completeRequiredType(RD);
}
-void CGDebugInfo::completeRequiredType(const RecordDecl *RD) {
- if (DebugKind <= codegenoptions::DebugLineTablesOnly)
- return;
-
- // If this is a dynamic class and we're emitting limited debug info, wait
- // until the vtable is emitted to complete the class debug info.
- if (DebugKind <= codegenoptions::LimitedDebugInfo) {
- if (const auto *CXXDecl = dyn_cast<CXXRecordDecl>(RD))
- if (CXXDecl->isDynamicClass())
- return;
- }
-
- if (DebugTypeExtRefs && RD->isFromASTFile())
- return;
-
- QualType Ty = CGM.getContext().getRecordType(RD);
- llvm::DIType *T = getTypeOrNull(Ty);
- if (T && T->isForwardDecl())
- completeClassData(RD);
-}
-
void CGDebugInfo::completeClassData(const RecordDecl *RD) {
if (DebugKind <= codegenoptions::DebugLineTablesOnly)
return;
return false;
}
+void CGDebugInfo::completeRequiredType(const RecordDecl *RD) {
+ if (shouldOmitDefinition(DebugKind, DebugTypeExtRefs, RD, CGM.getLangOpts()))
+ return;
+
+ QualType Ty = CGM.getContext().getRecordType(RD);
+ llvm::DIType *T = getTypeOrNull(Ty);
+ if (T && T->isForwardDecl())
+ completeClassData(RD);
+}
+
llvm::DIType *CGDebugInfo::CreateType(const RecordType *Ty) {
RecordDecl *RD = Ty->getDecl();
llvm::DIType *T = cast_or_null<llvm::DIType>(getTypeOrNull(QualType(Ty, 0)));
// be imported from a DLL. Otherwise, the debugger wouldn't be able to show the
// members.
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ImportedAfterCompletion",
+// CHECK-NOT: DIFlagFwdDecl
+// CHECK-SAME: ){{$}}
+
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OutOfLineCtor",
// CHECK-SAME: DIFlagFwdDecl
// CHECK-SAME: ){{$}}
// CHECK-NOT: DIFlagFwdDecl
// CHECK-SAME: ){{$}}
+
+struct ImportedAfterCompletion;
+ImportedAfterCompletion *force_fwd_decl;
+struct __declspec(dllimport) ImportedAfterCompletion {
+ virtual ~ImportedAfterCompletion();
+};
+
struct OutOfLineCtor {
OutOfLineCtor();
virtual void Foo();
};
int main() {
+ ImportedAfterCompletion c;
OutOfLineCtor o;
DerivedFromImported d;
ImportedMethod m;