| Index: lib/CodeGen/CodeGenModule.cpp
|
| diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
|
| index b6f1f4c97c79134b33e7fa65ecb5715428f6e1e1..dea71c867fe4934c8d0e7a0dab485182304651f8 100644
|
| --- a/lib/CodeGen/CodeGenModule.cpp
|
| +++ b/lib/CodeGen/CodeGenModule.cpp
|
| @@ -62,6 +62,7 @@ static CGCXXABI *createCXXABI(CodeGenModule &CGM) {
|
| switch (CGM.getTarget().getCXXABI().getKind()) {
|
| case TargetCXXABI::GenericAArch64:
|
| case TargetCXXABI::GenericARM:
|
| + case TargetCXXABI::Emscripten: // @LOCALMOD Emscripten
|
| case TargetCXXABI::iOS:
|
| case TargetCXXABI::iOS64:
|
| case TargetCXXABI::GenericItanium:
|
| @@ -787,9 +788,13 @@ 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);
|
| + // @LOCALMOD-START Emscripten
|
| + if (getTarget().getCXXABI().arePointersToMemberFunctionsAligned()) {
|
| + // C++ ABI requires 2-byte alignment for member functions.
|
| + if (F->getAlignment() < 2 && isa<CXXMethodDecl>(D))
|
| + F->setAlignment(2);
|
| + }
|
| + // @LOCALMOD-END Emscripten
|
| }
|
|
|
| void CodeGenModule::SetCommonAttributes(const Decl *D,
|
|
|