[cfe-commits] r86989 - in /cfe/trunk: include/clang/AST/ExprCXX.h lib/AST/ExprCXX.cpp lib/Sema/SemaExprCXX.cpp
Douglas Gregor
dgregor at apple.com
Thu Nov 12 07:31:47 PST 2009
Author: dgregor
Date: Thu Nov 12 09:31:47 2009
New Revision: 86989
URL: http://llvm.org/viewvc/llvm-project?rev=86989&view=rev
Log:
Improve source-location information for implicitly-generated member call expressions
Modified:
cfe/trunk/include/clang/AST/ExprCXX.h
cfe/trunk/lib/AST/ExprCXX.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=86989&r1=86988&r2=86989&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Thu Nov 12 09:31:47 2009
@@ -95,6 +95,8 @@
/// operation would return "x".
Expr *getImplicitObjectArgument();
+ virtual SourceRange getSourceRange() const;
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == CXXMemberCallExprClass;
}
Modified: cfe/trunk/lib/AST/ExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=86989&r1=86988&r2=86989&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprCXX.cpp (original)
+++ cfe/trunk/lib/AST/ExprCXX.cpp Thu Nov 12 09:31:47 2009
@@ -323,6 +323,14 @@
return 0;
}
+SourceRange CXXMemberCallExpr::getSourceRange() const {
+ SourceLocation LocStart = getCallee()->getLocStart();
+ if (LocStart.isInvalid() && getNumArgs() > 0)
+ LocStart = getArg(0)->getLocStart();
+ return SourceRange(LocStart, getRParenLoc());
+}
+
+
//===----------------------------------------------------------------------===//
// Named casts
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=86989&r1=86988&r2=86989&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Thu Nov 12 09:31:47 2009
@@ -2120,7 +2120,7 @@
CXXMemberCallExpr *CE =
new (Context) CXXMemberCallExpr(Context, ME, 0, 0,
ResultType,
- SourceLocation());
+ Exp->getLocEnd());
return CE;
}
More information about the cfe-commits
mailing list