diff options
author | Ken Dyck <kd@kendyck.com> | 2011-04-24 10:04:59 +0000 |
---|---|---|
committer | Ken Dyck <kd@kendyck.com> | 2011-04-24 10:04:59 +0000 |
commit | 28ebde58dd94b5ed2a6d149251202ab2c602a4a6 (patch) | |
tree | 78f74c1f8e7f1918dd84f880f98c121830c2c2f9 /lib/CodeGen/CGExpr.cpp | |
parent | c0a455942453a37dd7db83eb354f40a49872ab06 (diff) |
Convert CGBitFieldInfo::FieldByteOffset to CharUnits. No change in
functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index e0935ac039..892e9a3458 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -726,9 +726,10 @@ RValue CodeGenFunction::EmitLoadOfBitfieldLValue(LValue LV, Ptr = Builder.CreateStructGEP(Ptr, AI.FieldIndex, "bf.field"); // Offset by the byte offset, if used. - if (AI.FieldByteOffset) { + if (!AI.FieldByteOffset.isZero()) { Ptr = EmitCastToVoidPtr(Ptr); - Ptr = Builder.CreateConstGEP1_32(Ptr, AI.FieldByteOffset,"bf.field.offs"); + Ptr = Builder.CreateConstGEP1_32(Ptr, AI.FieldByteOffset.getQuantity(), + "bf.field.offs"); } // Cast to the access type. @@ -929,9 +930,10 @@ void CodeGenFunction::EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst, Ptr = Builder.CreateStructGEP(Ptr, AI.FieldIndex, "bf.field"); // Offset by the byte offset, if used. - if (AI.FieldByteOffset) { + if (!AI.FieldByteOffset.isZero()) { Ptr = EmitCastToVoidPtr(Ptr); - Ptr = Builder.CreateConstGEP1_32(Ptr, AI.FieldByteOffset,"bf.field.offs"); + Ptr = Builder.CreateConstGEP1_32(Ptr, AI.FieldByteOffset.getQuantity(), + "bf.field.offs"); } // Cast to the access type. |