Use CharUnits for alignment of UTF16 string in GetAddrOfConstantCFString().

llvm-svn: 94564
This commit is contained in:
Ken Dyck 2010-01-26 18:46:23 +00:00
parent e5402e4749
commit a0f99ff230
1 changed files with 2 additions and 2 deletions

View File

@ -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);