aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index f7fe69e326..b9013a8667 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -348,6 +348,9 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
if (const AlignedAttr *AA = D->getAttr<AlignedAttr>())
F->setAlignment(AA->getAlignment()/8);
+ // C++ ABI requires 2-byte alignment for member functions.
+ if (F->getAlignment() < 16 && isa<CXXMethodDecl>(D))
+ F->setAlignment(16/8);
}
void CodeGenModule::SetCommonAttributes(const Decl *D,