diff options
author | Mike Stump <mrs@apple.com> | 2009-10-05 22:49:20 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-10-05 22:49:20 +0000 |
commit | fb51ddfafcd5f8536d0312b3daa3c0b74b90ab5b (patch) | |
tree | 3a2dae6e9cd1b10a5d58118409829faf8004158d /lib/CodeGen/CodeGenModule.cpp | |
parent | 9a3dcf22342c4bf2be59ffd7abaebd4a9b0b1c4b (diff) |
Ensure we have atleast 2-byte alignment for member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 3 |
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, |