From 3228f42b12c24c76f5d5ae4ebf80837b752d1683 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(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94563 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 2358bb3592..b2ecd55f44 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/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-70-g09d2