forked from OSchip/llvm-project
[libclang] Introduce cxcursor::getCursorParentDecl(CXCursor Cursor) and use it at the appropriate place in CIndex.cpp
No functionality change. llvm-svn: 134104
This commit is contained in:
parent
e379ee31c0
commit
8bb2ecf32d
|
@ -4658,7 +4658,7 @@ AnnotateTokensWorker::Visit(CXCursor cursor, CXCursor parent) {
|
|||
// MyCXXClass foo; // Make sure we don't annotate 'foo' as a CallExpr cursor.
|
||||
if (clang_isExpression(cursorK)) {
|
||||
Expr *E = getCursorExpr(cursor);
|
||||
if (Decl *D = getCursorDecl(cursor)) {
|
||||
if (Decl *D = getCursorParentDecl(cursor)) {
|
||||
const unsigned I = NextToken();
|
||||
if (E->getLocStart().isValid() && D->getLocation().isValid() &&
|
||||
E->getLocStart() == D->getLocation() &&
|
||||
|
|
|
@ -484,6 +484,10 @@ Attr *cxcursor::getCursorAttr(CXCursor Cursor) {
|
|||
return (Attr *)Cursor.data[1];
|
||||
}
|
||||
|
||||
Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
|
||||
return (Decl *)Cursor.data[0];
|
||||
}
|
||||
|
||||
ASTContext &cxcursor::getCursorContext(CXCursor Cursor) {
|
||||
return getCursorASTUnit(Cursor)->getASTContext();
|
||||
}
|
||||
|
|
|
@ -184,6 +184,7 @@ Decl *getCursorDecl(CXCursor Cursor);
|
|||
Expr *getCursorExpr(CXCursor Cursor);
|
||||
Stmt *getCursorStmt(CXCursor Cursor);
|
||||
Attr *getCursorAttr(CXCursor Cursor);
|
||||
Decl *getCursorParentDecl(CXCursor Cursor);
|
||||
|
||||
ASTContext &getCursorContext(CXCursor Cursor);
|
||||
ASTUnit *getCursorASTUnit(CXCursor Cursor);
|
||||
|
|
Loading…
Reference in New Issue