TargetCXXABI.def 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. //===--- TargetCXXABI.def - Target C++ ABI database --------------- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file defines the various C++ ABI kinds used on different platforms.
  10. // Users of this file must define the CXXABI macro to make use of this
  11. // information.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef CXXABI
  15. #error Define the CXXABI macro to handle C++ ABI kinds.
  16. #endif
  17. #ifndef ITANIUM_CXXABI
  18. #define ITANIUM_CXXABI(Name, Str) CXXABI(Name, Str)
  19. #endif
  20. #ifndef MICROSOFT_CXXABI
  21. #define MICROSOFT_CXXABI(Name, Str) CXXABI(Name, Str)
  22. #endif
  23. /// The generic Itanium ABI is the standard ABI of most open-source
  24. /// and Unix-like platforms. It is the primary ABI targeted by
  25. /// many compilers, including Clang and GCC.
  26. ///
  27. /// It is documented here:
  28. /// http://www.codesourcery.com/public/cxx-abi/
  29. ITANIUM_CXXABI(GenericItanium, "itanium")
  30. /// The generic ARM ABI is a modified version of the Itanium ABI
  31. /// proposed by ARM for use on ARM-based platforms.
  32. ///
  33. /// These changes include:
  34. /// - the representation of member function pointers is adjusted
  35. /// to not conflict with the 'thumb' bit of ARM function pointers;
  36. /// - constructors and destructors return 'this';
  37. /// - guard variables are smaller;
  38. /// - inline functions are never key functions;
  39. /// - array cookies have a slightly different layout;
  40. /// - additional convenience functions are specified;
  41. /// - and more!
  42. ///
  43. /// It is documented here:
  44. /// http://infocenter.arm.com
  45. /// /help/topic/com.arm.doc.ihi0041c/IHI0041C_cppabi.pdf
  46. ITANIUM_CXXABI(GenericARM, "arm")
  47. /// The iOS ABI is a partial implementation of the ARM ABI.
  48. /// Several of the features of the ARM ABI were not fully implemented
  49. /// in the compilers that iOS was launched with.
  50. ///
  51. /// Essentially, the iOS ABI includes the ARM changes to:
  52. /// - member function pointers,
  53. /// - guard variables,
  54. /// - array cookies, and
  55. /// - constructor/destructor signatures.
  56. ITANIUM_CXXABI(iOS, "ios")
  57. /// The iOS 64-bit and macOS 64-bit ARM ABI follows ARM's published 64-bit
  58. /// ABI more closely, but we don't guarantee to follow it perfectly.
  59. ///
  60. /// It is documented here:
  61. /// http://infocenter.arm.com
  62. /// /help/topic/com.arm.doc.ihi0059a/IHI0059A_cppabi64.pdf
  63. ITANIUM_CXXABI(AppleARM64, "applearm64")
  64. /// WatchOS is a modernisation of the iOS ABI, which roughly means it's
  65. /// the iOS64 ABI ported to 32-bits. The primary difference from iOS64 is
  66. /// that RTTI objects must still be unique at the moment.
  67. ITANIUM_CXXABI(WatchOS, "watchos")
  68. /// The generic AArch64 ABI is also a modified version of the Itanium ABI,
  69. /// but it has fewer divergences than the 32-bit ARM ABI.
  70. ///
  71. /// The relevant changes from the generic ABI in this case are:
  72. /// - representation of member function pointers adjusted as in ARM.
  73. /// - guard variables are smaller.
  74. ITANIUM_CXXABI(GenericAArch64, "aarch64")
  75. /// The generic Mips ABI is a modified version of the Itanium ABI.
  76. ///
  77. /// At the moment, only change from the generic ABI in this case is:
  78. /// - representation of member function pointers adjusted as in ARM.
  79. ITANIUM_CXXABI(GenericMIPS, "mips")
  80. /// The WebAssembly ABI is a modified version of the Itanium ABI.
  81. ///
  82. /// The changes from the Itanium ABI are:
  83. /// - representation of member function pointers is adjusted, as in ARM;
  84. /// - member functions are not specially aligned;
  85. /// - constructors and destructors return 'this', as in ARM;
  86. /// - guard variables are 32-bit on wasm32, as in ARM;
  87. /// - unused bits of guard variables are reserved, as in ARM;
  88. /// - inline functions are never key functions, as in ARM;
  89. /// - C++11 POD rules are used for tail padding, as in iOS64.
  90. ///
  91. /// TODO: At present the WebAssembly ABI is not considered stable, so none
  92. /// of these details is necessarily final yet.
  93. ITANIUM_CXXABI(WebAssembly, "webassembly")
  94. /// The Fuchsia ABI is a modified version of the Itanium ABI.
  95. ///
  96. /// The relevant changes from the Itanium ABI are:
  97. /// - constructors and destructors return 'this', as in ARM.
  98. ITANIUM_CXXABI(Fuchsia, "fuchsia")
  99. /// The XL ABI is the ABI used by IBM xlclang compiler and is a modified
  100. /// version of the Itanium ABI.
  101. ///
  102. /// The relevant changes from the Itanium ABI are:
  103. /// - static initialization is adjusted to use sinit and sterm functions;
  104. ITANIUM_CXXABI(XL, "xl")
  105. /// The Microsoft ABI is the ABI used by Microsoft Visual Studio (and
  106. /// compatible compilers).
  107. ///
  108. /// FIXME: should this be split into Win32 and Win64 variants?
  109. ///
  110. /// Only scattered and incomplete official documentation exists.
  111. MICROSOFT_CXXABI(Microsoft, "microsoft")
  112. #undef CXXABI
  113. #undef ITANIUM_CXXABI
  114. #undef MICROSOFT_CXXABI