forked from OSchip/llvm-project
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
This commit is contained in:
parent
992d820e30
commit
335f5c7e3e
|
@ -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();
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
}
|
||||
+ classMethod;
|
||||
- instanceMethodWithInt:(int)i;
|
||||
- (struct OpaqueData*) getSomethingOpaque;
|
||||
@property int property;
|
||||
@end
|
||||
|
||||
|
|
|
@ -41,3 +41,6 @@
|
|||
// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type,
|
||||
// MODULE-CHECK-SAME: name: "ObjCClass",
|
||||
// MODULE-CHECK-SAME: scope: ![[MODULE]],
|
||||
|
||||
// The forward declaration should not be in the module scope.
|
||||
// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OpaqueData", file
|
||||
|
|
Loading…
Reference in New Issue