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 | 3472ae5bac95965083490b746c7da045054658f8 (patch) | |
| tree | fddc7585bc5ab507afbf89cf76e7bb44baa37cd4 /clang/lib/CodeGen | |
| parent | 2dfb5da6bb727b12bc3ff485a243d63b5cef3545 (diff) | |
| download | bcm5719-llvm-3472ae5bac95965083490b746c7da045054658f8.tar.gz bcm5719-llvm-3472ae5bac95965083490b746c7da045054658f8.zip | |
Ensure we have atleast 2-byte alignment for member functions.
llvm-svn: 83337
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index f7fe69e3262..b9013a8667c 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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, |

