[clang] 1118ee0 - [Clang][CGDebugInfo][ObjC] Mark objc bitfields with the DIFlagBitfield flag
Juan Manuel MARTINEZ CAAMAÑO via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 21 01:00:44 PST 2022
Author: Juan Manuel MARTINEZ CAAMAÑO
Date: 2022-12-21T04:00:40-05:00
New Revision: 1118ee04fc7c09bb54128bcaef4bd82835dcbafd
URL: https://github.com/llvm/llvm-project/commit/1118ee04fc7c09bb54128bcaef4bd82835dcbafd
DIFF: https://github.com/llvm/llvm-project/commit/1118ee04fc7c09bb54128bcaef4bd82835dcbafd.diff
LOG: [Clang][CGDebugInfo][ObjC] Mark objc bitfields with the DIFlagBitfield flag
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D140195
Added:
Modified:
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenObjC/debug-info-ivars.m
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 4d1b0b65d6e8e..576a97b66859c 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2930,6 +2930,9 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const ObjCInterfaceType *Ty,
else if (Field->getAccessControl() == ObjCIvarDecl::Public)
Flags = llvm::DINode::FlagPublic;
+ if (Field->isBitField())
+ Flags |= llvm::DINode::FlagBitField;
+
llvm::MDNode *PropertyNode = nullptr;
if (ObjCImplementationDecl *ImpD = ID->getImplementation()) {
if (ObjCPropertyImplDecl *PImpD =
diff --git a/clang/test/CodeGenObjC/debug-info-ivars.m b/clang/test/CodeGenObjC/debug-info-ivars.m
index 996562dae25f1..dc253b2c58abf 100644
--- a/clang/test/CodeGenObjC/debug-info-ivars.m
+++ b/clang/test/CodeGenObjC/debug-info-ivars.m
@@ -30,15 +30,15 @@ @implementation BaseClass
// CHECK-SAME: baseType: ![[UNSIGNED:[0-9]+]]
// CHECK-SAME: size: 9,
// CHECK-NOT: offset:
-// CHECK-SAME: flags: DIFlagProtected
+// CHECK-SAME: flags: DIFlagProtected | DIFlagBitField
// CHECK: ![[UNSIGNED]] = !DIBasicType(name: "unsigned int"
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "flag_2"
// CHECK-SAME: line: 12
// CHECK-SAME: baseType: ![[UNSIGNED]]
// CHECK-SAME: size: 9, offset: 1,
-// CHECK-SAME: flags: DIFlagProtected
+// CHECK-SAME: flags: DIFlagProtected | DIFlagBitField
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "flag_3"
// CHECK-SAME: line: 14
// CHECK-SAME: baseType: ![[UNSIGNED]]
// CHECK-SAME: size: 9, offset: 3,
-// CHECK-SAME: flags: DIFlagProtected
+// CHECK-SAME: flags: DIFlagProtected | DIFlagBitField
More information about the cfe-commits
mailing list