aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-08-23 18:51:39 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-08-23 18:51:39 +0000
commitbf9294fb6531a2a6ea2fbbe2712b9bb650dfef04 (patch)
tree96bda1a9bff0961047ab9fd5fcc1647535ce80d4 /clang/lib/CodeGen/CodeGenModule.cpp
parent99e9d6ffbfb8055b8e116b3b5ca38a2f83107c17 (diff)
downloadllvm-bf9294fb6531a2a6ea2fbbe2712b9bb650dfef04.zip
llvm-bf9294fb6531a2a6ea2fbbe2712b9bb650dfef04.tar.gz
llvm-bf9294fb6531a2a6ea2fbbe2712b9bb650dfef04.tar.bz2
Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380). llvm-svn: 111823
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index f26fa3c6..e638837 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1940,9 +1940,16 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
// Forward declarations, no (immediate) code generation.
case Decl::ObjCClass:
case Decl::ObjCForwardProtocol:
- case Decl::ObjCCategory:
case Decl::ObjCInterface:
break;
+
+ case Decl::ObjCCategory: {
+ ObjCCategoryDecl *CD = cast<ObjCCategoryDecl>(D);
+ if (CD->IsClassExtension() && CD->hasSynthBitfield())
+ Context.ResetObjCLayout(CD->getClassInterface());
+ break;
+ }
+
case Decl::ObjCProtocol:
Runtime->GenerateProtocol(cast<ObjCProtocolDecl>(D));
@@ -1956,6 +1963,8 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
case Decl::ObjCImplementation: {
ObjCImplementationDecl *OMD = cast<ObjCImplementationDecl>(D);
+ if (Features.ObjCNonFragileABI2 && OMD->hasSynthBitfield())
+ Context.ResetObjCLayout(OMD->getClassInterface());
EmitObjCPropertyImplementations(OMD);
EmitObjCIvarInitializations(OMD);
Runtime->GenerateClass(OMD);