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 | e5402e474907dfd9c2cdfe8eedeb97826dcb835d (patch) | |
tree | 3f031719435789ddd09a418a2462568ac0eb802f | |
parent | a01418d75ae571537231ad577fdd90de0e2b75b6 (diff) | |
download | bcm5719-llvm-e5402e474907dfd9c2cdfe8eedeb97826dcb835d.tar.gz bcm5719-llvm-e5402e474907dfd9c2cdfe8eedeb97826dcb835d.zip |
Use CharUnits for alignment in EmitNullInitializationLValue().
llvm-svn: 94563
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 4 |
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; |