Chromium Code Reviews| Index: lib/CodeGen/CodeGenModule.cpp |
| diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp |
| index b6f1f4c97c79134b33e7fa65ecb5715428f6e1e1..aa3cac1e2f9ed2aabfe83985f025e35f2438da0f 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, |
| @@ -3557,4 +3562,3 @@ void CodeGenModule::EmitOMPThreadPrivateDecl(const OMPThreadPrivateDecl *D) { |
| CXXGlobalInits.push_back(InitFunction); |
| } |
| } |
| - |
|
jvoung (off chromium)
2015/03/20 17:07:07
nit: extra change?
JF
2015/03/20 18:49:38
Oops, emacs decided to delete the extra line.
|