summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp21
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.h2
-rw-r--r--clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp2
-rw-r--r--clang/test/CodeGenCXX/debug-info-ms-abi.cpp17
-rw-r--r--clang/test/Modules/ModuleDebugInfo.cpp6
5 files changed, 12 insertions, 36 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 9763e9b51a8..5e9d73f082f 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1090,14 +1090,6 @@ void CGDebugInfo::CollectRecordNormalField(
elements.push_back(FieldType);
}
-void CGDebugInfo::CollectRecordNestedRecord(
- const RecordDecl *RD, SmallVectorImpl<llvm::Metadata *> &elements) {
- QualType Ty = CGM.getContext().getTypeDeclType(RD);
- SourceLocation Loc = RD->getLocation();
- llvm::DIType *nestedType = getOrCreateType(Ty, getOrCreateFile(Loc));
- elements.push_back(nestedType);
-}
-
void CGDebugInfo::CollectRecordFields(
const RecordDecl *record, llvm::DIFile *tunit,
SmallVectorImpl<llvm::Metadata *> &elements,
@@ -1109,10 +1101,6 @@ void CGDebugInfo::CollectRecordFields(
else {
const ASTRecordLayout &layout = CGM.getContext().getASTRecordLayout(record);
- // Debug info for nested records is included in the member list only for
- // CodeView.
- bool IncludeNestedRecords = CGM.getCodeGenOpts().EmitCodeView;
-
// Field number for non-static fields.
unsigned fieldNo = 0;
@@ -1138,10 +1126,7 @@ void CGDebugInfo::CollectRecordFields(
// Bump field number for next field.
++fieldNo;
- } else if (const auto *nestedRec = dyn_cast<CXXRecordDecl>(I))
- if (IncludeNestedRecords && !nestedRec->isImplicit() &&
- nestedRec->getDeclContext() == record)
- CollectRecordNestedRecord(nestedRec, elements);
+ }
}
}
@@ -3635,8 +3620,8 @@ void CGDebugInfo::EmitUsingDirective(const UsingDirectiveDecl &UD) {
if (CGM.getCodeGenOpts().getDebugInfo() < codegenoptions::LimitedDebugInfo)
return;
const NamespaceDecl *NSDecl = UD.getNominatedNamespace();
- if (!NSDecl->isAnonymousNamespace() ||
- CGM.getCodeGenOpts().DebugExplicitImport) {
+ if (!NSDecl->isAnonymousNamespace() ||
+ CGM.getCodeGenOpts().DebugExplicitImport) {
DBuilder.createImportedModule(
getCurrentContextDescriptor(cast<Decl>(UD.getDeclContext())),
getOrCreateNameSpace(NSDecl),
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 70c16462965..366dd81ac81 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -254,8 +254,6 @@ class CGDebugInfo {
llvm::DIFile *F,
SmallVectorImpl<llvm::Metadata *> &E,
llvm::DIType *RecordTy, const RecordDecl *RD);
- void CollectRecordNestedRecord(const RecordDecl *RD,
- SmallVectorImpl<llvm::Metadata *> &E);
void CollectRecordFields(const RecordDecl *Decl, llvm::DIFile *F,
SmallVectorImpl<llvm::Metadata *> &E,
llvm::DICompositeType *RecordTy);
diff --git a/clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp b/clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp
index 3b23ebf7ded..f7a2cfe7bae 100644
--- a/clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp
+++ b/clang/test/CodeGenCXX/debug-info-dup-fwd-decl.cpp
@@ -19,6 +19,6 @@ protected:
Test t;
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "data"
// CHECK: !DIDerivedType(tag: DW_TAG_pointer_type
+// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "data"
// CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "data"
diff --git a/clang/test/CodeGenCXX/debug-info-ms-abi.cpp b/clang/test/CodeGenCXX/debug-info-ms-abi.cpp
index b1ce128e0f7..a146ce94176 100644
--- a/clang/test/CodeGenCXX/debug-info-ms-abi.cpp
+++ b/clang/test/CodeGenCXX/debug-info-ms-abi.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple=i686-pc-windows-msvc -debug-info-kind=limited -gcodeview -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple=i686-pc-windows-msvc -debug-info-kind=limited -emit-llvm -o - | FileCheck %s
// Tests that certain miscellaneous features work in the MS ABI.
@@ -12,22 +12,19 @@ Foo f;
Foo::Nested n;
// CHECK: ![[Foo:[^ ]*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo",
-// CHECK-SAME: elements: ![[elements:[0-9]+]]
// CHECK-SAME: identifier: ".?AUFoo@@"
-// CHECK: ![[elements]] = !{![[vptr:[0-9]+]], ![[Nested:[0-9]+]], ![[f:[0-9]+]], ![[g:[0-9]+]], ![[h:[0-9]+]]}
-
-// CHECK: ![[Nested]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested",
-// CHECK-SAME: identifier: ".?AUNested@Foo@@"
-
-// CHECK: ![[f]] = !DISubprogram(name: "f",
+// CHECK: !DISubprogram(name: "f",
// CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0,
// CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,
-// CHECK: ![[g]] = !DISubprogram(name: "g",
+// CHECK: !DISubprogram(name: "g",
// CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 1,
// CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,
-// CHECK: ![[h]] = !DISubprogram(name: "h",
+// CHECK: !DISubprogram(name: "h",
// CHECK-SAME: containingType: ![[Foo]], virtuality: DW_VIRTUALITY_virtual, virtualIndex: 2,
// CHECK-SAME: flags: DIFlagPrototyped | DIFlagIntroducedVirtual,
+
+// CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested",
+// CHECK-SAME: identifier: ".?AUNested@Foo@@"
diff --git a/clang/test/Modules/ModuleDebugInfo.cpp b/clang/test/Modules/ModuleDebugInfo.cpp
index a190a04e33a..998d36327ef 100644
--- a/clang/test/Modules/ModuleDebugInfo.cpp
+++ b/clang/test/Modules/ModuleDebugInfo.cpp
@@ -121,7 +121,7 @@
// CHECK-SAME: flags: DIFlagFwdDecl,
// CHECK-SAME: identifier: "_ZTS9Template1IPvE")
-// Explicit instantiation.
+// Explicit instatiation.
// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "Template1<int>",
// CHECK-SAME: templateParams:
// CHECK-SAME: identifier: "_ZTS9Template1IiE")
@@ -130,10 +130,6 @@
// CHECK-SAME: flags: DIFlagFwdDecl
// CHECK-SAME: identifier: "_ZTS15FwdDeclTemplateIiE")
-// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Member",
-// CHECK-SAME: flags: DIFlagFwdDecl
-// CHECK-SAME: identifier: "_ZTSN11SpecializedIiE6MemberE")
-
// Forward-declared member of a template.
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Member",
// CHECK-SAME: flags: DIFlagFwdDecl
OpenPOWER on IntegriCloud