[cfe-commits] r134104 - in /cfe/trunk/tools/libclang: CIndex.cpp CXCursor.cpp CXCursor.h
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Jun 29 15:20:07 PDT 2011
Author: akirtzidis
Date: Wed Jun 29 17:20:07 2011
New Revision: 134104
URL: http://llvm.org/viewvc/llvm-project?rev=134104&view=rev
Log:
[libclang] Introduce cxcursor::getCursorParentDecl(CXCursor Cursor) and use it at the appropriate place in CIndex.cpp
No functionality change.
Modified:
cfe/trunk/tools/libclang/CIndex.cpp
cfe/trunk/tools/libclang/CXCursor.cpp
cfe/trunk/tools/libclang/CXCursor.h
Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=134104&r1=134103&r2=134104&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Wed Jun 29 17:20:07 2011
@@ -4658,7 +4658,7 @@
// 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() &&
Modified: cfe/trunk/tools/libclang/CXCursor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=134104&r1=134103&r2=134104&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXCursor.cpp (original)
+++ cfe/trunk/tools/libclang/CXCursor.cpp Wed Jun 29 17:20:07 2011
@@ -484,6 +484,10 @@
return (Attr *)Cursor.data[1];
}
+Decl *cxcursor::getCursorParentDecl(CXCursor Cursor) {
+ return (Decl *)Cursor.data[0];
+}
+
ASTContext &cxcursor::getCursorContext(CXCursor Cursor) {
return getCursorASTUnit(Cursor)->getASTContext();
}
Modified: cfe/trunk/tools/libclang/CXCursor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.h?rev=134104&r1=134103&r2=134104&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXCursor.h (original)
+++ cfe/trunk/tools/libclang/CXCursor.h Wed Jun 29 17:20:07 2011
@@ -184,6 +184,7 @@
Expr *getCursorExpr(CXCursor Cursor);
Stmt *getCursorStmt(CXCursor Cursor);
Attr *getCursorAttr(CXCursor Cursor);
+Decl *getCursorParentDecl(CXCursor Cursor);
ASTContext &getCursorContext(CXCursor Cursor);
ASTUnit *getCursorASTUnit(CXCursor Cursor);
More information about the cfe-commits
mailing list