diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-02 16:10:38 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-02 16:10:38 +0000 |
commit | 472eda06b00f4963dcdeb3e4417d2f2176e85c21 (patch) | |
tree | b5b1939f7d983f9db117ecc65f4accac1ca35b20 /clang/tools/libclang/IndexingContext.cpp | |
parent | bc2724f6e044f486ba167a2a3fa32aff4d9def4e (diff) | |
download | bcm5719-llvm-472eda06b00f4963dcdeb3e4417d2f2176e85c21.tar.gz bcm5719-llvm-472eda06b00f4963dcdeb3e4417d2f2176e85c21.zip |
[libclang] Implement the importedASTFile indexing callback to provide
info about imported modules.
llvm-svn: 165020
Diffstat (limited to 'clang/tools/libclang/IndexingContext.cpp')
-rw-r--r-- | clang/tools/libclang/IndexingContext.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp index 210dc36d522..3a3c010370b 100644 --- a/clang/tools/libclang/IndexingContext.cpp +++ b/clang/tools/libclang/IndexingContext.cpp @@ -253,6 +253,27 @@ void IndexingContext::ppIncludedFile(SourceLocation hashLoc, FileMap[File] = idxFile; } +void IndexingContext::importedModule(SourceLocation Loc, + StringRef name, bool isIncludeDirective, + const Module *module) { + if (!CB.importedASTFile) + return; + + std::string ModuleName = module->getFullModuleName(); + + ScratchAlloc SA(*this); + CXIdxImportedASTFileInfo Info = { + (CXFile)module->getASTFile(), + getIndexLoc(Loc), + /*isModule=*/true, + isIncludeDirective, + SA.toCStr(name), + ModuleName.c_str(), + }; + CXIdxClientASTFile astFile = CB.importedASTFile(ClientData, &Info); + (void)astFile; +} + void IndexingContext::startedTranslationUnit() { CXIdxClientContainer idxCont = 0; if (CB.startedTranslationUnit) |