From e5402e474907dfd9c2cdfe8eedeb97826dcb835d Mon Sep 17 00:00:00 2001 From: Ken Dyck Date: Tue, 26 Jan 2010 18:35:11 +0000 Subject: Use CharUnits for alignment in EmitNullInitializationLValue(). llvm-svn: 94563 --- clang/lib/CodeGen/CGExpr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang') diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index 2358bb35923..b2ecd55f441 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -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; -- cgit v1.2.3