diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-05-06 14:01:45 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-05-06 14:01:45 -0700 |
commit | 0db5dc3a0df36251eac3ea8ad6bf852acb2f819d (patch) | |
tree | b254238be8ce014a2eaab5f3e7d064379563907a /lib/CodeGen/CodeGenModule.cpp | |
parent | 9596f4e867095c9f1741601615a8d2bcb097772e (diff) | |
parent | dc171d8a2090ca1d46be0f164801edf8721ec5cc (diff) |
Merge branch 'incoming'1.17.0
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 0b03a3c4b6..3fb7cba914 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -57,6 +57,7 @@ static CGCXXABI &createCXXABI(CodeGenModule &CGM) { switch (CGM.getTarget().getCXXABI().getKind()) { case TargetCXXABI::GenericAArch64: case TargetCXXABI::GenericARM: + case TargetCXXABI::Emscripten: case TargetCXXABI::iOS: case TargetCXXABI::GenericItanium: return *CreateItaniumCXXABI(CGM); @@ -656,9 +657,11 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, if (alignment) F->setAlignment(alignment); - // C++ ABI requires 2-byte alignment for member functions. - if (F->getAlignment() < 2 && isa<CXXMethodDecl>(D)) - F->setAlignment(2); + if (getTarget().getCXXABI().arePointersToMemberFunctionsAligned()) { + // C++ ABI requires 2-byte alignment for member functions. + if (F->getAlignment() < 2 && isa<CXXMethodDecl>(D)) + F->setAlignment(2); + } } void CodeGenModule::SetCommonAttributes(const Decl *D, |