summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-10-02 17:36:14 +0000
committerAdrian Prantl <aprantl@apple.com>2015-10-02 17:36:14 +0000
commit335f5c7e3e2f69aee8b84a31c948f244c17b9755 (patch)
tree7bb294b0f32c70ca0ddd17a91ba5f4dc13f631c3 /clang/lib/CodeGen/CGDebugInfo.cpp
parent992d820e30e55ae3ccdc71d99e8699e5f9d109a3 (diff)
downloadbcm5719-llvm-335f5c7e3e2f69aee8b84a31c948f244c17b9755.tar.gz
bcm5719-llvm-335f5c7e3e2f69aee8b84a31c948f244c17b9755.zip
Module debugging: Don't emit forward declarations in module scopes.
A forward declaration inside a module header does not belong to the module. llvm-svn: 249157
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 388cbd91a15..4a5c16e2197 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2172,6 +2172,9 @@ ObjCInterfaceDecl *CGDebugInfo::getObjCInterfaceDecl(QualType Ty) {
}
llvm::DIModule *CGDebugInfo::getParentModuleOrNull(const Decl *D) {
+ // A forward declaration inside a module header does not belong to the module.
+ if (isa<RecordDecl>(D) && !cast<RecordDecl>(D)->getDefinition())
+ return nullptr;
if (DebugTypeExtRefs && D->isFromASTFile()) {
// Record a reference to an imported clang module or precompiled header.
auto *Reader = CGM.getContext().getExternalSource();
OpenPOWER on IntegriCloud