mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-25 02:28:18 +00:00
objective-c modern translator. Don't ignore unnamed bitfields
when rewriting. llvm-svn: 152123
This commit is contained in:
parent
ef21be2cda
commit
d7a3261dfb
@ -3250,12 +3250,9 @@ void RewriteModernObjC::RewriteObjCInternalStruct(ObjCInterfaceDecl *CDecl,
|
||||
ObjCInterfaceDecl *RCDecl = CDecl->getSuperClass();
|
||||
SmallVector<ObjCIvarDecl *, 8> IVars;
|
||||
for (ObjCIvarDecl *IVD = CDecl->all_declared_ivar_begin();
|
||||
IVD; IVD = IVD->getNextIvar()) {
|
||||
// Ignore unnamed bit-fields.
|
||||
if (!IVD->getDeclName())
|
||||
continue;
|
||||
IVD; IVD = IVD->getNextIvar())
|
||||
IVars.push_back(IVD);
|
||||
}
|
||||
|
||||
SourceLocation LocStart = CDecl->getLocStart();
|
||||
SourceLocation LocEnd = CDecl->getEndOfDefinitionLoc();
|
||||
|
||||
|
23
clang/test/Rewriter/unnamed-bf-modern-write.mm
Normal file
23
clang/test/Rewriter/unnamed-bf-modern-write.mm
Normal file
@ -0,0 +1,23 @@
|
||||
// RUN: %clang_cc1 -E %s -o %t.mm
|
||||
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s
|
||||
|
||||
@interface Foo {
|
||||
@private
|
||||
int first;
|
||||
int :1;
|
||||
int third :1;
|
||||
int :1;
|
||||
int fifth :1;
|
||||
}
|
||||
@end
|
||||
@implementation Foo
|
||||
@end
|
||||
|
||||
// CHECK: struct Foo_IMPL {
|
||||
// CHECK-NEXT: int first;
|
||||
// CHECK-NEXT: int : 1;
|
||||
// CHECK-NEXT: int third : 1;
|
||||
// CHECK-NEXT: int : 1;
|
||||
// CHECK-NEXT: int fifth : 1;
|
||||
// CHECK-NEXT: char : 0;
|
||||
// CHECK-NEXT: };
|
Loading…
x
Reference in New Issue
Block a user