diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-02-26 22:09:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-02-26 22:09:03 +0000 |
commit | c3b054d250cdca485c71845089c316e10610ebad (patch) | |
tree | abae0246ec9156cc1a7cbb947b2b0dfe95fa3189 /lib/AST/Expr.cpp | |
parent | bca07a4524feb4edec581062d631a13116320a24 (diff) |
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 391b26ab48ea5..1c1061b5a2296 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<CXXOperatorCallExpr>(this)) + return cast<CXXOperatorCallExpr>(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, |