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 | 2c3e05c266de0d4c465b58ffd129bd0b31604368 (patch) | |
tree | 208f2ff0a3e8f8bdf812c4774e5e4512b90005c6 /tools/libclang/IndexDecl.cpp | |
parent | d44e43e46f81cc83b8f1e4384724a9923426bb2a (diff) |
[libclang] Implement the importedASTFile indexing callback to provide
info about imported modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/IndexDecl.cpp')
-rw-r--r-- | tools/libclang/IndexDecl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/libclang/IndexDecl.cpp b/tools/libclang/IndexDecl.cpp index 53a98f111c..65b0b16a37 100644 --- a/tools/libclang/IndexDecl.cpp +++ b/tools/libclang/IndexDecl.cpp @@ -10,6 +10,7 @@ #include "IndexingContext.h" #include "clang/AST/DeclVisitor.h" +#include "clang/Basic/Module.h" using namespace clang; using namespace cxindex; @@ -305,6 +306,14 @@ public: IndexCtx.indexTypeSourceInfo(D->getTemplatedDecl()->getTypeSourceInfo(), D); return true; } + + bool VisitImportDecl(ImportDecl *D) { + Module *Imported = D->getImportedModule(); + if (Imported) + IndexCtx.importedModule(D->getLocation(), Imported->getFullModuleName(), + /*isIncludeDirective=*/false, Imported); + return true; + } }; } // anonymous namespace |