]> granicus.if.org Git - clang/commitdiff
Split (mostly nonexistent) USR code out from the main CIndex logic.
authorTed Kremenek <kremenek@apple.com>
Tue, 5 Jan 2010 22:06:45 +0000 (22:06 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 5 Jan 2010 22:06:45 +0000 (22:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92789 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang-c/Index.h
tools/CIndex/CIndex.cpp
tools/CIndex/CIndex.exports
tools/CIndex/CIndexUSRs.cpp [new file with mode: 0644]
tools/CIndex/CMakeLists.txt

index 03b4df12596a28d0fc0ef3a47d7f490fd71d43a0..8ff9f04dc8d72c0f0b03b62ad6c2ec00850141d2 100644 (file)
@@ -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.
  */
index 01a4cdd0ae8625b65912660e732f8f75ad413141..7b624e6dd3f30e606c296274742916f1ae8ac5b1 100644 (file)
@@ -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.
 //
index e925df945d069922f6df0d38378c65762a1a2661..2548c829409d67ee9931edcf97bedd0df3160265 100644 (file)
@@ -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/tools/CIndex/CIndexUSRs.cpp b/tools/CIndex/CIndexUSRs.cpp
new file mode 100644 (file)
index 0000000..40f93cd
--- /dev/null
@@ -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"
index ff3f4db2f437f8bc6dea4612243f9782d81a97df..52f847ef17dae8c89a0a91467f8559e37b70a750 100644 (file)
@@ -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?