Minor cleanup to use the ConvertTypeForMem helper.
llvm-svn: 51837
This commit is contained in:
parent
3b6dd58ee7
commit
149a57f7d4
|
@ -560,9 +560,7 @@ LValue CodeGenFunction::EmitLValueForField(llvm::Value* BaseValue,
|
||||||
if (Field->isBitField()) {
|
if (Field->isBitField()) {
|
||||||
// FIXME: CodeGenTypes should expose a method to get the appropriate
|
// FIXME: CodeGenTypes should expose a method to get the appropriate
|
||||||
// type for FieldTy (the appropriate type is ABI-dependent).
|
// type for FieldTy (the appropriate type is ABI-dependent).
|
||||||
unsigned EltTySize =
|
const llvm::Type *FieldTy = CGM.getTypes().ConvertTypeForMem(Field->getType());
|
||||||
CGM.getTargetData().getABITypeSizeInBits(ConvertType(Field->getType()));
|
|
||||||
const llvm::Type *FieldTy = llvm::IntegerType::get(EltTySize);
|
|
||||||
const llvm::PointerType *BaseTy =
|
const llvm::PointerType *BaseTy =
|
||||||
cast<llvm::PointerType>(BaseValue->getType());
|
cast<llvm::PointerType>(BaseValue->getType());
|
||||||
unsigned AS = BaseTy->getAddressSpace();
|
unsigned AS = BaseTy->getAddressSpace();
|
||||||
|
@ -583,7 +581,7 @@ LValue CodeGenFunction::EmitLValueForField(llvm::Value* BaseValue,
|
||||||
|
|
||||||
// Match union field type.
|
// Match union field type.
|
||||||
if (isUnion) {
|
if (isUnion) {
|
||||||
const llvm::Type * FieldTy = ConvertType(Field->getType());
|
const llvm::Type *FieldTy = CGM.getTypes().ConvertTypeForMem(Field->getType());
|
||||||
const llvm::PointerType * BaseTy =
|
const llvm::PointerType * BaseTy =
|
||||||
cast<llvm::PointerType>(BaseValue->getType());
|
cast<llvm::PointerType>(BaseValue->getType());
|
||||||
unsigned AS = BaseTy->getAddressSpace();
|
unsigned AS = BaseTy->getAddressSpace();
|
||||||
|
|
Loading…
Reference in New Issue