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/LLVMSupportExports.h"
 #include "llvm-c/ExternC.h"
 
 LLVM_C_EXTERN_C_BEGIN
@@ -34,7 +35,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_SUPPORT_ABI LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err);
 
 /**
  * Dispose of the given error without handling it. This operation consumes the
@@ -42,7 +43,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_SUPPORT_ABI void LLVMConsumeError(LLVMErrorRef Err);
 
 /**
  * Returns the given string's error message. This operation consumes the error,
@@ -50,17 +51,17 @@
  * The caller is responsible for disposing of the string by calling
  * LLVMDisposeErrorMessage.
  */
-char *LLVMGetErrorMessage(LLVMErrorRef Err);
+LLVM_SUPPORT_ABI char *LLVMGetErrorMessage(LLVMErrorRef Err);
 
 /**
  * Dispose of the given error message.
  */
-void LLVMDisposeErrorMessage(char *ErrMsg);
+LLVM_SUPPORT_ABI void LLVMDisposeErrorMessage(char *ErrMsg);
 
 /**
  * Returns the type id for llvm StringError.
  */
-LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
+LLVM_SUPPORT_ABI LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
 
 /**
  * Create a StringError.
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
@@ -15,6 +15,7 @@
 #define LLVM_C_ERRORHANDLING_H
 
 #include "llvm-c/ExternC.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 LLVM_C_EXTERN_C_BEGIN
 
@@ -40,7 +41,7 @@
  * signals and prints which component of LLVM you were in at the time if the
  * crash.
  */
-void LLVMEnablePrettyStackTrace(void);
+LLVM_SUPPORT_ABI void LLVMEnablePrettyStackTrace(void);
 
 LLVM_C_EXTERN_C_END
 
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
@@ -18,6 +18,7 @@
 
 #include "llvm/ADT/APSInt.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
@@ -30,7 +31,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_SUPPORT_ABI FixedPointSemantics {
 public:
   FixedPointSemantics(unsigned Width, unsigned Scale, bool IsSigned,
                       bool IsSaturated, bool HasUnsignedPadding)
@@ -97,7 +98,7 @@
 /// info about the fixed point type's width, sign, scale, and saturation, and
 /// provides different operations that would normally be performed on fixed point
 /// types.
-class APFixedPoint {
+class LLVM_SUPPORT_ABI APFixedPoint {
 public:
   APFixedPoint(const APInt &Val, const FixedPointSemantics &Sema)
       : Val(Val, !Sema.isSigned()), Sema(Sema) {
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
@@ -20,6 +20,8 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/FloatingPointMode.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <memory>
 
 #define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL)                             \
@@ -140,7 +142,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_SUPPORT_ABI APFloatBase {
   typedef APInt::WordType integerPart;
   static constexpr unsigned integerPartWidth = APInt::APINT_BITS_PER_WORD;
 
@@ -244,7 +246,7 @@
 
 namespace detail {
 
-class IEEEFloat final : public APFloatBase {
+class LLVM_SUPPORT_ABI IEEEFloat final : public APFloatBase {
 public:
   /// \name Constructors
   /// @{
@@ -404,7 +406,7 @@
   /// emphasizes producing different codes for different inputs in order to
   /// be used in canonicalization and memoization. As such, equality is
   /// bitwiseIsEqual, and 0 != -0.
-  friend hash_code hash_value(const IEEEFloat &Arg);
+  friend LLVM_SUPPORT_ABI hash_code hash_value(const IEEEFloat &Arg);
 
   /// Converts this value into a decimal string.
   ///
@@ -448,12 +450,12 @@
   ///   0   -> \c IEK_Zero
   ///   Inf -> \c IEK_Inf
   ///
-  friend int ilogb(const IEEEFloat &Arg);
+  friend LLVM_SUPPORT_ABI int ilogb(const IEEEFloat &Arg);
 
   /// Returns: X * 2^Exp for integral exponents.
-  friend IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode);
+  friend LLVM_SUPPORT_ABI IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode);
 
-  friend IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode);
+  friend LLVM_SUPPORT_ABI IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode);
 
   /// \name Special value setters.
   /// @{
@@ -590,16 +592,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_SUPPORT_ABI hash_code hash_value(const IEEEFloat &Arg);
+LLVM_SUPPORT_ABI int ilogb(const IEEEFloat &Arg);
+LLVM_SUPPORT_ABI IEEEFloat scalbn(IEEEFloat X, int Exp, IEEEFloat::roundingMode);
+LLVM_SUPPORT_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_SUPPORT_ABI DoubleAPFloat final : public APFloatBase {
   // Note: this must be the first data member.
   const fltSemantics *Semantics;
   std::unique_ptr<APFloat[]> Floats;
@@ -687,8 +689,8 @@
 
   bool getExactInverse(APFloat *inv) const;
 
-  friend DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp, roundingMode);
-  friend DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode);
+  friend LLVM_SUPPORT_ABI DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp, roundingMode);
+  friend LLVM_SUPPORT_ABI DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode);
   friend hash_code hash_value(const DoubleAPFloat &Arg);
 };
 
@@ -698,7 +700,7 @@
 
 // This is a interface class that is currently forwarding functionalities from
 // detail::IEEEFloat.
