[libclang] Introduce clang_Module_getASTFile function that returns the module file where a module object came from.
rdar://13743084
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180643 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 0a8a068..a43c1ab 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -6055,6 +6055,13 @@
return 0;
}
+CXFile clang_Module_getASTFile(CXModule CXMod) {
+ if (!CXMod)
+ return 0;
+ Module *Mod = static_cast<Module*>(CXMod);
+ return const_cast<FileEntry *>(Mod->getASTFile());
+}
+
CXModule clang_Module_getParent(CXModule CXMod) {
if (!CXMod)
return 0;