summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-06 17:22:42 +0000
committerChris Lattner <sabre@nondot.org>2009-12-06 17:22:42 +0000
commit72ecc68e11e50a770cec8b72aa4a270c8aedff63 (patch)
tree872b420051239fe0d88aaafc61f43389cd842095
parent6d6f10fe919eaf8391bae3df6ff8278158f11c4c (diff)
downloadbcm5719-llvm-72ecc68e11e50a770cec8b72aa4a270c8aedff63.tar.gz
bcm5719-llvm-72ecc68e11e50a770cec8b72aa4a270c8aedff63.zip
use new helpers to simplify code.
llvm-svn: 90709
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index a5156eb67bd..86a3ceb7a8b 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -403,8 +403,7 @@ RValue CodeGenFunction::EmitLoadOfBitfieldLValue(LValue LV,
// Shift to proper location.
if (StartBit)
- Val = Builder.CreateLShr(Val, llvm::ConstantInt::get(EltTy, StartBit),
- "bf.lo");
+ Val = Builder.CreateLShr(Val, StartBit, "bf.lo");
// Mask off unused bits.
llvm::Constant *LowMask = llvm::ConstantInt::get(VMContext,
@@ -426,8 +425,7 @@ RValue CodeGenFunction::EmitLoadOfBitfieldLValue(LValue LV,
HighVal = Builder.CreateAnd(HighVal, HighMask, "bf.lo.cleared");
// Shift to proper location and or in to bitfield value.
- HighVal = Builder.CreateShl(HighVal,
- llvm::ConstantInt::get(EltTy, LowBits));
+ HighVal = Builder.CreateShl(HighVal, LowBits);
Val = Builder.CreateOr(Val, HighVal, "bf.val");
}
@@ -613,8 +611,7 @@ void CodeGenFunction::EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst,
// LowVal = (LowVal & InvMask) | (NewVal << StartBit),
// with the shift of NewVal implicitly stripping the high bits.
llvm::Value *NewLowVal =
- Builder.CreateShl(NewVal, llvm::ConstantInt::get(EltTy, StartBit),
- "bf.value.lo");
+ Builder.CreateShl(NewVal, StartBit, "bf.value.lo");
LowVal = Builder.CreateAnd(LowVal, InvMask, "bf.prev.lo.cleared");
LowVal = Builder.CreateOr(LowVal, NewLowVal, "bf.new.lo");
@@ -640,8 +637,7 @@ void CodeGenFunction::EmitStoreThroughBitfieldLValue(RValue Src, LValue Dst,
// where the high bits of NewVal have already been cleared and the
// shift stripping the low bits.
llvm::Value *NewHighVal =
- Builder.CreateLShr(NewVal, llvm::ConstantInt::get(EltTy, LowBits),
- "bf.value.high");
+ Builder.CreateLShr(NewVal, LowBits, "bf.value.high");
HighVal = Builder.CreateAnd(HighVal, InvMask, "bf.prev.hi.cleared");
HighVal = Builder.CreateOr(HighVal, NewHighVal, "bf.new.hi");
OpenPOWER on IntegriCloud