aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-04-13 20:58:55 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-04-13 20:58:55 +0000
commitab970f90ce31a53fe7e6375a37536bf0832fd922 (patch)
treedca72794ebe2bac936e3a1516ad07fc54112d899 /lib/CodeGen/CGObjCMac.cpp
parent4895a8ca41352b9ce572cd64ffa93208898e7546 (diff)
IRgen: Enhance CGBitFieldInfo with enough information to fully describe the "policy" with which a bit-field should be accessed.
- For now, these policies are computed to match the current IRgen strategy, although the new information isn't being used yet (except in -fdump-record-layouts). - Design comments appreciated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 4713ac7ca2..8cd7cdbfe6 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -129,6 +129,17 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
new (CGF.CGM.getContext()) CGBitFieldInfo(
LTy, FieldNo, BitOffset, BitFieldSize, IvarTy->isSignedIntegerType());
+ // We always construct a single, possibly unaligned, access for this case.
+ Info->setNumComponents(1);
+ CGBitFieldInfo::AccessInfo &AI = Info->getComponent(0);
+ AI.FieldIndex = 0;
+ AI.FieldByteOffset = 0;
+ AI.FieldBitStart = BitOffset;
+ AI.AccessWidth = CGF.CGM.getContext().getTypeSize(IvarTy);
+ AI.AccessAlignment = 0;
+ AI.TargetBitOffset = 0;
+ AI.TargetBitWidth = 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, *Info, Quals.getCVRQualifiers());