aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-01-08 17:11:32 +0000
committerTed Kremenek <kremenek@apple.com>2010-01-08 17:11:32 +0000
commit6ab9db10c5f89d1db230d227f67ff18f55608e27 (patch)
treee8d4d9b2cd682b73aa2b1419bceebd3b9662efeb
parent81201626aa08bcc9d05c8b3c6a1d38a7d577c3ce (diff)
For now, add back clang_getDeclSource().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93003 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang-c/Index.h1
-rw-r--r--tools/CIndex/CIndex.cpp7
-rw-r--r--tools/CIndex/CIndex.exports1
3 files changed, 9 insertions, 0 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 12dd76850b..1c8da3077c 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -332,6 +332,7 @@ CINDEX_LINKAGE CXEntity clang_getEntityFromDecl(CXDecl);
CINDEX_LINKAGE CXString clang_getDeclSpelling(CXDecl);
CINDEX_LINKAGE unsigned clang_getDeclLine(CXDecl);
CINDEX_LINKAGE unsigned clang_getDeclColumn(CXDecl);
+CINDEX_LINKAGE const char *clang_getDeclSource(CXDecl); /* deprecate */
CINDEX_LINKAGE CXFile clang_getDeclSourceFile(CXDecl);
typedef struct CXSourceLineColumn {
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index 28a86e72be..19e82fc36f 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -718,6 +718,13 @@ CXDeclExtent clang_getDeclExtent(CXDecl AnonDecl) {
return extent;
}
+const char *clang_getDeclSource(CXDecl AnonDecl) {
+ assert(AnonDecl && "Passed null CXDecl");
+ FileEntry *FEnt = static_cast<FileEntry *>(clang_getDeclSourceFile(AnonDecl));
+ assert(FEnt && "Cannot find FileEntry for Decl");
+ return clang_getFileName(FEnt);
+}
+
static const FileEntry *getFileEntryFromSourceLocation(SourceManager &SMgr,
SourceLocation SLoc) {
FileID FID;
diff --git a/tools/CIndex/CIndex.exports b/tools/CIndex/CIndex.exports
index 4feab15482..3326087f9e 100644
--- a/tools/CIndex/CIndex.exports
+++ b/tools/CIndex/CIndex.exports
@@ -25,6 +25,7 @@ _clang_getDeclColumn
_clang_getDeclExtent
_clang_getDeclLine
_clang_getDeclExtent
+_clang_getDeclSource
_clang_getDeclSourceFile
_clang_getDeclSpelling
_clang_getDeclarationName