diff options
Diffstat (limited to 'lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r-- | lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index d0760b9cc2a6..c164cec5d942 100644 --- a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -71,9 +71,8 @@ class PCHContainerGenerator : public ASTConsumer { } bool VisitImportDecl(ImportDecl *D) { - auto *Import = cast<ImportDecl>(D); - if (!Import->getImportedOwningModule()) - DI.EmitImportDecl(*Import); + if (!D->getImportedOwningModule()) + DI.EmitImportDecl(*D); return true; } @@ -229,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); @@ -286,7 +290,7 @@ public: else ASTSym->setSection("__clangast"); - DEBUG({ + LLVM_DEBUG({ // Print the IR for the PCH container to the debug output. llvm::SmallString<0> Buffer; clang::EmitBackendOutput( |