Simplify.

llvm-svn: 100511
This commit is contained in:
Daniel Dunbar 2010-04-06 01:07:39 +00:00
parent 92aba5a817
commit 60d81e8611
1 changed files with 2 additions and 6 deletions

View File

@ -1481,12 +1481,8 @@ LValue CodeGenFunction::EmitLValueForBitfield(llvm::Value* BaseValue,
cast<llvm::PointerType>(BaseValue->getType());
unsigned AS = BaseTy->getAddressSpace();
BaseValue = Builder.CreateBitCast(BaseValue,
llvm::PointerType::get(FieldTy, AS),
"tmp");
llvm::Value *Idx =
llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), Info.FieldNo);
llvm::Value *V = Builder.CreateGEP(BaseValue, Idx, "tmp");
llvm::PointerType::get(FieldTy, AS));
llvm::Value *V = Builder.CreateConstGEP1_32(BaseValue, Info.FieldNo);
return LValue::MakeBitfield(V, Info, Field->getType()->isSignedIntegerType(),
Field->getType().getCVRQualifiers()|CVRQualifiers);