aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-04-15 05:09:32 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-04-15 05:09:32 +0000
commit2df2569679237b4979654a8663cd61aea67ab207 (patch)
treec2a48d8f611462b90df65df8f1d1ef93c40723db /lib/CodeGen/CGObjCMac.cpp
parent7fb619500404129322af972aab66c369949a2a74 (diff)
IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor arguments, it is now an immutable object.
Also, add some checking of various invariants that should hold on the CGBitFieldInfo access. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index a4fb431f8e..a6c2cc9010 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -124,13 +124,9 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
// layout object. However, this is blocked on other cleanups to the
// Objective-C code, so for now we just live with allocating a bunch of these
// objects.
- CGBitFieldInfo *Info =
- new (CGF.CGM.getContext()) CGBitFieldInfo(BitFieldSize,
- IvarTy->isSignedIntegerType());
// We always construct a single, possibly unaligned, access for this case.
- Info->setNumComponents(1);
- CGBitFieldInfo::AccessInfo &AI = Info->getComponent(0);
+ CGBitFieldInfo::AccessInfo AI;
AI.FieldIndex = 0;
AI.FieldByteOffset = 0;
AI.FieldBitStart = BitOffset;
@@ -139,6 +135,10 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
AI.TargetBitOffset = 0;
AI.TargetBitWidth = BitFieldSize;
+ CGBitFieldInfo *Info =
+ new (CGF.CGM.getContext()) CGBitFieldInfo(BitFieldSize, 1, &AI,
+ IvarTy->isSignedIntegerType());
+
// FIXME: We need to set a very conservative alignment on this, or make sure
// that the runtime is doing the right thing.
return LValue::MakeBitfield(V, *Info, Quals.getCVRQualifiers());