[cfe-commits] r152123 - in /cfe/trunk: lib/Rewrite/RewriteModernObjC.cpp test/Rewriter/unnamed-bf-modern-write.mm
Fariborz Jahanian
fjahanian at apple.com
Tue Mar 6 09:16:27 PST 2012
Author: fjahanian
Date: Tue Mar 6 11:16:27 2012
New Revision: 152123
URL: http://llvm.org/viewvc/llvm-project?rev=152123&view=rev
Log:
objective-c modern translator. Don't ignore unnamed bitfields
when rewriting.
Added:
cfe/trunk/test/Rewriter/unnamed-bf-modern-write.mm
Modified:
cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
Modified: cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp?rev=152123&r1=152122&r2=152123&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp Tue Mar 6 11:16:27 2012
@@ -3250,12 +3250,9 @@
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();
Added: cfe/trunk/test/Rewriter/unnamed-bf-modern-write.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/unnamed-bf-modern-write.mm?rev=152123&view=auto
==============================================================================
--- cfe/trunk/test/Rewriter/unnamed-bf-modern-write.mm (added)
+++ cfe/trunk/test/Rewriter/unnamed-bf-modern-write.mm Tue Mar 6 11:16:27 2012
@@ -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
+
+ at interface Foo {
+ at private
+ int first;
+ int :1;
+ int third :1;
+ int :1;
+ int fifth :1;
+}
+ at end
+ at implementation Foo
+ at 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: };
More information about the cfe-commits
mailing list