Index: include/clang/Basic/TargetCXXABI.h |
diff --git a/include/clang/Basic/TargetCXXABI.h b/include/clang/Basic/TargetCXXABI.h |
index 5669d2a55937da80fd50b351d0cdb2cde89228e6..ff05966c33f76f676b8d1f6e0f5e2051b0ebc9e8 100644 |
--- a/include/clang/Basic/TargetCXXABI.h |
+++ b/include/clang/Basic/TargetCXXABI.h |
@@ -79,6 +79,12 @@ public: |
/// - guard variables are smaller. |
GenericAArch64, |
+ // @LOCALMOD-START Emscripten |
+ /// Emscripten uses the Itanium C++, with the exception that it uses |
+ /// ARM-style pointers to member functions. |
+ Emscripten, |
+ // @LOCALMOD-END Emscripten |
+ |
/// The Microsoft ABI is the ABI used by Microsoft Visual Studio (and |
/// compatible compilers). |
/// |
@@ -112,6 +118,7 @@ public: |
case GenericAArch64: |
case GenericItanium: |
case GenericARM: |
+ case Emscripten: // @LOCALMOD Emscripten |
case iOS: |
case iOS64: |
return true; |
@@ -128,6 +135,7 @@ public: |
case GenericAArch64: |
case GenericItanium: |
case GenericARM: |
+ case Emscripten: // @LOCALMOD Emscripten |
case iOS: |
case iOS64: |
return false; |
@@ -138,6 +146,30 @@ public: |
llvm_unreachable("bad ABI kind"); |
} |
+ // @LOCALMOD-START Emscripten |
+ /// \brief Are pointers to member functions differently aligned? |
+ bool arePointersToMemberFunctionsAligned() const { |
+ switch (getKind()) { |
+ case Emscripten: |
+ // Emscripten uses table indices for function pointers and therefore |
+ // doesn't require alignment. |
+ return false; |
+ case GenericARM: |
+ case GenericAArch64: |
+ // ARM-style pointers to member functions put the discriminator in the |
+ // this adjustment, so they don't require functions to have any special |
+ // alignment. |
+ return false; |
+ case GenericItanium: |
jvoung (off chromium)
2015/03/20 17:07:07
Hmm, so LE32 uses GenericItanium directly and does
JF
2015/03/20 18:49:38
As discussed on IRC I left ARM as it was, with a T
|
+ case iOS: |
+ case iOS64: |
+ case Microsoft: |
+ return true; |
+ } |
+ llvm_unreachable("bad ABI kind"); |
+ } |
+ // @LOCALMOD-END Emscripten |
+ |
/// \brief Is the default C++ member function calling convention |
/// the same as the default calling convention? |
bool isMemberFunctionCCDefault() const { |
@@ -210,6 +242,7 @@ public: |
case GenericAArch64: |
case GenericItanium: |
+ case Emscripten: // @LOCALMOD Emscripten |
case iOS: // old iOS compilers did not follow this rule |
case Microsoft: |
return true; |
@@ -256,6 +289,7 @@ public: |
case GenericItanium: |
case GenericAArch64: |
case GenericARM: |
+ case Emscripten: // @LOCALMOD Emscripten |
case iOS: |
return UseTailPaddingUnlessPOD03; |