This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGaaf1a96408b1: [DebugInfo] Add size to class declarations in
debug info. (authored by akhuang).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87062/new/
https://reviews.llvm.org/D87062
Files:
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/debug-info-class.cpp
Index: clang/test/CodeGenCXX/debug-info-class.cpp
===================================================================
--- clang/test/CodeGenCXX/debug-info-class.cpp
+++ clang/test/CodeGenCXX/debug-info-class.cpp
@@ -136,7 +136,7 @@
// CHECK: [[C_DTOR]] = !DISubprogram(name: "~C"
// CHECK: [[D:![0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name:
"D"
-// CHECK-NOT: size:
+// CHECK-SAME: size:
// CHECK-SAME: DIFlagFwdDecl
// CHECK-NOT: identifier:
// CHECK-SAME: ){{$}}
Index: clang/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1031,6 +1031,10 @@
uint64_t Size = 0;
uint32_t Align = 0;
+ const RecordDecl *D = RD->getDefinition();
+ if (D && D->isCompleteDefinition())
+ Size = CGM.getContext().getTypeSize(Ty);
+
llvm::DINode::DIFlags Flags = llvm::DINode::FlagFwdDecl;
// Add flag to nontrivial forward declarations. To be consistent with MSVC,
Index: clang/test/CodeGenCXX/debug-info-class.cpp
===================================================================
--- clang/test/CodeGenCXX/debug-info-class.cpp
+++ clang/test/CodeGenCXX/debug-info-class.cpp
@@ -136,7 +136,7 @@
// CHECK: [[C_DTOR]] = !DISubprogram(name: "~C"
// CHECK: [[D:![0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "D"
-// CHECK-NOT: size:
+// CHECK-SAME: size:
// CHECK-SAME: DIFlagFwdDecl
// CHECK-NOT: identifier:
// CHECK-SAME: ){{$}}
Index: clang/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1031,6 +1031,10 @@
uint64_t Size = 0;
uint32_t Align = 0;
+ const RecordDecl *D = RD->getDefinition();
+ if (D && D->isCompleteDefinition())
+ Size = CGM.getContext().getTypeSize(Ty);
+
llvm::DINode::DIFlags Flags = llvm::DINode::FlagFwdDecl;
// Add flag to nontrivial forward declarations. To be consistent with MSVC,
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits