From: Mike Stump Date: Mon, 5 Oct 2009 21:58:44 +0000 (+0000) Subject: Respect alignments better. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f55314dce992fd60816ba337ad151a2fb7c42239;p=clang Respect alignments better. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83328 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index fdc97409eb..f7fe69e326 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -345,6 +345,9 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, if (D->hasAttr()) F->addFnAttr(llvm::Attribute::NoInline); + + if (const AlignedAttr *AA = D->getAttr()) + F->setAlignment(AA->getAlignment()/8); } void CodeGenModule::SetCommonAttributes(const Decl *D,