Add IsImplicit field in ObjCMessageExpr that is true when the message
was constructed, e.g. for a property access.
This allows the selector identifier locations machinery for ObjCMessageExpr
to function correctly, in that there are not real locations to handle/report for
such a message.
llvm-svn: 148013
diff --git a/clang/tools/libclang/IndexBody.cpp b/clang/tools/libclang/IndexBody.cpp
index bac7e02..177cad7 100644
--- a/clang/tools/libclang/IndexBody.cpp
+++ b/clang/tools/libclang/IndexBody.cpp
@@ -10,7 +10,6 @@
#include "IndexingContext.h"
#include "clang/AST/RecursiveASTVisitor.h"
-#include "clang/Analysis/Support/SaveAndRestore.h"
using namespace clang;
using namespace cxindex;
@@ -21,14 +20,12 @@
IndexingContext &IndexCtx;
const NamedDecl *Parent;
const DeclContext *ParentDC;
- bool InPseudoObject;
typedef RecursiveASTVisitor<BodyIndexer> base;
public:
BodyIndexer(IndexingContext &indexCtx,
const NamedDecl *Parent, const DeclContext *DC)
- : IndexCtx(indexCtx), Parent(Parent), ParentDC(DC),
- InPseudoObject(false) { }
+ : IndexCtx(indexCtx), Parent(Parent), ParentDC(DC) { }
bool shouldWalkTypesOfTypeLocs() const { return false; }
@@ -62,8 +59,8 @@
if (ObjCMethodDecl *MD = E->getMethodDecl())
IndexCtx.handleReference(MD, E->getSelectorStartLoc(),
Parent, ParentDC, E,
- InPseudoObject ? CXIdxEntityRef_Implicit
- : CXIdxEntityRef_Direct);
+ E->isImplicit() ? CXIdxEntityRef_Implicit
+ : CXIdxEntityRef_Direct);
return true;
}
@@ -82,11 +79,6 @@
return true;
}
- bool TraversePseudoObjectExpr(PseudoObjectExpr *E) {
- SaveAndRestore<bool> InPseudo(InPseudoObject, true);
- return base::TraversePseudoObjectExpr(E);
- }
-
bool VisitCXXConstructExpr(CXXConstructExpr *E) {
IndexCtx.handleReference(E->getConstructor(), E->getLocation(),
Parent, ParentDC, E);