diff options
author | Adrian Prantl <aprantl@apple.com> | 2018-01-03 19:10:21 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2018-01-03 19:10:21 +0000 |
commit | c5e3647f3cc663d20d8285fa16aa48c44d08218c (patch) | |
tree | 0527086c8786639765352bb7036ba42ae718b863 /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | |
parent | 05d8f16aa41d78a384f37147ec639c54bd7dbd59 (diff) | |
download | llvm-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.cpp | 5 |
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); |