[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
diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp
index c4fba96..efae7ee 100644
--- a/tools/libclang/Indexing.cpp
+++ b/tools/libclang/Indexing.cpp
@@ -73,6 +73,12 @@
                                   StringRef SearchPath,
                                   StringRef RelativePath,
                                   const Module *Imported) {
+    if (Imported) {
+      IndexCtx.importedModule(HashLoc, FileName, /*isIncludeDirective=*/true,
+                              Imported);
+      return;
+    }
+
     bool isImport = (IncludeTok.is(tok::identifier) &&
             IncludeTok.getIdentifierInfo()->getPPKeywordID() == tok::pp_import);
     IndexCtx.ppIncludedFile(HashLoc, FileName, File, isImport, IsAngled);