aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-04-06 01:07:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-04-06 01:07:44 +0000
commitefbf487da83883c2da81181cac6f040928aa4289 (patch)
treee760849636178291773eb0a39b613633c88e363c /lib/CodeGen/CGExpr.cpp
parentc7a984af71394402cb4d149554ab5da11aebd729 (diff)
IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100513 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index eb848331ec..0aa4438f4f 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -605,8 +605,9 @@ RValue CodeGenFunction::EmitLoadOfLValue(LValue LV, QualType ExprType) {
RValue CodeGenFunction::EmitLoadOfBitfieldLValue(LValue LV,
QualType ExprType) {
- unsigned StartBit = LV.getBitFieldInfo().Start;
- unsigned BitfieldSize = LV.getBitFieldInfo().Size;
+ const CGBitFieldInfo &Info = LV.getBitFieldInfo();
+ unsigned StartBit = Info.Start;
+ unsigned BitfieldSize = Info.Size;
llvm::Value *Ptr = LV.getBitFieldAddr();
const llvm::Type *EltTy =
@@ -650,7 +651,7 @@ RValue CodeGenFunction::EmitLoadOfBitfieldLValue(LValue LV,
}
// Sign extend if necessary.
- if (LV.isBitFieldSigned()) {
+ if (Info.IsSigned) {
llvm::Value *ExtraBits = llvm::ConstantInt::get(EltTy,
EltTySize - BitfieldSize);
Val = Builder.CreateAShr(Builder.CreateShl(Val, ExtraBits),
@@ -781,8 +782,9 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst,
void CodeGenFunction::EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst,
QualType Ty,
llvm::Value **Result) {
- unsigned StartBit = Dst.getBitFieldInfo().Start;
- unsigned BitfieldSize = Dst.getBitFieldInfo().Size;
+ const CGBitFieldInfo &Info = Dst.getBitFieldInfo();
+ unsigned StartBit = Info.Start;
+ unsigned BitfieldSize = Info.Size;
llvm::Value *Ptr = Dst.getBitFieldAddr();
const llvm::Type *EltTy =
@@ -805,7 +807,7 @@ void CodeGenFunction::EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst,
"bf.reload.val");
// Sign extend if necessary.
- if (Dst.isBitFieldSigned()) {
+ if (Info.IsSigned) {
unsigned SrcTySize = CGM.getTargetData().getTypeSizeInBits(SrcTy);
llvm::Value *ExtraBits = llvm::ConstantInt::get(SrcTy,
SrcTySize - BitfieldSize);
@@ -1484,7 +1486,7 @@ LValue CodeGenFunction::EmitLValueForBitfield(llvm::Value* BaseValue,
llvm::PointerType::get(FieldTy, AS));
llvm::Value *V = Builder.CreateConstGEP1_32(BaseValue, Info.FieldNo);
- return LValue::MakeBitfield(V, Info, Field->getType()->isSignedIntegerType(),
+ return LValue::MakeBitfield(V, Info,
Field->getType().getCVRQualifiers()|CVRQualifiers);
}