[cfe-commits] r94563 - /cfe/trunk/lib/CodeGen/CGExpr.cpp
Ken Dyck
ken.dyck at onsemi.com
Tue Jan 26 10:35:12 PST 2010
Author: kjdyck
Date: Tue Jan 26 12:35:11 2010
New Revision: 94563
URL: http://llvm.org/viewvc/llvm-project?rev=94563&view=rev
Log:
Use CharUnits for alignment in EmitNullInitializationLValue().
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=94563&r1=94562&r2=94563&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Jan 26 12:35:11 2010
@@ -1648,8 +1648,8 @@
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;
More information about the cfe-commits
mailing list