From f55314dce992fd60816ba337ad151a2fb7c42239 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Mon, 5 Oct 2009 21:58:44 +0000 Subject: [PATCH] Respect alignments better. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83328 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 3 +++ 1 file changed, 3 insertions(+) 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, -- 2.50.1