Modify ASTLocation and apart from being a Decl or Stmt, allow it to also be:
-A NamedDecl reference
-A TypeLoc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83095 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index d3e3783..a2719f6 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -512,8 +512,8 @@
ASTLocation ALoc = ResolveLocationInAST(CXXUnit->getASTContext(), SLoc);
- Decl *Dcl = ALoc.getDecl();
- Stmt *Stm = ALoc.getStmt();
+ Decl *Dcl = ALoc.getParentDecl();
+ Stmt *Stm = ALoc.dyn_AsStmt();
if (Dcl) {
if (Stm) {
if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Stm)) {