[PATCH] D87062: [DebugInfo] Add size to class declarations in debug info.
Amy Huang via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 3 15:43:21 PDT 2020
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,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87062.289825.patch
Type: text/x-patch
Size: 1079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200903/1d12e3d8/attachment.bin>
More information about the cfe-commits
mailing list