Use CharUnits for alignment in EmitNullInitializationLValue().
llvm-svn: 94563
This commit is contained in:
parent
a01418d75a
commit
e5402e4749
@ -1648,8 +1648,8 @@ LValue CodeGenFunction::EmitNullInitializationLValue(
|
||||
QualType Ty = E->getType();
|
||||
const llvm::Type *LTy = ConvertTypeForMem(Ty);
|
||||
llvm::AllocaInst *Alloc = CreateTempAlloca(LTy);
|
||||
unsigned Align = getContext().getTypeAlign(Ty)/8;
|
||||
Alloc->setAlignment(Align);
|
||||
CharUnits Align = getContext().getTypeAlignInChars(Ty);
|
||||
Alloc->setAlignment(Align.getQuantity());
|
||||
LValue lvalue = LValue::MakeAddr(Alloc, Qualifiers());
|
||||
EmitMemSetToZero(lvalue.getAddress(), Ty);
|
||||
return lvalue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user