diff options
| author | Fangrui Song <maskray@google.com> | 2018-11-20 08:00:00 +0000 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2018-11-20 08:00:00 +0000 |
| commit | cabb36d38d9e71610c7767a22477576aa8a4d9fa (patch) | |
| tree | 83a7fb26d29d77f774c462ca2b73b444c2317795 /clang/tools/libclang/CXCursor.h | |
| parent | c733c7bf94f8eecbe8de9e36d0c8f0c078530cba (diff) | |
| download | bcm5719-llvm-cabb36d38d9e71610c7767a22477576aa8a4d9fa.tar.gz bcm5719-llvm-cabb36d38d9e71610c7767a22477576aa8a4d9fa.zip | |
[libclang] Unify getCursorDecl and getCursorParentDecl
They do the same thing, thus the latter (which has only 2 call sites) can be deleted.
llvm-svn: 347293
Diffstat (limited to 'clang/tools/libclang/CXCursor.h')
| -rw-r--r-- | clang/tools/libclang/CXCursor.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/tools/libclang/CXCursor.h b/clang/tools/libclang/CXCursor.h index a5d9fff2a55..312fb3ff250 100644 --- a/clang/tools/libclang/CXCursor.h +++ b/clang/tools/libclang/CXCursor.h @@ -43,11 +43,11 @@ class TemplateName; class TypeDecl; class VarDecl; class IdentifierInfo; - + namespace cxcursor { CXCursor getCursor(CXTranslationUnit, SourceLocation); - + CXCursor MakeCXCursor(const clang::Attr *A, const clang::Decl *Parent, CXTranslationUnit TU); CXCursor MakeCXCursor(const clang::Decl *D, CXTranslationUnit TU, @@ -125,7 +125,7 @@ std::pair<const VarDecl *, SourceLocation> getCursorVariableRef(CXCursor C); /// Create a reference to a field at the given location. CXCursor MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc, CXTranslationUnit TU); - + /// Unpack a MemberRef cursor into the field it references and the /// location where the reference occurred. std::pair<const FieldDecl *, SourceLocation> getCursorMemberRef(CXCursor C); @@ -232,17 +232,16 @@ CXCursor MakeCursorOverloadedDeclRef(TemplateName Template, typedef llvm::PointerUnion3<const OverloadExpr *, const Decl *, OverloadedTemplateStorage *> OverloadedDeclRefStorage; - + /// Unpack an overloaded declaration reference into an expression, /// declaration, or template name along with the source location. std::pair<OverloadedDeclRefStorage, SourceLocation> getCursorOverloadedDeclRef(CXCursor C); - + const Decl *getCursorDecl(CXCursor Cursor); const Expr *getCursorExpr(CXCursor Cursor); const Stmt *getCursorStmt(CXCursor Cursor); const Attr *getCursorAttr(CXCursor Cursor); -const Decl *getCursorParentDecl(CXCursor Cursor); ASTContext &getCursorContext(CXCursor Cursor); ASTUnit *getCursorASTUnit(CXCursor Cursor); @@ -250,14 +249,14 @@ CXTranslationUnit getCursorTU(CXCursor Cursor); void getOverriddenCursors(CXCursor cursor, SmallVectorImpl<CXCursor> &overridden); - + /// Create an opaque pool used for fast generation of overridden /// CXCursor arrays. void *createOverridenCXCursorsPool(); /// Dispose of the overridden CXCursors pool. void disposeOverridenCXCursorsPool(void *pool); - + /// Returns a index/location pair for a selector identifier if the cursor /// points to one. std::pair<int, SourceLocation> getSelectorIdentifierIndexAndLoc(CXCursor); @@ -285,7 +284,7 @@ CXCursor getTypeRefCursor(CXCursor cursor); bool getDeclCursorUSR(const Decl *D, SmallVectorImpl<char> &Buf); bool operator==(CXCursor X, CXCursor Y); - + inline bool operator!=(CXCursor X, CXCursor Y) { return !(X == Y); } |

