diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-04-05 21:36:35 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-04-05 21:36:35 +0000 |
commit | f0fe5bc0e46038dc79cdd27fcf0c77ad4789fdff (patch) | |
tree | 81d8b952f0e86707c220eb074033cc7f9a3bf2c0 /lib/CodeGen/CGObjCMac.cpp | |
parent | 84139d6ef8967cfdb70d37378a7a65cc4827d44d (diff) |
IRgen: Move BitField LValues to just hold a reference to the CGBitFieldInfo.
- Unfortunately, this requires some horrible code in CGObjCMac which always
allocats a CGBitFieldInfo because we don't currently build a proper layout
for Objective-C classes. It needs to be cleaned up, but I don't want the
bit-field cleanups to be blocked on that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index e4df872d35..467ad43bb2 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -118,10 +118,19 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF, uint64_t BitFieldSize = Ivar->getBitWidth()->EvaluateAsInt(CGF.getContext()).getZExtValue(); + // Allocate a new CGBitFieldInfo object to describe this access. + // + // FIXME: This is incredibly wasteful, these should be uniqued or part of some + // 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. + unsigned FieldNo = 0; // This value is unused. + CGBitFieldInfo *Info = + new (CGF.CGM.getContext()) CGBitFieldInfo(FieldNo, BitOffset, BitFieldSize); + // 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, BitOffset, BitFieldSize, - IvarTy->isSignedIntegerType(), + return LValue::MakeBitfield(V, *Info, IvarTy->isSignedIntegerType(), Quals.getCVRQualifiers()); } |