diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-01-05 22:06:45 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-01-05 22:06:45 +0000 |
| commit | 9cd9f6d861a05d9663039a5c2c91ecb8200de411 (patch) | |
| tree | cd8cd819ec258be36ecd9203182147d04e278715 /clang | |
| parent | f88dd5ed64c83cab98ada56fc99a2c73180791aa (diff) | |
| download | bcm5719-llvm-9cd9f6d861a05d9663039a5c2c91ecb8200de411.tar.gz bcm5719-llvm-9cd9f6d861a05d9663039a5c2c91ecb8200de411.zip | |
Split (mostly nonexistent) USR code out from the main CIndex logic.
llvm-svn: 92789
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang-c/Index.h | 4 | ||||
| -rw-r--r-- | clang/tools/CIndex/CIndex.cpp | 29 | ||||
| -rw-r--r-- | clang/tools/CIndex/CIndex.exports | 2 | ||||
| -rw-r--r-- | clang/tools/CIndex/CIndexUSRs.cpp | 46 | ||||
| -rw-r--r-- | clang/tools/CIndex/CMakeLists.txt | 4 |
5 files changed, 52 insertions, 33 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 03b4df12596..8ff9f04dc8d 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -322,8 +322,8 @@ CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile); * CXEntity Operations. */ CINDEX_LINKAGE const char *clang_getDeclarationName(CXEntity); -CINDEX_LINKAGE const char *clang_getURI(CXEntity); -CINDEX_LINKAGE CXEntity clang_getEntity(const char *URI); +CINDEX_LINKAGE const char *clang_getUSR(CXEntity); +CINDEX_LINKAGE CXEntity clang_getEntity(const char *USR); /* * CXDecl Operations. */ diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp index 01a4cdd0ae8..7b624e6dd3f 100644 --- a/clang/tools/CIndex/CIndex.cpp +++ b/clang/tools/CIndex/CIndex.cpp @@ -529,35 +529,6 @@ void clang_loadDeclaration(CXDecl Dcl, DVisit.Visit(static_cast<Decl *>(Dcl)); } -// 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() { } -// - - -const char *clang_getDeclarationName(CXEntity) { - return ""; -} - -const char *clang_getURI(CXEntity) { - return ""; -} - -CXEntity clang_getEntity(const char *URI) { - return 0; -} - // // CXDecl Operations. // diff --git a/clang/tools/CIndex/CIndex.exports b/clang/tools/CIndex/CIndex.exports index e925df945d0..2548c829409 100644 --- a/clang/tools/CIndex/CIndex.exports +++ b/clang/tools/CIndex/CIndex.exports @@ -35,7 +35,7 @@ _clang_getFileTime _clang_getNullCursor _clang_getNumCompletionChunks _clang_getTranslationUnitSpelling -_clang_getURI +_clang_getUSR _clang_isDeclaration _clang_isDefinition _clang_isInvalid diff --git a/clang/tools/CIndex/CIndexUSRs.cpp b/clang/tools/CIndex/CIndexUSRs.cpp new file mode 100644 index 00000000000..40f93cd323a --- /dev/null +++ b/clang/tools/CIndex/CIndexUSRs.cpp @@ -0,0 +1,46 @@ +//===- CIndexUSR.cpp - Clang-C Source Indexing Library --------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the generation and use of USRs from CXEntities. +// +//===----------------------------------------------------------------------===// + +#include "CIndexer.h" + +extern "C" { + +// 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() { } +// + +const char *clang_getDeclarationName(CXEntity) { + return ""; +} + +const char *clang_getUSR(CXEntity) { + return ""; +} + +CXEntity clang_getEntity(const char *URI) { + return 0; +} + +} // end extern "C" diff --git a/clang/tools/CIndex/CMakeLists.txt b/clang/tools/CIndex/CMakeLists.txt index ff3f4db2f43..52f847ef17d 100644 --- a/clang/tools/CIndex/CMakeLists.txt +++ b/clang/tools/CIndex/CMakeLists.txt @@ -21,8 +21,10 @@ set( LLVM_LINK_COMPONENTS add_clang_library(CIndex CIndex.cpp + CIndexCodeCompletion.cpp + CIndexUSRs.cpp CIndexer.cpp - CIndexCodeCompletion) +) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # FIXME: Deal with LLVM_SUBMIT_VERSION? |

