[Clang][CGDebugInfo][ObjC] Mark objc bitfields with the DIFlagBitfield flag

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D140195
This commit is contained in:
Juan Manuel MARTINEZ CAAMAÑO 2022-12-21 03:38:47 -05:00
parent 1341780847
commit 1118ee04fc
2 changed files with 6 additions and 3 deletions

View File

@ -2930,6 +2930,9 @@ llvm::DIType *CGDebugInfo::CreateTypeDefinition(const ObjCInterfaceType *Ty,
else if (Field->getAccessControl() == ObjCIvarDecl::Public) else if (Field->getAccessControl() == ObjCIvarDecl::Public)
Flags = llvm::DINode::FlagPublic; Flags = llvm::DINode::FlagPublic;
if (Field->isBitField())
Flags |= llvm::DINode::FlagBitField;
llvm::MDNode *PropertyNode = nullptr; llvm::MDNode *PropertyNode = nullptr;
if (ObjCImplementationDecl *ImpD = ID->getImplementation()) { if (ObjCImplementationDecl *ImpD = ID->getImplementation()) {
if (ObjCPropertyImplDecl *PImpD = if (ObjCPropertyImplDecl *PImpD =

View File

@ -30,15 +30,15 @@ __attribute((objc_root_class)) @interface NSObject {
// CHECK-SAME: baseType: ![[UNSIGNED:[0-9]+]] // CHECK-SAME: baseType: ![[UNSIGNED:[0-9]+]]
// CHECK-SAME: size: 9, // CHECK-SAME: size: 9,
// CHECK-NOT: offset: // CHECK-NOT: offset:
// CHECK-SAME: flags: DIFlagProtected // CHECK-SAME: flags: DIFlagProtected | DIFlagBitField
// CHECK: ![[UNSIGNED]] = !DIBasicType(name: "unsigned int" // CHECK: ![[UNSIGNED]] = !DIBasicType(name: "unsigned int"
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "flag_2" // CHECK: !DIDerivedType(tag: DW_TAG_member, name: "flag_2"
// CHECK-SAME: line: 12 // CHECK-SAME: line: 12
// CHECK-SAME: baseType: ![[UNSIGNED]] // CHECK-SAME: baseType: ![[UNSIGNED]]
// CHECK-SAME: size: 9, offset: 1, // 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: !DIDerivedType(tag: DW_TAG_member, name: "flag_3"
// CHECK-SAME: line: 14 // CHECK-SAME: line: 14
// CHECK-SAME: baseType: ![[UNSIGNED]] // CHECK-SAME: baseType: ![[UNSIGNED]]
// CHECK-SAME: size: 9, offset: 3, // CHECK-SAME: size: 9, offset: 3,
// CHECK-SAME: flags: DIFlagProtected // CHECK-SAME: flags: DIFlagProtected | DIFlagBitField