diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-26 18:46:23 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-26 18:46:23 +0000 |
commit | 4da244c23d6093adbbbc41654aa5c5111b38f431 (patch) | |
tree | ffeac7d5c9b65e74f347e4e267d89586ae0a4008 /lib/CodeGen/CodeGenModule.cpp | |
parent | 3228f42b12c24c76f5d5ae4ebf80837b752d1683 (diff) |
Use CharUnits for alignment of UTF16 string in GetAddrOfConstantCFString().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index ebd3df1cf9..dc66f04c5e 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1501,8 +1501,8 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { if (Sect) GV->setSection(Sect); if (isUTF16) { - unsigned Align = getContext().getTypeAlign(getContext().ShortTy)/8; - GV->setAlignment(Align); + CharUnits Align = getContext().getTypeAlignInChars(getContext().ShortTy); + GV->setAlignment(Align.getQuantity()); } Fields[2] = llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2); |