From a0fb00f9837bd0d2e5948f16f6a6b82a7a628f51 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 26 Feb 2011 22:09:03 +0000 Subject: Vendor import of clang trunk r126547: http://llvm.org/svn/llvm-project/cfe/trunk@126547 --- lib/AST/Expr.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/AST/Expr.cpp') diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 391b26a..1c1061b 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -836,6 +836,19 @@ QualType CallExpr::getCallReturnType() const { return FnType->getResultType(); } +SourceRange CallExpr::getSourceRange() const { + if (isa(this)) + return cast(this)->getSourceRange(); + + SourceLocation begin = getCallee()->getLocStart(); + if (begin.isInvalid() && getNumArgs() > 0) + begin = getArg(0)->getLocStart(); + SourceLocation end = getRParenLoc(); + if (end.isInvalid() && getNumArgs() > 0) + end = getArg(getNumArgs() - 1)->getLocEnd(); + return SourceRange(begin, end); +} + OffsetOfExpr *OffsetOfExpr::Create(ASTContext &C, QualType type, SourceLocation OperatorLoc, TypeSourceInfo *tsi, -- cgit v1.1