aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-01-03 19:10:21 +0000
committerAdrian Prantl <aprantl@apple.com>2018-01-03 19:10:21 +0000
commitc5e3647f3cc663d20d8285fa16aa48c44d08218c (patch)
tree0527086c8786639765352bb7036ba42ae718b863 /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
parent05d8f16aa41d78a384f37147ec639c54bd7dbd59 (diff)
downloadllvm-c5e3647f3cc663d20d8285fa16aa48c44d08218c.zip
llvm-c5e3647f3cc663d20d8285fa16aa48c44d08218c.tar.gz
llvm-c5e3647f3cc663d20d8285fa16aa48c44d08218c.tar.bz2
-gmodules: Emit debug info for implicit module imports via #include.
When a type is only used as a template parameter and that type is the only type imported from another #include'd module, no skeleton CU for that module is generated, so a consumer doesn't know where to find the type definition. By emitting an import declaration, we can force a skeleton CU to be generated for each imported module. rdar://problem/36266156 llvm-svn: 321754
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r--clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
index cb695e7..150b64f 100644
--- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
+++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
@@ -228,6 +228,11 @@ public:
Builder->getModuleDebugInfo()->completeRequiredType(RD);
}
+ void HandleImplicitImportDecl(ImportDecl *D) override {
+ if (!D->getImportedOwningModule())
+ Builder->getModuleDebugInfo()->EmitImportDecl(*D);
+ }
+
/// Emit a container holding the serialized AST.
void HandleTranslationUnit(ASTContext &Ctx) override {
assert(M && VMContext && Builder);