forked from OSchip/llvm-project
Improve source-location information for implicitly-generated member call expressions
llvm-svn: 86989
This commit is contained in:
parent
91cd960d50
commit
ef986e8fc3
|
@ -95,6 +95,8 @@ public:
|
|||
/// operation would return "x".
|
||||
Expr *getImplicitObjectArgument();
|
||||
|
||||
virtual SourceRange getSourceRange() const;
|
||||
|
||||
static bool classof(const Stmt *T) {
|
||||
return T->getStmtClass() == CXXMemberCallExprClass;
|
||||
}
|
||||
|
|
|
@ -323,6 +323,14 @@ Expr *CXXMemberCallExpr::getImplicitObjectArgument() {
|
|||
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
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -2120,7 +2120,7 @@ CXXMemberCallExpr *Sema::BuildCXXMemberCallExpr(Expr *Exp,
|
|||
CXXMemberCallExpr *CE =
|
||||
new (Context) CXXMemberCallExpr(Context, ME, 0, 0,
|
||||
ResultType,
|
||||
SourceLocation());
|
||||
Exp->getLocEnd());
|
||||
return CE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue