diff options
| -rw-r--r-- | clang/include/clang-c/Index.h | 20 | ||||
| -rw-r--r-- | clang/tools/CIndex/CIndex.exports | 2 | ||||
| -rw-r--r-- | clang/tools/CIndex/CIndexUSRs.cpp | 55 |
3 files changed, 0 insertions, 77 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index f1f36e57b7d..3b70eff4d73 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -54,7 +54,6 @@ typedef void *CXIndex; /* An indexing instance. */ typedef void *CXTranslationUnit; /* A translation unit instance. */ typedef void *CXFile; /* A source file */ -typedef void *CXDecl; /* A specific declaration within a translation unit. */ /* Cursors represent declarations, definitions, and references. */ enum CXCursorKind { @@ -219,12 +218,6 @@ typedef struct { void *data[3]; } CXCursor; -/* A unique token for looking up "visible" CXDecls from a CXTranslationUnit. */ -typedef struct { - CXIndex index; - void *data; -} CXEntity; - /** * For functions returning a string that might or might not need * to be internally allocated and freed. @@ -427,19 +420,6 @@ CINDEX_LINKAGE unsigned clang_visitChildren(CXTranslationUnit tu, CINDEX_LINKAGE const char *clang_getFileName(CXFile SFile); CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile); -/* - * CXEntity Operations. - */ - -/* clang_getDeclaration() maps from a CXEntity to the matching CXDecl (if any) - * in a specified translation unit. */ -CINDEX_LINKAGE CXDecl clang_getDeclaration(CXEntity, CXTranslationUnit); - -/* - * CXDecl Operations. - */ -CINDEX_LINKAGE CXEntity clang_getEntityFromDecl(CXIndex, CXDecl); - /** * \brief Identifies a specific source location within a translation * unit. diff --git a/clang/tools/CIndex/CIndex.exports b/clang/tools/CIndex/CIndex.exports index 05e3b61990e..7151dbe6918 100644 --- a/clang/tools/CIndex/CIndex.exports +++ b/clang/tools/CIndex/CIndex.exports @@ -20,9 +20,7 @@ _clang_getCursorLocation _clang_getCursorReferenced _clang_getCursorSpelling _clang_getCursorUSR -_clang_getDeclaration _clang_getDefinitionSpellingAndExtent -_clang_getEntityFromDecl _clang_getFileName _clang_getFileTime _clang_getInstantiationLocation diff --git a/clang/tools/CIndex/CIndexUSRs.cpp b/clang/tools/CIndex/CIndexUSRs.cpp index 4f43c50d141..e7f85290021 100644 --- a/clang/tools/CIndex/CIndexUSRs.cpp +++ b/clang/tools/CIndex/CIndexUSRs.cpp @@ -17,48 +17,6 @@ #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" -// Some notes on CXEntity: -// -// - Since the 'ordinary' namespace includes functions, data, typedefs, -// ObjC interfaces, thecurrent algorithm is a bit naive (resulting in one -// entity for 2 different types). For example: -// -// module1.m: @interface Foo @end Foo *x; -// module2.m: void Foo(int); -// -// - Since the unique name spans translation units, static data/functions -// within a CXTranslationUnit are *not* currently represented by entities. -// As a result, there will be no entity for the following: -// -// module.m: static void Foo() { } -// - -static inline Entity GetEntity(const CXEntity &E) { - return Entity::getFromOpaquePtr(E.data); -} - -static inline ASTUnit *GetTranslationUnit(CXTranslationUnit TU) { - return (ASTUnit*) TU; -} - -static inline ASTContext &GetASTContext(CXTranslationUnit TU) { - return GetTranslationUnit(TU)->getASTContext(); -} - -static inline CXEntity NullCXEntity() { - CXEntity CE; - CE.index = NULL; - CE.data = NULL; - return CE; -} - -static inline CXEntity MakeEntity(CXIndex CIdx, const Entity &E) { - CXEntity CE; - CE.index = CIdx; - CE.data = E.getAsOpaquePtr(); - return CE; -} - static inline Program &GetProgram(CXIndex CIdx) { return ((CIndexer*) CIdx)->getProgram(); } @@ -215,19 +173,6 @@ static CXString ConstructUSR(Decl *D) { extern "C" { -/// clang_getDeclaration() maps from a CXEntity to the matching CXDecl (if any) -/// in a specified translation unit. -CXDecl clang_getDeclaration(CXEntity CE, CXTranslationUnit TU) { - return (CXDecl) GetEntity(CE).getDecl(GetASTContext(TU)); -} - - -CXEntity clang_getEntityFromDecl(CXIndex CIdx, CXDecl CE) { - if (Decl *D = (Decl *) CE) - return MakeEntity(CIdx, Entity::get(D, GetProgram(CIdx))); - return NullCXEntity(); -} - CXString clang_getCursorUSR(CXCursor C) { if (Decl *D = cxcursor::getCursorDecl(C)) return ConstructUSR(D); |

