Add clang_getDeclSource().
llvm-svn: 82807
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index 74b3cfd..ff0be0d 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/tools/CIndex/CIndex.cpp
@@ -370,6 +370,14 @@
return SourceMgr.getSpellingLineNumber(ND->getLocation());
}
+const char *clang_getDeclSource(CXDecl AnonDecl)
+{
+ assert(AnonDecl && "Passed null CXDecl");
+ NamedDecl *ND = static_cast<NamedDecl *>(AnonDecl);
+ SourceManager &SourceMgr = ND->getASTContext().getSourceManager();
+ return SourceMgr.getBufferName(ND->getLocation());
+}
+
const char *clang_getCursorSpelling(CXCursor C)
{
assert(C.decl && "CXCursor has null decl");