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,