-class APFloat : public APFloatBase {
+class LLVM_SUPPORT_ABI APFloat : public APFloatBase {
   typedef detail::IEEEFloat IEEEFloat;
   typedef detail::DoubleAPFloat DoubleAPFloat;
 
@@ -1248,7 +1250,7 @@
     APFLOAT_DISPATCH_ON_SEMANTICS(getExactInverse(inv));
   }
 
-  friend hash_code hash_value(const APFloat &Arg);
+  friend LLVM_SUPPORT_ABI hash_code hash_value(const APFloat &Arg);
   friend int ilogb(const APFloat &Arg) { return ilogb(Arg.getIEEE()); }
   friend APFloat scalbn(APFloat X, int Exp, roundingMode RM);
   friend APFloat frexp(const APFloat &X, int &Exp, roundingMode RM);
@@ -1260,7 +1262,8 @@
 ///
 /// These additional declarations are required in order to compile LLVM with IBM
 /// xlC compiler.
-hash_code hash_value(const APFloat &Arg);
+LLVM_SUPPORT_ABI hash_code hash_value(const APFloat &Arg);
+
 inline APFloat scalbn(APFloat X, int Exp, APFloat::roundingMode RM) {
   if (APFloat::usesLayout<detail::IEEEFloat>(X.getSemantics()))
     return APFloat(scalbn(X.U.IEEE, Exp, RM), X.getSemantics());
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
@@ -16,7 +16,9 @@
 #define LLVM_ADT_APINT_H
 
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MathExtras.h"
+
 #include <cassert>
 #include <climits>
 #include <cstring>
@@ -67,7 +69,7 @@
 ///   * In general, the class tries to follow the style of computation that LLVM
 ///     uses in its IR. This simplifies its use for LLVM.
 ///
-class LLVM_NODISCARD APInt {
+class LLVM_SUPPORT_ABI LLVM_NODISCARD APInt {
 public:
   typedef uint64_t WordType;
 
@@ -686,7 +688,7 @@
   }
 
   /// Overload to compute a hash_code for an APInt value.
-  friend hash_code hash_value(const APInt &Arg);
+  friend LLVM_SUPPORT_ABI hash_code hash_value(const APInt &Arg);
 
   /// This function returns a pointer to the internal storage of the APInt.
   /// This is useful for writing out the APInt in binary form without any
@@ -2190,7 +2192,7 @@
 /// using Stein's algorithm.
 ///
 /// \returns the greatest common divisor of A and B.
-APInt GreatestCommonDivisor(APInt A, APInt B);
+LLVM_SUPPORT_ABI APInt GreatestCommonDivisor(APInt A, APInt B);
 
 /// Converts the given APInt to a double value.
 ///
@@ -2221,7 +2223,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_SUPPORT_ABI APInt RoundDoubleToAPInt(double Double, unsigned width);
 
 /// Converts a float value into a APInt.
 ///
@@ -2231,10 +2233,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_SUPPORT_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_SUPPORT_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).
@@ -2269,30 +2271,30 @@
 ///
 /// The returned value may have a different bit width from the input
 /// coefficients.
-Optional<APInt> SolveQuadraticEquationWrap(APInt A, APInt B, APInt C,
+LLVM_SUPPORT_ABI Optional<APInt> 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.
-Optional<unsigned> GetMostSignificantDifferentBit(const APInt &A,
+LLVM_SUPPORT_ABI Optional<unsigned> GetMostSignificantDifferentBit(const APInt &A,
                                                   const APInt &B);
 
 } // End of APIntOps namespace
 
 // 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_SUPPORT_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_SUPPORT_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_SUPPORT_ABI void LoadIntFromMemory(APInt &IntVal, const uint8_t *Src, unsigned LoadBytes);
 
 /// Provide DenseMapInfo for APInt.
-template <> struct DenseMapInfo<APInt> {
+template <> struct LLVM_SUPPORT_ABI DenseMapInfo<APInt> {
   static inline APInt getEmptyKey() {
     APInt V(nullptr, 0);
     V.U.VAL = 0;
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
@@ -15,11 +15,13 @@
 #define LLVM_ADT_APSINT_H
 
 #include "llvm/ADT/APInt.h"
+#include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
 /// An arbitrary precision integer that knows its signedness.
-class LLVM_NODISCARD APSInt : public APInt {
+class LLVM_SUPPORT_ABI LLVM_NODISCARD APSInt : public APInt {
   bool IsUnsigned;
 
 public:
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,8 @@
 #ifndef LLVM_ADT_DAGDELTAALGORITHM_H
 #define LLVM_ADT_DAGDELTAALGORITHM_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <set>
 #include <utility>
 #include <vector>
@@ -35,7 +37,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_SUPPORT_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,8 @@
 #ifndef LLVM_ADT_DELTAALGORITHM_H
 #define LLVM_ADT_DELTAALGORITHM_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <set>
 #include <vector>
 
@@ -32,7 +34,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_SUPPORT_ABI DeltaAlgorithm {
 public:
   using change_ty = unsigned;
   // FIXME: Use a decent data structure.
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
@@ -16,6 +16,7 @@
 #define LLVM_ADT_EPOCHTRACKER_H
 
 #include "llvm/Config/abi-breaking.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 #include <cstdint>
 
@@ -32,7 +33,7 @@
 /// isHandleInSync at appropriate points to assert that the handle they're using
 /// is still valid.
 ///
-class DebugEpochBase {
+class LLVM_SUPPORT_ABI DebugEpochBase {
   uint64_t Epoch;
 
 public:
@@ -78,7 +79,7 @@
 
 #else
 
-class DebugEpochBase {
+class LLVM_SUPPORT_ABI DebugEpochBase {
 public:
   void incrementEpoch() {}
 
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
@@ -18,6 +18,8 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
@@ -109,7 +111,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_SUPPORT_ABI FoldingSetBase {
 protected:
   /// Buckets - Array of bucket chains.
   void **Buckets;
@@ -282,7 +284,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_SUPPORT_ABI FoldingSetNodeIDRef {
   const unsigned *Data = nullptr;
   size_t Size = 0;
 
@@ -310,7 +312,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_SUPPORT_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<unsigned, 32> Bits;
@@ -662,7 +664,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_SUPPORT_ABI FoldingSetIteratorImpl {
 protected:
   FoldingSetNode *NodePtr;
 
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
@@ -319,7 +319,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;
+extern LLVM_SUPPORT_ABI 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
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
@@ -21,10 +21,11 @@
 #define LLVM_ADT_INTEQCLASSES_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
-class IntEqClasses {
+class LLVM_SUPPORT_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
@@ -108,7 +108,9 @@
 #include "llvm/ADT/bit.h"
 #include "llvm/Support/AlignOf.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/RecyclingAllocator.h"
+
 #include <algorithm>
 #include <cassert>
 #include <cstdint>
@@ -413,6 +415,7 @@
 /// @param Position Insert position.
 /// @param Grow     Reserve space for a new element at Position.
 /// @return         (node, offset) for Position.
+LLVM_SUPPORT_ABI
 IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity,
                    const unsigned *CurSize, unsigned NewSize[],
                    unsigned Position, bool Grow);
@@ -492,7 +495,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-class NodeRef {
+class LLVM_SUPPORT_ABI NodeRef {
   struct CacheAlignedPointerTraits {
     static inline void *getAsVoidPointer(void *P) { return P; }
     static inline void *getFromVoidPointer(void *P) { return P; }
@@ -772,7 +775,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-class Path {
+class LLVM_SUPPORT_ABI Path {
   /// Entry - Each step in the path is a node pointer and an offset into that
   /// node.
   struct Entry {
diff --git a/llvm/include/llvm/ADT/Optional.h b/llvm/include/llvm/ADT/Optional.h
--- a/llvm/include/llvm/ADT/Optional.h
+++ b/llvm/include/llvm/ADT/Optional.h
@@ -19,7 +19,9 @@
 #include "llvm/ADT/None.h"
 #include "llvm/ADT/STLForwardCompat.h"
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/type_traits.h"
+
 #include <cassert>
 #include <memory>
 #include <new>
@@ -479,7 +481,7 @@
   return !(X < Y);
 }
 
-raw_ostream &operator<<(raw_ostream &OS, NoneType);
+LLVM_SUPPORT_ABI raw_ostream &operator<<(raw_ostream &OS, NoneType);
 
 template <typename T, typename = decltype(std::declval<raw_ostream &>()
                                           << std::declval<const T &>())>
diff --git a/llvm/include/llvm/ADT/SmallPtrSet.h b/llvm/include/llvm/ADT/SmallPtrSet.h
--- a/llvm/include/llvm/ADT/SmallPtrSet.h
+++ b/llvm/include/llvm/ADT/SmallPtrSet.h
@@ -16,8 +16,10 @@
 
 #include "llvm/ADT/EpochTracker.h"
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/ReverseIteration.h"
 #include "llvm/Support/type_traits.h"
+
 #include <cassert>
 #include <cstddef>
 #include <cstdlib>
@@ -46,7 +48,7 @@
 /// (-2), to allow deletion.  The hash table is resized when the table is 3/4 or
 /// more.  When this happens, the table is doubled in size.
 ///
-class SmallPtrSetImplBase : public DebugEpochBase {
+class LLVM_SUPPORT_ABI SmallPtrSetImplBase : public DebugEpochBase {
   friend class SmallPtrSetIteratorImpl;
 
 protected:
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -16,8 +16,10 @@
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MemAlloc.h"
 #include "llvm/Support/type_traits.h"
+
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
@@ -59,12 +61,12 @@
   /// This is a helper for \a grow() that's out of line to reduce code
   /// duplication.  This function will report a fatal error if it can't grow at
   /// least to \p MinSize.
-  void *mallocForGrow(size_t MinSize, size_t TSize, size_t &NewCapacity);
+  LLVM_SUPPORT_ABI void *mallocForGrow(size_t MinSize, size_t TSize, size_t &NewCapacity);
 
   /// This is an implementation of the grow() method which only works
   /// on POD-like data types and is out of line to reduce code duplication.
   /// This function will report a fatal error if it cannot increase capacity.
-  void grow_pod(void *FirstEl, size_t MinSize, size_t TSize);
+  LLVM_SUPPORT_ABI void grow_pod(void *FirstEl, size_t MinSize, size_t TSize);
 
 public:
   size_t size() const { return Size; }
@@ -87,6 +89,11 @@
   }
 };
 
+extern template class SmallVectorBase<uint32_t>;
+#if SIZE_MAX > UINT32_MAX
+extern template class SmallVectorBase<uint64_t>;
+#endif
+
 template <class T>
 using SmallVectorSizeType =
     typename std::conditional<sizeof(T) < 4 && sizeof(void *) >= 8, uint64_t,
diff --git a/llvm/include/llvm/ADT/Statistic.h b/llvm/include/llvm/ADT/Statistic.h
--- a/llvm/include/llvm/ADT/Statistic.h
+++ b/llvm/include/llvm/ADT/Statistic.h
@@ -27,6 +27,8 @@
 
 #include "llvm/Config/llvm-config.h"
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <atomic>
 #include <memory>
 #include <vector>
@@ -46,7 +48,7 @@
 class raw_fd_ostream;
 class StringRef;
 
-class TrackingStatistic {
+class LLVM_SUPPORT_ABI TrackingStatistic {
 public:
   const char *const DebugType;
   const char *const Name;
@@ -172,25 +174,25 @@
   static llvm::TrackingStatistic VARNAME = {DEBUG_TYPE, #VARNAME, DESC}
 
 /// Enable the collection and printing of statistics.
-void EnableStatistics(bool DoPrintOnExit = true);
+LLVM_SUPPORT_ABI void EnableStatistics(bool DoPrintOnExit = true);
 
 /// Check if statistics are enabled.
-bool AreStatisticsEnabled();
+LLVM_SUPPORT_ABI bool AreStatisticsEnabled();
 
 /// Return a file stream to print our output on.
-std::unique_ptr<raw_fd_ostream> CreateInfoOutputFile();
+LLVM_SUPPORT_ABI std::unique_ptr<raw_fd_ostream> CreateInfoOutputFile();
 
 /// Print statistics to the file returned by CreateInfoOutputFile().
-void PrintStatistics();
+LLVM_SUPPORT_ABI void PrintStatistics();
 
 /// Print statistics to the given output stream.
-void PrintStatistics(raw_ostream &OS);
+LLVM_SUPPORT_ABI void PrintStatistics(raw_ostream &OS);
 
 /// Print statistics in JSON format. This does include all global timers (\see
 /// Timer, TimerGroup). Note that the timers are cleared after printing and will
 /// not be printed in human readable form or in a second call of
 /// PrintStatisticsJSON().
-void PrintStatisticsJSON(raw_ostream &OS);
+LLVM_SUPPORT_ABI void PrintStatisticsJSON(raw_ostream &OS);
 
 /// Get the statistics. This can be used to look up the value of
 /// statistics without needing to parse JSON.
@@ -199,7 +201,7 @@
 /// during it's execution. It will return the value at the point that it is
 /// read. However, it will prevent new statistics from registering until it
 /// completes.
-const std::vector<std::pair<StringRef, unsigned>> GetStatistics();
+LLVM_SUPPORT_ABI const std::vector<std::pair<StringRef, unsigned>> GetStatistics();
 
 /// Reset the statistics. This can be used to zero and de-register the
 /// statistics in order to measure a compilation.
@@ -214,7 +216,7 @@
 /// compilation should ensure that no compilations are in progress at the point
 /// this function is called and that only one compilation executes until calling
 /// GetStatistics().
-void ResetStatistics();
+LLVM_SUPPORT_ABI void ResetStatistics();
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h
--- a/llvm/include/llvm/ADT/StringExtras.h
+++ b/llvm/include/llvm/ADT/StringExtras.h
@@ -18,6 +18,8 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
@@ -311,7 +313,7 @@
 /// StrInStrNoCase - Portable version of strcasestr.  Locates the first
 /// occurrence of string 's1' in string 's2', ignoring case.  Returns
 /// the offset of s2 in s1 or npos if s2 cannot be found.
-StringRef::size_type StrInStrNoCase(StringRef s1, StringRef s2);
+LLVM_SUPPORT_ABI StringRef::size_type StrInStrNoCase(StringRef s1, StringRef s2);
 
 /// getToken - This function extracts one token from source, ignoring any
 /// leading characters that appear in the Delimiters string, and ending the
@@ -319,11 +321,13 @@
 /// there are no tokens in the source string, an empty string is returned.
 /// The function returns a pair containing the extracted token and the
 /// remaining tail string.
+LLVM_SUPPORT_ABI
 std::pair<StringRef, StringRef> getToken(StringRef Source,
                                          StringRef Delimiters = " \t\n\v\f\r");
 
 /// SplitString - Split up the specified string according to the specified
 /// delimiters, appending the result fragments to the output list.
+LLVM_SUPPORT_ABI
 void SplitString(StringRef Source,
                  SmallVectorImpl<StringRef> &OutFragments,
                  StringRef Delimiters = " \t\n\v\f\r");
@@ -349,25 +353,25 @@
 
 /// Print each character of the specified string, escaping it if it is not
 /// printable or if it is an escape char.
-void printEscapedString(StringRef Name, raw_ostream &Out);
+LLVM_SUPPORT_ABI void printEscapedString(StringRef Name, raw_ostream &Out);
 
 /// Print each character of the specified string, escaping HTML special
 /// characters.
-void printHTMLEscaped(StringRef String, raw_ostream &Out);
+LLVM_SUPPORT_ABI void printHTMLEscaped(StringRef String, raw_ostream &Out);
 
 /// printLowerCase - Print each character as lowercase if it is uppercase.
-void printLowerCase(StringRef String, raw_ostream &Out);
+LLVM_SUPPORT_ABI void printLowerCase(StringRef String, raw_ostream &Out);
 
 /// Converts a string from camel-case to snake-case by replacing all uppercase
 /// letters with '_' followed by the letter in lowercase, except if the
 /// uppercase letter is the first character of the string.
-std::string convertToSnakeFromCamelCase(StringRef input);
+LLVM_SUPPORT_ABI std::string convertToSnakeFromCamelCase(StringRef input);
 
 /// Converts a string from snake-case to camel-case by replacing all occurrences
 /// of '_' followed by a lowercase letter with the letter in uppercase.
 /// Optionally allow capitalization of the first letter (if it is a lowercase
 /// letter)
-std::string convertToCamelFromSnakeCase(StringRef input,
+LLVM_SUPPORT_ABI std::string convertToCamelFromSnakeCase(StringRef input,
                                         bool capitalizeFirst = false);
 
 namespace detail {
diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
--- a/llvm/include/llvm/ADT/StringMap.h
+++ b/llvm/include/llvm/ADT/StringMap.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringMapEntry.h"
 #include "llvm/Support/AllocatorBase.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
 #include <initializer_list>
 #include <iterator>
@@ -27,7 +28,7 @@
 
 /// StringMapImpl - This is the base class of StringMap that is shared among
 /// all of its instantiations.
-class StringMapImpl {
+class LLVM_SUPPORT_ABI StringMapImpl {
 protected:
   // Array of NumBuckets pointers to entries, null pointers are holes.
   // TheTable[NumBuckets] contains a sentinel value for easy iteration. Followed
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h
--- a/llvm/include/llvm/ADT/StringRef.h
+++ b/llvm/include/llvm/ADT/StringRef.h
@@ -12,6 +12,8 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
@@ -39,13 +41,18 @@
   class StringRef;
 
   /// Helper functions for StringRef::getAsInteger.
+  LLVM_SUPPORT_ABI
   bool getAsUnsignedInteger(StringRef Str, unsigned Radix,
                             unsigned long long &Result);
 
+  LLVM_SUPPORT_ABI
   bool getAsSignedInteger(StringRef Str, unsigned Radix, long long &Result);
 
+  LLVM_SUPPORT_ABI
   bool consumeUnsignedInteger(StringRef &Str, unsigned Radix,
                               unsigned long long &Result);
+
+  LLVM_SUPPORT_ABI
   bool consumeSignedInteger(StringRef &Str, unsigned Radix, long long &Result);
 
   /// StringRef - Represent a constant reference to a string, i.e. a character
@@ -55,7 +62,7 @@
   /// situations where the character data resides in some other buffer, whose
   /// lifetime extends past that of the StringRef. For this reason, it is not in
   /// general safe to store a StringRef.
-  class LLVM_GSL_POINTER StringRef {
+  class LLVM_SUPPORT_ABI LLVM_GSL_POINTER StringRef {
   public:
     static constexpr size_t npos = ~size_t(0);
 
@@ -945,7 +952,7 @@
   /// @}
 
   /// Compute a hash_code for a StringRef.
-  LLVM_NODISCARD
+  LLVM_NODISCARD LLVM_SUPPORT_ABI
   hash_code hash_value(StringRef S);
 
   // Provide DenseMapInfo for StringRefs.
diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h
--- a/llvm/include/llvm/ADT/Triple.h
+++ b/llvm/include/llvm/ADT/Triple.h
@@ -10,6 +10,7 @@
 #define LLVM_ADT_TRIPLE_H
 
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 // Some system headers or GCC predefined macros conflict with identifiers in
 // this file.  Undefine them here.
@@ -42,7 +43,7 @@
 ///
 /// See autoconf/config.guess for a glimpse into what configuration names
 /// look like in practice.
-class Triple {
+class LLVM_SUPPORT_ABI Triple {
 public:
   enum ArchType {
     UnknownArch,
diff --git a/llvm/include/llvm/ADT/Twine.h b/llvm/include/llvm/ADT/Twine.h
--- a/llvm/include/llvm/ADT/Twine.h
+++ b/llvm/include/llvm/ADT/Twine.h
@@ -12,6 +12,8 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cassert>
 #include <cstdint>
 #include <string>
@@ -80,7 +82,7 @@
   /// so we provide two additional methods (and accompanying operator+
   /// overloads) to guarantee that particularly important cases (cstring plus
   /// StringRef) codegen as desired.
-  class Twine {
+  class LLVM_SUPPORT_ABI Twine {
     /// NodeKind - Represent the type of an argument.
     enum NodeKind : unsigned char {
       /// An empty string; the result of concatenating anything with it is also
diff --git a/llvm/include/llvm/Support/AArch64TargetParser.h b/llvm/include/llvm/Support/AArch64TargetParser.h
--- a/llvm/include/llvm/Support/AArch64TargetParser.h
+++ b/llvm/include/llvm/Support/AArch64TargetParser.h
@@ -17,6 +17,8 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/ARMTargetParser.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <vector>
 
 // FIXME:This should be made into class design,to avoid dupplication.
@@ -111,31 +113,31 @@
 };
 
 // FIXME: These should be moved to TargetTuple once it exists
-bool getExtensionFeatures(uint64_t Extensions,
+LLVM_SUPPORT_ABI bool getExtensionFeatures(uint64_t Extensions,
                           std::vector<StringRef> &Features);
-bool getArchFeatures(ArchKind AK, std::vector<StringRef> &Features);
+LLVM_SUPPORT_ABI bool getArchFeatures(ArchKind AK, std::vector<StringRef> &Features);
 
-StringRef getArchName(ArchKind AK);
-unsigned getArchAttr(ArchKind AK);
-StringRef getCPUAttr(ArchKind AK);
-StringRef getSubArch(ArchKind AK);
+LLVM_SUPPORT_ABI StringRef getArchName(ArchKind AK);
+LLVM_SUPPORT_ABI unsigned getArchAttr(ArchKind AK);
+LLVM_SUPPORT_ABI StringRef getCPUAttr(ArchKind AK);
+LLVM_SUPPORT_ABI StringRef getSubArch(ArchKind AK);
 StringRef getArchExtName(unsigned ArchExtKind);
-StringRef getArchExtFeature(StringRef ArchExt);
+LLVM_SUPPORT_ABI StringRef getArchExtFeature(StringRef ArchExt);
 
 // Information by Name
-unsigned getDefaultFPU(StringRef CPU, ArchKind AK);
-uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK);
-StringRef getDefaultCPU(StringRef Arch);
-ArchKind getCPUArchKind(StringRef CPU);
+LLVM_SUPPORT_ABI unsigned getDefaultFPU(StringRef CPU, ArchKind AK);
+LLVM_SUPPORT_ABI uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK);
+LLVM_SUPPORT_ABI StringRef getDefaultCPU(StringRef Arch);
+LLVM_SUPPORT_ABI ArchKind getCPUArchKind(StringRef CPU);
 
 // Parser
-ArchKind parseArch(StringRef Arch);
-ArchExtKind parseArchExt(StringRef ArchExt);
-ArchKind parseCPUArch(StringRef CPU);
+LLVM_SUPPORT_ABI ArchKind parseArch(StringRef Arch);
+LLVM_SUPPORT_ABI ArchExtKind parseArchExt(StringRef ArchExt);
+LLVM_SUPPORT_ABI ArchKind parseCPUArch(StringRef CPU);
 // Used by target parser tests
-void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
+LLVM_SUPPORT_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
 
-bool isX18ReservedByDefault(const Triple &TT);
+LLVM_SUPPORT_ABI bool isX18ReservedByDefault(const Triple &TT);
 
 struct ParsedBranchProtection {
   StringRef Scope;
@@ -143,7 +145,7 @@
   bool BranchTargetEnforcement;
 };
 
-bool parseBranchProtection(StringRef Spec, ParsedBranchProtection &PBP,
+LLVM_SUPPORT_ABI bool parseBranchProtection(StringRef Spec, ParsedBranchProtection &PBP,
                            StringRef &Err);
 
 } // namespace AArch64
diff --git a/llvm/include/llvm/Support/AMDGPUMetadata.h b/llvm/include/llvm/Support/AMDGPUMetadata.h
--- a/llvm/include/llvm/Support/AMDGPUMetadata.h
+++ b/llvm/include/llvm/Support/AMDGPUMetadata.h
@@ -16,6 +16,8 @@
 #define LLVM_SUPPORT_AMDGPUMETADATA_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cstdint>
 #include <string>
 #include <system_error>
@@ -441,10 +443,10 @@
 };
 
 /// Converts \p String to \p HSAMetadata.
-std::error_code fromString(StringRef String, Metadata &HSAMetadata);
+LLVM_SUPPORT_ABI std::error_code fromString(StringRef String, Metadata &HSAMetadata);
 
 /// Converts \p HSAMetadata to \p String.
-std::error_code toString(Metadata HSAMetadata, std::string &String);
+LLVM_SUPPORT_ABI std::error_code toString(Metadata HSAMetadata, std::string &String);
 
 //===----------------------------------------------------------------------===//
 // HSA metadata for v3 code object.
diff --git a/llvm/include/llvm/Support/ARMAttributeParser.h b/llvm/include/llvm/Support/ARMAttributeParser.h
--- a/llvm/include/llvm/Support/ARMAttributeParser.h
+++ b/llvm/include/llvm/Support/ARMAttributeParser.h
@@ -16,11 +16,12 @@
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 class StringRef;
 
-class ARMAttributeParser : public ELFAttributeParser {
+class LLVM_SUPPORT_ABI ARMAttributeParser : public ELFAttributeParser {
   struct DisplayHandler {
     ARMBuildAttrs::AttrType attribute;
     Error (ARMAttributeParser::*routine)(ARMBuildAttrs::AttrType);
diff --git a/llvm/include/llvm/Support/ARMBuildAttributes.h b/llvm/include/llvm/Support/ARMBuildAttributes.h
--- a/llvm/include/llvm/Support/ARMBuildAttributes.h
+++ b/llvm/include/llvm/Support/ARMBuildAttributes.h
@@ -19,11 +19,12 @@
 #define LLVM_SUPPORT_ARMBUILDATTRIBUTES_H
 
 #include "llvm/Support/ELFAttributes.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 namespace ARMBuildAttrs {
 
-const TagNameMap &getARMAttributeTags();
+LLVM_SUPPORT_ABI const TagNameMap &getARMAttributeTags();
 
 enum SpecialAttr {
   // This is for the .cpu asm attr. It translates into one or more
diff --git a/llvm/include/llvm/Support/ARMTargetParser.h b/llvm/include/llvm/Support/ARMTargetParser.h
--- a/llvm/include/llvm/Support/ARMTargetParser.h
+++ b/llvm/include/llvm/Support/ARMTargetParser.h
@@ -17,6 +17,8 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/ARMBuildAttributes.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <vector>
 
 namespace llvm {
@@ -232,48 +234,48 @@
 };
 
 // Information by ID
-StringRef getFPUName(unsigned FPUKind);
-FPUVersion getFPUVersion(unsigned FPUKind);
-NeonSupportLevel getFPUNeonSupportLevel(unsigned FPUKind);
-FPURestriction getFPURestriction(unsigned FPUKind);
+LLVM_SUPPORT_ABI StringRef getFPUName(unsigned FPUKind);
+LLVM_SUPPORT_ABI FPUVersion getFPUVersion(unsigned FPUKind);
+LLVM_SUPPORT_ABI NeonSupportLevel getFPUNeonSupportLevel(unsigned FPUKind);
+LLVM_SUPPORT_ABI FPURestriction getFPURestriction(unsigned FPUKind);
 
 // FIXME: These should be moved to TargetTuple once it exists
-bool getFPUFeatures(unsigned FPUKind, std::vector<StringRef> &Features);
-bool getHWDivFeatures(uint64_t HWDivKind, std::vector<StringRef> &Features);
-bool getExtensionFeatures(uint64_t Extensions,
+LLVM_SUPPORT_ABI bool getFPUFeatures(unsigned FPUKind, std::vector<StringRef> &Features);
+LLVM_SUPPORT_ABI bool getHWDivFeatures(uint64_t HWDivKind, std::vector<StringRef> &Features);
+LLVM_SUPPORT_ABI bool getExtensionFeatures(uint64_t Extensions,
                           std::vector<StringRef> &Features);
 
-StringRef getArchName(ArchKind AK);
-unsigned getArchAttr(ArchKind AK);
-StringRef getCPUAttr(ArchKind AK);
-StringRef getSubArch(ArchKind AK);
-StringRef getArchExtName(uint64_t ArchExtKind);
-StringRef getArchExtFeature(StringRef ArchExt);
-bool appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK, StringRef ArchExt,
+LLVM_SUPPORT_ABI StringRef getArchName(ArchKind AK);
+LLVM_SUPPORT_ABI unsigned getArchAttr(ArchKind AK);
+LLVM_SUPPORT_ABI StringRef getCPUAttr(ArchKind AK);
+LLVM_SUPPORT_ABI StringRef getSubArch(ArchKind AK);
+LLVM_SUPPORT_ABI StringRef getArchExtName(uint64_t ArchExtKind);
+LLVM_SUPPORT_ABI StringRef getArchExtFeature(StringRef ArchExt);
+LLVM_SUPPORT_ABI bool appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK, StringRef ArchExt,
                            std::vector<StringRef> &Features,
                            unsigned &ArgFPUKind);
 
 // Information by Name
-unsigned getDefaultFPU(StringRef CPU, ArchKind AK);
-uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK);
-StringRef getDefaultCPU(StringRef Arch);
+LLVM_SUPPORT_ABI unsigned getDefaultFPU(StringRef CPU, ArchKind AK);
+LLVM_SUPPORT_ABI uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK);
+LLVM_SUPPORT_ABI StringRef getDefaultCPU(StringRef Arch);
 StringRef getCanonicalArchName(StringRef Arch);
 StringRef getFPUSynonym(StringRef FPU);
 StringRef getArchSynonym(StringRef Arch);
 
 // Parser
-uint64_t parseHWDiv(StringRef HWDiv);
-unsigned parseFPU(StringRef FPU);
-ArchKind parseArch(StringRef Arch);
-uint64_t parseArchExt(StringRef ArchExt);
-ArchKind parseCPUArch(StringRef CPU);
-ISAKind parseArchISA(StringRef Arch);
-EndianKind parseArchEndian(StringRef Arch);
-ProfileKind parseArchProfile(StringRef Arch);
-unsigned parseArchVersion(StringRef Arch);
-
-void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
-StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU);
+LLVM_SUPPORT_ABI uint64_t parseHWDiv(StringRef HWDiv);
+LLVM_SUPPORT_ABI unsigned parseFPU(StringRef FPU);
+LLVM_SUPPORT_ABI ArchKind parseArch(StringRef Arch);
+LLVM_SUPPORT_ABI uint64_t parseArchExt(StringRef ArchExt);
+LLVM_SUPPORT_ABI ArchKind parseCPUArch(StringRef CPU);
+LLVM_SUPPORT_ABI ISAKind parseArchISA(StringRef Arch);
+LLVM_SUPPORT_ABI EndianKind parseArchEndian(StringRef Arch);
+LLVM_SUPPORT_ABI ProfileKind parseArchProfile(StringRef Arch);
+LLVM_SUPPORT_ABI unsigned parseArchVersion(StringRef Arch);
+
+LLVM_SUPPORT_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
+LLVM_SUPPORT_ABI StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU);
 
 } // namespace ARM
 } // namespace llvm
diff --git a/llvm/include/llvm/Support/ARMWinEH.h b/llvm/include/llvm/Support/ARMWinEH.h
--- a/llvm/include/llvm/Support/ARMWinEH.h
+++ b/llvm/include/llvm/Support/ARMWinEH.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/Endian.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 namespace ARM {
@@ -205,7 +206,8 @@
 
 /// SavedRegisterMask - Utility function to calculate the set of saved general
 /// purpose (r0-r15) and VFP (d0-d31) registers.
-std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF);
+LLVM_SUPPORT_ABI std::pair<uint16_t, uint32_t>
+SavedRegisterMask(const RuntimeFunction &RF);
 
 /// RuntimeFunctionARM64 - An entry in the table of procedure data (.pdata)
 ///
diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/include/llvm/Support/Allocator.h
@@ -23,8 +23,10 @@
 #include "llvm/Support/AllocatorBase.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/MemAlloc.h"
+
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
@@ -40,7 +42,7 @@
 
 // We call out to an external function to actually print the message as the
 // printing code uses Allocator.h in its implementation.
-void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
+LLVM_SUPPORT_ABI void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
                                 size_t TotalMemory);
 
 } // end namespace detail
diff --git a/llvm/include/llvm/Support/BinaryStreamError.h b/llvm/include/llvm/Support/BinaryStreamError.h
--- a/llvm/include/llvm/Support/BinaryStreamError.h
+++ b/llvm/include/llvm/Support/BinaryStreamError.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 #include <string>
 
@@ -24,7 +25,7 @@
 };
 
 /// Base class for errors originating when parsing raw PDB files
-class BinaryStreamError : public ErrorInfo<BinaryStreamError> {
+class LLVM_SUPPORT_ABI BinaryStreamError : public ErrorInfo<BinaryStreamError> {
 public:
   static char ID;
   explicit BinaryStreamError(stream_error_code C);
diff --git a/llvm/include/llvm/Support/BinaryStreamReader.h b/llvm/include/llvm/Support/BinaryStreamReader.h
--- a/llvm/include/llvm/Support/BinaryStreamReader.h
+++ b/llvm/include/llvm/Support/BinaryStreamReader.h
@@ -18,7 +18,9 @@
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/type_traits.h"
+
 #include <type_traits>
 
 namespace llvm {
@@ -28,7 +30,7 @@
 /// null-terminated strings, integers in various flavors of endianness, etc.
 /// Can be subclassed to provide reading of custom datatypes, although no
 /// are overridable.
-class BinaryStreamReader {
+class LLVM_SUPPORT_ABI BinaryStreamReader {
 public:
   BinaryStreamReader() = default;
   explicit BinaryStreamReader(BinaryStreamRef Ref);
diff --git a/llvm/include/llvm/Support/BinaryStreamRef.h b/llvm/include/llvm/Support/BinaryStreamRef.h
--- a/llvm/include/llvm/Support/BinaryStreamRef.h
+++ b/llvm/include/llvm/Support/BinaryStreamRef.h
@@ -14,6 +14,8 @@
 #include "llvm/Support/BinaryStream.h"
 #include "llvm/Support/BinaryStreamError.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <algorithm>
 #include <cstdint>
 #include <memory>
@@ -153,7 +155,7 @@
 /// general, you should not pass around pointers or references to BinaryStreams
 /// and use inheritance to achieve polymorphism.  Instead, you should pass
 /// around BinaryStreamRefs by value and achieve polymorphism that way.
-class BinaryStreamRef
+class LLVM_SUPPORT_ABI BinaryStreamRef
     : public BinaryStreamRefBase<BinaryStreamRef, BinaryStream> {
   friend BinaryStreamRefBase<BinaryStreamRef, BinaryStream>;
   friend class WritableBinaryStreamRef;
@@ -219,7 +221,7 @@
   bool empty() const { return size() == 0; }
 };
 
-class WritableBinaryStreamRef
+class LLVM_SUPPORT_ABI WritableBinaryStreamRef
     : public BinaryStreamRefBase<WritableBinaryStreamRef,
                                  WritableBinaryStream> {
   friend BinaryStreamRefBase<WritableBinaryStreamRef, WritableBinaryStream>;
diff --git a/llvm/include/llvm/Support/BinaryStreamWriter.h b/llvm/include/llvm/Support/BinaryStreamWriter.h
--- a/llvm/include/llvm/Support/BinaryStreamWriter.h
+++ b/llvm/include/llvm/Support/BinaryStreamWriter.h
@@ -17,6 +17,8 @@
 #include "llvm/Support/BinaryStreamRef.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cstdint>
 #include <type_traits>
 #include <utility>
@@ -28,7 +30,7 @@
 /// such as null-terminated strings, integers in various flavors of endianness,
 /// etc.  Can be subclassed to provide reading and writing of custom datatypes,
 /// although no methods are overridable.
-class BinaryStreamWriter {
+class LLVM_SUPPORT_ABI BinaryStreamWriter {
 public:
   BinaryStreamWriter() = default;
   explicit BinaryStreamWriter(WritableBinaryStreamRef Ref);
diff --git a/llvm/include/llvm/Support/BlockFrequency.h b/llvm/include/llvm/Support/BlockFrequency.h
--- a/llvm/include/llvm/Support/BlockFrequency.h
+++ b/llvm/include/llvm/Support/BlockFrequency.h
@@ -15,13 +15,14 @@
 
 #include "llvm/Support/BranchProbability.h"
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
 class raw_ostream;
 
 // This class represents Block Frequency as a 64-bit value.
-class BlockFrequency {
+class LLVM_SUPPORT_ABI BlockFrequency {
   uint64_t Frequency;
 
 public:
diff --git a/llvm/include/llvm/Support/BranchProbability.h b/llvm/include/llvm/Support/BranchProbability.h
--- a/llvm/include/llvm/Support/BranchProbability.h
+++ b/llvm/include/llvm/Support/BranchProbability.h
@@ -14,6 +14,8 @@
 #define LLVM_SUPPORT_BRANCHPROBABILITY_H
 
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <algorithm>
 #include <cassert>
 #include <climits>
@@ -27,7 +29,7 @@
 // no greater than 1. It uses a fixed-point-like implementation, in which the
 // denominator is always a constant value (here we use 1<<31 for maximum
 // precision).
-class BranchProbability {
+class LLVM_SUPPORT_ABI BranchProbability {
   // Numerator
   uint32_t N;
 
diff --git a/llvm/include/llvm/Support/BuryPointer.h b/llvm/include/llvm/Support/BuryPointer.h
--- a/llvm/include/llvm/Support/BuryPointer.h
+++ b/llvm/include/llvm/Support/BuryPointer.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_SUPPORT_BURYPOINTER_H
 #define LLVM_SUPPORT_BURYPOINTER_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <memory>
 
 namespace llvm {
@@ -19,7 +21,8 @@
 // the memory is not misdiagnosed as an unintentional leak by leak detection
 // tools (this is achieved by preserving pointers to the object in a globally
 // visible array).
-void BuryPointer(const void *Ptr);
+LLVM_SUPPORT_ABI void BuryPointer(const void *Ptr);
+
 template <typename T> void BuryPointer(std::unique_ptr<T> Ptr) {
   BuryPointer(Ptr.release());
 }
diff --git a/llvm/include/llvm/Support/COM.h b/llvm/include/llvm/Support/COM.h
--- a/llvm/include/llvm/Support/COM.h
+++ b/llvm/include/llvm/Support/COM.h
@@ -14,12 +14,14 @@
 #ifndef LLVM_SUPPORT_COM_H
 #define LLVM_SUPPORT_COM_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 namespace llvm {
 namespace sys {
 
 enum class COMThreadingMode { SingleThreaded, MultiThreaded };
 
-class InitializeCOMRAII {
+class LLVM_SUPPORT_ABI InitializeCOMRAII {
 public:
   explicit InitializeCOMRAII(COMThreadingMode Threading,
                              bool SpeedOverMemory = false);
diff --git a/llvm/include/llvm/Support/CRC.h b/llvm/include/llvm/Support/CRC.h
--- a/llvm/include/llvm/Support/CRC.h
+++ b/llvm/include/llvm/Support/CRC.h
@@ -14,16 +14,17 @@
 #define LLVM_SUPPORT_CRC_H
 
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 template <typename T> class ArrayRef;
 
 // Compute the CRC-32 of Data.
-uint32_t crc32(ArrayRef<uint8_t> Data);
+LLVM_SUPPORT_ABI uint32_t crc32(ArrayRef<uint8_t> Data);
 
 // Compute the running CRC-32 of Data, with CRC being the previous value of the
 // checksum.
-uint32_t crc32(uint32_t CRC, ArrayRef<uint8_t> Data);
+LLVM_SUPPORT_ABI uint32_t crc32(uint32_t CRC, ArrayRef<uint8_t> Data);
 
 // Class for computing the JamCRC.
 //
@@ -42,7 +43,7 @@
 //
 // N.B.  We permit flexibility of the "Init" value.  Some consumers of this need
 //       it to be zero.
-class JamCRC {
+class LLVM_SUPPORT_ABI JamCRC {
 public:
   JamCRC(uint32_t Init = 0xFFFFFFFFU) : CRC(Init) {}
 
diff --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -15,6 +15,8 @@
 #define LLVM_SUPPORT_CACHEPRUNING_H
 
 #include "llvm/ADT/Optional.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <chrono>
 
 namespace llvm {
@@ -65,7 +67,7 @@
 /// For example: "prune_interval=30s:prune_after=24h:cache_size=50%"
 /// which means a pruning interval of 30 seconds, expiration time of 24 hours
 /// and maximum cache size of 50% of available disk space.
-Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicyStr);
+LLVM_SUPPORT_ABI Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicyStr);
 
 /// Peform pruning using the supplied policy, returns true if pruning
 /// occurred, i.e. if Policy.Interval was expired.
@@ -73,7 +75,7 @@
 /// As a safeguard against data loss if the user specifies the wrong directory
 /// as their cache directory, this function will ignore files not matching the
 /// pattern "llvmcache-*".
-bool pruneCache(StringRef Path, CachePruningPolicy Policy);
+LLVM_SUPPORT_ABI bool pruneCache(StringRef Path, CachePruningPolicy Policy);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Support/Chrono.h b/llvm/include/llvm/Support/Chrono.h
--- a/llvm/include/llvm/Support/Chrono.h
+++ b/llvm/include/llvm/Support/Chrono.h
@@ -11,6 +11,7 @@
 
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/FormatProviders.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 #include <chrono>
 #include <ctime>
@@ -56,6 +57,7 @@
 
 } // namespace sys
 
+LLVM_SUPPORT_ABI
 raw_ostream &operator<<(raw_ostream &OS, sys::TimePoint<> TP);
 
 /// Format provider for TimePoint<>
@@ -67,7 +69,7 @@
 ///
 /// If no options are given, the default format is "%Y-%m-%d %H:%M:%S.%N".
 template <>
-struct format_provider<sys::TimePoint<>> {
+struct LLVM_SUPPORT_ABI format_provider<sys::TimePoint<>> {
   static void format(const sys::TimePoint<> &TP, llvm::raw_ostream &OS,
                      StringRef Style);
 };
@@ -76,12 +78,12 @@
 template <typename Period> struct unit { static const char value[]; };
 template <typename Period> const char unit<Period>::value[] = "";
 
-template <> struct unit<std::ratio<3600>> { static const char value[]; };
-template <> struct unit<std::ratio<60>> { static const char value[]; };
-template <> struct unit<std::ratio<1>> { static const char value[]; };
-template <> struct unit<std::milli> { static const char value[]; };
-template <> struct unit<std::micro> { static const char value[]; };
-template <> struct unit<std::nano> { static const char value[]; };
+template <> struct LLVM_SUPPORT_ABI unit<std::ratio<3600>> { static const char value[]; };
+template <> struct LLVM_SUPPORT_ABI unit<std::ratio<60>> { static const char value[]; };
+template <> struct LLVM_SUPPORT_ABI unit<std::ratio<1>> { static const char value[]; };
+template <> struct LLVM_SUPPORT_ABI unit<std::milli> { static const char value[]; };
+template <> struct LLVM_SUPPORT_ABI unit<std::micro> { static const char value[]; };
+template <> struct LLVM_SUPPORT_ABI unit<std::nano> { static const char value[]; };
 } // namespace detail
 
 /// Implementation of format_provider<T> for duration types.
diff --git a/llvm/include/llvm/Support/CodeGenCoverage.h b/llvm/include/llvm/Support/CodeGenCoverage.h
--- a/llvm/include/llvm/Support/CodeGenCoverage.h
+++ b/llvm/include/llvm/Support/CodeGenCoverage.h
@@ -12,12 +12,13 @@
 #define LLVM_SUPPORT_CODEGENCOVERAGE_H
 
 #include "llvm/ADT/BitVector.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 class LLVMContext;
 class MemoryBuffer;
 
-class CodeGenCoverage {
+class LLVM_SUPPORT_ABI CodeGenCoverage {
 protected:
   BitVector RuleCoverage;
 
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/include/llvm/Support/CommandLine.h
@@ -30,8 +30,10 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <cassert>
 #include <climits>
 #include <cstddef>
@@ -68,6 +70,7 @@
 // that give precedence to later occurrences.  If your program supports options
 // that give precedence to earlier occurrences, you will need to extend this
 // function to support it correctly.
+LLVM_SUPPORT_ABI
 bool ParseCommandLineOptions(int argc, const char *const *argv,
                              StringRef Overview = "",
                              raw_ostream *Errs = nullptr,
@@ -82,7 +85,7 @@
 ///                     used to print out the version when --version is given
 ///                     on the command line. This allows other systems using the
 ///                     CommandLine utilities to print their own version string.
-void SetVersionPrinter(VersionPrinterTy func);
+LLVM_SUPPORT_ABI void SetVersionPrinter(VersionPrinterTy func);
 
 ///===---------------------------------------------------------------------===//
 /// AddExtraVersionPrinter - Add an extra printer to use in addition to the
@@ -91,13 +94,13 @@
 ///                          which will be called after the basic LLVM version
 ///                          printing is complete. Each can then add additional
 ///                          information specific to the tool.
-void AddExtraVersionPrinter(VersionPrinterTy func);
+LLVM_SUPPORT_ABI void AddExtraVersionPrinter(VersionPrinterTy func);
 
 // PrintOptionValues - Print option values.
 // With -print-options print the difference between option values and defaults.
 // With -print-all-options print all option values.
 // (Currently not perfect, but best-effort.)
-void PrintOptionValues();
+LLVM_SUPPORT_ABI void PrintOptionValues();
 
 // Forward declaration - AddLiteralOption needs to be up here to make gcc happy.
 class Option;
@@ -109,6 +112,7 @@
 ///
 /// Literal options are used by some parsers to register special option values.
 /// This is how the PassNameParser registers pass names for opt.
+LLVM_SUPPORT_ABI
 void AddLiteralOption(Option &O, StringRef Name);
 
 //===----------------------------------------------------------------------===//
@@ -183,7 +187,7 @@
 //===----------------------------------------------------------------------===//
 // Option Category class
 //
-class OptionCategory {
+class LLVM_SUPPORT_ABI OptionCategory {
 private:
   StringRef const Name;
   StringRef const Description;
@@ -202,12 +206,12 @@
 };
 
 // The general Option Category (used as default category).
-OptionCategory &getGeneralCategory();
+LLVM_SUPPORT_ABI OptionCategory &getGeneralCategory();
 
 //===----------------------------------------------------------------------===//
 // SubCommand class
 //
-class SubCommand {
+class LLVM_SUPPORT_ABI SubCommand {
 private:
   StringRef Name;
   StringRef Description;
@@ -238,15 +242,15 @@
 };
 
 // A special subcommand representing no subcommand
-extern ManagedStatic<SubCommand> TopLevelSubCommand;
+extern LLVM_SUPPORT_ABI ManagedStatic<SubCommand> TopLevelSubCommand;
 
 // A special subcommand that can be used to put an option into all subcommands.
-extern ManagedStatic<SubCommand> AllSubCommands;
+extern LLVM_SUPPORT_ABI ManagedStatic<SubCommand> AllSubCommands;
 
 //===----------------------------------------------------------------------===//
 // Option Base class
 //
-class Option {
+class LLVM_SUPPORT_ABI Option {
   friend class alias;
 
   // handleOccurrences - Overriden by subclasses to handle the value passed into
@@ -519,7 +523,7 @@
 // OptionValue class
 
 // Support value comparison outside the template.
-struct GenericOptionValue {
+struct LLVM_SUPPORT_ABI GenericOptionValue {
   virtual bool compare(const GenericOptionValue &V) const = 0;
 
 protected:
@@ -638,7 +642,7 @@
   }
 
 private:
-  void anchor() override;
+  LLVM_SUPPORT_ABI void anchor() override;
 };
 
 template <>
@@ -655,7 +659,7 @@
   }
 
 private:
-  void anchor() override;
+  LLVM_SUPPORT_ABI void anchor() override;
 };
 
 //===----------------------------------------------------------------------===//
@@ -712,7 +716,7 @@
 // not need replicated for every instance of the generic parser.  This also
 // allows us to put stuff into CommandLine.cpp
 //
-class generic_parser_base {
+class LLVM_SUPPORT_ABI generic_parser_base {
 protected:
   class GenericOptionInfo {
   public:
@@ -875,7 +879,7 @@
 //--------------------------------------------------
 // basic_parser - Super class of parsers to provide boilerplate code
 //
-class basic_parser_impl { // non-template implementation of basic_parser<t>
+class LLVM_SUPPORT_ABI basic_parser_impl { // non-template implementation of basic_parser<t>
 public:
   basic_parser_impl(Option &) {}
 
@@ -926,7 +930,10 @@
 //--------------------------------------------------
 // parser<bool>
 //
-template <> class parser<bool> : public basic_parser<bool> {
+
+extern template class basic_parser<bool>;
+
+template <> class LLVM_SUPPORT_ABI parser<bool> : public basic_parser<bool> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -949,11 +956,12 @@
   void anchor() override;
 };
 
-extern template class basic_parser<bool>;
-
 //--------------------------------------------------
 // parser<boolOrDefault>
-template <> class parser<boolOrDefault> : public basic_parser<boolOrDefault> {
+
+extern template class basic_parser<boolOrDefault>;
+
+template <> class LLVM_SUPPORT_ABI parser<boolOrDefault> : public basic_parser<boolOrDefault> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -974,12 +982,13 @@
   void anchor() override;
 };
 
-extern template class basic_parser<boolOrDefault>;
-
 //--------------------------------------------------
 // parser<int>
 //
-template <> class parser<int> : public basic_parser<int> {
+
+extern template class basic_parser<int>;
+
+template <> class LLVM_SUPPORT_ABI parser<int> : public basic_parser<int> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -996,8 +1005,6 @@
   void anchor() override;
 };
 
-extern template class basic_parser<int>;
-
 //--------------------------------------------------
 // parser<long>
 //
@@ -1023,7 +1030,10 @@
 //--------------------------------------------------
 // parser<long long>
 //
-template <> class parser<long long> : public basic_parser<long long> {
+
+extern template class basic_parser<long long>;
+
+template <> class LLVM_SUPPORT_ABI parser<long long> : public basic_parser<long long> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1040,12 +1050,13 @@
   void anchor() override;
 };
 
-extern template class basic_parser<long long>;
-
 //--------------------------------------------------
 // parser<unsigned>
 //
-template <> class parser<unsigned> : public basic_parser<unsigned> {
+
+extern template class basic_parser<unsigned>;
+
+template <> class LLVM_SUPPORT_ABI parser<unsigned> : public basic_parser<unsigned> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1062,8 +1073,6 @@
   void anchor() override;
 };
 
-extern template class basic_parser<unsigned>;
-
 //--------------------------------------------------
 // parser<unsigned long>
 //
@@ -1090,8 +1099,11 @@
 //--------------------------------------------------
 // parser<unsigned long long>
 //
+
+extern template class basic_parser<unsigned long long>;
+
 template <>
-class parser<unsigned long long> : public basic_parser<unsigned long long> {
+class LLVM_SUPPORT_ABI parser<unsigned long long> : public basic_parser<unsigned long long> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1109,12 +1121,13 @@
   void anchor() override;
 };
 
-extern template class basic_parser<unsigned long long>;
-
 //--------------------------------------------------
 // parser<double>
 //
-template <> class parser<double> : public basic_parser<double> {
+
+extern template class basic_parser<double>;
+
+template <> class LLVM_SUPPORT_ABI parser<double> : public basic_parser<double> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1131,12 +1144,13 @@
   void anchor() override;
 };
 
-extern template class basic_parser<double>;
-
 //--------------------------------------------------
 // parser<float>
 //
-template <> class parser<float> : public basic_parser<float> {
+
+extern template class basic_parser<float>;
+
+template <> class LLVM_SUPPORT_ABI parser<float> : public basic_parser<float> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1153,12 +1167,13 @@
   void anchor() override;
 };
 
-extern template class basic_parser<float>;
-
 //--------------------------------------------------
 // parser<std::string>
 //
-template <> class parser<std::string> : public basic_parser<std::string> {
+
+extern template class basic_parser<std::string>;
+
+template <> class LLVM_SUPPORT_ABI parser<std::string> : public basic_parser<std::string> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1178,12 +1193,13 @@
   void anchor() override;
 };
 
-extern template class basic_parser<std::string>;
-
 //--------------------------------------------------
 // parser<char>
 //
-template <> class parser<char> : public basic_parser<char> {
+
+extern template class basic_parser<char>;
+
+template <> class LLVM_SUPPORT_ABI parser<char> : public basic_parser<char> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1203,8 +1219,6 @@
   void anchor() override;
 };
 
-extern template class basic_parser<char>;
-
 //--------------------------------------------------
 // PrintOptionDiff
 //
@@ -1502,6 +1516,8 @@
     done();
   }
 
+  virtual ~opt() = default;
+
   void setCallback(
       std::function<void(const typename ParserClass::parser_data_type &)> CB) {
     Callback = CB;
@@ -1511,11 +1527,11 @@
       [](const typename ParserClass::parser_data_type &) {};
 };
 
-extern template class opt<unsigned>;
-extern template class opt<int>;
-extern template class opt<std::string>;
-extern template class opt<char>;
-extern template class opt<bool>;
+extern template LLVM_SUPPORT_ABI class opt<unsigned>;
+extern template LLVM_SUPPORT_ABI class opt<int>;
+extern template LLVM_SUPPORT_ABI class opt<std::string>;
+extern template LLVM_SUPPORT_ABI class opt<char>;
+extern template LLVM_SUPPORT_ABI class opt<bool>;
 
 //===----------------------------------------------------------------------===//
 // list_storage class
@@ -1859,7 +1875,7 @@
 // Aliased command line option (alias this name to a preexisting name)
 //
 
-class alias : public Option {
+class LLVM_SUPPORT_ABI alias : public Option {
   Option *AliasFor;
 
   bool handleOccurrence(unsigned pos, StringRef /*ArgName*/,
@@ -1930,20 +1946,20 @@
 // output. All occurrences of cl::extrahelp will be accumulated and
 // printed to stderr at the end of the regular help, just before
 // exit is called.
-struct extrahelp {
+struct LLVM_SUPPORT_ABI extrahelp {
   StringRef morehelp;
 
   explicit extrahelp(StringRef help);
 };
 
-void PrintVersionMessage();
+LLVM_SUPPORT_ABI void PrintVersionMessage();
 
 /// This function just prints the help message, exactly the same way as if the
 /// -help or -help-hidden option had been given on the command line.
 ///
 /// \param Hidden if true will print hidden options
 /// \param Categorized if true print options in categories
-void PrintHelpMessage(bool Hidden = false, bool Categorized = false);
+LLVM_SUPPORT_ABI void PrintHelpMessage(bool Hidden = false, bool Categorized = false);
 
 //===----------------------------------------------------------------------===//
 // Public interface for accessing registered options.
@@ -1976,7 +1992,7 @@
 /// Hopefully this API can be deprecated soon. Any situation where options need
 /// to be modified by tools or libraries should be handled by sane APIs rather
 /// than just handing around a global list.
-StringMap<Option *> &getRegisteredOptions(SubCommand &Sub = *TopLevelSubCommand);
+LLVM_SUPPORT_ABI StringMap<Option *> &getRegisteredOptions(SubCommand &Sub = *TopLevelSubCommand);
 
 /// Use this to get all registered SubCommands from the provided parser.
 ///
@@ -1997,7 +2013,7 @@
 ///
 /// This interface is useful for defining subcommands in libraries and
 /// the dispatch from a single point (like in the main function).
-iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
+LLVM_SUPPORT_ABI iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
 getRegisteredSubcommands();
 
 //===----------------------------------------------------------------------===//
@@ -2016,7 +2032,7 @@
 /// \param [in] MarkEOLs true if tokenizing a response file and you want end of
 /// lines and end of the response file to be marked with a nullptr string.
 /// \param [out] NewArgv All parsed strings are appended to NewArgv.
-void TokenizeGNUCommandLine(StringRef Source, StringSaver &Saver,
+LLVM_SUPPORT_ABI void TokenizeGNUCommandLine(StringRef Source, StringSaver &Saver,
                             SmallVectorImpl<const char *> &NewArgv,
                             bool MarkEOLs = false);
 
@@ -2031,7 +2047,7 @@
 /// \param [in] MarkEOLs true if tokenizing a response file and you want end of
 /// lines and end of the response file to be marked with a nullptr string.
 /// \param [out] NewArgv All parsed strings are appended to NewArgv.
-void TokenizeWindowsCommandLine(StringRef Source, StringSaver &Saver,
+LLVM_SUPPORT_ABI void TokenizeWindowsCommandLine(StringRef Source, StringSaver &Saver,
                                 SmallVectorImpl<const char *> &NewArgv,
                                 bool MarkEOLs = false);
 
@@ -2039,7 +2055,7 @@
 /// quoting or escaping was used, this produces substrings of the original
 /// string. If a token requires unquoting, it will be allocated with the
 /// StringSaver.
-void TokenizeWindowsCommandLineNoCopy(StringRef Source, StringSaver &Saver,
+LLVM_SUPPORT_ABI void TokenizeWindowsCommandLineNoCopy(StringRef Source, StringSaver &Saver,
                                       SmallVectorImpl<StringRef> &NewArgv);
 
 /// String tokenization function type.  Should be compatible with either
@@ -2057,7 +2073,7 @@
 ///
 /// It works like TokenizeGNUCommandLine with ability to skip comment lines.
 ///
-void tokenizeConfigFile(StringRef Source, StringSaver &Saver,
+LLVM_SUPPORT_ABI void tokenizeConfigFile(StringRef Source, StringSaver &Saver,
                         SmallVectorImpl<const char *> &NewArgv,
                         bool MarkEOLs = false);
 
@@ -2072,7 +2088,7 @@
 /// commands resolving file names in them relative to the directory where
 /// CfgFilename resides.
 ///
-bool readConfigFile(StringRef CfgFileName, StringSaver &Saver,
+LLVM_SUPPORT_ABI bool readConfigFile(StringRef CfgFileName, StringSaver &Saver,
                     SmallVectorImpl<const char *> &Argv);
 
 /// Expand response files on a command line recursively using the given
@@ -2094,7 +2110,7 @@
 /// \param [in] CurrentDir Path used to resolve relative rsp files. If set to
 /// None, process' cwd is used instead.
 /// \return true if all @files were expanded successfully or there were none.
-bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer,
+LLVM_SUPPORT_ABI bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer,
                          SmallVectorImpl<const char *> &Argv, bool MarkEOLs,
                          bool RelativeNames,
                          llvm::Optional<llvm::StringRef> CurrentDir,
@@ -2102,7 +2118,7 @@
 
 /// An overload of ExpandResponseFiles() that uses
 /// llvm::vfs::getRealFileSystem().
-bool ExpandResponseFiles(
+LLVM_SUPPORT_ABI bool ExpandResponseFiles(
     StringSaver &Saver, TokenizerCallback Tokenizer,
     SmallVectorImpl<const char *> &Argv, bool MarkEOLs = false,
     bool RelativeNames = false,
@@ -2112,7 +2128,7 @@
 /// environment variable EnvVar and command line options, then expands response
 /// files recursively. The tokenizer is a predefined GNU or Windows one.
 /// \return true if all @files were expanded successfully or there were none.
-bool expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar,
+LLVM_SUPPORT_ABI bool expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar,
                          StringSaver &Saver,
                          SmallVectorImpl<const char *> &NewArgv);
 
@@ -2123,6 +2139,7 @@
 /// Some tools (like clang-format) like to be able to hide all options that are
 /// not specific to the tool. This function allows a tool to specify a single
 /// option category to display in the -help output.
+LLVM_SUPPORT_ABI
 void HideUnrelatedOptions(cl::OptionCategory &Category,
                           SubCommand &Sub = *TopLevelSubCommand);
 
@@ -2133,19 +2150,20 @@
 /// Some tools (like clang-format) like to be able to hide all options that are
 /// not specific to the tool. This function allows a tool to specify a single
 /// option category to display in the -help output.
+LLVM_SUPPORT_ABI
 void HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories,
                           SubCommand &Sub = *TopLevelSubCommand);
 
 /// Reset all command line options to a state that looks as if they have
 /// never appeared on the command line.  This is useful for being able to parse
 /// a command line multiple times (especially useful for writing tests).
-void ResetAllOptionOccurrences();
+LLVM_SUPPORT_ABI void ResetAllOptionOccurrences();
 
 /// Reset the command line parser back to its initial state.  This
 /// removes
 /// all options, categories, and subcommands and returns the parser to a state
 /// where no options are supported.
-void ResetCommandLineParser();
+LLVM_SUPPORT_ABI void ResetCommandLineParser();
 
 /// Parses `Arg` into the option handler `Handler`.
 bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i);
diff --git a/llvm/include/llvm/Support/Compression.h b/llvm/include/llvm/Support/Compression.h
--- a/llvm/include/llvm/Support/Compression.h
+++ b/llvm/include/llvm/Support/Compression.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_COMPRESSION_H
 
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 template <typename T> class SmallVectorImpl;
@@ -27,15 +28,15 @@
 static constexpr int DefaultCompression = 6;
 static constexpr int BestSizeCompression = 9;
 
-bool isAvailable();
+LLVM_SUPPORT_ABI bool isAvailable();
 
-Error compress(StringRef InputBuffer, SmallVectorImpl<char> &CompressedBuffer,
+LLVM_SUPPORT_ABI Error compress(StringRef InputBuffer, SmallVectorImpl<char> &CompressedBuffer,
                int Level = DefaultCompression);
 
-Error uncompress(StringRef InputBuffer, char *UncompressedBuffer,
+LLVM_SUPPORT_ABI Error uncompress(StringRef InputBuffer, char *UncompressedBuffer,
                  size_t &UncompressedSize);
 
-Error uncompress(StringRef InputBuffer,
+LLVM_SUPPORT_ABI Error uncompress(StringRef InputBuffer,
                  SmallVectorImpl<char> &UncompressedBuffer,
                  size_t UncompressedSize);
 
diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h
--- a/llvm/include/llvm/Support/ConvertUTF.h
+++ b/llvm/include/llvm/Support/ConvertUTF.h
@@ -89,6 +89,8 @@
 #ifndef LLVM_SUPPORT_CONVERTUTF_H
 #define LLVM_SUPPORT_CONVERTUTF_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cstddef>
 #include <string>
 #include <system_error>
@@ -135,7 +137,7 @@
   lenientConversion
 } ConversionFlags;
 
-ConversionResult ConvertUTF8toUTF16 (
+LLVM_SUPPORT_ABI ConversionResult ConvertUTF8toUTF16 (
   const UTF8** sourceStart, const UTF8* sourceEnd,
   UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
 
@@ -143,7 +145,7 @@
  * Convert a partial UTF8 sequence to UTF32.  If the sequence ends in an
  * incomplete code unit sequence, returns \c sourceExhausted.
  */
-ConversionResult ConvertUTF8toUTF32Partial(
+LLVM_SUPPORT_ABI ConversionResult ConvertUTF8toUTF32Partial(
   const UTF8** sourceStart, const UTF8* sourceEnd,
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
 
@@ -151,11 +153,11 @@
  * Convert a partial UTF8 sequence to UTF32.  If the sequence ends in an
  * incomplete code unit sequence, returns \c sourceIllegal.
  */
-ConversionResult ConvertUTF8toUTF32(
+LLVM_SUPPORT_ABI ConversionResult ConvertUTF8toUTF32(
   const UTF8** sourceStart, const UTF8* sourceEnd,
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
 
-ConversionResult ConvertUTF16toUTF8 (
+LLVM_SUPPORT_ABI ConversionResult ConvertUTF16toUTF8 (
   const UTF16** sourceStart, const UTF16* sourceEnd,
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
 
@@ -171,11 +173,11 @@
   const UTF32** sourceStart, const UTF32* sourceEnd,
   UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
 
-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
+LLVM_SUPPORT_ABI Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
 
-Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd);
+LLVM_SUPPORT_ABI Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd);
 
-unsigned getNumBytesForUTF8(UTF8 firstByte);
+LLVM_SUPPORT_ABI unsigned getNumBytesForUTF8(UTF8 firstByte);
 
 /*************************************************************************/
 /* Below are LLVM-specific wrappers of the functions above. */
@@ -193,6 +195,7 @@
  * the first character which could not be converted.
  * \return true on success.
  */
+LLVM_SUPPORT_ABI
 bool ConvertUTF8toWide(unsigned WideCharWidth, llvm::StringRef Source,
                        char *&ResultPtr, const UTF8 *&ErrorPtr);
 
@@ -200,18 +203,21 @@
 * Converts a UTF-8 StringRef to a std::wstring.
 * \return true on success.
 */
+LLVM_SUPPORT_ABI
 bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result);
 
 /**
 * Converts a UTF-8 C-string to a std::wstring.
 * \return true on success.
 */
+LLVM_SUPPORT_ABI
 bool ConvertUTF8toWide(const char *Source, std::wstring &Result);
 
 /**
 * Converts a std::wstring to a UTF-8 encoded std::string.
 * \return true on success.
 */
+LLVM_SUPPORT_ABI
 bool convertWideToUTF8(const std::wstring &Source, std::string &Result);
 
 
@@ -225,7 +231,7 @@
  *
  * \returns true on success.
  */
-bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr);
+LLVM_SUPPORT_ABI bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr);
 
 /**
  * Convert the first UTF8 sequence in the given source buffer to a UTF32
@@ -258,7 +264,7 @@
  * Returns true if a blob of text starts with a UTF-16 big or little endian byte
  * order mark.
  */
-bool hasUTF16ByteOrderMark(ArrayRef<char> SrcBytes);
+LLVM_SUPPORT_ABI bool hasUTF16ByteOrderMark(ArrayRef<char> SrcBytes);
 
 /**
  * Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.
@@ -267,7 +273,7 @@
  * \param [out] Out Converted UTF-8 is stored here on success.
  * \returns true on success
  */
-bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
+LLVM_SUPPORT_ABI bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
 
 /**
 * Converts a UTF16 string into a UTF8 std::string.
@@ -276,24 +282,27 @@
 * \param [out] Out Converted UTF-8 is stored here on success.
 * \returns true on success
 */
-bool convertUTF16ToUTF8String(ArrayRef<UTF16> Src, std::string &Out);
+LLVM_SUPPORT_ABI bool convertUTF16ToUTF8String(ArrayRef<UTF16> Src, std::string &Out);
 
 /**
  * Converts a UTF-8 string into a UTF-16 string with native endianness.
  *
  * \returns true on success
  */
-bool convertUTF8ToUTF16String(StringRef SrcUTF8,
+LLVM_SUPPORT_ABI bool convertUTF8ToUTF16String(StringRef SrcUTF8,
                               SmallVectorImpl<UTF16> &DstUTF16);
 
 #if defined(_WIN32)
 namespace sys {
 namespace windows {
-std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
+LLVM_SUPPORT_ABI std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
 /// Convert to UTF16 from the current code page used in the system
 std::error_code CurCPToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
+
+LLVM_SUPPORT_ABI
 std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
                             SmallVectorImpl<char> &utf8);
+
 /// Convert from UTF16 to the current code page used in the system
 std::error_code UTF16ToCurCP(const wchar_t *utf16, size_t utf16_len,
                              SmallVectorImpl<char> &utf8);
diff --git a/llvm/include/llvm/Support/CrashRecoveryContext.h b/llvm/include/llvm/Support/CrashRecoveryContext.h
--- a/llvm/include/llvm/Support/CrashRecoveryContext.h
+++ b/llvm/include/llvm/Support/CrashRecoveryContext.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_CRASHRECOVERYCONTEXT_H
 
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 class CrashRecoveryContextCleanup;
@@ -43,7 +44,7 @@
 /// To assist recovery the class allows specifying set of actions that will be
 /// executed in any case, whether crash occurs or not. These actions may be used
 /// to reclaim resources in the case of crash.
-class CrashRecoveryContext {
+class LLVM_SUPPORT_ABI CrashRecoveryContext {
   void *Impl = nullptr;
   CrashRecoveryContextCleanup *head = nullptr;
 
@@ -121,7 +122,7 @@
 ///
 /// Cleanup handlers are stored in a double list, which is owned and managed by
 /// a crash recovery context.
-class CrashRecoveryContextCleanup {
+class LLVM_SUPPORT_ABI CrashRecoveryContextCleanup {
 protected:
   CrashRecoveryContext *context = nullptr;
   CrashRecoveryContextCleanup(CrashRecoveryContext *context)
diff --git a/llvm/include/llvm/Support/DJB.h b/llvm/include/llvm/Support/DJB.h
--- a/llvm/include/llvm/Support/DJB.h
+++ b/llvm/include/llvm/Support/DJB.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_DJB_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
@@ -26,7 +27,7 @@
 
 /// Computes the Bernstein hash after folding the input according to the Dwarf 5
 /// standard case folding rules.
-uint32_t caseFoldingDjbHash(StringRef Buffer, uint32_t H = 5381);
+LLVM_SUPPORT_ABI uint32_t caseFoldingDjbHash(StringRef Buffer, uint32_t H = 5381);
 } // namespace llvm
 
 #endif // LLVM_SUPPORT_DJB_H
diff --git a/llvm/include/llvm/Support/DataExtractor.h b/llvm/include/llvm/Support/DataExtractor.h
--- a/llvm/include/llvm/Support/DataExtractor.h
+++ b/llvm/include/llvm/Support/DataExtractor.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
@@ -38,7 +39,7 @@
   return uint24_t(C.Bytes[2], C.Bytes[1], C.Bytes[0]);
 }
 
-class DataExtractor {
+class LLVM_SUPPORT_ABI DataExtractor {
   StringRef Data;
   uint8_t IsLittleEndian;
   uint8_t AddressSize;
diff --git a/llvm/include/llvm/Support/Debug.h b/llvm/include/llvm/Support/Debug.h
--- a/llvm/include/llvm/Support/Debug.h
+++ b/llvm/include/llvm/Support/Debug.h
@@ -28,6 +28,8 @@
 #ifndef LLVM_SUPPORT_DEBUG_H
 #define LLVM_SUPPORT_DEBUG_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 namespace llvm {
 
 class raw_ostream;
@@ -38,7 +40,7 @@
 /// specified on the command line, or if none was specified on the command line
 /// with the -debug-only=X option.
 ///
-bool isCurrentDebugType(const char *Type);
+LLVM_SUPPORT_ABI bool isCurrentDebugType(const char *Type);
 
 /// setCurrentDebugType - Set the current debug type, as if the -debug-only=X
 /// option were specified.  Note that DebugFlag also needs to be set to true for
@@ -76,7 +78,7 @@
 /// is specified.  This should probably not be referenced directly, instead, use
 /// the DEBUG macro below.
 ///
-extern bool DebugFlag;
+extern LLVM_SUPPORT_ABI bool DebugFlag;
 
 /// \name Verification flags.
 ///
@@ -105,12 +107,12 @@
 /// to install signal handlers if they are certain there will be no
 /// conflict.
 ///
-extern bool EnableDebugBuffering;
+extern LLVM_SUPPORT_ABI bool EnableDebugBuffering;
 
 /// dbgs() - This returns a reference to a raw_ostream for debugging
 /// messages.  If debugging is disabled it returns errs().  Use it
 /// like: dbgs() << "foo" << "bar";
-raw_ostream &dbgs();
+LLVM_SUPPORT_ABI raw_ostream &dbgs();
 
 // DEBUG macro - This macro should be used by passes to emit debug information.
 // In the '-debug' option is specified on the commandline, and if this is a
diff --git a/llvm/include/llvm/Support/DebugCounter.h b/llvm/include/llvm/Support/DebugCounter.h
--- a/llvm/include/llvm/Support/DebugCounter.h
+++ b/llvm/include/llvm/Support/DebugCounter.h
@@ -47,13 +47,15 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/UniqueVector.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <string>
 
 namespace llvm {
 
 class raw_ostream;
 
-class DebugCounter {
+class LLVM_SUPPORT_ABI DebugCounter {
 public:
   ~DebugCounter();
 
diff --git a/llvm/include/llvm/Support/DynamicLibrary.h b/llvm/include/llvm/Support/DynamicLibrary.h
--- a/llvm/include/llvm/Support/DynamicLibrary.h
+++ b/llvm/include/llvm/Support/DynamicLibrary.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_SUPPORT_DYNAMICLIBRARY_H
 #define LLVM_SUPPORT_DYNAMICLIBRARY_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <string>
 
 namespace llvm {
@@ -33,7 +35,7 @@
   ///
   /// Note: there is currently no interface for temporarily loading a library,
   /// or for unloading libraries when the LLVM library is unloaded.
-  class DynamicLibrary {
+  class LLVM_SUPPORT_ABI DynamicLibrary {
     // Placeholder whose address represents an invalid library.
     // We use this instead of NULL or a pointer-int pair because the OS library
     // might define 0 or 1 to be "special" handles, such as "search all".
diff --git a/llvm/include/llvm/Support/ELFAttributeParser.h b/llvm/include/llvm/Support/ELFAttributeParser.h
--- a/llvm/include/llvm/Support/ELFAttributeParser.h
+++ b/llvm/include/llvm/Support/ELFAttributeParser.h
@@ -14,13 +14,14 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 #include <unordered_map>
 
 namespace llvm {
 class StringRef;
 
-class ELFAttributeParser {
+class LLVM_SUPPORT_ABI ELFAttributeParser {
   StringRef vendor;
   std::unordered_map<unsigned, unsigned> attributes;
   std::unordered_map<unsigned, StringRef> attributesStr;
diff --git a/llvm/include/llvm/Support/ELFAttributes.h b/llvm/include/llvm/Support/ELFAttributes.h
--- a/llvm/include/llvm/Support/ELFAttributes.h
+++ b/llvm/include/llvm/Support/ELFAttributes.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
@@ -25,9 +26,9 @@
 
 enum AttrType : unsigned { File = 1, Section = 2, Symbol = 3 };
 
-StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap,
+LLVM_SUPPORT_ABI StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap,
                            bool hasTagPrefix = true);
-Optional<unsigned> attrTypeFromString(StringRef tag, TagNameMap tagNameMap);
+LLVM_SUPPORT_ABI Optional<unsigned> attrTypeFromString(StringRef tag, TagNameMap tagNameMap);
 
 // Magic numbers for ELF attributes.
 enum AttrMagic { Format_Version = 0x41 };
diff --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -25,7 +25,9 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/Format.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <algorithm>
 #include <cassert>
 #include <cstdint>
@@ -45,7 +47,7 @@
 
 /// Base class for error info classes. Do not extend this directly: Extend
 /// the ErrorInfo template subclass instead.
-class ErrorInfoBase {
+class LLVM_SUPPORT_ABI ErrorInfoBase {
 public:
   virtual ~ErrorInfoBase() = default;
 
@@ -257,7 +259,7 @@
   // of debug prints can cause the function to be too large for inlining.  So
   // it's important that we define this function out of line so that it can't be
   // inlined.
-  [[noreturn]] void fatalUncheckedError() const;
+  [[noreturn]] LLVM_SUPPORT_ABI void fatalUncheckedError() const;
 #endif
 
   void assertIsChecked() {
@@ -379,10 +381,13 @@
     }
   }
 
+  // FIXME(compnerd) is this portable?
+  LLVM_SUPPORT_ABI
   std::error_code convertToErrorCode() const override;
 
   // Used by ErrorInfo::classID.
-  static char ID;
+  // FIXME(compnerd) is this portable?
+  LLVM_SUPPORT_ABI static char ID;
 
 private:
   ErrorList(std::unique_ptr<ErrorInfoBase> Payload1,
@@ -719,7 +724,7 @@
 
 /// Report a serious error, calling any installed error handler. See
 /// ErrorHandling.h.
-[[noreturn]] void report_fatal_error(Error Err, bool gen_crash_diag = true);
+[[noreturn]] LLVM_SUPPORT_ABI void report_fatal_error(Error Err, bool gen_crash_diag = true);
 
 /// Report a fatal error if Err is a failure value.
 ///
@@ -1013,7 +1018,7 @@
 /// This is useful in the base level of your program to allow clean termination
 /// (allowing clean deallocation of resources, etc.), while reporting error
 /// information to the user.
-void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner = {});
+LLVM_SUPPORT_ABI void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner = {});
 
 /// Write all error messages (if any) in E to a string. The newline character
 /// is used to separate error messages.
@@ -1130,8 +1135,8 @@
 /// This is useful if you're writing an interface that returns a Error
 /// (or Expected) and you want to call code that still returns
 /// std::error_codes.
-class ECError : public ErrorInfo<ECError> {
-  friend Error errorCodeToError(std::error_code);
+class LLVM_SUPPORT_ABI ECError : public ErrorInfo<ECError> {
+  friend LLVM_SUPPORT_ABI Error errorCodeToError(std::error_code);
 
   virtual void anchor() override;
 
@@ -1156,16 +1161,16 @@
 /// sensible conversion to std::error_code is available, as attempts to convert
 /// to/from this error will result in a fatal error. (i.e. it is a programmatic
 ///error to try to convert such a value).
-std::error_code inconvertibleErrorCode();
+LLVM_SUPPORT_ABI std::error_code inconvertibleErrorCode();
 
 /// Helper for converting an std::error_code to a Error.
-Error errorCodeToError(std::error_code EC);
+LLVM_SUPPORT_ABI Error errorCodeToError(std::error_code EC);
 
 /// Helper for converting an ECError to a std::error_code.
 ///
 /// This method requires that Err be Error() or an ECError, otherwise it
 /// will trigger a call to abort().
-std::error_code errorToErrorCode(Error Err);
+LLVM_SUPPORT_ABI std::error_code errorToErrorCode(Error Err);
 
 /// Convert an ErrorOr<T> to an Expected<T>.
 template <typename T> Expected<T> errorOrToExpected(ErrorOr<T> &&EO) {
@@ -1205,7 +1210,7 @@
 ///   }
 ///   @endcode
 ///
-class StringError : public ErrorInfo<StringError> {
+class LLVM_SUPPORT_ABI StringError : public ErrorInfo<StringError> {
 public:
   static char ID;
 
@@ -1236,7 +1241,7 @@
   return make_error<StringError>(Stream.str(), EC);
 }
 
-Error createStringError(std::error_code EC, char const *Msg);
+LLVM_SUPPORT_ABI Error createStringError(std::error_code EC, char const *Msg);
 
 inline Error createStringError(std::error_code EC, const Twine &S) {
   return createStringError(EC, S.str().c_str());
@@ -1252,7 +1257,7 @@
 ///
 /// In some cases, an error needs to live along a 'source' name, in order to
 /// show more detailed information to the user.
-class FileError final : public ErrorInfo<FileError> {
+class LLVM_SUPPORT_ABI FileError final : public ErrorInfo<FileError> {
 
   friend Error createFileError(const Twine &, Error);
   friend Error createFileError(const Twine &, size_t, Error);
diff --git a/llvm/include/llvm/Support/ErrorHandling.h b/llvm/include/llvm/Support/ErrorHandling.h
--- a/llvm/include/llvm/Support/ErrorHandling.h
+++ b/llvm/include/llvm/Support/ErrorHandling.h
@@ -15,6 +15,8 @@
 #define LLVM_SUPPORT_ERRORHANDLING_H
 
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <string>
 
 namespace llvm {
@@ -42,11 +44,11 @@
   ///
   /// \param user_data - An argument which will be passed to the install error
   /// handler.
-  void install_fatal_error_handler(fatal_error_handler_t handler,
+  LLVM_SUPPORT_ABI void install_fatal_error_handler(fatal_error_handler_t handler,
                                    void *user_data = nullptr);
 
   /// Restores default error handling behaviour.
-  void remove_fatal_error_handler();
+  LLVM_SUPPORT_ABI void remove_fatal_error_handler();
 
   /// ScopedFatalErrorHandler - This is a simple helper class which just
   /// calls install_fatal_error_handler in its constructor and
@@ -68,13 +70,13 @@
 /// standard error, followed by a newline.
 /// After the error handler is called this function will call abort(), it
 /// does not return.
-[[noreturn]] void report_fatal_error(const char *reason,
+[[noreturn]] LLVM_SUPPORT_ABI void report_fatal_error(const char *reason,
                                      bool gen_crash_diag = true);
-[[noreturn]] void report_fatal_error(const std::string &reason,
+[[noreturn]] LLVM_SUPPORT_ABI void report_fatal_error(const std::string &reason,
                                      bool gen_crash_diag = true);
-[[noreturn]] void report_fatal_error(StringRef reason,
+[[noreturn]] LLVM_SUPPORT_ABI void report_fatal_error(StringRef reason,
                                      bool gen_crash_diag = true);
-[[noreturn]] void report_fatal_error(const Twine &reason,
+[[noreturn]] LLVM_SUPPORT_ABI void report_fatal_error(const Twine &reason,
                                      bool gen_crash_diag = true);
 
 /// Installs a new bad alloc error handler that should be used whenever a
@@ -113,13 +115,13 @@
 /// If no error handler is installed (default), throws a bad_alloc exception
 /// if LLVM is compiled with exception support. Otherwise prints the error
 /// to standard error and calls abort().
-[[noreturn]] void report_bad_alloc_error(const char *Reason,
+[[noreturn]] LLVM_SUPPORT_ABI void report_bad_alloc_error(const char *Reason,
                                          bool GenCrashDiag = true);
 
 /// This function calls abort(), and prints the optional message to stderr.
 /// Use the llvm_unreachable macro (that adds location info), instead of
 /// calling this function directly.
-[[noreturn]] void
+[[noreturn]] LLVM_SUPPORT_ABI void
 llvm_unreachable_internal(const char *msg = nullptr, const char *file = nullptr,
                           unsigned line = 0);
 }
diff --git a/llvm/include/llvm/Support/ExtensibleRTTI.h b/llvm/include/llvm/Support/ExtensibleRTTI.h
--- a/llvm/include/llvm/Support/ExtensibleRTTI.h
+++ b/llvm/include/llvm/Support/ExtensibleRTTI.h
@@ -60,6 +60,8 @@
 #ifndef LLVM_SUPPORT_EXTENSIBLERTTI_H
 #define LLVM_SUPPORT_EXTENSIBLERTTI_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 namespace llvm {
 
 template <typename ThisT, typename ParentT> class RTTIExtends;
@@ -68,7 +70,7 @@
 ///
 /// This class defines virtual methods, dynamicClassID and isA, that enable
 /// type comparisons.
-class RTTIRoot {
+class LLVM_SUPPORT_ABI RTTIRoot {
 public:
   virtual ~RTTIRoot() = default;
 
diff --git a/llvm/include/llvm/Support/FileCollector.h b/llvm/include/llvm/Support/FileCollector.h
--- a/llvm/include/llvm/Support/FileCollector.h
+++ b/llvm/include/llvm/Support/FileCollector.h
@@ -12,7 +12,9 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringSet.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/VirtualFileSystem.h"
+
 #include <mutex>
 #include <string>
 
@@ -20,7 +22,7 @@
 class FileCollectorFileSystem;
 class Twine;
 
-class FileCollectorBase {
+class LLVM_SUPPORT_ABI FileCollectorBase {
 public:
   FileCollectorBase();
   virtual ~FileCollectorBase();
@@ -67,13 +69,13 @@
 ///
 /// In order to preserve the relative topology of files we use their real paths
 /// as relative paths inside of the Root.
-class FileCollector : public FileCollectorBase {
+class LLVM_SUPPORT_ABI FileCollector : public FileCollectorBase {
 public:
   /// Helper utility that encapsulates the logic for canonicalizing a virtual
   /// path and a path to copy from.
-  class PathCanonicalizer {
+  class LLVM_SUPPORT_ABI PathCanonicalizer {
   public:
-    struct PathStorage {
+    struct LLVM_SUPPORT_ABI PathStorage {
       SmallString<256> CopyFrom;
       SmallString<256> VirtualPath;
     };
diff --git a/llvm/include/llvm/Support/FileOutputBuffer.h b/llvm/include/llvm/Support/FileOutputBuffer.h
--- a/llvm/include/llvm/Support/FileOutputBuffer.h
+++ b/llvm/include/llvm/Support/FileOutputBuffer.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 /// FileOutputBuffer - This interface provides simple way to create an in-memory
@@ -25,7 +26,7 @@
 /// If the FileOutputBuffer is committed, the target file's content will become
 /// the buffer content at the time of the commit.  If the FileOutputBuffer is
 /// not committed, the file will be deleted in the FileOutputBuffer destructor.
-class FileOutputBuffer {
+class LLVM_SUPPORT_ABI FileOutputBuffer {
 public:
   enum {
     /// Set the 'x' bit on the resulting file.
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h
--- a/llvm/include/llvm/Support/FileSystem.h
+++ b/llvm/include/llvm/Support/FileSystem.h
@@ -35,7 +35,9 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/FileSystem/UniqueID.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MD5.h"
+
 #include <cassert>
 #include <cstdint>
 #include <ctime>
@@ -60,7 +62,7 @@
 using file_t = int;
 #endif
 
-extern const file_t kInvalidFile;
+extern LLVM_SUPPORT_ABI const file_t kInvalidFile;
 
 /// An enumeration for the file system's view of the type.
 enum class file_type {
@@ -134,7 +136,7 @@
 /// Represents the result of a call to directory_iterator::status(). This is a
 /// subset of the information returned by a regular sys::fs::status() call, and
 /// represents the information provided by Windows FileFirstFile/FindNextFile.
-class basic_file_status {
+class LLVM_SUPPORT_ABI basic_file_status {
 protected:
   #if defined(LLVM_ON_UNIX)
   time_t fs_st_atime = 0;
@@ -224,7 +226,7 @@
 
 /// Represents the result of a call to sys::fs::status().
 class file_status : public basic_file_status {
-  friend bool equivalent(file_status A, file_status B);
+  friend LLVM_SUPPORT_ABI bool equivalent(file_status A, file_status B);
 
   #if defined(LLVM_ON_UNIX)
   dev_t fs_st_dev = 0;
@@ -281,7 +283,7 @@
 /// relative/../path => <current-directory>/relative/../path
 ///
 /// @param path A path that is modified to be an absolute path.
-void make_absolute(const Twine &current_directory, SmallVectorImpl<char> &path);
+LLVM_SUPPORT_ABI void make_absolute(const Twine &current_directory, SmallVectorImpl<char> &path);
 
 /// Make \a path an absolute path.
 ///
@@ -294,7 +296,7 @@
 /// @param path A path that is modified to be an absolute path.
 /// @returns errc::success if \a path has been made absolute, otherwise a
 ///          platform-specific error_code.
-std::error_code make_absolute(SmallVectorImpl<char> &path);
+LLVM_SUPPORT_ABI std::error_code make_absolute(SmallVectorImpl<char> &path);
 
 /// Create all the non-existent directories in path.
 ///
@@ -302,7 +304,7 @@
 /// @returns errc::success if is_directory(path), otherwise a platform
 ///          specific error_code. If IgnoreExisting is false, also returns
 ///          error if the directory already existed.
-std::error_code create_directories(const Twine &path,
+LLVM_SUPPORT_ABI std::error_code create_directories(const Twine &path,
                                    bool IgnoreExisting = true,
                                    perms Perms = owner_all | group_all);
 
@@ -312,7 +314,7 @@
 /// @returns errc::success if is_directory(path), otherwise a platform
 ///          specific error_code. If IgnoreExisting is false, also returns
 ///          error if the directory already existed.
-std::error_code create_directory(const Twine &path, bool IgnoreExisting = true,
+LLVM_SUPPORT_ABI std::error_code create_directory(const Twine &path, bool IgnoreExisting = true,
                                  perms Perms = owner_all | group_all);
 
 /// Create a link from \a from to \a to.
@@ -326,7 +328,7 @@
 /// @param from The path to hard link from. This is created.
 /// @returns errc::success if the link was created, otherwise a platform
 /// specific error_code.
-std::error_code create_link(const Twine &to, const Twine &from);
+LLVM_SUPPORT_ABI std::error_code create_link(const Twine &to, const Twine &from);
 
 /// Create a hard link from \a from to \a to, or return an error.
 ///
@@ -334,7 +336,7 @@
 /// @param from The path to hard link from. This is created.
 /// @returns errc::success if the link was created, otherwise a platform
 /// specific error_code.
-std::error_code create_hard_link(const Twine &to, const Twine &from);
+LLVM_SUPPORT_ABI std::error_code create_hard_link(const Twine &to, const Twine &from);
 
 /// Collapse all . and .. patterns, resolve all symlinks, and optionally
 ///        expand ~ expressions to the user's home directory.
@@ -343,28 +345,28 @@
 /// @param output The location to store the resolved path.
 /// @param expand_tilde If true, resolves ~ expressions to the user's home
 ///                     directory.
-std::error_code real_path(const Twine &path, SmallVectorImpl<char> &output,
+LLVM_SUPPORT_ABI std::error_code real_path(const Twine &path, SmallVectorImpl<char> &output,
                           bool expand_tilde = false);
 
 /// Expands ~ expressions to the user's home directory. On Unix ~user
 /// directories are resolved as well.
 ///
 /// @param path The path to resolve.
-void expand_tilde(const Twine &path, SmallVectorImpl<char> &output);
+LLVM_SUPPORT_ABI void expand_tilde(const Twine &path, SmallVectorImpl<char> &output);
 
 /// Get the current path.
 ///
 /// @param result Holds the current path on return.
 /// @returns errc::success if the current path has been stored in result,
 ///          otherwise a platform-specific error_code.
-std::error_code current_path(SmallVectorImpl<char> &result);
+LLVM_SUPPORT_ABI std::error_code current_path(SmallVectorImpl<char> &result);
 
 /// Set the current path.
 ///
 /// @param path The path to set.
 /// @returns errc::success if the current path was successfully set,
 ///          otherwise a platform-specific error_code.
-std::error_code set_current_path(const Twine &path);
+LLVM_SUPPORT_ABI std::error_code set_current_path(const Twine &path);
 
 /// Remove path. Equivalent to POSIX remove().
 ///
@@ -372,14 +374,14 @@
 /// @returns errc::success if path has been removed or didn't exist, otherwise a
 ///          platform-specific error code. If IgnoreNonExisting is false, also
 ///          returns error if the file didn't exist.
-std::error_code remove(const Twine &path, bool IgnoreNonExisting = true);
+LLVM_SUPPORT_ABI std::error_code remove(const Twine &path, bool IgnoreNonExisting = true);
 
 /// Recursively delete a directory.
 ///
 /// @param path Input path.
 /// @returns errc::success if path has been removed or didn't exist, otherwise a
 ///          platform-specific error code.
-std::error_code remove_directories(const Twine &path, bool IgnoreErrors = true);
+LLVM_SUPPORT_ABI std::error_code remove_directories(const Twine &path, bool IgnoreErrors = true);
 
 /// Rename \a from to \a to.
 ///
@@ -389,19 +391,19 @@
 ///
 /// @param from The path to rename from.
 /// @param to The path to rename to. This is created.
-std::error_code rename(const Twine &from, const Twine &to);
+LLVM_SUPPORT_ABI std::error_code rename(const Twine &from, const Twine &to);
 
 /// Copy the contents of \a From to \a To.
 ///
 /// @param From The path to copy from.
 /// @param To The path to copy to. This is created.
-std::error_code copy_file(const Twine &From, const Twine &To);
+LLVM_SUPPORT_ABI std::error_code copy_file(const Twine &From, const Twine &To);
 
 /// Copy the contents of \a From to \a To.
 ///
 /// @param From The path to copy from.
 /// @param ToFD The open file descriptor of the destination file.
-std::error_code copy_file(const Twine &From, int ToFD);
+LLVM_SUPPORT_ABI std::error_code copy_file(const Twine &From, int ToFD);
 
 /// Resize path to size. File is resized as if by POSIX truncate().
 ///
@@ -409,7 +411,7 @@
 /// @param Size Size to resize to.
 /// @returns errc::success if \a path has been resized to \a size, otherwise a
 ///          platform-specific error_code.
-std::error_code resize_file(int FD, uint64_t Size);
+LLVM_SUPPORT_ABI std::error_code resize_file(int FD, uint64_t Size);
 
 /// Resize \p FD to \p Size before mapping \a mapped_file_region::readwrite. On
 /// non-Windows, this calls \a resize_file(). On Windows, this is a no-op,
@@ -431,10 +433,10 @@
 /// @param FD Input file descriptor.
 /// @returns An MD5Result with the hash computed, if successful, otherwise a
 ///          std::error_code.
-ErrorOr<MD5::MD5Result> md5_contents(int FD);
+LLVM_SUPPORT_ABI ErrorOr<MD5::MD5Result> md5_contents(int FD);
 
 /// Version of compute_md5 that doesn't require an open file descriptor.
-ErrorOr<MD5::MD5Result> md5_contents(const Twine &Path);
+LLVM_SUPPORT_ABI ErrorOr<MD5::MD5Result> md5_contents(const Twine &Path);
 
 /// @}
 /// @name Physical Observers
@@ -445,7 +447,7 @@
 /// @param status A basic_file_status previously returned from stat.
 /// @returns True if the file represented by status exists, false if it does
 ///          not.
-bool exists(const basic_file_status &status);
+LLVM_SUPPORT_ABI bool exists(const basic_file_status &status);
 
 enum class AccessMode { Exist, Write, Execute };
 
@@ -454,7 +456,7 @@
 /// @param Path Input path.
 /// @returns errc::success if the path can be accessed, otherwise a
 ///          platform-specific error_code.
-std::error_code access(const Twine &Path, AccessMode Mode);
+LLVM_SUPPORT_ABI std::error_code access(const Twine &Path, AccessMode Mode);
 
 /// Does file exist?
 ///
@@ -468,7 +470,7 @@
 ///
 /// @param Path Input path.
 /// @returns True if we can execute it, false otherwise.
-bool can_execute(const Twine &Path);
+LLVM_SUPPORT_ABI bool can_execute(const Twine &Path);
 
 /// Can we write this file?
 ///
@@ -487,7 +489,7 @@
 ///
 /// @returns True if A and B both represent the same file system entity, false
 ///          otherwise.
-bool equivalent(file_status A, file_status B);
+LLVM_SUPPORT_ABI bool equivalent(file_status A, file_status B);
 
 /// Do paths represent the same thing?
 ///
@@ -499,7 +501,7 @@
 ///               inode (or equivalent).
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform-specific error_code.
-std::error_code equivalent(const Twine &A, const Twine &B, bool &result);
+LLVM_SUPPORT_ABI std::error_code equivalent(const Twine &A, const Twine &B, bool &result);
 
 /// Simpler version of equivalent for clients that don't need to
 ///        differentiate between an error and false.
@@ -515,10 +517,10 @@
 ///               false if it is not.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform specific error_code.
-std::error_code is_local(const Twine &path, bool &result);
+LLVM_SUPPORT_ABI std::error_code is_local(const Twine &path, bool &result);
 
 /// Version of is_local accepting an open file descriptor.
-std::error_code is_local(int FD, bool &result);
+LLVM_SUPPORT_ABI std::error_code is_local(int FD, bool &result);
 
 /// Simpler version of is_local for clients that don't need to
 ///        differentiate between an error and false.
@@ -546,7 +548,7 @@
 ///
 /// @param status A basic_file_status previously returned from status.
 /// @returns status.type() == file_type::directory_file.
-bool is_directory(const basic_file_status &status);
+LLVM_SUPPORT_ABI bool is_directory(const basic_file_status &status);
 
 /// Is path a directory?
 ///
@@ -555,7 +557,7 @@
 ///               symlinks, false if it is not. Undefined otherwise.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform-specific error_code.
-std::error_code is_directory(const Twine &path, bool &result);
+LLVM_SUPPORT_ABI std::error_code is_directory(const Twine &path, bool &result);
 
 /// Simpler version of is_directory for clients that don't need to
 ///        differentiate between an error and false.
@@ -568,7 +570,7 @@
 ///
 /// @param status A basic_file_status previously returned from status.
 /// @returns status_known(status) && status.type() == file_type::regular_file.
-bool is_regular_file(const basic_file_status &status);
+LLVM_SUPPORT_ABI bool is_regular_file(const basic_file_status &status);
 
 /// Is path a regular file?
 ///
@@ -577,7 +579,7 @@
 ///               symlinks), false if it is not. Undefined otherwise.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform-specific error_code.
-std::error_code is_regular_file(const Twine &path, bool &result);
+LLVM_SUPPORT_ABI std::error_code is_regular_file(const Twine &path, bool &result);
 
 /// Simpler version of is_regular_file for clients that don't need to
 ///        differentiate between an error and false.
@@ -637,15 +639,15 @@
 ///               statted.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform-specific error_code.
-std::error_code status(const Twine &path, file_status &result,
+LLVM_SUPPORT_ABI std::error_code status(const Twine &path, file_status &result,
                        bool follow = true);
 
 /// A version for when a file descriptor is already available.
-std::error_code status(int FD, file_status &Result);
+LLVM_SUPPORT_ABI std::error_code status(int FD, file_status &Result);
 
 #ifdef _WIN32
 /// A version for when a file descriptor is already available.
-std::error_code status(file_t FD, file_status &Result);
+LLVM_SUPPORT_ABI std::error_code status(file_t FD, file_status &Result);
 #endif
 
 /// Get file creation mode mask of the process.
@@ -654,7 +656,7 @@
 /// @note There is no umask on Windows. This function returns 0 always
 ///       on Windows. This function does not return an error_code because
 ///       umask(2) never fails. It is not thread safe.
-unsigned getUmask();
+LLVM_SUPPORT_ABI unsigned getUmask();
 
 /// Set file permissions.
 ///
@@ -665,12 +667,12 @@
 /// @note On Windows, all permissions except *_write are ignored. Using any of
 ///       owner_write, group_write, or all_write will make the file writable.
 ///       Otherwise, the file will be marked as read-only.
-std::error_code setPermissions(const Twine &Path, perms Permissions);
+LLVM_SUPPORT_ABI std::error_code setPermissions(const Twine &Path, perms Permissions);
 
 /// Vesion of setPermissions accepting a file descriptor.
 /// TODO Delete the path based overload once we implement the FD based overload
 /// on Windows.
-std::error_code setPermissions(int FD, perms Permissions);
+LLVM_SUPPORT_ABI std::error_code setPermissions(int FD, perms Permissions);
 
 /// Get file permissions.
 ///
@@ -680,7 +682,7 @@
 /// @note On Windows, if the file does not have the FILE_ATTRIBUTE_READONLY
 ///       attribute, all_all will be returned. Otherwise, all_read | all_exe
 ///       will be returned.
-ErrorOr<perms> getPermissions(const Twine &Path);
+LLVM_SUPPORT_ABI ErrorOr<perms> getPermissions(const Twine &Path);
 
 /// Get file size.
 ///
@@ -702,7 +704,7 @@
 /// @returns errc::success if the file times were successfully set, otherwise a
 ///          platform-specific error_code or errc::function_not_supported on
 ///          platforms where the functionality isn't available.
-std::error_code setLastAccessAndModificationTime(int FD, TimePoint<> AccessTime,
+LLVM_SUPPORT_ABI std::error_code setLastAccessAndModificationTime(int FD, TimePoint<> AccessTime,
                                                  TimePoint<> ModificationTime);
 
 /// Simpler version that sets both file modification and access time to the same
@@ -828,14 +830,14 @@
 /// @param Mode Set to the opened file's permissions.
 /// @returns errc::success if Result{FD,Path} have been successfully set,
 ///          otherwise a platform-specific error_code.
-std::error_code createUniqueFile(const Twine &Model, int &ResultFD,
+LLVM_SUPPORT_ABI std::error_code createUniqueFile(const Twine &Model, int &ResultFD,
                                  SmallVectorImpl<char> &ResultPath,
                                  OpenFlags Flags = OF_None,
                                  unsigned Mode = all_read | all_write);
 
 /// Simpler version for clients that don't want an open file. An empty
 /// file will still be created.
-std::error_code createUniqueFile(const Twine &Model,
+LLVM_SUPPORT_ABI std::error_code createUniqueFile(const Twine &Model,
                                  SmallVectorImpl<char> &ResultPath,
                                  unsigned Mode = all_read | all_write);
 
@@ -846,7 +848,7 @@
 ///
 /// The destructor doesn't implicitly discard because there is no way to
 /// properly handle errors in a destructor.
-class TempFile {
+class LLVM_SUPPORT_ABI TempFile {
   bool Done = false;
   TempFile(StringRef Name, int FD);
 
@@ -886,18 +888,18 @@
 ///
 /// This should be used for things like a temporary .s that is removed after
 /// running the assembler.
-std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
+LLVM_SUPPORT_ABI std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
                                     int &ResultFD,
                                     SmallVectorImpl<char> &ResultPath,
                                     OpenFlags Flags = OF_None);
 
 /// Simpler version for clients that don't want an open file. An empty
 /// file will still be created.
-std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
+LLVM_SUPPORT_ABI std::error_code createTemporaryFile(const Twine &Prefix, StringRef Suffix,
                                     SmallVectorImpl<char> &ResultPath,
                                     OpenFlags Flags = OF_None);
 
-std::error_code createUniqueDirectory(const Twine &Prefix,
+LLVM_SUPPORT_ABI std::error_code createUniqueDirectory(const Twine &Prefix,
                                       SmallVectorImpl<char> &ResultPath);
 
 /// Get a unique name, not currently exisiting in the filesystem. Subject
@@ -918,7 +920,7 @@
 /// checks if it exists. This function is subject to race conditions, if you
 /// want to use the returned name to actually create a file, use
 /// createTemporaryFile instead.
-std::error_code
+LLVM_SUPPORT_ABI std::error_code
 getPotentiallyUniqueTempFileName(const Twine &Prefix, StringRef Suffix,
                                  SmallVectorImpl<char> &ResultPath);
 
@@ -956,7 +958,7 @@
 /// @param Mode The access permissions of the file, represented in octal.
 /// @returns errc::success if \a Name has been opened, otherwise a
 ///          platform-specific error_code.
-std::error_code openFile(const Twine &Name, int &ResultFD,
+LLVM_SUPPORT_ABI std::error_code openFile(const Twine &Name, int &ResultFD,
                          CreationDisposition Disp, FileAccess Access,
                          OpenFlags Flags, unsigned Mode = 0666);
 
@@ -974,16 +976,16 @@
 /// @param Mode The access permissions of the file, represented in octal.
 /// @returns errc::success if \a Name has been opened, otherwise a
 ///          platform-specific error_code.
-Expected<file_t> openNativeFile(const Twine &Name, CreationDisposition Disp,
+LLVM_SUPPORT_ABI Expected<file_t> openNativeFile(const Twine &Name, CreationDisposition Disp,
                                 FileAccess Access, OpenFlags Flags,
                                 unsigned Mode = 0666);
 
 /// Converts from a Posix file descriptor number to a native file handle.
 /// On Windows, this retreives the underlying handle. On non-Windows, this is a
 /// no-op.
-file_t convertFDToNativeFile(int FD);
-
-#ifndef _WIN32
+#if defined(_WIN32)
+LLVM_SUPPORT_ABI file_t convertFDToNativeFile(int FD);
+#else
 inline file_t convertFDToNativeFile(int FD) { return FD; }
 #endif
 
@@ -1006,7 +1008,7 @@
 /// @param FileHandle File to read from.
 /// @param Buf Buffer to read into.
 /// @returns The number of bytes read, or error.
-Expected<size_t> readNativeFile(file_t FileHandle, MutableArrayRef<char> Buf);
+LLVM_SUPPORT_ABI Expected<size_t> readNativeFile(file_t FileHandle, MutableArrayRef<char> Buf);
 
 /// Reads \p Buf.size() bytes from \p FileHandle at offset \p Offset into \p
 /// Buf. If 'pread' is available, this will use that, otherwise it will use
@@ -1017,7 +1019,7 @@
 /// @param Buf Buffer to read into.
 /// @param Offset Offset into the file at which the read should occur.
 /// @returns The number of bytes read, or error.
-Expected<size_t> readNativeFileSlice(file_t FileHandle,
+LLVM_SUPPORT_ABI Expected<size_t> readNativeFileSlice(file_t FileHandle,
                                      MutableArrayRef<char> Buf,
                                      uint64_t Offset);
 
@@ -1119,7 +1121,7 @@
 ///                 location.
 /// @returns errc::success if \a Name has been opened, otherwise a
 ///          platform-specific error_code.
-std::error_code openFileForRead(const Twine &Name, int &ResultFD,
+LLVM_SUPPORT_ABI std::error_code openFileForRead(const Twine &Name, int &ResultFD,
                                 OpenFlags Flags = OF_None,
                                 SmallVectorImpl<char> *RealPath = nullptr);
 
@@ -1135,7 +1137,7 @@
 ///                 location.
 /// @returns a platform-specific file descriptor if \a Name has been opened,
 ///          otherwise an error object.
-Expected<file_t>
+LLVM_SUPPORT_ABI Expected<file_t>
 openNativeFileForRead(const Twine &Name, OpenFlags Flags = OF_None,
                       SmallVectorImpl<char> *RealPath = nullptr);
 
@@ -1160,7 +1162,7 @@
 /// context, as it may not prevent other threads in the same process from
 /// obtaining a lock on the same file, even if they are using a different file
 /// descriptor.
-std::error_code
+LLVM_SUPPORT_ABI std::error_code
 tryLockFile(int FD,
             std::chrono::milliseconds Timeout = std::chrono::milliseconds(0));
 
@@ -1174,7 +1176,7 @@
 /// @param FD The descriptor representing the file to unlock.
 /// @returns errc::success if lock is successfully released or platform-specific
 /// error_code otherwise.
-std::error_code unlockFile(int FD);
+LLVM_SUPPORT_ABI std::error_code unlockFile(int FD);
 
 /// @brief Close the file object.  This should be used instead of ::close for
 /// portability. On error, the caller should assume the file is closed, as is
@@ -1185,7 +1187,7 @@
 ///
 /// @returns An error code if closing the file failed. Typically, an error here
 /// means that the filesystem may have failed to perform some buffered writes.
-std::error_code closeFile(file_t &F);
+LLVM_SUPPORT_ABI std::error_code closeFile(file_t &F);
 
 #ifdef LLVM_ON_UNIX
 /// @brief Change ownership of a file.
@@ -1226,7 +1228,7 @@
   }
 };
 
-std::error_code getUniqueID(const Twine Path, UniqueID &Result);
+LLVM_SUPPORT_ABI std::error_code getUniqueID(const Twine Path, UniqueID &Result);
 
 /// Get disk space usage information.
 ///
@@ -1241,7 +1243,7 @@
 
 /// This class represents a memory mapped file. It is based on
 /// boost::iostreams::mapped_file.
-class mapped_file_region {
+class LLVM_SUPPORT_ABI mapped_file_region {
 public:
   enum mapmode {
     readonly, ///< May only access map via const_data as read only.
@@ -1317,14 +1319,14 @@
 /// Return the path to the main executable, given the value of argv[0] from
 /// program startup and the address of main itself. In extremis, this function
 /// may fail and return an empty path.
-std::string getMainExecutable(const char *argv0, void *MainExecAddr);
+LLVM_SUPPORT_ABI std::string getMainExecutable(const char *argv0, void *MainExecAddr);
 
 /// @}
 /// @name Iterators
 /// @{
 
 /// directory_entry - A single entry in a directory.
-class directory_entry {
+class LLVM_SUPPORT_ABI directory_entry {
   // FIXME: different platforms make different information available "for free"
   // when traversing a directory. The design of this class wraps most of the
   // information in basic_file_status, so on platforms where we can't populate
@@ -1374,9 +1376,9 @@
 
   struct DirIterState;
 
-  std::error_code directory_iterator_construct(DirIterState &, StringRef, bool);
-  std::error_code directory_iterator_increment(DirIterState &);
-  std::error_code directory_iterator_destruct(DirIterState &);
+  LLVM_SUPPORT_ABI std::error_code directory_iterator_construct(DirIterState &, StringRef, bool);
+  LLVM_SUPPORT_ABI std::error_code directory_iterator_increment(DirIterState &);
+  LLVM_SUPPORT_ABI std::error_code directory_iterator_destruct(DirIterState &);
 
   /// Keeps state for the directory_iterator.
   struct DirIterState {
diff --git a/llvm/include/llvm/Support/FileUtilities.h b/llvm/include/llvm/Support/FileUtilities.h
--- a/llvm/include/llvm/Support/FileUtilities.h
+++ b/llvm/include/llvm/Support/FileUtilities.h
@@ -18,6 +18,7 @@
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/Path.h"
 
 namespace llvm {
@@ -29,7 +30,7 @@
   /// option, it will set the string to an error message if an error occurs, or
   /// if the files are different.
   ///
-  int DiffFilesWithTolerance(StringRef FileA,
+  LLVM_SUPPORT_ABI int DiffFilesWithTolerance(StringRef FileA,
                              StringRef FileB,
                              double AbsTol, double RelTol,
                              std::string *Error = nullptr);
@@ -82,7 +83,7 @@
     failed_to_rename_temp_file
   };
 
-  class AtomicFileWriteError : public llvm::ErrorInfo<AtomicFileWriteError> {
+  class LLVM_SUPPORT_ABI AtomicFileWriteError : public llvm::ErrorInfo<AtomicFileWriteError> {
   public:
     AtomicFileWriteError(atomic_write_error Error) : Error(Error) {}
 
@@ -104,10 +105,10 @@
   /// writes content of \p Buffer to the file and renames it to \p FinalPath.
   ///
   /// \returns \c AtomicFileWriteError in case of error.
-  llvm::Error writeFileAtomically(StringRef TempPathModel, StringRef FinalPath,
+  LLVM_SUPPORT_ABI llvm::Error writeFileAtomically(StringRef TempPathModel, StringRef FinalPath,
                                   StringRef Buffer);
 
-  llvm::Error
+  LLVM_SUPPORT_ABI llvm::Error
   writeFileAtomically(StringRef TempPathModel, StringRef FinalPath,
                       std::function<llvm::Error(llvm::raw_ostream &)> Writer);
 } // End llvm namespace
diff --git a/llvm/include/llvm/Support/Format.h b/llvm/include/llvm/Support/Format.h
--- a/llvm/include/llvm/Support/Format.h
+++ b/llvm/include/llvm/Support/Format.h
@@ -26,6 +26,8 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cassert>
 #include <cstdio>
 #include <tuple>
@@ -35,7 +37,7 @@
 
 /// This is a helper class used for handling formatted output.  It is the
 /// abstract base class of a templated derived class.
-class format_object_base {
+class LLVM_SUPPORT_ABI format_object_base {
 protected:
   const char *Fmt;
   ~format_object_base() = default; // Disallow polymorphic deletion.
diff --git a/llvm/include/llvm/Support/FormatProviders.h b/llvm/include/llvm/Support/FormatProviders.h
--- a/llvm/include/llvm/Support/FormatProviders.h
+++ b/llvm/include/llvm/Support/FormatProviders.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/FormatVariadicDetails.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/NativeFormatting.h"
 
 #include <type_traits>
diff --git a/llvm/include/llvm/Support/FormatVariadic.h b/llvm/include/llvm/Support/FormatVariadic.h
--- a/llvm/include/llvm/Support/FormatVariadic.h
+++ b/llvm/include/llvm/Support/FormatVariadic.h
@@ -33,7 +33,9 @@
 #include "llvm/Support/FormatCommon.h"
 #include "llvm/Support/FormatProviders.h"
 #include "llvm/Support/FormatVariadicDetails.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <cstddef>
 #include <string>
 #include <tuple>
@@ -62,7 +64,7 @@
   StringRef Options;
 };
 
-class formatv_object_base {
+class LLVM_SUPPORT_ABI formatv_object_base {
 protected:
   StringRef Fmt;
   ArrayRef<detail::format_adapter *> Adapters;
diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h
--- a/llvm/include/llvm/Support/FormatVariadicDetails.h
+++ b/llvm/include/llvm/Support/FormatVariadicDetails.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_FORMATVARIADICDETAILS_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
 
 #include <type_traits>
@@ -19,7 +20,7 @@
 class Error;
 
 namespace detail {
-class format_adapter {
+class LLVM_SUPPORT_ABI format_adapter {
   virtual void anchor();
 
 protected:
diff --git a/llvm/include/llvm/Support/FormattedStream.h b/llvm/include/llvm/Support/FormattedStream.h
--- a/llvm/include/llvm/Support/FormattedStream.h
+++ b/llvm/include/llvm/Support/FormattedStream.h
@@ -15,7 +15,9 @@
 #define LLVM_SUPPORT_FORMATTEDSTREAM_H
 
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <utility>
 
 namespace llvm {
@@ -27,7 +29,7 @@
 /// doesn't attempt to handle everything Unicode can do (combining characters,
 /// right-to-left markers, etc), but should cover the cases likely to appear in
 /// source code or diagnostic messages.
-class formatted_raw_ostream : public raw_ostream {
+class LLVM_SUPPORT_ABI formatted_raw_ostream : public raw_ostream {
   /// TheStream - The real stream we output to. We set it to be
   /// unbuffered, since we're already doing our own buffering.
   ///
@@ -169,7 +171,7 @@
 
 /// fouts() - This returns a reference to a formatted_raw_ostream for
 /// standard output.  Use it like: fouts() << "foo" << "bar";
-formatted_raw_ostream &fouts();
+LLVM_SUPPORT_ABI formatted_raw_ostream &fouts();
 
 /// ferrs() - This returns a reference to a formatted_raw_ostream for
 /// standard error.  Use it like: ferrs() << "foo" << "bar";
@@ -177,7 +179,7 @@
 
 /// fdbgs() - This returns a reference to a formatted_raw_ostream for
 /// debug output.  Use it like: fdbgs() << "foo" << "bar";
-formatted_raw_ostream &fdbgs();
+LLVM_SUPPORT_ABI formatted_raw_ostream &fdbgs();
 
 } // end llvm namespace
 
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
--- a/llvm/include/llvm/Support/GlobPattern.h
+++ b/llvm/include/llvm/Support/GlobPattern.h
@@ -17,6 +17,8 @@
 #include "llvm/ADT/BitVector.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <vector>
 
 // This class represents a glob pattern. Supported metacharacters
@@ -26,7 +28,7 @@
 template <typename T> class ArrayRef;
 class StringRef;
 
-class GlobPattern {
+class LLVM_SUPPORT_ABI GlobPattern {
 public:
   static Expected<GlobPattern> create(StringRef Pat);
   bool match(StringRef S) const;
diff --git a/llvm/include/llvm/Support/GraphWriter.h b/llvm/include/llvm/Support/GraphWriter.h
--- a/llvm/include/llvm/Support/GraphWriter.h
+++ b/llvm/include/llvm/Support/GraphWriter.h
@@ -27,7 +27,9 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/DOTGraphTraits.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <algorithm>
 #include <cstddef>
 #include <iterator>
@@ -39,11 +41,11 @@
 
 namespace DOT {  // Private functions...
 
-std::string EscapeString(const std::string &Label);
+LLVM_SUPPORT_ABI std::string EscapeString(const std::string &Label);
 
 /// Get a color string for this node number. Simply round-robin selects
 /// from a reasonable number of colors.
-StringRef getColorString(unsigned NodeNumber);
+LLVM_SUPPORT_ABI StringRef getColorString(unsigned NodeNumber);
 
 } // end namespace DOT
 
@@ -59,7 +61,7 @@
 
 } // end namespace GraphProgram
 
-bool DisplayGraph(StringRef Filename, bool wait = true,
+LLVM_SUPPORT_ABI bool DisplayGraph(StringRef Filename, bool wait = true,
                   GraphProgram::Name program = GraphProgram::DOT);
 
 template<typename GraphType>
@@ -316,7 +318,7 @@
   return O;
 }
 
-std::string createGraphFilename(const Twine &Name, int &FD);
+LLVM_SUPPORT_ABI std::string createGraphFilename(const Twine &Name, int &FD);
 
 /// Writes graph into a provided @c Filename.
 /// If @c Filename is empty, generates a random one.
diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/Support/Host.h
--- a/llvm/include/llvm/Support/Host.h
+++ b/llvm/include/llvm/Support/Host.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_SUPPORT_HOST_H
 #define LLVM_SUPPORT_HOST_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <string>
 
 namespace llvm {
@@ -29,18 +31,18 @@
   ///   CPU_TYPE-VENDOR-OPERATING_SYSTEM
   /// or
   ///   CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
-  std::string getDefaultTargetTriple();
+  LLVM_SUPPORT_ABI std::string getDefaultTargetTriple();
 
   /// getProcessTriple() - Return an appropriate target triple for generating
   /// code to be loaded into the current process, e.g. when using the JIT.
-  std::string getProcessTriple();
+  LLVM_SUPPORT_ABI std::string getProcessTriple();
 
   /// getHostCPUName - Get the LLVM name for the host CPU. The particular format
   /// of the name is target dependent, and suitable for passing as -mcpu to the
   /// target which matches the host.
   ///
   /// \return - The host CPU name, or empty if the CPU could not be determined.
-  StringRef getHostCPUName();
+  LLVM_SUPPORT_ABI StringRef getHostCPUName();
 
   /// getHostCPUFeatures - Get the LLVM names for the host CPU features.
   /// The particular format of the names are target dependent, and suitable for
@@ -52,19 +54,19 @@
   /// all valid LLVM feature names.
   ///
   /// \return - True on success.
-  bool getHostCPUFeatures(StringMap<bool, MallocAllocator> &Features);
+  LLVM_SUPPORT_ABI bool getHostCPUFeatures(StringMap<bool, MallocAllocator> &Features);
 
   /// Get the number of physical cores (as opposed to logical cores returned
   /// from thread::hardware_concurrency(), which includes hyperthreads).
   /// Returns -1 if unknown for the current host system.
-  int getHostNumPhysicalCores();
+  LLVM_SUPPORT_ABI int getHostNumPhysicalCores();
 
   namespace detail {
   /// Helper functions to extract HostCPUName from /proc/cpuinfo on linux.
-  StringRef getHostCPUNameForPowerPC(StringRef ProcCpuinfoContent);
-  StringRef getHostCPUNameForARM(StringRef ProcCpuinfoContent);
-  StringRef getHostCPUNameForS390x(StringRef ProcCpuinfoContent);
-  StringRef getHostCPUNameForBPF();
+  LLVM_SUPPORT_ABI StringRef getHostCPUNameForPowerPC(StringRef ProcCpuinfoContent);
+  LLVM_SUPPORT_ABI StringRef getHostCPUNameForARM(StringRef ProcCpuinfoContent);
+  LLVM_SUPPORT_ABI StringRef getHostCPUNameForS390x(StringRef ProcCpuinfoContent);
+  LLVM_SUPPORT_ABI StringRef getHostCPUNameForBPF();
 
   /// Helper functions to extract CPU details from CPUID on x86.
   namespace x86 {
diff --git a/llvm/include/llvm/Support/InitLLVM.h b/llvm/include/llvm/Support/InitLLVM.h
--- a/llvm/include/llvm/Support/InitLLVM.h
+++ b/llvm/include/llvm/Support/InitLLVM.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/PrettyStackTrace.h"
 
 // The main() functions in typical LLVM tools start with InitLLVM which does
@@ -32,7 +33,7 @@
 // InitLLVM calls llvm_shutdown() on destruction, which cleans up
 // ManagedStatic objects.
 namespace llvm {
-class InitLLVM {
+class LLVM_SUPPORT_ABI InitLLVM {
 public:
   InitLLVM(int &Argc, const char **&Argv,
            bool InstallPipeSignalExitHandler = true);
diff --git a/llvm/include/llvm/Support/InstructionCost.h b/llvm/include/llvm/Support/InstructionCost.h
--- a/llvm/include/llvm/Support/InstructionCost.h
+++ b/llvm/include/llvm/Support/InstructionCost.h
@@ -19,14 +19,16 @@
 #define LLVM_SUPPORT_INSTRUCTIONCOST_H
 
 #include "llvm/ADT/Optional.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MathExtras.h"
+
 #include <limits>
 
 namespace llvm {
 
 class raw_ostream;
 
-class InstructionCost {
+class LLVM_SUPPORT_ABI InstructionCost {
 public:
   using CostType = int64_t;
 
diff --git a/llvm/include/llvm/Support/ItaniumManglingCanonicalizer.h b/llvm/include/llvm/Support/ItaniumManglingCanonicalizer.h
--- a/llvm/include/llvm/Support/ItaniumManglingCanonicalizer.h
+++ b/llvm/include/llvm/Support/ItaniumManglingCanonicalizer.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_SUPPORT_ITANIUMMANGLINGCANONICALIZER_H
 #define LLVM_SUPPORT_ITANIUMMANGLINGCANONICALIZER_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cstddef>
 #include <cstdint>
 
@@ -33,7 +35,7 @@
 /// This can be used when data (eg, profiling data) is available for a version
 /// of a program built in a different configuration, with correspondingly
 /// different manglings.
-class ItaniumManglingCanonicalizer {
+class LLVM_SUPPORT_ABI ItaniumManglingCanonicalizer {
 public:
   ItaniumManglingCanonicalizer();
   ItaniumManglingCanonicalizer(const ItaniumManglingCanonicalizer &) = delete;
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -51,7 +51,9 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FormatVariadic.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <map>
 
 namespace llvm {
@@ -74,11 +76,11 @@
 
 /// Returns true if \p S is valid UTF-8, which is required for use as JSON.
 /// If it returns false, \p Offset is set to a byte offset near the first error.
-bool isUTF8(llvm::StringRef S, size_t *ErrOffset = nullptr);
+LLVM_SUPPORT_ABI bool isUTF8(llvm::StringRef S, size_t *ErrOffset = nullptr);
 /// Replaces invalid UTF-8 sequences in \p S with the replacement character
 /// (U+FFFD). The returned string is valid UTF-8.
 /// This is much slower than isUTF8, so test that first.
-std::string fixUTF8(llvm::StringRef S);
+LLVM_SUPPORT_ABI std::string fixUTF8(llvm::StringRef S);
 
 class Array;
 class ObjectKey;
@@ -87,7 +89,7 @@
 
 /// An Object is a JSON object, which maps strings to heterogenous JSON values.
 /// It simulates DenseMap<ObjectKey, Value>. ObjectKey is a maybe-owned string.
-class Object {
+class LLVM_SUPPORT_ABI Object {
   using Storage = DenseMap<ObjectKey, Value, llvm::DenseMapInfo<StringRef>>;
   Storage M;
 
@@ -146,14 +148,16 @@
   const json::Array *getArray(StringRef K) const;
   json::Array *getArray(StringRef K);
 };
-bool operator==(const Object &LHS, const Object &RHS);
+
+LLVM_SUPPORT_ABI bool operator==(const Object &LHS, const Object &RHS);
+
 inline bool operator!=(const Object &LHS, const Object &RHS) {
   return !(LHS == RHS);
 }
 
 /// An Array is a JSON array, which contains heterogeneous JSON values.
 /// It simulates std::vector<Value>.
-class Array {
+class LLVM_SUPPORT_ABI Array {
   std::vector<Value> V;
 
 public:
@@ -286,7 +290,7 @@
 /// And parsed:
 ///   Expected<Value> E = json::parse("[1, 2, null]");
 ///   assert(E && E->kind() == Value::Array);
-class Value {
+class LLVM_SUPPORT_ABI Value {
 public:
   enum Kind {
     Null,
@@ -482,10 +486,12 @@
   mutable llvm::AlignedCharArrayUnion<bool, double, int64_t, llvm::StringRef,
                                       std::string, json::Array, json::Object>
       Union;
-  friend bool operator==(const Value &, const Value &);
+
+  friend LLVM_SUPPORT_ABI bool operator==(const Value &, const Value &);
 };
 
-bool operator==(const Value &, const Value &);
+LLVM_SUPPORT_ABI bool operator==(const Value &, const Value &);
+
 inline bool operator!=(const Value &L, const Value &R) { return !(L == R); }
 
 /// ObjectKey is a used to capture keys in Object. Like Value but:
@@ -567,7 +573,7 @@
 /// A "cursor" marking a position within a Value.
 /// The Value is a tree, and this is the path from the root to the current node.
 /// This is used to associate errors with particular subobjects.
-class Path {
+class LLVM_SUPPORT_ABI Path {
 public:
   class Root;
 
@@ -614,7 +620,7 @@
 
 /// The root is the trivial Path to the root value.
 /// It also stores the latest reported error and the path where it occurred.
-class Path::Root {
+class LLVM_SUPPORT_ABI Path::Root {
   llvm::StringRef Name;
   llvm::StringLiteral ErrorMessage;
   std::vector<Path::Segment> ErrorPath; // Only valid in error state. Reversed.
@@ -797,7 +803,7 @@
 /// Parses the provided JSON source, or returns a ParseError.
 /// The returned Value is self-contained and owns its strings (they do not refer
 /// to the original source).
-llvm::Expected<Value> parse(llvm::StringRef JSON);
+LLVM_SUPPORT_ABI llvm::Expected<Value> parse(llvm::StringRef JSON);
 
 class ParseError : public llvm::ErrorInfo<ParseError> {
   const char *Msg;
@@ -883,7 +889,7 @@
 /// This can be mismatched begin()/end() pairs, trying to emit attributes inside
 /// an array, and so on.
 /// With asserts disabled, this is undefined behavior.
-class OStream {
+class LLVM_SUPPORT_ABI OStream {
  public:
   using Block = llvm::function_ref<void()>;
   // If IndentSize is nonzero, output is pretty-printed.
@@ -1002,7 +1008,7 @@
 /// Allow printing json::Value with formatv().
 /// The default style is basic/compact formatting, like operator<<.
 /// A format string like formatv("{0:2}", Value) pretty-prints with indent 2.
-template <> struct format_provider<llvm::json::Value> {
+template <> struct LLVM_SUPPORT_ABI format_provider<llvm::json::Value> {
   static void format(const llvm::json::Value &, raw_ostream &, StringRef);
 };
 } // namespace llvm
diff --git a/llvm/include/llvm/Support/KnownBits.h b/llvm/include/llvm/Support/KnownBits.h
--- a/llvm/include/llvm/Support/KnownBits.h
+++ b/llvm/include/llvm/Support/KnownBits.h
@@ -16,11 +16,12 @@
 
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/Optional.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
 // Struct for tracking the known zeros and ones of a value.
-struct KnownBits {
+struct LLVM_SUPPORT_ABI KnownBits {
   APInt Zero;
   APInt One;
 
diff --git a/llvm/include/llvm/Support/LEB128.h b/llvm/include/llvm/Support/LEB128.h
--- a/llvm/include/llvm/Support/LEB128.h
+++ b/llvm/include/llvm/Support/LEB128.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_LEB128_H
 #define LLVM_SUPPORT_LEB128_H
 
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
@@ -198,10 +199,10 @@
 }
 
 /// Utility function to get the size of the ULEB128-encoded value.
-extern unsigned getULEB128Size(uint64_t Value);
+LLVM_SUPPORT_ABI unsigned getULEB128Size(uint64_t Value);
 
 /// Utility function to get the size of the SLEB128-encoded value.
-extern unsigned getSLEB128Size(int64_t Value);
+LLVM_SUPPORT_ABI unsigned getSLEB128Size(int64_t Value);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Support/LLVMSupportExports.h b/llvm/include/llvm/Support/LLVMSupportExports.h
new file mode 100644
--- /dev/null
+++ b/llvm/include/llvm/Support/LLVMSupportExports.h
@@ -0,0 +1,40 @@
+//===--- SupportMacros.h - ABI Macro Definitions ----------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_LLVMSUPPORT_EXPORTS_H
+#define LLVM_SUPPORT_LLVMSUPPORT_EXPORTS_H
+
+#if defined(__ELF__)
+# if defined(LLVM_SUPPORT_STATIC)
+#   define LLVM_SUPPORT_ABI
+# else
+#   if defined(LLVMSupport_EXPORTS)
+#     define LLVM_SUPPORT_ABI __attribute__((__visibility__("protected")))
+#   else
+#     define LLVM_SUPPORT_ABI __attribute__((__visibility__("default")))
+#   endif
+# endif
+#elif defined(__MACH__) || defined(__WASM__)
+# if defined(LLVM_SUPPORT_STATIC)
+#   define LLVM_SUPPORT_ABI
+# else
+#   define LLVM_SUPPORT_ABI __attribute__((__visibility__("default")))
+# endif
+#else
+# if defined(LLVM_SUPPORT_STATIC)
+#   define LLVM_SUPPORT_ABI
+# else
+#   if defined(LLVMSupport_EXPORTS)
+#     define LLVM_SUPPORT_ABI __declspec(dllexport)
+#   else
+#     define LLVM_SUPPORT_ABI __declspec(dllimport)
+#   endif
+# endif
+#endif
+
+#endif
diff --git a/llvm/include/llvm/Support/LineIterator.h b/llvm/include/llvm/Support/LineIterator.h
--- a/llvm/include/llvm/Support/LineIterator.h
+++ b/llvm/include/llvm/Support/LineIterator.h
@@ -12,7 +12,9 @@
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MemoryBufferRef.h"
+
 #include <iterator>
 
 namespace llvm {
@@ -30,7 +32,7 @@
 /// character.
 ///
 /// Note that this iterator requires the buffer to be nul terminated.
-class line_iterator {
+class LLVM_SUPPORT_ABI line_iterator {
   Optional<MemoryBufferRef> Buffer;
   char CommentMarker = '\0';
   bool SkipBlanks = true;
diff --git a/llvm/include/llvm/Support/Locale.h b/llvm/include/llvm/Support/Locale.h
--- a/llvm/include/llvm/Support/Locale.h
+++ b/llvm/include/llvm/Support/Locale.h
@@ -1,14 +1,24 @@
+//===--- Locale.h - Locale helpers -----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
 #ifndef LLVM_SUPPORT_LOCALE_H
 #define LLVM_SUPPORT_LOCALE_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 namespace llvm {
 class StringRef;
 
 namespace sys {
 namespace locale {
 
-int columnWidth(StringRef s);
-bool isPrint(int c);
+LLVM_SUPPORT_ABI int columnWidth(StringRef s);
+LLVM_SUPPORT_ABI bool isPrint(int c);
 
 }
 }
diff --git a/llvm/include/llvm/Support/LockFileManager.h b/llvm/include/llvm/Support/LockFileManager.h
--- a/llvm/include/llvm/Support/LockFileManager.h
+++ b/llvm/include/llvm/Support/LockFileManager.h
@@ -10,6 +10,8 @@
 
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <system_error>
 #include <utility> // for std::pair
 
@@ -24,7 +26,7 @@
 /// system to ensure that only a single process can create that ".lock" file.
 /// When the lock file is removed, the owning process has finished the
 /// operation.
-class LockFileManager {
+class LLVM_SUPPORT_ABI LockFileManager {
 public:
   /// Describes the state of a lock file.
   enum LockFileState {
diff --git a/llvm/include/llvm/Support/LowLevelTypeImpl.h b/llvm/include/llvm/Support/LowLevelTypeImpl.h
--- a/llvm/include/llvm/Support/LowLevelTypeImpl.h
+++ b/llvm/include/llvm/Support/LowLevelTypeImpl.h
@@ -28,7 +28,9 @@
 
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MachineValueType.h"
+
 #include <cassert>
 
 namespace llvm {
@@ -37,7 +39,7 @@
 class Type;
 class raw_ostream;
 
-class LLT {
+class LLVM_SUPPORT_ABI LLT {
 public:
   /// Get a low-level scalar or aggregate "bag of bits".
   static LLT scalar(unsigned SizeInBits) {
diff --git a/llvm/include/llvm/Support/MD5.h b/llvm/include/llvm/Support/MD5.h
--- a/llvm/include/llvm/Support/MD5.h
+++ b/llvm/include/llvm/Support/MD5.h
@@ -30,6 +30,8 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Endian.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <array>
 #include <cstdint>
 
@@ -38,9 +40,9 @@
 template <unsigned N> class SmallString;
 template <typename T> class ArrayRef;
 
-class MD5 {
+class LLVM_SUPPORT_ABI MD5 {
 public:
-  struct MD5Result {
+  struct LLVM_SUPPORT_ABI MD5Result {
     std::array<uint8_t, 16> Bytes;
 
     operator std::array<uint8_t, 16>() const { return Bytes; }
diff --git a/llvm/include/llvm/Support/ManagedStatic.h b/llvm/include/llvm/Support/ManagedStatic.h
--- a/llvm/include/llvm/Support/ManagedStatic.h
+++ b/llvm/include/llvm/Support/ManagedStatic.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_SUPPORT_MANAGEDSTATIC_H
 #define LLVM_SUPPORT_MANAGEDSTATIC_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <atomic>
 #include <cstddef>
 
@@ -46,7 +48,7 @@
 #endif
 
 /// ManagedStaticBase - Common base class for ManagedStatic instances.
-class ManagedStaticBase {
+class LLVM_SUPPORT_ABI ManagedStaticBase {
 protected:
 #ifdef LLVM_USE_CONSTEXPR_CTOR
   mutable std::atomic<void *> Ptr{};
@@ -111,7 +113,7 @@
 };
 
 /// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
-void llvm_shutdown();
+LLVM_SUPPORT_ABI void llvm_shutdown();
 
 /// llvm_shutdown_obj - This is a simple helper class that calls
 /// llvm_shutdown() when it is destroyed.
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -14,6 +14,8 @@
 #define LLVM_SUPPORT_MATHEXTRAS_H
 
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cassert>
 #include <climits>
 #include <cmath>
@@ -875,7 +877,7 @@
 }
 
 /// Use this rather than HUGE_VALF; the latter causes warnings on MSVC.
-extern const float huge_valf;
+extern LLVM_SUPPORT_ABI const float huge_valf;
 
 
 /// Add two signed integers, computing the two's complement truncated result,
diff --git a/llvm/include/llvm/Support/MemAlloc.h b/llvm/include/llvm/Support/MemAlloc.h
--- a/llvm/include/llvm/Support/MemAlloc.h
+++ b/llvm/include/llvm/Support/MemAlloc.h
@@ -18,6 +18,7 @@
 
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include <cstdlib>
 
 namespace llvm {
@@ -71,7 +72,7 @@
 /// like posix_memalign due to portability. It is mostly intended to allow
 /// compatibility with platforms that, after aligned allocation was added, use
 /// reduced default alignment.
-LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void *
+LLVM_SUPPORT_ABI LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void *
 allocate_buffer(size_t Size, size_t Alignment);
 
 /// Deallocate a buffer of memory with the given size and alignment.
@@ -81,7 +82,7 @@
 ///
 /// The pointer must have been allocated with the corresponding new operator,
 /// most likely using the above helper.
-void deallocate_buffer(void *Ptr, size_t Size, size_t Alignment);
+LLVM_SUPPORT_ABI void deallocate_buffer(void *Ptr, size_t Size, size_t Alignment);
 
 } // namespace llvm
 #endif
diff --git a/llvm/include/llvm/Support/Memory.h b/llvm/include/llvm/Support/Memory.h
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -14,6 +14,8 @@
 #define LLVM_SUPPORT_MEMORY_H
 
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <system_error>
 
 namespace llvm {
@@ -49,7 +51,7 @@
   /// MemoryBlock instances.
   /// @since 1.4
   /// An abstraction for memory operations.
-  class Memory {
+  class LLVM_SUPPORT_ABI Memory {
   public:
     enum ProtectionFlags {
       MF_READ = 0x1000000,
diff --git a/llvm/include/llvm/Support/MemoryBuffer.h b/llvm/include/llvm/Support/MemoryBuffer.h
--- a/llvm/include/llvm/Support/MemoryBuffer.h
+++ b/llvm/include/llvm/Support/MemoryBuffer.h
@@ -19,7 +19,9 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/CBindingWrapping.h"
 #include "llvm/Support/ErrorOr.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MemoryBufferRef.h"
+
 #include <cstddef>
 #include <cstdint>
 #include <memory>
@@ -47,7 +49,7 @@
 /// be more efficient for clients which are reading all the data to stop
 /// reading when they encounter a '\0' than to continually check the file
 /// position to see if it has reached the end of the file.
-class MemoryBuffer {
+class LLVM_SUPPORT_ABI MemoryBuffer {
   const char *BufferStart; // Start of the buffer.
   const char *BufferEnd;   // End of the buffer.
 
@@ -159,7 +161,7 @@
 /// access to the underlying contents.  It only supports creation methods that
 /// are guaranteed to produce a writable buffer.  For example, mapping a file
 /// read-only is not supported.
-class WritableMemoryBuffer : public MemoryBuffer {
+class LLVM_SUPPORT_ABI WritableMemoryBuffer : public MemoryBuffer {
 protected:
   WritableMemoryBuffer() = default;
 
@@ -217,7 +219,7 @@
 /// the underlying contents and committing those changes to the original source.
 /// It only supports creation methods that are guaranteed to produce a writable
 /// buffer.  For example, mapping a file read-only is not supported.
-class WriteThroughMemoryBuffer : public MemoryBuffer {
+class LLVM_SUPPORT_ABI WriteThroughMemoryBuffer : public MemoryBuffer {
 protected:
   WriteThroughMemoryBuffer() = default;
 
diff --git a/llvm/include/llvm/Support/MemoryBufferRef.h b/llvm/include/llvm/Support/MemoryBufferRef.h
--- a/llvm/include/llvm/Support/MemoryBufferRef.h
+++ b/llvm/include/llvm/Support/MemoryBufferRef.h
@@ -14,12 +14,13 @@
 #define LLVM_SUPPORT_MEMORYBUFFERREF_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
 class MemoryBuffer;
 
-class MemoryBufferRef {
+class LLVM_SUPPORT_ABI MemoryBufferRef {
   StringRef Buffer;
   StringRef Identifier;
 
diff --git a/llvm/include/llvm/Support/NativeFormatting.h b/llvm/include/llvm/Support/NativeFormatting.h
--- a/llvm/include/llvm/Support/NativeFormatting.h
+++ b/llvm/include/llvm/Support/NativeFormatting.h
@@ -10,6 +10,8 @@
 #define LLVM_SUPPORT_NATIVEFORMATTING_H
 
 #include "llvm/ADT/Optional.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cstdint>
 
 namespace llvm {
@@ -21,24 +23,38 @@
 };
 enum class HexPrintStyle { Upper, Lower, PrefixUpper, PrefixLower };
 
-size_t getDefaultPrecision(FloatStyle Style);
+LLVM_SUPPORT_ABI size_t getDefaultPrecision(FloatStyle Style);
 
-bool isPrefixedHexStyle(HexPrintStyle S);
+LLVM_SUPPORT_ABI bool isPrefixedHexStyle(HexPrintStyle S);
 
+LLVM_SUPPORT_ABI
 void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits,
                    IntegerStyle Style);
+
+LLVM_SUPPORT_ABI
 void write_integer(raw_ostream &S, int N, size_t MinDigits, IntegerStyle Style);
+
+LLVM_SUPPORT_ABI
 void write_integer(raw_ostream &S, unsigned long N, size_t MinDigits,
                    IntegerStyle Style);
+
+LLVM_SUPPORT_ABI
 void write_integer(raw_ostream &S, long N, size_t MinDigits,
                    IntegerStyle Style);
+
+LLVM_SUPPORT_ABI
 void write_integer(raw_ostream &S, unsigned long long N, size_t MinDigits,
                    IntegerStyle Style);
+
+LLVM_SUPPORT_ABI
 void write_integer(raw_ostream &S, long long N, size_t MinDigits,
                    IntegerStyle Style);
 
+LLVM_SUPPORT_ABI
 void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
                Optional<size_t> Width = None);
+
+LLVM_SUPPORT_ABI
 void write_double(raw_ostream &S, double D, FloatStyle Style,
                   Optional<size_t> Precision = None);
 }
diff --git a/llvm/include/llvm/Support/OptimizedStructLayout.h b/llvm/include/llvm/Support/OptimizedStructLayout.h
--- a/llvm/include/llvm/Support/OptimizedStructLayout.h
+++ b/llvm/include/llvm/Support/OptimizedStructLayout.h
@@ -35,8 +35,10 @@
 #ifndef LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H
 #define LLVM_SUPPORT_OPTIMIZEDSTRUCTLAYOUT_H
 
-#include "llvm/Support/Alignment.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Alignment.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <utility>
 
 namespace llvm {
@@ -135,7 +137,7 @@
 /// The return value is the total size of the struct and its required
 /// alignment.  Note that the total size is not rounded up to a multiple
 /// of the required alignment; clients which require this can do so easily.
-std::pair<uint64_t, Align> performOptimizedStructLayout(
+LLVM_SUPPORT_ABI std::pair<uint64_t, Align> performOptimizedStructLayout(
                         MutableArrayRef<OptimizedStructLayoutField> Fields);
 
 } // namespace llvm
diff --git a/llvm/include/llvm/Support/Parallel.h b/llvm/include/llvm/Support/Parallel.h
--- a/llvm/include/llvm/Support/Parallel.h
+++ b/llvm/include/llvm/Support/Parallel.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Config/llvm-config.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/Threading.h"
 
@@ -27,7 +28,7 @@
 // Strategy for the default executor used by the parallel routines provided by
 // this file. It defaults to using all hardware threads and should be
 // initialized before the first use of parallel routines.
-extern ThreadPoolStrategy strategy;
+extern LLVM_SUPPORT_ABI ThreadPoolStrategy strategy;
 
 namespace detail {
 
@@ -59,7 +60,7 @@
   }
 };
 
-class TaskGroup {
+class LLVM_SUPPORT_ABI TaskGroup {
   Latch L;
   bool Parallel;
 
diff --git a/llvm/include/llvm/Support/Path.h b/llvm/include/llvm/Support/Path.h
--- a/llvm/include/llvm/Support/Path.h
+++ b/llvm/include/llvm/Support/Path.h
@@ -18,6 +18,8 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <iterator>
 #include <system_error>
 
@@ -58,16 +60,16 @@
   Style S = Style::native; ///< The path style to use.
 
   // An end iterator has Position = Path.size() + 1.
-  friend const_iterator begin(StringRef path, Style style);
-  friend const_iterator end(StringRef path);
+  friend LLVM_SUPPORT_ABI const_iterator begin(StringRef path, Style style);
+  friend LLVM_SUPPORT_ABI const_iterator end(StringRef path);
 
 public:
   reference operator*() const { return Component; }
-  const_iterator &operator++();    // preincrement
-  bool operator==(const const_iterator &RHS) const;
+  LLVM_SUPPORT_ABI const_iterator &operator++();    // preincrement
+  LLVM_SUPPORT_ABI bool operator==(const const_iterator &RHS) const;
 
   /// Difference in bytes between this and RHS.
-  ptrdiff_t operator-(const const_iterator &RHS) const;
+  LLVM_SUPPORT_ABI ptrdiff_t operator-(const const_iterator &RHS) const;
 };
 
 /// Reverse path iterator.
@@ -83,37 +85,37 @@
   size_t    Position = 0;  ///< The iterators current position within Path.
   Style S = Style::native; ///< The path style to use.
 
-  friend reverse_iterator rbegin(StringRef path, Style style);
-  friend reverse_iterator rend(StringRef path);
+  friend LLVM_SUPPORT_ABI reverse_iterator rbegin(StringRef path, Style style);
+  friend LLVM_SUPPORT_ABI reverse_iterator rend(StringRef path);
 
 public:
   reference operator*() const { return Component; }
-  reverse_iterator &operator++();    // preincrement
-  bool operator==(const reverse_iterator &RHS) const;
+  LLVM_SUPPORT_ABI reverse_iterator &operator++();    // preincrement
+  LLVM_SUPPORT_ABI bool operator==(const reverse_iterator &RHS) const;
 
   /// Difference in bytes between this and RHS.
-  ptrdiff_t operator-(const reverse_iterator &RHS) const;
+  LLVM_SUPPORT_ABI ptrdiff_t operator-(const reverse_iterator &RHS) const;
 };
 
 /// Get begin iterator over \a path.
 /// @param path Input path.
 /// @returns Iterator initialized with the first component of \a path.
-const_iterator begin(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI const_iterator begin(StringRef path, Style style = Style::native);
 
 /// Get end iterator over \a path.
 /// @param path Input path.
 /// @returns Iterator initialized to the end of \a path.
-const_iterator end(StringRef path);
+LLVM_SUPPORT_ABI const_iterator end(StringRef path);
 
 /// Get reverse begin iterator over \a path.
 /// @param path Input path.
 /// @returns Iterator initialized with the first reverse component of \a path.
-reverse_iterator rbegin(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI reverse_iterator rbegin(StringRef path, Style style = Style::native);
 
 /// Get reverse end iterator over \a path.
 /// @param path Input path.
 /// @returns Iterator initialized to the reverse end of \a path.
-reverse_iterator rend(StringRef path);
+LLVM_SUPPORT_ABI reverse_iterator rend(StringRef path);
 
 /// @}
 /// @name Lexical Modifiers
@@ -131,7 +133,7 @@
 /// @endcode
 ///
 /// @param path A path that is modified to not have a file component.
-void remove_filename(SmallVectorImpl<char> &path, Style style = Style::native);
+LLVM_SUPPORT_ABI void remove_filename(SmallVectorImpl<char> &path, Style style = Style::native);
 
 /// Replace the file extension of \a path with \a extension.
 ///
@@ -145,7 +147,7 @@
 /// @param extension The extension to be added. It may be empty. It may also
 ///                  optionally start with a '.', if it does not, one will be
 ///                  prepended.
-void replace_extension(SmallVectorImpl<char> &path, const Twine &extension,
+LLVM_SUPPORT_ABI void replace_extension(SmallVectorImpl<char> &path, const Twine &extension,
                        Style style = Style::native);
 
 /// Replace matching path prefix with another path.
@@ -170,7 +172,7 @@
 /// @param style The style used to match the prefix. Exact match using
 /// Posix style, case/separator insensitive match for Windows style.
 /// @result true if \a Path begins with OldPrefix
-bool replace_path_prefix(SmallVectorImpl<char> &Path, StringRef OldPrefix,
+LLVM_SUPPORT_ABI bool replace_path_prefix(SmallVectorImpl<char> &Path, StringRef OldPrefix,
                          StringRef NewPrefix,
                          Style style = Style::native);
 
@@ -184,12 +186,12 @@
 ///
 /// @param path Set to \a path + \a component.
 /// @param a The component to be appended to \a path.
-void append(SmallVectorImpl<char> &path, const Twine &a,
+LLVM_SUPPORT_ABI void append(SmallVectorImpl<char> &path, const Twine &a,
                                          const Twine &b = "",
                                          const Twine &c = "",
                                          const Twine &d = "");
 
-void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
+LLVM_SUPPORT_ABI void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
             const Twine &b = "", const Twine &c = "", const Twine &d = "");
 
 /// Append to path.
@@ -203,7 +205,7 @@
 /// @param path Set to \a path + [\a begin, \a end).
 /// @param begin Start of components to append.
 /// @param end One past the end of components to append.
-void append(SmallVectorImpl<char> &path, const_iterator begin,
+LLVM_SUPPORT_ABI void append(SmallVectorImpl<char> &path, const_iterator begin,
             const_iterator end, Style style = Style::native);
 
 /// @}
@@ -216,7 +218,7 @@
 ///
 /// @param path A path that is transformed to native format.
 /// @param result Holds the result of the transformation.
-void native(const Twine &path, SmallVectorImpl<char> &result,
+LLVM_SUPPORT_ABI void native(const Twine &path, SmallVectorImpl<char> &result,
             Style style = Style::native);
 
 /// Convert path to the native form in place. This is used to give paths to
@@ -224,7 +226,7 @@
 /// on Windows all '/' are converted to '\'.
 ///
 /// @param path A path that is transformed to native format.
-void native(SmallVectorImpl<char> &path, Style style = Style::native);
+LLVM_SUPPORT_ABI void native(SmallVectorImpl<char> &path, Style style = Style::native);
 
 /// Replaces backslashes with slashes if Windows.
 ///
@@ -232,7 +234,7 @@
 /// @result The result of replacing backslashes with forward slashes if Windows.
 /// On Unix, this function is a no-op because backslashes are valid path
 /// chracters.
-std::string convert_to_slash(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI std::string convert_to_slash(StringRef path, Style style = Style::native);
 
 /// @}
 /// @name Lexical Observers
@@ -248,7 +250,7 @@
 ///
 /// @param path Input path.
 /// @result The root name of \a path if it has one, otherwise "".
-StringRef root_name(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef root_name(StringRef path, Style style = Style::native);
 
 /// Get root directory.
 ///
@@ -261,7 +263,7 @@
 /// @param path Input path.
 /// @result The root directory of \a path if it has one, otherwise
 ///               "".
-StringRef root_directory(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef root_directory(StringRef path, Style style = Style::native);
 
 /// Get root path.
 ///
@@ -269,7 +271,7 @@
 ///
 /// @param path Input path.
 /// @result The root path of \a path if it has one, otherwise "".
-StringRef root_path(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef root_path(StringRef path, Style style = Style::native);
 
 /// Get relative path.
 ///
@@ -281,7 +283,7 @@
 ///
 /// @param path Input path.
 /// @result The path starting after root_path if one exists, otherwise "".
-StringRef relative_path(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef relative_path(StringRef path, Style style = Style::native);
 
 /// Get parent path.
 ///
@@ -293,7 +295,7 @@
 ///
 /// @param path Input path.
 /// @result The parent path of \a path if one exists, otherwise "".
-StringRef parent_path(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef parent_path(StringRef path, Style style = Style::native);
 
 /// Get filename.
 ///
@@ -307,7 +309,7 @@
 /// @param path Input path.
 /// @result The filename part of \a path. This is defined as the last component
 ///         of \a path. Similar to the POSIX "basename" utility.
-StringRef filename(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef filename(StringRef path, Style style = Style::native);
 
 /// Get stem.
 ///
@@ -325,7 +327,7 @@
 ///
 /// @param path Input path.
 /// @result The stem of \a path.
-StringRef stem(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef stem(StringRef path, Style style = Style::native);
 
 /// Get extension.
 ///
@@ -341,18 +343,18 @@
 ///
 /// @param path Input path.
 /// @result The extension of \a path.
-StringRef extension(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef extension(StringRef path, Style style = Style::native);
 
 /// Check whether the given char is a path separator on the host OS.
 ///
 /// @param value a character
 /// @result true if \a value is a path separator character on the host OS
-bool is_separator(char value, Style style = Style::native);
+LLVM_SUPPORT_ABI bool is_separator(char value, Style style = Style::native);
 
 /// Return the preferred separator for this platform.
 ///
 /// @result StringRef of the preferred separator, null-terminated.
-StringRef get_separator(Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef get_separator(Style style = Style::native);
 
 /// Get the typical temporary directory for the system, e.g.,
 /// "/var/tmp" or "C:/TEMP"
@@ -363,27 +365,27 @@
 /// (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
 ///
 /// @param result Holds the resulting path name.
-void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result);
+LLVM_SUPPORT_ABI void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result);
 
 /// Get the user's home directory.
 ///
 /// @param result Holds the resulting path name.
 /// @result True if a home directory is set, false otherwise.
-bool home_directory(SmallVectorImpl<char> &result);
+LLVM_SUPPORT_ABI bool home_directory(SmallVectorImpl<char> &result);
 
 /// Get the directory where packages should read user-specific configurations.
 /// e.g. $XDG_CONFIG_HOME.
 ///
 /// @param result Holds the resulting path name.
 /// @result True if the appropriate path was determined, it need not exist.
-bool user_config_directory(SmallVectorImpl<char> &result);
+LLVM_SUPPORT_ABI bool user_config_directory(SmallVectorImpl<char> &result);
 
 /// Get the directory where installed packages should put their
 /// machine-local cache, e.g. $XDG_CACHE_HOME.
 ///
 /// @param result Holds the resulting path name.
 /// @result True if the appropriate path was determined, it need not exist.
-bool cache_directory(SmallVectorImpl<char> &result);
+LLVM_SUPPORT_ABI bool cache_directory(SmallVectorImpl<char> &result);
 
 /// Has root name?
 ///
@@ -391,7 +393,7 @@
 ///
 /// @param path Input path.
 /// @result True if the path has a root name, false otherwise.
-bool has_root_name(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool has_root_name(const Twine &path, Style style = Style::native);
 
 /// Has root directory?
 ///
@@ -399,7 +401,7 @@
 ///
 /// @param path Input path.
 /// @result True if the path has a root directory, false otherwise.
-bool has_root_directory(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool has_root_directory(const Twine &path, Style style = Style::native);
 
 /// Has root path?
 ///
@@ -407,7 +409,7 @@
 ///
 /// @param path Input path.
 /// @result True if the path has a root path, false otherwise.
-bool has_root_path(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool has_root_path(const Twine &path, Style style = Style::native);
 
 /// Has relative path?
 ///
@@ -423,7 +425,7 @@
 ///
 /// @param path Input path.
 /// @result True if the path has a parent path, false otherwise.
-bool has_parent_path(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool has_parent_path(const Twine &path, Style style = Style::native);
 
 /// Has filename?
 ///
@@ -431,7 +433,7 @@
 ///
 /// @param path Input path.
 /// @result True if the path has a filename, false otherwise.
-bool has_filename(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool has_filename(const Twine &path, Style style = Style::native);
 
 /// Has stem?
 ///
@@ -439,7 +441,7 @@
 ///
 /// @param path Input path.
 /// @result True if the path has a stem, false otherwise.
-bool has_stem(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool has_stem(const Twine &path, Style style = Style::native);
 
 /// Has extension?
 ///
@@ -447,7 +449,7 @@
 ///
 /// @param path Input path.
 /// @result True if the path has a extension, false otherwise.
-bool has_extension(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool has_extension(const Twine &path, Style style = Style::native);
 
 /// Is path absolute?
 ///
@@ -466,7 +468,7 @@
 ///
 /// @param path Input path.
 /// @result True if the path is absolute, false if it is not.
-bool is_absolute(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool is_absolute(const Twine &path, Style style = Style::native);
 
 /// Is path absolute using GNU rules?
 ///
@@ -491,19 +493,19 @@
 /// means to derive the style from the host.
 /// @result True if the path is absolute following GNU rules, false if it is
 /// not.
-bool is_absolute_gnu(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool is_absolute_gnu(const Twine &path, Style style = Style::native);
 
 /// Is path relative?
 ///
 /// @param path Input path.
 /// @result True if the path is relative, false if it is not.
-bool is_relative(const Twine &path, Style style = Style::native);
+LLVM_SUPPORT_ABI bool is_relative(const Twine &path, Style style = Style::native);
 
 /// Remove redundant leading "./" pieces and consecutive separators.
 ///
 /// @param path Input path.
 /// @result The cleaned-up \a path.
-StringRef remove_leading_dotslash(StringRef path, Style style = Style::native);
+LLVM_SUPPORT_ABI StringRef remove_leading_dotslash(StringRef path, Style style = Style::native);
 
 /// In-place remove any './' and optionally '../' components from a path.
 ///
@@ -511,7 +513,7 @@
 /// @param remove_dot_dot specify if '../' (except for leading "../") should be
 /// removed
 /// @result True if path was changed
-bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false,
+LLVM_SUPPORT_ABI bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false,
                  Style style = Style::native);
 
 } // end namespace path
diff --git a/llvm/include/llvm/Support/PluginLoader.h b/llvm/include/llvm/Support/PluginLoader.h
--- a/llvm/include/llvm/Support/PluginLoader.h
+++ b/llvm/include/llvm/Support/PluginLoader.h
@@ -16,6 +16,7 @@
 #ifndef LLVM_SUPPORT_PLUGINLOADER_H
 #define LLVM_SUPPORT_PLUGINLOADER_H
 
+#include "llvm/Support/LLVMSupportExports.h"
 #ifndef DONT_GET_PLUGIN_LOADER_OPTION
 #include "llvm/Support/CommandLine.h"
 #endif
@@ -23,7 +24,7 @@
 #include <string>
 
 namespace llvm {
-  struct PluginLoader {
+  struct LLVM_SUPPORT_ABI PluginLoader {
     void operator=(const std::string &Filename);
     static unsigned getNumPlugins();
     static std::string& getPlugin(unsigned num);
diff --git a/llvm/include/llvm/Support/PrettyStackTrace.h b/llvm/include/llvm/Support/PrettyStackTrace.h
--- a/llvm/include/llvm/Support/PrettyStackTrace.h
+++ b/llvm/include/llvm/Support/PrettyStackTrace.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
   class raw_ostream;
@@ -24,7 +25,7 @@
   /// Enables dumping a "pretty" stack trace when the program crashes.
   ///
   /// \see PrettyStackTraceEntry
-  void EnablePrettyStackTrace();
+  LLVM_SUPPORT_ABI void EnablePrettyStackTrace();
 
   /// Enables (or disables) dumping a "pretty" stack trace when the user sends
   /// SIGINFO or SIGUSR1 to the current process.
@@ -35,21 +36,21 @@
   ///
   /// \see EnablePrettyStackTrace
   /// \see PrettyStackTraceEntry
-  void EnablePrettyStackTraceOnSigInfoForThisThread(bool ShouldEnable = true);
+  LLVM_SUPPORT_ABI void EnablePrettyStackTraceOnSigInfoForThisThread(bool ShouldEnable = true);
 
   /// Replaces the generic bug report message that is output upon
   /// a crash.
-  void setBugReportMsg(const char *Msg);
+  LLVM_SUPPORT_ABI void setBugReportMsg(const char *Msg);
 
   /// Get the bug report message that will be output upon a crash.
-  const char *getBugReportMsg();
+  LLVM_SUPPORT_ABI const char *getBugReportMsg();
 
   /// PrettyStackTraceEntry - This class is used to represent a frame of the
   /// "pretty" stack trace that is dumped when a program crashes. You can define
   /// subclasses of this and declare them on the program stack: when they are
   /// constructed and destructed, they will add their symbolic frames to a
   /// virtual stack trace.  This gets dumped out if the program crashes.
-  class PrettyStackTraceEntry {
+  class LLVM_SUPPORT_ABI PrettyStackTraceEntry {
     friend PrettyStackTraceEntry *ReverseStackTrace(PrettyStackTraceEntry *);
 
     PrettyStackTraceEntry *NextEntry;
@@ -69,7 +70,7 @@
   /// PrettyStackTraceString - This object prints a specified string (which
   /// should not contain newlines) to the stream as the stack trace when a crash
   /// occurs.
-  class PrettyStackTraceString : public PrettyStackTraceEntry {
+  class LLVM_SUPPORT_ABI PrettyStackTraceString : public PrettyStackTraceEntry {
     const char *Str;
   public:
     PrettyStackTraceString(const char *str) : Str(str) {}
@@ -88,7 +89,7 @@
 
   /// PrettyStackTraceProgram - This object prints a specified program arguments
   /// to the stream as the stack trace when a crash occurs.
-  class PrettyStackTraceProgram : public PrettyStackTraceEntry {
+  class LLVM_SUPPORT_ABI PrettyStackTraceProgram : public PrettyStackTraceEntry {
     int ArgC;
     const char *const *ArgV;
   public:
@@ -100,7 +101,7 @@
   };
 
   /// Returns the topmost element of the "pretty" stack state.
-  const void *SavePrettyStackState();
+  LLVM_SUPPORT_ABI const void *SavePrettyStackState();
 
   /// Restores the topmost element of the "pretty" stack state to State, which
   /// should come from a previous call to SavePrettyStackState().  This is
@@ -109,7 +110,7 @@
   /// happens after a crash that's been recovered by CrashRecoveryContext
   /// doesn't have frames on it that were added in code unwound by the
   /// CrashRecoveryContext.
-  void RestorePrettyStackState(const void *State);
+  LLVM_SUPPORT_ABI void RestorePrettyStackState(const void *State);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Support/Process.h b/llvm/include/llvm/Support/Process.h
--- a/llvm/include/llvm/Support/Process.h
+++ b/llvm/include/llvm/Support/Process.h
@@ -29,7 +29,9 @@
 #include "llvm/Support/Chrono.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/Program.h"
+
 #include <system_error>
 
 namespace llvm {
@@ -41,7 +43,7 @@
 
 /// A collection of legacy interfaces for querying information about the
 /// current executing process.
-class Process {
+class LLVM_SUPPORT_ABI Process {
 public:
   using Pid = int32_t;
 
@@ -219,7 +221,6 @@
 private:
   [[noreturn]] static void ExitNoCleanup(int RetCode);
 };
-
 }
 }
 
diff --git a/llvm/include/llvm/Support/Program.h b/llvm/include/llvm/Support/Program.h
--- a/llvm/include/llvm/Support/Program.h
+++ b/llvm/include/llvm/Support/Program.h
@@ -20,6 +20,8 @@
 #include "llvm/Config/llvm-config.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <chrono>
 #include <system_error>
 
@@ -75,7 +77,7 @@
   ///
   /// \returns The fully qualified path to the first \p Name in \p Paths if it
   ///   exists. \p Name if \p Name has slashes in it. Otherwise an error.
-  ErrorOr<std::string>
+  LLVM_SUPPORT_ABI ErrorOr<std::string>
   findProgramByName(StringRef Name, ArrayRef<StringRef> Paths = {});
 
   // These functions change the specified standard stream (stdin or stdout) mode
@@ -87,7 +89,7 @@
   // These functions change the specified standard stream (stdin or stdout) to
   // binary mode. They return errc::success if the specified stream
   // was changed. Otherwise a platform dependent error is returned.
-  std::error_code ChangeStdinToBinary();
+  LLVM_SUPPORT_ABI std::error_code ChangeStdinToBinary();
   std::error_code ChangeStdoutToBinary();
 
   /// This function executes the program using the arguments provided.  The
@@ -101,6 +103,7 @@
   /// A zero or positive value indicates the result code of the program.
   /// -1 indicates failure to execute
   /// -2 indicates a crash during execution or timeout
+  LLVM_SUPPORT_ABI
   int ExecuteAndWait(
       StringRef Program, ///< Path of the program to be executed. It is
       ///< presumed this is the result of the findProgramByName method.
@@ -145,7 +148,7 @@
   /// \note On Microsoft Windows systems, users will need to either call
   /// \see Wait until the process finished execution or win32 CloseHandle() API
   /// on ProcessInfo.ProcessHandle to avoid memory leaks.
-  ProcessInfo ExecuteNoWait(StringRef Program, ArrayRef<StringRef> Args,
+  LLVM_SUPPORT_ABI ProcessInfo ExecuteNoWait(StringRef Program, ArrayRef<StringRef> Args,
                             Optional<ArrayRef<StringRef>> Env,
                             ArrayRef<Optional<StringRef>> Redirects = {},
                             unsigned MemoryLimit = 0,
@@ -155,12 +158,12 @@
 
   /// Return true if the given arguments fit within system-specific
   /// argument length limits.
-  bool commandLineFitsWithinSystemLimits(StringRef Program,
+  LLVM_SUPPORT_ABI bool commandLineFitsWithinSystemLimits(StringRef Program,
                                          ArrayRef<StringRef> Args);
 
   /// Return true if the given arguments fit within system-specific
   /// argument length limits.
-  bool commandLineFitsWithinSystemLimits(StringRef Program,
+  LLVM_SUPPORT_ABI bool commandLineFitsWithinSystemLimits(StringRef Program,
                                          ArrayRef<const char *> Args);
 
   /// File encoding options when writing contents that a non-UTF8 tool will
@@ -193,7 +196,7 @@
   /// should be changed as soon as binutils fix this to support UTF16 on mingw.
   ///
   /// \returns non-zero error_code if failed
-  std::error_code
+  LLVM_SUPPORT_ABI std::error_code
   writeFileWithEncoding(StringRef FileName, StringRef Contents,
                         WindowsEncodingMethod Encoding = WEM_UTF8);
 
@@ -204,7 +207,7 @@
   /// \li 0 if the child process has not changed state.
   /// \note Users of this function should always check the ReturnCode member of
   /// the \see ProcessInfo returned from this function.
-  ProcessInfo Wait(
+  LLVM_SUPPORT_ABI ProcessInfo Wait(
       const ProcessInfo &PI,  ///< The child process that should be waited on.
       unsigned SecondsToWait, ///< If non-zero, this specifies the amount of
       ///< time to wait for the child process to exit. If the time expires, the
@@ -222,7 +225,7 @@
   );
 
   /// Print a command argument, and optionally quote it.
-  void printArg(llvm::raw_ostream &OS, StringRef Arg, bool Quote);
+  LLVM_SUPPORT_ABI void printArg(llvm::raw_ostream &OS, StringRef Arg, bool Quote);
 
 #if defined(_WIN32)
   /// Given a list of command line arguments, quote and escape them as necessary
diff --git a/llvm/include/llvm/Support/RISCVAttributeParser.h b/llvm/include/llvm/Support/RISCVAttributeParser.h
--- a/llvm/include/llvm/Support/RISCVAttributeParser.h
+++ b/llvm/include/llvm/Support/RISCVAttributeParser.h
@@ -10,10 +10,11 @@
 #define LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
 
 #include "llvm/Support/ELFAttributeParser.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/RISCVAttributes.h"
 
 namespace llvm {
-class RISCVAttributeParser : public ELFAttributeParser {
+class LLVM_SUPPORT_ABI RISCVAttributeParser : public ELFAttributeParser {
   struct DisplayHandler {
     RISCVAttrs::AttrType attribute;
     Error (RISCVAttributeParser::*routine)(unsigned);
diff --git a/llvm/include/llvm/Support/RISCVAttributes.h b/llvm/include/llvm/Support/RISCVAttributes.h
--- a/llvm/include/llvm/Support/RISCVAttributes.h
+++ b/llvm/include/llvm/Support/RISCVAttributes.h
@@ -18,11 +18,12 @@
 #define LLVM_SUPPORT_RISCVATTRIBUTES_H
 
 #include "llvm/Support/ELFAttributes.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 namespace RISCVAttrs {
 
-const TagNameMap &getRISCVAttributeTags();
+LLVM_SUPPORT_ABI const TagNameMap &getRISCVAttributeTags();
 
 enum AttrType : unsigned {
   // Attribute types in ELF/.riscv.attributes.
diff --git a/llvm/include/llvm/Support/RandomNumberGenerator.h b/llvm/include/llvm/Support/RandomNumberGenerator.h
--- a/llvm/include/llvm/Support/RandomNumberGenerator.h
+++ b/llvm/include/llvm/Support/RandomNumberGenerator.h
@@ -17,6 +17,8 @@
 
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h" // Needed for uint64_t on Windows.
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <random>
 #include <system_error>
 
@@ -29,7 +31,7 @@
 /// seed should be set by passing the -rng-seed=<uint64> option. Use
 /// Module::createRNG to create a new RNG instance for use with that
 /// module.
-class RandomNumberGenerator {
+class LLVM_SUPPORT_ABI RandomNumberGenerator {
 
   // 64-bit Mersenne Twister by Matsumoto and Nishimura, 2000
   // http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine
@@ -63,7 +65,7 @@
 };
 
 // Get random vector of specified size
-std::error_code getRandomBytes(void *Buffer, size_t Size);
+LLVM_SUPPORT_ABI std::error_code getRandomBytes(void *Buffer, size_t Size);
 }
 
 #endif
diff --git a/llvm/include/llvm/Support/Regex.h b/llvm/include/llvm/Support/Regex.h
--- a/llvm/include/llvm/Support/Regex.h
+++ b/llvm/include/llvm/Support/Regex.h
@@ -17,6 +17,8 @@
 #define LLVM_SUPPORT_REGEX_H
 
 #include "llvm/ADT/BitmaskEnum.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <string>
 
 struct llvm_regex;
@@ -25,7 +27,7 @@
   class StringRef;
   template<typename T> class SmallVectorImpl;
 
-  class Regex {
+  class LLVM_SUPPORT_ABI Regex {
   public:
     enum RegexFlags : unsigned {
       NoFlags = 0,
diff --git a/llvm/include/llvm/Support/SHA1.h b/llvm/include/llvm/Support/SHA1.h
--- a/llvm/include/llvm/Support/SHA1.h
+++ b/llvm/include/llvm/Support/SHA1.h
@@ -15,6 +15,8 @@
 #ifndef LLVM_SUPPORT_SHA1_H
 #define LLVM_SUPPORT_SHA1_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <array>
 #include <cstdint>
 
@@ -23,7 +25,7 @@
 class StringRef;
 
 /// A class that wrap the SHA1 algorithm.
-class SHA1 {
+class LLVM_SUPPORT_ABI SHA1 {
 public:
   SHA1() { init(); }
 
diff --git a/llvm/include/llvm/Support/SHA256.h b/llvm/include/llvm/Support/SHA256.h
--- a/llvm/include/llvm/Support/SHA256.h
+++ b/llvm/include/llvm/Support/SHA256.h
@@ -22,6 +22,8 @@
 #ifndef LLVM_SUPPORT_SHA256_H
 #define LLVM_SUPPORT_SHA256_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <array>
 #include <cstdint>
 
@@ -30,7 +32,7 @@
 template <typename T> class ArrayRef;
 class StringRef;
 
-class SHA256 {
+class LLVM_SUPPORT_ABI SHA256 {
 public:
   explicit SHA256() { init(); }
 
diff --git a/llvm/include/llvm/Support/SMTAPI.h b/llvm/include/llvm/Support/SMTAPI.h
--- a/llvm/include/llvm/Support/SMTAPI.h
+++ b/llvm/include/llvm/Support/SMTAPI.h
@@ -17,7 +17,9 @@
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APSInt.h"
 #include "llvm/ADT/FoldingSet.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <memory>
 
 namespace llvm {
@@ -440,7 +442,7 @@
 using SMTSolverRef = std::shared_ptr<SMTSolver>;
 
 /// Convenience method to create and Z3Solver object
-SMTSolverRef CreateZ3Solver();
+LLVM_SUPPORT_ABI SMTSolverRef CreateZ3Solver();
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Support/ScaledNumber.h b/llvm/include/llvm/Support/ScaledNumber.h
--- a/llvm/include/llvm/Support/ScaledNumber.h
+++ b/llvm/include/llvm/Support/ScaledNumber.h
@@ -21,7 +21,9 @@
 #ifndef LLVM_SUPPORT_SCALEDNUMBER_H
 #define LLVM_SUPPORT_SCALEDNUMBER_H
 
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MathExtras.h"
+
 #include <algorithm>
 #include <cstdint>
 #include <limits>
@@ -105,7 +107,7 @@
 /// Multiply two 64-bit integers to create a 64-bit scaled number.
 ///
 /// Implemented with four 64-bit integer multiplies.
-std::pair<uint64_t, int16_t> multiply64(uint64_t LHS, uint64_t RHS);
+LLVM_SUPPORT_ABI std::pair<uint64_t, int16_t> multiply64(uint64_t LHS, uint64_t RHS);
 
 /// Multiply two 32-bit integers to create a 32-bit scaled number.
 ///
@@ -135,14 +137,14 @@
 /// Implemented with long division.
 ///
 /// \pre \c Dividend and \c Divisor are non-zero.
-std::pair<uint64_t, int16_t> divide64(uint64_t Dividend, uint64_t Divisor);
+LLVM_SUPPORT_ABI std::pair<uint64_t, int16_t> divide64(uint64_t Dividend, uint64_t Divisor);
 
 /// Divide two 32-bit integers to create a 32-bit scaled number.
 ///
 /// Implemented with one 64-bit integer divide/remainder pair.
 ///
 /// \pre \c Dividend and \c Divisor are non-zero.
-std::pair<uint32_t, int16_t> divide32(uint32_t Dividend, uint32_t Divisor);
+LLVM_SUPPORT_ABI std::pair<uint32_t, int16_t> divide32(uint32_t Dividend, uint32_t Divisor);
 
 /// Divide two 32-bit numbers to create a 32-bit scaled number.
 ///
@@ -241,7 +243,7 @@
 /// 1, and 0 for less than, greater than, and equal, respectively.
 ///
 /// \pre 0 <= ScaleDiff < 64.
-int compareImpl(uint64_t L, uint64_t R, int ScaleDiff);
+LLVM_SUPPORT_ABI int compareImpl(uint64_t L, uint64_t R, int ScaleDiff);
 
 /// Compare two scaled numbers.
 ///
@@ -416,7 +418,7 @@
 namespace llvm {
 
 class raw_ostream;
-class ScaledNumberBase {
+class LLVM_SUPPORT_ABI ScaledNumberBase {
 public:
   static constexpr int DefaultPrecision = 10;
 
diff --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h
--- a/llvm/include/llvm/Support/ScopedPrinter.h
+++ b/llvm/include/llvm/Support/ScopedPrinter.h
@@ -16,7 +16,9 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Endian.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <algorithm>
 
 namespace llvm {
@@ -57,8 +59,9 @@
   uint64_t Value;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const HexNumber &Value);
-std::string to_hexString(uint64_t Value, bool UpperCase = true);
+LLVM_SUPPORT_ABI raw_ostream &operator<<(raw_ostream &OS, const HexNumber &Value);
+
+LLVM_SUPPORT_ABI std::string to_hexString(uint64_t Value, bool UpperCase = true);
 
 template <class T> std::string to_string(const T &Value) {
   std::string number;
@@ -67,7 +70,7 @@
   return stream.str();
 }
 
-class ScopedPrinter {
+class LLVM_SUPPORT_ABI ScopedPrinter {
 public:
   ScopedPrinter(raw_ostream &OS) : OS(OS), IndentLevel(0) {}
 
diff --git a/llvm/include/llvm/Support/Signals.h b/llvm/include/llvm/Support/Signals.h
--- a/llvm/include/llvm/Support/Signals.h
+++ b/llvm/include/llvm/Support/Signals.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_SUPPORT_SIGNALS_H
 #define LLVM_SUPPORT_SIGNALS_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <string>
 
 namespace llvm {
@@ -24,12 +26,12 @@
 
   /// This function runs all the registered interrupt handlers, including the
   /// removal of files registered by RemoveFileOnSignal.
-  void RunInterruptHandlers();
+  LLVM_SUPPORT_ABI void RunInterruptHandlers();
 
   /// This function registers signal handlers to ensure that if a signal gets
   /// delivered that the named file is removed.
   /// Remove a file if a fatal signal occurs.
-  bool RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg = nullptr);
+  LLVM_SUPPORT_ABI bool RemoveFileOnSignal(StringRef Filename, std::string* ErrMsg = nullptr);
 
   /// This function removes a file from the list of files to be removed on
   /// signal delivery.
@@ -43,16 +45,16 @@
   ///        StringRef(), in which case we will only search $PATH.
   /// \param DisableCrashReporting if \c true, disable the normal crash
   ///        reporting mechanisms on the underlying operating system.
-  void PrintStackTraceOnErrorSignal(StringRef Argv0,
+  LLVM_SUPPORT_ABI void PrintStackTraceOnErrorSignal(StringRef Argv0,
                                     bool DisableCrashReporting = false);
 
   /// Disable all system dialog boxes that appear when the process crashes.
-  void DisableSystemDialogsOnCrash();
+  LLVM_SUPPORT_ABI void DisableSystemDialogsOnCrash();
 
   /// Print the stack trace using the given \c raw_ostream object.
   /// \param Depth refers to the number of stackframes to print. If not
   ///        specified, the entire frame is printed.
-  void PrintStackTrace(raw_ostream &OS, int Depth = 0);
+  LLVM_SUPPORT_ABI void PrintStackTrace(raw_ostream &OS, int Depth = 0);
 
   // Run all registered signal handlers.
   void RunSignalHandlers();
@@ -62,7 +64,7 @@
   /// Add a function to be called when an abort/kill signal is delivered to the
   /// process. The handler can have a cookie passed to it to identify what
   /// instance of the handler it is.
-  void AddSignalHandler(SignalHandlerCallback FnPtr, void *Cookie);
+  LLVM_SUPPORT_ABI void AddSignalHandler(SignalHandlerCallback FnPtr, void *Cookie);
 
   /// This function registers a function to be called when the user "interrupts"
   /// the program (typically by pressing ctrl-c).  When the user interrupts the
@@ -73,7 +75,7 @@
   /// functions.  An null interrupt function pointer disables the current
   /// installed function.  Note also that the handler may be executed on a
   /// different thread on some platforms.
-  void SetInterruptFunction(void (*IF)());
+  LLVM_SUPPORT_ABI void SetInterruptFunction(void (*IF)());
 
   /// Registers a function to be called when an "info" signal is delivered to
   /// the process.
diff --git a/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h b/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h
--- a/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h
+++ b/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h
@@ -15,6 +15,7 @@
 #define LLVM_SUPPORT_SMALLVECTORMEMORYBUFFER_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -26,7 +27,7 @@
 /// instances. This is useful for MCJIT and Orc, where object files are streamed
 /// into SmallVectors, then inspected using ObjectFile (which takes a
 /// MemoryBuffer).
-class SmallVectorMemoryBuffer : public MemoryBuffer {
+class LLVM_SUPPORT_ABI SmallVectorMemoryBuffer : public MemoryBuffer {
 public:
   /// Construct an SmallVectorMemoryBuffer from the given SmallVector
   /// r-value.
diff --git a/llvm/include/llvm/Support/SourceMgr.h b/llvm/include/llvm/Support/SourceMgr.h
--- a/llvm/include/llvm/Support/SourceMgr.h
+++ b/llvm/include/llvm/Support/SourceMgr.h
@@ -16,8 +16,10 @@
 #define LLVM_SUPPORT_SOURCEMGR_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/SMLoc.h"
+
 #include <vector>
 
 namespace llvm {
@@ -28,7 +30,7 @@
 
 /// This owns the files read by a parser, handles include stacks,
 /// and handles diagnostic wrangling.
-class SourceMgr {
+class LLVM_SUPPORT_ABI SourceMgr {
 public:
   enum DiagKind {
     DK_Error,
@@ -223,7 +225,7 @@
 };
 
 /// Represents a single fixit, a replacement of one range of text with another.
-class SMFixIt {
+class LLVM_SUPPORT_ABI SMFixIt {
   SMRange Range;
 
   std::string Text;
@@ -248,7 +250,7 @@
 
 /// Instances of this class encapsulate one diagnostic report, allowing
 /// printing to a raw_ostream as a caret diagnostic.
-class SMDiagnostic {
+class LLVM_SUPPORT_ABI SMDiagnostic {
   const SourceMgr *SM = nullptr;
   SMLoc Loc;
   std::string Filename;
diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList.h
@@ -52,8 +52,10 @@
 #define LLVM_SUPPORT_SPECIALCASELIST_H
 
 #include "llvm/ADT/StringMap.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/TrigramIndex.h"
+
 #include <memory>
 #include <string>
 #include <vector>
@@ -66,7 +68,7 @@
 class FileSystem;
 }
 
-class SpecialCaseList {
+class LLVM_SUPPORT_ABI SpecialCaseList {
 public:
   /// Parses the special case list entries from files. On failure, returns
   /// 0 and writes an error message to string.
@@ -120,10 +122,10 @@
   /// literal strings than Regex.
   class Matcher {
   public:
-    bool insert(std::string Regexp, unsigned LineNumber, std::string &REError);
+    LLVM_SUPPORT_ABI bool insert(std::string Regexp, unsigned LineNumber, std::string &REError);
     // Returns the line number in the source file that this query matches to.
     // Returns zero if no match is found.
-    unsigned match(StringRef Query) const;
+    LLVM_SUPPORT_ABI unsigned match(StringRef Query) const;
 
   private:
     StringMap<unsigned> Strings;
diff --git a/llvm/include/llvm/Support/StringSaver.h b/llvm/include/llvm/Support/StringSaver.h
--- a/llvm/include/llvm/Support/StringSaver.h
+++ b/llvm/include/llvm/Support/StringSaver.h
@@ -13,12 +13,13 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 
 /// Saves strings in the provided stable storage and returns a
 /// StringRef with a stable character pointer.
-class StringSaver final {
+class LLVM_SUPPORT_ABI StringSaver final {
   BumpPtrAllocator &Alloc;
 
 public:
@@ -39,7 +40,7 @@
 ///
 /// Compared to StringPool, it performs fewer allocations but doesn't support
 /// refcounting/deletion.
-class UniqueStringSaver final {
+class LLVM_SUPPORT_ABI UniqueStringSaver final {
   StringSaver Strings;
   llvm::DenseSet<llvm::StringRef> Unique;
 
diff --git a/llvm/include/llvm/Support/SuffixTree.h b/llvm/include/llvm/Support/SuffixTree.h
--- a/llvm/include/llvm/Support/SuffixTree.h
+++ b/llvm/include/llvm/Support/SuffixTree.h
@@ -15,6 +15,8 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <vector>
 
 namespace llvm {
@@ -134,7 +136,7 @@
 /// paper is available at
 ///
 /// https://www.cs.helsinki.fi/u/ukkonen/SuffixT1withFigs.pdf
-class SuffixTree {
+class LLVM_SUPPORT_ABI SuffixTree {
 public:
   /// Each element is an integer representing an instruction in the module.
   llvm::ArrayRef<unsigned> Str;
diff --git a/llvm/include/llvm/Support/SymbolRemappingReader.h b/llvm/include/llvm/Support/SymbolRemappingReader.h
--- a/llvm/include/llvm/Support/SymbolRemappingReader.h
+++ b/llvm/include/llvm/Support/SymbolRemappingReader.h
@@ -62,11 +62,12 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ItaniumManglingCanonicalizer.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MemoryBuffer.h"
 
 namespace llvm {
 
-class SymbolRemappingParseError : public ErrorInfo<SymbolRemappingParseError> {
+class LLVM_SUPPORT_ABI SymbolRemappingParseError : public ErrorInfo<SymbolRemappingParseError> {
 public:
   SymbolRemappingParseError(StringRef File, int64_t Line, const Twine &Message)
       : File(File), Line(Line), Message(Message.str()) {}
@@ -94,7 +95,7 @@
 ///
 /// Remaps the symbol names in profile data to match those in the program
 /// according to a set of rules specified in a given file.
-class SymbolRemappingReader {
+class LLVM_SUPPORT_ABI SymbolRemappingReader {
 public:
   /// Read remappings from the given buffer, which must live as long as
   /// the remapper.
diff --git a/llvm/include/llvm/Support/SystemUtils.h b/llvm/include/llvm/Support/SystemUtils.h
--- a/llvm/include/llvm/Support/SystemUtils.h
+++ b/llvm/include/llvm/Support/SystemUtils.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_SUPPORT_SYSTEMUTILS_H
 #define LLVM_SUPPORT_SYSTEMUTILS_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 namespace llvm {
 class raw_ostream;
 
@@ -21,6 +23,7 @@
 /// generate a warning message to errs() advising against display of bitcode
 /// and return true. Otherwise just return false.
 /// Check for output written to a console
+LLVM_SUPPORT_ABI
 bool CheckBitcodeOutputToConsole(
     raw_ostream &stream_to_check ///< The stream to be checked
 );
diff --git a/llvm/include/llvm/Support/TarWriter.h b/llvm/include/llvm/Support/TarWriter.h
--- a/llvm/include/llvm/Support/TarWriter.h
+++ b/llvm/include/llvm/Support/TarWriter.h
@@ -12,10 +12,11 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
-class TarWriter {
+class LLVM_SUPPORT_ABI TarWriter {
 public:
   static Expected<std::unique_ptr<TarWriter>> create(StringRef OutputPath,
                                                      StringRef BaseDir);
diff --git a/llvm/include/llvm/Support/TargetParser.h b/llvm/include/llvm/Support/TargetParser.h
--- a/llvm/include/llvm/Support/TargetParser.h
+++ b/llvm/include/llvm/Support/TargetParser.h
@@ -19,6 +19,8 @@
 #include "llvm/ADT/Triple.h"
 #include "llvm/Support/ARMTargetParser.h"
 #include "llvm/Support/AArch64TargetParser.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <vector>
 
 namespace llvm {
@@ -132,18 +134,18 @@
   FEATURE_SRAMECC = 1 << 8,
 };
 
-StringRef getArchNameAMDGCN(GPUKind AK);
-StringRef getArchNameR600(GPUKind AK);
-StringRef getCanonicalArchName(const Triple &T, StringRef Arch);
-GPUKind parseArchAMDGCN(StringRef CPU);
-GPUKind parseArchR600(StringRef CPU);
-unsigned getArchAttrAMDGCN(GPUKind AK);
-unsigned getArchAttrR600(GPUKind AK);
+LLVM_SUPPORT_ABI StringRef getArchNameAMDGCN(GPUKind AK);
+LLVM_SUPPORT_ABI StringRef getArchNameR600(GPUKind AK);
+LLVM_SUPPORT_ABI StringRef getCanonicalArchName(const Triple &T, StringRef Arch);
+LLVM_SUPPORT_ABI GPUKind parseArchAMDGCN(StringRef CPU);
+LLVM_SUPPORT_ABI GPUKind parseArchR600(StringRef CPU);
+LLVM_SUPPORT_ABI unsigned getArchAttrAMDGCN(GPUKind AK);
+LLVM_SUPPORT_ABI unsigned getArchAttrR600(GPUKind AK);
 
-void fillValidArchListAMDGCN(SmallVectorImpl<StringRef> &Values);
-void fillValidArchListR600(SmallVectorImpl<StringRef> &Values);
+LLVM_SUPPORT_ABI void fillValidArchListAMDGCN(SmallVectorImpl<StringRef> &Values);
+LLVM_SUPPORT_ABI void fillValidArchListR600(SmallVectorImpl<StringRef> &Values);
 
-IsaVersion getIsaVersion(StringRef GPU);
+LLVM_SUPPORT_ABI IsaVersion getIsaVersion(StringRef GPU);
 
 } // namespace AMDGPU
 
@@ -165,15 +167,15 @@
   FK_64BIT = 1 << 7,
 };
 
-bool checkCPUKind(CPUKind Kind, bool IsRV64);
-bool checkTuneCPUKind(CPUKind Kind, bool IsRV64);
-CPUKind parseCPUKind(StringRef CPU);
-CPUKind parseTuneCPUKind(StringRef CPU, bool IsRV64);
-StringRef getMArchFromMcpu(StringRef CPU);
-void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
-void fillValidTuneCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
-bool getCPUFeaturesExceptStdExt(CPUKind Kind, std::vector<StringRef> &Features);
-StringRef resolveTuneCPUAlias(StringRef TuneCPU, bool IsRV64);
+LLVM_SUPPORT_ABI bool checkCPUKind(CPUKind Kind, bool IsRV64);
+LLVM_SUPPORT_ABI bool checkTuneCPUKind(CPUKind Kind, bool IsRV64);
+LLVM_SUPPORT_ABI CPUKind parseCPUKind(StringRef CPU);
+LLVM_SUPPORT_ABI CPUKind parseTuneCPUKind(StringRef CPU, bool IsRV64);
+LLVM_SUPPORT_ABI StringRef getMArchFromMcpu(StringRef CPU);
+LLVM_SUPPORT_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
+LLVM_SUPPORT_ABI void fillValidTuneCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
+LLVM_SUPPORT_ABI bool getCPUFeaturesExceptStdExt(CPUKind Kind, std::vector<StringRef> &Features);
+LLVM_SUPPORT_ABI StringRef resolveTuneCPUAlias(StringRef TuneCPU, bool IsRV64);
 
 } // namespace RISCV
 
diff --git a/llvm/include/llvm/Support/TargetRegistry.h b/llvm/include/llvm/Support/TargetRegistry.h
--- a/llvm/include/llvm/Support/TargetRegistry.h
+++ b/llvm/include/llvm/Support/TargetRegistry.h
@@ -27,6 +27,8 @@
 #include "llvm/Support/CodeGen.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FormattedStream.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
@@ -675,7 +677,7 @@
 };
 
 /// TargetRegistry - Generic interface to target specific features.
-struct TargetRegistry {
+struct LLVM_SUPPORT_ABI TargetRegistry {
   // FIXME: Make this a namespace, probably just move all the Register*
   // functions into Target (currently they all just set members on the Target
   // anyway, and Target friends this class so those functions can...
diff --git a/llvm/include/llvm/Support/ThreadLocal.h b/llvm/include/llvm/Support/ThreadLocal.h
--- a/llvm/include/llvm/Support/ThreadLocal.h
+++ b/llvm/include/llvm/Support/ThreadLocal.h
@@ -14,14 +14,16 @@
 #define LLVM_SUPPORT_THREADLOCAL_H
 
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/Threading.h"
+
 #include <cassert>
 
 namespace llvm {
   namespace sys {
     // ThreadLocalImpl - Common base class of all ThreadLocal instantiations.
     // YOU SHOULD NEVER USE THIS DIRECTLY.
-    class ThreadLocalImpl {
+    class LLVM_SUPPORT_ABI ThreadLocalImpl {
       typedef uint64_t ThreadLocalDataTy;
       /// Platform-specific thread local data.
       ///
diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h
--- a/llvm/include/llvm/Support/ThreadPool.h
+++ b/llvm/include/llvm/Support/ThreadPool.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_THREADPOOL_H
 
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/Threading.h"
 #include "llvm/Support/thread.h"
 
@@ -34,7 +35,7 @@
 ///
 /// The pool keeps a vector of threads alive, waiting on a condition variable
 /// for some work to become available.
-class ThreadPool {
+class LLVM_SUPPORT_ABI ThreadPool {
 public:
   using TaskTy = std::function<void()>;
   using PackagedTaskTy = std::packaged_task<void()>;
diff --git a/llvm/include/llvm/Support/Threading.h b/llvm/include/llvm/Support/Threading.h
--- a/llvm/include/llvm/Support/Threading.h
+++ b/llvm/include/llvm/Support/Threading.h
@@ -20,6 +20,8 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Compiler.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <ciso646> // So we can check the C++ standard lib macros.
 #include <functional>
 
@@ -53,7 +55,7 @@
 
 /// Returns true if LLVM is compiled with support for multi-threading, and
 /// false otherwise.
-bool llvm_is_multithreaded();
+LLVM_SUPPORT_ABI bool llvm_is_multithreaded();
 
 #if LLVM_THREADING_USE_STD_CALL_ONCE
 
@@ -116,7 +118,7 @@
   }
 
   /// This tells how a thread pool will be used
-  class ThreadPoolStrategy {
+  class LLVM_SUPPORT_ABI ThreadPoolStrategy {
   public:
     // The default value (0) means all available threads should be used,
     // taking the affinity mask into account. If set, this value only represents
@@ -152,7 +154,7 @@
   /// strategy, we attempt to equally allocate the threads on all CPU sockets.
   /// "0" or an empty string will return the \p Default strategy.
   /// "all" for using all hardware threads.
-  Optional<ThreadPoolStrategy>
+  LLVM_SUPPORT_ABI Optional<ThreadPoolStrategy>
   get_threadpool_strategy(StringRef Num, ThreadPoolStrategy Default = {});
 
   /// Returns a thread strategy for tasks requiring significant memory or other
@@ -205,7 +207,7 @@
   /// Note that not all platforms guarantee that the value returned will be
   /// unique across the entire system, so portable code should not assume
   /// this.
-  uint64_t get_threadid();
+  LLVM_SUPPORT_ABI uint64_t get_threadid();
 
   /// Get the maximum length of a thread name on this platform.
   /// A value of 0 means there is no limit.
@@ -217,7 +219,7 @@
   /// wildly across operating systems, and we only make a best effort to
   /// perform the operation on supported platforms.  No indication of success
   /// or failure is returned.
-  void set_thread_name(const Twine &Name);
+  LLVM_SUPPORT_ABI void set_thread_name(const Twine &Name);
 
   /// Get the name of the current thread.  The level of support for
   /// getting a thread's name varies wildly across operating systems, and it
@@ -225,15 +227,15 @@
   /// that you can later get it back.  This function is intended for diagnostic
   /// purposes, and as with setting a thread's name no indication of whether
   /// the operation succeeded or failed is returned.
-  void get_thread_name(SmallVectorImpl<char> &Name);
+  LLVM_SUPPORT_ABI void get_thread_name(SmallVectorImpl<char> &Name);
 
   /// Returns a mask that represents on which hardware thread, core, CPU, NUMA
   /// group, the calling thread can be executed. On Windows, threads cannot
   /// cross CPU sockets boundaries.
-  llvm::BitVector get_thread_affinity_mask();
+  LLVM_SUPPORT_ABI llvm::BitVector get_thread_affinity_mask();
 
   /// Returns how many physical CPUs or NUMA groups the system has.
-  unsigned get_cpus();
+  LLVM_SUPPORT_ABI unsigned get_cpus();
 
   enum class ThreadPriority {
     Background = 0,
@@ -246,7 +248,8 @@
   /// If the priority is default tries to restore current threads priority to
   /// default scheduling priority.
   enum class SetThreadPriorityResult { FAILURE, SUCCESS };
-  SetThreadPriorityResult set_thread_priority(ThreadPriority Priority);
+
+  LLVM_SUPPORT_ABI SetThreadPriorityResult set_thread_priority(ThreadPriority Priority);
 }
 
 #endif
diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h
--- a/llvm/include/llvm/Support/TimeProfiler.h
+++ b/llvm/include/llvm/Support/TimeProfiler.h
@@ -10,24 +10,25 @@
 #define LLVM_SUPPORT_TIMEPROFILER_H
 
 #include "llvm/Support/Error.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
 
 struct TimeTraceProfiler;
-TimeTraceProfiler *getTimeTraceProfilerInstance();
+LLVM_SUPPORT_ABI TimeTraceProfiler *getTimeTraceProfilerInstance();
 
 /// Initialize the time trace profiler.
 /// This sets up the global \p TimeTraceProfilerInstance
 /// variable to be the profiler instance.
-void timeTraceProfilerInitialize(unsigned TimeTraceGranularity,
+LLVM_SUPPORT_ABI void timeTraceProfilerInitialize(unsigned TimeTraceGranularity,
                                  StringRef ProcName);
 
 /// Cleanup the time trace profiler, if it was initialized.
-void timeTraceProfilerCleanup();
+LLVM_SUPPORT_ABI void timeTraceProfilerCleanup();
 
 /// Finish a time trace profiler running on a worker thread.
-void timeTraceProfilerFinishThread();
+LLVM_SUPPORT_ABI void timeTraceProfilerFinishThread();
 
 /// Is the time trace profiler enabled, i.e. initialized?
 inline bool timeTraceProfilerEnabled() {
@@ -37,26 +38,26 @@
 /// Write profiling data to output stream.
 /// Data produced is JSON, in Chrome "Trace Event" format, see
 /// https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview
-void timeTraceProfilerWrite(raw_pwrite_stream &OS);
+LLVM_SUPPORT_ABI void timeTraceProfilerWrite(raw_pwrite_stream &OS);
 
 /// Write profiling data to a file.
 /// The function will write to \p PreferredFileName if provided, if not
 /// then will write to \p FallbackFileName appending .time-trace.
 /// Returns a StringError indicating a failure if the function is
 /// unable to open the file for writing.
-Error timeTraceProfilerWrite(StringRef PreferredFileName,
+LLVM_SUPPORT_ABI Error timeTraceProfilerWrite(StringRef PreferredFileName,
                              StringRef FallbackFileName);
 
 /// Manually begin a time section, with the given \p Name and \p Detail.
 /// Profiler copies the string data, so the pointers can be given into
 /// temporaries. Time sections can be hierarchical; every Begin must have a
 /// matching End pair but they can nest.
-void timeTraceProfilerBegin(StringRef Name, StringRef Detail);
-void timeTraceProfilerBegin(StringRef Name,
+LLVM_SUPPORT_ABI void timeTraceProfilerBegin(StringRef Name, StringRef Detail);
+LLVM_SUPPORT_ABI void timeTraceProfilerBegin(StringRef Name,
                             llvm::function_ref<std::string()> Detail);
 
 /// Manually end the last time section.
-void timeTraceProfilerEnd();
+LLVM_SUPPORT_ABI void timeTraceProfilerEnd();
 
 /// The TimeTraceScope is a helper class to call the begin and end functions
 /// of the time trace profiler.  When the object is constructed, it begins
diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h
--- a/llvm/include/llvm/Support/Timer.h
+++ b/llvm/include/llvm/Support/Timer.h
@@ -12,6 +12,8 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cassert>
 #include <string>
 #include <utility>
@@ -23,7 +25,7 @@
 class TimerGroup;
 class raw_ostream;
 
-class TimeRecord {
+class LLVM_SUPPORT_ABI TimeRecord {
   double WallTime;               ///< Wall clock time elapsed in seconds.
   double UserTime;               ///< User time elapsed.
   double SystemTime;             ///< System time elapsed.
@@ -79,7 +81,7 @@
 /// when the last timer is destroyed, otherwise it is printed when its
 /// TimerGroup is destroyed.  Timers do not print their information if they are
 /// never started.
-class Timer {
+class LLVM_SUPPORT_ABI Timer {
   TimeRecord Time;          ///< The total time captured.
   TimeRecord StartTime;     ///< The time startTimer() was last called.
   std::string Name;         ///< The name of this time variable.
@@ -143,7 +145,7 @@
 /// stopTimer() methods of the Timer class.  When the object is constructed, it
 /// starts the timer specified as its argument.  When it is destroyed, it stops
 /// the relevant timer.  This makes it easy to time a region of code.
-class TimeRegion {
+class LLVM_SUPPORT_ABI TimeRegion {
   Timer *T;
   TimeRegion(const TimeRegion &) = delete;
 
@@ -163,7 +165,7 @@
 /// you to declare a new timer, AND specify the region to time, all in one
 /// statement.  All timers with the same name are merged.  This is primarily
 /// used for debugging and for hunting performance problems.
-struct NamedRegionTimer : public TimeRegion {
+struct LLVM_SUPPORT_ABI NamedRegionTimer : public TimeRegion {
   explicit NamedRegionTimer(StringRef Name, StringRef Description,
                             StringRef GroupName,
                             StringRef GroupDescription, bool Enabled = true);
@@ -173,7 +175,7 @@
 /// report that is printed when the TimerGroup is destroyed.  It is illegal to
 /// destroy a TimerGroup object before all of the Timers in it are gone.  A
 /// TimerGroup can be specified for a newly created timer in its constructor.
-class TimerGroup {
+class LLVM_SUPPORT_ABI TimerGroup {
   struct PrintRecord {
     TimeRecord Time;
     std::string Name;
@@ -243,7 +245,7 @@
 
 private:
   friend class Timer;
-  friend void PrintStatisticsJSON(raw_ostream &OS);
+  friend LLVM_SUPPORT_ABI void PrintStatisticsJSON(raw_ostream &OS);
   void addTimer(Timer &T);
   void removeTimer(Timer &T);
   void prepareToPrintList(bool reset_time = false);
diff --git a/llvm/include/llvm/Support/ToolOutputFile.h b/llvm/include/llvm/Support/ToolOutputFile.h
--- a/llvm/include/llvm/Support/ToolOutputFile.h
+++ b/llvm/include/llvm/Support/ToolOutputFile.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_TOOLOUTPUTFILE_H
 
 #include "llvm/ADT/Optional.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
@@ -28,7 +29,7 @@
   /// before the raw_fd_ostream is constructed and destructed after the
   /// raw_fd_ostream is destructed. It installs cleanups in its constructor and
   /// uninstalls them in its destructor.
-  class CleanupInstaller {
+  class LLVM_SUPPORT_ABI CleanupInstaller {
     /// The name of the file.
     std::string Filename;
   public:
@@ -50,9 +51,11 @@
 public:
   /// This constructor's arguments are passed to raw_fd_ostream's
   /// constructor.
+  LLVM_SUPPORT_ABI
   ToolOutputFile(StringRef Filename, std::error_code &EC,
                  sys::fs::OpenFlags Flags);
 
+  LLVM_SUPPORT_ABI
   ToolOutputFile(StringRef Filename, int FD);
 
   /// Return the contained raw_fd_ostream.
diff --git a/llvm/include/llvm/Support/TrigramIndex.h b/llvm/include/llvm/Support/TrigramIndex.h
--- a/llvm/include/llvm/Support/TrigramIndex.h
+++ b/llvm/include/llvm/Support/TrigramIndex.h
@@ -28,6 +28,8 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <string>
 #include <unordered_map>
 #include <vector>
@@ -35,7 +37,7 @@
 namespace llvm {
 class StringRef;
 
-class TrigramIndex {
+class LLVM_SUPPORT_ABI TrigramIndex {
  public:
   /// Inserts a new Regex into the index.
   void insert(const std::string &Regex);
diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -16,6 +16,7 @@
 #define LLVM_SUPPORT_TYPESIZE_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/WithColor.h"
 
@@ -29,7 +30,7 @@
 
 /// Reports a diagnostic message to indicate an invalid size request has been
 /// done on a scalable vector. This function may not return.
-void reportInvalidSizeRequest(const char *Msg);
+LLVM_SUPPORT_ABI void reportInvalidSizeRequest(const char *Msg);
 
 template <typename LeafTy> struct LinearPolyBaseTypeTraits {};
 
@@ -414,7 +415,7 @@
 // TypeSize is used to represent the size of types. If the type is of fixed
 // size, it will represent the exact size. If the type is a scalable vector,
 // it will represent the known minimum size.
-class TypeSize : public LinearPolySize<TypeSize> {
+class LLVM_SUPPORT_ABI TypeSize : public LinearPolySize<TypeSize> {
 public:
   TypeSize(const LinearPolySize<TypeSize> &V) : LinearPolySize(V) {}
   TypeSize(ScalarTy MinVal, bool IsScalable)
diff --git a/llvm/include/llvm/Support/Unicode.h b/llvm/include/llvm/Support/Unicode.h
--- a/llvm/include/llvm/Support/Unicode.h
+++ b/llvm/include/llvm/Support/Unicode.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_SUPPORT_UNICODE_H
 #define LLVM_SUPPORT_UNICODE_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 namespace llvm {
 class StringRef;
 
@@ -41,7 +43,7 @@
 ///   * surrogates (category = Cs);
 ///   * unassigned characters (category = Cn).
 /// \return true if the character is considered printable.
-bool isPrintable(int UCS);
+LLVM_SUPPORT_ABI bool isPrintable(int UCS);
 
 /// Gets the number of positions the UTF8-encoded \p Text is likely to occupy
 /// when output on a terminal ("character width"). This depends on the
@@ -57,7 +59,7 @@
 ///   * 0 for each non-spacing and enclosing combining mark;
 ///   * 2 for each CJK character excluding halfwidth forms;
 ///   * 1 for each of the remaining characters.
-int columnWidthUTF8(StringRef Text);
+LLVM_SUPPORT_ABI int columnWidthUTF8(StringRef Text);
 
 /// Fold input unicode character according the Simple unicode case folding
 /// rules.
diff --git a/llvm/include/llvm/Support/Valgrind.h b/llvm/include/llvm/Support/Valgrind.h
--- a/llvm/include/llvm/Support/Valgrind.h
+++ b/llvm/include/llvm/Support/Valgrind.h
@@ -15,12 +15,14 @@
 #ifndef LLVM_SUPPORT_VALGRIND_H
 #define LLVM_SUPPORT_VALGRIND_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cstddef>
 
 namespace llvm {
 namespace sys {
   // True if Valgrind is controlling this process.
-  bool RunningOnValgrind();
+  LLVM_SUPPORT_ABI bool RunningOnValgrind();
 
   // Discard valgrind's translation of code in the range [Addr .. Addr + Len).
   // Otherwise valgrind may continue to execute the old version of the code.
diff --git a/llvm/include/llvm/Support/VersionTuple.h b/llvm/include/llvm/Support/VersionTuple.h
--- a/llvm/include/llvm/Support/VersionTuple.h
+++ b/llvm/include/llvm/Support/VersionTuple.h
@@ -18,6 +18,8 @@
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/Support/HashBuilder.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <string>
 #include <tuple>
 
@@ -26,7 +28,7 @@
 class StringRef;
 
 /// Represents a version number in the form major[.minor[.subminor[.build]]].
-class VersionTuple {
+class LLVM_SUPPORT_ABI VersionTuple {
   unsigned Major : 32;
 
   unsigned Minor : 31;
@@ -181,6 +183,7 @@
 };
 
 /// Print a version number.
+LLVM_SUPPORT_ABI
 raw_ostream &operator<<(raw_ostream &Out, const VersionTuple &V);
 
 // Provide DenseMapInfo for version tuples.
diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -22,8 +22,10 @@
 #include "llvm/Support/Chrono.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/SourceMgr.h"
+
 #include <cassert>
 #include <cstdint>
 #include <ctime>
@@ -43,7 +45,7 @@
 namespace vfs {
 
 /// The result of a \p status operation.
-class Status {
+class LLVM_SUPPORT_ABI Status {
   std::string Name;
   llvm::sys::fs::UniqueID UID;
   llvm::sys::TimePoint<> MTime;
@@ -96,7 +98,7 @@
 };
 
 /// Represents an open file.
-class File {
+class LLVM_SUPPORT_ABI File {
 public:
   /// Destroy the file after closing it (if open).
   /// Sub-classes should generally call close() inside their destructors.  We
@@ -142,7 +144,7 @@
 
 /// An interface for virtual file systems to provide an iterator over the
 /// (non-recursive) contents of a directory.
-struct DirIterImpl {
+struct LLVM_SUPPORT_ABI DirIterImpl {
   virtual ~DirIterImpl();
 
   /// Sets \c CurrentEntry to the next entry in the directory on success,
@@ -206,7 +208,7 @@
 
 /// An input iterator over the recursive contents of a virtual path,
 /// similar to llvm::sys::fs::recursive_directory_iterator.
-class recursive_directory_iterator {
+class LLVM_SUPPORT_ABI recursive_directory_iterator {
   FileSystem *FS;
   std::shared_ptr<detail::RecDirIterState>
       State; // Input iterator semantics on copy.
@@ -242,7 +244,7 @@
 };
 
 /// The virtual file system interface.
-class FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem> {
+class LLVM_SUPPORT_ABI FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem> {
 public:
   virtual ~FileSystem();
 
@@ -301,13 +303,13 @@
 /// the operating system.
 /// The working directory is linked to the process's working directory.
 /// (This is usually thread-hostile).
-IntrusiveRefCntPtr<FileSystem> getRealFileSystem();
+LLVM_SUPPORT_ABI IntrusiveRefCntPtr<FileSystem> getRealFileSystem();
 
 /// Create an \p vfs::FileSystem for the 'real' file system, as seen by
 /// the operating system.
 /// It has its own working directory, independent of (but initially equal to)
 /// that of the process.
-std::unique_ptr<FileSystem> createPhysicalFileSystem();
+LLVM_SUPPORT_ABI std::unique_ptr<FileSystem> createPhysicalFileSystem();
 
 /// A file system that allows overlaying one \p AbstractFileSystem on top
 /// of another.
@@ -319,7 +321,7 @@
 /// top-most (most recently added) directory are used.  When there is a file
 /// that exists in more than one file system, the file in the top-most file
 /// system overrides the other(s).
-class OverlayFileSystem : public FileSystem {
+class LLVM_SUPPORT_ABI OverlayFileSystem : public FileSystem {
   using FileSystemList = SmallVector<IntrusiveRefCntPtr<FileSystem>, 1>;
 
   /// The stack of file systems, implemented as a list in order of
@@ -367,7 +369,7 @@
 /// By default, this delegates all calls to the underlying file system. This
 /// is useful when derived file systems want to override some calls and still
 /// proxy other calls.
-class ProxyFileSystem : public FileSystem {
+class LLVM_SUPPORT_ABI ProxyFileSystem : public FileSystem {
 public:
   explicit ProxyFileSystem(IntrusiveRefCntPtr<FileSystem> FS)
       : FS(std::move(FS)) {}
@@ -413,7 +415,7 @@
 } // namespace detail
 
 /// An in-memory file system.
-class InMemoryFileSystem : public FileSystem {
+class LLVM_SUPPORT_ABI InMemoryFileSystem : public FileSystem {
   std::unique_ptr<detail::InMemoryDirectory> Root;
   std::string WorkingDirectory;
   bool UseNormalizedPaths = true;
@@ -500,7 +502,7 @@
 
 /// Gets a \p FileSystem for a virtual file system described in YAML
 /// format.
-std::unique_ptr<FileSystem>
+LLVM_SUPPORT_ABI std::unique_ptr<FileSystem>
 getVFSFromYAML(std::unique_ptr<llvm::MemoryBuffer> Buffer,
                llvm::SourceMgr::DiagHandlerTy DiagHandler,
                StringRef YAMLFilePath, void *DiagContext = nullptr,
@@ -829,12 +831,14 @@
 
   /// Parses \p Buffer, which is expected to be in YAML format and
   /// returns a virtual file system representing its contents.
+  LLVM_SUPPORT_ABI
   static std::unique_ptr<RedirectingFileSystem>
   create(std::unique_ptr<MemoryBuffer> Buffer,
          SourceMgr::DiagHandlerTy DiagHandler, StringRef YAMLFilePath,
          void *DiagContext, IntrusiveRefCntPtr<FileSystem> ExternalFS);
 
   /// Redirect each of the remapped files from first to second.
+  LLVM_SUPPORT_ABI
   static std::unique_ptr<RedirectingFileSystem>
   create(ArrayRef<std::pair<std::string, std::string>> RemappedFiles,
          bool UseExternalNames, FileSystem &ExternalFS);
@@ -873,14 +877,14 @@
 /// Collect all pairs of <virtual path, real path> entries from the
 /// \p YAMLFilePath. This is used by the module dependency collector to forward
 /// the entries into the reproducer output VFS YAML file.
-void collectVFSFromYAML(
+LLVM_SUPPORT_ABI void collectVFSFromYAML(
     std::unique_ptr<llvm::MemoryBuffer> Buffer,
     llvm::SourceMgr::DiagHandlerTy DiagHandler, StringRef YAMLFilePath,
     SmallVectorImpl<YAMLVFSEntry> &CollectedEntries,
     void *DiagContext = nullptr,
     IntrusiveRefCntPtr<FileSystem> ExternalFS = getRealFileSystem());
 
-class YAMLVFSWriter {
+class LLVM_SUPPORT_ABI YAMLVFSWriter {
   std::vector<YAMLVFSEntry> Mappings;
   Optional<bool> IsCaseSensitive;
   Optional<bool> IsOverlayRelative;
diff --git a/llvm/include/llvm/Support/Windows/WindowsSupport.h b/llvm/include/llvm/Support/Windows/WindowsSupport.h
--- a/llvm/include/llvm/Support/Windows/WindowsSupport.h
+++ b/llvm/include/llvm/Support/Windows/WindowsSupport.h
@@ -42,7 +42,9 @@
 #include "llvm/Support/Chrono.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/VersionTuple.h"
+
 #include <cassert>
 #include <string>
 #include <system_error>
@@ -239,7 +241,7 @@
 
 /// Convert UTF-8 path to a suitable UTF-16 path for use with the Win32 Unicode
 /// File API.
-std::error_code widenPath(const Twine &Path8, SmallVectorImpl<wchar_t> &Path16,
+LLVM_SUPPORT_ABI std::error_code widenPath(const Twine &Path8, SmallVectorImpl<wchar_t> &Path16,
                           size_t MaxPathLen = MAX_PATH);
 
 } // end namespace windows
diff --git a/llvm/include/llvm/Support/WindowsError.h b/llvm/include/llvm/Support/WindowsError.h
--- a/llvm/include/llvm/Support/WindowsError.h
+++ b/llvm/include/llvm/Support/WindowsError.h
@@ -9,10 +9,12 @@
 #ifndef LLVM_SUPPORT_WINDOWSERROR_H
 #define LLVM_SUPPORT_WINDOWSERROR_H
 
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <system_error>
 
 namespace llvm {
-std::error_code mapWindowsError(unsigned EV);
+LLVM_SUPPORT_ABI std::error_code mapWindowsError(unsigned EV);
 }
 
 #endif
diff --git a/llvm/include/llvm/Support/WithColor.h b/llvm/include/llvm/Support/WithColor.h
--- a/llvm/include/llvm/Support/WithColor.h
+++ b/llvm/include/llvm/Support/WithColor.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_SUPPORT_WITHCOLOR_H
 #define LLVM_SUPPORT_WITHCOLOR_H
 
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
@@ -20,7 +21,7 @@
 class OptionCategory;
 }
 
-extern cl::OptionCategory &getColorCategory();
+LLVM_SUPPORT_ABI cl::OptionCategory &getColorCategory();
 
 // Symbolic names for various syntax elements.
 enum class HighlightColor {
@@ -50,7 +51,7 @@
 
 /// An RAII object that temporarily switches an output stream to a specific
 /// color.
-class WithColor {
+class LLVM_SUPPORT_ABI WithColor {
   raw_ostream &OS;
   ColorMode Mode;
 
diff --git a/llvm/include/llvm/Support/X86TargetParser.h b/llvm/include/llvm/Support/X86TargetParser.h
--- a/llvm/include/llvm/Support/X86TargetParser.h
+++ b/llvm/include/llvm/Support/X86TargetParser.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
 class StringRef;
@@ -133,30 +134,30 @@
 
 /// Parse \p CPU string into a CPUKind. Will only accept 64-bit capable CPUs if
 /// \p Only64Bit is true.
-CPUKind parseArchX86(StringRef CPU, bool Only64Bit = false);
-CPUKind parseTuneCPU(StringRef CPU, bool Only64Bit = false);
+LLVM_SUPPORT_ABI CPUKind parseArchX86(StringRef CPU, bool Only64Bit = false);
+LLVM_SUPPORT_ABI CPUKind parseTuneCPU(StringRef CPU, bool Only64Bit = false);
 
 /// Provide a list of valid CPU names. If \p Only64Bit is true, the list will
 /// only contain 64-bit capable CPUs.
-void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values,
+LLVM_SUPPORT_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values,
                           bool Only64Bit = false);
 /// Provide a list of valid -mtune names.
-void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values,
+LLVM_SUPPORT_ABI void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values,
                           bool Only64Bit = false);
 
 /// Get the key feature prioritizing target multiversioning.
-ProcessorFeatures getKeyFeature(CPUKind Kind);
+LLVM_SUPPORT_ABI ProcessorFeatures getKeyFeature(CPUKind Kind);
 
 /// Fill in the features that \p CPU supports into \p Features.
-void getFeaturesForCPU(StringRef CPU, SmallVectorImpl<StringRef> &Features);
+LLVM_SUPPORT_ABI void getFeaturesForCPU(StringRef CPU, SmallVectorImpl<StringRef> &Features);
 
 /// Set or clear entries in \p Features that are implied to be enabled/disabled
 /// by the provided \p Feature.
-void updateImpliedFeatures(StringRef Feature, bool Enabled,
+LLVM_SUPPORT_ABI void updateImpliedFeatures(StringRef Feature, bool Enabled,
                            StringMap<bool> &Features);
 
-uint64_t getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs);
-unsigned getFeaturePriority(ProcessorFeatures Feat);
+LLVM_SUPPORT_ABI uint64_t getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs);
+LLVM_SUPPORT_ABI unsigned getFeaturePriority(ProcessorFeatures Feat);
 
 } // namespace X86
 } // namespace llvm
diff --git a/llvm/include/llvm/Support/YAMLParser.h b/llvm/include/llvm/Support/YAMLParser.h
--- a/llvm/include/llvm/Support/YAMLParser.h
+++ b/llvm/include/llvm/Support/YAMLParser.h
@@ -39,8 +39,10 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/SMLoc.h"
 #include "llvm/Support/SourceMgr.h"
+
 #include <cassert>
 #include <cstddef>
 #include <iterator>
@@ -65,25 +67,25 @@
 
 /// Dump all the tokens in this stream to OS.
 /// \returns true if there was an error, false otherwise.
-bool dumpTokens(StringRef Input, raw_ostream &);
+LLVM_SUPPORT_ABI bool dumpTokens(StringRef Input, raw_ostream &);
 
 /// Scans all tokens in input without outputting anything. This is used
 ///        for benchmarking the tokenizer.
 /// \returns true if there was an error, false otherwise.
-bool scanTokens(StringRef Input);
+LLVM_SUPPORT_ABI bool scanTokens(StringRef Input);
 
 /// Escape \a Input for a double quoted scalar; if \p EscapePrintable
 /// is true, all UTF8 sequences will be escaped, if \p EscapePrintable is
 /// false, those UTF8 sequences encoding printable unicode scalars will not be
 /// escaped, but emitted verbatim.
-std::string escape(StringRef Input, bool EscapePrintable = true);
+LLVM_SUPPORT_ABI std::string escape(StringRef Input, bool EscapePrintable = true);
 
 /// Parse \p S as a bool according to https://yaml.org/type/bool.html.
-llvm::Optional<bool> parseBool(StringRef S);
+LLVM_SUPPORT_ABI llvm::Optional<bool> parseBool(StringRef S);
 
 /// This class represents a YAML stream potentially containing multiple
 ///        documents.
-class Stream {
+class LLVM_SUPPORT_ABI Stream {
 public:
   /// This keeps a reference to the string referenced by \p Input.
   Stream(StringRef Input, SourceMgr &, bool ShowColors = true,
@@ -116,7 +118,7 @@
 };
 
 /// Abstract base class for all Nodes.
-class Node {
+class LLVM_SUPPORT_ABI Node {
   virtual void anchor();
 
 public:
@@ -209,7 +211,7 @@
 ///
 /// Example:
 ///   Adena
-class ScalarNode final : public Node {
+class LLVM_SUPPORT_ABI ScalarNode final : public Node {
   void anchor() override;
 
 public:
@@ -282,7 +284,7 @@
 ///
 /// Example:
 ///   Section: .text
-class KeyValueNode final : public Node {
+class LLVM_SUPPORT_ABI KeyValueNode final : public Node {
   void anchor() override;
 
 public:
@@ -411,7 +413,7 @@
 /// Example:
 ///   Name: _main
 ///   Scope: Global
-class MappingNode final : public Node {
+class LLVM_SUPPORT_ABI MappingNode final : public Node {
   void anchor() override;
 
 public:
@@ -459,7 +461,7 @@
 /// Example:
 ///   - Hello
 ///   - World
-class SequenceNode final : public Node {
+class LLVM_SUPPORT_ABI SequenceNode final : public Node {
   void anchor() override;
 
 public:
@@ -528,7 +530,7 @@
 
 /// A YAML Stream is a sequence of Documents. A document contains a root
 ///        node.
-class Document {
+class LLVM_SUPPORT_ABI Document {
 public:
   Document(Stream &ParentStream);
 
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
--- a/llvm/include/llvm/Support/YAMLTraits.h
+++ b/llvm/include/llvm/Support/YAMLTraits.h
@@ -18,12 +18,14 @@
 #include "llvm/Support/AlignOf.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Endian.h"
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/SMLoc.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/VersionTuple.h"
 #include "llvm/Support/YAMLParser.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <cassert>
 #include <cctype>
 #include <cstddef>
@@ -748,7 +750,7 @@
                     !has_MappingValidateTraits<T, Context>::value> {};
 
 // Base class for Input and Output.
-class IO {
+class LLVM_SUPPORT_ABI IO {
 public:
   IO(void *Ctxt = nullptr);
   virtual ~IO();
@@ -1141,91 +1143,91 @@
 }
 
 template<>
-struct ScalarTraits<bool> {
+struct LLVM_SUPPORT_ABI ScalarTraits<bool> {
   static void output(const bool &, void* , raw_ostream &);
   static StringRef input(StringRef, void *, bool &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<StringRef> {
+struct LLVM_SUPPORT_ABI ScalarTraits<StringRef> {
   static void output(const StringRef &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, StringRef &);
   static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
 };
 
 template<>
-struct ScalarTraits<std::string> {
+struct LLVM_SUPPORT_ABI ScalarTraits<std::string> {
   static void output(const std::string &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, std::string &);
   static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
 };
 
 template<>
-struct ScalarTraits<uint8_t> {
+struct LLVM_SUPPORT_ABI ScalarTraits<uint8_t> {
   static void output(const uint8_t &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, uint8_t &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<uint16_t> {
+struct LLVM_SUPPORT_ABI ScalarTraits<uint16_t> {
   static void output(const uint16_t &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, uint16_t &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<uint32_t> {
+struct LLVM_SUPPORT_ABI ScalarTraits<uint32_t> {
   static void output(const uint32_t &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, uint32_t &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<uint64_t> {
+struct LLVM_SUPPORT_ABI ScalarTraits<uint64_t> {
   static void output(const uint64_t &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, uint64_t &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<int8_t> {
+struct LLVM_SUPPORT_ABI ScalarTraits<int8_t> {
   static void output(const int8_t &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, int8_t &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<int16_t> {
+struct LLVM_SUPPORT_ABI ScalarTraits<int16_t> {
   static void output(const int16_t &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, int16_t &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<int32_t> {
+struct LLVM_SUPPORT_ABI ScalarTraits<int32_t> {
   static void output(const int32_t &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, int32_t &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<int64_t> {
+struct LLVM_SUPPORT_ABI ScalarTraits<int64_t> {
   static void output(const int64_t &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, int64_t &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<float> {
+struct LLVM_SUPPORT_ABI ScalarTraits<float> {
   static void output(const float &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, float &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<double> {
+struct LLVM_SUPPORT_ABI ScalarTraits<double> {
   static void output(const double &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, double &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
@@ -1370,7 +1372,7 @@
 /// the mapRequired() method calls may not be in the same order
 /// as the keys in the document.
 ///
-class Input : public IO {
+class LLVM_SUPPORT_ABI Input : public IO {
 public:
   // Construct a yaml Input object from a StringRef and optional
   // user-data. The DiagHandler can be specified to provide
@@ -1533,7 +1535,7 @@
 /// The Output class is used to generate a yaml document from in-memory structs
 /// and vectors.
 ///
-class Output : public IO {
+class LLVM_SUPPORT_ABI Output : public IO {
 public:
   Output(raw_ostream &, void *Ctxt = nullptr, int WrapColumn = 70);
   ~Output() override;
@@ -1690,34 +1692,34 @@
 LLVM_YAML_STRONG_TYPEDEF(uint64_t, Hex64)
 
 template<>
-struct ScalarTraits<Hex8> {
+struct LLVM_SUPPORT_ABI ScalarTraits<Hex8> {
   static void output(const Hex8 &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, Hex8 &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<Hex16> {
+struct LLVM_SUPPORT_ABI ScalarTraits<Hex16> {
   static void output(const Hex16 &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, Hex16 &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<Hex32> {
+struct LLVM_SUPPORT_ABI ScalarTraits<Hex32> {
   static void output(const Hex32 &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, Hex32 &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
 template<>
-struct ScalarTraits<Hex64> {
+struct LLVM_SUPPORT_ABI ScalarTraits<Hex64> {
   static void output(const Hex64 &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, Hex64 &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
-template <> struct ScalarTraits<VersionTuple> {
+template <> struct LLVM_SUPPORT_ABI ScalarTraits<VersionTuple> {
   static void output(const VersionTuple &Value, void *, llvm::raw_ostream &Out);
   static StringRef input(StringRef, void *, VersionTuple &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
diff --git a/llvm/include/llvm/Support/raw_os_ostream.h b/llvm/include/llvm/Support/raw_os_ostream.h
--- a/llvm/include/llvm/Support/raw_os_ostream.h
+++ b/llvm/include/llvm/Support/raw_os_ostream.h
@@ -13,7 +13,9 @@
 #ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
 #define LLVM_SUPPORT_RAW_OS_OSTREAM_H
 
+#include "llvm/Support/LLVMSupportExports.h"
 #include "llvm/Support/raw_ostream.h"
+
 #include <iosfwd>
 
 namespace llvm {
@@ -21,7 +23,7 @@
 /// raw_os_ostream - A raw_ostream that writes to an std::ostream.  This is a
 /// simple adaptor class.  It does not check for output errors; clients should
 /// use the underlying stream to detect errors.
-class raw_os_ostream : public raw_ostream {
+class LLVM_SUPPORT_ABI raw_os_ostream : public raw_ostream {
   std::ostream &OS;
 
   /// write_impl - See raw_ostream::write_impl.
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -16,6 +16,8 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/LLVMSupportExports.h"
+
 #include <cassert>
 #include <chrono>
 #include <cstddef>
@@ -50,7 +52,7 @@
 /// output to a stream.  It does not support seeking, reopening, rewinding, line
 /// buffered disciplines etc. It is a simple buffer that outputs
 /// a chunk at a time.
-class raw_ostream {
+class LLVM_SUPPORT_ABI raw_ostream {
 public:
   // Class kinds to support LLVM-style RTTI.
   enum class OStreamKind {
@@ -412,7 +414,7 @@
 /// An abstract base class for streams implementations that also support a
 /// pwrite operation. This is useful for code that can mostly stream out data,
 /// but needs to patch in a header that needs to know the output size.
-class raw_pwrite_stream : public raw_ostream {
+class LLVM_SUPPORT_ABI raw_pwrite_stream : public raw_ostream {
   virtual void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) = 0;
   void anchor() override;
 
@@ -438,7 +440,7 @@
 
 /// A raw_ostream that writes to a file descriptor.
 ///
-class raw_fd_ostream : public raw_pwrite_stream {
+class LLVM_SUPPORT_ABI raw_fd_ostream : public raw_pwrite_stream {
   int FD;
   bool ShouldClose;
   bool SupportsSeeking = false;
@@ -574,17 +576,17 @@
 
 /// This returns a reference to a raw_fd_ostream for standard output. Use it
 /// like: outs() << "foo" << "bar";
-raw_fd_ostream &outs();
+LLVM_SUPPORT_ABI raw_fd_ostream &outs();
 
 /// This returns a reference to a raw_ostream for standard error.
 /// Use it like: errs() << "foo" << "bar";
 /// By default, the stream is tied to stdout to ensure stdout is flushed before
 /// stderr is written, to ensure the error messages are written in their
 /// expected place.
-raw_fd_ostream &errs();
+LLVM_SUPPORT_ABI raw_fd_ostream &errs();
 
 /// This returns a reference to a raw_ostream which simply discards output.
-raw_ostream &nulls();
+LLVM_SUPPORT_ABI raw_ostream &nulls();
 
 //===----------------------------------------------------------------------===//
 // File Streams
@@ -592,7 +594,7 @@
 
 /// A raw_ostream of a file for reading/writing/seeking.
 ///
-class raw_fd_stream : public raw_fd_ostream {
+class LLVM_SUPPORT_ABI raw_fd_stream : public raw_fd_ostream {
 public:
   /// Open the specified file for reading/writing/seeking. If an error occurs,
   /// information about the error is put into EC, and the stream should be
@@ -620,7 +622,7 @@
 
 /// A raw_ostream that writes to an std::string.  This is a simple adaptor
 /// class. This class does not encounter output errors.
-class raw_string_ostream : public raw_ostream {
+class LLVM_SUPPORT_ABI raw_string_ostream : public raw_ostream {
   std::string &OS;
 
   /// See raw_ostream::write_impl.
@@ -653,7 +655,7 @@
 /// raw_svector_ostream operates without a buffer, delegating all memory
 /// management to the SmallString. Thus the SmallString is always up-to-date,
 /// may be used directly and there is no need to call flush().
-class raw_svector_ostream : public raw_pwrite_stream {
+class LLVM_SUPPORT_ABI raw_svector_ostream : public raw_pwrite_stream {
   SmallVectorImpl<char> &OS;
 
   /// See raw_ostream::write_impl.
@@ -686,7 +688,7 @@
 };
 
 /// A raw_ostream that discards all output.
-class raw_null_ostream : public raw_pwrite_stream {
+class LLVM_SUPPORT_ABI raw_null_ostream : public raw_pwrite_stream {
   /// See raw_ostream::write_impl.
   void write_impl(const char *Ptr, size_t size) override;
   void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) override;
@@ -700,7 +702,7 @@
   ~raw_null_ostream() override;
 };
 
-class buffer_ostream : public raw_svector_ostream {
+class LLVM_SUPPORT_ABI buffer_ostream : public raw_svector_ostream {
   raw_ostream &OS;
   SmallVector<char, 0> Buffer;
 
@@ -711,7 +713,7 @@
   ~buffer_ostream() override { OS << str(); }
 };
 
-class buffer_unique_ostream : public raw_svector_ostream {
+class LLVM_SUPPORT_ABI buffer_unique_ostream : public raw_svector_ostream {
   std::unique_ptr<raw_ostream> OS;
   SmallVector<char, 0> Buffer;
 
@@ -731,7 +733,7 @@
 /// for other names. For raw_fd_ostream instances, the stream writes to
 /// a temporary file. The final output file is atomically replaced with the
 /// temporary file after the \p Write function is finished.
-Error writeToOutput(StringRef OutputFileName,
+LLVM_SUPPORT_ABI Error writeToOutput(StringRef OutputFileName,
                     std::function<Error(raw_ostream &)> Write);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/Support/thread.h b/llvm/include/llvm/Support/thread.h
--- a/llvm/include/llvm/Support/thread.h
+++ b/llvm/include/llvm/Support/thread.h
@@ -18,6 +18,7 @@
 
 #include "llvm/ADT/Optional.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 #ifdef _WIN32
 typedef unsigned long DWORD;
@@ -35,7 +36,7 @@
 
 /// LLVM thread following std::thread interface with added constructor to
 /// specify stack size.
-class thread {
+class LLVM_SUPPORT_ABI thread {
   template <typename FPtr, typename... Args, size_t... Indices>
   static void Apply(std::tuple<FPtr, Args...> &Callee,
                     std::index_sequence<Indices...>) {
@@ -118,11 +119,14 @@
   native_handle_type Thread;
 };
 
-thread::native_handle_type
+LLVM_SUPPORT_ABI thread::native_handle_type
 llvm_execute_on_thread_impl(thread::start_routine_type ThreadFunc, void *Arg,
                             llvm::Optional<unsigned> StackSizeInBytes);
-void llvm_thread_join_impl(thread::native_handle_type Thread);
-void llvm_thread_detach_impl(thread::native_handle_type Thread);
+
+LLVM_SUPPORT_ABI void llvm_thread_join_impl(thread::native_handle_type Thread);
+
+LLVM_SUPPORT_ABI void llvm_thread_detach_impl(thread::native_handle_type Thread);
+
 thread::id llvm_thread_get_id_impl(thread::native_handle_type Thread);
 thread::id llvm_thread_get_current_id_impl();
 
diff --git a/llvm/include/llvm/Support/xxhash.h b/llvm/include/llvm/Support/xxhash.h
--- a/llvm/include/llvm/Support/xxhash.h
+++ b/llvm/include/llvm/Support/xxhash.h
@@ -40,10 +40,11 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/LLVMSupportExports.h"
 
 namespace llvm {
-uint64_t xxHash64(llvm::StringRef Data);
-uint64_t xxHash64(llvm::ArrayRef<uint8_t> Data);
+LLVM_SUPPORT_ABI uint64_t xxHash64(llvm::StringRef Data);
+LLVM_SUPPORT_ABI uint64_t xxHash64(llvm::ArrayRef<uint8_t> Data);
 }
 
 #endif
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -101,7 +101,7 @@
   endif()
 endif()
 
-add_llvm_component_library(LLVMSupport
+add_llvm_component_library(LLVMSupport SHARED
   AArch64TargetParser.cpp
   ABIBreak.cpp
   ARMTargetParser.cpp
@@ -281,7 +281,12 @@
   set(llvm_system_libs ${llvm_system_libs} "${terminfo_library}")
 endif()
 
-set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${llvm_system_libs}")
+set_target_properties(LLVMSupport PROPERTIES
+  LLVM_SYSTEM_LIBS "${llvm_system_libs}"
+  DEFINE_SYMBOL "LLVMSupport_EXPORTS"
+  C_VISIBILITY_PRESET hidden
+  CXX_VISIBILITY_PRESET hidden
+  VISIBILITY_INLINES_HIDDEN YES)
 
 
 if(LLVM_INTEGRATED_CRT_ALLOC)
diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -49,7 +49,7 @@
 #endif
 
 namespace llvm {
-pthread_t
+LLVM_SUPPORT_ABI pthread_t
 llvm_execute_on_thread_impl(void *(*ThreadFunc)(void *), void *Arg,
                             llvm::Optional<unsigned> StackSizeInBytes) {
   int errnum;
@@ -81,6 +81,7 @@
   return Thread;
 }
 
+LLVM_SUPPORT_ABI
 void llvm_thread_detach_impl(pthread_t Thread) {
   int errnum;
 
@@ -89,6 +90,7 @@
   }
 }
 
+LLVM_SUPPORT_ABI
 void llvm_thread_join_impl(pthread_t Thread) {
   int errnum;
 
diff --git a/llvm/lib/Support/Windows/Threading.inc b/llvm/lib/Support/Windows/Threading.inc
--- a/llvm/lib/Support/Windows/Threading.inc
+++ b/llvm/lib/Support/Windows/Threading.inc
@@ -24,7 +24,7 @@
 #endif
 
 namespace llvm {
-HANDLE
+LLVM_SUPPORT_ABI HANDLE
 llvm_execute_on_thread_impl(unsigned(__stdcall *ThreadFunc)(void *), void *Arg,
                             llvm::Optional<unsigned> StackSizeInBytes) {
   HANDLE hThread = (HANDLE)::_beginthreadex(
@@ -37,12 +37,14 @@
   return hThread;
 }
 
+LLVM_SUPPORT_ABI
 void llvm_thread_join_impl(HANDLE hThread) {
   if (::WaitForSingleObject(hThread, INFINITE) == WAIT_FAILED) {
     ReportLastErrorFatal("WaitForSingleObject failed");
   }
 }
 
+LLVM_SUPPORT_ABI
 void llvm_thread_detach_impl(HANDLE hThread) {
   if (::CloseHandle(hThread) == FALSE) {
     ReportLastErrorFatal("CloseHandle failed");