diff --git a/llvm/include/llvm-c/Error.h b/llvm/include/llvm-c/Error.h --- a/llvm/include/llvm-c/Error.h +++ b/llvm/include/llvm-c/Error.h @@ -14,6 +14,7 @@ #ifndef LLVM_C_ERROR_H #define LLVM_C_ERROR_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" LLVM_C_EXTERN_C_BEGIN @@ -41,7 +42,7 @@ * Returns the type id for the given error instance, which must be a failure * value (i.e. non-null). */ -LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err); +LLVM_ABI LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err); /** * Dispose of the given error without handling it. This operation consumes the @@ -49,7 +50,7 @@ * Note: This method *only* needs to be called if the error is not being passed * to some other consuming operation, e.g. LLVMGetErrorMessage. */ -void LLVMConsumeError(LLVMErrorRef Err); +LLVM_ABI void LLVMConsumeError(LLVMErrorRef Err); /** * Returns the given string's error message. This operation consumes the error, @@ -57,22 +58,22 @@ * The caller is responsible for disposing of the string by calling * LLVMDisposeErrorMessage. */ -char *LLVMGetErrorMessage(LLVMErrorRef Err); +LLVM_ABI char *LLVMGetErrorMessage(LLVMErrorRef Err); /** * Dispose of the given error message. */ -void LLVMDisposeErrorMessage(char *ErrMsg); +LLVM_ABI void LLVMDisposeErrorMessage(char *ErrMsg); /** * Returns the type id for llvm StringError. */ -LLVMErrorTypeId LLVMGetStringErrorTypeId(void); +LLVM_ABI LLVMErrorTypeId LLVMGetStringErrorTypeId(void); /** * Create a StringError. */ -LLVMErrorRef LLVMCreateStringError(const char *ErrMsg); +LLVM_ABI LLVMErrorRef LLVMCreateStringError(const char *ErrMsg); /** * @} diff --git a/llvm/include/llvm-c/ErrorHandling.h b/llvm/include/llvm-c/ErrorHandling.h --- a/llvm/include/llvm-c/ErrorHandling.h +++ b/llvm/include/llvm-c/ErrorHandling.h @@ -14,6 +14,7 @@ #ifndef LLVM_C_ERRORHANDLING_H #define LLVM_C_ERRORHANDLING_H +#include "llvm/Support/Compiler.h" #include "llvm-c/ExternC.h" LLVM_C_EXTERN_C_BEGIN @@ -33,20 +34,21 @@ * function allows you to install a callback that will be invoked prior to the * call to exit(1). */ -void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler); +LLVM_ABI void +LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler); /** * Reset the fatal error handler. This resets LLVM's fatal error handling * behavior to the default. */ -void LLVMResetFatalErrorHandler(void); +LLVM_ABI void LLVMResetFatalErrorHandler(void); /** * Enable LLVM's built-in stack trace code. This intercepts the OS's crash * signals and prints which component of LLVM you were in at the time if the * crash. */ -void LLVMEnablePrettyStackTrace(void); +LLVM_ABI void LLVMEnablePrettyStackTrace(void); /** * @} diff --git a/llvm/include/llvm-c/Support.h b/llvm/include/llvm-c/Support.h --- a/llvm/include/llvm-c/Support.h +++ b/llvm/include/llvm-c/Support.h @@ -32,7 +32,7 @@ * * @see sys::DynamicLibrary::LoadLibraryPermanently() */ -LLVMBool LLVMLoadLibraryPermanently(const char* Filename); +LLVM_ABI LLVMBool LLVMLoadLibraryPermanently(const char* Filename); /** * This function parses the given arguments using the LLVM command line parser. @@ -42,8 +42,9 @@ * * @see llvm::cl::ParseCommandLineOptions() */ -void LLVMParseCommandLineOptions(int argc, const char *const *argv, - const char *Overview); +LLVM_ABI void LLVMParseCommandLineOptions(int argc, + const char *const *argv, + const char *Overview); /** * This function will search through all previously loaded dynamic @@ -52,7 +53,7 @@ * * @see sys::DynamicLibrary::SearchForAddressOfSymbol() */ -void *LLVMSearchForAddressOfSymbol(const char *symbolName); +LLVM_ABI void *LLVMSearchForAddressOfSymbol(const char *symbolName); /** * This functions permanently adds the symbol \p symbolName with the @@ -61,7 +62,7 @@ * * @see sys::DynamicLibrary::AddSymbol() */ -void LLVMAddSymbol(const char *symbolName, void *symbolValue); +LLVM_ABI void LLVMAddSymbol(const char *symbolName, void *symbolValue); /** * @} diff --git a/llvm/include/llvm/ADT/APFixedPoint.h b/llvm/include/llvm/ADT/APFixedPoint.h --- a/llvm/include/llvm/ADT/APFixedPoint.h +++ b/llvm/include/llvm/ADT/APFixedPoint.h @@ -32,7 +32,7 @@ /// if any). The scale represents the number of fractional bits in this type. /// When HasUnsignedPadding is true and this type is unsigned, the first bit /// in the value this represents is treated as padding. -class FixedPointSemantics { +class LLVM_ABI FixedPointSemantics { public: static constexpr unsigned WidthBitWidth = 16; static constexpr unsigned LsbWeightBitWidth = 13; @@ -129,7 +129,7 @@ return hash_value(bit_cast(Val)); } -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline FixedPointSemantics getEmptyKey() { return FixedPointSemantics(0, 0, false, false, false); } @@ -151,7 +151,7 @@ /// JTC1 SC22 WG14 N1169. The class carries the value and semantics of /// a fixed point, and provides different operations that would normally be /// performed on fixed point types. -class APFixedPoint { +class LLVM_ABI APFixedPoint { public: APFixedPoint(const APInt &Val, const FixedPointSemantics &Sema) : Val(Val, !Sema.isSigned()), Sema(Sema) { @@ -298,7 +298,7 @@ return hash_combine(Val.getSemantics(), Val.getValue()); } -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline APFixedPoint getEmptyKey() { return APFixedPoint(DenseMapInfo::getEmptyKey()); } diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h --- a/llvm/include/llvm/ADT/APFloat.h +++ b/llvm/include/llvm/ADT/APFloat.h @@ -139,7 +139,7 @@ // This is the common type definitions shared by APFloat and its internal // implementation classes. This struct should not define any non-static data // members. -struct APFloatBase { +struct LLVM_ABI APFloatBase { typedef APInt::WordType integerPart; static constexpr unsigned integerPartWidth = APInt::APINT_BITS_PER_WORD; @@ -290,7 +290,7 @@ namespace detail { -class IEEEFloat final : public APFloatBase { +class LLVM_ABI IEEEFloat final : public APFloatBase { public: /// \name Constructors /// @{ @@ -656,16 +656,16 @@ unsigned int sign : 1; }; -hash_code hash_value(const IEEEFloat &Arg); -int ilogb(const IEEEFloat &Arg); -IEEEFloat scalbn(IEEEFloat X, int Exp, IEEEFloat::roundingMode); -IEEEFloat frexp(const IEEEFloat &Val, int &Exp, IEEEFloat::roundingMode RM); +LLVM_ABI hash_code hash_value(const IEEEFloat &Arg); +LLVM_ABI int ilogb(const IEEEFloat &Arg); +LLVM_ABI IEEEFloat scalbn(IEEEFloat X, int Exp, IEEEFloat::roundingMode); +LLVM_ABI IEEEFloat frexp(const IEEEFloat &Val, int &Exp, IEEEFloat::roundingMode RM); // This mode implements more precise float in terms of two APFloats. // The interface and layout is designed for arbitrary underlying semantics, // though currently only PPCDoubleDouble semantics are supported, whose // corresponding underlying semantics are IEEEdouble. -class DoubleAPFloat final : public APFloatBase { +class LLVM_ABI DoubleAPFloat final : public APFloatBase { // Note: this must be the first data member. const fltSemantics *Semantics; std::unique_ptr Floats; @@ -752,13 +752,13 @@ friend hash_code hash_value(const DoubleAPFloat &Arg); }; -hash_code hash_value(const DoubleAPFloat &Arg); +LLVM_ABI hash_code hash_value(const DoubleAPFloat &Arg); } // End detail namespace // This is a interface class that is currently forwarding functionalities from // detail::IEEEFloat. -class APFloat : public APFloatBase { +class LLVM_ABI APFloat : public APFloatBase { typedef detail::IEEEFloat IEEEFloat; typedef detail::DoubleAPFloat DoubleAPFloat; @@ -1328,8 +1328,8 @@ /// /// These additional declarations are required in order to compile LLVM with IBM /// xlC compiler. -hash_code hash_value(const APFloat &Arg); -inline APFloat scalbn(APFloat X, int Exp, APFloat::roundingMode RM) { +LLVM_ABI hash_code hash_value(const APFloat &Arg); +LLVM_ABI inline APFloat scalbn(APFloat X, int Exp, APFloat::roundingMode RM) { if (APFloat::usesLayout(X.getSemantics())) return APFloat(scalbn(X.U.IEEE, Exp, RM), X.getSemantics()); if (APFloat::usesLayout(X.getSemantics())) @@ -1426,8 +1426,8 @@ const APFloat &DoubleAPFloat::getFirst() const { return Floats[0]; } APFloat &DoubleAPFloat::getSecond() { return Floats[1]; } const APFloat &DoubleAPFloat::getSecond() const { return Floats[1]; } -DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp, APFloat::roundingMode RM); -DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, APFloat::roundingMode); +LLVM_ABI DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp, APFloat::roundingMode RM); +LLVM_ABI DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, APFloat::roundingMode); } // namespace detail diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h --- a/llvm/include/llvm/ADT/APInt.h +++ b/llvm/include/llvm/ADT/APInt.h @@ -36,7 +36,7 @@ class APInt; -inline APInt operator-(APInt); +LLVM_ABI inline APInt operator-(APInt); //===----------------------------------------------------------------------===// // APInt Class @@ -73,7 +73,7 @@ /// shifts are defined, but sign extension and ashr is not. Zero bit values /// compare and hash equal to themselves, and countLeadingZeros returns 0. /// -class [[nodiscard]] APInt { +class LLVM_ABI [[nodiscard]] APInt { public: typedef uint64_t WordType; @@ -2193,7 +2193,7 @@ /// using Stein's algorithm. /// /// \returns the greatest common divisor of A and B. -APInt GreatestCommonDivisor(APInt A, APInt B); +LLVM_ABI APInt GreatestCommonDivisor(APInt A, APInt B); /// Converts the given APInt to a double value. /// @@ -2224,7 +2224,7 @@ /// Converts the given double value into a APInt. /// /// This function convert a double value to an APInt value. -APInt RoundDoubleToAPInt(double Double, unsigned width); +LLVM_ABI APInt RoundDoubleToAPInt(double Double, unsigned width); /// Converts a float value into a APInt. /// @@ -2234,10 +2234,10 @@ } /// Return A unsign-divided by B, rounded by the given rounding mode. -APInt RoundingUDiv(const APInt &A, const APInt &B, APInt::Rounding RM); +LLVM_ABI APInt RoundingUDiv(const APInt &A, const APInt &B, APInt::Rounding RM); /// Return A sign-divided by B, rounded by the given rounding mode. -APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM); +LLVM_ABI APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM); /// Let q(n) = An^2 + Bn + C, and BW = bit width of the value range /// (e.g. 32 for i32). @@ -2272,12 +2272,12 @@ /// /// The returned value may have a different bit width from the input /// coefficients. -std::optional SolveQuadraticEquationWrap(APInt A, APInt B, APInt C, +LLVM_ABI std::optional SolveQuadraticEquationWrap(APInt A, APInt B, APInt C, unsigned RangeWidth); /// Compare two values, and if they are different, return the position of the /// most significant bit that is different in the values. -std::optional GetMostSignificantDifferentBit(const APInt &A, +LLVM_ABI std::optional GetMostSignificantDifferentBit(const APInt &A, const APInt &B); /// Splat/Merge neighboring bits to widen/narrow the bitmask represented @@ -2291,24 +2291,24 @@ /// e.g. ScaleBitMask(0b0101, 8) -> 0b00110011 /// e.g. ScaleBitMask(0b00011011, 4) -> 0b0001 /// A.getBitwidth() or NewBitWidth must be a whole multiples of the other. -APInt ScaleBitMask(const APInt &A, unsigned NewBitWidth, +LLVM_ABI APInt ScaleBitMask(const APInt &A, unsigned NewBitWidth, bool MatchAllBits = false); } // namespace APIntOps // See friend declaration above. This additional declaration is required in // order to compile LLVM with IBM xlC compiler. -hash_code hash_value(const APInt &Arg); +LLVM_ABI hash_code hash_value(const APInt &Arg); /// StoreIntToMemory - Fills the StoreBytes bytes of memory starting from Dst /// with the integer held in IntVal. -void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes); +LLVM_ABI void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes); /// LoadIntFromMemory - Loads the integer stored in the LoadBytes bytes starting /// from Src into IntVal, which is assumed to be wide enough and to hold zero. -void LoadIntFromMemory(APInt &IntVal, const uint8_t *Src, unsigned LoadBytes); +LLVM_ABI void LoadIntFromMemory(APInt &IntVal, const uint8_t *Src, unsigned LoadBytes); /// Provide DenseMapInfo for APInt. -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline APInt getEmptyKey() { APInt V(nullptr, 0); V.U.VAL = ~0ULL; diff --git a/llvm/include/llvm/ADT/APSInt.h b/llvm/include/llvm/ADT/APSInt.h --- a/llvm/include/llvm/ADT/APSInt.h +++ b/llvm/include/llvm/ADT/APSInt.h @@ -20,7 +20,7 @@ namespace llvm { /// An arbitrary precision integer that knows its signedness. -class [[nodiscard]] APSInt : public APInt { +class LLVM_ABI [[nodiscard]] APSInt : public APInt { bool IsUnsigned = false; public: @@ -367,7 +367,7 @@ } /// Provide DenseMapInfo for APSInt, using the DenseMapInfo for APInt. -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline APSInt getEmptyKey() { return APSInt(DenseMapInfo::getEmptyKey()); } diff --git a/llvm/include/llvm/ADT/AllocatorList.h b/llvm/include/llvm/ADT/AllocatorList.h --- a/llvm/include/llvm/ADT/AllocatorList.h +++ b/llvm/include/llvm/ADT/AllocatorList.h @@ -30,7 +30,8 @@ /// Because this list owns the allocator, calling \a splice() with a different /// list isn't generally safe. As such, \a splice has been left out of the /// interface entirely. -template class AllocatorList : AllocatorT { +template +class LLVM_ABI AllocatorList : AllocatorT { struct Node : ilist_node { Node(Node &&) = delete; Node(const Node &) = delete; diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h --- a/llvm/include/llvm/ADT/ArrayRef.h +++ b/llvm/include/llvm/ADT/ArrayRef.h @@ -38,7 +38,7 @@ /// This is intended to be trivially copyable, so it should be passed by /// value. template - class LLVM_GSL_POINTER [[nodiscard]] ArrayRef { + class LLVM_ABI LLVM_GSL_POINTER [[nodiscard]] ArrayRef { public: using value_type = T; using pointer = value_type *; @@ -302,7 +302,7 @@ /// This is intended to be trivially copyable, so it should be passed by /// value. template - class [[nodiscard]] MutableArrayRef : public ArrayRef { + class LLVM_ABI [[nodiscard]] MutableArrayRef : public ArrayRef { public: using value_type = T; using pointer = value_type *; @@ -444,7 +444,7 @@ }; /// This is a MutableArrayRef that owns its array. - template class OwningArrayRef : public MutableArrayRef { + template class LLVM_ABI OwningArrayRef : public MutableArrayRef { public: OwningArrayRef() = default; OwningArrayRef(size_t Size) : MutableArrayRef(new T[Size], Size) {} @@ -691,7 +691,7 @@ } // Provide DenseMapInfo for ArrayRefs. - template struct DenseMapInfo, void> { + template struct LLVM_ABI DenseMapInfo, void> { static inline ArrayRef getEmptyKey() { return ArrayRef( reinterpret_cast(~static_cast(0)), size_t(0)); diff --git a/llvm/include/llvm/ADT/BitVector.h b/llvm/include/llvm/ADT/BitVector.h --- a/llvm/include/llvm/ADT/BitVector.h +++ b/llvm/include/llvm/ADT/BitVector.h @@ -31,7 +31,7 @@ /// ForwardIterator for the bits that are set. /// Iterators get invalidated when resize / reserve is called. -template class const_set_bits_iterator_impl { +template class LLVM_ABI const_set_bits_iterator_impl { const BitVectorT &Parent; int Current = 0; @@ -79,7 +79,7 @@ } }; -class BitVector { +class LLVM_ABI BitVector { typedef uintptr_t BitWord; enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT }; @@ -836,7 +836,7 @@ return X.getMemorySize(); } -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline BitVector getEmptyKey() { return {}; } static inline BitVector getTombstoneKey() { BitVector V; diff --git a/llvm/include/llvm/ADT/BitmaskEnum.h b/llvm/include/llvm/ADT/BitmaskEnum.h --- a/llvm/include/llvm/ADT/BitmaskEnum.h +++ b/llvm/include/llvm/ADT/BitmaskEnum.h @@ -94,10 +94,10 @@ /// Traits class to determine whether an enum has a /// LLVM_BITMASK_LARGEST_ENUMERATOR enumerator. template -struct is_bitmask_enum : std::false_type {}; +struct LLVM_ABI is_bitmask_enum : std::false_type {}; template -struct is_bitmask_enum< +struct LLVM_ABI is_bitmask_enum< E, std::enable_if_t= 0>> : std::true_type {}; @@ -105,7 +105,7 @@ template struct largest_bitmask_enum_bit; template -struct largest_bitmask_enum_bit< +struct LLVM_ABI largest_bitmask_enum_bit< E, std::enable_if_t= 0>> { using UnderlyingTy = std::underlying_type_t; static constexpr UnderlyingTy value = diff --git a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h --- a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h +++ b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h @@ -8,6 +8,7 @@ #ifndef LLVM_ADT_DAGDELTAALGORITHM_H #define LLVM_ADT_DAGDELTAALGORITHM_H +#include "llvm/Support/Compiler.h" #include #include #include @@ -35,7 +36,7 @@ /// substantially fewer tests with appropriate dependencies. \see DeltaAlgorithm /// for more information on the properties which the predicate function itself /// should satisfy. -class DAGDeltaAlgorithm { +class LLVM_ABI DAGDeltaAlgorithm { virtual void anchor(); public: diff --git a/llvm/include/llvm/ADT/DeltaAlgorithm.h b/llvm/include/llvm/ADT/DeltaAlgorithm.h --- a/llvm/include/llvm/ADT/DeltaAlgorithm.h +++ b/llvm/include/llvm/ADT/DeltaAlgorithm.h @@ -8,6 +8,7 @@ #ifndef LLVM_ADT_DELTAALGORITHM_H #define LLVM_ADT_DELTAALGORITHM_H +#include "llvm/Support/Compiler.h" #include #include @@ -32,7 +33,7 @@ /// requirements, and the algorithm will generally produce reasonable /// results. However, it may run substantially more tests than with a good /// predicate. -class DeltaAlgorithm { +class LLVM_ABI DeltaAlgorithm { public: using change_ty = unsigned; // FIXME: Use a decent data structure. diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h --- a/llvm/include/llvm/ADT/DenseMap.h +++ b/llvm/include/llvm/ADT/DenseMap.h @@ -39,7 +39,7 @@ // We extend a pair to allow users to override the bucket type with their own // implementation without requiring two members. template -struct DenseMapPair : public std::pair { +struct LLVM_ABI DenseMapPair : public std::pair { using std::pair::pair; KeyT &getFirst() { return std::pair::first; } @@ -58,7 +58,7 @@ template -class DenseMapBase : public DebugEpochBase { +class LLVM_ABI DenseMapBase : public DebugEpochBase { template using const_arg_type_t = typename const_pointer_or_const_ref::type; @@ -738,7 +738,7 @@ template , typename BucketT = llvm::detail::DenseMapPair> -class DenseMap : public DenseMapBase, +class LLVM_ABI DenseMap : public DenseMapBase, KeyT, ValueT, KeyInfoT, BucketT> { friend class DenseMapBase; @@ -904,7 +904,7 @@ template , typename BucketT = llvm::detail::DenseMapPair> -class SmallDenseMap +class LLVM_ABI SmallDenseMap : public DenseMapBase< SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT> { @@ -1218,7 +1218,7 @@ template -class DenseMapIterator : DebugEpochBase::HandleBase { +class LLVM_ABI DenseMapIterator : DebugEpochBase::HandleBase { friend class DenseMapIterator; friend class DenseMapIterator; diff --git a/llvm/include/llvm/ADT/DenseMapInfo.h b/llvm/include/llvm/ADT/DenseMapInfo.h --- a/llvm/include/llvm/ADT/DenseMapInfo.h +++ b/llvm/include/llvm/ADT/DenseMapInfo.h @@ -21,6 +21,8 @@ #include #include +#include "llvm/Support/Compiler.h" + namespace llvm { namespace detail { @@ -47,7 +49,7 @@ /// in derived DenseMapInfo specializations; in non-SFINAE use cases this should /// just be `void`. template -struct DenseMapInfo { +struct LLVM_ABI DenseMapInfo { //static inline T getEmptyKey(); //static inline T getTombstoneKey(); //static unsigned getHashValue(const T &Val); @@ -60,7 +62,7 @@ // declared key types. Assume that no pointer key type requires more than 4096 // bytes of alignment. template -struct DenseMapInfo { +struct LLVM_ABI DenseMapInfo { // The following should hold, but it would require T to be complete: // static_assert(alignof(T) <= (1 << Log2MaxAlign), // "DenseMap does not support pointer keys requiring more than " @@ -88,7 +90,7 @@ }; // Provide DenseMapInfo for chars. -template<> struct DenseMapInfo { +template<> struct LLVM_ABI DenseMapInfo { static inline char getEmptyKey() { return ~0; } static inline char getTombstoneKey() { return ~0 - 1; } static unsigned getHashValue(const char& Val) { return Val * 37U; } @@ -99,7 +101,7 @@ }; // Provide DenseMapInfo for unsigned chars. -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline unsigned char getEmptyKey() { return ~0; } static inline unsigned char getTombstoneKey() { return ~0 - 1; } static unsigned getHashValue(const unsigned char &Val) { return Val * 37U; } @@ -110,7 +112,7 @@ }; // Provide DenseMapInfo for unsigned shorts. -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline unsigned short getEmptyKey() { return 0xFFFF; } static inline unsigned short getTombstoneKey() { return 0xFFFF - 1; } static unsigned getHashValue(const unsigned short &Val) { return Val * 37U; } @@ -121,7 +123,7 @@ }; // Provide DenseMapInfo for unsigned ints. -template<> struct DenseMapInfo { +template<> struct LLVM_ABI DenseMapInfo { static inline unsigned getEmptyKey() { return ~0U; } static inline unsigned getTombstoneKey() { return ~0U - 1; } static unsigned getHashValue(const unsigned& Val) { return Val * 37U; } @@ -132,7 +134,7 @@ }; // Provide DenseMapInfo for unsigned longs. -template<> struct DenseMapInfo { +template<> struct LLVM_ABI DenseMapInfo { static inline unsigned long getEmptyKey() { return ~0UL; } static inline unsigned long getTombstoneKey() { return ~0UL - 1L; } @@ -146,7 +148,7 @@ }; // Provide DenseMapInfo for unsigned long longs. -template<> struct DenseMapInfo { +template<> struct LLVM_ABI DenseMapInfo { static inline unsigned long long getEmptyKey() { return ~0ULL; } static inline unsigned long long getTombstoneKey() { return ~0ULL - 1ULL; } @@ -161,7 +163,7 @@ }; // Provide DenseMapInfo for shorts. -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline short getEmptyKey() { return 0x7FFF; } static inline short getTombstoneKey() { return -0x7FFF - 1; } static unsigned getHashValue(const short &Val) { return Val * 37U; } @@ -169,7 +171,7 @@ }; // Provide DenseMapInfo for ints. -template<> struct DenseMapInfo { +template<> struct LLVM_ABI DenseMapInfo { static inline int getEmptyKey() { return 0x7fffffff; } static inline int getTombstoneKey() { return -0x7fffffff - 1; } static unsigned getHashValue(const int& Val) { return (unsigned)(Val * 37U); } @@ -180,7 +182,7 @@ }; // Provide DenseMapInfo for longs. -template<> struct DenseMapInfo { +template<> struct LLVM_ABI DenseMapInfo { static inline long getEmptyKey() { return (1UL << (sizeof(long) * 8 - 1)) - 1UL; } @@ -197,7 +199,7 @@ }; // Provide DenseMapInfo for long longs. -template<> struct DenseMapInfo { +template<> struct LLVM_ABI DenseMapInfo { static inline long long getEmptyKey() { return 0x7fffffffffffffffLL; } static inline long long getTombstoneKey() { return -0x7fffffffffffffffLL-1; } @@ -213,7 +215,7 @@ // Provide DenseMapInfo for all pairs whose members have info. template -struct DenseMapInfo> { +struct LLVM_ABI DenseMapInfo> { using Pair = std::pair; using FirstInfo = DenseMapInfo; using SecondInfo = DenseMapInfo; @@ -248,7 +250,7 @@ }; // Provide DenseMapInfo for all tuples whose members have info. -template struct DenseMapInfo> { +template struct LLVM_ABI DenseMapInfo> { using Tuple = std::tuple; static inline Tuple getEmptyKey() { diff --git a/llvm/include/llvm/ADT/DenseSet.h b/llvm/include/llvm/ADT/DenseSet.h --- a/llvm/include/llvm/ADT/DenseSet.h +++ b/llvm/include/llvm/ADT/DenseSet.h @@ -27,11 +27,12 @@ namespace detail { -struct DenseSetEmpty {}; +struct LLVM_ABI DenseSetEmpty {}; // Use the empty base class trick so we can create a DenseMap where the buckets // contain only a single item. -template class DenseSetPair : public DenseSetEmpty { +template +class LLVM_ABI DenseSetPair : public DenseSetEmpty { KeyT key; public: @@ -51,7 +52,7 @@ /// or the equivalent SmallDenseMap type. ValueInfoT must implement the /// DenseMapInfo "concept". template -class DenseSetImpl { +class LLVM_ABI DenseSetImpl { static_assert(sizeof(typename MapTy::value_type) == sizeof(ValueT), "DenseMap buckets unexpectedly large!"); MapTy TheMap; @@ -265,7 +266,7 @@ /// Implements a dense probed hash-table based set. template > -class DenseSet : public detail::DenseSetImpl< +class LLVM_ABI DenseSet : public detail::DenseSetImpl< ValueT, DenseMap>, ValueInfoT> { @@ -283,7 +284,7 @@ /// stored inline. template > -class SmallDenseSet +class LLVM_ABI SmallDenseSet : public detail::DenseSetImpl< ValueT, SmallDenseMap>, diff --git a/llvm/include/llvm/ADT/EpochTracker.h b/llvm/include/llvm/ADT/EpochTracker.h --- a/llvm/include/llvm/ADT/EpochTracker.h +++ b/llvm/include/llvm/ADT/EpochTracker.h @@ -85,7 +85,7 @@ #define LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE #endif // _MSC_VER -class DebugEpochBase { +class LLVM_ABI DebugEpochBase { public: void incrementEpoch() {} diff --git a/llvm/include/llvm/ADT/FloatingPointMode.h b/llvm/include/llvm/ADT/FloatingPointMode.h --- a/llvm/include/llvm/ADT/FloatingPointMode.h +++ b/llvm/include/llvm/ADT/FloatingPointMode.h @@ -67,7 +67,7 @@ /// Represent subnormal handling kind for floating point instruction inputs and /// outputs. -struct DenormalMode { +struct LLVM_ABI DenormalMode { /// Represent handled modes for denormal (aka subnormal) modes in the floating /// point environment. enum DenormalModeKind : int8_t { @@ -265,13 +265,13 @@ LLVM_DECLARE_ENUM_AS_BITMASK(FPClassTest, /* LargestValue */ fcPosInf); /// Return the test mask which returns true if the value's sign bit is flipped. -FPClassTest fneg(FPClassTest Mask); +LLVM_ABI FPClassTest fneg(FPClassTest Mask); /// Return the test mask which returns true if the value's sign bit is cleared. -FPClassTest fabs(FPClassTest Mask); +LLVM_ABI FPClassTest fabs(FPClassTest Mask); /// Write a human readable form of \p Mask to \p OS -raw_ostream &operator<<(raw_ostream &OS, FPClassTest Mask); +LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, FPClassTest Mask); } // namespace llvm diff --git a/llvm/include/llvm/ADT/FoldingSet.h b/llvm/include/llvm/ADT/FoldingSet.h --- a/llvm/include/llvm/ADT/FoldingSet.h +++ b/llvm/include/llvm/ADT/FoldingSet.h @@ -112,7 +112,7 @@ /// in the bucket via a singly linked list. The last node in the list points /// back to the bucket to facilitate node removal. /// -class FoldingSetBase { +class LLVM_ABI FoldingSetBase { protected: /// Buckets - Array of bucket chains. void **Buckets; @@ -228,7 +228,7 @@ /// DefaultFoldingSetTrait - This class provides default implementations /// for FoldingSetTrait implementations. -template struct DefaultFoldingSetTrait { +template struct LLVM_ABI DefaultFoldingSetTrait { static void Profile(const T &X, FoldingSetNodeID &ID) { X.Profile(ID); } @@ -258,12 +258,12 @@ /// types. Combined with the FoldingSetNodeWrapper class, one can add objects /// to FoldingSets that were not originally designed to have that behavior. template -struct FoldingSetTrait : public DefaultFoldingSetTrait {}; +struct LLVM_ABI FoldingSetTrait : public DefaultFoldingSetTrait {}; /// DefaultContextualFoldingSetTrait - Like DefaultFoldingSetTrait, but /// for ContextualFoldingSets. template -struct DefaultContextualFoldingSetTrait { +struct LLVM_ABI DefaultContextualFoldingSetTrait { static void Profile(T &X, FoldingSetNodeID &ID, Ctx Context) { X.Profile(ID, Context); } @@ -276,7 +276,7 @@ /// ContextualFoldingSetTrait - Like FoldingSetTrait, but for /// ContextualFoldingSets. -template struct ContextualFoldingSetTrait +template struct LLVM_ABI ContextualFoldingSetTrait : public DefaultContextualFoldingSetTrait {}; //===--------------------------------------------------------------------===// @@ -285,7 +285,7 @@ /// than using plain FoldingSetNodeIDs, since the 32-element SmallVector /// is often much larger than necessary, and the possibility of heap /// allocation means it requires a non-trivial destructor call. -class FoldingSetNodeIDRef { +class LLVM_ABI FoldingSetNodeIDRef { const unsigned *Data = nullptr; size_t Size = 0; @@ -315,7 +315,7 @@ /// FoldingSetNodeID - This class is used to gather all the unique data bits of /// a node. When all the bits are gathered this class is used to produce a /// hash value for the node. -class FoldingSetNodeID { +class LLVM_ABI FoldingSetNodeID { /// Bits - Vector of all the data bits that make the node unique. /// Use a SmallVector to avoid a heap allocation in the common case. SmallVector Bits; @@ -432,7 +432,7 @@ //===----------------------------------------------------------------------===// /// FoldingSetImpl - An implementation detail that lets us share code between /// FoldingSet and ContextualFoldingSet. -template class FoldingSetImpl : public FoldingSetBase { +template class LLVM_ABI FoldingSetImpl : public FoldingSetBase { protected: explicit FoldingSetImpl(unsigned Log2InitSize) : FoldingSetBase(Log2InitSize) {} @@ -517,7 +517,7 @@ /// move-assigning and destroying. This is primarily to enable movable APIs /// that incorporate these objects. template -class FoldingSet : public FoldingSetImpl, T> { +class LLVM_ABI FoldingSet : public FoldingSetImpl, T> { using Super = FoldingSetImpl; using Node = typename Super::Node; @@ -569,7 +569,7 @@ /// function with signature /// void Profile(FoldingSetNodeID &, Ctx); template -class ContextualFoldingSet +class LLVM_ABI ContextualFoldingSet : public FoldingSetImpl, T> { // Unfortunately, this can't derive from FoldingSet because the // construction of the vtable for FoldingSet requires @@ -628,7 +628,7 @@ /// order based on the insertion order. T must be a subclass of FoldingSetNode /// and implement a Profile function. template > -class FoldingSetVector { +class LLVM_ABI FoldingSetVector { FoldingSet Set; VectorT Vector; @@ -689,7 +689,7 @@ //===----------------------------------------------------------------------===// /// FoldingSetIteratorImpl - This is the common iterator support shared by all /// folding sets, which knows how to walk the folding set hash table. -class FoldingSetIteratorImpl { +class LLVM_ABI FoldingSetIteratorImpl { protected: FoldingSetNode *NodePtr; @@ -706,7 +706,7 @@ } }; -template class FoldingSetIterator : public FoldingSetIteratorImpl { +template class LLVM_ABI FoldingSetIterator : public FoldingSetIteratorImpl { public: explicit FoldingSetIterator(void **Bucket) : FoldingSetIteratorImpl(Bucket) {} @@ -731,7 +731,7 @@ /// FoldingSetBucketIteratorImpl - This is the common bucket iterator support /// shared by all folding sets, which knows how to walk a particular bucket /// of a folding set hash table. -class FoldingSetBucketIteratorImpl { +class LLVM_ABI FoldingSetBucketIteratorImpl { protected: void *Ptr; @@ -755,7 +755,7 @@ }; template -class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl { +class LLVM_ABI FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl { public: explicit FoldingSetBucketIterator(void **Bucket) : FoldingSetBucketIteratorImpl(Bucket) {} @@ -779,7 +779,7 @@ /// FoldingSetNodeWrapper - This template class is used to "wrap" arbitrary /// types in an enclosing object so that they can be inserted into FoldingSets. template -class FoldingSetNodeWrapper : public FoldingSetNode { +class LLVM_ABI FoldingSetNodeWrapper : public FoldingSetNode { T data; public: @@ -802,7 +802,7 @@ /// each time it is needed. This trades space for speed (which can be /// significant if the ID is long), and it also permits nodes to drop /// information that would otherwise only be required for recomputing an ID. -class FastFoldingSetNode : public FoldingSetNode { +class LLVM_ABI FastFoldingSetNode : public FoldingSetNode { FoldingSetNodeID FastID; protected: @@ -815,13 +815,13 @@ //===----------------------------------------------------------------------===// // Partial specializations of FoldingSetTrait. -template struct FoldingSetTrait { +template struct LLVM_ABI FoldingSetTrait { static inline void Profile(T *X, FoldingSetNodeID &ID) { ID.AddPointer(X); } }; template -struct FoldingSetTrait> { +struct LLVM_ABI FoldingSetTrait> { static inline void Profile(const std::pair &P, FoldingSetNodeID &ID) { ID.Add(P.first); @@ -830,7 +830,7 @@ }; template -struct FoldingSetTrait::value>> { +struct LLVM_ABI FoldingSetTrait::value>> { static void Profile(const T &X, FoldingSetNodeID &ID) { ID.AddInteger(static_cast>(X)); } diff --git a/llvm/include/llvm/ADT/GraphTraits.h b/llvm/include/llvm/ADT/GraphTraits.h --- a/llvm/include/llvm/ADT/GraphTraits.h +++ b/llvm/include/llvm/ADT/GraphTraits.h @@ -33,8 +33,7 @@ // differently without requiring a copy of the original graph. This could // be achieved by carrying more data in NodeRef. See LoopBodyTraits for one // example. -template -struct GraphTraits { +template struct LLVM_ABI GraphTraits { // Elements to provide: // typedef NodeRef - Type of Node token in the graph, which should @@ -93,8 +92,7 @@ // df_iterator> I = idf_begin(M), E = idf_end(M); // for (; I != E; ++I) { ... } // -template -struct Inverse { +template struct LLVM_ABI Inverse { const GraphType &Graph; inline Inverse(const GraphType &G) : Graph(G) {} @@ -102,7 +100,8 @@ // Provide a partial specialization of GraphTraits so that the inverse of an // inverse falls back to the original graph. -template struct GraphTraits>> : GraphTraits {}; +template +struct LLVM_ABI GraphTraits>> : GraphTraits {}; // Provide iterator ranges for the graph traits nodes and children template diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h --- a/llvm/include/llvm/ADT/Hashing.h +++ b/llvm/include/llvm/ADT/Hashing.h @@ -71,7 +71,7 @@ /// using llvm::hash_value; /// llvm::hash_code code = hash_value(x); /// \endcode -class hash_code { +class LLVM_ABI hash_code { size_t value; public: @@ -140,7 +140,7 @@ /// undone. This makes it thread-hostile and very hard to use outside of /// immediately on start of a simple program designed for reproducible /// behavior. -void set_fixed_execution_hash_seed(uint64_t fixed_value); +LLVM_ABI void set_fixed_execution_hash_seed(uint64_t fixed_value); // All of the implementation details of actually computing the various hash @@ -265,7 +265,7 @@ /// The intermediate state used during hashing. /// Currently, the algorithm for computing hash codes is based on CityHash and /// keeps 56 bytes of arbitrary state. -struct hash_state { +struct LLVM_ABI hash_state { uint64_t h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0, h5 = 0, h6 = 0; /// Create a new hash_state structure and initialize it based on the @@ -328,7 +328,7 @@ /// This variable can be set using the \see llvm::set_fixed_execution_seed /// function. See that function for details. Do not, under any circumstances, /// set or read this variable. -extern uint64_t fixed_seed_override; +LLVM_ABI extern uint64_t fixed_seed_override; inline uint64_t get_execution_seed() { // FIXME: This needs to be a per-execution seed. This is just a placeholder @@ -355,7 +355,7 @@ // for equality. For all the platforms we care about, this holds for integers // and pointers, but there are platforms where it doesn't and we would like to // support user-defined types which happen to satisfy this property. -template struct is_hashable_data +template struct LLVM_ABI is_hashable_data : std::integral_constant::value || std::is_pointer::value) && 64 % sizeof(T) == 0)> {}; @@ -364,7 +364,7 @@ // is no alignment-derived padding in the pair. This is a bit of a lie because // std::pair isn't truly POD, but it's close enough in all reasonable // implementations for our use case of hashing the underlying data. -template struct is_hashable_data > +template struct LLVM_ABI is_hashable_data > : std::integral_constant::value && is_hashable_data::value && (sizeof(T) + sizeof(U)) == @@ -504,7 +504,7 @@ /// recursive combining of arguments used in hash_combine. It is particularly /// useful at minimizing the code in the recursive calls to ease the pain /// caused by a lack of variadic functions. -struct hash_combine_recursive_helper { +struct LLVM_ABI hash_combine_recursive_helper { char buffer[64] = {}; hash_state state; const uint64_t seed; @@ -674,7 +674,7 @@ return arg ? hash_combine(true, *arg) : hash_value(false); } -template <> struct DenseMapInfo { +template <> struct LLVM_ABI DenseMapInfo { static inline hash_code getEmptyKey() { return hash_code(-1); } static inline hash_code getTombstoneKey() { return hash_code(-2); } static unsigned getHashValue(hash_code val) { return val; } diff --git a/llvm/include/llvm/ADT/IntEqClasses.h b/llvm/include/llvm/ADT/IntEqClasses.h --- a/llvm/include/llvm/ADT/IntEqClasses.h +++ b/llvm/include/llvm/ADT/IntEqClasses.h @@ -25,7 +25,7 @@ namespace llvm { -class IntEqClasses { +class LLVM_ABI IntEqClasses { /// EC - When uncompressed, map each integer to a smaller member of its /// equivalence class. The class leader is the smallest member and maps to /// itself. diff --git a/llvm/include/llvm/ADT/IntervalMap.h b/llvm/include/llvm/ADT/IntervalMap.h --- a/llvm/include/llvm/ADT/IntervalMap.h +++ b/llvm/include/llvm/ADT/IntervalMap.h @@ -137,7 +137,7 @@ //===----------------------------------------------------------------------===// template -struct IntervalMapInfo { +struct LLVM_ABI IntervalMapInfo { /// startLess - Return true if x is not in [a;b]. /// This is x < a both for closed intervals and for [a;b) half-open intervals. static inline bool startLess(const T &x, const T &a) { @@ -164,7 +164,7 @@ }; template -struct IntervalMapHalfOpenInfo { +struct LLVM_ABI IntervalMapHalfOpenInfo { /// startLess - Return true if x is not in [a;b). static inline bool startLess(const T &x, const T &a) { return x < a; @@ -220,7 +220,7 @@ //===----------------------------------------------------------------------===// template -class NodeBase { +class LLVM_ABI NodeBase { public: enum { Capacity = N }; @@ -411,7 +411,7 @@ /// @param Position Insert position. /// @param Grow Reserve space for a new element at Position. /// @return (node, offset) for Position. -IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity, +LLVM_ABI IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity, const unsigned *CurSize, unsigned NewSize[], unsigned Position, bool Grow); @@ -436,7 +436,7 @@ }; template -struct NodeSizer { +struct LLVM_ABI NodeSizer { enum { // Compute the leaf node branching factor that makes a node fit in three // cache lines. The branching factor must be at least 3, or some B+-tree @@ -490,7 +490,7 @@ // //===----------------------------------------------------------------------===// -class NodeRef { +class LLVM_ABI NodeRef { struct CacheAlignedPointerTraits { static inline void *getAsVoidPointer(void *P) { return P; } static inline void *getFromVoidPointer(void *P) { return P; } @@ -563,7 +563,7 @@ //===----------------------------------------------------------------------===// template -class LeafNode : public NodeBase, ValT, N> { +class LLVM_ABI LeafNode : public NodeBase, ValT, N> { public: const KeyT &start(unsigned i) const { return this->first[i].first; } const KeyT &stop(unsigned i) const { return this->first[i].second; } @@ -700,7 +700,7 @@ //===----------------------------------------------------------------------===// template -class BranchNode : public NodeBase { +class LLVM_ABI BranchNode : public NodeBase { public: const KeyT &stop(unsigned i) const { return this->second[i]; } const NodeRef &subtree(unsigned i) const { return this->first[i]; } @@ -770,7 +770,7 @@ // //===----------------------------------------------------------------------===// -class Path { +class LLVM_ABI Path { /// Entry - Each step in the path is a node pointer and an offset into that /// node. struct Entry { @@ -933,7 +933,7 @@ template ::LeafSize, typename Traits = IntervalMapInfo> -class IntervalMap { +class LLVM_ABI IntervalMap { using Sizer = IntervalMapImpl::NodeSizer; using Leaf = IntervalMapImpl::LeafNode; using Branch = @@ -2107,7 +2107,7 @@ /// for (IntervalMapOverlaps I(a, b); I.valid() ; ++I) { ... } /// template -class IntervalMapOverlaps { +class LLVM_ABI IntervalMapOverlaps { using KeyType = typename MapA::KeyType; using Traits = typename MapA::KeyTraits; diff --git a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h --- a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h +++ b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h @@ -60,6 +60,7 @@ #ifndef LLVM_ADT_INTRUSIVEREFCNTPTR_H #define LLVM_ADT_INTRUSIVEREFCNTPTR_H +#include "llvm/Support/Compiler.h" #include #include #include @@ -73,7 +74,7 @@ /// calls to Release() and Retain(), which increment and decrement the object's /// refcount, respectively. When a Release() call decrements the refcount to 0, /// the object deletes itself. -template class RefCountedBase { +template class LLVM_ABI RefCountedBase { mutable unsigned RefCount = 0; protected: @@ -103,7 +104,7 @@ }; /// A thread-safe version of \c RefCountedBase. -template class ThreadSafeRefCountedBase { +template class LLVM_ABI ThreadSafeRefCountedBase { mutable std::atomic RefCount{0}; protected: @@ -154,7 +155,7 @@ /// forward-declares Foo and specializes IntrusiveRefCntPtrInfo. Then /// Bar.h could use IntrusiveRefCntPtr, although it still couldn't call any /// functions on Foo itself, because Foo would be an incomplete type. -template struct IntrusiveRefCntPtrInfo { +template struct LLVM_ABI IntrusiveRefCntPtrInfo { static void retain(T *obj) { obj->Retain(); } static void release(T *obj) { obj->Release(); } }; @@ -165,7 +166,7 @@ /// This class increments its pointee's reference count when it is created, and /// decrements its refcount when it's destroyed (or is changed to point to a /// different object). -template class IntrusiveRefCntPtr { +template class LLVM_ABI IntrusiveRefCntPtr { T *Obj = nullptr; public: @@ -283,7 +284,8 @@ // Casting.h. template struct simplify_type; -template struct simplify_type> { +template +struct LLVM_ABI simplify_type> { using SimpleType = T *; static SimpleType getSimplifiedValue(IntrusiveRefCntPtr &Val) { @@ -291,7 +293,8 @@ } }; -template struct simplify_type> { +template +struct LLVM_ABI simplify_type> { using SimpleType = /*const*/ T *; static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr &Val) { diff --git a/llvm/include/llvm/ADT/PointerIntPair.h b/llvm/include/llvm/ADT/PointerIntPair.h --- a/llvm/include/llvm/ADT/PointerIntPair.h +++ b/llvm/include/llvm/ADT/PointerIntPair.h @@ -25,7 +25,7 @@ namespace llvm { namespace detail { -template struct PunnedPointer { +template struct LLVM_ABI PunnedPointer { static_assert(sizeof(Ptr) == sizeof(intptr_t), ""); // Asserts that allow us to let the compiler implement the destructor and @@ -77,7 +77,7 @@ template , typename Info = PointerIntPairInfo> -class PointerIntPair { +class LLVM_ABI PointerIntPair { // Used by MSVC visualizer and generally helpful for debugging/visualizing. using InfoTy = Info; detail::PunnedPointer Value; @@ -165,7 +165,7 @@ }; template -struct PointerIntPairInfo { +struct LLVM_ABI PointerIntPairInfo { static_assert(PtrTraits::NumLowBitsAvailable < std::numeric_limits::digits, "cannot use a pointer type that has all bits free"); @@ -216,7 +216,7 @@ // Provide specialization of DenseMapInfo for PointerIntPair. template -struct DenseMapInfo, void> { +struct LLVM_ABI DenseMapInfo, void> { using Ty = PointerIntPair; static Ty getEmptyKey() { @@ -242,7 +242,7 @@ // Teach SmallPtrSet that PointerIntPair is "basically a pointer". template -struct PointerLikeTypeTraits< +struct LLVM_ABI PointerLikeTypeTraits< PointerIntPair> { static inline void * getAsVoidPointer(const PointerIntPair &P) { @@ -280,13 +280,13 @@ namespace std { template -struct tuple_size< +struct LLVM_ABI tuple_size< llvm::PointerIntPair> : std::integral_constant {}; template -struct tuple_element< +struct LLVM_ABI tuple_element< I, llvm::PointerIntPair> : std::conditional {}; } // namespace std diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -51,20 +51,20 @@ // Extra additions to //===----------------------------------------------------------------------===// -template struct make_const_ptr { +template struct LLVM_ABI make_const_ptr { using type = std::add_pointer_t>; }; -template struct make_const_ref { +template struct LLVM_ABI make_const_ref { using type = std::add_lvalue_reference_t>; }; namespace detail { -template class Op, class... Args> struct detector { +template class Op, class... Args> struct LLVM_ABI detector { using value_t = std::false_type; }; template