]> granicus.if.org Git - clang/commitdiff
Respect alignments better.
authorMike Stump <mrs@apple.com>
Mon, 5 Oct 2009 21:58:44 +0000 (21:58 +0000)
committerMike Stump <mrs@apple.com>
Mon, 5 Oct 2009 21:58:44 +0000 (21:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83328 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index fdc97409eb4c3e79203d7134aa939d6e70bb048d..f7fe69e3262509598f524bf1a094dea409ddf413 100644 (file)
@@ -345,6 +345,9 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
 
   if (D->hasAttr<NoInlineAttr>())
     F->addFnAttr(llvm::Attribute::NoInline);
+
+  if (const AlignedAttr *AA = D->getAttr<AlignedAttr>())
+    F->setAlignment(AA->getAlignment()/8);
 }
 
 void CodeGenModule::SetCommonAttributes(const Decl *D,