[cfe-commits] r93003 - in /cfe/trunk: include/clang-c/Index.h tools/CIndex/CIndex.cpp tools/CIndex/CIndex.exports
Ted Kremenek
kremenek at apple.com
Fri Jan 8 09:11:32 PST 2010
Author: kremenek
Date: Fri Jan 8 11:11:32 2010
New Revision: 93003
URL: http://llvm.org/viewvc/llvm-project?rev=93003&view=rev
Log:
For now, add back clang_getDeclSource().
Modified:
cfe/trunk/include/clang-c/Index.h
cfe/trunk/tools/CIndex/CIndex.cpp
cfe/trunk/tools/CIndex/CIndex.exports
Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=93003&r1=93002&r2=93003&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Fri Jan 8 11:11:32 2010
@@ -332,6 +332,7 @@
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 {
Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=93003&r1=93002&r2=93003&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Fri Jan 8 11:11:32 2010
@@ -718,6 +718,13 @@
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;
Modified: cfe/trunk/tools/CIndex/CIndex.exports
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.exports?rev=93003&r1=93002&r2=93003&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.exports (original)
+++ cfe/trunk/tools/CIndex/CIndex.exports Fri Jan 8 11:11:32 2010
@@ -25,6 +25,7 @@
_clang_getDeclExtent
_clang_getDeclLine
_clang_getDeclExtent
+_clang_getDeclSource
_clang_getDeclSourceFile
_clang_getDeclSpelling
_clang_getDeclarationName
More information about the cfe-commits
mailing list