From c5e153c50e510dabdf4d7b1c83cba48fb4e40bdf Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Mon, 5 Oct 2009 21:58:44 +0000 Subject: [PATCH] Respect alignments better. llvm-svn: 83328 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index fdc97409eb4c..f7fe69e32625 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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,