diff options
author | Dan Gohman <sunfish@mozilla.com> | 2014-04-25 16:00:38 -0700 |
---|---|---|
committer | Dan Gohman <sunfish@mozilla.com> | 2014-04-25 16:00:38 -0700 |
commit | 364355da26053c321180fa31ecd731d36c4cffae (patch) | |
tree | 36308273d5ec44a8ad508b7726f5ca02cc14d373 /include/clang/Basic/TargetCXXABI.h | |
parent | ad32fdb927a37dba26cb8b56f3a6b11667fe6584 (diff) |
Don't align member functions.
Emscripten uses the ARM ABI for pointers to member functions and doesn't
require that member functions are aligned.
Diffstat (limited to 'include/clang/Basic/TargetCXXABI.h')
-rw-r--r-- | include/clang/Basic/TargetCXXABI.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/clang/Basic/TargetCXXABI.h b/include/clang/Basic/TargetCXXABI.h index 29e4e47076..abdf899f5d 100644 --- a/include/clang/Basic/TargetCXXABI.h +++ b/include/clang/Basic/TargetCXXABI.h @@ -134,6 +134,24 @@ public: llvm_unreachable("bad ABI kind"); } + /// \brief Are pointers to member functions differently aligned? + bool arePointersToMemberFunctionsAligned() const { + switch (getKind()) { + case Emscripten: + 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: + case iOS: + case Microsoft: + return true; + } + llvm_unreachable("bad ABI kind"); + } + /// \brief Is the default C++ member function calling convention /// the same as the default calling convention? bool isMemberFunctionCCDefault() const { |