summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp4
1 files changed, 2 insertions, 2 deletions
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;
OpenPOWER on IntegriCloud