diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-26 18:35:11 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-26 18:35:11 +0000 |
commit | 3228f42b12c24c76f5d5ae4ebf80837b752d1683 (patch) | |
tree | afac79414dbe8df9c30b17225c8e42931c913d97 | |
parent | 0045e9fe1f7dfc37f1ea7bdb9b70bcdb6700f0c0 (diff) |
Use CharUnits for alignment in EmitNullInitializationLValue().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94563 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; |