aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-10-05 22:49:20 +0000
committerMike Stump <mrs@apple.com>2009-10-05 22:49:20 +0000
commit3472ae5bac95965083490b746c7da045054658f8 (patch)
treefddc7585bc5ab507afbf89cf76e7bb44baa37cd4 /clang/lib/CodeGen/CodeGenModule.cpp
parent2dfb5da6bb727b12bc3ff485a243d63b5cef3545 (diff)
downloadllvm-3472ae5bac95965083490b746c7da045054658f8.zip
llvm-3472ae5bac95965083490b746c7da045054658f8.tar.gz
llvm-3472ae5bac95965083490b746c7da045054658f8.tar.bz2
Ensure we have atleast 2-byte alignment for member functions.
llvm-svn: 83337
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index f7fe69e..b9013a8 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,