[clang] LLVM ABI Annotations (PR #67502)

Tom Stellard via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 29 19:48:12 PDT 2023


https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/67502

>From 825afc151053eccf533454fe271406d99a9392ff Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 7 Jul 2023 01:58:17 +0000
Subject: [PATCH 01/39] APFloat: Add some missing function declarations

Theses functions were added in fd1e5aa8dffa8b26e59fb340668b264b9ac80382
without a declaration.

Differential Revision: https://reviews.llvm.org/D154765
---
 llvm/include/llvm/ADT/APFloat.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index 64caa5a76545673..3961a001b8810ca 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -753,6 +753,8 @@ class DoubleAPFloat final : public APFloatBase {
 };
 
 hash_code hash_value(const DoubleAPFloat &Arg);
+DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp, IEEEFloat::roundingMode RM);
+DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, IEEEFloat::roundingMode);
 
 } // End detail namespace
 

>From c691dd6a2a4b2096e453343888ecb5b69d985255 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Thu, 13 Jul 2023 16:45:56 +0000
Subject: [PATCH 02/39] [profiling] Move option declarations into headers

This will make it possible to add visibility attributes to these
variables.  This also fixes some type mismatches between the
declaration and the definition.

Differential Revision: https://reviews.llvm.org/D156599
---
 clang/lib/CodeGen/BackendUtil.cpp                      |  3 +--
 llvm/include/llvm/ProfileData/ProfileCommon.h          |  8 ++++++++
 llvm/include/llvm/Transforms/IPO/SampleProfile.h       |  8 ++++++++
 .../Transforms/Instrumentation/PGOInstrumentation.h    |  3 +++
 llvm/lib/Analysis/ProfileSummaryInfo.cpp               | 10 ----------
 llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp |  1 +
 .../Transforms/Instrumentation/PGOInstrumentation.cpp  |  1 -
 llvm/tools/llvm-profgen/CSPreInliner.cpp               |  8 +-------
 8 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 1b0c249f4408999..72223803d59e314 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -69,6 +69,7 @@
 #include "llvm/Transforms/Instrumentation/KCFI.h"
 #include "llvm/Transforms/Instrumentation/MemProfiler.h"
 #include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
+#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h"
 #include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
 #include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
@@ -89,8 +90,6 @@ using namespace llvm;
 #include "llvm/Support/Extension.def"
 
 namespace llvm {
-extern cl::opt<bool> DebugInfoCorrelate;
-
 // Experiment to move sanitizers earlier.
 static cl::opt<bool> ClSanitizeOnOptimizerEarlyEP(
     "sanitizer-early-opt-ep", cl::Optional,
diff --git a/llvm/include/llvm/ProfileData/ProfileCommon.h b/llvm/include/llvm/ProfileData/ProfileCommon.h
index 4fe92cef4d72605..eaab59484c947a7 100644
--- a/llvm/include/llvm/ProfileData/ProfileCommon.h
+++ b/llvm/include/llvm/ProfileData/ProfileCommon.h
@@ -28,6 +28,14 @@
 
 namespace llvm {
 
+extern cl::opt<bool> UseContextLessSummary;
+extern cl::opt<int> ProfileSummaryCutoffHot;
+extern cl::opt<int> ProfileSummaryCutoffCold;
+extern cl::opt<unsigned> ProfileSummaryHugeWorkingSetSizeThreshold;
+extern cl::opt<unsigned> ProfileSummaryLargeWorkingSetSizeThreshold;
+extern cl::opt<uint64_t> ProfileSummaryHotCount;
+extern cl::opt<uint64_t> ProfileSummaryColdCount;
+
 namespace sampleprof {
 
 class FunctionSamples;
diff --git a/llvm/include/llvm/Transforms/IPO/SampleProfile.h b/llvm/include/llvm/Transforms/IPO/SampleProfile.h
index 2ef55949e236556..e94f6ba55cd0dd4 100644
--- a/llvm/include/llvm/Transforms/IPO/SampleProfile.h
+++ b/llvm/include/llvm/Transforms/IPO/SampleProfile.h
@@ -17,12 +17,20 @@
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/CommandLine.h"
 #include <string>
 
 namespace llvm {
 
 class Module;
 
+extern cl::opt<int> SampleHotCallSiteThreshold;
+extern cl::opt<int> SampleColdCallSiteThreshold;
+extern cl::opt<int> ProfileInlineGrowthLimit;
+extern cl::opt<int> ProfileInlineLimitMin;
+extern cl::opt<int> ProfileInlineLimitMax;
+extern cl::opt<bool> SortProfiledSCC;
+
 namespace vfs {
 class FileSystem;
 } // namespace vfs
diff --git a/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h b/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
index 952bc2f8edbe347..b497c0cc53afb26 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
@@ -18,11 +18,14 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/CommandLine.h"
 #include <cstdint>
 #include <string>
 
 namespace llvm {
 
+extern cl::opt<bool> DebugInfoCorrelate;
+
 class Function;
 class Instruction;
 class Module;
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
index 203f1e42733f3dc..fdad14571dfe4f4 100644
--- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp
+++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
@@ -23,16 +23,6 @@
 #include <optional>
 using namespace llvm;
 
-// Knobs for profile summary based thresholds.
-namespace llvm {
-extern cl::opt<int> ProfileSummaryCutoffHot;
-extern cl::opt<int> ProfileSummaryCutoffCold;
-extern cl::opt<unsigned> ProfileSummaryHugeWorkingSetSizeThreshold;
-extern cl::opt<unsigned> ProfileSummaryLargeWorkingSetSizeThreshold;
-extern cl::opt<int> ProfileSummaryHotCount;
-extern cl::opt<int> ProfileSummaryColdCount;
-} // namespace llvm
-
 static cl::opt<bool> PartialProfile(
     "partial-profile", cl::Hidden, cl::init(false),
     cl::desc("Specify the current profile is used as a partial profile."));
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index a7b1953ce81c1eb..f78bd73aa642812 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -47,6 +47,7 @@
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/TargetParser/Triple.h"
+#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Utils/ModuleUtils.h"
 #include "llvm/Transforms/Utils/SSAUpdater.h"
 #include <algorithm>
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index 82cabbd28a7aaa1..ba162839877897e 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -327,7 +327,6 @@ extern cl::opt<PGOViewCountsType> PGOViewCounts;
 // Defined in Analysis/BlockFrequencyInfo.cpp:  -view-bfi-func-name=
 extern cl::opt<std::string> ViewBlockFreqFuncName;
 
-extern cl::opt<bool> DebugInfoCorrelate;
 } // namespace llvm
 
 static cl::opt<bool>
diff --git a/llvm/tools/llvm-profgen/CSPreInliner.cpp b/llvm/tools/llvm-profgen/CSPreInliner.cpp
index ae0fd6d0b069298..c0ea22ca4c773c2 100644
--- a/llvm/tools/llvm-profgen/CSPreInliner.cpp
+++ b/llvm/tools/llvm-profgen/CSPreInliner.cpp
@@ -11,6 +11,7 @@
 #include "llvm/ADT/SCCIterator.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
+#include "llvm/Transforms/IPO/SampleProfile.h"
 #include <cstdint>
 #include <queue>
 
@@ -35,13 +36,6 @@ STATISTIC(
 // TODO: the actual threshold to be tuned here because the size here is based
 // on machine code not LLVM IR.
 namespace llvm {
-extern cl::opt<int> SampleHotCallSiteThreshold;
-extern cl::opt<int> SampleColdCallSiteThreshold;
-extern cl::opt<int> ProfileInlineGrowthLimit;
-extern cl::opt<int> ProfileInlineLimitMin;
-extern cl::opt<int> ProfileInlineLimitMax;
-extern cl::opt<bool> SortProfiledSCC;
-
 cl::opt<bool> EnableCSPreInliner(
     "csspgo-preinliner", cl::Hidden, cl::init(true),
     cl::desc("Run a global pre-inliner to merge context profile based on "

>From 0224e43b58f1ecbadf1d9764fe63e2e8ec6ac3eb Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 21 Jul 2023 21:16:10 +0000
Subject: [PATCH 03/39] PassBuilder: Move PrintPiplinePasses declaration to
 header

This will make it possible to add visibility attributes to this
variable.
---
 llvm/include/llvm/Passes/PassBuilder.h | 3 +++
 llvm/tools/opt/NewPMDriver.cpp         | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/llvm/include/llvm/Passes/PassBuilder.h b/llvm/include/llvm/Passes/PassBuilder.h
index fdb407263787f69..b95fd41554bf283 100644
--- a/llvm/include/llvm/Passes/PassBuilder.h
+++ b/llvm/include/llvm/Passes/PassBuilder.h
@@ -28,6 +28,9 @@
 #include <vector>
 
 namespace llvm {
+
+extern cl::opt<bool> PrintPipelinePasses;
+
 class StringRef;
 class AAManager;
 class TargetMachine;
diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp
index 6ae3f87099afd64..5ceea38c933eca3 100644
--- a/llvm/tools/opt/NewPMDriver.cpp
+++ b/llvm/tools/opt/NewPMDriver.cpp
@@ -214,10 +214,6 @@ static cl::opt<bool> DisableLoopUnrolling(
     "disable-loop-unrolling",
     cl::desc("Disable loop unrolling in all relevant passes"), cl::init(false));
 
-namespace llvm {
-extern cl::opt<bool> PrintPipelinePasses;
-} // namespace llvm
-
 template <typename PassManagerT>
 bool tryParsePipelineText(PassBuilder &PB,
                           const cl::opt<std::string> &PipelineOpt) {

>From f2fa98e68c7fc6fa712d16f78eab512328078994 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 21 Jul 2023 21:42:33 +0000
Subject: [PATCH 04/39] XXX: CMake changes

---
 llvm/cmake/modules/AddLLVM.cmake | 17 ++++++++++++++++-
 llvm/lib/Target/CMakeLists.txt   | 11 -----------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 230620c37027a1e..49850e8bdde43a0 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -591,7 +591,22 @@ function(llvm_add_library name)
   endif()
 
   if(ARG_COMPONENT_LIB)
-    set_target_properties(${name} PROPERTIES LLVM_COMPONENT TRUE)
+    set_target_properties(${name} PROPERTIES
+	                  LLVM_COMPONENT TRUE
+			  DEFINE_SYMBOL "LLVM_ABI_EXPORTS")
+
+    # When building shared objects for each target there are some internal APIs
+    # that are used across shared objects which we can't hide.
+    if (NOT BUILD_SHARED_LIBS AND NOT APPLE AND
+        (NOT (WIN32 OR CYGWIN) OR (MINGW AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND
+        NOT (${CMAKE_SYSTEM_NAME} MATCHES "AIX") AND
+        NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
+
+      set_target_properties(${name} PROPERTIES
+                            C_VISIBILITY_PRESET hidden
+                            CXX_VISIBILITY_PRESET hidden
+                            VISIBILITY_INLINES_HIDDEN YES)
+    endif()
     set_property(GLOBAL APPEND PROPERTY LLVM_COMPONENT_LIBS ${name})
   endif()
 
diff --git a/llvm/lib/Target/CMakeLists.txt b/llvm/lib/Target/CMakeLists.txt
index 2739233f9ccb3d6..2a0edbe058984b7 100644
--- a/llvm/lib/Target/CMakeLists.txt
+++ b/llvm/lib/Target/CMakeLists.txt
@@ -20,17 +20,6 @@ add_llvm_component_library(LLVMTarget
   TargetParser
   )
 
-# When building shared objects for each target there are some internal APIs
-# that are used across shared objects which we can't hide.
-if (NOT BUILD_SHARED_LIBS AND NOT APPLE AND
-    (NOT (WIN32 OR CYGWIN) OR (MINGW AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND
-    NOT (${CMAKE_SYSTEM_NAME} MATCHES "AIX") AND
-    NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
-  # Set default visibility to hidden, so we don't export all the Target classes
-  # in libLLVM.so.
-  set(CMAKE_CXX_VISIBILITY_PRESET hidden)
-endif()
-
 foreach(t ${LLVM_TARGETS_TO_BUILD})
   message(STATUS "Targeting ${t}")
   add_subdirectory(${t})

>From 5200de97f31326556d902fd4d425db856894237a Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 11 Jul 2023 13:32:19 +0000
Subject: [PATCH 05/39] Add headers

---
 llvm/include/llvm-c/Analysis.h                                 | 1 +
 llvm/include/llvm-c/BitReader.h                                | 1 +
 llvm/include/llvm-c/BitWriter.h                                | 1 +
 llvm/include/llvm-c/Comdat.h                                   | 1 +
 llvm/include/llvm-c/Core.h                                     | 1 +
 llvm/include/llvm-c/DebugInfo.h                                | 1 +
 llvm/include/llvm-c/Disassembler.h                             | 1 +
 llvm/include/llvm-c/DisassemblerTypes.h                        | 1 +
 llvm/include/llvm-c/ExecutionEngine.h                          | 1 +
 llvm/include/llvm-c/IRReader.h                                 | 1 +
 llvm/include/llvm-c/LLJIT.h                                    | 1 +
 llvm/include/llvm-c/Linker.h                                   | 1 +
 llvm/include/llvm-c/Object.h                                   | 1 +
 llvm/include/llvm-c/Orc.h                                      | 1 +
 llvm/include/llvm-c/OrcEE.h                                    | 1 +
 llvm/include/llvm-c/Remarks.h                                  | 1 +
 llvm/include/llvm-c/Support.h                                  | 1 +
 llvm/include/llvm-c/Target.h                                   | 1 +
 llvm/include/llvm-c/TargetMachine.h                            | 1 +
 llvm/include/llvm-c/Transforms/PassBuilder.h                   | 1 +
 llvm/include/llvm-c/blake3.h                                   | 1 +
 llvm/include/llvm-c/lto.h                                      | 1 +
 llvm/include/llvm/ADT/APFixedPoint.h                           | 1 +
 llvm/include/llvm/ADT/APFloat.h                                | 1 +
 llvm/include/llvm/ADT/APSInt.h                                 | 1 +
 llvm/include/llvm/ADT/AddressRanges.h                          | 1 +
 llvm/include/llvm/ADT/AllocatorList.h                          | 1 +
 llvm/include/llvm/ADT/BitVector.h                              | 1 +
 llvm/include/llvm/ADT/Bitfields.h                              | 1 +
 llvm/include/llvm/ADT/BitmaskEnum.h                            | 1 +
 llvm/include/llvm/ADT/BreadthFirstIterator.h                   | 1 +
 llvm/include/llvm/ADT/CachedHashString.h                       | 1 +
 llvm/include/llvm/ADT/CoalescingBitVector.h                    | 1 +
 llvm/include/llvm/ADT/ConcurrentHashtable.h                    | 1 +
 llvm/include/llvm/ADT/DenseSet.h                               | 1 +
 llvm/include/llvm/ADT/DepthFirstIterator.h                     | 1 +
 llvm/include/llvm/ADT/DirectedGraph.h                          | 1 +
 llvm/include/llvm/ADT/EnumeratedArray.h                        | 1 +
 llvm/include/llvm/ADT/EpochTracker.h                           | 1 +
 llvm/include/llvm/ADT/EquivalenceClasses.h                     | 1 +
 llvm/include/llvm/ADT/FloatingPointMode.h                      | 1 +
 llvm/include/llvm/ADT/FoldingSet.h                             | 1 +
 llvm/include/llvm/ADT/FunctionExtras.h                         | 1 +
 llvm/include/llvm/ADT/GenericCycleImpl.h                       | 1 +
 llvm/include/llvm/ADT/GenericCycleInfo.h                       | 1 +
 llvm/include/llvm/ADT/GenericSSAContext.h                      | 1 +
 llvm/include/llvm/ADT/GenericUniformityImpl.h                  | 1 +
 llvm/include/llvm/ADT/GenericUniformityInfo.h                  | 1 +
 llvm/include/llvm/ADT/GraphTraits.h                            | 1 +
 llvm/include/llvm/ADT/Hashing.h                                | 1 +
 llvm/include/llvm/ADT/IndexedMap.h                             | 1 +
 llvm/include/llvm/ADT/IntEqClasses.h                           | 1 +
 llvm/include/llvm/ADT/IntervalMap.h                            | 1 +
 llvm/include/llvm/ADT/IntervalTree.h                           | 1 +
 llvm/include/llvm/ADT/MapVector.h                              | 1 +
 llvm/include/llvm/ADT/PointerEmbeddedInt.h                     | 1 +
 llvm/include/llvm/ADT/PointerSumType.h                         | 1 +
 llvm/include/llvm/ADT/PointerUnion.h                           | 1 +
 llvm/include/llvm/ADT/PostOrderIterator.h                      | 1 +
 llvm/include/llvm/ADT/PriorityQueue.h                          | 1 +
 llvm/include/llvm/ADT/SCCIterator.h                            | 1 +
 llvm/include/llvm/ADT/STLExtras.h                              | 1 +
 llvm/include/llvm/ADT/ScopedHashTable.h                        | 1 +
 llvm/include/llvm/ADT/Sequence.h                               | 1 +
 llvm/include/llvm/ADT/SmallBitVector.h                         | 1 +
 llvm/include/llvm/ADT/SmallString.h                            | 1 +
 llvm/include/llvm/ADT/SparseBitVector.h                        | 1 +
 llvm/include/llvm/ADT/SparseMultiSet.h                         | 1 +
 llvm/include/llvm/ADT/SparseSet.h                              | 1 +
 llvm/include/llvm/ADT/StringExtras.h                           | 1 +
 llvm/include/llvm/ADT/StringMap.h                              | 1 +
 llvm/include/llvm/ADT/StringMapEntry.h                         | 1 +
 llvm/include/llvm/ADT/StringSet.h                              | 1 +
 llvm/include/llvm/ADT/TinyPtrVector.h                          | 1 +
 llvm/include/llvm/ADT/Twine.h                                  | 1 +
 llvm/include/llvm/ADT/UniqueVector.h                           | 1 +
 llvm/include/llvm/ADT/fallible_iterator.h                      | 1 +
 llvm/include/llvm/ADT/ilist.h                                  | 1 +
 llvm/include/llvm/ADT/ilist_base.h                             | 1 +
 llvm/include/llvm/ADT/ilist_iterator.h                         | 1 +
 llvm/include/llvm/ADT/ilist_node.h                             | 1 +
 llvm/include/llvm/ADT/ilist_node_base.h                        | 1 +
 llvm/include/llvm/ADT/ilist_node_options.h                     | 1 +
 llvm/include/llvm/ADT/iterator.h                               | 1 +
 llvm/include/llvm/Analysis/AliasAnalysis.h                     | 1 +
 llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h            | 1 +
 llvm/include/llvm/Analysis/AliasSetTracker.h                   | 1 +
 llvm/include/llvm/Analysis/AssumeBundleQueries.h               | 1 +
 llvm/include/llvm/Analysis/AssumptionCache.h                   | 1 +
 llvm/include/llvm/Analysis/BasicAliasAnalysis.h                | 1 +
 llvm/include/llvm/Analysis/BlockFrequencyInfo.h                | 1 +
 llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h            | 1 +
 llvm/include/llvm/Analysis/BranchProbabilityInfo.h             | 1 +
 llvm/include/llvm/Analysis/CFG.h                               | 1 +
 llvm/include/llvm/Analysis/CFGPrinter.h                        | 1 +
 llvm/include/llvm/Analysis/CFGSCCPrinter.h                     | 1 +
 llvm/include/llvm/Analysis/CGSCCPassManager.h                  | 1 +
 llvm/include/llvm/Analysis/CallGraph.h                         | 1 +
 llvm/include/llvm/Analysis/CallGraphSCCPass.h                  | 1 +
 llvm/include/llvm/Analysis/CallPrinter.h                       | 1 +
 llvm/include/llvm/Analysis/CaptureTracking.h                   | 1 +
 llvm/include/llvm/Analysis/CmpInstAnalysis.h                   | 1 +
 llvm/include/llvm/Analysis/CodeMetrics.h                       | 1 +
 llvm/include/llvm/Analysis/ConstantFolding.h                   | 1 +
 llvm/include/llvm/Analysis/ConstraintSystem.h                  | 1 +
 llvm/include/llvm/Analysis/CostModel.h                         | 1 +
 llvm/include/llvm/Analysis/CycleAnalysis.h                     | 1 +
 llvm/include/llvm/Analysis/DDG.h                               | 1 +
 llvm/include/llvm/Analysis/DDGPrinter.h                        | 1 +
 llvm/include/llvm/Analysis/DOTGraphTraitsPass.h                | 1 +
 llvm/include/llvm/Analysis/Delinearization.h                   | 1 +
 llvm/include/llvm/Analysis/DemandedBits.h                      | 1 +
 llvm/include/llvm/Analysis/DependenceAnalysis.h                | 1 +
 llvm/include/llvm/Analysis/DependenceGraphBuilder.h            | 1 +
 llvm/include/llvm/Analysis/DomPrinter.h                        | 1 +
 llvm/include/llvm/Analysis/DominanceFrontier.h                 | 1 +
 llvm/include/llvm/Analysis/DominanceFrontierImpl.h             | 1 +
 llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h        | 1 +
 llvm/include/llvm/Analysis/GlobalsModRef.h                     | 1 +
 llvm/include/llvm/Analysis/GuardUtils.h                        | 2 ++
 llvm/include/llvm/Analysis/HeatUtils.h                         | 1 +
 llvm/include/llvm/Analysis/IRSimilarityIdentifier.h            | 1 +
 llvm/include/llvm/Analysis/IVDescriptors.h                     | 1 +
 llvm/include/llvm/Analysis/IVUsers.h                           | 1 +
 llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h     | 1 +
 llvm/include/llvm/Analysis/IndirectCallVisitor.h               | 1 +
 llvm/include/llvm/Analysis/InlineAdvisor.h                     | 1 +
 llvm/include/llvm/Analysis/InlineCost.h                        | 1 +
 llvm/include/llvm/Analysis/InlineOrder.h                       | 1 +
 llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h       | 1 +
 llvm/include/llvm/Analysis/InstCount.h                         | 1 +
 llvm/include/llvm/Analysis/InstSimplifyFolder.h                | 1 +
 llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h     | 1 +
 llvm/include/llvm/Analysis/InstructionSimplify.h               | 1 +
 llvm/include/llvm/Analysis/InteractiveModelRunner.h            | 1 +
 llvm/include/llvm/Analysis/Interval.h                          | 1 +
 llvm/include/llvm/Analysis/IntervalIterator.h                  | 1 +
 llvm/include/llvm/Analysis/IntervalPartition.h                 | 1 +
 llvm/include/llvm/Analysis/IteratedDominanceFrontier.h         | 1 +
 llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h            | 1 +
 llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h         | 1 +
 llvm/include/llvm/Analysis/LazyCallGraph.h                     | 1 +
 llvm/include/llvm/Analysis/LazyValueInfo.h                     | 1 +
 llvm/include/llvm/Analysis/Lint.h                              | 1 +
 llvm/include/llvm/Analysis/Loads.h                             | 1 +
 llvm/include/llvm/Analysis/LoopAccessAnalysis.h                | 1 +
 llvm/include/llvm/Analysis/LoopAnalysisManager.h               | 1 +
 llvm/include/llvm/Analysis/LoopCacheAnalysis.h                 | 1 +
 llvm/include/llvm/Analysis/LoopInfo.h                          | 1 +
 llvm/include/llvm/Analysis/LoopIterator.h                      | 1 +
 llvm/include/llvm/Analysis/LoopNestAnalysis.h                  | 1 +
 llvm/include/llvm/Analysis/LoopPass.h                          | 1 +
 llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h                | 1 +
 llvm/include/llvm/Analysis/MLInlineAdvisor.h                   | 1 +
 llvm/include/llvm/Analysis/MLModelRunner.h                     | 1 +
 llvm/include/llvm/Analysis/MemDerefPrinter.h                   | 1 +
 llvm/include/llvm/Analysis/MemoryBuiltins.h                    | 1 +
 llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h          | 1 +
 llvm/include/llvm/Analysis/MemoryLocation.h                    | 1 +
 llvm/include/llvm/Analysis/MemoryProfileInfo.h                 | 1 +
 llvm/include/llvm/Analysis/MemorySSA.h                         | 1 +
 llvm/include/llvm/Analysis/MemorySSAUpdater.h                  | 1 +
 llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h            | 1 +
 llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h             | 1 +
 llvm/include/llvm/Analysis/MustExecute.h                       | 1 +
 llvm/include/llvm/Analysis/NoInferenceModelRunner.h            | 1 +
 llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h              | 1 +
 llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h              | 1 +
 llvm/include/llvm/Analysis/ObjCARCInstKind.h                   | 1 +
 llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h         | 1 +
 llvm/include/llvm/Analysis/OverflowInstAnalysis.h              | 2 ++
 llvm/include/llvm/Analysis/PHITransAddr.h                      | 1 +
 llvm/include/llvm/Analysis/Passes.h                            | 2 ++
 llvm/include/llvm/Analysis/PhiValues.h                         | 1 +
 llvm/include/llvm/Analysis/PostDominators.h                    | 1 +
 llvm/include/llvm/Analysis/ProfileSummaryInfo.h                | 1 +
 llvm/include/llvm/Analysis/PtrUseVisitor.h                     | 1 +
 llvm/include/llvm/Analysis/RegionInfo.h                        | 1 +
 llvm/include/llvm/Analysis/RegionIterator.h                    | 1 +
 llvm/include/llvm/Analysis/RegionPass.h                        | 1 +
 llvm/include/llvm/Analysis/RegionPrinter.h                     | 1 +
 llvm/include/llvm/Analysis/ReleaseModeModelRunner.h            | 1 +
 llvm/include/llvm/Analysis/ReplayInlineAdvisor.h               | 1 +
 llvm/include/llvm/Analysis/ScalarEvolution.h                   | 1 +
 llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h      | 1 +
 llvm/include/llvm/Analysis/ScalarEvolutionDivision.h           | 1 +
 llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h        | 1 +
 llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h      | 1 +
 llvm/include/llvm/Analysis/ScopedNoAliasAA.h                   | 1 +
 llvm/include/llvm/Analysis/SparsePropagation.h                 | 1 +
 llvm/include/llvm/Analysis/StackLifetime.h                     | 1 +
 llvm/include/llvm/Analysis/StackSafetyAnalysis.h               | 1 +
 llvm/include/llvm/Analysis/SyntheticCountsUtils.h              | 1 +
 llvm/include/llvm/Analysis/TargetFolder.h                      | 1 +
 llvm/include/llvm/Analysis/TargetLibraryInfo.h                 | 1 +
 llvm/include/llvm/Analysis/TargetTransformInfo.h               | 1 +
 llvm/include/llvm/Analysis/TargetTransformInfoImpl.h           | 1 +
 llvm/include/llvm/Analysis/TensorSpec.h                        | 1 +
 llvm/include/llvm/Analysis/Trace.h                             | 1 +
 llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h            | 1 +
 llvm/include/llvm/Analysis/TypeMetadataUtils.h                 | 1 +
 llvm/include/llvm/Analysis/UniformityAnalysis.h                | 1 +
 .../llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h  | 1 +
 llvm/include/llvm/Analysis/Utils/Local.h                       | 2 ++
 llvm/include/llvm/Analysis/Utils/TrainingLogger.h              | 1 +
 llvm/include/llvm/Analysis/ValueLattice.h                      | 1 +
 llvm/include/llvm/Analysis/ValueLatticeUtils.h                 | 2 ++
 llvm/include/llvm/Analysis/ValueTracking.h                     | 1 +
 llvm/include/llvm/Analysis/VectorUtils.h                       | 1 +
 llvm/include/llvm/AsmParser/LLLexer.h                          | 1 +
 llvm/include/llvm/AsmParser/LLParser.h                         | 1 +
 llvm/include/llvm/AsmParser/Parser.h                           | 1 +
 llvm/include/llvm/AsmParser/SlotMapping.h                      | 1 +
 llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h        | 1 +
 llvm/include/llvm/BinaryFormat/COFF.h                          | 1 +
 llvm/include/llvm/BinaryFormat/DXContainer.h                   | 1 +
 llvm/include/llvm/BinaryFormat/ELF.h                           | 1 +
 llvm/include/llvm/BinaryFormat/Magic.h                         | 1 +
 llvm/include/llvm/BinaryFormat/Minidump.h                      | 1 +
 llvm/include/llvm/BinaryFormat/MsgPackDocument.h               | 1 +
 llvm/include/llvm/BinaryFormat/MsgPackReader.h                 | 1 +
 llvm/include/llvm/BinaryFormat/MsgPackWriter.h                 | 1 +
 llvm/include/llvm/BinaryFormat/Wasm.h                          | 1 +
 llvm/include/llvm/BinaryFormat/WasmTraits.h                    | 1 +
 llvm/include/llvm/BinaryFormat/XCOFF.h                         | 1 +
 llvm/include/llvm/Bitcode/BitcodeAnalyzer.h                    | 1 +
 llvm/include/llvm/Bitcode/BitcodeCommon.h                      | 1 +
 llvm/include/llvm/Bitcode/BitcodeReader.h                      | 1 +
 llvm/include/llvm/Bitcode/BitcodeWriter.h                      | 1 +
 llvm/include/llvm/Bitcode/BitcodeWriterPass.h                  | 1 +
 llvm/include/llvm/Bitstream/BitCodes.h                         | 1 +
 llvm/include/llvm/Bitstream/BitstreamReader.h                  | 1 +
 llvm/include/llvm/Bitstream/BitstreamWriter.h                  | 1 +
 llvm/include/llvm/CodeGen/AccelTable.h                         | 1 +
 llvm/include/llvm/CodeGen/Analysis.h                           | 1 +
 llvm/include/llvm/CodeGen/AsmPrinter.h                         | 1 +
 llvm/include/llvm/CodeGen/AsmPrinterHandler.h                  | 1 +
 llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h         | 1 +
 llvm/include/llvm/CodeGen/AtomicExpandUtils.h                  | 1 +
 llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h             | 1 +
 llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h    | 1 +
 llvm/include/llvm/CodeGen/BasicTTIImpl.h                       | 1 +
 llvm/include/llvm/CodeGen/ByteProvider.h                       | 1 +
 llvm/include/llvm/CodeGen/CFIFixup.h                           | 1 +
 llvm/include/llvm/CodeGen/CSEConfigBase.h                      | 2 ++
 llvm/include/llvm/CodeGen/CalcSpillWeights.h                   | 1 +
 llvm/include/llvm/CodeGen/CallingConvLower.h                   | 1 +
 llvm/include/llvm/CodeGen/CodeGenCommonISel.h                  | 1 +
 llvm/include/llvm/CodeGen/CodeGenPassBuilder.h                 | 1 +
 llvm/include/llvm/CodeGen/CommandFlags.h                       | 1 +
 llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h          | 1 +
 llvm/include/llvm/CodeGen/CostTable.h                          | 1 +
 llvm/include/llvm/CodeGen/DFAPacketizer.h                      | 1 +
 llvm/include/llvm/CodeGen/DIE.h                                | 1 +
 llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h         | 1 +
 llvm/include/llvm/CodeGen/DebugHandlerBase.h                   | 1 +
 llvm/include/llvm/CodeGen/DetectDeadLanes.h                    | 1 +
 llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h               | 1 +
 llvm/include/llvm/CodeGen/EdgeBundles.h                        | 1 +
 llvm/include/llvm/CodeGen/ExecutionDomainFix.h                 | 1 +
 llvm/include/llvm/CodeGen/ExpandReductions.h                   | 1 +
 llvm/include/llvm/CodeGen/ExpandVectorPredication.h            | 1 +
 llvm/include/llvm/CodeGen/FastISel.h                           | 1 +
 llvm/include/llvm/CodeGen/FaultMaps.h                          | 1 +
 llvm/include/llvm/CodeGen/FunctionLoweringInfo.h               | 1 +
 llvm/include/llvm/CodeGen/GCMetadata.h                         | 1 +
 llvm/include/llvm/CodeGen/GCMetadataPrinter.h                  | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h                 | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h           | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h            | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/Combiner.h                | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h          | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h            | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h     | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h          | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h           | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h    | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h            | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h       | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h       | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h     | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h     | 1 +
 .../llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h     | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h               | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h         | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h           | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h            | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/Localizer.h               | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h    | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h          | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h        | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h           | 1 +
 llvm/include/llvm/CodeGen/GlobalISel/Utils.h                   | 1 +
 llvm/include/llvm/CodeGen/HardwareLoops.h                      | 1 +
 llvm/include/llvm/CodeGen/ISDOpcodes.h                         | 1 +
 llvm/include/llvm/CodeGen/IndirectThunks.h                     | 1 +
 llvm/include/llvm/CodeGen/IntrinsicLowering.h                  | 2 ++
 llvm/include/llvm/CodeGen/LatencyPriorityQueue.h               | 1 +
 llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h      | 1 +
 llvm/include/llvm/CodeGen/LexicalScopes.h                      | 1 +
 llvm/include/llvm/CodeGen/LiveInterval.h                       | 1 +
 llvm/include/llvm/CodeGen/LiveIntervalCalc.h                   | 1 +
 llvm/include/llvm/CodeGen/LiveIntervalUnion.h                  | 1 +
 llvm/include/llvm/CodeGen/LivePhysRegs.h                       | 1 +
 llvm/include/llvm/CodeGen/LiveRangeCalc.h                      | 1 +
 llvm/include/llvm/CodeGen/LiveRangeEdit.h                      | 1 +
 llvm/include/llvm/CodeGen/LiveRegMatrix.h                      | 1 +
 llvm/include/llvm/CodeGen/LiveRegUnits.h                       | 1 +
 llvm/include/llvm/CodeGen/LiveStacks.h                         | 1 +
 llvm/include/llvm/CodeGen/LiveVariables.h                      | 1 +
 llvm/include/llvm/CodeGen/LoopTraversal.h                      | 1 +
 llvm/include/llvm/CodeGen/LowLevelType.h                       | 1 +
 llvm/include/llvm/CodeGen/LowLevelTypeUtils.h                  | 1 +
 llvm/include/llvm/CodeGen/MBFIWrapper.h                        | 1 +
 llvm/include/llvm/CodeGen/MIRFSDiscriminator.h                 | 1 +
 llvm/include/llvm/CodeGen/MIRFormatter.h                       | 1 +
 llvm/include/llvm/CodeGen/MIRParser/MIParser.h                 | 1 +
 llvm/include/llvm/CodeGen/MIRParser/MIRParser.h                | 1 +
 llvm/include/llvm/CodeGen/MIRPrinter.h                         | 2 ++
 llvm/include/llvm/CodeGen/MIRSampleProfile.h                   | 1 +
 llvm/include/llvm/CodeGen/MIRYamlMapping.h                     | 1 +
 llvm/include/llvm/CodeGen/MachineBasicBlock.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h          | 1 +
 llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h       | 1 +
 llvm/include/llvm/CodeGen/MachineCFGPrinter.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineConstantPool.h                | 1 +
 llvm/include/llvm/CodeGen/MachineCycleAnalysis.h               | 1 +
 llvm/include/llvm/CodeGen/MachineDominanceFrontier.h           | 1 +
 llvm/include/llvm/CodeGen/MachineDominators.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineFrameInfo.h                   | 1 +
 llvm/include/llvm/CodeGen/MachineFunctionPass.h                | 1 +
 llvm/include/llvm/CodeGen/MachineInstr.h                       | 1 +
 llvm/include/llvm/CodeGen/MachineInstrBuilder.h                | 1 +
 llvm/include/llvm/CodeGen/MachineInstrBundle.h                 | 1 +
 llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h         | 1 +
 llvm/include/llvm/CodeGen/MachineJumpTableInfo.h               | 1 +
 llvm/include/llvm/CodeGen/MachineLoopInfo.h                    | 1 +
 llvm/include/llvm/CodeGen/MachineLoopUtils.h                   | 2 ++
 llvm/include/llvm/CodeGen/MachineMemOperand.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineModuleInfo.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h             | 1 +
 llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h           | 1 +
 llvm/include/llvm/CodeGen/MachineOperand.h                     | 1 +
 llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h   | 1 +
 llvm/include/llvm/CodeGen/MachineOutliner.h                    | 1 +
 llvm/include/llvm/CodeGen/MachinePassManager.h                 | 1 +
 llvm/include/llvm/CodeGen/MachinePassRegistry.h                | 1 +
 llvm/include/llvm/CodeGen/MachinePipeliner.h                   | 1 +
 llvm/include/llvm/CodeGen/MachinePostDominators.h              | 1 +
 llvm/include/llvm/CodeGen/MachineRegionInfo.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineRegisterInfo.h                | 1 +
 llvm/include/llvm/CodeGen/MachineSSAContext.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineSSAUpdater.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineScheduler.h                   | 1 +
 llvm/include/llvm/CodeGen/MachineSizeOpts.h                    | 1 +
 llvm/include/llvm/CodeGen/MachineStableHash.h                  | 1 +
 llvm/include/llvm/CodeGen/MachineTraceMetrics.h                | 1 +
 llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h          | 1 +
 llvm/include/llvm/CodeGen/MachineValueType.h                   | 1 +
 llvm/include/llvm/CodeGen/MacroFusion.h                        | 1 +
 llvm/include/llvm/CodeGen/ModuloSchedule.h                     | 1 +
 llvm/include/llvm/CodeGen/MultiHazardRecognizer.h              | 1 +
 llvm/include/llvm/CodeGen/NonRelocatableStringpool.h           | 1 +
 llvm/include/llvm/CodeGen/PBQP/CostAllocator.h                 | 1 +
 llvm/include/llvm/CodeGen/PBQP/Graph.h                         | 1 +
 llvm/include/llvm/CodeGen/PBQP/Math.h                          | 1 +
 llvm/include/llvm/CodeGen/PBQP/Solution.h                      | 1 +
 llvm/include/llvm/CodeGen/PBQPRAConstraint.h                   | 1 +
 llvm/include/llvm/CodeGen/ParallelCG.h                         | 1 +
 llvm/include/llvm/CodeGen/Passes.h                             | 1 +
 llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h           | 1 +
 llvm/include/llvm/CodeGen/PseudoSourceValue.h                  | 1 +
 llvm/include/llvm/CodeGen/RDFGraph.h                           | 1 +
 llvm/include/llvm/CodeGen/RDFLiveness.h                        | 1 +
 llvm/include/llvm/CodeGen/RDFRegisters.h                       | 1 +
 llvm/include/llvm/CodeGen/ReachingDefAnalysis.h                | 1 +
 llvm/include/llvm/CodeGen/RegAllocPBQP.h                       | 1 +
 llvm/include/llvm/CodeGen/RegAllocRegistry.h                   | 1 +
 llvm/include/llvm/CodeGen/Register.h                           | 1 +
 llvm/include/llvm/CodeGen/RegisterBank.h                       | 1 +
 llvm/include/llvm/CodeGen/RegisterBankInfo.h                   | 1 +
 llvm/include/llvm/CodeGen/RegisterClassInfo.h                  | 1 +
 llvm/include/llvm/CodeGen/RegisterPressure.h                   | 1 +
 llvm/include/llvm/CodeGen/RegisterScavenging.h                 | 1 +
 llvm/include/llvm/CodeGen/RegisterUsageInfo.h                  | 1 +
 llvm/include/llvm/CodeGen/ReplaceWithVeclib.h                  | 1 +
 llvm/include/llvm/CodeGen/ResourcePriorityQueue.h              | 1 +
 llvm/include/llvm/CodeGen/RuntimeLibcalls.h                    | 1 +
 llvm/include/llvm/CodeGen/ScheduleDAG.h                        | 1 +
 llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h                  | 1 +
 llvm/include/llvm/CodeGen/ScheduleDAGMutation.h                | 2 ++
 llvm/include/llvm/CodeGen/ScheduleDFS.h                        | 1 +
 llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h           | 2 ++
 llvm/include/llvm/CodeGen/SchedulerRegistry.h                  | 1 +
 llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h         | 1 +
 llvm/include/llvm/CodeGen/SelectionDAG.h                       | 1 +
 llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h        | 1 +
 llvm/include/llvm/CodeGen/SelectionDAGISel.h                   | 1 +
 llvm/include/llvm/CodeGen/SelectionDAGNodes.h                  | 1 +
 llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h             | 1 +
 llvm/include/llvm/CodeGen/SlotIndexes.h                        | 1 +
 llvm/include/llvm/CodeGen/Spiller.h                            | 2 ++
 llvm/include/llvm/CodeGen/StackMaps.h                          | 1 +
 llvm/include/llvm/CodeGen/StackProtector.h                     | 1 +
 llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h            | 1 +
 llvm/include/llvm/CodeGen/SwitchLoweringUtils.h                | 1 +
 llvm/include/llvm/CodeGen/TailDuplicator.h                     | 1 +
 llvm/include/llvm/CodeGen/TargetCallingConv.h                  | 1 +
 llvm/include/llvm/CodeGen/TargetFrameLowering.h                | 1 +
 llvm/include/llvm/CodeGen/TargetInstrInfo.h                    | 1 +
 llvm/include/llvm/CodeGen/TargetLowering.h                     | 1 +
 llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h       | 1 +
 llvm/include/llvm/CodeGen/TargetPassConfig.h                   | 1 +
 llvm/include/llvm/CodeGen/TargetRegisterInfo.h                 | 1 +
 llvm/include/llvm/CodeGen/TargetSchedule.h                     | 1 +
 llvm/include/llvm/CodeGen/TargetSubtargetInfo.h                | 1 +
 llvm/include/llvm/CodeGen/TileShapeInfo.h                      | 1 +
 llvm/include/llvm/CodeGen/TypePromotion.h                      | 1 +
 llvm/include/llvm/CodeGen/UnreachableBlockElim.h               | 1 +
 llvm/include/llvm/CodeGen/VLIWMachineScheduler.h               | 1 +
 llvm/include/llvm/CodeGen/VirtRegMap.h                         | 1 +
 llvm/include/llvm/CodeGen/WasmEHFuncInfo.h                     | 1 +
 llvm/include/llvm/CodeGen/WinEHFuncInfo.h                      | 1 +
 llvm/include/llvm/DWARFLinker/DWARFLinker.h                    | 1 +
 llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h         | 1 +
 llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h         | 1 +
 llvm/include/llvm/DWARFLinker/DWARFStreamer.h                  | 1 +
 llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h           | 1 +
 llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h              | 1 +
 llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h            | 1 +
 llvm/include/llvm/DWARFLinkerParallel/StringPool.h             | 1 +
 llvm/include/llvm/DWARFLinkerParallel/StringTable.h            | 1 +
 llvm/include/llvm/DWP/DWP.h                                    | 1 +
 llvm/include/llvm/DWP/DWPError.h                               | 1 +
 llvm/include/llvm/DWP/DWPStringPool.h                          | 1 +
 .../llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h        | 1 +
 llvm/include/llvm/DebugInfo/CodeView/CVRecord.h                | 1 +
 llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h         | 1 +
 llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h           | 1 +
 llvm/include/llvm/DebugInfo/CodeView/CodeView.h                | 1 +
 llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h           | 1 +
 llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h        | 1 +
 .../llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h        | 1 +
 .../include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h | 1 +
 llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h  | 1 +
 llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h | 1 +
 .../include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h | 1 +
 .../llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h      | 1 +
 llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h    | 1 +
 .../llvm/DebugInfo/CodeView/DebugStringTableSubsection.h       | 1 +
 llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h         | 1 +
 llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h   | 1 +
 llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h  | 1 +
 .../include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h | 1 +
 llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h  | 1 +
 llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h  | 1 +
 llvm/include/llvm/DebugInfo/CodeView/EnumTables.h              | 1 +
 llvm/include/llvm/DebugInfo/CodeView/Formatters.h              | 1 +
 llvm/include/llvm/DebugInfo/CodeView/GUID.h                    | 1 +
 llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h  | 1 +
 .../include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h | 1 +
 llvm/include/llvm/DebugInfo/CodeView/Line.h                    | 1 +
 llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h | 1 +
 llvm/include/llvm/DebugInfo/CodeView/RecordName.h              | 1 +
 llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h     | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h    | 1 +
 llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h     | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h      | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h      | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h            | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h            | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h     | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h     | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h        | 1 +
 .../llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h    | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h  | 1 +
 llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h   | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h          | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h        | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h         | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h             | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h               | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h      | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h              | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h       | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h       | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h        | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h     | 1 +
 .../llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h      | 1 +
 llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h    | 1 +
 llvm/include/llvm/DebugInfo/DIContext.h                        | 1 +
 .../llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h        | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h      | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h          | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h             | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h           | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h               | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h         | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h           | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h             | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h        | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h          | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h            | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h        | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h             | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h              | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h            | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h         | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h        | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h         | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h                   | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h            | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h             | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h              | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h             | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h    | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h                | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h              | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h               | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h           | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h              | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h                  | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h             | 1 +
 llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h              | 1 +
 llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h            | 1 +
 llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h               | 1 +
 llvm/include/llvm/DebugInfo/GSYM/FileEntry.h                   | 1 +
 llvm/include/llvm/DebugInfo/GSYM/FileWriter.h                  | 1 +
 llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h                | 1 +
 llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h                 | 1 +
 llvm/include/llvm/DebugInfo/GSYM/GsymReader.h                  | 1 +
 llvm/include/llvm/DebugInfo/GSYM/Header.h                      | 1 +
 llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h                  | 1 +
 llvm/include/llvm/DebugInfo/GSYM/LineEntry.h                   | 1 +
 llvm/include/llvm/DebugInfo/GSYM/LineTable.h                   | 1 +
 llvm/include/llvm/DebugInfo/GSYM/LookupResult.h                | 1 +
 llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h       | 1 +
 llvm/include/llvm/DebugInfo/GSYM/StringTable.h                 | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h       | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h       | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h          | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h      | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h        | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h       | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h         | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h        | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h         | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h          | 2 ++
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h    | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h       | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h        | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h          | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h      | 1 +
 .../llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h        | 1 +
 .../llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h      | 1 +
 .../llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h     | 1 +
 llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h  | 1 +
 llvm/include/llvm/DebugInfo/MSF/IMSFFile.h                     | 1 +
 llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h                   | 1 +
 llvm/include/llvm/DebugInfo/MSF/MSFCommon.h                    | 1 +
 llvm/include/llvm/DebugInfo/MSF/MSFError.h                     | 1 +
 llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h            | 1 +
 llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h                 | 1 +
 llvm/include/llvm/DebugInfo/PDB/GenericError.h                 | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h               | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h             | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h                | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h           | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h               | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h                | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h           | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBSession.h                  | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h               | 1 +
 llvm/include/llvm/DebugInfo/PDB/IPDBTable.h                    | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h   | 1 +
 .../llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h             | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h      | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h            | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h            | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h      | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/Hash.h                  | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h             | 1 +
 .../include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h | 2 ++
 llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h            | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h  | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h             | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h           | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h        | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h     | 1 +
 .../llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h      | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h       | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h       | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h  | 1 +
 .../include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h      | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h    | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h       | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h      | 1 +
 .../include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h       | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h        | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h               | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h        | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h        | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/RawError.h              | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h              | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h           | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h          | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h            | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h             | 1 +
 llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h      | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDB.h                          | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBContext.h                   | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBExtras.h                    | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h                 | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h                    | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h          | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h               | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h           | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h    | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h        | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h              | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h                | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h                 | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h                | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h        | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h      | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h               | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h        | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h               | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h           | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h       | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h          | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h       | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h            | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h          | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h         | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h             | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h          | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h     | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h             | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h      | 1 +
 llvm/include/llvm/DebugInfo/PDB/PDBTypes.h                     | 1 +
 llvm/include/llvm/DebugInfo/PDB/UDTLayout.h                    | 1 +
 llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h              | 1 +
 llvm/include/llvm/DebugInfo/Symbolize/Markup.h                 | 1 +
 llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h           | 1 +
 llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h     | 1 +
 llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h | 1 +
 llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h              | 1 +
 llvm/include/llvm/Debuginfod/BuildIDFetcher.h                  | 1 +
 llvm/include/llvm/Debuginfod/Debuginfod.h                      | 1 +
 llvm/include/llvm/Debuginfod/HTTPClient.h                      | 1 +
 llvm/include/llvm/Debuginfod/HTTPServer.h                      | 1 +
 llvm/include/llvm/Demangle/ItaniumDemangle.h                   | 1 +
 llvm/include/llvm/Demangle/MicrosoftDemangle.h                 | 1 +
 llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h            | 1 +
 llvm/include/llvm/Demangle/Utility.h                           | 1 +
 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h            | 1 +
 llvm/include/llvm/ExecutionEngine/GenericValue.h               | 1 +
 llvm/include/llvm/ExecutionEngine/JITEventListener.h           | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/COFF.h               | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h        | 1 +
 .../llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h  | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h     | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ELF.h                | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h        | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h        | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h           | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h      | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h          | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h          | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h         | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h            | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h       | 1 +
 .../llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h        | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/MachO.h              | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h        | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h       | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h       | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h            | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h            | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/i386.h               | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h          | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h              | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/riscv.h              | 1 +
 llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h             | 1 +
 llvm/include/llvm/ExecutionEngine/JITSymbol.h                  | 1 +
 llvm/include/llvm/ExecutionEngine/MCJIT.h                      | 1 +
 llvm/include/llvm/ExecutionEngine/ObjectCache.h                | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h           | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h   | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h   | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h           | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/Core.h                   | 1 +
 .../llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h        | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h             | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h  | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h         | 1 +
 .../include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h | 1 +
 .../ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h     | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h    | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h | 1 +
 .../llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h  | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h | 1 +
 .../llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h   | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h    | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h         | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h         | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h       | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h       | 1 +
 .../include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h                  | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/Layer.h                  | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h          | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h   | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h          | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/Mangling.h               | 1 +
 .../llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h      | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h           | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h    | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h     | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h   | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h          | 1 +
 .../llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h        | 1 +
 .../llvm/ExecutionEngine/Orc/Shared/AllocationActions.h        | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h | 1 +
 .../llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h        | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h     | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h   | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h        | 1 +
 .../ExecutionEngine/Orc/Shared/SimplePackedSerialization.h     | 1 +
 .../llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h     | 1 +
 .../ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h     | 1 +
 .../llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h     | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h        | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h      | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/Speculation.h            | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h       | 1 +
 .../Orc/TargetProcess/ExecutorBootstrapService.h               | 1 +
 .../Orc/TargetProcess/ExecutorSharedMemoryMapperService.h      | 1 +
 .../llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h      | 1 +
 .../llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h  | 1 +
 .../Orc/TargetProcess/SimpleExecutorDylibManager.h             | 1 +
 .../Orc/TargetProcess/SimpleExecutorMemoryManager.h            | 1 +
 .../ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h  | 1 +
 .../ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h   | 1 +
 llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h           | 1 +
 llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h        | 1 +
 llvm/include/llvm/ExecutionEngine/RuntimeDyld.h                | 1 +
 llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h         | 1 +
 llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h       | 1 +
 llvm/include/llvm/FileCheck/FileCheck.h                        | 1 +
 llvm/include/llvm/Frontend/HLSL/HLSLResource.h                 | 1 +
 llvm/include/llvm/Frontend/OpenMP/OMPContext.h                 | 1 +
 llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h               | 1 +
 llvm/include/llvm/FuzzMutate/FuzzerCLI.h                       | 1 +
 llvm/include/llvm/FuzzMutate/IRMutator.h                       | 1 +
 llvm/include/llvm/FuzzMutate/OpDescriptor.h                    | 1 +
 llvm/include/llvm/FuzzMutate/Operations.h                      | 1 +
 llvm/include/llvm/FuzzMutate/Random.h                          | 1 +
 llvm/include/llvm/FuzzMutate/RandomIRBuilder.h                 | 1 +
 llvm/include/llvm/IR/AbstractCallSite.h                        | 1 +
 llvm/include/llvm/IR/Argument.h                                | 1 +
 llvm/include/llvm/IR/AssemblyAnnotationWriter.h                | 2 ++
 llvm/include/llvm/IR/Assumptions.h                             | 1 +
 llvm/include/llvm/IR/AttributeMask.h                           | 1 +
 llvm/include/llvm/IR/Attributes.h                              | 1 +
 llvm/include/llvm/IR/AutoUpgrade.h                             | 1 +
 llvm/include/llvm/IR/BasicBlock.h                              | 1 +
 llvm/include/llvm/IR/BuiltinGCs.h                              | 2 ++
 llvm/include/llvm/IR/CFG.h                                     | 1 +
 llvm/include/llvm/IR/Comdat.h                                  | 1 +
 llvm/include/llvm/IR/Constant.h                                | 1 +
 llvm/include/llvm/IR/ConstantFold.h                            | 1 +
 llvm/include/llvm/IR/ConstantFolder.h                          | 1 +
 llvm/include/llvm/IR/DIBuilder.h                               | 1 +
 llvm/include/llvm/IR/DebugInfo.h                               | 1 +
 llvm/include/llvm/IR/DebugInfoMetadata.h                       | 1 +
 llvm/include/llvm/IR/DebugLoc.h                                | 1 +
 llvm/include/llvm/IR/DerivedUser.h                             | 1 +
 llvm/include/llvm/IR/DiagnosticHandler.h                       | 1 +
 llvm/include/llvm/IR/DiagnosticInfo.h                          | 1 +
 llvm/include/llvm/IR/DiagnosticPrinter.h                       | 1 +
 llvm/include/llvm/IR/Dominators.h                              | 1 +
 llvm/include/llvm/IR/EHPersonalities.h                         | 1 +
 llvm/include/llvm/IR/FMF.h                                     | 2 ++
 llvm/include/llvm/IR/FPEnv.h                                   | 1 +
 llvm/include/llvm/IR/Function.h                                | 1 +
 llvm/include/llvm/IR/GCStrategy.h                              | 1 +
 llvm/include/llvm/IR/GVMaterializer.h                          | 1 +
 llvm/include/llvm/IR/GetElementPtrTypeIterator.h               | 1 +
 llvm/include/llvm/IR/GlobalAlias.h                             | 1 +
 llvm/include/llvm/IR/GlobalIFunc.h                             | 1 +
 llvm/include/llvm/IR/GlobalObject.h                            | 1 +
 llvm/include/llvm/IR/GlobalValue.h                             | 1 +
 llvm/include/llvm/IR/GlobalVariable.h                          | 1 +
 llvm/include/llvm/IR/IRBuilder.h                               | 1 +
 llvm/include/llvm/IR/IRBuilderFolder.h                         | 1 +
 llvm/include/llvm/IR/IRPrintingPasses.h                        | 1 +
 llvm/include/llvm/IR/InlineAsm.h                               | 1 +
 llvm/include/llvm/IR/InstIterator.h                            | 1 +
 llvm/include/llvm/IR/InstVisitor.h                             | 1 +
 llvm/include/llvm/IR/InstrTypes.h                              | 1 +
 llvm/include/llvm/IR/Instruction.h                             | 1 +
 llvm/include/llvm/IR/Instructions.h                            | 1 +
 llvm/include/llvm/IR/IntrinsicInst.h                           | 1 +
 llvm/include/llvm/IR/Intrinsics.h                              | 1 +
 llvm/include/llvm/IR/LLVMContext.h                             | 1 +
 llvm/include/llvm/IR/LLVMRemarkStreamer.h                      | 1 +
 llvm/include/llvm/IR/LegacyPassManager.h                       | 1 +
 llvm/include/llvm/IR/LegacyPassManagers.h                      | 1 +
 llvm/include/llvm/IR/LegacyPassNameParser.h                    | 1 +
 llvm/include/llvm/IR/MDBuilder.h                               | 1 +
 llvm/include/llvm/IR/Mangler.h                                 | 1 +
 llvm/include/llvm/IR/MatrixBuilder.h                           | 1 +
 llvm/include/llvm/IR/Metadata.h                                | 1 +
 llvm/include/llvm/IR/Module.h                                  | 1 +
 llvm/include/llvm/IR/ModuleSlotTracker.h                       | 1 +
 llvm/include/llvm/IR/ModuleSummaryIndex.h                      | 1 +
 llvm/include/llvm/IR/ModuleSummaryIndexYAML.h                  | 1 +
 llvm/include/llvm/IR/NoFolder.h                                | 1 +
 llvm/include/llvm/IR/OperandTraits.h                           | 1 +
 llvm/include/llvm/IR/Operator.h                                | 1 +
 llvm/include/llvm/IR/OptBisect.h                               | 1 +
 llvm/include/llvm/IR/PassInstrumentation.h                     | 1 +
 llvm/include/llvm/IR/PassManager.h                             | 1 +
 llvm/include/llvm/IR/PassManagerInternal.h                     | 1 +
 llvm/include/llvm/IR/PassTimingInfo.h                          | 1 +
 llvm/include/llvm/IR/PatternMatch.h                            | 1 +
 llvm/include/llvm/IR/PredIteratorCache.h                       | 1 +
 llvm/include/llvm/IR/PrintPasses.h                             | 1 +
 llvm/include/llvm/IR/ProfDataUtils.h                           | 1 +
 llvm/include/llvm/IR/ProfileSummary.h                          | 1 +
 llvm/include/llvm/IR/PseudoProbe.h                             | 1 +
 llvm/include/llvm/IR/ReplaceConstant.h                         | 1 +
 llvm/include/llvm/IR/SSAContext.h                              | 1 +
 llvm/include/llvm/IR/SafepointIRVerifier.h                     | 1 +
 llvm/include/llvm/IR/Statepoint.h                              | 1 +
 llvm/include/llvm/IR/StructuralHash.h                          | 1 +
 llvm/include/llvm/IR/SymbolTableListTraits.h                   | 1 +
 llvm/include/llvm/IR/TrackingMDRef.h                           | 1 +
 llvm/include/llvm/IR/TypeFinder.h                              | 1 +
 llvm/include/llvm/IR/TypedPointerType.h                        | 1 +
 llvm/include/llvm/IR/UseListOrder.h                            | 1 +
 llvm/include/llvm/IR/Value.h                                   | 1 +
 llvm/include/llvm/IR/ValueHandle.h                             | 1 +
 llvm/include/llvm/IR/ValueMap.h                                | 1 +
 llvm/include/llvm/IR/ValueSymbolTable.h                        | 1 +
 llvm/include/llvm/IR/VectorBuilder.h                           | 1 +
 llvm/include/llvm/IR/Verifier.h                                | 1 +
 llvm/include/llvm/IRPrinter/IRPrintingPasses.h                 | 1 +
 llvm/include/llvm/IRReader/IRReader.h                          | 1 +
 llvm/include/llvm/InitializePasses.h                           | 2 ++
 llvm/include/llvm/InterfaceStub/ELFObjHandler.h                | 1 +
 llvm/include/llvm/InterfaceStub/IFSHandler.h                   | 1 +
 llvm/include/llvm/InterfaceStub/IFSStub.h                      | 1 +
 llvm/include/llvm/LTO/Config.h                                 | 1 +
 llvm/include/llvm/LTO/LTO.h                                    | 1 +
 llvm/include/llvm/LTO/LTOBackend.h                             | 1 +
 llvm/include/llvm/LTO/SummaryBasedOptimizations.h              | 3 +++
 llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h                | 1 +
 llvm/include/llvm/LTO/legacy/LTOModule.h                       | 1 +
 llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h            | 1 +
 llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h              | 1 +
 llvm/include/llvm/Linker/IRMover.h                             | 1 +
 llvm/include/llvm/Linker/Linker.h                              | 1 +
 llvm/include/llvm/MC/ConstantPools.h                           | 1 +
 llvm/include/llvm/MC/DXContainerPSVInfo.h                      | 1 +
 llvm/include/llvm/MC/MCAsmBackend.h                            | 1 +
 llvm/include/llvm/MC/MCAsmInfo.h                               | 1 +
 llvm/include/llvm/MC/MCAsmInfoCOFF.h                           | 1 +
 llvm/include/llvm/MC/MCAsmInfoDarwin.h                         | 1 +
 llvm/include/llvm/MC/MCAsmInfoELF.h                            | 1 +
 llvm/include/llvm/MC/MCAsmInfoGOFF.h                           | 1 +
 llvm/include/llvm/MC/MCAsmInfoWasm.h                           | 1 +
 llvm/include/llvm/MC/MCAsmInfoXCOFF.h                          | 1 +
 llvm/include/llvm/MC/MCAsmLayout.h                             | 1 +
 llvm/include/llvm/MC/MCAsmMacro.h                              | 1 +
 llvm/include/llvm/MC/MCAssembler.h                             | 1 +
 llvm/include/llvm/MC/MCCodeEmitter.h                           | 2 ++
 llvm/include/llvm/MC/MCCodeView.h                              | 1 +
 llvm/include/llvm/MC/MCDXContainerStreamer.h                   | 1 +
 llvm/include/llvm/MC/MCDXContainerWriter.h                     | 1 +
 llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h           | 1 +
 llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h     | 1 +
 llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h         | 2 ++
 llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h             | 1 +
 llvm/include/llvm/MC/MCDwarf.h                                 | 1 +
 llvm/include/llvm/MC/MCELFObjectWriter.h                       | 1 +
 llvm/include/llvm/MC/MCELFStreamer.h                           | 1 +
 llvm/include/llvm/MC/MCExpr.h                                  | 1 +
 llvm/include/llvm/MC/MCFixup.h                                 | 1 +
 llvm/include/llvm/MC/MCFixupKindInfo.h                         | 2 ++
 llvm/include/llvm/MC/MCFragment.h                              | 1 +
 llvm/include/llvm/MC/MCInst.h                                  | 1 +
 llvm/include/llvm/MC/MCInstBuilder.h                           | 1 +
 llvm/include/llvm/MC/MCInstPrinter.h                           | 1 +
 llvm/include/llvm/MC/MCInstrAnalysis.h                         | 1 +
 llvm/include/llvm/MC/MCInstrDesc.h                             | 1 +
 llvm/include/llvm/MC/MCInstrInfo.h                             | 1 +
 llvm/include/llvm/MC/MCInstrItineraries.h                      | 1 +
 llvm/include/llvm/MC/MCLabel.h                                 | 2 ++
 llvm/include/llvm/MC/MCLinkerOptimizationHint.h                | 1 +
 llvm/include/llvm/MC/MCMachObjectWriter.h                      | 1 +
 llvm/include/llvm/MC/MCObjectFileInfo.h                        | 1 +
 llvm/include/llvm/MC/MCObjectStreamer.h                        | 1 +
 llvm/include/llvm/MC/MCObjectWriter.h                          | 1 +
 llvm/include/llvm/MC/MCParser/AsmCond.h                        | 2 ++
 llvm/include/llvm/MC/MCParser/AsmLexer.h                       | 1 +
 llvm/include/llvm/MC/MCParser/MCAsmLexer.h                     | 1 +
 llvm/include/llvm/MC/MCParser/MCAsmParser.h                    | 1 +
 llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h           | 1 +
 llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h               | 2 ++
 llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h             | 1 +
 llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h              | 1 +
 llvm/include/llvm/MC/MCPseudoProbe.h                           | 1 +
 llvm/include/llvm/MC/MCRegister.h                              | 1 +
 llvm/include/llvm/MC/MCRegisterInfo.h                          | 1 +
 llvm/include/llvm/MC/MCSPIRVObjectWriter.h                     | 1 +
 llvm/include/llvm/MC/MCSPIRVStreamer.h                         | 1 +
 llvm/include/llvm/MC/MCSchedule.h                              | 1 +
 llvm/include/llvm/MC/MCSection.h                               | 1 +
 llvm/include/llvm/MC/MCSectionCOFF.h                           | 1 +
 llvm/include/llvm/MC/MCSectionDXContainer.h                    | 1 +
 llvm/include/llvm/MC/MCSectionELF.h                            | 1 +
 llvm/include/llvm/MC/MCSectionGOFF.h                           | 1 +
 llvm/include/llvm/MC/MCSectionMachO.h                          | 1 +
 llvm/include/llvm/MC/MCSectionSPIRV.h                          | 1 +
 llvm/include/llvm/MC/MCSectionWasm.h                           | 1 +
 llvm/include/llvm/MC/MCSectionXCOFF.h                          | 1 +
 llvm/include/llvm/MC/MCStreamer.h                              | 1 +
 llvm/include/llvm/MC/MCSubtargetInfo.h                         | 1 +
 llvm/include/llvm/MC/MCSymbol.h                                | 1 +
 llvm/include/llvm/MC/MCSymbolCOFF.h                            | 1 +
 llvm/include/llvm/MC/MCSymbolELF.h                             | 1 +
 llvm/include/llvm/MC/MCSymbolGOFF.h                            | 1 +
 llvm/include/llvm/MC/MCSymbolMachO.h                           | 1 +
 llvm/include/llvm/MC/MCSymbolWasm.h                            | 1 +
 llvm/include/llvm/MC/MCSymbolXCOFF.h                           | 1 +
 llvm/include/llvm/MC/MCTargetOptions.h                         | 1 +
 llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h             | 1 +
 llvm/include/llvm/MC/MCValue.h                                 | 1 +
 llvm/include/llvm/MC/MCWasmObjectWriter.h                      | 1 +
 llvm/include/llvm/MC/MCWasmStreamer.h                          | 1 +
 llvm/include/llvm/MC/MCWin64EH.h                               | 1 +
 llvm/include/llvm/MC/MCWinCOFFObjectWriter.h                   | 1 +
 llvm/include/llvm/MC/MCWinCOFFStreamer.h                       | 1 +
 llvm/include/llvm/MC/MCWinEH.h                                 | 1 +
 llvm/include/llvm/MC/MCXCOFFObjectWriter.h                     | 1 +
 llvm/include/llvm/MC/MCXCOFFStreamer.h                         | 1 +
 llvm/include/llvm/MC/MachineLocation.h                         | 1 +
 llvm/include/llvm/MC/SectionKind.h                             | 2 ++
 llvm/include/llvm/MC/StringTableBuilder.h                      | 1 +
 llvm/include/llvm/MC/TargetRegistry.h                          | 1 +
 llvm/include/llvm/MCA/CodeEmitter.h                            | 1 +
 llvm/include/llvm/MCA/Context.h                                | 1 +
 llvm/include/llvm/MCA/CustomBehaviour.h                        | 1 +
 llvm/include/llvm/MCA/HWEventListener.h                        | 1 +
 llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h             | 2 ++
 llvm/include/llvm/MCA/HardwareUnits/LSUnit.h                   | 1 +
 llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h             | 1 +
 llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h          | 1 +
 llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h        | 1 +
 llvm/include/llvm/MCA/HardwareUnits/Scheduler.h                | 1 +
 llvm/include/llvm/MCA/IncrementalSourceMgr.h                   | 1 +
 llvm/include/llvm/MCA/InstrBuilder.h                           | 1 +
 llvm/include/llvm/MCA/Instruction.h                            | 1 +
 llvm/include/llvm/MCA/Pipeline.h                               | 1 +
 llvm/include/llvm/MCA/SourceMgr.h                              | 1 +
 llvm/include/llvm/MCA/Stages/DispatchStage.h                   | 1 +
 llvm/include/llvm/MCA/Stages/EntryStage.h                      | 1 +
 llvm/include/llvm/MCA/Stages/ExecuteStage.h                    | 1 +
 llvm/include/llvm/MCA/Stages/InOrderIssueStage.h               | 1 +
 llvm/include/llvm/MCA/Stages/InstructionTables.h               | 1 +
 llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h               | 1 +
 llvm/include/llvm/MCA/Stages/RetireStage.h                     | 1 +
 llvm/include/llvm/MCA/Stages/Stage.h                           | 1 +
 llvm/include/llvm/MCA/Support.h                                | 1 +
 llvm/include/llvm/MCA/View.h                                   | 1 +
 llvm/include/llvm/ObjCopy/COFF/COFFConfig.h                    | 1 +
 llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h                   | 2 ++
 llvm/include/llvm/ObjCopy/CommonConfig.h                       | 1 +
 llvm/include/llvm/ObjCopy/ConfigManager.h                      | 1 +
 llvm/include/llvm/ObjCopy/ELF/ELFConfig.h                      | 1 +
 llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h                     | 2 ++
 llvm/include/llvm/ObjCopy/MachO/MachOConfig.h                  | 1 +
 llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h                 | 2 ++
 llvm/include/llvm/ObjCopy/MultiFormatConfig.h                  | 1 +
 llvm/include/llvm/ObjCopy/ObjCopy.h                            | 1 +
 llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h                  | 2 ++
 llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h                 | 2 ++
 llvm/include/llvm/ObjCopy/wasm/WasmConfig.h                    | 2 ++
 llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h                   | 2 ++
 llvm/include/llvm/Object/Archive.h                             | 1 +
 llvm/include/llvm/Object/ArchiveWriter.h                       | 1 +
 llvm/include/llvm/Object/Binary.h                              | 1 +
 llvm/include/llvm/Object/BuildID.h                             | 1 +
 llvm/include/llvm/Object/COFF.h                                | 1 +
 llvm/include/llvm/Object/COFFImportFile.h                      | 1 +
 llvm/include/llvm/Object/COFFModuleDefinition.h                | 1 +
 llvm/include/llvm/Object/CVDebugRecord.h                       | 1 +
 llvm/include/llvm/Object/DXContainer.h                         | 1 +
 llvm/include/llvm/Object/Decompressor.h                        | 1 +
 llvm/include/llvm/Object/ELF.h                                 | 1 +
 llvm/include/llvm/Object/ELFObjectFile.h                       | 1 +
 llvm/include/llvm/Object/ELFTypes.h                            | 1 +
 llvm/include/llvm/Object/Error.h                               | 1 +
 llvm/include/llvm/Object/FaultMapParser.h                      | 1 +
 llvm/include/llvm/Object/GOFF.h                                | 1 +
 llvm/include/llvm/Object/GOFFObjectFile.h                      | 1 +
 llvm/include/llvm/Object/IRObjectFile.h                        | 1 +
 llvm/include/llvm/Object/IRSymtab.h                            | 1 +
 llvm/include/llvm/Object/MachO.h                               | 1 +
 llvm/include/llvm/Object/MachOUniversal.h                      | 1 +
 llvm/include/llvm/Object/MachOUniversalWriter.h                | 1 +
 llvm/include/llvm/Object/Minidump.h                            | 1 +
 llvm/include/llvm/Object/ModuleSymbolTable.h                   | 1 +
 llvm/include/llvm/Object/ObjectFile.h                          | 1 +
 llvm/include/llvm/Object/OffloadBinary.h                       | 1 +
 llvm/include/llvm/Object/RelocationResolver.h                  | 1 +
 llvm/include/llvm/Object/SymbolSize.h                          | 1 +
 llvm/include/llvm/Object/SymbolicFile.h                        | 1 +
 llvm/include/llvm/Object/TapiFile.h                            | 1 +
 llvm/include/llvm/Object/TapiUniversal.h                       | 1 +
 llvm/include/llvm/Object/Wasm.h                                | 1 +
 llvm/include/llvm/Object/WindowsMachineFlag.h                  | 2 ++
 llvm/include/llvm/Object/WindowsResource.h                     | 1 +
 llvm/include/llvm/Object/XCOFFObjectFile.h                     | 1 +
 llvm/include/llvm/ObjectYAML/ArchiveYAML.h                     | 1 +
 llvm/include/llvm/ObjectYAML/COFFYAML.h                        | 1 +
 llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h       | 1 +
 llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h             | 1 +
 llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h         | 1 +
 llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h               | 1 +
 llvm/include/llvm/ObjectYAML/DWARFEmitter.h                    | 1 +
 llvm/include/llvm/ObjectYAML/DWARFYAML.h                       | 1 +
 llvm/include/llvm/ObjectYAML/DXContainerYAML.h                 | 1 +
 llvm/include/llvm/ObjectYAML/ELFYAML.h                         | 1 +
 llvm/include/llvm/ObjectYAML/MachOYAML.h                       | 1 +
 llvm/include/llvm/ObjectYAML/MinidumpYAML.h                    | 1 +
 llvm/include/llvm/ObjectYAML/ObjectYAML.h                      | 1 +
 llvm/include/llvm/ObjectYAML/OffloadYAML.h                     | 1 +
 llvm/include/llvm/ObjectYAML/WasmYAML.h                        | 1 +
 llvm/include/llvm/ObjectYAML/XCOFFYAML.h                       | 1 +
 llvm/include/llvm/ObjectYAML/YAML.h                            | 1 +
 llvm/include/llvm/ObjectYAML/yaml2obj.h                        | 1 +
 llvm/include/llvm/Option/Arg.h                                 | 1 +
 llvm/include/llvm/Option/ArgList.h                             | 1 +
 llvm/include/llvm/Option/OptSpecifier.h                        | 2 ++
 llvm/include/llvm/Option/OptTable.h                            | 1 +
 llvm/include/llvm/Option/Option.h                              | 1 +
 llvm/include/llvm/Pass.h                                       | 1 +
 llvm/include/llvm/PassAnalysisSupport.h                        | 1 +
 llvm/include/llvm/PassInfo.h                                   | 1 +
 llvm/include/llvm/PassRegistry.h                               | 1 +
 llvm/include/llvm/PassSupport.h                                | 1 +
 llvm/include/llvm/Passes/OptimizationLevel.h                   | 1 +
 llvm/include/llvm/Passes/PassBuilder.h                         | 1 +
 llvm/include/llvm/Passes/StandardInstrumentations.h            | 1 +
 llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h | 1 +
 llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h | 1 +
 llvm/include/llvm/ProfileData/GCOV.h                           | 1 +
 llvm/include/llvm/ProfileData/InstrProfCorrelator.h            | 1 +
 llvm/include/llvm/ProfileData/InstrProfReader.h                | 1 +
 llvm/include/llvm/ProfileData/InstrProfWriter.h                | 1 +
 llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h   | 1 +
 llvm/include/llvm/ProfileData/MemProf.h                        | 1 +
 llvm/include/llvm/ProfileData/ProfileCommon.h                  | 1 +
 llvm/include/llvm/ProfileData/RawMemProfReader.h               | 1 +
 llvm/include/llvm/ProfileData/SampleProf.h                     | 1 +
 llvm/include/llvm/ProfileData/SampleProfReader.h               | 1 +
 llvm/include/llvm/ProfileData/SampleProfWriter.h               | 1 +
 llvm/include/llvm/ProfileData/SymbolRemappingReader.h          | 1 +
 llvm/include/llvm/Remarks/BitstreamRemarkParser.h              | 1 +
 llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h          | 1 +
 llvm/include/llvm/Remarks/HotnessThresholdParser.h             | 1 +
 llvm/include/llvm/Remarks/Remark.h                             | 1 +
 llvm/include/llvm/Remarks/RemarkFormat.h                       | 1 +
 llvm/include/llvm/Remarks/RemarkLinker.h                       | 1 +
 llvm/include/llvm/Remarks/RemarkParser.h                       | 1 +
 llvm/include/llvm/Remarks/RemarkSerializer.h                   | 1 +
 llvm/include/llvm/Remarks/RemarkStreamer.h                     | 1 +
 llvm/include/llvm/Remarks/RemarkStringTable.h                  | 1 +
 llvm/include/llvm/Remarks/YAMLRemarkSerializer.h               | 1 +
 llvm/include/llvm/Support/AMDGPUMetadata.h                     | 1 +
 llvm/include/llvm/Support/ARMAttributeParser.h                 | 1 +
 llvm/include/llvm/Support/ARMBuildAttributes.h                 | 1 +
 llvm/include/llvm/Support/ARMWinEH.h                           | 1 +
 llvm/include/llvm/Support/Alignment.h                          | 1 +
 llvm/include/llvm/Support/ArrayRecycler.h                      | 1 +
 llvm/include/llvm/Support/Automaton.h                          | 1 +
 llvm/include/llvm/Support/BLAKE3.h                             | 1 +
 llvm/include/llvm/Support/BalancedPartitioning.h               | 1 +
 llvm/include/llvm/Support/Base64.h                             | 1 +
 llvm/include/llvm/Support/BinaryByteStream.h                   | 1 +
 llvm/include/llvm/Support/BinaryItemStream.h                   | 1 +
 llvm/include/llvm/Support/BinaryStream.h                       | 1 +
 llvm/include/llvm/Support/BinaryStreamArray.h                  | 1 +
 llvm/include/llvm/Support/BinaryStreamError.h                  | 1 +
 llvm/include/llvm/Support/BinaryStreamReader.h                 | 1 +
 llvm/include/llvm/Support/BinaryStreamRef.h                    | 1 +
 llvm/include/llvm/Support/BinaryStreamWriter.h                 | 1 +
 llvm/include/llvm/Support/CFGDiff.h                            | 1 +
 llvm/include/llvm/Support/CSKYAttributeParser.h                | 1 +
 llvm/include/llvm/Support/CSKYAttributes.h                     | 1 +
 llvm/include/llvm/Support/CachePruning.h                       | 1 +
 llvm/include/llvm/Support/Caching.h                            | 1 +
 llvm/include/llvm/Support/CodeGenCoverage.h                    | 1 +
 llvm/include/llvm/Support/CommandLine.h                        | 1 +
 llvm/include/llvm/Support/Compression.h                        | 1 +
 llvm/include/llvm/Support/ConvertEBCDIC.h                      | 1 +
 llvm/include/llvm/Support/CrashRecoveryContext.h               | 1 +
 llvm/include/llvm/Support/DJB.h                                | 1 +
 llvm/include/llvm/Support/DOTGraphTraits.h                     | 1 +
 llvm/include/llvm/Support/DataExtractor.h                      | 1 +
 llvm/include/llvm/Support/DebugCounter.h                       | 1 +
 llvm/include/llvm/Support/DivisionByConstantInfo.h             | 1 +
 llvm/include/llvm/Support/Duration.h                           | 1 +
 llvm/include/llvm/Support/ELFAttributeParser.h                 | 1 +
 llvm/include/llvm/Support/ELFAttributes.h                      | 1 +
 llvm/include/llvm/Support/EndianStream.h                       | 1 +
 llvm/include/llvm/Support/ErrorOr.h                            | 1 +
 llvm/include/llvm/Support/FileCollector.h                      | 1 +
 llvm/include/llvm/Support/FileOutputBuffer.h                   | 1 +
 llvm/include/llvm/Support/FileSystem.h                         | 1 +
 llvm/include/llvm/Support/FileSystem/UniqueID.h                | 1 +
 llvm/include/llvm/Support/FileUtilities.h                      | 1 +
 llvm/include/llvm/Support/Format.h                             | 1 +
 llvm/include/llvm/Support/FormatAdapters.h                     | 1 +
 llvm/include/llvm/Support/FormatCommon.h                       | 1 +
 llvm/include/llvm/Support/FormatProviders.h                    | 1 +
 llvm/include/llvm/Support/FormatVariadic.h                     | 1 +
 llvm/include/llvm/Support/FormatVariadicDetails.h              | 1 +
 llvm/include/llvm/Support/FormattedStream.h                    | 1 +
 llvm/include/llvm/Support/GenericDomTree.h                     | 1 +
 llvm/include/llvm/Support/GenericDomTreeConstruction.h         | 1 +
 llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h   | 1 +
 llvm/include/llvm/Support/GenericLoopInfo.h                    | 1 +
 llvm/include/llvm/Support/GenericLoopInfoImpl.h                | 1 +
 llvm/include/llvm/Support/GlobPattern.h                        | 1 +
 llvm/include/llvm/Support/GraphWriter.h                        | 1 +
 llvm/include/llvm/Support/HashBuilder.h                        | 1 +
 llvm/include/llvm/Support/InitLLVM.h                           | 1 +
 llvm/include/llvm/Support/InstructionCost.h                    | 1 +
 llvm/include/llvm/Support/JSON.h                               | 1 +
 llvm/include/llvm/Support/KnownBits.h                          | 1 +
 llvm/include/llvm/Support/LEB128.h                             | 1 +
 llvm/include/llvm/Support/LineIterator.h                       | 1 +
 llvm/include/llvm/Support/LockFileManager.h                    | 1 +
 llvm/include/llvm/Support/MD5.h                                | 1 +
 llvm/include/llvm/Support/MSP430AttributeParser.h              | 1 +
 llvm/include/llvm/Support/MSP430Attributes.h                   | 1 +
 llvm/include/llvm/Support/MSVCErrorWorkarounds.h               | 1 +
 llvm/include/llvm/Support/MemoryBuffer.h                       | 1 +
 llvm/include/llvm/Support/MemoryBufferRef.h                    | 1 +
 llvm/include/llvm/Support/ModRef.h                             | 1 +
 llvm/include/llvm/Support/Mutex.h                              | 1 +
 llvm/include/llvm/Support/OnDiskHashTable.h                    | 1 +
 llvm/include/llvm/Support/OptimizedStructLayout.h              | 1 +
 llvm/include/llvm/Support/PGOOptions.h                         | 1 +
 llvm/include/llvm/Support/Parallel.h                           | 1 +
 llvm/include/llvm/Support/Path.h                               | 1 +
 llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h          | 1 +
 llvm/include/llvm/Support/PointerLikeTypeTraits.h              | 1 +
 llvm/include/llvm/Support/Printable.h                          | 1 +
 llvm/include/llvm/Support/Process.h                            | 1 +
 llvm/include/llvm/Support/Program.h                            | 1 +
 llvm/include/llvm/Support/RISCVAttributeParser.h               | 1 +
 llvm/include/llvm/Support/RISCVAttributes.h                    | 1 +
 llvm/include/llvm/Support/RISCVISAInfo.h                       | 1 +
 llvm/include/llvm/Support/RWMutex.h                            | 1 +
 llvm/include/llvm/Support/Recycler.h                           | 1 +
 llvm/include/llvm/Support/RecyclingAllocator.h                 | 1 +
 llvm/include/llvm/Support/Regex.h                              | 1 +
 llvm/include/llvm/Support/SMLoc.h                              | 1 +
 llvm/include/llvm/Support/SMTAPI.h                             | 1 +
 llvm/include/llvm/Support/SaveAndRestore.h                     | 1 +
 llvm/include/llvm/Support/ScaledNumber.h                       | 1 +
 llvm/include/llvm/Support/ScopedPrinter.h                      | 1 +
 llvm/include/llvm/Support/SmallVectorMemoryBuffer.h            | 1 +
 llvm/include/llvm/Support/SourceMgr.h                          | 1 +
 llvm/include/llvm/Support/SpecialCaseList.h                    | 1 +
 llvm/include/llvm/Support/StringSaver.h                        | 1 +
 llvm/include/llvm/Support/SuffixTree.h                         | 1 +
 llvm/include/llvm/Support/SuffixTreeNode.h                     | 1 +
 llvm/include/llvm/Support/TarWriter.h                          | 1 +
 llvm/include/llvm/Support/ThreadPool.h                         | 1 +
 llvm/include/llvm/Support/TimeProfiler.h                       | 1 +
 llvm/include/llvm/Support/Timer.h                              | 1 +
 llvm/include/llvm/Support/ToolOutputFile.h                     | 1 +
 llvm/include/llvm/Support/Unicode.h                            | 1 +
 llvm/include/llvm/Support/VersionTuple.h                       | 1 +
 llvm/include/llvm/Support/VirtualFileSystem.h                  | 1 +
 llvm/include/llvm/Support/Win64EH.h                            | 1 +
 llvm/include/llvm/Support/WindowsError.h                       | 1 +
 llvm/include/llvm/Support/WithColor.h                          | 1 +
 llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h       | 1 +
 llvm/include/llvm/Support/YAMLParser.h                         | 1 +
 llvm/include/llvm/Support/YAMLTraits.h                         | 1 +
 llvm/include/llvm/Support/circular_raw_ostream.h               | 1 +
 llvm/include/llvm/Support/raw_os_ostream.h                     | 1 +
 llvm/include/llvm/Support/raw_ostream.h                        | 1 +
 llvm/include/llvm/Support/thread.h                             | 1 +
 llvm/include/llvm/Support/xxhash.h                             | 1 +
 llvm/include/llvm/TableGen/Error.h                             | 1 +
 llvm/include/llvm/TableGen/Main.h                              | 1 +
 llvm/include/llvm/TableGen/Parser.h                            | 1 +
 llvm/include/llvm/TableGen/Record.h                            | 1 +
 llvm/include/llvm/TableGen/SetTheory.h                         | 1 +
 llvm/include/llvm/TableGen/StringMatcher.h                     | 1 +
 llvm/include/llvm/TableGen/TableGenBackend.h                   | 1 +
 llvm/include/llvm/Target/CGPassBuilderOption.h                 | 1 +
 llvm/include/llvm/Target/TargetIntrinsicInfo.h                 | 1 +
 llvm/include/llvm/Target/TargetLoweringObjectFile.h            | 1 +
 llvm/include/llvm/Target/TargetMachine.h                       | 1 +
 llvm/include/llvm/Target/TargetOptions.h                       | 1 +
 llvm/include/llvm/TargetParser/AArch64TargetParser.h           | 1 +
 llvm/include/llvm/TargetParser/ARMTargetParser.h               | 1 +
 llvm/include/llvm/TargetParser/ARMTargetParserCommon.h         | 1 +
 llvm/include/llvm/TargetParser/CSKYTargetParser.h              | 1 +
 llvm/include/llvm/TargetParser/Host.h                          | 1 +
 llvm/include/llvm/TargetParser/LoongArchTargetParser.h         | 1 +
 llvm/include/llvm/TargetParser/RISCVTargetParser.h             | 1 +
 llvm/include/llvm/TargetParser/SubtargetFeature.h              | 1 +
 llvm/include/llvm/TargetParser/TargetParser.h                  | 1 +
 llvm/include/llvm/TargetParser/Triple.h                        | 1 +
 llvm/include/llvm/TargetParser/X86TargetParser.h               | 1 +
 llvm/include/llvm/Testing/Annotations/Annotations.h            | 1 +
 llvm/include/llvm/Testing/Support/Error.h                      | 1 +
 llvm/include/llvm/Testing/Support/SupportHelpers.h             | 1 +
 llvm/include/llvm/TextAPI/Architecture.h                       | 1 +
 llvm/include/llvm/TextAPI/ArchitectureSet.h                    | 1 +
 llvm/include/llvm/TextAPI/InterfaceFile.h                      | 1 +
 llvm/include/llvm/TextAPI/PackedVersion.h                      | 1 +
 llvm/include/llvm/TextAPI/Platform.h                           | 1 +
 llvm/include/llvm/TextAPI/Symbol.h                             | 1 +
 llvm/include/llvm/TextAPI/Target.h                             | 1 +
 llvm/include/llvm/TextAPI/TextAPIReader.h                      | 1 +
 llvm/include/llvm/TextAPI/TextAPIWriter.h                      | 2 ++
 llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h     | 2 ++
 llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h             | 2 ++
 .../Transforms/AggressiveInstCombine/AggressiveInstCombine.h   | 1 +
 llvm/include/llvm/Transforms/CFGuard.h                         | 2 ++
 llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h          | 1 +
 .../llvm/Transforms/Coroutines/CoroConditionalWrapper.h        | 1 +
 llvm/include/llvm/Transforms/Coroutines/CoroEarly.h            | 1 +
 llvm/include/llvm/Transforms/Coroutines/CoroElide.h            | 1 +
 llvm/include/llvm/Transforms/Coroutines/CoroSplit.h            | 1 +
 llvm/include/llvm/Transforms/IPO.h                             | 1 +
 llvm/include/llvm/Transforms/IPO/AlwaysInliner.h               | 1 +
 llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h         | 1 +
 llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h           | 1 +
 llvm/include/llvm/Transforms/IPO/Attributor.h                  | 1 +
 llvm/include/llvm/Transforms/IPO/BlockExtractor.h              | 1 +
 llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h      | 1 +
 llvm/include/llvm/Transforms/IPO/ConstantMerge.h               | 1 +
 llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h                 | 1 +
 llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h     | 1 +
 llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h             | 1 +
 llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h            | 1 +
 llvm/include/llvm/Transforms/IPO/ExtractGV.h                   | 1 +
 llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h          | 1 +
 llvm/include/llvm/Transforms/IPO/FunctionAttrs.h               | 1 +
 llvm/include/llvm/Transforms/IPO/FunctionImport.h              | 1 +
 llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h      | 1 +
 llvm/include/llvm/Transforms/IPO/GlobalDCE.h                   | 1 +
 llvm/include/llvm/Transforms/IPO/GlobalOpt.h                   | 1 +
 llvm/include/llvm/Transforms/IPO/GlobalSplit.h                 | 1 +
 llvm/include/llvm/Transforms/IPO/HotColdSplitting.h            | 1 +
 llvm/include/llvm/Transforms/IPO/IROutliner.h                  | 1 +
 llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h          | 1 +
 llvm/include/llvm/Transforms/IPO/Inliner.h                     | 1 +
 llvm/include/llvm/Transforms/IPO/Internalize.h                 | 1 +
 llvm/include/llvm/Transforms/IPO/LoopExtractor.h               | 1 +
 llvm/include/llvm/Transforms/IPO/LowerTypeTests.h              | 1 +
 .../include/llvm/Transforms/IPO/MemProfContextDisambiguation.h | 1 +
 llvm/include/llvm/Transforms/IPO/MergeFunctions.h              | 1 +
 llvm/include/llvm/Transforms/IPO/ModuleInliner.h               | 1 +
 llvm/include/llvm/Transforms/IPO/OpenMPOpt.h                   | 1 +
 llvm/include/llvm/Transforms/IPO/PartialInlining.h             | 1 +
 llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h           | 1 +
 llvm/include/llvm/Transforms/IPO/SCCP.h                        | 1 +
 llvm/include/llvm/Transforms/IPO/SampleContextTracker.h        | 1 +
 llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h          | 1 +
 llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h         | 1 +
 llvm/include/llvm/Transforms/IPO/StripSymbols.h                | 1 +
 llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h  | 1 +
 llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h        | 1 +
 llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h          | 1 +
 llvm/include/llvm/Transforms/InstCombine/InstCombine.h         | 1 +
 llvm/include/llvm/Transforms/Instrumentation.h                 | 1 +
 .../include/llvm/Transforms/Instrumentation/AddressSanitizer.h | 1 +
 .../llvm/Transforms/Instrumentation/AddressSanitizerCommon.h   | 1 +
 .../llvm/Transforms/Instrumentation/BlockCoverageInference.h   | 1 +
 llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h  | 1 +
 llvm/include/llvm/Transforms/Instrumentation/CFGMST.h          | 1 +
 llvm/include/llvm/Transforms/Instrumentation/CGProfile.h       | 1 +
 .../llvm/Transforms/Instrumentation/ControlHeightReduction.h   | 1 +
 .../llvm/Transforms/Instrumentation/DataFlowSanitizer.h        | 1 +
 llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h    | 1 +
 .../llvm/Transforms/Instrumentation/HWAddressSanitizer.h       | 1 +
 llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h  | 1 +
 llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h  | 1 +
 llvm/include/llvm/Transforms/Instrumentation/KCFI.h            | 1 +
 llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h     | 1 +
 llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h | 1 +
 .../llvm/Transforms/Instrumentation/PGOInstrumentation.h       | 1 +
 llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h  | 1 +
 .../llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h  | 1 +
 .../llvm/Transforms/Instrumentation/SanitizerCoverage.h        | 1 +
 llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h | 1 +
 llvm/include/llvm/Transforms/ObjCARC.h                         | 1 +
 llvm/include/llvm/Transforms/Scalar.h                          | 1 +
 llvm/include/llvm/Transforms/Scalar/ADCE.h                     | 1 +
 llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h | 1 +
 llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h        | 1 +
 llvm/include/llvm/Transforms/Scalar/BDCE.h                     | 1 +
 llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h        | 1 +
 llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h         | 1 +
 llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h    | 1 +
 .../llvm/Transforms/Scalar/CorrelatedValuePropagation.h        | 1 +
 llvm/include/llvm/Transforms/Scalar/DCE.h                      | 1 +
 llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h         | 1 +
 llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h     | 1 +
 llvm/include/llvm/Transforms/Scalar/DivRemPairs.h              | 1 +
 llvm/include/llvm/Transforms/Scalar/EarlyCSE.h                 | 1 +
 llvm/include/llvm/Transforms/Scalar/FlattenCFG.h               | 1 +
 llvm/include/llvm/Transforms/Scalar/Float2Int.h                | 1 +
 llvm/include/llvm/Transforms/Scalar/GuardWidening.h            | 1 +
 llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h           | 1 +
 llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h           | 1 +
 .../llvm/Transforms/Scalar/InductiveRangeCheckElimination.h    | 1 +
 llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h       | 1 +
 llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h         | 1 +
 llvm/include/llvm/Transforms/Scalar/JumpThreading.h            | 1 +
 llvm/include/llvm/Transforms/Scalar/LICM.h                     | 1 +
 .../include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h           | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h         | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopDeletion.h             | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopDistribute.h           | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopFlatten.h              | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopFuse.h                 | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h       | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h         | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopInterchange.h          | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h      | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopPassManager.h          | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopPredication.h          | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopReroll.h               | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopRotation.h             | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h          | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopSink.h                 | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h       | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h     | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h           | 1 +
 llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h       | 1 +
 llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h          | 1 +
 llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h  | 1 +
 llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h     | 1 +
 llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h      | 1 +
 llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h    | 1 +
 llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h  | 1 +
 llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h       | 1 +
 llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h          | 1 +
 llvm/include/llvm/Transforms/Scalar/MergeICmps.h               | 1 +
 llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h    | 1 +
 llvm/include/llvm/Transforms/Scalar/NaryReassociate.h          | 1 +
 llvm/include/llvm/Transforms/Scalar/NewGVN.h                   | 1 +
 llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h  | 1 +
 llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h          | 1 +
 llvm/include/llvm/Transforms/Scalar/Reassociate.h              | 1 +
 llvm/include/llvm/Transforms/Scalar/Reg2Mem.h                  | 1 +
 llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h  | 1 +
 llvm/include/llvm/Transforms/Scalar/SCCP.h                     | 1 +
 llvm/include/llvm/Transforms/Scalar/SROA.h                     | 1 +
 llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h | 1 +
 llvm/include/llvm/Transforms/Scalar/Scalarizer.h               | 1 +
 .../llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h        | 1 +
 llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h       | 1 +
 llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h              | 1 +
 llvm/include/llvm/Transforms/Scalar/Sink.h                     | 1 +
 llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h     | 1 +
 .../llvm/Transforms/Scalar/StraightLineStrengthReduce.h        | 1 +
 llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h           | 1 +
 llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h         | 1 +
 llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h | 1 +
 llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h     | 1 +
 llvm/include/llvm/Transforms/Utils.h                           | 2 ++
 llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h          | 1 +
 llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h      | 1 +
 llvm/include/llvm/Transforms/Utils/AddDiscriminators.h         | 1 +
 llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h       | 1 +
 llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h           | 1 +
 llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h        | 1 +
 llvm/include/llvm/Transforms/Utils/BuildLibCalls.h             | 1 +
 llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h        | 1 +
 llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h          | 1 +
 llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h        | 2 ++
 llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h       | 1 +
 llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h | 1 +
 llvm/include/llvm/Transforms/Utils/Cloning.h                   | 1 +
 llvm/include/llvm/Transforms/Utils/CodeExtractor.h             | 1 +
 llvm/include/llvm/Transforms/Utils/CodeLayout.h                | 1 +
 llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h            | 2 ++
 llvm/include/llvm/Transforms/Utils/CountVisits.h               | 1 +
 llvm/include/llvm/Transforms/Utils/CtorUtils.h                 | 1 +
 llvm/include/llvm/Transforms/Utils/Debugify.h                  | 1 +
 llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h     | 1 +
 llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h          | 1 +
 llvm/include/llvm/Transforms/Utils/Evaluator.h                 | 1 +
 llvm/include/llvm/Transforms/Utils/FixIrreducible.h            | 1 +
 llvm/include/llvm/Transforms/Utils/FunctionComparator.h        | 1 +
 llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h       | 1 +
 llvm/include/llvm/Transforms/Utils/GlobalStatus.h              | 1 +
 llvm/include/llvm/Transforms/Utils/GuardUtils.h                | 2 ++
 llvm/include/llvm/Transforms/Utils/HelloWorld.h                | 1 +
 llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h         | 1 +
 llvm/include/llvm/Transforms/Utils/InstructionNamer.h          | 1 +
 llvm/include/llvm/Transforms/Utils/IntegerDivision.h           | 2 ++
 llvm/include/llvm/Transforms/Utils/LCSSA.h                     | 1 +
 llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h        | 1 +
 llvm/include/llvm/Transforms/Utils/Local.h                     | 1 +
 llvm/include/llvm/Transforms/Utils/LoopPeel.h                  | 1 +
 llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h         | 2 ++
 llvm/include/llvm/Transforms/Utils/LoopSimplify.h              | 1 +
 llvm/include/llvm/Transforms/Utils/LoopUtils.h                 | 1 +
 llvm/include/llvm/Transforms/Utils/LoopVersioning.h            | 1 +
 llvm/include/llvm/Transforms/Utils/LowerAtomic.h               | 1 +
 llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h          | 1 +
 llvm/include/llvm/Transforms/Utils/LowerIFunc.h                | 1 +
 llvm/include/llvm/Transforms/Utils/LowerInvoke.h               | 1 +
 llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h        | 1 +
 llvm/include/llvm/Transforms/Utils/LowerSwitch.h               | 1 +
 llvm/include/llvm/Transforms/Utils/MatrixUtils.h               | 1 +
 llvm/include/llvm/Transforms/Utils/Mem2Reg.h                   | 1 +
 llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h            | 1 +
 llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h      | 1 +
 llvm/include/llvm/Transforms/Utils/MetaRenamer.h               | 1 +
 llvm/include/llvm/Transforms/Utils/MisExpect.h                 | 1 +
 llvm/include/llvm/Transforms/Utils/ModuleUtils.h               | 1 +
 llvm/include/llvm/Transforms/Utils/MoveAutoInit.h              | 1 +
 llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h           | 1 +
 llvm/include/llvm/Transforms/Utils/PredicateInfo.h             | 1 +
 llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h           | 2 ++
 llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h   | 1 +
 llvm/include/llvm/Transforms/Utils/SCCPSolver.h                | 1 +
 llvm/include/llvm/Transforms/Utils/SSAUpdater.h                | 1 +
 llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h            | 1 +
 llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h            | 1 +
 llvm/include/llvm/Transforms/Utils/SampleProfileInference.h    | 1 +
 .../llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h        | 1 +
 .../llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h        | 1 +
 llvm/include/llvm/Transforms/Utils/SanitizerStats.h            | 1 +
 llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h   | 1 +
 llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h        | 2 ++
 llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h            | 2 ++
 llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h          | 1 +
 llvm/include/llvm/Transforms/Utils/SizeOpts.h                  | 1 +
 llvm/include/llvm/Transforms/Utils/SplitModule.h               | 1 +
 llvm/include/llvm/Transforms/Utils/StripGCRelocates.h          | 1 +
 .../include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h | 1 +
 llvm/include/llvm/Transforms/Utils/SymbolRewriter.h            | 1 +
 llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h    | 1 +
 llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h            | 1 +
 llvm/include/llvm/Transforms/Utils/UnrollLoop.h                | 1 +
 llvm/include/llvm/Transforms/Utils/VNCoercion.h                | 2 ++
 llvm/include/llvm/Transforms/Utils/ValueMapper.h               | 1 +
 llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h   | 1 +
 .../llvm/Transforms/Vectorize/LoopVectorizationLegality.h      | 1 +
 llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h         | 1 +
 llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h         | 1 +
 llvm/include/llvm/Transforms/Vectorize/VectorCombine.h         | 1 +
 llvm/include/llvm/WindowsDriver/MSVCPaths.h                    | 1 +
 llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h      | 1 +
 llvm/include/llvm/XRay/BlockIndexer.h                          | 1 +
 llvm/include/llvm/XRay/BlockPrinter.h                          | 1 +
 llvm/include/llvm/XRay/BlockVerifier.h                         | 1 +
 llvm/include/llvm/XRay/FDRRecordConsumer.h                     | 1 +
 llvm/include/llvm/XRay/FDRRecordProducer.h                     | 1 +
 llvm/include/llvm/XRay/FDRRecords.h                            | 1 +
 llvm/include/llvm/XRay/FDRTraceExpander.h                      | 1 +
 llvm/include/llvm/XRay/FDRTraceWriter.h                        | 1 +
 llvm/include/llvm/XRay/FileHeaderReader.h                      | 1 +
 llvm/include/llvm/XRay/InstrumentationMap.h                    | 1 +
 llvm/include/llvm/XRay/Profile.h                               | 1 +
 llvm/include/llvm/XRay/RecordPrinter.h                         | 1 +
 llvm/include/llvm/XRay/Trace.h                                 | 1 +
 llvm/include/llvm/XRay/XRayRecord.h                            | 1 +
 llvm/include/llvm/XRay/YAMLXRayRecord.h                        | 1 +
 1516 files changed, 1567 insertions(+)

diff --git a/llvm/include/llvm-c/Analysis.h b/llvm/include/llvm-c/Analysis.h
index 270b145a4d27e28..e515ef311aee3e5 100644
--- a/llvm/include/llvm-c/Analysis.h
+++ b/llvm/include/llvm-c/Analysis.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_C_ANALYSIS_H
 #define LLVM_C_ANALYSIS_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 
diff --git a/llvm/include/llvm-c/BitReader.h b/llvm/include/llvm-c/BitReader.h
index 088107468d4fbc9..1a960118979a22c 100644
--- a/llvm/include/llvm-c/BitReader.h
+++ b/llvm/include/llvm-c/BitReader.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_C_BITREADER_H
 #define LLVM_C_BITREADER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 
diff --git a/llvm/include/llvm-c/BitWriter.h b/llvm/include/llvm-c/BitWriter.h
index ea84b6593d12610..5baba8cbe7cf45c 100644
--- a/llvm/include/llvm-c/BitWriter.h
+++ b/llvm/include/llvm-c/BitWriter.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_C_BITWRITER_H
 #define LLVM_C_BITWRITER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 
diff --git a/llvm/include/llvm-c/Comdat.h b/llvm/include/llvm-c/Comdat.h
index 8002bc0581af758..8ef628366cf36ed 100644
--- a/llvm/include/llvm-c/Comdat.h
+++ b/llvm/include/llvm-c/Comdat.h
@@ -16,6 +16,7 @@
 
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
+#include "llvm/Support/Compiler.h"
 
 LLVM_C_EXTERN_C_BEGIN
 
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index fbba8ca42a8c761..372830b09a855b2 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_C_CORE_H
 #define LLVM_C_CORE_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/Deprecated.h"
 #include "llvm-c/ErrorHandling.h"
 #include "llvm-c/ExternC.h"
diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h
index 5924294708cc354..dc0e7432db6f969 100644
--- a/llvm/include/llvm-c/DebugInfo.h
+++ b/llvm/include/llvm-c/DebugInfo.h
@@ -16,6 +16,7 @@
 #ifndef LLVM_C_DEBUGINFO_H
 #define LLVM_C_DEBUGINFO_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 
diff --git a/llvm/include/llvm-c/Disassembler.h b/llvm/include/llvm-c/Disassembler.h
index b1cb35da6687a8f..8f832318f9d1676 100644
--- a/llvm/include/llvm-c/Disassembler.h
+++ b/llvm/include/llvm-c/Disassembler.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_C_DISASSEMBLER_H
 #define LLVM_C_DISASSEMBLER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/DisassemblerTypes.h"
 #include "llvm-c/ExternC.h"
 
diff --git a/llvm/include/llvm-c/DisassemblerTypes.h b/llvm/include/llvm-c/DisassemblerTypes.h
index 6999a350ec918ea..06ebfec6c32ba0f 100644
--- a/llvm/include/llvm-c/DisassemblerTypes.h
+++ b/llvm/include/llvm-c/DisassemblerTypes.h
@@ -10,6 +10,7 @@
 #ifndef LLVM_C_DISASSEMBLERTYPES_H
 #define LLVM_C_DISASSEMBLERTYPES_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/DataTypes.h"
 #ifdef __cplusplus
 #include <cstddef>
diff --git a/llvm/include/llvm-c/ExecutionEngine.h b/llvm/include/llvm-c/ExecutionEngine.h
index c5fc9bdb4d07f62..ba8353b4796f16c 100644
--- a/llvm/include/llvm-c/ExecutionEngine.h
+++ b/llvm/include/llvm-c/ExecutionEngine.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_C_EXECUTIONENGINE_H
 #define LLVM_C_EXECUTIONENGINE_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Target.h"
 #include "llvm-c/TargetMachine.h"
diff --git a/llvm/include/llvm-c/IRReader.h b/llvm/include/llvm-c/IRReader.h
index 905b84fa5a8693b..629dce589715728 100644
--- a/llvm/include/llvm-c/IRReader.h
+++ b/llvm/include/llvm-c/IRReader.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_C_IRREADER_H
 #define LLVM_C_IRREADER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 
diff --git a/llvm/include/llvm-c/LLJIT.h b/llvm/include/llvm-c/LLJIT.h
index a06133aac4fb063..961bf2daa909f11 100644
--- a/llvm/include/llvm-c/LLJIT.h
+++ b/llvm/include/llvm-c/LLJIT.h
@@ -24,6 +24,7 @@
 #ifndef LLVM_C_LLJIT_H
 #define LLVM_C_LLJIT_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/Error.h"
 #include "llvm-c/Orc.h"
 #include "llvm-c/TargetMachine.h"
diff --git a/llvm/include/llvm-c/Linker.h b/llvm/include/llvm-c/Linker.h
index acff5d5e222531e..f13a5fbea67e16a 100644
--- a/llvm/include/llvm-c/Linker.h
+++ b/llvm/include/llvm-c/Linker.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_C_LINKER_H
 #define LLVM_C_LINKER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 
diff --git a/llvm/include/llvm-c/Object.h b/llvm/include/llvm-c/Object.h
index f422c1ad224d25e..709609df2460af8 100644
--- a/llvm/include/llvm-c/Object.h
+++ b/llvm/include/llvm-c/Object.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_C_OBJECT_H
 #define LLVM_C_OBJECT_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 #include "llvm/Config/llvm-config.h"
diff --git a/llvm/include/llvm-c/Orc.h b/llvm/include/llvm-c/Orc.h
index 0dcfb06865aa883..488394c060fabca 100644
--- a/llvm/include/llvm-c/Orc.h
+++ b/llvm/include/llvm-c/Orc.h
@@ -27,6 +27,7 @@
 #ifndef LLVM_C_ORC_H
 #define LLVM_C_ORC_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/Error.h"
 #include "llvm-c/TargetMachine.h"
 #include "llvm-c/Types.h"
diff --git a/llvm/include/llvm-c/OrcEE.h b/llvm/include/llvm-c/OrcEE.h
index d451187aaef59bb..1b7a8dbe2bb16a1 100644
--- a/llvm/include/llvm-c/OrcEE.h
+++ b/llvm/include/llvm-c/OrcEE.h
@@ -24,6 +24,7 @@
 #ifndef LLVM_C_ORCEE_H
 #define LLVM_C_ORCEE_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/Error.h"
 #include "llvm-c/ExecutionEngine.h"
 #include "llvm-c/Orc.h"
diff --git a/llvm/include/llvm-c/Remarks.h b/llvm/include/llvm-c/Remarks.h
index ffe647a6554aabb..e19b604829f2714 100644
--- a/llvm/include/llvm-c/Remarks.h
+++ b/llvm/include/llvm-c/Remarks.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_C_REMARKS_H
 #define LLVM_C_REMARKS_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 #ifdef __cplusplus
diff --git a/llvm/include/llvm-c/Support.h b/llvm/include/llvm-c/Support.h
index 17657861b32b929..41feb25f66b3115 100644
--- a/llvm/include/llvm-c/Support.h
+++ b/llvm/include/llvm-c/Support.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_C_SUPPORT_H
 #define LLVM_C_SUPPORT_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/DataTypes.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
diff --git a/llvm/include/llvm-c/Target.h b/llvm/include/llvm-c/Target.h
index 518b46d55bc3c9a..53baef1da485b65 100644
--- a/llvm/include/llvm-c/Target.h
+++ b/llvm/include/llvm-c/Target.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_C_TARGET_H
 #define LLVM_C_TARGET_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Types.h"
 #include "llvm/Config/llvm-config.h"
diff --git a/llvm/include/llvm-c/TargetMachine.h b/llvm/include/llvm-c/TargetMachine.h
index bfbe1421a3560a8..e92b896327464d0 100644
--- a/llvm/include/llvm-c/TargetMachine.h
+++ b/llvm/include/llvm-c/TargetMachine.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_C_TARGETMACHINE_H
 #define LLVM_C_TARGETMACHINE_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 #include "llvm-c/Target.h"
 #include "llvm-c/Types.h"
diff --git a/llvm/include/llvm-c/Transforms/PassBuilder.h b/llvm/include/llvm-c/Transforms/PassBuilder.h
index d0466dd7fc0a127..b6055c25c5f1151 100644
--- a/llvm/include/llvm-c/Transforms/PassBuilder.h
+++ b/llvm/include/llvm-c/Transforms/PassBuilder.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_C_TRANSFORMS_PASSBUILDER_H
 #define LLVM_C_TRANSFORMS_PASSBUILDER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/Error.h"
 #include "llvm-c/TargetMachine.h"
 #include "llvm-c/Types.h"
diff --git a/llvm/include/llvm-c/blake3.h b/llvm/include/llvm-c/blake3.h
index 679477c3aa7f08c..f4a98b4218f8855 100644
--- a/llvm/include/llvm-c/blake3.h
+++ b/llvm/include/llvm-c/blake3.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_C_BLAKE3_H
 #define LLVM_C_BLAKE3_H
 
+#include "llvm/Support/Compiler.h"
 #include <stddef.h>
 #include <stdint.h>
 
diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h
index 5ceb02224d2bba5..087a6bd09a80e2f 100644
--- a/llvm/include/llvm-c/lto.h
+++ b/llvm/include/llvm-c/lto.h
@@ -16,6 +16,7 @@
 #ifndef LLVM_C_LTO_H
 #define LLVM_C_LTO_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm-c/ExternC.h"
 
 #ifdef __cplusplus
diff --git a/llvm/include/llvm/ADT/APFixedPoint.h b/llvm/include/llvm/ADT/APFixedPoint.h
index 5442968d20e4af7..22a08633a856b5e 100644
--- a/llvm/include/llvm/ADT/APFixedPoint.h
+++ b/llvm/include/llvm/ADT/APFixedPoint.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index 3961a001b8810ca..f97cd5d050185b0 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/FloatingPointMode.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <memory>
 
diff --git a/llvm/include/llvm/ADT/APSInt.h b/llvm/include/llvm/ADT/APSInt.h
index 90b988875a24dc0..a7201cdcb708805 100644
--- a/llvm/include/llvm/ADT/APSInt.h
+++ b/llvm/include/llvm/ADT/APSInt.h
@@ -16,6 +16,7 @@
 #define LLVM_ADT_APSINT_H
 
 #include "llvm/ADT/APInt.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/AddressRanges.h b/llvm/include/llvm/ADT/AddressRanges.h
index 415d30bbb5cf9b8..3990870cc13a265 100644
--- a/llvm/include/llvm/ADT/AddressRanges.h
+++ b/llvm/include/llvm/ADT/AddressRanges.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <optional>
 #include <stdint.h>
diff --git a/llvm/include/llvm/ADT/AllocatorList.h b/llvm/include/llvm/ADT/AllocatorList.h
index 04d0afc9d076e6a..dee561a55b00470 100644
--- a/llvm/include/llvm/ADT/AllocatorList.h
+++ b/llvm/include/llvm/ADT/AllocatorList.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/iterator.h"
 #include "llvm/ADT/simple_ilist.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/ADT/BitVector.h b/llvm/include/llvm/ADT/BitVector.h
index a8847a326753781..dbe1847abacc2df 100644
--- a/llvm/include/llvm/ADT/BitVector.h
+++ b/llvm/include/llvm/ADT/BitVector.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/ADT/Bitfields.h b/llvm/include/llvm/ADT/Bitfields.h
index 4064d716f8a7742..6e14208448f484b 100644
--- a/llvm/include/llvm/ADT/Bitfields.h
+++ b/llvm/include/llvm/ADT/Bitfields.h
@@ -79,6 +79,7 @@
 #ifndef LLVM_ADT_BITFIELDS_H
 #define LLVM_ADT_BITFIELDS_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <climits> // CHAR_BIT
 #include <cstddef> // size_t
diff --git a/llvm/include/llvm/ADT/BitmaskEnum.h b/llvm/include/llvm/ADT/BitmaskEnum.h
index 976fddde725f0cd..4080e67e05dcc51 100644
--- a/llvm/include/llvm/ADT/BitmaskEnum.h
+++ b/llvm/include/llvm/ADT/BitmaskEnum.h
@@ -13,6 +13,7 @@
 #include <type_traits>
 #include <utility>
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 
 /// LLVM_MARK_AS_BITMASK_ENUM lets you opt in an individual enum type so you can
diff --git a/llvm/include/llvm/ADT/BreadthFirstIterator.h b/llvm/include/llvm/ADT/BreadthFirstIterator.h
index 29e96693c4d1ae3..cebaf9eec709a7c 100644
--- a/llvm/include/llvm/ADT/BreadthFirstIterator.h
+++ b/llvm/include/llvm/ADT/BreadthFirstIterator.h
@@ -21,6 +21,7 @@
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include <iterator>
 #include <optional>
 #include <queue>
diff --git a/llvm/include/llvm/ADT/CachedHashString.h b/llvm/include/llvm/ADT/CachedHashString.h
index ebd40e3207156af..ea44cb0cb8784e1 100644
--- a/llvm/include/llvm/ADT/CachedHashString.h
+++ b/llvm/include/llvm/ADT/CachedHashString.h
@@ -22,6 +22,7 @@
 
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/CoalescingBitVector.h b/llvm/include/llvm/ADT/CoalescingBitVector.h
index 4940bc1c2c18b2f..0cf1eda9a9259ae 100644
--- a/llvm/include/llvm/ADT/CoalescingBitVector.h
+++ b/llvm/include/llvm/ADT/CoalescingBitVector.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/ADT/ConcurrentHashtable.h b/llvm/include/llvm/ADT/ConcurrentHashtable.h
index 438159d5c736b1b..858479ffe47486f 100644
--- a/llvm/include/llvm/ADT/ConcurrentHashtable.h
+++ b/llvm/include/llvm/ADT/ConcurrentHashtable.h
@@ -15,6 +15,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Parallel.h"
 #include "llvm/Support/WithColor.h"
diff --git a/llvm/include/llvm/ADT/DenseSet.h b/llvm/include/llvm/ADT/DenseSet.h
index b89c88626e43bb5..bd08a419bb7323c 100644
--- a/llvm/include/llvm/ADT/DenseSet.h
+++ b/llvm/include/llvm/ADT/DenseSet.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMapInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/type_traits.h"
 #include <cstddef>
diff --git a/llvm/include/llvm/ADT/DepthFirstIterator.h b/llvm/include/llvm/ADT/DepthFirstIterator.h
index 71053c2d0d8a8ec..4f93c91576d38d1 100644
--- a/llvm/include/llvm/ADT/DepthFirstIterator.h
+++ b/llvm/include/llvm/ADT/DepthFirstIterator.h
@@ -37,6 +37,7 @@
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include <iterator>
 #include <optional>
 #include <utility>
diff --git a/llvm/include/llvm/ADT/DirectedGraph.h b/llvm/include/llvm/ADT/DirectedGraph.h
index 83c0bea6393c4d6..dd012b8b5df8069 100644
--- a/llvm/include/llvm/ADT/DirectedGraph.h
+++ b/llvm/include/llvm/ADT/DirectedGraph.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/ADT/EnumeratedArray.h b/llvm/include/llvm/ADT/EnumeratedArray.h
index fd0700c8e408a05..47921d079e29b6d 100644
--- a/llvm/include/llvm/ADT/EnumeratedArray.h
+++ b/llvm/include/llvm/ADT/EnumeratedArray.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_ADT_ENUMERATEDARRAY_H
 #define LLVM_ADT_ENUMERATEDARRAY_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <iterator>
 
diff --git a/llvm/include/llvm/ADT/EpochTracker.h b/llvm/include/llvm/ADT/EpochTracker.h
index fc41d6f2c92d2f9..5efb46f70339816 100644
--- a/llvm/include/llvm/ADT/EpochTracker.h
+++ b/llvm/include/llvm/ADT/EpochTracker.h
@@ -17,6 +17,7 @@
 #define LLVM_ADT_EPOCHTRACKER_H
 
 #include "llvm/Config/abi-breaking.h"
+#include "llvm/Support/Compiler.h"
 
 #include <cstdint>
 
diff --git a/llvm/include/llvm/ADT/EquivalenceClasses.h b/llvm/include/llvm/ADT/EquivalenceClasses.h
index 4f98b84cf97d24f..4feda9cb4784f72 100644
--- a/llvm/include/llvm/ADT/EquivalenceClasses.h
+++ b/llvm/include/llvm/ADT/EquivalenceClasses.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_ADT_EQUIVALENCECLASSES_H
 #define LLVM_ADT_EQUIVALENCECLASSES_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/ADT/FloatingPointMode.h b/llvm/include/llvm/ADT/FloatingPointMode.h
index 61e57094fdbb98c..3e94054daa663e8 100644
--- a/llvm/include/llvm/ADT/FloatingPointMode.h
+++ b/llvm/include/llvm/ADT/FloatingPointMode.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/FoldingSet.h b/llvm/include/llvm/ADT/FoldingSet.h
index 237668921cbb273..7a5dc8ca3e67f8d 100644
--- a/llvm/include/llvm/ADT/FoldingSet.h
+++ b/llvm/include/llvm/ADT/FoldingSet.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h
index 53de2cb74253a68..5635fcc7d61dc75 100644
--- a/llvm/include/llvm/ADT/FunctionExtras.h
+++ b/llvm/include/llvm/ADT/FunctionExtras.h
@@ -35,6 +35,7 @@
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/STLForwardCompat.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemAlloc.h"
 #include "llvm/Support/type_traits.h"
 #include <cstring>
diff --git a/llvm/include/llvm/ADT/GenericCycleImpl.h b/llvm/include/llvm/ADT/GenericCycleImpl.h
index e1362d8597b2af0..8003ff7275b72a7 100644
--- a/llvm/include/llvm/ADT/GenericCycleImpl.h
+++ b/llvm/include/llvm/ADT/GenericCycleImpl.h
@@ -26,6 +26,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/GenericCycleInfo.h"
+#include "llvm/Support/Compiler.h"
 
 #define DEBUG_TYPE "generic-cycle-impl"
 
diff --git a/llvm/include/llvm/ADT/GenericCycleInfo.h b/llvm/include/llvm/ADT/GenericCycleInfo.h
index 7df50f4a0ec1721..70185b5024766d8 100644
--- a/llvm/include/llvm/ADT/GenericCycleInfo.h
+++ b/llvm/include/llvm/ADT/GenericCycleInfo.h
@@ -32,6 +32,7 @@
 #include "llvm/ADT/GenericSSAContext.h"
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SetVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/ADT/GenericSSAContext.h b/llvm/include/llvm/ADT/GenericSSAContext.h
index 40b2be7c34c316d..36565973b20ef87 100644
--- a/llvm/include/llvm/ADT/GenericSSAContext.h
+++ b/llvm/include/llvm/ADT/GenericSSAContext.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_ADT_GENERICSSACONTEXT_H
 #define LLVM_ADT_GENERICSSACONTEXT_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Printable.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/GenericUniformityImpl.h b/llvm/include/llvm/ADT/GenericUniformityImpl.h
index 4df04accc6835d8..ba15c38c1c18fc8 100644
--- a/llvm/include/llvm/ADT/GenericUniformityImpl.h
+++ b/llvm/include/llvm/ADT/GenericUniformityImpl.h
@@ -43,6 +43,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SparseBitVector.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 #include <set>
diff --git a/llvm/include/llvm/ADT/GenericUniformityInfo.h b/llvm/include/llvm/ADT/GenericUniformityInfo.h
index 114fdfed765c21f..5b90fb78bb0bd2c 100644
--- a/llvm/include/llvm/ADT/GenericUniformityInfo.h
+++ b/llvm/include/llvm/ADT/GenericUniformityInfo.h
@@ -10,6 +10,7 @@
 #define LLVM_ADT_GENERICUNIFORMITYINFO_H
 
 #include "llvm/ADT/GenericCycleInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/GraphTraits.h b/llvm/include/llvm/ADT/GraphTraits.h
index 3a7773592af3d4d..8c131d60dde220a 100644
--- a/llvm/include/llvm/ADT/GraphTraits.h
+++ b/llvm/include/llvm/ADT/GraphTraits.h
@@ -20,6 +20,7 @@
 #define LLVM_ADT_GRAPHTRAITS_H
 
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h
index ef983105c7bae67..b0ff47f4c6c89a6 100644
--- a/llvm/include/llvm/ADT/Hashing.h
+++ b/llvm/include/llvm/ADT/Hashing.h
@@ -44,6 +44,7 @@
 #ifndef LLVM_ADT_HASHING_H
 #define LLVM_ADT_HASHING_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/SwapByteOrder.h"
diff --git a/llvm/include/llvm/ADT/IndexedMap.h b/llvm/include/llvm/ADT/IndexedMap.h
index 5ac5f798269b9bf..cc09a1c5713bd77 100644
--- a/llvm/include/llvm/ADT/IndexedMap.h
+++ b/llvm/include/llvm/ADT/IndexedMap.h
@@ -22,6 +22,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/IntEqClasses.h b/llvm/include/llvm/ADT/IntEqClasses.h
index 9ee8a46be411eeb..82faef8436b1b82 100644
--- a/llvm/include/llvm/ADT/IntEqClasses.h
+++ b/llvm/include/llvm/ADT/IntEqClasses.h
@@ -22,6 +22,7 @@
 #define LLVM_ADT_INTEQCLASSES_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/IntervalMap.h b/llvm/include/llvm/ADT/IntervalMap.h
index c68d816a8e7d751..fb24b59e8f4d15d 100644
--- a/llvm/include/llvm/ADT/IntervalMap.h
+++ b/llvm/include/llvm/ADT/IntervalMap.h
@@ -107,6 +107,7 @@
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/RecyclingAllocator.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/ADT/IntervalTree.h b/llvm/include/llvm/ADT/IntervalTree.h
index cb707bd77a64d99..5c040098a46abd2 100644
--- a/llvm/include/llvm/ADT/IntervalTree.h
+++ b/llvm/include/llvm/ADT/IntervalTree.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
diff --git a/llvm/include/llvm/ADT/MapVector.h b/llvm/include/llvm/ADT/MapVector.h
index a129b63f8be7a70..09f881341e3849c 100644
--- a/llvm/include/llvm/ADT/MapVector.h
+++ b/llvm/include/llvm/ADT/MapVector.h
@@ -19,6 +19,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/ADT/PointerEmbeddedInt.h b/llvm/include/llvm/ADT/PointerEmbeddedInt.h
index fbc48af79da1ea1..3bdefa24747567e 100644
--- a/llvm/include/llvm/ADT/PointerEmbeddedInt.h
+++ b/llvm/include/llvm/ADT/PointerEmbeddedInt.h
@@ -10,6 +10,7 @@
 #define LLVM_ADT_POINTEREMBEDDEDINT_H
 
 #include "llvm/ADT/DenseMapInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
 #include <cassert>
diff --git a/llvm/include/llvm/ADT/PointerSumType.h b/llvm/include/llvm/ADT/PointerSumType.h
index 57f045035a7847f..43226d41843b796 100644
--- a/llvm/include/llvm/ADT/PointerSumType.h
+++ b/llvm/include/llvm/ADT/PointerSumType.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/bit.h"
 #include "llvm/ADT/DenseMapInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/ADT/PointerUnion.h b/llvm/include/llvm/ADT/PointerUnion.h
index 7d4ed02b622626b..63aa0e350387d83 100644
--- a/llvm/include/llvm/ADT/PointerUnion.h
+++ b/llvm/include/llvm/ADT/PointerUnion.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/ADT/PostOrderIterator.h b/llvm/include/llvm/ADT/PostOrderIterator.h
index 33d3330a40bd3f9..abc0510b046c675 100644
--- a/llvm/include/llvm/ADT/PostOrderIterator.h
+++ b/llvm/include/llvm/ADT/PostOrderIterator.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include <iterator>
 #include <optional>
 #include <set>
diff --git a/llvm/include/llvm/ADT/PriorityQueue.h b/llvm/include/llvm/ADT/PriorityQueue.h
index f40c160f0f5e60b..7738a48b8c55237 100644
--- a/llvm/include/llvm/ADT/PriorityQueue.h
+++ b/llvm/include/llvm/ADT/PriorityQueue.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_ADT_PRIORITYQUEUE_H
 #define LLVM_ADT_PRIORITYQUEUE_H
 
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <queue>
 
diff --git a/llvm/include/llvm/ADT/SCCIterator.h b/llvm/include/llvm/ADT/SCCIterator.h
index e743ae7c11edbc0..b3012448bda5a92 100644
--- a/llvm/include/llvm/ADT/SCCIterator.h
+++ b/llvm/include/llvm/ADT/SCCIterator.h
@@ -26,6 +26,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/iterator.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 7edc582636c772e..d5cf0f3df334349 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -25,6 +25,7 @@
 #include "llvm/ADT/iterator.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Config/abi-breaking.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/ADT/ScopedHashTable.h b/llvm/include/llvm/ADT/ScopedHashTable.h
index 78d4df7d5684520..78fadaf629048a7 100644
--- a/llvm/include/llvm/ADT/ScopedHashTable.h
+++ b/llvm/include/llvm/ADT/ScopedHashTable.h
@@ -33,6 +33,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/Support/AllocatorBase.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <new>
 
diff --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h
index ddda9a95a7bc652..fb9ef13d0d71160 100644
--- a/llvm/include/llvm/ADT/Sequence.h
+++ b/llvm/include/llvm/ADT/Sequence.h
@@ -86,6 +86,7 @@
 #include <type_traits> // std::is_integral, std::is_enum, std::underlying_type,
                        // std::enable_if
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h" // AddOverflow / SubOverflow
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/SmallBitVector.h b/llvm/include/llvm/ADT/SmallBitVector.h
index c538a4d4023b280..3bb300eaac27b38 100644
--- a/llvm/include/llvm/ADT/SmallBitVector.h
+++ b/llvm/include/llvm/ADT/SmallBitVector.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/BitVector.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/ADT/SmallString.h b/llvm/include/llvm/ADT/SmallString.h
index 0052c86fb37b82d..5d63a780d0c6902 100644
--- a/llvm/include/llvm/ADT/SmallString.h
+++ b/llvm/include/llvm/ADT/SmallString.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/SparseBitVector.h b/llvm/include/llvm/ADT/SparseBitVector.h
index 1e00c1386187510..89aa64db20ac94e 100644
--- a/llvm/include/llvm/ADT/SparseBitVector.h
+++ b/llvm/include/llvm/ADT/SparseBitVector.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_ADT_SPARSEBITVECTOR_H
 #define LLVM_ADT_SPARSEBITVECTOR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/ADT/SparseMultiSet.h b/llvm/include/llvm/ADT/SparseMultiSet.h
index d8dbe4023ea6479..453697b5f1ac6e4 100644
--- a/llvm/include/llvm/ADT/SparseMultiSet.h
+++ b/llvm/include/llvm/ADT/SparseMultiSet.h
@@ -24,6 +24,7 @@
 #include "llvm/ADT/identity.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/SparseSet.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <cstdlib>
diff --git a/llvm/include/llvm/ADT/SparseSet.h b/llvm/include/llvm/ADT/SparseSet.h
index 4a999e6b4c69a6d..591525c05551c13 100644
--- a/llvm/include/llvm/ADT/SparseSet.h
+++ b/llvm/include/llvm/ADT/SparseSet.h
@@ -23,6 +23,7 @@
 #include "llvm/ADT/identity.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/AllocatorBase.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <cstdlib>
diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h
index eec010e893228db..1e7f05bc3be86c0 100644
--- a/llvm/include/llvm/ADT/StringExtras.h
+++ b/llvm/include/llvm/ADT/StringExtras.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
index 466f95254d102e9..caa37792a1271d9 100644
--- a/llvm/include/llvm/ADT/StringMap.h
+++ b/llvm/include/llvm/ADT/StringMap.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/StringMapEntry.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/AllocatorBase.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
 #include <initializer_list>
 #include <iterator>
diff --git a/llvm/include/llvm/ADT/StringMapEntry.h b/llvm/include/llvm/ADT/StringMapEntry.h
index 98b51cc1aebd59e..393beceeca7da75 100644
--- a/llvm/include/llvm/ADT/StringMapEntry.h
+++ b/llvm/include/llvm/ADT/StringMapEntry.h
@@ -17,6 +17,7 @@
 #define LLVM_ADT_STRINGMAPENTRY_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/StringSet.h b/llvm/include/llvm/ADT/StringSet.h
index d7b63bc9c96852e..0dc9c2358bdd606 100644
--- a/llvm/include/llvm/ADT/StringSet.h
+++ b/llvm/include/llvm/ADT/StringSet.h
@@ -15,6 +15,7 @@
 #define LLVM_ADT_STRINGSET_H
 
 #include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/TinyPtrVector.h b/llvm/include/llvm/ADT/TinyPtrVector.h
index fa2bcd8933a0a2d..8309a06ab0a0d4d 100644
--- a/llvm/include/llvm/ADT/TinyPtrVector.h
+++ b/llvm/include/llvm/ADT/TinyPtrVector.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/ADT/Twine.h b/llvm/include/llvm/ADT/Twine.h
index ecd9d6df60ac613..547af57cad81423 100644
--- a/llvm/include/llvm/ADT/Twine.h
+++ b/llvm/include/llvm/ADT/Twine.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/ADT/UniqueVector.h b/llvm/include/llvm/ADT/UniqueVector.h
index bfea988f1702703..d1f36d6fde06256 100644
--- a/llvm/include/llvm/ADT/UniqueVector.h
+++ b/llvm/include/llvm/ADT/UniqueVector.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_ADT_UNIQUEVECTOR_H
 #define LLVM_ADT_UNIQUEVECTOR_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <map>
diff --git a/llvm/include/llvm/ADT/fallible_iterator.h b/llvm/include/llvm/ADT/fallible_iterator.h
index b42f62b67fd665d..d24b8644ae26bfd 100644
--- a/llvm/include/llvm/ADT/fallible_iterator.h
+++ b/llvm/include/llvm/ADT/fallible_iterator.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <type_traits>
diff --git a/llvm/include/llvm/ADT/ilist.h b/llvm/include/llvm/ADT/ilist.h
index aed19ccbff7f2de..d9adae6038a13ed 100644
--- a/llvm/include/llvm/ADT/ilist.h
+++ b/llvm/include/llvm/ADT/ilist.h
@@ -25,6 +25,7 @@
 #define LLVM_ADT_ILIST_H
 
 #include "llvm/ADT/simple_ilist.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/ADT/ilist_base.h b/llvm/include/llvm/ADT/ilist_base.h
index b8c098b951aded7..32e676b2779a897 100644
--- a/llvm/include/llvm/ADT/ilist_base.h
+++ b/llvm/include/llvm/ADT/ilist_base.h
@@ -10,6 +10,7 @@
 #define LLVM_ADT_ILIST_BASE_H
 
 #include "llvm/ADT/ilist_node_base.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ADT/ilist_iterator.h b/llvm/include/llvm/ADT/ilist_iterator.h
index be876347907bb2b..ad428241e4aa214 100644
--- a/llvm/include/llvm/ADT/ilist_iterator.h
+++ b/llvm/include/llvm/ADT/ilist_iterator.h
@@ -10,6 +10,7 @@
 #define LLVM_ADT_ILIST_ITERATOR_H
 
 #include "llvm/ADT/ilist_node.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/ADT/ilist_node.h b/llvm/include/llvm/ADT/ilist_node.h
index 7856b1c0d410e2c..f8af8fca6e7ef98 100644
--- a/llvm/include/llvm/ADT/ilist_node.h
+++ b/llvm/include/llvm/ADT/ilist_node.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/ilist_node_base.h"
 #include "llvm/ADT/ilist_node_options.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/ilist_node_base.h b/llvm/include/llvm/ADT/ilist_node_base.h
index f6c518e6eed7a17..04d6ede9c6a69a4 100644
--- a/llvm/include/llvm/ADT/ilist_node_base.h
+++ b/llvm/include/llvm/ADT/ilist_node_base.h
@@ -10,6 +10,7 @@
 #define LLVM_ADT_ILIST_NODE_BASE_H
 
 #include "llvm/ADT/PointerIntPair.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ADT/ilist_node_options.h b/llvm/include/llvm/ADT/ilist_node_options.h
index 05340d344e39988..e07cbcfd7bb83e0 100644
--- a/llvm/include/llvm/ADT/ilist_node_options.h
+++ b/llvm/include/llvm/ADT/ilist_node_options.h
@@ -10,6 +10,7 @@
 #define LLVM_ADT_ILIST_NODE_OPTIONS_H
 
 #include "llvm/Config/abi-breaking.h"
+#include "llvm/Support/Compiler.h"
 
 #include <type_traits>
 
diff --git a/llvm/include/llvm/ADT/iterator.h b/llvm/include/llvm/ADT/iterator.h
index 6f0c42fe08bec07..23065ea71cedad6 100644
--- a/llvm/include/llvm/ADT/iterator.h
+++ b/llvm/include/llvm/ADT/iterator.h
@@ -10,6 +10,7 @@
 #define LLVM_ADT_ITERATOR_H
 
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <iterator>
 #include <type_traits>
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 8da8d516499aa4e..bf57e200cae7d2a 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -43,6 +43,7 @@
 #include "llvm/Analysis/MemoryLocation.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ModRef.h"
 #include <cstdint>
 #include <functional>
diff --git a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
index 113115b871448b2..e12f90a66631efa 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
@@ -25,6 +25,7 @@
 #define LLVM_ANALYSIS_ALIASANALYSISEVALUATOR_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class AAResults;
diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h
index e485e1ff2f4c987..400c573634e0086 100644
--- a/llvm/include/llvm/Analysis/AliasSetTracker.h
+++ b/llvm/include/llvm/Analysis/AliasSetTracker.h
@@ -26,6 +26,7 @@
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/Analysis/AssumeBundleQueries.h b/llvm/include/llvm/Analysis/AssumeBundleQueries.h
index b3f499faa14edc2..a7cc4c72605ae55 100644
--- a/llvm/include/llvm/Analysis/AssumeBundleQueries.h
+++ b/llvm/include/llvm/Analysis/AssumeBundleQueries.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/IR/IntrinsicInst.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class AssumptionCache;
diff --git a/llvm/include/llvm/Analysis/AssumptionCache.h b/llvm/include/llvm/Analysis/AssumptionCache.h
index 12dd9b04c93231b..982b2927a5b7e8b 100644
--- a/llvm/include/llvm/Analysis/AssumptionCache.h
+++ b/llvm/include/llvm/Analysis/AssumptionCache.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
index ca67e0905c5f6ad..df4b5e533734de7 100644
--- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
@@ -17,6 +17,7 @@
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <optional>
 #include <utility>
diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
index 39507570a1b2c3f..1ce36da169ff697 100644
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
@@ -16,6 +16,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/BlockFrequency.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 #include <optional>
diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
index 9d96748874a04b8..6517c0c5d2e23fc 100644
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
@@ -30,6 +30,7 @@
 #include "llvm/Support/BlockFrequency.h"
 #include "llvm/Support/BranchProbability.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DOTGraphTraits.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Format.h"
diff --git a/llvm/include/llvm/Analysis/BranchProbabilityInfo.h b/llvm/include/llvm/Analysis/BranchProbabilityInfo.h
index fb02997371bfb87..a47fa7411558448 100644
--- a/llvm/include/llvm/Analysis/BranchProbabilityInfo.h
+++ b/llvm/include/llvm/Analysis/BranchProbabilityInfo.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/BranchProbability.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/Analysis/CFG.h b/llvm/include/llvm/Analysis/CFG.h
index 86b01c13274fec8..3974abaadb8cb1e 100644
--- a/llvm/include/llvm/Analysis/CFG.h
+++ b/llvm/include/llvm/Analysis/CFG.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/CFGPrinter.h b/llvm/include/llvm/Analysis/CFGPrinter.h
index 8c4c0c3f182f21f..7eded147e4201b7 100644
--- a/llvm/include/llvm/Analysis/CFGPrinter.h
+++ b/llvm/include/llvm/Analysis/CFGPrinter.h
@@ -27,6 +27,7 @@
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ProfDataUtils.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DOTGraphTraits.h"
 #include "llvm/Support/FormatVariadic.h"
 
diff --git a/llvm/include/llvm/Analysis/CFGSCCPrinter.h b/llvm/include/llvm/Analysis/CFGSCCPrinter.h
index d98071461f57876..58fe717b58b9711 100644
--- a/llvm/include/llvm/Analysis/CFGSCCPrinter.h
+++ b/llvm/include/llvm/Analysis/CFGSCCPrinter.h
@@ -10,6 +10,7 @@
 #define LLVM_ANALYSIS_CFGSCCPRINTER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h
index 0264b36a1d12ff3..026d48d0130e650 100644
--- a/llvm/include/llvm/Analysis/CGSCCPassManager.h
+++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h
@@ -92,6 +92,7 @@
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
 #include <utility>
diff --git a/llvm/include/llvm/Analysis/CallGraph.h b/llvm/include/llvm/Analysis/CallGraph.h
index 9413b39978e3fb3..542df9c7fda98a6 100644
--- a/llvm/include/llvm/Analysis/CallGraph.h
+++ b/llvm/include/llvm/Analysis/CallGraph.h
@@ -49,6 +49,7 @@
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Pass.h"
 #include <cassert>
 #include <map>
diff --git a/llvm/include/llvm/Analysis/CallGraphSCCPass.h b/llvm/include/llvm/Analysis/CallGraphSCCPass.h
index d0d81605436ea18..962ff4526afd1ae 100644
--- a/llvm/include/llvm/Analysis/CallGraphSCCPass.h
+++ b/llvm/include/llvm/Analysis/CallGraphSCCPass.h
@@ -22,6 +22,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/CallPrinter.h b/llvm/include/llvm/Analysis/CallPrinter.h
index d325d0010371745..d8211fd6d182b43 100644
--- a/llvm/include/llvm/Analysis/CallPrinter.h
+++ b/llvm/include/llvm/Analysis/CallPrinter.h
@@ -15,6 +15,7 @@
 #define LLVM_ANALYSIS_CALLPRINTER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/CaptureTracking.h b/llvm/include/llvm/Analysis/CaptureTracking.h
index a2d9277745e42f5..4dd952219020986 100644
--- a/llvm/include/llvm/Analysis/CaptureTracking.h
+++ b/llvm/include/llvm/Analysis/CaptureTracking.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/CmpInstAnalysis.h b/llvm/include/llvm/Analysis/CmpInstAnalysis.h
index 1d07a0c22887bbb..7ed53cd1ef61284 100644
--- a/llvm/include/llvm/Analysis/CmpInstAnalysis.h
+++ b/llvm/include/llvm/Analysis/CmpInstAnalysis.h
@@ -15,6 +15,7 @@
 #define LLVM_ANALYSIS_CMPINSTANALYSIS_H
 
 #include "llvm/IR/InstrTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
   class Type;
diff --git a/llvm/include/llvm/Analysis/CodeMetrics.h b/llvm/include/llvm/Analysis/CodeMetrics.h
index a9431bca11251a6..c078fee4c523b5f 100644
--- a/llvm/include/llvm/Analysis/CodeMetrics.h
+++ b/llvm/include/llvm/Analysis/CodeMetrics.h
@@ -15,6 +15,7 @@
 #define LLVM_ANALYSIS_CODEMETRICS_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/InstructionCost.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/ConstantFolding.h b/llvm/include/llvm/Analysis/ConstantFolding.h
index b11981c609ce1f5..3a105ce925faa88 100644
--- a/llvm/include/llvm/Analysis/ConstantFolding.h
+++ b/llvm/include/llvm/Analysis/ConstantFolding.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_ANALYSIS_CONSTANTFOLDING_H
 #define LLVM_ANALYSIS_CONSTANTFOLDING_H
 
+#include "llvm/Support/Compiler.h"
 #include <stdint.h>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/ConstraintSystem.h b/llvm/include/llvm/Analysis/ConstraintSystem.h
index 5d3bc64bf8b4b28..8d7101b29f9f28d 100644
--- a/llvm/include/llvm/Analysis/ConstraintSystem.h
+++ b/llvm/include/llvm/Analysis/ConstraintSystem.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 
 #include <string>
diff --git a/llvm/include/llvm/Analysis/CostModel.h b/llvm/include/llvm/Analysis/CostModel.h
index 649168050cec678..063a0337a6c2295 100644
--- a/llvm/include/llvm/Analysis/CostModel.h
+++ b/llvm/include/llvm/Analysis/CostModel.h
@@ -10,6 +10,7 @@
 #define LLVM_ANALYSIS_COSTMODEL_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 /// Printer pass for cost modeling results.
diff --git a/llvm/include/llvm/Analysis/CycleAnalysis.h b/llvm/include/llvm/Analysis/CycleAnalysis.h
index 30bf6856b69b0d3..f84861ceec87877 100644
--- a/llvm/include/llvm/Analysis/CycleAnalysis.h
+++ b/llvm/include/llvm/Analysis/CycleAnalysis.h
@@ -19,6 +19,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/SSAContext.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 extern template class GenericCycleInfo<SSAContext>;
diff --git a/llvm/include/llvm/Analysis/DDG.h b/llvm/include/llvm/Analysis/DDG.h
index bc599cb1f9a1545..45eae9363789556 100644
--- a/llvm/include/llvm/Analysis/DDG.h
+++ b/llvm/include/llvm/Analysis/DDG.h
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/DependenceAnalysis.h"
 #include "llvm/Analysis/DependenceGraphBuilder.h"
 #include "llvm/Analysis/LoopAnalysisManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Analysis/DDGPrinter.h b/llvm/include/llvm/Analysis/DDGPrinter.h
index d93c28280bac3b1..6fd11d0570d7a2b 100644
--- a/llvm/include/llvm/Analysis/DDGPrinter.h
+++ b/llvm/include/llvm/Analysis/DDGPrinter.h
@@ -16,6 +16,7 @@
 #define LLVM_ANALYSIS_DDGPRINTER_H
 
 #include "llvm/Analysis/DDG.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DOTGraphTraits.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index 07c08bc1cc3bcb6..cae56e6685872e3 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -14,6 +14,7 @@
 #define LLVM_ANALYSIS_DOTGRAPHTRAITSPASS_H
 
 #include "llvm/Analysis/CFGPrinter.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/GraphWriter.h"
 
diff --git a/llvm/include/llvm/Analysis/Delinearization.h b/llvm/include/llvm/Analysis/Delinearization.h
index 95a36b8b79a4bf0..a20a4742097bfeb 100644
--- a/llvm/include/llvm/Analysis/Delinearization.h
+++ b/llvm/include/llvm/Analysis/Delinearization.h
@@ -17,6 +17,7 @@
 #define LLVM_ANALYSIS_DELINEARIZATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class raw_ostream;
diff --git a/llvm/include/llvm/Analysis/DemandedBits.h b/llvm/include/llvm/Analysis/DemandedBits.h
index d7709b7423784af..133aed5bf4aa08d 100644
--- a/llvm/include/llvm/Analysis/DemandedBits.h
+++ b/llvm/include/llvm/Analysis/DemandedBits.h
@@ -25,6 +25,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/DependenceAnalysis.h b/llvm/include/llvm/Analysis/DependenceAnalysis.h
index 327315f831e11ba..d06b19ab64542b2 100644
--- a/llvm/include/llvm/Analysis/DependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/DependenceAnalysis.h
@@ -43,6 +43,7 @@
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
   class AAResults;
diff --git a/llvm/include/llvm/Analysis/DependenceGraphBuilder.h b/llvm/include/llvm/Analysis/DependenceGraphBuilder.h
index f490f20e7c19aa9..5f9657aa63caef9 100644
--- a/llvm/include/llvm/Analysis/DependenceGraphBuilder.h
+++ b/llvm/include/llvm/Analysis/DependenceGraphBuilder.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/EquivalenceClasses.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/DomPrinter.h b/llvm/include/llvm/Analysis/DomPrinter.h
index 83fe721346ab2ed..7d44da544e8b429 100644
--- a/llvm/include/llvm/Analysis/DomPrinter.h
+++ b/llvm/include/llvm/Analysis/DomPrinter.h
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/PostDominators.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h
index cef5e03b3b7a7c7..ea7a367deaa5db2 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontier.h
@@ -21,6 +21,7 @@
 #include "llvm/Config/llvm-config.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericDomTree.h"
 #include <cassert>
 #include <map>
diff --git a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
index 7a5f8f31bae392d..95ce0736eca952c 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Analysis/DominanceFrontier.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/GenericDomTree.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h b/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
index 85d98a05bbd7c18..fa2dd51e1c84284 100644
--- a/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
+++ b/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class DominatorTree;
diff --git a/llvm/include/llvm/Analysis/GlobalsModRef.h b/llvm/include/llvm/Analysis/GlobalsModRef.h
index ab8ab8295b556c1..865fd2f9ebeedf5 100644
--- a/llvm/include/llvm/Analysis/GlobalsModRef.h
+++ b/llvm/include/llvm/Analysis/GlobalsModRef.h
@@ -17,6 +17,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <list>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/GuardUtils.h b/llvm/include/llvm/Analysis/GuardUtils.h
index b83211535ec2341..589cc5f3082bb00 100644
--- a/llvm/include/llvm/Analysis/GuardUtils.h
+++ b/llvm/include/llvm/Analysis/GuardUtils.h
@@ -12,6 +12,8 @@
 #ifndef LLVM_ANALYSIS_GUARDUTILS_H
 #define LLVM_ANALYSIS_GUARDUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class BasicBlock;
diff --git a/llvm/include/llvm/Analysis/HeatUtils.h b/llvm/include/llvm/Analysis/HeatUtils.h
index 9ecbbaf318da9cd..2fbc99d4f01ba46 100644
--- a/llvm/include/llvm/Analysis/HeatUtils.h
+++ b/llvm/include/llvm/Analysis/HeatUtils.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_ANALYSIS_HEATUTILS_H
 #define LLVM_ANALYSIS_HEATUTILS_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <string>
 
diff --git a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
index ad137baff5d4289..bef9da329fe1947 100644
--- a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
+++ b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
@@ -54,6 +54,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/IVDescriptors.h b/llvm/include/llvm/Analysis/IVDescriptors.h
index 42826cd4e660a36..4324f413e8b00af 100644
--- a/llvm/include/llvm/Analysis/IVDescriptors.h
+++ b/llvm/include/llvm/Analysis/IVDescriptors.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/IVUsers.h b/llvm/include/llvm/Analysis/IVUsers.h
index 6b9b6bf190f1c8d..e7098b74094b326 100644
--- a/llvm/include/llvm/Analysis/IVUsers.h
+++ b/llvm/include/llvm/Analysis/IVUsers.h
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/LoopPass.h"
 #include "llvm/Analysis/ScalarEvolutionNormalization.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h b/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h
index 8a05e913a91063b..3124d3872a53fda 100644
--- a/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h
+++ b/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h
@@ -14,6 +14,7 @@
 #define LLVM_ANALYSIS_INDIRECTCALLPROMOTIONANALYSIS_H
 
 #include "llvm/ProfileData/InstrProf.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/IndirectCallVisitor.h b/llvm/include/llvm/Analysis/IndirectCallVisitor.h
index 0825e19ecd2d240..d23d95f7dc69b9f 100644
--- a/llvm/include/llvm/Analysis/IndirectCallVisitor.h
+++ b/llvm/include/llvm/Analysis/IndirectCallVisitor.h
@@ -13,6 +13,7 @@
 #define LLVM_ANALYSIS_INDIRECTCALLVISITOR_H
 
 #include "llvm/IR/InstVisitor.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/InlineAdvisor.h b/llvm/include/llvm/Analysis/InlineAdvisor.h
index 53c018d15cd71a6..c705d7afb2219bf 100644
--- a/llvm/include/llvm/Analysis/InlineAdvisor.h
+++ b/llvm/include/llvm/Analysis/InlineAdvisor.h
@@ -14,6 +14,7 @@
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/Config/llvm-config.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/InlineCost.h b/llvm/include/llvm/Analysis/InlineCost.h
index 57f452853d2d6d6..d309a58b2a6fa1d 100644
--- a/llvm/include/llvm/Analysis/InlineCost.h
+++ b/llvm/include/llvm/Analysis/InlineCost.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/Analysis/InlineModelFeatureMaps.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <climits>
 #include <optional>
diff --git a/llvm/include/llvm/Analysis/InlineOrder.h b/llvm/include/llvm/Analysis/InlineOrder.h
index a1d25a25b8568f7..ed3971b5013b76c 100644
--- a/llvm/include/llvm/Analysis/InlineOrder.h
+++ b/llvm/include/llvm/Analysis/InlineOrder.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/Analysis/InlineCost.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h b/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h
index 0aae696a98a928a..4981ae646bfc5f3 100644
--- a/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h
+++ b/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h
@@ -11,6 +11,7 @@
 #define LLVM_ANALYSIS_INLINESIZEESTIMATORANALYSIS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Analysis/InstCount.h b/llvm/include/llvm/Analysis/InstCount.h
index e5ce822caf6efaa..44cb9228f4be7fe 100644
--- a/llvm/include/llvm/Analysis/InstCount.h
+++ b/llvm/include/llvm/Analysis/InstCount.h
@@ -14,6 +14,7 @@
 #define LLVM_ANALYSIS_INSTCOUNT_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/InstSimplifyFolder.h b/llvm/include/llvm/Analysis/InstSimplifyFolder.h
index 16bd9f76542124f..f3d9d3cc13d33dd 100644
--- a/llvm/include/llvm/Analysis/InstSimplifyFolder.h
+++ b/llvm/include/llvm/Analysis/InstSimplifyFolder.h
@@ -24,6 +24,7 @@
 #include "llvm/Analysis/TargetFolder.h"
 #include "llvm/IR/IRBuilderFolder.h"
 #include "llvm/IR/Instruction.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Constant;
diff --git a/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h b/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h
index 192630e62a54cf3..f42e8799eba6c36 100644
--- a/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h
+++ b/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h
@@ -21,6 +21,7 @@
 #define LLVM_ANALYSIS_INSTRUCTIONPRECEDENCETRACKING_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/InstructionSimplify.h b/llvm/include/llvm/Analysis/InstructionSimplify.h
index df0784664eadc86..aa33fb1a6e2de3e 100644
--- a/llvm/include/llvm/Analysis/InstructionSimplify.h
+++ b/llvm/include/llvm/Analysis/InstructionSimplify.h
@@ -32,6 +32,7 @@
 #define LLVM_ANALYSIS_INSTRUCTIONSIMPLIFY_H
 
 #include "llvm/IR/PatternMatch.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/InteractiveModelRunner.h b/llvm/include/llvm/Analysis/InteractiveModelRunner.h
index 680dc4249d80b17..71346d188fd126c 100644
--- a/llvm/include/llvm/Analysis/InteractiveModelRunner.h
+++ b/llvm/include/llvm/Analysis/InteractiveModelRunner.h
@@ -14,6 +14,7 @@
 #include "llvm/Analysis/TensorSpec.h"
 #include "llvm/Analysis/Utils/TrainingLogger.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/raw_ostream.h"
 #include <system_error>
diff --git a/llvm/include/llvm/Analysis/Interval.h b/llvm/include/llvm/Analysis/Interval.h
index 9afe659d00dd3dd..9cfcd32f949fdc8 100644
--- a/llvm/include/llvm/Analysis/Interval.h
+++ b/llvm/include/llvm/Analysis/Interval.h
@@ -20,6 +20,7 @@
 #define LLVM_ANALYSIS_INTERVAL_H
 
 #include "llvm/ADT/GraphTraits.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/IntervalIterator.h b/llvm/include/llvm/Analysis/IntervalIterator.h
index cbb7cac1c508c57..4ce3c28f4fa6c55 100644
--- a/llvm/include/llvm/Analysis/IntervalIterator.h
+++ b/llvm/include/llvm/Analysis/IntervalIterator.h
@@ -36,6 +36,7 @@
 #include "llvm/Analysis/Interval.h"
 #include "llvm/Analysis/IntervalPartition.h"
 #include "llvm/IR/CFG.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <iterator>
diff --git a/llvm/include/llvm/Analysis/IntervalPartition.h b/llvm/include/llvm/Analysis/IntervalPartition.h
index 66a99fb15bfb9fd..16bdfb945dc6f9d 100644
--- a/llvm/include/llvm/Analysis/IntervalPartition.h
+++ b/llvm/include/llvm/Analysis/IntervalPartition.h
@@ -23,6 +23,7 @@
 #define LLVM_ANALYSIS_INTERVALPARTITION_H
 
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <vector>
 
diff --git a/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h b/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h
index 542a741ee07ee16..a313bdf87654eba 100644
--- a/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_ANALYSIS_ITERATEDDOMINANCEFRONTIER_H
 #define LLVM_ANALYSIS_ITERATEDDOMINANCEFRONTIER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/CFGDiff.h"
 #include "llvm/Support/GenericIteratedDominanceFrontier.h"
 
diff --git a/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h b/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h
index a6d8b76b12aea24..86cba8a54bea7b9 100644
--- a/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h
+++ b/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h
@@ -18,6 +18,7 @@
 
 #include "llvm/Analysis/BlockFrequencyInfo.h"
 #include "llvm/Analysis/LazyBranchProbabilityInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Pass.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h b/llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h
index bad7423616b453b..4083389dbcf6cd1 100644
--- a/llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h
+++ b/llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h
@@ -17,6 +17,7 @@
 #define LLVM_ANALYSIS_LAZYBRANCHPROBABILITYINFO_H
 
 #include "llvm/Analysis/BranchProbabilityInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Pass.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h
index 211a058aa0173d6..a51b169547d057c 100644
--- a/llvm/include/llvm/Analysis/LazyCallGraph.h
+++ b/llvm/include/llvm/Analysis/LazyCallGraph.h
@@ -45,6 +45,7 @@
 #include "llvm/Analysis/TargetLibraryInfo.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
 #include <iterator>
diff --git a/llvm/include/llvm/Analysis/LazyValueInfo.h b/llvm/include/llvm/Analysis/LazyValueInfo.h
index b109b7f7e65ae7c..6125b26f8be0728 100644
--- a/llvm/include/llvm/Analysis/LazyValueInfo.h
+++ b/llvm/include/llvm/Analysis/LazyValueInfo.h
@@ -16,6 +16,7 @@
 
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
   class AssumptionCache;
diff --git a/llvm/include/llvm/Analysis/Lint.h b/llvm/include/llvm/Analysis/Lint.h
index 8dffa1ecb5f388f..bd26851ed9a77c3 100644
--- a/llvm/include/llvm/Analysis/Lint.h
+++ b/llvm/include/llvm/Analysis/Lint.h
@@ -19,6 +19,7 @@
 #define LLVM_ANALYSIS_LINT_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/Loads.h b/llvm/include/llvm/Analysis/Loads.h
index 2880ed33a34cbc6..8520ca0afc3a76d 100644
--- a/llvm/include/llvm/Analysis/Loads.h
+++ b/llvm/include/llvm/Analysis/Loads.h
@@ -15,6 +15,7 @@
 
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
index 2b3092aa6614c5f..6694724273e18f5 100644
--- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
@@ -19,6 +19,7 @@
 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
 #include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/LoopAnalysisManager.h b/llvm/include/llvm/Analysis/LoopAnalysisManager.h
index d22675a308aac75..a039e9143a2510c 100644
--- a/llvm/include/llvm/Analysis/LoopAnalysisManager.h
+++ b/llvm/include/llvm/Analysis/LoopAnalysisManager.h
@@ -30,6 +30,7 @@
 #define LLVM_ANALYSIS_LOOPANALYSISMANAGER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/LoopCacheAnalysis.h b/llvm/include/llvm/Analysis/LoopCacheAnalysis.h
index c9e853b9be8e69b..b2a7c6808f98d9c 100644
--- a/llvm/include/llvm/Analysis/LoopCacheAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopCacheAnalysis.h
@@ -16,6 +16,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h
index 3434630c27cfe74..52ed6bea3ea40ba 100644
--- a/llvm/include/llvm/Analysis/LoopInfo.h
+++ b/llvm/include/llvm/Analysis/LoopInfo.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericLoopInfo.h"
 #include <algorithm>
 #include <optional>
diff --git a/llvm/include/llvm/Analysis/LoopIterator.h b/llvm/include/llvm/Analysis/LoopIterator.h
index 360f196a80daf4b..9d16479484d7886 100644
--- a/llvm/include/llvm/Analysis/LoopIterator.h
+++ b/llvm/include/llvm/Analysis/LoopIterator.h
@@ -25,6 +25,7 @@
 
 #include "llvm/ADT/PostOrderIterator.h"
 #include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/LoopNestAnalysis.h b/llvm/include/llvm/Analysis/LoopNestAnalysis.h
index 852a6c438d43aaa..7751dae96c7cc3f 100644
--- a/llvm/include/llvm/Analysis/LoopNestAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopNestAnalysis.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/LoopPass.h b/llvm/include/llvm/Analysis/LoopPass.h
index c5f08d0ae8af68a..608712ba7f6dd79 100644
--- a/llvm/include/llvm/Analysis/LoopPass.h
+++ b/llvm/include/llvm/Analysis/LoopPass.h
@@ -16,6 +16,7 @@
 
 #include "llvm/IR/LegacyPassManagers.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <deque>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h b/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
index eada6a647763ba2..6014942558e71c7 100644
--- a/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
+++ b/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Analysis/ScalarEvolution.h"
 #include "llvm/IR/InstVisitor.h"
+#include "llvm/Support/Compiler.h"
 
 // This class is used to get an estimate of the optimization effects that we
 // could get from complete loop unrolling. It comes from the fact that some
diff --git a/llvm/include/llvm/Analysis/MLInlineAdvisor.h b/llvm/include/llvm/Analysis/MLInlineAdvisor.h
index f58862e533529c8..8ece7f5343da21c 100644
--- a/llvm/include/llvm/Analysis/MLInlineAdvisor.h
+++ b/llvm/include/llvm/Analysis/MLInlineAdvisor.h
@@ -14,6 +14,7 @@
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/Analysis/MLModelRunner.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 #include <deque>
 #include <map>
diff --git a/llvm/include/llvm/Analysis/MLModelRunner.h b/llvm/include/llvm/Analysis/MLModelRunner.h
index 903411fbdf7ecf1..b8c64ac1ee92d1f 100644
--- a/llvm/include/llvm/Analysis/MLModelRunner.h
+++ b/llvm/include/llvm/Analysis/MLModelRunner.h
@@ -12,6 +12,7 @@
 
 #include "llvm/Analysis/TensorSpec.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LLVMContext;
diff --git a/llvm/include/llvm/Analysis/MemDerefPrinter.h b/llvm/include/llvm/Analysis/MemDerefPrinter.h
index bafdc543eeaf4c3..0166c15b6f4222c 100644
--- a/llvm/include/llvm/Analysis/MemDerefPrinter.h
+++ b/llvm/include/llvm/Analysis/MemDerefPrinter.h
@@ -10,6 +10,7 @@
 #define LLVM_ANALYSIS_MEMDEREFPRINTER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MemDerefPrinterPass : public PassInfoMixin<MemDerefPrinterPass> {
diff --git a/llvm/include/llvm/Analysis/MemoryBuiltins.h b/llvm/include/llvm/Analysis/MemoryBuiltins.h
index 711bbf6a0afe5f6..f1d62ddd3ef9941 100644
--- a/llvm/include/llvm/Analysis/MemoryBuiltins.h
+++ b/llvm/include/llvm/Analysis/MemoryBuiltins.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/InstVisitor.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <optional>
 #include <utility>
diff --git a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
index 27185aa9942e4e3..dcedd8c76f387a7 100644
--- a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/PredIteratorCache.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/MemoryLocation.h b/llvm/include/llvm/Analysis/MemoryLocation.h
index 85ca84e68a13971..fbf739315dc468c 100644
--- a/llvm/include/llvm/Analysis/MemoryLocation.h
+++ b/llvm/include/llvm/Analysis/MemoryLocation.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/IR/Metadata.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/TypeSize.h"
 
 #include <optional>
diff --git a/llvm/include/llvm/Analysis/MemoryProfileInfo.h b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
index 355bff46f6279f5..baf1cbca64fac57 100644
--- a/llvm/include/llvm/Analysis/MemoryProfileInfo.h
+++ b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
@@ -18,6 +18,7 @@
 #include "llvm/IR/Metadata.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index 94d7f1a78b8470c..40b83fb9569abcf 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -98,6 +98,7 @@
 #include "llvm/IR/Type.h"
 #include "llvm/IR/User.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/Analysis/MemorySSAUpdater.h b/llvm/include/llvm/Analysis/MemorySSAUpdater.h
index 2bcd1a462871643..e1455e4c8a306b8 100644
--- a/llvm/include/llvm/Analysis/MemorySSAUpdater.h
+++ b/llvm/include/llvm/Analysis/MemorySSAUpdater.h
@@ -37,6 +37,7 @@
 #include "llvm/Analysis/MemorySSA.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/IR/ValueMap.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/CFGDiff.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h b/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h
index fa91e4f653d04d0..9e9fc1d59320d78 100644
--- a/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h
+++ b/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h
@@ -11,6 +11,7 @@
 
 #include "llvm/IR/DebugInfo.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class raw_ostream;
diff --git a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
index e36dea58cec454d..f89b396b500e236 100644
--- a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
+++ b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
@@ -16,6 +16,7 @@
 #include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <optional>
 
diff --git a/llvm/include/llvm/Analysis/MustExecute.h b/llvm/include/llvm/Analysis/MustExecute.h
index 9c97bd1725ac2c9..e2cd7349b5dba55 100644
--- a/llvm/include/llvm/Analysis/MustExecute.h
+++ b/llvm/include/llvm/Analysis/MustExecute.h
@@ -28,6 +28,7 @@
 #include "llvm/Analysis/InstructionPrecedenceTracking.h"
 #include "llvm/IR/EHPersonalities.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/NoInferenceModelRunner.h b/llvm/include/llvm/Analysis/NoInferenceModelRunner.h
index 980b40500d7cc3e..4a6f0f57f329525 100644
--- a/llvm/include/llvm/Analysis/NoInferenceModelRunner.h
+++ b/llvm/include/llvm/Analysis/NoInferenceModelRunner.h
@@ -13,6 +13,7 @@
 #include "llvm/Analysis/MLModelRunner.h"
 #include "llvm/Analysis/TensorSpec.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 namespace llvm {
 /// A pseudo model runner. We use it to store feature values when collecting
 /// logs for the default policy, in 'development' mode, but never ask it to
diff --git a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
index 1a154c648fe6115..b56651e84b59630 100644
--- a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
@@ -24,6 +24,7 @@
 
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace objcarc {
diff --git a/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h b/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h
index 20ff5a5bc6e0340..c191132ebff7a0a 100644
--- a/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h
+++ b/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h
@@ -27,6 +27,7 @@
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/ObjCARCInstKind.h b/llvm/include/llvm/Analysis/ObjCARCInstKind.h
index e332bcf88be79b5..da27ee752df4a39 100644
--- a/llvm/include/llvm/Analysis/ObjCARCInstKind.h
+++ b/llvm/include/llvm/Analysis/ObjCARCInstKind.h
@@ -10,6 +10,7 @@
 #define LLVM_ANALYSIS_OBJCARCINSTKIND_H
 
 #include "llvm/IR/Instructions.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace objcarc {
diff --git a/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h b/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h
index 8aaeaf29910293b..64a022fcd317cb8 100644
--- a/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h
+++ b/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h
@@ -18,6 +18,7 @@
 #include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/OverflowInstAnalysis.h b/llvm/include/llvm/Analysis/OverflowInstAnalysis.h
index 761d20f17a8b832..49e0207038cdcd6 100644
--- a/llvm/include/llvm/Analysis/OverflowInstAnalysis.h
+++ b/llvm/include/llvm/Analysis/OverflowInstAnalysis.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_ANALYSIS_OVERFLOWINSTANALYSIS_H
 #define LLVM_ANALYSIS_OVERFLOWINSTANALYSIS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class Use;
 class Value;
diff --git a/llvm/include/llvm/Analysis/PHITransAddr.h b/llvm/include/llvm/Analysis/PHITransAddr.h
index de9c3c4fd292132..364fcd82710cb38 100644
--- a/llvm/include/llvm/Analysis/PHITransAddr.h
+++ b/llvm/include/llvm/Analysis/PHITransAddr.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/Instruction.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class AssumptionCache;
diff --git a/llvm/include/llvm/Analysis/Passes.h b/llvm/include/llvm/Analysis/Passes.h
index ac1bc3549910c8c..63df72c33f8b798 100644
--- a/llvm/include/llvm/Analysis/Passes.h
+++ b/llvm/include/llvm/Analysis/Passes.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_ANALYSIS_PASSES_H
 #define LLVM_ANALYSIS_PASSES_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
   class FunctionPass;
   class ImmutablePass;
diff --git a/llvm/include/llvm/Analysis/PhiValues.h b/llvm/include/llvm/Analysis/PhiValues.h
index ecbb8874b378e25..7ee5dc05bae480d 100644
--- a/llvm/include/llvm/Analysis/PhiValues.h
+++ b/llvm/include/llvm/Analysis/PhiValues.h
@@ -24,6 +24,7 @@
 #include "llvm/ADT/SetVector.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Pass.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/PostDominators.h b/llvm/include/llvm/Analysis/PostDominators.h
index 4383113c8db11e8..e2a0e37b1a91f16 100644
--- a/llvm/include/llvm/Analysis/PostDominators.h
+++ b/llvm/include/llvm/Analysis/PostDominators.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Pass.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
index 38eb71ba271d06b..ae771016767a342 100644
--- a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
+++ b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
@@ -21,6 +21,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ProfileSummary.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <optional>
 
diff --git a/llvm/include/llvm/Analysis/PtrUseVisitor.h b/llvm/include/llvm/Analysis/PtrUseVisitor.h
index 86206b2d5e9f883..fbac51f1d12aaa2 100644
--- a/llvm/include/llvm/Analysis/PtrUseVisitor.h
+++ b/llvm/include/llvm/Analysis/PtrUseVisitor.h
@@ -29,6 +29,7 @@
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/InstVisitor.h"
 #include "llvm/IR/IntrinsicInst.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <type_traits>
 
diff --git a/llvm/include/llvm/Analysis/RegionInfo.h b/llvm/include/llvm/Analysis/RegionInfo.h
index 612b977f1ffa45d..7bbc35a1e65d858 100644
--- a/llvm/include/llvm/Analysis/RegionInfo.h
+++ b/llvm/include/llvm/Analysis/RegionInfo.h
@@ -45,6 +45,7 @@
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <map>
diff --git a/llvm/include/llvm/Analysis/RegionIterator.h b/llvm/include/llvm/Analysis/RegionIterator.h
index ba28b1b902ead28..ee0d857a44b935b 100644
--- a/llvm/include/llvm/Analysis/RegionIterator.h
+++ b/llvm/include/llvm/Analysis/RegionIterator.h
@@ -15,6 +15,7 @@
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/Analysis/RegionInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <iterator>
 #include <type_traits>
diff --git a/llvm/include/llvm/Analysis/RegionPass.h b/llvm/include/llvm/Analysis/RegionPass.h
index dd5e6a1a3b24936..2b23a20752504a6 100644
--- a/llvm/include/llvm/Analysis/RegionPass.h
+++ b/llvm/include/llvm/Analysis/RegionPass.h
@@ -17,6 +17,7 @@
 
 #include "llvm/IR/LegacyPassManagers.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <deque>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/RegionPrinter.h b/llvm/include/llvm/Analysis/RegionPrinter.h
index 501a5406236e926..3c38e58b41c56e6 100644
--- a/llvm/include/llvm/Analysis/RegionPrinter.h
+++ b/llvm/include/llvm/Analysis/RegionPrinter.h
@@ -16,6 +16,7 @@
 
 #include "llvm/Analysis/DOTGraphTraitsPass.h"
 #include "llvm/Analysis/RegionInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
   class FunctionPass;
diff --git a/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h b/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h
index 91855138fe18e61..c0ce5dfadf6e416 100644
--- a/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h
+++ b/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h
@@ -16,6 +16,7 @@
 
 #include "llvm/Analysis/MLModelRunner.h"
 #include "llvm/Analysis/TensorSpec.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 
 #include <memory>
diff --git a/llvm/include/llvm/Analysis/ReplayInlineAdvisor.h b/llvm/include/llvm/Analysis/ReplayInlineAdvisor.h
index 0c5b566f60a4704..71abd958ee6bd3a 100644
--- a/llvm/include/llvm/Analysis/ReplayInlineAdvisor.h
+++ b/llvm/include/llvm/Analysis/ReplayInlineAdvisor.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Analysis/InlineAdvisor.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class CallBase;
diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h
index c108a7ae9c9b59d..3bdc15f47397f3c 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -36,6 +36,7 @@
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/IR/ValueMap.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
index 53959b6c69ca57e..4182091f84f59e3 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionDivision.h b/llvm/include/llvm/Analysis/ScalarEvolutionDivision.h
index 3283d438ccb515c..055e50c415c296b 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionDivision.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionDivision.h
@@ -14,6 +14,7 @@
 #define LLVM_ANALYSIS_SCALAREVOLUTIONDIVISION_H
 
 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
index 91848a91c17e6e6..1a53dd54796fc6f 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -21,6 +21,7 @@
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h b/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h
index b34db8f5a03a398..8899e72133b9aeb 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h
@@ -37,6 +37,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
index f6ade7c83a61af3..87b41c4ce101867 100644
--- a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
+++ b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
@@ -17,6 +17,7 @@
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/SparsePropagation.h b/llvm/include/llvm/Analysis/SparsePropagation.h
index d5805a7314757f6..daacd91fb58b2e6 100644
--- a/llvm/include/llvm/Analysis/SparsePropagation.h
+++ b/llvm/include/llvm/Analysis/SparsePropagation.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Instructions.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include <set>
 
diff --git a/llvm/include/llvm/Analysis/StackLifetime.h b/llvm/include/llvm/Analysis/StackLifetime.h
index 7fd88362276a190..c95277baf2343ab 100644
--- a/llvm/include/llvm/Analysis/StackLifetime.h
+++ b/llvm/include/llvm/Analysis/StackLifetime.h
@@ -15,6 +15,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <utility>
 
diff --git a/llvm/include/llvm/Analysis/StackSafetyAnalysis.h b/llvm/include/llvm/Analysis/StackSafetyAnalysis.h
index 751735f3e59f6e8..f8611da024c519b 100644
--- a/llvm/include/llvm/Analysis/StackSafetyAnalysis.h
+++ b/llvm/include/llvm/Analysis/StackSafetyAnalysis.h
@@ -16,6 +16,7 @@
 #include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/SyntheticCountsUtils.h b/llvm/include/llvm/Analysis/SyntheticCountsUtils.h
index 5a6c7dd53c7e557..2b630bbd3d4b929 100644
--- a/llvm/include/llvm/Analysis/SyntheticCountsUtils.h
+++ b/llvm/include/llvm/Analysis/SyntheticCountsUtils.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/Analysis/CallGraph.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ScaledNumber.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/TargetFolder.h b/llvm/include/llvm/Analysis/TargetFolder.h
index 3d9edf132dc107f..58fe1ec4ee11759 100644
--- a/llvm/include/llvm/Analysis/TargetFolder.h
+++ b/llvm/include/llvm/Analysis/TargetFolder.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/IRBuilderFolder.h"
 #include "llvm/IR/Operator.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
index 6f045fa30661174..c29c38cf5504854 100644
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Pass.h"
 #include "llvm/TargetParser/Triple.h"
 #include <optional>
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index 1ae595d2110457d..4d48826e95b9742 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -28,6 +28,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/AtomicOrdering.h"
 #include "llvm/Support/BranchProbability.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/InstructionCost.h"
 #include <functional>
 #include <optional>
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index b34eaa3d6f7dd7d..a2e3d41ee4a740d 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Operator.h"
 #include "llvm/IR/PatternMatch.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <utility>
 
diff --git a/llvm/include/llvm/Analysis/TensorSpec.h b/llvm/include/llvm/Analysis/TensorSpec.h
index c50507b7a6b1144..599db5c1c0a865d 100644
--- a/llvm/include/llvm/Analysis/TensorSpec.h
+++ b/llvm/include/llvm/Analysis/TensorSpec.h
@@ -13,6 +13,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/IR/LLVMContext.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/JSON.h"
 
 #include <memory>
diff --git a/llvm/include/llvm/Analysis/Trace.h b/llvm/include/llvm/Analysis/Trace.h
index a1ffd03c4053030..acc72812eadbef4 100644
--- a/llvm/include/llvm/Analysis/Trace.h
+++ b/llvm/include/llvm/Analysis/Trace.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_ANALYSIS_TRACE_H
 #define LLVM_ANALYSIS_TRACE_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <vector>
 
diff --git a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
index 36dd39c033aa63d..10f7526518e4ab0 100644
--- a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/TypeMetadataUtils.h b/llvm/include/llvm/Analysis/TypeMetadataUtils.h
index dab67aad1ab0eb7..c334c540e935cfe 100644
--- a/llvm/include/llvm/Analysis/TypeMetadataUtils.h
+++ b/llvm/include/llvm/Analysis/TypeMetadataUtils.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_ANALYSIS_TYPEMETADATAUTILS_H
 #define LLVM_ANALYSIS_TYPEMETADATAUTILS_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Analysis/UniformityAnalysis.h b/llvm/include/llvm/Analysis/UniformityAnalysis.h
index f42c4950ed649fd..04ba816430b674e 100644
--- a/llvm/include/llvm/Analysis/UniformityAnalysis.h
+++ b/llvm/include/llvm/Analysis/UniformityAnalysis.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/GenericUniformityInfo.h"
 #include "llvm/Analysis/CycleAnalysis.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h b/llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h
index 45ef4dbe2155e3b..48497f5543d6ef1 100644
--- a/llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h
+++ b/llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h
@@ -15,6 +15,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <vector>
 
diff --git a/llvm/include/llvm/Analysis/Utils/Local.h b/llvm/include/llvm/Analysis/Utils/Local.h
index e1dbfd3e5f37c01..68cbd8907da9397 100644
--- a/llvm/include/llvm/Analysis/Utils/Local.h
+++ b/llvm/include/llvm/Analysis/Utils/Local.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_ANALYSIS_UTILS_LOCAL_H
 #define LLVM_ANALYSIS_UTILS_LOCAL_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class DataLayout;
diff --git a/llvm/include/llvm/Analysis/Utils/TrainingLogger.h b/llvm/include/llvm/Analysis/Utils/TrainingLogger.h
index 8f46779a732d15e..d59a3dbe53c9e9f 100644
--- a/llvm/include/llvm/Analysis/Utils/TrainingLogger.h
+++ b/llvm/include/llvm/Analysis/Utils/TrainingLogger.h
@@ -58,6 +58,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/Analysis/TensorSpec.h"
 #include "llvm/IR/LLVMContext.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/JSON.h"
 
 #include <memory>
diff --git a/llvm/include/llvm/Analysis/ValueLattice.h b/llvm/include/llvm/Analysis/ValueLattice.h
index 5ae32b5e775e5b5..1da5eb3c61efbd0 100644
--- a/llvm/include/llvm/Analysis/ValueLattice.h
+++ b/llvm/include/llvm/Analysis/ValueLattice.h
@@ -12,6 +12,7 @@
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/ConstantRange.h"
 #include "llvm/IR/Instructions.h"
+#include "llvm/Support/Compiler.h"
 
 //===----------------------------------------------------------------------===//
 //                               ValueLatticeElement
diff --git a/llvm/include/llvm/Analysis/ValueLatticeUtils.h b/llvm/include/llvm/Analysis/ValueLatticeUtils.h
index a3bbb96129bffc5..6a1db715b854e59 100644
--- a/llvm/include/llvm/Analysis/ValueLatticeUtils.h
+++ b/llvm/include/llvm/Analysis/ValueLatticeUtils.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_ANALYSIS_VALUELATTICEUTILS_H
 #define LLVM_ANALYSIS_VALUELATTICEUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class Function;
diff --git a/llvm/include/llvm/Analysis/ValueTracking.h b/llvm/include/llvm/Analysis/ValueTracking.h
index 44e083c63c82c05..ca792b679653fa1 100644
--- a/llvm/include/llvm/Analysis/ValueTracking.h
+++ b/llvm/include/llvm/Analysis/ValueTracking.h
@@ -20,6 +20,7 @@
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Intrinsics.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 
diff --git a/llvm/include/llvm/Analysis/VectorUtils.h b/llvm/include/llvm/Analysis/VectorUtils.h
index ad69f5711abd483..6cc39ed9b194dad 100644
--- a/llvm/include/llvm/Analysis/VectorUtils.h
+++ b/llvm/include/llvm/Analysis/VectorUtils.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Analysis/LoopAccessAnalysis.h"
 #include "llvm/Support/CheckedArithmetic.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class TargetLibraryInfo;
diff --git a/llvm/include/llvm/AsmParser/LLLexer.h b/llvm/include/llvm/AsmParser/LLLexer.h
index bd929db33c4a2bb..a45d1cb885d008b 100644
--- a/llvm/include/llvm/AsmParser/LLLexer.h
+++ b/llvm/include/llvm/AsmParser/LLLexer.h
@@ -16,6 +16,7 @@
 #include "LLToken.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APSInt.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <string>
 
diff --git a/llvm/include/llvm/AsmParser/LLParser.h b/llvm/include/llvm/AsmParser/LLParser.h
index eca908a24aac7b2..bb16097caf2cf23 100644
--- a/llvm/include/llvm/AsmParser/LLParser.h
+++ b/llvm/include/llvm/AsmParser/LLParser.h
@@ -20,6 +20,7 @@
 #include "llvm/IR/FMF.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ModRef.h"
 #include <map>
 #include <optional>
diff --git a/llvm/include/llvm/AsmParser/Parser.h b/llvm/include/llvm/AsmParser/Parser.h
index c57e7abe554dbd2..397b2206be2a954 100644
--- a/llvm/include/llvm/AsmParser/Parser.h
+++ b/llvm/include/llvm/AsmParser/Parser.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <optional>
 
diff --git a/llvm/include/llvm/AsmParser/SlotMapping.h b/llvm/include/llvm/AsmParser/SlotMapping.h
index 0e95eb816b4c6c1..78208313d97d05b 100644
--- a/llvm/include/llvm/AsmParser/SlotMapping.h
+++ b/llvm/include/llvm/AsmParser/SlotMapping.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/IR/TrackingMDRef.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <vector>
 
diff --git a/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h b/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
index f6268b48e6b29a7..ca93b57b94e4771 100644
--- a/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
+++ b/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/MsgPackReader.h"
+#include "llvm/Support/Compiler.h"
 
 #include <cstddef>
 #include <optional>
diff --git a/llvm/include/llvm/BinaryFormat/COFF.h b/llvm/include/llvm/BinaryFormat/COFF.h
index d2ec2a2f67e54cb..278094681849ace 100644
--- a/llvm/include/llvm/BinaryFormat/COFF.h
+++ b/llvm/include/llvm/BinaryFormat/COFF.h
@@ -22,6 +22,7 @@
 #ifndef LLVM_BINARYFORMAT_COFF_H
 #define LLVM_BINARYFORMAT_COFF_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <cassert>
 
diff --git a/llvm/include/llvm/BinaryFormat/DXContainer.h b/llvm/include/llvm/BinaryFormat/DXContainer.h
index f202f1bf6dff180..dd4c89b18246c40 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainer.h
+++ b/llvm/include/llvm/BinaryFormat/DXContainer.h
@@ -14,6 +14,7 @@
 #define LLVM_BINARYFORMAT_DXCONTAINER_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SwapByteOrder.h"
 #include "llvm/TargetParser/Triple.h"
 
diff --git a/llvm/include/llvm/BinaryFormat/ELF.h b/llvm/include/llvm/BinaryFormat/ELF.h
index a303d404f9be43c..e16bf6c72929b0f 100644
--- a/llvm/include/llvm/BinaryFormat/ELF.h
+++ b/llvm/include/llvm/BinaryFormat/ELF.h
@@ -20,6 +20,7 @@
 #define LLVM_BINARYFORMAT_ELF_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <cstring>
 
diff --git a/llvm/include/llvm/BinaryFormat/Magic.h b/llvm/include/llvm/BinaryFormat/Magic.h
index 329c96f5c14c404..eaf70f32ac15045 100644
--- a/llvm/include/llvm/BinaryFormat/Magic.h
+++ b/llvm/include/llvm/BinaryFormat/Magic.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_BINARYFORMAT_MAGIC_H
 #define LLVM_BINARYFORMAT_MAGIC_H
 
+#include "llvm/Support/Compiler.h"
 #include <system_error>
 
 namespace llvm {
diff --git a/llvm/include/llvm/BinaryFormat/Minidump.h b/llvm/include/llvm/BinaryFormat/Minidump.h
index bc303929498d030..c1bfe9d5b5b89e6 100644
--- a/llvm/include/llvm/BinaryFormat/Minidump.h
+++ b/llvm/include/llvm/BinaryFormat/Minidump.h
@@ -20,6 +20,7 @@
 
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/DenseMapInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/BinaryFormat/MsgPackDocument.h b/llvm/include/llvm/BinaryFormat/MsgPackDocument.h
index 7a181bd9bf84115..15c2e7e2e57000c 100644
--- a/llvm/include/llvm/BinaryFormat/MsgPackDocument.h
+++ b/llvm/include/llvm/BinaryFormat/MsgPackDocument.h
@@ -18,6 +18,7 @@
 #define LLVM_BINARYFORMAT_MSGPACKDOCUMENT_H
 
 #include "llvm/BinaryFormat/MsgPackReader.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 
 namespace llvm {
diff --git a/llvm/include/llvm/BinaryFormat/MsgPackReader.h b/llvm/include/llvm/BinaryFormat/MsgPackReader.h
index 5123fb65cf0951b..ccb4da9d4ed20e5 100644
--- a/llvm/include/llvm/BinaryFormat/MsgPackReader.h
+++ b/llvm/include/llvm/BinaryFormat/MsgPackReader.h
@@ -33,6 +33,7 @@
 #ifndef LLVM_BINARYFORMAT_MSGPACKREADER_H
 #define LLVM_BINARYFORMAT_MSGPACKREADER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/BinaryFormat/MsgPackWriter.h b/llvm/include/llvm/BinaryFormat/MsgPackWriter.h
index b3d3c3bcdef0eb2..70b4e2ddf298d65 100644
--- a/llvm/include/llvm/BinaryFormat/MsgPackWriter.h
+++ b/llvm/include/llvm/BinaryFormat/MsgPackWriter.h
@@ -28,6 +28,7 @@
 #ifndef LLVM_BINARYFORMAT_MSGPACKWRITER_H
 #define LLVM_BINARYFORMAT_MSGPACKWRITER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/EndianStream.h"
 #include "llvm/Support/MemoryBufferRef.h"
 
diff --git a/llvm/include/llvm/BinaryFormat/Wasm.h b/llvm/include/llvm/BinaryFormat/Wasm.h
index 48195af7def30e9..6e06a66897bb3e4 100644
--- a/llvm/include/llvm/BinaryFormat/Wasm.h
+++ b/llvm/include/llvm/BinaryFormat/Wasm.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/BinaryFormat/WasmTraits.h b/llvm/include/llvm/BinaryFormat/WasmTraits.h
index bef9dd3291ca76e..e39488c213ea905 100644
--- a/llvm/include/llvm/BinaryFormat/WasmTraits.h
+++ b/llvm/include/llvm/BinaryFormat/WasmTraits.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/Hashing.h"
 #include "llvm/BinaryFormat/Wasm.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/BinaryFormat/XCOFF.h b/llvm/include/llvm/BinaryFormat/XCOFF.h
index 5774e01429d37ea..966890eca0b3892 100644
--- a/llvm/include/llvm/BinaryFormat/XCOFF.h
+++ b/llvm/include/llvm/BinaryFormat/XCOFF.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_BINARYFORMAT_XCOFF_H
 #define LLVM_BINARYFORMAT_XCOFF_H
 
+#include "llvm/Support/Compiler.h"
 #include <stddef.h>
 #include <stdint.h>
 
diff --git a/llvm/include/llvm/Bitcode/BitcodeAnalyzer.h b/llvm/include/llvm/Bitcode/BitcodeAnalyzer.h
index c7219a52f976b78..a4a8c4d27ac19ff 100644
--- a/llvm/include/llvm/Bitcode/BitcodeAnalyzer.h
+++ b/llvm/include/llvm/Bitcode/BitcodeAnalyzer.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Bitstream/BitstreamReader.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <map>
 #include <optional>
diff --git a/llvm/include/llvm/Bitcode/BitcodeCommon.h b/llvm/include/llvm/Bitcode/BitcodeCommon.h
index 22d1872fe49cc9f..59c70818df3302f 100644
--- a/llvm/include/llvm/Bitcode/BitcodeCommon.h
+++ b/llvm/include/llvm/Bitcode/BitcodeCommon.h
@@ -15,6 +15,7 @@
 #define LLVM_BITCODE_BITCODECOMMON_H
 
 #include "llvm/ADT/Bitfields.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Bitcode/BitcodeReader.h b/llvm/include/llvm/Bitcode/BitcodeReader.h
index 8fc1dbda11ed296..4b6d94d48a1c173 100644
--- a/llvm/include/llvm/Bitcode/BitcodeReader.h
+++ b/llvm/include/llvm/Bitcode/BitcodeReader.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Bitstream/BitCodeEnums.h"
 #include "llvm/IR/GlobalValue.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorOr.h"
diff --git a/llvm/include/llvm/Bitcode/BitcodeWriter.h b/llvm/include/llvm/Bitcode/BitcodeWriter.h
index 248d33f4502ef03..0420621256b6cf3 100644
--- a/llvm/include/llvm/Bitcode/BitcodeWriter.h
+++ b/llvm/include/llvm/Bitcode/BitcodeWriter.h
@@ -17,6 +17,7 @@
 #include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/MC/StringTableBuilder.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include <map>
 #include <memory>
diff --git a/llvm/include/llvm/Bitcode/BitcodeWriterPass.h b/llvm/include/llvm/Bitcode/BitcodeWriterPass.h
index 3c2471237532b81..c9b5e4f4603f199 100644
--- a/llvm/include/llvm/Bitcode/BitcodeWriterPass.h
+++ b/llvm/include/llvm/Bitcode/BitcodeWriterPass.h
@@ -15,6 +15,7 @@
 #define LLVM_BITCODE_BITCODEWRITERPASS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Bitstream/BitCodes.h b/llvm/include/llvm/Bitstream/BitCodes.h
index 93888f7d3b335d3..2367112e004af1a 100644
--- a/llvm/include/llvm/Bitstream/BitCodes.h
+++ b/llvm/include/llvm/Bitstream/BitCodes.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Bitstream/BitCodeEnums.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
diff --git a/llvm/include/llvm/Bitstream/BitstreamReader.h b/llvm/include/llvm/Bitstream/BitstreamReader.h
index 3a838309fb1ca6f..f252b9126ef3cf6 100644
--- a/llvm/include/llvm/Bitstream/BitstreamReader.h
+++ b/llvm/include/llvm/Bitstream/BitstreamReader.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Bitstream/BitCodes.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBufferRef.h"
diff --git a/llvm/include/llvm/Bitstream/BitstreamWriter.h b/llvm/include/llvm/Bitstream/BitstreamWriter.h
index 37c9bc905397018..a485d1270b9477f 100644
--- a/llvm/include/llvm/Bitstream/BitstreamWriter.h
+++ b/llvm/include/llvm/Bitstream/BitstreamWriter.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Bitstream/BitCodes.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/CodeGen/AccelTable.h b/llvm/include/llvm/CodeGen/AccelTable.h
index 46537c9cb68156c..14c2da430c7bfc2 100644
--- a/llvm/include/llvm/CodeGen/AccelTable.h
+++ b/llvm/include/llvm/CodeGen/AccelTable.h
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/DIE.h"
 #include "llvm/CodeGen/DwarfStringPoolEntry.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DJB.h"
 #include "llvm/Support/Debug.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/CodeGen/Analysis.h b/llvm/include/llvm/CodeGen/Analysis.h
index 1c67fe2d003d90d..9b96620d808d009 100644
--- a/llvm/include/llvm/CodeGen/Analysis.h
+++ b/llvm/include/llvm/CodeGen/Analysis.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/CodeGen/ISDOpcodes.h"
 #include "llvm/IR/Instructions.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 template <typename T> class SmallVectorImpl;
diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h
index 0ac497c5f8efbd6..360a3b020beac90 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinter.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinter.h
@@ -25,6 +25,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/StackMaps.h"
 #include "llvm/IR/InlineAsm.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/CodeGen/AsmPrinterHandler.h b/llvm/include/llvm/CodeGen/AsmPrinterHandler.h
index 5c06645f767eb1a..f6921a0bea7cd2e 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinterHandler.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinterHandler.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_CODEGEN_ASMPRINTERHANDLER_H
 #define LLVM_CODEGEN_ASMPRINTERHANDLER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h b/llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h
index b740ab567b12f49..2f4126c68192ed0 100644
--- a/llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h
+++ b/llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h
@@ -5,6 +5,7 @@
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/CodeGen/AtomicExpandUtils.h b/llvm/include/llvm/CodeGen/AtomicExpandUtils.h
index 1cb410a0c31c69e..ed6a15c0952349c 100644
--- a/llvm/include/llvm/CodeGen/AtomicExpandUtils.h
+++ b/llvm/include/llvm/CodeGen/AtomicExpandUtils.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/Support/AtomicOrdering.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h b/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h
index d43f399b2c310a3..ad745b097925ae8 100644
--- a/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h
+++ b/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h b/llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h
index cd27fea771ba1c8..1955176edd23670 100644
--- a/llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h
+++ b/llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/LineIterator.h"
 #include "llvm/Support/MemoryBuffer.h"
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index 383fdd1f4d79d02..c8c47d0e2af8115 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -44,6 +44,7 @@
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Target/TargetMachine.h"
diff --git a/llvm/include/llvm/CodeGen/ByteProvider.h b/llvm/include/llvm/CodeGen/ByteProvider.h
index e0ba40b1353363e..e634e5e7978e099 100644
--- a/llvm/include/llvm/CodeGen/ByteProvider.h
+++ b/llvm/include/llvm/CodeGen/ByteProvider.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_CODEGEN_BYTEPROVIDER_H
 #define LLVM_CODEGEN_BYTEPROVIDER_H
 
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <type_traits>
 
diff --git a/llvm/include/llvm/CodeGen/CFIFixup.h b/llvm/include/llvm/CodeGen/CFIFixup.h
index 40e535106751c9c..f543d6387bb6ad7 100644
--- a/llvm/include/llvm/CodeGen/CFIFixup.h
+++ b/llvm/include/llvm/CodeGen/CFIFixup.h
@@ -16,6 +16,7 @@
 
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/InitializePasses.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class CFIFixup : public MachineFunctionPass {
diff --git a/llvm/include/llvm/CodeGen/CSEConfigBase.h b/llvm/include/llvm/CodeGen/CSEConfigBase.h
index d3637099c4b6573..a219be9000812a8 100644
--- a/llvm/include/llvm/CodeGen/CSEConfigBase.h
+++ b/llvm/include/llvm/CodeGen/CSEConfigBase.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_CODEGEN_CSECONFIGBASE_H
 #define LLVM_CODEGEN_CSECONFIGBASE_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 // Class representing some configuration that can be done during GlobalISel's
 // CSEInfo analysis. We define it here because TargetPassConfig can't depend on
diff --git a/llvm/include/llvm/CodeGen/CalcSpillWeights.h b/llvm/include/llvm/CodeGen/CalcSpillWeights.h
index 41b7f10cfc38ac0..9f2fc3acaf42e95 100644
--- a/llvm/include/llvm/CodeGen/CalcSpillWeights.h
+++ b/llvm/include/llvm/CodeGen/CalcSpillWeights.h
@@ -10,6 +10,7 @@
 #define LLVM_CODEGEN_CALCSPILLWEIGHTS_H
 
 #include "llvm/CodeGen/SlotIndexes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/CallingConvLower.h b/llvm/include/llvm/CodeGen/CallingConvLower.h
index cb88482b94152c0..43b87c1bfabd919 100644
--- a/llvm/include/llvm/CodeGen/CallingConvLower.h
+++ b/llvm/include/llvm/CodeGen/CallingConvLower.h
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/TargetCallingConv.h"
 #include "llvm/IR/CallingConv.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 #include <variant>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/CodeGenCommonISel.h b/llvm/include/llvm/CodeGen/CodeGenCommonISel.h
index 90ef890f22d1b1d..d7c627b23d49235 100644
--- a/llvm/include/llvm/CodeGen/CodeGenCommonISel.h
+++ b/llvm/include/llvm/CodeGen/CodeGenCommonISel.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_CODEGENCOMMONISEL_H
 
 #include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h b/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
index ab1219328a5d498..cf219388926a854 100644
--- a/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
@@ -33,6 +33,7 @@
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCTargetOptions.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index 27794eb63de0b3d..cc8d34a0ee75a74 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/FloatingPointMode.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Target/TargetOptions.h"
 #include <optional>
 #include <string>
diff --git a/llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h b/llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h
index 84a2673fecb5bf3..a330108a7fa2ff6 100644
--- a/llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h
+++ b/llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_COMPLEXDEINTERLEAVING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/CostTable.h b/llvm/include/llvm/CodeGen/CostTable.h
index ca0cbdda3b11489..66b557870407931 100644
--- a/llvm/include/llvm/CodeGen/CostTable.h
+++ b/llvm/include/llvm/CodeGen/CostTable.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/DFAPacketizer.h b/llvm/include/llvm/CodeGen/DFAPacketizer.h
index a7a2dfdf09506c0..7934e72dabee5d8 100644
--- a/llvm/include/llvm/CodeGen/DFAPacketizer.h
+++ b/llvm/include/llvm/CodeGen/DFAPacketizer.h
@@ -29,6 +29,7 @@
 #include "llvm/CodeGen/ScheduleDAGInstrs.h"
 #include "llvm/CodeGen/ScheduleDAGMutation.h"
 #include "llvm/Support/Automaton.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <map>
 #include <memory>
diff --git a/llvm/include/llvm/CodeGen/DIE.h b/llvm/include/llvm/CodeGen/DIE.h
index 952c38cd22dbe6e..7a4adcabec2ef52 100644
--- a/llvm/include/llvm/CodeGen/DIE.h
+++ b/llvm/include/llvm/CodeGen/DIE.h
@@ -24,6 +24,7 @@
 #include "llvm/CodeGen/DwarfStringPoolEntry.h"
 #include "llvm/Support/AlignOf.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h b/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
index 7708df725180b86..f527feaf4cf74d2 100644
--- a/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
+++ b/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/DebugHandlerBase.h b/llvm/include/llvm/CodeGen/DebugHandlerBase.h
index af25f2544da7172..150708600ce08f2 100644
--- a/llvm/include/llvm/CodeGen/DebugHandlerBase.h
+++ b/llvm/include/llvm/CodeGen/DebugHandlerBase.h
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/LexicalScopes.h"
 #include "llvm/IR/DebugInfoMetadata.h"
 #include "llvm/IR/DebugLoc.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/DetectDeadLanes.h b/llvm/include/llvm/CodeGen/DetectDeadLanes.h
index 93c7582dce09f69..713d36c0b2a180e 100644
--- a/llvm/include/llvm/CodeGen/DetectDeadLanes.h
+++ b/llvm/include/llvm/CodeGen/DetectDeadLanes.h
@@ -30,6 +30,7 @@
 
 #include "llvm/ADT/BitVector.h"
 #include "llvm/MC/LaneBitmask.h"
+#include "llvm/Support/Compiler.h"
 #include <deque>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h b/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
index 7822ebf2eb09997..ba7cdd5ebb83616 100644
--- a/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
+++ b/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/EdgeBundles.h b/llvm/include/llvm/CodeGen/EdgeBundles.h
index b844bd307c19700..e1b1ab9c6d853c3 100644
--- a/llvm/include/llvm/CodeGen/EdgeBundles.h
+++ b/llvm/include/llvm/CodeGen/EdgeBundles.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/IntEqClasses.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/ExecutionDomainFix.h b/llvm/include/llvm/CodeGen/ExecutionDomainFix.h
index 4e2b171c73cc04a..c7e3d89a82565c3 100644
--- a/llvm/include/llvm/CodeGen/ExecutionDomainFix.h
+++ b/llvm/include/llvm/CodeGen/ExecutionDomainFix.h
@@ -27,6 +27,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/ReachingDefAnalysis.h"
 #include "llvm/CodeGen/TargetRegisterInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/ExpandReductions.h b/llvm/include/llvm/CodeGen/ExpandReductions.h
index 91c2507a9e395c3..e838d45b8daf91a 100644
--- a/llvm/include/llvm/CodeGen/ExpandReductions.h
+++ b/llvm/include/llvm/CodeGen/ExpandReductions.h
@@ -10,6 +10,7 @@
 #define LLVM_CODEGEN_EXPANDREDUCTIONS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/ExpandVectorPredication.h b/llvm/include/llvm/CodeGen/ExpandVectorPredication.h
index b69adb9db260182..a01f93d2d647d28 100644
--- a/llvm/include/llvm/CodeGen/ExpandVectorPredication.h
+++ b/llvm/include/llvm/CodeGen/ExpandVectorPredication.h
@@ -10,6 +10,7 @@
 #define LLVM_CODEGEN_EXPANDVECTORPREDICATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/FastISel.h b/llvm/include/llvm/CodeGen/FastISel.h
index dc2931b40d352c9..c733d782033505f 100644
--- a/llvm/include/llvm/CodeGen/FastISel.h
+++ b/llvm/include/llvm/CodeGen/FastISel.h
@@ -26,6 +26,7 @@
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/InstrTypes.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <utility>
 
diff --git a/llvm/include/llvm/CodeGen/FaultMaps.h b/llvm/include/llvm/CodeGen/FaultMaps.h
index c228bb895edd0a0..4e8cb3dacb782e2 100644
--- a/llvm/include/llvm/CodeGen/FaultMaps.h
+++ b/llvm/include/llvm/CodeGen/FaultMaps.h
@@ -10,6 +10,7 @@
 #define LLVM_CODEGEN_FAULTMAPS_H
 
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
index 4c17e8dcc41a66e..a40bbd1d973a782 100644
--- a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -25,6 +25,7 @@
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Type.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/KnownBits.h"
 #include <cassert>
 #include <utility>
diff --git a/llvm/include/llvm/CodeGen/GCMetadata.h b/llvm/include/llvm/CodeGen/GCMetadata.h
index 334c5c23b8facc9..d0eafa664947eb7 100644
--- a/llvm/include/llvm/CodeGen/GCMetadata.h
+++ b/llvm/include/llvm/CodeGen/GCMetadata.h
@@ -39,6 +39,7 @@
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/GCStrategy.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/CodeGen/GCMetadataPrinter.h b/llvm/include/llvm/CodeGen/GCMetadataPrinter.h
index f9527c9f8752e93..1800b527d5ca0dc 100644
--- a/llvm/include/llvm/CodeGen/GCMetadataPrinter.h
+++ b/llvm/include/llvm/CodeGen/GCMetadataPrinter.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_CODEGEN_GCMETADATAPRINTER_H
 #define LLVM_CODEGEN_GCMETADATAPRINTER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Registry.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
index 09d6192a2bd5ce1..38b8b89fbe3e19a 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MachineBasicBlock;
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h b/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
index 488df12f13f8df2..0f287e44dae685d 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
@@ -13,6 +13,7 @@
 #define LLVM_CODEGEN_GLOBALISEL_CSEMIRBUILDER_H
 
 #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
index c8e198157b0827c..1d248ca5e8b17c1 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
@@ -24,6 +24,7 @@
 #include "llvm/IR/CallingConv.h"
 #include "llvm/IR/Type.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cstdint>
 #include <functional>
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Combiner.h b/llvm/include/llvm/CodeGen/GlobalISel/Combiner.h
index 8c295428afe8880..2db32cfd3d8a2e6 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Combiner.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Combiner.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_GLOBALISEL_COMBINER_H
 
 #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MachineRegisterInfo;
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
index 0a9f0e931ae09a4..aadda24bcbb3c7c 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
@@ -22,6 +22,7 @@
 #include "llvm/CodeGen/LowLevelType.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/IR/InstrTypes.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h
index e73f8489497e223..61d7cfe8a3c6517 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_CODEGEN_GLOBALISEL_COMBINERINFO_H
 #define LLVM_CODEGEN_GLOBALISEL_COMBINERINFO_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h b/llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
index b42deb01f8d091d..dba61a889729b78 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MachineInstr;
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h b/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
index eff87c5617d997d..f1de98b0c231f74 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/InitializePasses.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/KnownBits.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h b/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h
index 3ec6a1da201e2c5..025647e583eaf40 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h b/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
index 8484d970aff0a9e..2cbd753554bc2a4 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/MachineMemOperand.h"
 #include "llvm/CodeGen/TargetOpcodes.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h b/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
index 4d26af3e3e6d221..3010fda890fcdd0 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
@@ -28,6 +28,7 @@
 #include "llvm/CodeGen/SwitchLoweringUtils.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <utility>
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h
index ac6184877b936ea..eb9e29000480fa4 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_GLOBALISEL_INLINEASMLOWERING_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h
index 60c7694725a5acf..7e47adaadd6df22 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h
@@ -17,6 +17,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
index 1662136cfa94afb..7b42795a675497a 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_GLOBALISEL_INSTRUCTIONSELECTOR_H
 
 #include "llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class InstructionSelector : public GIMatchTableExecutor {
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
index 08233dba2041143..f94aa70f75310bd 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/CodeGen/LowLevelType.h"
 #include "llvm/CodeGen/TargetOpcodes.h"
+#include "llvm/Support/Compiler.h"
 #include <unordered_map>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
index 0f8f5662926d434..b155245d75601a6 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
@@ -25,6 +25,7 @@
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/IR/Constants.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 
 #define DEBUG_TYPE "legalizer"
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h b/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
index 9f9e435b9ce2732..f6f7ada531e0e56 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
@@ -25,6 +25,7 @@
 #include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
index a568edd0e640d93..b1ad61036d11fcd 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
@@ -24,6 +24,7 @@
 #include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"
 #include "llvm/CodeGen/RuntimeLibcalls.h"
 #include "llvm/CodeGen/TargetOpcodes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 // Forward declarations.
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
index 569b86cca635331..a6081a6aa9eb4c3 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
@@ -23,6 +23,7 @@
 #include "llvm/MC/MCInstrDesc.h"
 #include "llvm/Support/AtomicOrdering.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <tuple>
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h b/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
index 5562e76b67f6940..0e84c699c460e85 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 // Forward declarations.
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h b/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h
index b1fcdd207a60a1a..c5908cb1e52f5fd 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h
@@ -23,6 +23,7 @@
 
 #include "llvm/ADT/SetVector.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 // Forward declarations.
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h b/llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
index 1667d0145b04206..a5c3bf47d304afa 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
@@ -14,6 +14,7 @@
 
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/CodeGen/GlobalISel/GISelChangeObserver.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LostDebugLocObserver : public GISelChangeObserver {
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h b/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
index ea6ed322e9b1927..63aa2b02abb056e 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
@@ -17,6 +17,7 @@
 #include "llvm/CodeGen/GlobalISel/Utils.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/IR/InstrTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace MIPatternMatch {
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h b/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
index a1ff76487a12ec4..c1e10586c136968 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
@@ -20,6 +20,7 @@
 #include "llvm/CodeGen/TargetOpcodes.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/Module.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
index 609326e28e30744..ccd06dccb5f19b0 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
@@ -70,6 +70,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
 #include "llvm/CodeGen/RegisterBankInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Utils.h b/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
index d5c1fd8d0d512c0..616c7e511e23f42 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/HardwareLoops.h b/llvm/include/llvm/CodeGen/HardwareLoops.h
index c7b6e0f5ae5670f..809f1725d6144be 100644
--- a/llvm/include/llvm/CodeGen/HardwareLoops.h
+++ b/llvm/include/llvm/CodeGen/HardwareLoops.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_HARDWARELOOPS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/ISDOpcodes.h b/llvm/include/llvm/CodeGen/ISDOpcodes.h
index 45ff99b9c973e99..5e7fca70b91c924 100644
--- a/llvm/include/llvm/CodeGen/ISDOpcodes.h
+++ b/llvm/include/llvm/CodeGen/ISDOpcodes.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_ISDOPCODES_H
 
 #include "llvm/CodeGen/ValueTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/IndirectThunks.h b/llvm/include/llvm/CodeGen/IndirectThunks.h
index b0a8e3043be5cc4..d1b4be89851dd2c 100644
--- a/llvm/include/llvm/CodeGen/IndirectThunks.h
+++ b/llvm/include/llvm/CodeGen/IndirectThunks.h
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/Module.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/IntrinsicLowering.h b/llvm/include/llvm/CodeGen/IntrinsicLowering.h
index 0b327a34ca098e1..f3213b6639568b7 100644
--- a/llvm/include/llvm/CodeGen/IntrinsicLowering.h
+++ b/llvm/include/llvm/CodeGen/IntrinsicLowering.h
@@ -15,6 +15,8 @@
 #ifndef LLVM_CODEGEN_INTRINSICLOWERING_H
 #define LLVM_CODEGEN_INTRINSICLOWERING_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class CallInst;
 class DataLayout;
diff --git a/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h b/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
index 556ef3f8cc788c1..c155af901e7b3c1 100644
--- a/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
+++ b/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
@@ -17,6 +17,7 @@
 
 #include "llvm/CodeGen/ScheduleDAG.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
   class LatencyPriorityQueue;
diff --git a/llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h b/llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h
index e5794966ce630d0..b8c0b72f0c1dfe2 100644
--- a/llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h
+++ b/llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h
@@ -20,6 +20,7 @@
 #include "llvm/CodeGen/MachineDominators.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineLoopInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 /// This is an alternative analysis pass to MachineBlockFrequencyInfo.
diff --git a/llvm/include/llvm/CodeGen/LexicalScopes.h b/llvm/include/llvm/CodeGen/LexicalScopes.h
index 9617ba80c13884c..13fd9b30172bffc 100644
--- a/llvm/include/llvm/CodeGen/LexicalScopes.h
+++ b/llvm/include/llvm/CodeGen/LexicalScopes.h
@@ -21,6 +21,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/DebugInfoMetadata.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <unordered_map>
 #include <utility>
diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h
index 92e35c9a4ab9466..a1d08cfb2212c39 100644
--- a/llvm/include/llvm/CodeGen/LiveInterval.h
+++ b/llvm/include/llvm/CodeGen/LiveInterval.h
@@ -29,6 +29,7 @@
 #include "llvm/CodeGen/SlotIndexes.h"
 #include "llvm/MC/LaneBitmask.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/CodeGen/LiveIntervalCalc.h b/llvm/include/llvm/CodeGen/LiveIntervalCalc.h
index b8d67ef8f4e196e..7750ce1b0bb51c5 100644
--- a/llvm/include/llvm/CodeGen/LiveIntervalCalc.h
+++ b/llvm/include/llvm/CodeGen/LiveIntervalCalc.h
@@ -18,6 +18,7 @@
 #define LLVM_CODEGEN_LIVEINTERVALCALC_H
 
 #include "llvm/CodeGen/LiveRangeCalc.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/LiveIntervalUnion.h b/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
index 81003455da4241e..ab77ee5edef4bb7 100644
--- a/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
+++ b/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/LiveInterval.h"
 #include "llvm/CodeGen/SlotIndexes.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <limits>
 
diff --git a/llvm/include/llvm/CodeGen/LivePhysRegs.h b/llvm/include/llvm/CodeGen/LivePhysRegs.h
index 76bb34d270a26dc..3f878ffbb6953d4 100644
--- a/llvm/include/llvm/CodeGen/LivePhysRegs.h
+++ b/llvm/include/llvm/CodeGen/LivePhysRegs.h
@@ -34,6 +34,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/MC/MCRegister.h"
 #include "llvm/MC/MCRegisterInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <utility>
 
diff --git a/llvm/include/llvm/CodeGen/LiveRangeCalc.h b/llvm/include/llvm/CodeGen/LiveRangeCalc.h
index 895ecff18f8925f..393c69d80fba577 100644
--- a/llvm/include/llvm/CodeGen/LiveRangeCalc.h
+++ b/llvm/include/llvm/CodeGen/LiveRangeCalc.h
@@ -31,6 +31,7 @@
 #include "llvm/CodeGen/LiveInterval.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/SlotIndexes.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/LiveRangeEdit.h b/llvm/include/llvm/CodeGen/LiveRangeEdit.h
index 0950c20325fb028..4fc28620f946172 100644
--- a/llvm/include/llvm/CodeGen/LiveRangeEdit.h
+++ b/llvm/include/llvm/CodeGen/LiveRangeEdit.h
@@ -27,6 +27,7 @@
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/SlotIndexes.h"
 #include "llvm/CodeGen/TargetSubtargetInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/LiveRegMatrix.h b/llvm/include/llvm/CodeGen/LiveRegMatrix.h
index 2b32308c7c075ef..7dd82e1dce2f803 100644
--- a/llvm/include/llvm/CodeGen/LiveRegMatrix.h
+++ b/llvm/include/llvm/CodeGen/LiveRegMatrix.h
@@ -26,6 +26,7 @@
 #include "llvm/ADT/BitVector.h"
 #include "llvm/CodeGen/LiveIntervalUnion.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/LiveRegUnits.h b/llvm/include/llvm/CodeGen/LiveRegUnits.h
index a750d5dec546336..8cad162ee16c4dd 100644
--- a/llvm/include/llvm/CodeGen/LiveRegUnits.h
+++ b/llvm/include/llvm/CodeGen/LiveRegUnits.h
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/MC/LaneBitmask.h"
 #include "llvm/MC/MCRegisterInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/LiveStacks.h b/llvm/include/llvm/CodeGen/LiveStacks.h
index 2edc2985f0ee664..3958c398e542b72 100644
--- a/llvm/include/llvm/CodeGen/LiveStacks.h
+++ b/llvm/include/llvm/CodeGen/LiveStacks.h
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/PassRegistry.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <map>
 #include <unordered_map>
diff --git a/llvm/include/llvm/CodeGen/LiveVariables.h b/llvm/include/llvm/CodeGen/LiveVariables.h
index a1ed3c073251bf8..edc1f122cc9efd9 100644
--- a/llvm/include/llvm/CodeGen/LiveVariables.h
+++ b/llvm/include/llvm/CodeGen/LiveVariables.h
@@ -38,6 +38,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/PassRegistry.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/LoopTraversal.h b/llvm/include/llvm/CodeGen/LoopTraversal.h
index 93d140cabd0d7f8..4f2aac2fd4ba963 100644
--- a/llvm/include/llvm/CodeGen/LoopTraversal.h
+++ b/llvm/include/llvm/CodeGen/LoopTraversal.h
@@ -19,6 +19,7 @@
 #define LLVM_CODEGEN_LOOPTRAVERSAL_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/LowLevelType.h b/llvm/include/llvm/CodeGen/LowLevelType.h
index 2924f475ac85006..88c557efca475b8 100644
--- a/llvm/include/llvm/CodeGen/LowLevelType.h
+++ b/llvm/include/llvm/CodeGen/LowLevelType.h
@@ -28,6 +28,7 @@
 
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/CodeGen/MachineValueType.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include <cassert>
 
diff --git a/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h b/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
index 5cd8e5412df2604..98a900d4656ef8d 100644
--- a/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
+++ b/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
@@ -18,6 +18,7 @@
 
 #include "llvm/CodeGen/LowLevelType.h"
 #include "llvm/CodeGen/ValueTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MBFIWrapper.h b/llvm/include/llvm/CodeGen/MBFIWrapper.h
index 714ecc5d4334e40..d8722c6737817fb 100644
--- a/llvm/include/llvm/CodeGen/MBFIWrapper.h
+++ b/llvm/include/llvm/CodeGen/MBFIWrapper.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Support/BlockFrequency.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h b/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h
index da943268dac876b..df4b71415929957 100644
--- a/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h
+++ b/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Discriminator.h"
 
 #include <cassert>
diff --git a/llvm/include/llvm/CodeGen/MIRFormatter.h b/llvm/include/llvm/CodeGen/MIRFormatter.h
index 203d965836f65cf..96fb2bc3ce983af 100644
--- a/llvm/include/llvm/CodeGen/MIRFormatter.h
+++ b/llvm/include/llvm/CodeGen/MIRFormatter.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_MIRFORMATTER_H
 
 #include "llvm/CodeGen/PseudoSourceValue.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cstdint>
 #include <optional>
diff --git a/llvm/include/llvm/CodeGen/MIRParser/MIParser.h b/llvm/include/llvm/CodeGen/MIRParser/MIParser.h
index b01a0c7aa073ca5..ec532b7d4273587 100644
--- a/llvm/include/llvm/CodeGen/MIRParser/MIParser.h
+++ b/llvm/include/llvm/CodeGen/MIRParser/MIParser.h
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineMemOperand.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <utility>
 
diff --git a/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h b/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
index e1606e7c0ea72d9..4afd49212c7f895 100644
--- a/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
+++ b/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
@@ -19,6 +19,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <memory>
 #include <optional>
diff --git a/llvm/include/llvm/CodeGen/MIRPrinter.h b/llvm/include/llvm/CodeGen/MIRPrinter.h
index 5e94418d5fe066c..330bf39246b179b 100644
--- a/llvm/include/llvm/CodeGen/MIRPrinter.h
+++ b/llvm/include/llvm/CodeGen/MIRPrinter.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_CODEGEN_MIRPRINTER_H
 #define LLVM_CODEGEN_MIRPRINTER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class MachineBasicBlock;
diff --git a/llvm/include/llvm/CodeGen/MIRSampleProfile.h b/llvm/include/llvm/CodeGen/MIRSampleProfile.h
index 221e966e2b9e088..4bdfd436b73930b 100644
--- a/llvm/include/llvm/CodeGen/MIRSampleProfile.h
+++ b/llvm/include/llvm/CodeGen/MIRSampleProfile.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Discriminator.h"
 #include <memory>
 #include <string>
diff --git a/llvm/include/llvm/CodeGen/MIRYamlMapping.h b/llvm/include/llvm/CodeGen/MIRYamlMapping.h
index 16e773c18641819..f1a364ec2c3dd06 100644
--- a/llvm/include/llvm/CodeGen/MIRYamlMapping.h
+++ b/llvm/include/llvm/CodeGen/MIRYamlMapping.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/CodeGen/MachineJumpTableInfo.h"
 #include "llvm/CodeGen/TargetFrameLowering.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include "llvm/Support/YAMLTraits.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h
index 1c5137f305b6b3c..04fea37dff47cfd 100644
--- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/MC/LaneBitmask.h"
 #include "llvm/Support/BranchProbability.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <iterator>
diff --git a/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h b/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
index 6d58c7a14fb95ac..cf1122eefcb6d50 100644
--- a/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
@@ -15,6 +15,7 @@
 
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/Support/BlockFrequency.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 #include <optional>
diff --git a/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h b/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h
index bd544421bc0ff6d..38c55feee854a43 100644
--- a/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h
@@ -16,6 +16,7 @@
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/BranchProbability.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachineCFGPrinter.h b/llvm/include/llvm/CodeGen/MachineCFGPrinter.h
index ea3ff5a5c828b92..92d091d589b0c88 100644
--- a/llvm/include/llvm/CodeGen/MachineCFGPrinter.h
+++ b/llvm/include/llvm/CodeGen/MachineCFGPrinter.h
@@ -12,6 +12,7 @@
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DOTGraphTraits.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineConstantPool.h b/llvm/include/llvm/CodeGen/MachineConstantPool.h
index a9bc0ce300b22d4..d362eeb17b4b824 100644
--- a/llvm/include/llvm/CodeGen/MachineConstantPool.h
+++ b/llvm/include/llvm/CodeGen/MachineConstantPool.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/MC/SectionKind.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 #include <climits>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/MachineCycleAnalysis.h b/llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
index 1c210632f9e1a5f..86f2066f42699c3 100644
--- a/llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
+++ b/llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/GenericCycleInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineSSAContext.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h b/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
index e3e679608784a44..807b4e8b0c092be 100644
--- a/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
+++ b/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
@@ -13,6 +13,7 @@
 #include "llvm/Analysis/DominanceFrontierImpl.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericDomTree.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineDominators.h b/llvm/include/llvm/CodeGen/MachineDominators.h
index 30c18ef410fab3d..891d9e15ae23399 100644
--- a/llvm/include/llvm/CodeGen/MachineDominators.h
+++ b/llvm/include/llvm/CodeGen/MachineDominators.h
@@ -20,6 +20,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineInstrBundleIterator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericDomTree.h"
 #include "llvm/Support/GenericDomTreeConstruction.h"
 #include <cassert>
diff --git a/llvm/include/llvm/CodeGen/MachineFrameInfo.h b/llvm/include/llvm/CodeGen/MachineFrameInfo.h
index 7d11d63d4066f4a..a500dc535d41bd5 100644
--- a/llvm/include/llvm/CodeGen/MachineFrameInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineFrameInfo.h
@@ -17,6 +17,7 @@
 #include "llvm/CodeGen/Register.h"
 #include "llvm/CodeGen/TargetFrameLowering.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/MachineFunctionPass.h b/llvm/include/llvm/CodeGen/MachineFunctionPass.h
index caaf22c2139e31a..fa92103d414b060 100644
--- a/llvm/include/llvm/CodeGen/MachineFunctionPass.h
+++ b/llvm/include/llvm/CodeGen/MachineFunctionPass.h
@@ -20,6 +20,7 @@
 
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h
index 2928ccfbcef72dd..17f8c07c439a07d 100644
--- a/llvm/include/llvm/CodeGen/MachineInstr.h
+++ b/llvm/include/llvm/CodeGen/MachineInstr.h
@@ -29,6 +29,7 @@
 #include "llvm/MC/MCInstrDesc.h"
 #include "llvm/MC/MCSymbol.h"
 #include "llvm/Support/ArrayRecycler.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/TrailingObjects.h"
 #include <algorithm>
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
index c35bdc0c2b44a1b..622f9898fb93845 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -28,6 +28,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Intrinsics.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBundle.h b/llvm/include/llvm/CodeGen/MachineInstrBundle.h
index 9685d1fd8a3e087..ea1943f1810e399 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBundle.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBundle.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_MACHINEINSTRBUNDLE_H
 
 #include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h b/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
index 250cb0d78a68f33..68c73850b5d6ba9 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/ilist.h"
 #include "llvm/ADT/simple_ilist.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <iterator>
 #include <type_traits>
diff --git a/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h b/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
index 1d082bd03e5b5e0..9ba3e2d6292af36 100644
--- a/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
@@ -19,6 +19,7 @@
 #ifndef LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H
 #define LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Printable.h"
 #include <cassert>
 #include <vector>
diff --git a/llvm/include/llvm/CodeGen/MachineLoopInfo.h b/llvm/include/llvm/CodeGen/MachineLoopInfo.h
index cf8d1f17bde7687..d40be0a7d8d1bc8 100644
--- a/llvm/include/llvm/CodeGen/MachineLoopInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineLoopInfo.h
@@ -32,6 +32,7 @@
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/IR/DebugLoc.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericLoopInfo.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineLoopUtils.h b/llvm/include/llvm/CodeGen/MachineLoopUtils.h
index b9bf93b71e25c2c..022f9a69fafb789 100644
--- a/llvm/include/llvm/CodeGen/MachineLoopUtils.h
+++ b/llvm/include/llvm/CodeGen/MachineLoopUtils.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_CODEGEN_MACHINELOOPUTILS_H
 #define LLVM_CODEGEN_MACHINELOOPUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class MachineBasicBlock;
 class MachineRegisterInfo;
diff --git a/llvm/include/llvm/CodeGen/MachineMemOperand.h b/llvm/include/llvm/CodeGen/MachineMemOperand.h
index da7fd7cdf02958d..93e1ba1b1009eb9 100644
--- a/llvm/include/llvm/CodeGen/MachineMemOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineMemOperand.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Value.h" // PointerLikeTypeTraits<Value*>
 #include "llvm/Support/AtomicOrdering.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineModuleInfo.h b/llvm/include/llvm/CodeGen/MachineModuleInfo.h
index 4f0ada3d7e17aa1..f629643b1bf14f0 100644
--- a/llvm/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineModuleInfo.h
@@ -36,6 +36,7 @@
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCSymbol.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <utility>
 #include <vector>
diff --git a/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h b/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h
index 58f7163d7b81986..0a2c820df98ba93 100644
--- a/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h
+++ b/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h b/llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h
index fc7635edd82c79f..19dbeeec0aec505 100644
--- a/llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h
+++ b/llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h
@@ -10,6 +10,7 @@
 #define LLVM_CODEGEN_MACHINEMODULESLOTTRACKER_H
 
 #include "llvm/IR/ModuleSlotTracker.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachineOperand.h b/llvm/include/llvm/CodeGen/MachineOperand.h
index 1f3b7feedd1897f..c7c6e609f75e0bf 100644
--- a/llvm/include/llvm/CodeGen/MachineOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineOperand.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/IR/Intrinsics.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h b/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
index 2b177e6763d39e5..45728b8f3f2ceb7 100644
--- a/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
+++ b/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/IR/Function.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineOutliner.h b/llvm/include/llvm/CodeGen/MachineOutliner.h
index d0ff02fea4ff9b7..88d7ca3b3f3cd72 100644
--- a/llvm/include/llvm/CodeGen/MachineOutliner.h
+++ b/llvm/include/llvm/CodeGen/MachineOutliner.h
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/LiveRegUnits.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <initializer_list>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachinePassManager.h b/llvm/include/llvm/CodeGen/MachinePassManager.h
index 5dc0e2918d4695d..77174c23bd4fcb6 100644
--- a/llvm/include/llvm/CodeGen/MachinePassManager.h
+++ b/llvm/include/llvm/CodeGen/MachinePassManager.h
@@ -26,6 +26,7 @@
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <map>
diff --git a/llvm/include/llvm/CodeGen/MachinePassRegistry.h b/llvm/include/llvm/CodeGen/MachinePassRegistry.h
index f5b3723db0aabeb..e6bcf2f3994cb50 100644
--- a/llvm/include/llvm/CodeGen/MachinePassRegistry.h
+++ b/llvm/include/llvm/CodeGen/MachinePassRegistry.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachinePipeliner.h b/llvm/include/llvm/CodeGen/MachinePipeliner.h
index 04055ba9732dd44..12cd22116d719d6 100644
--- a/llvm/include/llvm/CodeGen/MachinePipeliner.h
+++ b/llvm/include/llvm/CodeGen/MachinePipeliner.h
@@ -49,6 +49,7 @@
 #include "llvm/CodeGen/ScheduleDAGMutation.h"
 #include "llvm/CodeGen/TargetInstrInfo.h"
 #include "llvm/InitializePasses.h"
+#include "llvm/Support/Compiler.h"
 
 #include <deque>
 
diff --git a/llvm/include/llvm/CodeGen/MachinePostDominators.h b/llvm/include/llvm/CodeGen/MachinePostDominators.h
index cee4294f6317b0c..05543581f2695fb 100644
--- a/llvm/include/llvm/CodeGen/MachinePostDominators.h
+++ b/llvm/include/llvm/CodeGen/MachinePostDominators.h
@@ -16,6 +16,7 @@
 
 #include "llvm/CodeGen/MachineDominators.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineRegionInfo.h b/llvm/include/llvm/CodeGen/MachineRegionInfo.h
index eeb69fef2c6b939..381fe855ec73748 100644
--- a/llvm/include/llvm/CodeGen/MachineRegionInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineRegionInfo.h
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineLoopInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
index 496224a85c52c3d..65f94fabb52e623 100644
--- a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
@@ -29,6 +29,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/CodeGen/TargetSubtargetInfo.h"
 #include "llvm/MC/LaneBitmask.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/CodeGen/MachineSSAContext.h b/llvm/include/llvm/CodeGen/MachineSSAContext.h
index 3bf0f728907eca7..6d0c24f1f450846 100644
--- a/llvm/include/llvm/CodeGen/MachineSSAContext.h
+++ b/llvm/include/llvm/CodeGen/MachineSSAContext.h
@@ -16,6 +16,7 @@
 #define LLVM_CODEGEN_MACHINESSACONTEXT_H
 
 #include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Printable.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineSSAUpdater.h b/llvm/include/llvm/CodeGen/MachineSSAUpdater.h
index bbd09d7d151ba07..d522a5b45fd9751 100644
--- a/llvm/include/llvm/CodeGen/MachineSSAUpdater.h
+++ b/llvm/include/llvm/CodeGen/MachineSSAUpdater.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_MACHINESSAUPDATER_H
 
 #include "llvm/CodeGen/Register.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachineScheduler.h b/llvm/include/llvm/CodeGen/MachineScheduler.h
index c950a9ac5c38793..c6b9fb3756c9064 100644
--- a/llvm/include/llvm/CodeGen/MachineScheduler.h
+++ b/llvm/include/llvm/CodeGen/MachineScheduler.h
@@ -89,6 +89,7 @@
 #include "llvm/CodeGen/ScheduleDAGMutation.h"
 #include "llvm/CodeGen/TargetSchedule.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/CodeGen/MachineSizeOpts.h b/llvm/include/llvm/CodeGen/MachineSizeOpts.h
index 550508ad7a233fb..76ddb7175b6a13a 100644
--- a/llvm/include/llvm/CodeGen/MachineSizeOpts.h
+++ b/llvm/include/llvm/CodeGen/MachineSizeOpts.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_CODEGEN_MACHINESIZEOPTS_H
 #define LLVM_CODEGEN_MACHINESIZEOPTS_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/SizeOpts.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/MachineStableHash.h b/llvm/include/llvm/CodeGen/MachineStableHash.h
index 43571b7b8afd212..da73311573211b4 100644
--- a/llvm/include/llvm/CodeGen/MachineStableHash.h
+++ b/llvm/include/llvm/CodeGen/MachineStableHash.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_MACHINESTABLEHASH_H
 
 #include "llvm/CodeGen/StableHashing.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MachineBasicBlock;
diff --git a/llvm/include/llvm/CodeGen/MachineTraceMetrics.h b/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
index 63e4210b2a860e7..4e0a56e14494591 100644
--- a/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
+++ b/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
@@ -53,6 +53,7 @@
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/TargetSchedule.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h b/llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h
index e6da099751e7ae5..63417cdf6571532 100644
--- a/llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h
+++ b/llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineCycleAnalysis.h"
 #include "llvm/CodeGen/MachineDominators.h"
 #include "llvm/CodeGen/MachineSSAContext.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/MachineValueType.h b/llvm/include/llvm/CodeGen/MachineValueType.h
index d7dc38c7bd9885a..17f017522d9e8c2 100644
--- a/llvm/include/llvm/CodeGen/MachineValueType.h
+++ b/llvm/include/llvm/CodeGen/MachineValueType.h
@@ -17,6 +17,7 @@
 #define LLVM_CODEGEN_MACHINEVALUETYPE_H
 
 #include "llvm/ADT/Sequence.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/TypeSize.h"
diff --git a/llvm/include/llvm/CodeGen/MacroFusion.h b/llvm/include/llvm/CodeGen/MacroFusion.h
index ea2c7a5faae385a..c8246fcf2e3fb68 100644
--- a/llvm/include/llvm/CodeGen/MacroFusion.h
+++ b/llvm/include/llvm/CodeGen/MacroFusion.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_CODEGEN_MACROFUSION_H
 #define LLVM_CODEGEN_MACROFUSION_H
 
+#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <memory>
 
diff --git a/llvm/include/llvm/CodeGen/ModuloSchedule.h b/llvm/include/llvm/CodeGen/ModuloSchedule.h
index d03f7b4959159e4..77ca6ff696b6ac9 100644
--- a/llvm/include/llvm/CodeGen/ModuloSchedule.h
+++ b/llvm/include/llvm/CodeGen/ModuloSchedule.h
@@ -64,6 +64,7 @@
 #include "llvm/CodeGen/MachineLoopUtils.h"
 #include "llvm/CodeGen/TargetInstrInfo.h"
 #include "llvm/CodeGen/TargetSubtargetInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <deque>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/MultiHazardRecognizer.h b/llvm/include/llvm/CodeGen/MultiHazardRecognizer.h
index 9846045ff014bbc..987ad742bfe05ee 100644
--- a/llvm/include/llvm/CodeGen/MultiHazardRecognizer.h
+++ b/llvm/include/llvm/CodeGen/MultiHazardRecognizer.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/ScheduleHazardRecognizer.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/NonRelocatableStringpool.h b/llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
index fe07c70d85c597e..a03846d05d6b2ad 100644
--- a/llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
+++ b/llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
@@ -11,6 +11,7 @@
 
 #include "llvm/CodeGen/DwarfStringPoolEntry.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/PBQP/CostAllocator.h b/llvm/include/llvm/CodeGen/PBQP/CostAllocator.h
index 7a8ee691c034f0f..7e28d04663d961b 100644
--- a/llvm/include/llvm/CodeGen/PBQP/CostAllocator.h
+++ b/llvm/include/llvm/CodeGen/PBQP/CostAllocator.h
@@ -18,6 +18,7 @@
 #define LLVM_CODEGEN_PBQP_COSTALLOCATOR_H
 
 #include "llvm/ADT/DenseSet.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/CodeGen/PBQP/Graph.h b/llvm/include/llvm/CodeGen/PBQP/Graph.h
index 5c802802a880427..142bfa1461a0850 100644
--- a/llvm/include/llvm/CodeGen/PBQP/Graph.h
+++ b/llvm/include/llvm/CodeGen/PBQP/Graph.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_PBQP_GRAPH_H
 
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <iterator>
diff --git a/llvm/include/llvm/CodeGen/PBQP/Math.h b/llvm/include/llvm/CodeGen/PBQP/Math.h
index 099ba788e9a2d8c..b9d45848f1267be 100644
--- a/llvm/include/llvm/CodeGen/PBQP/Math.h
+++ b/llvm/include/llvm/CodeGen/PBQP/Math.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <functional>
diff --git a/llvm/include/llvm/CodeGen/PBQP/Solution.h b/llvm/include/llvm/CodeGen/PBQP/Solution.h
index d5b1474f0f4c7ea..de2abef047ce87f 100644
--- a/llvm/include/llvm/CodeGen/PBQP/Solution.h
+++ b/llvm/include/llvm/CodeGen/PBQP/Solution.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_PBQP_SOLUTION_H
 
 #include "llvm/CodeGen/PBQP/Graph.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <map>
 
diff --git a/llvm/include/llvm/CodeGen/PBQPRAConstraint.h b/llvm/include/llvm/CodeGen/PBQPRAConstraint.h
index 876ab97a669fd6e..a683bff1ff9e807 100644
--- a/llvm/include/llvm/CodeGen/PBQPRAConstraint.h
+++ b/llvm/include/llvm/CodeGen/PBQPRAConstraint.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_CODEGEN_PBQPRACONSTRAINT_H
 #define LLVM_CODEGEN_PBQPRACONSTRAINT_H
 
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <memory>
 #include <vector>
diff --git a/llvm/include/llvm/CodeGen/ParallelCG.h b/llvm/include/llvm/CodeGen/ParallelCG.h
index 70ce2ff474213b4..df72be4c5841bf0 100644
--- a/llvm/include/llvm/CodeGen/ParallelCG.h
+++ b/llvm/include/llvm/CodeGen/ParallelCG.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_PARALLELCG_H
 
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <memory>
 
diff --git a/llvm/include/llvm/CodeGen/Passes.h b/llvm/include/llvm/CodeGen/Passes.h
index 11bc1d48a93d7c9..088e1653816f666 100644
--- a/llvm/include/llvm/CodeGen/Passes.h
+++ b/llvm/include/llvm/CodeGen/Passes.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_PASSES_H
 
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Discriminator.h"
 #include "llvm/CodeGen/RegAllocCommon.h"
 
diff --git a/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h b/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h
index 73d7d779e55b673..97d3b2e1229b1bb 100644
--- a/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h
+++ b/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_PREISELINTRINSICLOWERING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/PseudoSourceValue.h b/llvm/include/llvm/CodeGen/PseudoSourceValue.h
index 07b7ba32156698d..bffa2dd57851f66 100644
--- a/llvm/include/llvm/CodeGen/PseudoSourceValue.h
+++ b/llvm/include/llvm/CodeGen/PseudoSourceValue.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/IR/ValueMap.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/RDFGraph.h b/llvm/include/llvm/CodeGen/RDFGraph.h
index cf7344e8c3e7465..1e9ccc812ff1fa1 100644
--- a/llvm/include/llvm/CodeGen/RDFGraph.h
+++ b/llvm/include/llvm/CodeGen/RDFGraph.h
@@ -229,6 +229,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/MC/LaneBitmask.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/CodeGen/RDFLiveness.h b/llvm/include/llvm/CodeGen/RDFLiveness.h
index fe1034f9b6f8efa..4091769fab938e2 100644
--- a/llvm/include/llvm/CodeGen/RDFLiveness.h
+++ b/llvm/include/llvm/CodeGen/RDFLiveness.h
@@ -16,6 +16,7 @@
 #include "RDFRegisters.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/MC/LaneBitmask.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <set>
 #include <unordered_map>
diff --git a/llvm/include/llvm/CodeGen/RDFRegisters.h b/llvm/include/llvm/CodeGen/RDFRegisters.h
index 7eed0b4e1e7b8f0..9d8174600f99467 100644
--- a/llvm/include/llvm/CodeGen/RDFRegisters.h
+++ b/llvm/include/llvm/CodeGen/RDFRegisters.h
@@ -15,6 +15,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/MC/LaneBitmask.h"
 #include "llvm/MC/MCRegister.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <map>
diff --git a/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h b/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h
index ec652f448f0f651..7386af9d54eee4b 100644
--- a/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h
+++ b/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h
@@ -27,6 +27,7 @@
 #include "llvm/CodeGen/LoopTraversal.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/InitializePasses.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/RegAllocPBQP.h b/llvm/include/llvm/CodeGen/RegAllocPBQP.h
index 1ea8840947bc887..c0cc2726a159211 100644
--- a/llvm/include/llvm/CodeGen/RegAllocPBQP.h
+++ b/llvm/include/llvm/CodeGen/RegAllocPBQP.h
@@ -24,6 +24,7 @@
 #include "llvm/CodeGen/PBQP/Solution.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/MC/MCRegister.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/CodeGen/RegAllocRegistry.h b/llvm/include/llvm/CodeGen/RegAllocRegistry.h
index cd81e084a859ba9..14fa5861f0cf4ff 100644
--- a/llvm/include/llvm/CodeGen/RegAllocRegistry.h
+++ b/llvm/include/llvm/CodeGen/RegAllocRegistry.h
@@ -16,6 +16,7 @@
 
 #include "llvm/CodeGen/RegAllocCommon.h"
 #include "llvm/CodeGen/MachinePassRegistry.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/Register.h b/llvm/include/llvm/CodeGen/Register.h
index e1456f81d4670f9..f8daf0b4e1e0f4b 100644
--- a/llvm/include/llvm/CodeGen/Register.h
+++ b/llvm/include/llvm/CodeGen/Register.h
@@ -10,6 +10,7 @@
 #define LLVM_CODEGEN_REGISTER_H
 
 #include "llvm/MC/MCRegister.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/RegisterBank.h b/llvm/include/llvm/CodeGen/RegisterBank.h
index ee295c7cdde0048..56fa270f04a5652 100644
--- a/llvm/include/llvm/CodeGen/RegisterBank.h
+++ b/llvm/include/llvm/CodeGen/RegisterBank.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_REGISTERBANK_H
 
 #include "llvm/ADT/BitVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 // Forward declarations.
diff --git a/llvm/include/llvm/CodeGen/RegisterBankInfo.h b/llvm/include/llvm/CodeGen/RegisterBankInfo.h
index 60f03756e1b5461..10a4ef06410d454 100644
--- a/llvm/include/llvm/CodeGen/RegisterBankInfo.h
+++ b/llvm/include/llvm/CodeGen/RegisterBankInfo.h
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/LowLevelType.h"
 #include "llvm/CodeGen/Register.h"
 #include "llvm/CodeGen/RegisterBank.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <initializer_list>
diff --git a/llvm/include/llvm/CodeGen/RegisterClassInfo.h b/llvm/include/llvm/CodeGen/RegisterClassInfo.h
index 0e50d2feb9b2813..e9297a85b1495a6 100644
--- a/llvm/include/llvm/CodeGen/RegisterClassInfo.h
+++ b/llvm/include/llvm/CodeGen/RegisterClassInfo.h
@@ -21,6 +21,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/MC/MCRegister.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 
diff --git a/llvm/include/llvm/CodeGen/RegisterPressure.h b/llvm/include/llvm/CodeGen/RegisterPressure.h
index 8a46e505affd2fd..b2d0507bcf5b1fd 100644
--- a/llvm/include/llvm/CodeGen/RegisterPressure.h
+++ b/llvm/include/llvm/CodeGen/RegisterPressure.h
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/SlotIndexes.h"
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/MC/LaneBitmask.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <cstdlib>
diff --git a/llvm/include/llvm/CodeGen/RegisterScavenging.h b/llvm/include/llvm/CodeGen/RegisterScavenging.h
index 21f2d355f237be8..bd7a688e77a34fc 100644
--- a/llvm/include/llvm/CodeGen/RegisterScavenging.h
+++ b/llvm/include/llvm/CodeGen/RegisterScavenging.h
@@ -23,6 +23,7 @@
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/MC/LaneBitmask.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/RegisterUsageInfo.h b/llvm/include/llvm/CodeGen/RegisterUsageInfo.h
index aa1f5ef8110b0cf..4b474c4eb8433a0 100644
--- a/llvm/include/llvm/CodeGen/RegisterUsageInfo.h
+++ b/llvm/include/llvm/CodeGen/RegisterUsageInfo.h
@@ -23,6 +23,7 @@
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 #include "llvm/PassRegistry.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/ReplaceWithVeclib.h b/llvm/include/llvm/CodeGen/ReplaceWithVeclib.h
index c71aca0c992b386..b4d308d890bf2c1 100644
--- a/llvm/include/llvm/CodeGen/ReplaceWithVeclib.h
+++ b/llvm/include/llvm/CodeGen/ReplaceWithVeclib.h
@@ -18,6 +18,7 @@
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 #include "llvm/PassRegistry.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h b/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
index bd63dd8756210fd..41bdd72c4bd5a8e 100644
--- a/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
+++ b/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
@@ -17,6 +17,7 @@
 #define LLVM_CODEGEN_RESOURCEPRIORITYQUEUE_H
 
 #include "llvm/CodeGen/ScheduleDAG.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
   class DFAPacketizer;
diff --git a/llvm/include/llvm/CodeGen/RuntimeLibcalls.h b/llvm/include/llvm/CodeGen/RuntimeLibcalls.h
index 666420681510732..fa2868b993c5705 100644
--- a/llvm/include/llvm/CodeGen/RuntimeLibcalls.h
+++ b/llvm/include/llvm/CodeGen/RuntimeLibcalls.h
@@ -16,6 +16,7 @@
 
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/Support/AtomicOrdering.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace RTLIB {
diff --git a/llvm/include/llvm/CodeGen/ScheduleDAG.h b/llvm/include/llvm/CodeGen/ScheduleDAG.h
index 89b71167a43a89b..2131f60a796cd67 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDAG.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDAG.h
@@ -21,6 +21,7 @@
 #include "llvm/ADT/iterator.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/TargetLowering.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h b/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
index 5ea68e0a64af9c6..7f23777df1a32db 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
@@ -26,6 +26,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/CodeGen/TargetSchedule.h"
 #include "llvm/MC/LaneBitmask.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <list>
diff --git a/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h b/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h
index d1dd72859a380eb..6e68de285f02504 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_CODEGEN_SCHEDULEDAGMUTATION_H
 #define LLVM_CODEGEN_SCHEDULEDAGMUTATION_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class ScheduleDAGInstrs;
diff --git a/llvm/include/llvm/CodeGen/ScheduleDFS.h b/llvm/include/llvm/CodeGen/ScheduleDFS.h
index 2e0a30cc56e3cc1..99f33831db9bb8b 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDFS.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDFS.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/ScheduleDAG.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <vector>
diff --git a/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h b/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h
index 9f1101b658d0483..7b02667251862a9 100644
--- a/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h
+++ b/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_CODEGEN_SCHEDULEHAZARDRECOGNIZER_H
 #define LLVM_CODEGEN_SCHEDULEHAZARDRECOGNIZER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class MachineInstr;
diff --git a/llvm/include/llvm/CodeGen/SchedulerRegistry.h b/llvm/include/llvm/CodeGen/SchedulerRegistry.h
index 0ccfaafd9e50255..b06dc1306ced3ab 100644
--- a/llvm/include/llvm/CodeGen/SchedulerRegistry.h
+++ b/llvm/include/llvm/CodeGen/SchedulerRegistry.h
@@ -16,6 +16,7 @@
 
 #include "llvm/CodeGen/MachinePassRegistry.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h b/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
index a70acca98a5c464..e449b68a8280c10 100644
--- a/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
+++ b/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
@@ -17,6 +17,7 @@
 
 #include "llvm/CodeGen/ScheduleHazardRecognizer.h"
 #include "llvm/MC/MCInstrItineraries.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstring>
diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h
index 67904a8043a8e6d..cf6ec3c91fa7820 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -37,6 +37,7 @@
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/ArrayRecycler.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/RecyclingAllocator.h"
 #include <cassert>
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h b/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
index 3d0f836b0c75784..0901b195b770b63 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
@@ -10,6 +10,7 @@
 #define LLVM_CODEGEN_SELECTIONDAGADDRESSANALYSIS_H
 
 #include "llvm/CodeGen/SelectionDAGNodes.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGISel.h b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
index 6c0b2cfe8ef31d8..6788442d8ffb039 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGISel.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
@@ -17,6 +17,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/IR/BasicBlock.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
index ba2222390a76cd1..e411bd143d06b37 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -42,6 +42,7 @@
 #include "llvm/Support/AlignOf.h"
 #include "llvm/Support/AtomicOrdering.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/TypeSize.h"
 #include <algorithm>
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h b/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h
index e7d608969124104..6be0884e57f2cc9 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineMemOperand.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/SlotIndexes.h b/llvm/include/llvm/CodeGen/SlotIndexes.h
index 7e013dbf2ab385d..5fe6c1097a0b1a4 100644
--- a/llvm/include/llvm/CodeGen/SlotIndexes.h
+++ b/llvm/include/llvm/CodeGen/SlotIndexes.h
@@ -29,6 +29,7 @@
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineInstrBundle.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <iterator>
diff --git a/llvm/include/llvm/CodeGen/Spiller.h b/llvm/include/llvm/CodeGen/Spiller.h
index b2f5485eba02e73..4f1309916f06cdf 100644
--- a/llvm/include/llvm/CodeGen/Spiller.h
+++ b/llvm/include/llvm/CodeGen/Spiller.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_CODEGEN_SPILLER_H
 #define LLVM_CODEGEN_SPILLER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class LiveRangeEdit;
diff --git a/llvm/include/llvm/CodeGen/StackMaps.h b/llvm/include/llvm/CodeGen/StackMaps.h
index 467e31f17bc82bf..ecf3c2c77a88622 100644
--- a/llvm/include/llvm/CodeGen/StackMaps.h
+++ b/llvm/include/llvm/CodeGen/StackMaps.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/IR/CallingConv.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/CodeGen/StackProtector.h b/llvm/include/llvm/CodeGen/StackProtector.h
index 70a3abff83f6e3b..bbbbdf5899982d4 100644
--- a/llvm/include/llvm/CodeGen/StackProtector.h
+++ b/llvm/include/llvm/CodeGen/StackProtector.h
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h b/llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h
index a374736347f6d7d..381f8ea5f80ae23 100644
--- a/llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h
+++ b/llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h
@@ -20,6 +20,7 @@
 #include "llvm/CodeGen/Register.h"
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/DebugLoc.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 
diff --git a/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h b/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h
index 189dfef590b0f9b..2bb840c8f6ba756 100644
--- a/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h
+++ b/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h
@@ -14,6 +14,7 @@
 #include "llvm/CodeGen/SelectionDAGNodes.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/Support/BranchProbability.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/TailDuplicator.h b/llvm/include/llvm/CodeGen/TailDuplicator.h
index 8fdce301c0ccb10..4ffe638f41082e7 100644
--- a/llvm/include/llvm/CodeGen/TailDuplicator.h
+++ b/llvm/include/llvm/CodeGen/TailDuplicator.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/CodeGen/TargetInstrInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/TargetCallingConv.h b/llvm/include/llvm/CodeGen/TargetCallingConv.h
index 89ea9bcb2a408d8..ca51121b31c045d 100644
--- a/llvm/include/llvm/CodeGen/TargetCallingConv.h
+++ b/llvm/include/llvm/CodeGen/TargetCallingConv.h
@@ -16,6 +16,7 @@
 #include "llvm/CodeGen/MachineValueType.h"
 #include "llvm/CodeGen/ValueTypes.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <cassert>
 #include <climits>
diff --git a/llvm/include/llvm/CodeGen/TargetFrameLowering.h b/llvm/include/llvm/CodeGen/TargetFrameLowering.h
index 94de30461547e9d..2de5b174cc569cf 100644
--- a/llvm/include/llvm/CodeGen/TargetFrameLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetFrameLowering.h
@@ -14,6 +14,7 @@
 #define LLVM_CODEGEN_TARGETFRAMELOWERING_H
 
 #include "llvm/CodeGen/MachineBasicBlock.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/TypeSize.h"
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/TargetInstrInfo.h b/llvm/include/llvm/CodeGen/TargetInstrInfo.h
index 817d32ea0ef6f7d..7704a3568186193 100644
--- a/llvm/include/llvm/CodeGen/TargetInstrInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetInstrInfo.h
@@ -28,6 +28,7 @@
 #include "llvm/CodeGen/VirtRegMap.h"
 #include "llvm/MC/MCInstrInfo.h"
 #include "llvm/Support/BranchProbability.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 6daf623665dafee..6bc1202c0f7945f 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -50,6 +50,7 @@
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/AtomicOrdering.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
index 07ebf5e65431d31..bd442a1d926df41 100644
--- a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
+++ b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/BinaryFormat/XCOFF.h"
 #include "llvm/MC/MCExpr.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Target/TargetLoweringObjectFile.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/TargetPassConfig.h b/llvm/include/llvm/CodeGen/TargetPassConfig.h
index 8d7086d02c8ac27..7efd4f6bc99b069 100644
--- a/llvm/include/llvm/CodeGen/TargetPassConfig.h
+++ b/llvm/include/llvm/CodeGen/TargetPassConfig.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Pass.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <string>
 
diff --git a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
index 62a955f6b7d43ef..48bd68084d0a7d8 100644
--- a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
@@ -24,6 +24,7 @@
 #include "llvm/IR/CallingConv.h"
 #include "llvm/MC/LaneBitmask.h"
 #include "llvm/MC/MCRegisterInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/Printable.h"
diff --git a/llvm/include/llvm/CodeGen/TargetSchedule.h b/llvm/include/llvm/CodeGen/TargetSchedule.h
index bfab9cb92a38505..d2c170d143033f5 100644
--- a/llvm/include/llvm/CodeGen/TargetSchedule.h
+++ b/llvm/include/llvm/CodeGen/TargetSchedule.h
@@ -20,6 +20,7 @@
 #include "llvm/Config/llvm-config.h"
 #include "llvm/MC/MCInstrItineraries.h"
 #include "llvm/MC/MCSchedule.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h b/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
index 9b98ef353d73ea3..8f3b9dfa164bb32 100644
--- a/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
@@ -21,6 +21,7 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/MC/MCSubtargetInfo.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <vector>
 
diff --git a/llvm/include/llvm/CodeGen/TileShapeInfo.h b/llvm/include/llvm/CodeGen/TileShapeInfo.h
index 48c2d9ae70dfa6d..e902404d05a0a4a 100644
--- a/llvm/include/llvm/CodeGen/TileShapeInfo.h
+++ b/llvm/include/llvm/CodeGen/TileShapeInfo.h
@@ -24,6 +24,7 @@
 #include "llvm/CodeGen/MachineOperand.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/Register.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/TypePromotion.h b/llvm/include/llvm/CodeGen/TypePromotion.h
index efe58232cdcdd92..dd8fc920a78aadd 100644
--- a/llvm/include/llvm/CodeGen/TypePromotion.h
+++ b/llvm/include/llvm/CodeGen/TypePromotion.h
@@ -15,6 +15,7 @@
 #define LLVM_CODEGEN_TYPEPROMOTION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/UnreachableBlockElim.h b/llvm/include/llvm/CodeGen/UnreachableBlockElim.h
index 7dbae77e344015d..5732c4abe57b548 100644
--- a/llvm/include/llvm/CodeGen/UnreachableBlockElim.h
+++ b/llvm/include/llvm/CodeGen/UnreachableBlockElim.h
@@ -23,6 +23,7 @@
 #define LLVM_CODEGEN_UNREACHABLEBLOCKELIM_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/VLIWMachineScheduler.h b/llvm/include/llvm/CodeGen/VLIWMachineScheduler.h
index bd12baa6afaba67..14c262dcd624104 100644
--- a/llvm/include/llvm/CodeGen/VLIWMachineScheduler.h
+++ b/llvm/include/llvm/CodeGen/VLIWMachineScheduler.h
@@ -15,6 +15,7 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/CodeGen/MachineScheduler.h"
 #include "llvm/CodeGen/TargetSchedule.h"
+#include "llvm/Support/Compiler.h"
 #include <limits>
 #include <memory>
 #include <utility>
diff --git a/llvm/include/llvm/CodeGen/VirtRegMap.h b/llvm/include/llvm/CodeGen/VirtRegMap.h
index 42e8d294a637add..a46469eef1b6ee9 100644
--- a/llvm/include/llvm/CodeGen/VirtRegMap.h
+++ b/llvm/include/llvm/CodeGen/VirtRegMap.h
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/CodeGen/TileShapeInfo.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h b/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
index ab6b897e9f99945..a710c091186e3ab 100644
--- a/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
+++ b/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/CodeGen/WinEHFuncInfo.h b/llvm/include/llvm/CodeGen/WinEHFuncInfo.h
index c007d462e0709ed..7e1a55c4bbf2b45 100644
--- a/llvm/include/llvm/CodeGen/WinEHFuncInfo.h
+++ b/llvm/include/llvm/CodeGen/WinEHFuncInfo.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/PointerUnion.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <limits>
 #include <utility>
diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinker.h b/llvm/include/llvm/DWARFLinker/DWARFLinker.h
index 90834b6e3f9ba31..5bb6e145810abd8 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFLinker.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinker.h
@@ -19,6 +19,7 @@
 #include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
 #include "llvm/DebugInfo/DWARF/DWARFDie.h"
 #include "llvm/DebugInfo/DWARF/DWARFExpression.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h b/llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
index 08ebd4bc70bc934..c78421c3518435a 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/CodeGen/DIE.h"
 #include "llvm/DebugInfo/DWARF/DWARFUnit.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h b/llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h
index fb02b0fc1b4dfeb..488ae6f164a1185 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h
@@ -16,6 +16,7 @@
 #include "llvm/CodeGen/NonRelocatableStringpool.h"
 #include "llvm/DebugInfo/DWARF/DWARFDebugLine.h"
 #include "llvm/DebugInfo/DWARF/DWARFDie.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include <atomic>
diff --git a/llvm/include/llvm/DWARFLinker/DWARFStreamer.h b/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
index a3842250f609c5a..1f318a065505d40 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
@@ -18,6 +18,7 @@
 #include "llvm/MC/MCObjectFileInfo.h"
 #include "llvm/MC/MCRegisterInfo.h"
 #include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Target/TargetMachine.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h b/llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h
index 5d735abab419e63..a819b791b5ac87f 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/AddressRanges.h"
 #include "llvm/DebugInfo/DWARF/DWARFDie.h"
 #include "llvm/DebugInfo/DWARF/DWARFExpression.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h b/llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h
index c20d59f9771d9d5..21eecb20b527216 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DWARFLinkerParallel/AddressesMap.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <functional>
 #include <memory>
diff --git a/llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h b/llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h
index 3c725fc4f53a840..f893b41d68f2a36 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
 #include "llvm/DebugInfo/DWARF/DWARFDie.h"
 #include "llvm/MC/MCDwarf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 
 /// ------------------------------------------------------------------
diff --git a/llvm/include/llvm/DWARFLinkerParallel/StringPool.h b/llvm/include/llvm/DWARFLinkerParallel/StringPool.h
index 4828ff4e4b05d3f..8cb976d12ec85c3 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/StringPool.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/StringPool.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ConcurrentHashtable.h"
 #include "llvm/CodeGen/DwarfStringPoolEntry.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/PerThreadBumpPtrAllocator.h"
 #include <string>
 #include <string_view>
diff --git a/llvm/include/llvm/DWARFLinkerParallel/StringTable.h b/llvm/include/llvm/DWARFLinkerParallel/StringTable.h
index 4f8aece521d85d0..a1d02e1b9864a9c 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/StringTable.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/StringTable.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/DWARFLinkerParallel/StringPool.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace dwarflinker_parallel {
diff --git a/llvm/include/llvm/DWP/DWP.h b/llvm/include/llvm/DWP/DWP.h
index e33133d38ae008e..389c3c830e4c869 100644
--- a/llvm/include/llvm/DWP/DWP.h
+++ b/llvm/include/llvm/DWP/DWP.h
@@ -10,6 +10,7 @@
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <deque>
 #include <vector>
diff --git a/llvm/include/llvm/DWP/DWPError.h b/llvm/include/llvm/DWP/DWPError.h
index a690ef3109bbfc0..da8c8406dcf17ce 100644
--- a/llvm/include/llvm/DWP/DWPError.h
+++ b/llvm/include/llvm/DWP/DWPError.h
@@ -1,6 +1,7 @@
 #ifndef LLVM_DWP_DWPERROR_H
 #define LLVM_DWP_DWPERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <string>
diff --git a/llvm/include/llvm/DWP/DWPStringPool.h b/llvm/include/llvm/DWP/DWPStringPool.h
index 1354b46f156b6fb..6234be924dae4d7 100644
--- a/llvm/include/llvm/DWP/DWPStringPool.h
+++ b/llvm/include/llvm/DWP/DWPStringPool.h
@@ -4,6 +4,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/MCStreamer.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
index fa2277343d5d4af..945c5609c6ca4f5 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
@@ -16,6 +16,7 @@
 #include "llvm/DebugInfo/CodeView/TypeCollection.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h b/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
index 99de8ebef812fb4..025db3b0b19aaca 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/CodeView/RecordSerialization.h"
 #include "llvm/Support/BinaryStreamReader.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
index c629018fd109fc8..28a98e03d5ab607 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_CVSYMBOLVISITOR_H
 
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
index 7780e233cab3b0b..ce9467760eb3192 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
index a9ad99a1d0a84c0..ac09772ca0b4630 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
@@ -16,6 +16,7 @@
 #include <cinttypes>
 #include <type_traits>
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
index 17eb06c242a95cb..4f59e182a3d3a66 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
 #define LLVM_DEBUGINFO_CODEVIEW_CODEVIEWERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
index 29ba0c3eb785086..fc6bbb1ba5a1d21 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/CodeView/CodeViewError.h"
 #include "llvm/Support/BinaryStreamReader.h"
 #include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
index 84cef520a2f4606..90ec227748d3b84 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/CodeView/TypeRecordMapping.h"
 #include "llvm/Support/BinaryByteStream.h"
 #include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
index 615fd216e65500e..89f9496e1f82608 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
@@ -17,6 +17,7 @@
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
index e21873a3af8f7f3..fe2acc5c725127f 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <map>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
index 198ce4a8b4e4c24..b2dd04684384b69 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
index f2c5bf9d7c957cf..9c80dc00bdcd7df 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
index f9d1507af5f3cd6..064a38c96cab3c9 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
@@ -16,6 +16,7 @@
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamReader.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
index 68eb9e1af3bd3c0..a5748510ca73f4f 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/CodeView/Line.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
index 6e5b8adddd4aef4..bb3054a431a3532 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h
index 39413bb73b58325..5e7e8d8135d387e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTION_H
 
 #include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
index e915d8a5830c4a9..e0c3ecbc4a3fb01 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MathExtras.h"
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
index fdca2ad063a14c4..67c7856ee8fa093 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTIONVISITOR_H
 
 #include "llvm/DebugInfo/CodeView/StringsAndChecksums.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
index 91b740ce6b9aee4..034e82b113359f1 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
index 51b8523ed969702..006a0a59220b0a5 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
index eddecf3650349ca..ff6c1253edc50f6 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace codeview {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h b/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h
index ec874b7ca114827..62a0cb60e38117e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/BinaryFormat/COFF.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/Formatters.h b/llvm/include/llvm/DebugInfo/CodeView/Formatters.h
index 10683c289224aa6..91c93b03a92ae1e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/Formatters.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/Formatters.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/GUID.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FormatAdapters.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/DebugInfo/CodeView/GUID.h b/llvm/include/llvm/DebugInfo/CodeView/GUID.h
index 5f807e6f7eebd26..74cc98d33ec1222 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/GUID.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/GUID.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H
 #define LLVM_DEBUGINFO_CODEVIEW_GUID_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <cstring>
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
index 18f16bc66a7775e..840ff27867d9cad 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/CodeView/TypeHashing.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h b/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
index 240f7092140c1d8..d9434411847a485 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/StringSaver.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/Line.h b/llvm/include/llvm/DebugInfo/CodeView/Line.h
index 6918645b94d2dfc..a0ac8a94f50cdea 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/Line.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/Line.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_CODEVIEW_LINE_H
 #define LLVM_DEBUGINFO_CODEVIEW_LINE_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <cinttypes>
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
index 10bc8f60613c8e4..f602362c347e6de 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
@@ -17,6 +17,7 @@
 #include "llvm/DebugInfo/CodeView/TypeCollection.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/RecordName.h b/llvm/include/llvm/DebugInfo/CodeView/RecordName.h
index 9078ed38d2f1429..50432f3805b3b07 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/RecordName.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/RecordName.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
index 10248dbf646b391..8f9e13cca2c6fb1 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/CodeViewError.h"
 #include "llvm/Support/BinaryStreamReader.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cinttypes>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h b/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
index fcc0452a6ae9a77..203813c697500fa 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_SIMPLETYPESERIALIZER_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h b/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
index 50e745e5c2ab98c..8904ea5043f5f1b 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
index 108abb291498e3e..48f272e1d77d102 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
@@ -16,6 +16,7 @@
 #include "llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h"
 #include "llvm/Support/BinaryByteStream.h"
 #include "llvm/Support/BinaryStreamReader.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
index 12f45dcb21ffc54..fddd4cd7652d4cb 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h
index c674700fac59d9d..6c8f875bff25bdb 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/SymbolDumpDelegate.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <memory>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h
index 3ddcf9c5739096c..10b1e6b1cb7365a 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h
@@ -19,6 +19,7 @@
 #include "llvm/DebugInfo/CodeView/RecordSerialization.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <cstdint>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
index 71bc70dde6ed186..87ba1d62411a2cb 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace codeview {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
index 30e9c626c205424..daf77f2097b78cf 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/CodeViewRecordIO.h"
 #include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class BinaryStreamReader;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
index df52b374f72df0c..7f9935e5d85d2b1 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
@@ -17,6 +17,7 @@
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/BinaryByteStream.h"
 #include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <array>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
index 80574be2097f607..17e32083e33bd93 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
 #include "llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
index 1a4d5b9d31df67d..9171e7db37cf10e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLVISITORCALLBACKS_H
 
 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
index 368d8b288315c2e..688f0b7eb22b21b 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLVISITORDELEGATE_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h b/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h
index dd082a72125a58f..a61b3cda11de70e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace codeview {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h b/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
index 2b17f5ccb13b0a8..cc97aca3e46df8e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
@@ -17,6 +17,7 @@
 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
 #include "llvm/Support/BinaryByteStream.h"
 #include "llvm/Support/BinaryStreamReader.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
index 1fad50343e3ae33..8d50e5019b43b54 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class ScopedPrinter;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h b/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
index 1914f499f0ed4c6..07b0ffdb61f661e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
@@ -17,6 +17,7 @@
 #include "llvm/DebugInfo/CodeView/TypeCollection.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FormatProviders.h"
 
 #include <type_traits>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h b/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
index 653eafa04e0ab67..2c5f9b63da31d62 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_TYPEINDEX_H
 
 #include "llvm/ADT/DenseMapInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <cassert>
 #include <cinttypes>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h b/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
index 7ef8521604fb9c4..e9cfadf0586ff50 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 template <typename T> class SmallVectorImpl;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h b/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
index 24a4accab845a87..b69cda6303794fa 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/CodeView/GUID.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <algorithm>
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h b/llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
index aa183cd7d19d30a..d28e40bfbe5e529 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace codeview {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h b/llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
index 26eb7d221679d06..070243f8532dd02 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/CodeViewRecordIO.h"
 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h b/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
index 9bcae7a4b729ce5..4e565319737f43b 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h b/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
index 2a389b9ac34e708..1b11dbe28332f5f 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_TYPETABLECOLLECTION_H
 
 #include "llvm/DebugInfo/CodeView/TypeCollection.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/StringSaver.h"
 
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h b/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
index 66944f6d0bd2da3..ebf90fff1d98e41 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h b/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
index 33f8b1f24b1b4ce..75a137ca1b0f5be 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_CODEVIEW_TYPEVISITORCALLBACKS_H
 
 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h
index 6866a6614b56bc1..9cf727151800fd9 100644
--- a/llvm/include/llvm/DebugInfo/DIContext.h
+++ b/llvm/include/llvm/DebugInfo/DIContext.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Support/WithColor.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
index 02b402e86d23399..15279728e039a48 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
index ce5d2f6c1457dc2..4581a0d9e36d6f6 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
@@ -15,6 +15,7 @@
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
 #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <utility>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
index f4d6c451cbe1d65..1bbbe329ce590e6 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
index 104ac1b9ddfbbdc..35cd164ece3f73d 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
@@ -11,6 +11,7 @@
 
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
index d449b7bed796e21..c7484374cef21e1 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_DWARF_DWARFCOMPILEUNIT_H
 
 #include "llvm/DebugInfo/DWARF/DWARFUnit.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
index 27720ac746ee2fd..ef5fa72ac819b52 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
@@ -20,6 +20,7 @@
 #include "llvm/DebugInfo/DWARF/DWARFUnit.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/Error.h"
 #include "llvm/TargetParser/Host.h"
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
index e94fa7bf5590f2a..814d506840b490b 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
@@ -11,6 +11,7 @@
 
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DWARF/DWARFSection.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
index 5f1bf26c36d8179..79bfadefc3b5f47 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGABBREV_H
 
 #include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include <cstdint>
 #include <map>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
index ae2a4e2276da0fe..39a5e77257ad227 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
@@ -11,6 +11,7 @@
 
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DIContext.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
index 760d8826771c092..dd9d6709a61f400 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/BinaryFormat/Dwarf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
index 068674cfae5c56b..5090fbc380d53a7 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
index bc35f2ab988ed2d..84094eda6361a70 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/DebugInfo/DWARF/DWARFExpression.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/TargetParser/Triple.h"
 #include <map>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
index 7d59f4257b2e2ab..759607e71e72769 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
@@ -11,6 +11,7 @@
 
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
index 5c01dad848fd215..dc950bd9f796ebe 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
 #include "llvm/DebugInfo/DWARF/DWARFUnit.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MD5.h"
 #include "llvm/Support/Path.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
index 5a82e7bd6289a0e..7205a2b52e27185 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Errc.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
index 10d4eb25a921b1f..a9270c7eefdb975 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
 #include "llvm/DebugInfo/DWARF/DWARFUnit.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
index 6c82bbfe74f7b95..1faa336099a3a00 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/Dwarf.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
index 02bb5f0a3d95058..8eb4f592820d922 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGRANGELIST_H
 
 #include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
index 8ddd9cab23644ab..b12d807bcb8d1a0 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
@@ -13,6 +13,7 @@
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
 #include "llvm/DebugInfo/DWARF/DWARFListTable.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
index 421b84d644db64b..048ef08ab57ded8 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/DWARF/DWARFAttribute.h"
 #include "llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h"
 #include "llvm/DebugInfo/DWARF/DWARFLocationExpression.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <iterator>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
index 00228a32173f1fa..1a7c354c0a768a8 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/BinaryFormat/Dwarf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
index 2dcd7805b6c96b1..b9d1331ec800066 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DIContext.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
index 6b23c4e57d95031..7e7e9052dc1339a 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <utility>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
index d739d6c195df99c..a0303da25313b40 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
@@ -12,6 +12,7 @@
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h
index 8b5497f4eeb9641..9884cbbbe2161b4 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_DWARF_DWARFLOCATIONEXPRESSION_H
 
 #include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h
index 52bd91d9140f938..6e886abad627d5f 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/DWARF/DWARFRelocMap.h"
 #include "llvm/DebugInfo/DWARF/DWARFSection.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
index c5999a65c2a7259..0a8571ec711d737 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Object/RelocationResolver.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h
index e03dc21fb6f00fd..d0b221165c3a64b 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_DWARF_DWARFSECTION_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
index e05271740e61577..19212ead6626488 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/DebugInfo/DWARF/DWARFDie.h"
+#include "llvm/Support/Compiler.h"
 
 #include <string>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
index 85ec6fd86ade674..afbc3d52c3224b6 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/DWARF/DWARFUnit.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
index b42c951598d6fbd..e70af0309bd904c 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
@@ -21,6 +21,7 @@
 #include "llvm/DebugInfo/DWARF/DWARFDie.h"
 #include "llvm/DebugInfo/DWARF/DWARFLocationExpression.h"
 #include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
index e65b193ffc8617a..2a0dcf5e750b08d 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
index ac890cdf065f877..b57ad1d65122835 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
 #include "llvm/DebugInfo/DWARF/DWARFDie.h"
 #include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <map>
 #include <set>
diff --git a/llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h b/llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h
index b8d7199f2d87ff4..ee0241dcb11112a 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/GSYM/ExtractRanges.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h b/llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h
index 9a6568719875da5..b33fcb1d204e079 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_GSYM_EXTRACTRANGES_H
 
 #include "llvm/ADT/AddressRanges.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
 #include <stdint.h>
diff --git a/llvm/include/llvm/DebugInfo/GSYM/FileEntry.h b/llvm/include/llvm/DebugInfo/GSYM/FileEntry.h
index 8e00c5f01c8e894..ee27995735a68a9 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/FileEntry.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/FileEntry.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/Hashing.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <stdint.h>
 
diff --git a/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h b/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
index 74811240e0b5e4f..402cef8491ae9a9 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_GSYM_FILEWRITER_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 
 #include <stddef.h>
diff --git a/llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h b/llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
index cf917bf294cfc31..cfbdfe78c7ca1e2 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/GSYM/LineTable.h"
 #include "llvm/DebugInfo/GSYM/LookupResult.h"
 #include "llvm/DebugInfo/GSYM/StringTable.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <tuple>
 
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h b/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
index bca3a83cc685045..5e5f6287bfdd417 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
@@ -20,6 +20,7 @@
 #include "llvm/DebugInfo/GSYM/FileEntry.h"
 #include "llvm/DebugInfo/GSYM/FunctionInfo.h"
 #include "llvm/MC/StringTableBuilder.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Path.h"
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h b/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
index 5c0ab87dca3035c..885b6297de07865 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/GSYM/Header.h"
 #include "llvm/DebugInfo/GSYM/LineEntry.h"
 #include "llvm/DebugInfo/GSYM/StringTable.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/ErrorOr.h"
diff --git a/llvm/include/llvm/DebugInfo/GSYM/Header.h b/llvm/include/llvm/DebugInfo/GSYM/Header.h
index 9ca32d25985e9fe..1198ef73cb2bd92 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/Header.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/Header.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_GSYM_HEADER_H
 #define LLVM_DEBUGINFO_GSYM_HEADER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <cstddef>
diff --git a/llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h b/llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h
index 03bc85396d99f35..f414665c2155e55 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/GSYM/ExtractRanges.h"
 #include "llvm/DebugInfo/GSYM/LineEntry.h"
 #include "llvm/DebugInfo/GSYM/LookupResult.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <stdint.h>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/GSYM/LineEntry.h b/llvm/include/llvm/DebugInfo/GSYM/LineEntry.h
index e68624b21929ed8..968fdebb8b0b6d0 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/LineEntry.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/LineEntry.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_GSYM_LINEENTRY_H
 
 #include "llvm/DebugInfo/GSYM/ExtractRanges.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace gsym {
diff --git a/llvm/include/llvm/DebugInfo/GSYM/LineTable.h b/llvm/include/llvm/DebugInfo/GSYM/LineTable.h
index 7749e5e4fbb3b84..b3232f077779bb3 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/LineTable.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/LineTable.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_GSYM_LINETABLE_H
 
 #include "llvm/DebugInfo/GSYM/LineEntry.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h b/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h
index 9ccc96fbb4d5c6b..bf64998c9e84ede 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/AddressRanges.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <inttypes.h>
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h b/llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h
index dcbda39a769620c..600fc531b8ba8ac 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_GSYM_OBJECTFILETRANSFORMER_H
 #define LLVM_DEBUGINFO_GSYM_OBJECTFILETRANSFORMER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/GSYM/StringTable.h b/llvm/include/llvm/DebugInfo/GSYM/StringTable.h
index d9c9ede91be5f7c..3ad4db78a0feab4 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/StringTable.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/StringTable.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/GSYM/ExtractRanges.h"
+#include "llvm/Support/Compiler.h"
 #include <stdint.h>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h
index 4019ea6f1744834..677c91b616c0f1f 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h
@@ -15,6 +15,7 @@
 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVCOMPARE_H
 
 #include "llvm/DebugInfo/LogicalView/Core/LVObject.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace logicalview {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
index 17fa04040ad7743..21bf3234d9e8a5b 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
@@ -16,6 +16,7 @@
 
 #include "llvm/DebugInfo/LogicalView/Core/LVObject.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <set>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h
index c335c34e372b9f7..a57a1e4da49c28e 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h
@@ -15,6 +15,7 @@
 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVLINE_H
 
 #include "llvm/DebugInfo/LogicalView/Core/LVElement.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace logicalview {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h
index 3b556f9927832dd..a552b2cb44ac108 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h
@@ -15,6 +15,7 @@
 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVLOCATION_H
 
 #include "llvm/DebugInfo/LogicalView/Core/LVObject.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace logicalview {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
index ca429d2c289329c..b34c60994e952ab 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/DebugInfo/LogicalView/Core/LVSupport.h"
+#include "llvm/Support/Compiler.h"
 #include <limits>
 #include <list>
 #include <map>
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
index a0a360c0a434f91..7a8c00957db9d7e 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
@@ -19,6 +19,7 @@
 #include "llvm/DebugInfo/LogicalView/Core/LVScope.h"
 #include "llvm/DebugInfo/LogicalView/Core/LVSymbol.h"
 #include "llvm/DebugInfo/LogicalView/Core/LVType.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Regex.h"
 #include <set>
 #include <string>
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h
index 3ec0ccb31168fc1..6e41cd9fc76cb63 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/IntervalTree.h"
 #include "llvm/DebugInfo/LogicalView/Core/LVObject.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace logicalview {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h
index 9ce26398e48dfb3..213419d1a22c7d0 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h
@@ -16,6 +16,7 @@
 
 #include "llvm/DebugInfo/LogicalView/Core/LVOptions.h"
 #include "llvm/DebugInfo/LogicalView/Core/LVRange.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ScopedPrinter.h"
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
index 1b3c377cd7dbba0..058e4f3e6dd5126 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/LogicalView/Core/LVLocation.h"
 #include "llvm/DebugInfo/LogicalView/Core/LVSort.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include <list>
 #include <map>
 #include <set>
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h
index 01f0b1880fbc3a6..2086d08eab84c5d 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSORT_H
 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSORT_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 namespace logicalview {
 
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
index 4c596b5b1dde732..e10b99730a7ab03 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
index 50f2c9a09ff5def..c3ee07a2b244e38 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/DebugInfo/LogicalView/Core/LVStringPool.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/Path.h"
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h
index 25bfa9eb77d8ae9..5ab45e2fa5678f9 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h
@@ -15,6 +15,7 @@
 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVSYMBOL_H
 
 #include "llvm/DebugInfo/LogicalView/Core/LVElement.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace logicalview {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h
index 28881b3c95b17dd..b2d2702b2e229fe 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h
@@ -15,6 +15,7 @@
 #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVTYPE_H
 
 #include "llvm/DebugInfo/LogicalView/Core/LVElement.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace logicalview {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h b/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h
index bf30501d00c1f6e..9a8a6fd4a4095d3 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h
@@ -19,6 +19,7 @@
 #include "llvm/Object/Archive.h"
 #include "llvm/Object/MachOUniversal.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/ScopedPrinter.h"
 #include <string>
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
index a66cf4608823bee..911af0e7891bbd3 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
@@ -26,6 +26,7 @@
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Object/COFF.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace logicalview {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h
index 8a32210bac3c9cc..f419b348f08a6f5 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h
@@ -26,6 +26,7 @@
 #include "llvm/Support/BinaryByteStream.h"
 #include "llvm/Support/BinaryItemStream.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 template <> struct BinaryItemTraits<codeview::CVType> {
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h
index 3c461fd9e1e9260..d23ff9d64310929 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h
@@ -24,6 +24,7 @@
 #include "llvm/DebugInfo/PDB/Native/InputFile.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <stack>
 #include <utility>
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h
index 0837b886a273a62..da210ec1ee19007 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h
@@ -17,6 +17,7 @@
 #include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
 #include "llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h"
+#include "llvm/Support/Compiler.h"
 #include <unordered_set>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h b/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h
index 7e80f96b89ae1bf..9e096f7c15b90b7 100644
--- a/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h
+++ b/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_MSF_IMSFFILE_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h b/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h
index 2ac18a8efaba829..ae18bc5ea728aa9 100644
--- a/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h
+++ b/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/BitVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <utility>
diff --git a/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h b/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h
index 0520b94ea3dd355..3009532608dc65d 100644
--- a/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h
+++ b/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/BitVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MathExtras.h"
diff --git a/llvm/include/llvm/DebugInfo/MSF/MSFError.h b/llvm/include/llvm/DebugInfo/MSF/MSFError.h
index 0d0a43102a9b08e..8360073508228f2 100644
--- a/llvm/include/llvm/DebugInfo/MSF/MSFError.h
+++ b/llvm/include/llvm/DebugInfo/MSF/MSFError.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_MSF_MSFERROR_H
 #define LLVM_DEBUGINFO_MSF_MSFERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h b/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h
index b5f0596fceed33b..5ac36a0e53bee29 100644
--- a/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h
+++ b/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h
@@ -15,6 +15,7 @@
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/BinaryStream.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h b/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
index 49ba20af7263601..cf09d3f5992bee3 100644
--- a/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
+++ b/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h b/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h
index 96d960599f7ef7b..cffdf90dbf2fd49 100644
--- a/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h
+++ b/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_DIA_DIAERROR_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/GenericError.h b/llvm/include/llvm/DebugInfo/PDB/GenericError.h
index 1121343ed64f8c2..48c2480b6cfbad4 100644
--- a/llvm/include/llvm/DebugInfo/PDB/GenericError.h
+++ b/llvm/include/llvm/DebugInfo/PDB/GenericError.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_PDB_GENERICERROR_H
 #define LLVM_DEBUGINFO_PDB_GENERICERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h b/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h
index fb18396cafe31e8..7f4f5e92cb8690a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_IPDBDATASTREAM_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <optional>
 #include <string>
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h b/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
index 93525b716791550..f7de588bee3190a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_IPDBENUMCHILDREN_H
 
 #include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h b/llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h
index 24138b380db4aee..d8dd3b8c3fff095 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_PDB_IPDBFRAMEDATA_H
 #define LLVM_DEBUGINFO_PDB_IPDBFRAMEDATA_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <string>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h b/llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
index 6ee6c7cc8fc1d2c..cbda789ddab48aa 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
 #define LLVM_DEBUGINFO_PDB_IPDBINJECTEDSOURCE_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <string>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h b/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
index 47b6397099b7811..f7c7d70020f6085 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_PDB_IPDBLINENUMBER_H
 #define LLVM_DEBUGINFO_PDB_IPDBLINENUMBER_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h b/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
index f59e933ca575f7c..6aa33e13a9a865c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h b/llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
index c5cf4bbe556007e..6065459c40527ea 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_IPDBSECTIONCONTRIB_H
 
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h b/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h
index 7e38654c6550423..32e454a65ef98f6 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h
@@ -13,6 +13,7 @@
 #include "PDBTypes.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h b/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
index d7e49fb70580185..52d8ba87f27bb44 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_IPDBSOURCEFILE_H
 
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <string>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h b/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h
index 55ca230d58c41f1..1ed2e00d9f6843f 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_IPDBTABLE_H
 
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
index 1ecae5c32509e19..f34ecee173a8b5c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
index eda24e33869fef2..71826df8fb33c08 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
 #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <string>
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
index de5b46f216721e3..d8d6e2935b60018 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstddef>
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h
index 3f60130f5752904..aa7509b25641516 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h
@@ -16,6 +16,7 @@
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
index 9a84fc3e7c55cf7..df1883693067ac3 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
@@ -14,6 +14,7 @@
 #include "llvm/BinaryFormat/COFF.h"
 #include "llvm/Object/COFF.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include "llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h"
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h b/llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h
index dcc67f1e4a8cd91..6ecdc2034bb6bc8 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_NATIVE_ENUMTABLES_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 template <typename T> struct EnumEntry;
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h b/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h
index ed745eaf9727460..0371d899792e87a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/FormatAdapters.h"
 #include "llvm/Support/FormatVariadic.h"
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
index 28a72c887f25a5d..6387f9333086e49 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
index 2988bef4a75b296..e2210b278bd5e4d 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/Hash.h b/llvm/include/llvm/DebugInfo/PDB/Native/Hash.h
index b048d878a12cd05..9186a99afdaf0c6 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/Hash.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/Hash.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h b/llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
index eb03397ba694004..71c4045db11d421 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/Native/RawError.h"
 #include "llvm/Support/BinaryStreamReader.h"
 #include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h b/llvm/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
index da4078365ff55f1..503e63317848ac5 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_ISECTIONCONTRIBVISITOR_H
 #define LLVM_DEBUGINFO_PDB_NATIVE_ISECTIONCONTRIBVISITOR_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 namespace pdb {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h
index 625bab6a4378284..c8779c19fac568c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
 #include "llvm/Support/BinaryStream.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
index 4b77e321353f8fd..3b42e248c4da6e1 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_INFOSTREAMBUILDER_H
 #define LLVM_DEBUGINFO_PDB_NATIVE_INFOSTREAMBUILDER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include "llvm/DebugInfo/CodeView/GUID.h"
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h
index 259c924d9d7c61b..905cf8d31ea1429 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
 #include "llvm/DebugInfo/PDB/Native/HashTable.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h b/llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h
index 834cd96b77b467c..51a73ca6f53d359 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/PDB/Native/ModuleDebugStream.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h b/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
index bb029e534c74e02..ce4375959848759 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
@@ -14,6 +14,7 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/DebugInfo/PDB/Native/FormatUtil.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
index 0caf9fffbad693e..7b14adc41c8fece 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
 #include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h b/llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
index 18fbab0dd38c167..78f24522e8f674c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/PDB/Native/HashTable.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
index 50d437642d0f736..0ec2302a25098fb 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
index c10e652efa8d264..7efe7bf76ceadee 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h
index 50d4c2db3c2aa32..93a4623942c3966 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/IPDBInjectedSource.h"
 #include "llvm/DebugInfo/PDB/Native/InjectedSourceStream.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h
index a936b769d688ceb..90f5a7d01a3b729 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
 #include "llvm/DebugInfo/PDB/Native/NativeLineNumber.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
index 94f1ee18ed9f43c..2d76f180e9a4202 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/Support/Compiler.h"
 namespace llvm {
 namespace pdb {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h
index 5fc91675f2092e3..7aee9d8e7acfcae 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
index 2ca000c1c0fe6e5..ea461064fa4fd5e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 #include <vector>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
index 82fdff130c4f7f4..31e61e8318193ca 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/CodeView/GUID.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h
index c15e22f61077a48..53d4f747c9e1849 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class raw_ostream;
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h
index 3467ac912162e51..a702c2edd8ce950 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h
index 53f2985833fd91f..df793616ee50361 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/Line.h"
 #include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h
index 43de80507d02341..e9ae293cf1e603b 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
index 4133be2207136ae..699e2d78fc8cbd8 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_NATIVE_NATIVERAWSYMBOL_H
 
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h
index 95be7d09aae98ff..01207800d8fa6de 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/PDB/Native/SymbolCache.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h
index c6653368bc0cee7..087849116dc69f9 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
 #include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
index ab4abc4d3c2cc7c..d6c5027db993783 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
index 262864fd709fa3a..126cd14c0e3074c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
@@ -13,6 +13,7 @@
 
 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
index 8bb09f05d0bc64b..e7e16b31bd28a8f 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
@@ -12,6 +12,7 @@
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
index 01f13ce1073e1a7..a10a0f1cde41c11 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class raw_ostream;
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
index 47ea722313c3638..dd5603d2da05a27 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
index 184e00086849ce6..d0503d942dafbe3 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
index ce4ebcd00c4a8e1..b05b5d12f2562c5 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
index 79924a78cd218c9..e9d808205e43abd 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
index 92d51706c1dac70..41a898d6f1a66ca 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace pdb {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h
index 1ea92ed4bf21f83..76be171cac0b0d8 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h
@@ -13,6 +13,7 @@
 #include "llvm/DebugInfo/MSF/MSFCommon.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
index c23d958f8ed0612..f678b2be20e6928 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
@@ -15,6 +15,7 @@
 #include "llvm/DebugInfo/PDB/Native/NamedStreamMap.h"
 #include "llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <memory>
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
index 4336cd398baf1e5..daacd778f8c5b16 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
index 986bd3645108ab3..e60bd547697ccdb 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
index a59a752ff91167b..2159bba18f3115c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/PDB/Native/GlobalsStream.h"
 #include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/RawError.h b/llvm/include/llvm/DebugInfo/PDB/Native/RawError.h
index 8836adf9497f432..d61e0f009e8b9c5 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/RawError.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/RawError.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_RAWERROR_H
 #define LLVM_DEBUGINFO_PDB_NATIVE_RAWERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h b/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
index 4a9db4962fbbc16..f02cb4a88d69a21 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/GUID.h"
 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h b/llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
index 7c5b6b9e1bdf61a..714e796a9b9e7ee 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h"
 #include "llvm/DebugInfo/PDB/Native/NativeSourceFile.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 #include <memory>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
index c2f7eb04d16e1e6..e72d9d37db94a83 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/CodeView/CVRecord.h"
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h b/llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
index 3cdb890d81d359d..303356cc7d04e94 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_NATIVE_TPIHASHING_H
 
 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
index 4c413abb2bf0277..6c8a8200b613bfa 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
index 855b5fe1f931186..4852dfa04840724 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDB.h b/llvm/include/llvm/DebugInfo/PDB/PDB.h
index 6d734dc2f243ac4..0803af881392b2b 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDB.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDB.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <memory>
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBContext.h b/llvm/include/llvm/DebugInfo/PDB/PDBContext.h
index 3163c0a1dae034e..fbcae9763e66e4f 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBContext.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBContext.h
@@ -11,6 +11,7 @@
 
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/DebugInfo/PDB/IPDBSession.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 #include <string>
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h b/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h
index 802d18a069ee44c..4d7e30b6a7190fc 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cstdint>
 #include <unordered_map>
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h
index f81b15f2353d702..8e2915f3b718bc3 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_PDBSYMDUMPER_H
 
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h
index 4e34b75b6117e2f..8253f10f654ca0d 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h
@@ -13,6 +13,7 @@
 #include "PDBExtras.h"
 #include "PDBTypes.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 
 #define FORWARD_SYMBOL_METHOD(MethodName)                                      \
   decltype(auto) MethodName() const { return RawSymbol->MethodName(); }
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
index c8d3d0b7bb9635b..fc9f017435e471b 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
@@ -10,6 +10,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
index 09142227b01762d..30c708a2831c10e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
@@ -10,6 +10,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
index ca8b39d03f86f20..d804b499e0399bf 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
@@ -10,6 +10,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
index 46c1592685338a1..b1fcd0994d3c83a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
index cba082f2ff19668..edebb38707de9fb 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
index c78b47ce99248bc..661c079937e3377 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
@@ -12,6 +12,7 @@
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h
index 61e67d1368a88b2..d629046d13d77d5 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h
@@ -12,6 +12,7 @@
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
index cde66d399243836..e523d980c18be9c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
index bfc7f7689718284..15c2762591de6ae 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
@@ -13,6 +13,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
index 09c6f47289608e5..775b4bf7663f443 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
index 843a8348a2f0be6..d7be5099f06e104 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
index 148802a47cbcced..2396a88498577af 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
index a757cc02624b10e..240d98d763a1936 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
index 2b81a63995e6ed6..0e141ead88eec51 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
index 496141e5fa68fd3..75583ec16c10e65 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
index c74ac3fb9cce1f5..83221b654d90ce6 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
@@ -13,6 +13,7 @@
 #include "PDBTypes.h"
 
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
index b923983095f335c..83e6c8174ccda6e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
index b15abf7bedfd7de..cdef3fa869d0d08 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
index e7570b41dd21b0b..0a0d7bb3e285c5e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
index ee1f736c17a04e8..99b42f5aa58ca1a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
@@ -13,6 +13,7 @@
 #include "PDBTypes.h"
 
 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
index 9fde421162614d7..ca8a613c5080e54 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
index 71decff722a5113..b1cb4c4b7a5db11 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
index ceb4bff5b7b4261..fcca9e4a5f1f04f 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
index 866bf520a3b26a3..ae568811f092cae 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
index 1b43ef9a21bd2b9..feb9a3856653943 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
index 3f37730cf1df4b3..5654b60c1f5a198 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
index a3a49a4b619a581..2f99f251e080179 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
@@ -13,6 +13,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
index 6223bee98670717..6cee234c9fdfd24 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
index bec0a9970a9f2b0..a17d0f1d793132a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
index a53af49bc9e018e..400299e8bc4b003 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
@@ -10,6 +10,7 @@
 #define LLVM_DEBUGINFO_PDB_PDBSYMBOLUNKNOWN_H
 
 #include "PDBSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
index dde25a023d000ac..28ff189234112da 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
@@ -11,6 +11,7 @@
 
 #include "PDBSymbol.h"
 #include "PDBTypes.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
index b6a794ad7e76095..3b04fc780ac97ae 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
@@ -14,6 +14,7 @@
 #include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
 #include "llvm/DebugInfo/PDB/IPDBFrameData.h"
 #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
+#include "llvm/Support/Compiler.h"
 #include <cctype>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/DebugInfo/PDB/UDTLayout.h b/llvm/include/llvm/DebugInfo/PDB/UDTLayout.h
index 8631c412f114254..3c24b957a35a648 100644
--- a/llvm/include/llvm/DebugInfo/PDB/UDTLayout.h
+++ b/llvm/include/llvm/DebugInfo/PDB/UDTLayout.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 #include <string>
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h b/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
index b89f1da5857acfd..0a2dfdb07f2fa20 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
@@ -15,6 +15,7 @@
 #define LLVM_DEBUGINFO_SYMBOLIZE_DIPRINTER_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/JSON.h"
 #include <memory>
 #include <vector>
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Markup.h b/llvm/include/llvm/DebugInfo/Symbolize/Markup.h
index 37e1d2748e31c31..d3698a440daea88 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/Markup.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/Markup.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Regex.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h b/llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h
index a1514d91702b9f1..1e722319e8dbcce 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/DebugInfo/Symbolize/Markup.h"
 #include "llvm/Object/BuildID.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/WithColor.h"
 #include "llvm/Support/raw_ostream.h"
 #include <map>
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
index 51e92b83eadbac0..7037afa26893053 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
@@ -13,6 +13,7 @@
 #define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZABLEMODULE_H
 
 #include "llvm/DebugInfo/DIContext.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
index 075dbe3e0e372ed..1db5746907c2f12 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
@@ -15,6 +15,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
index 99a7f219baaa09f..31bda033ae57216 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
@@ -19,6 +19,7 @@
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/BuildID.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <algorithm>
 #include <cstdint>
diff --git a/llvm/include/llvm/Debuginfod/BuildIDFetcher.h b/llvm/include/llvm/Debuginfod/BuildIDFetcher.h
index f0ecea1821257b9..264e43ac22a221e 100644
--- a/llvm/include/llvm/Debuginfod/BuildIDFetcher.h
+++ b/llvm/include/llvm/Debuginfod/BuildIDFetcher.h
@@ -16,6 +16,7 @@
 #define LLVM_DEBUGINFOD_DIFETCHER_H
 
 #include "llvm/Object/BuildID.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Debuginfod/Debuginfod.h b/llvm/include/llvm/Debuginfod/Debuginfod.h
index ec7f5691dda4fbf..33831bd4535a20c 100644
--- a/llvm/include/llvm/Debuginfod/Debuginfod.h
+++ b/llvm/include/llvm/Debuginfod/Debuginfod.h
@@ -25,6 +25,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Object/BuildID.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/Mutex.h"
diff --git a/llvm/include/llvm/Debuginfod/HTTPClient.h b/llvm/include/llvm/Debuginfod/HTTPClient.h
index 6ded55502f05511..a382727d99057dd 100644
--- a/llvm/include/llvm/Debuginfod/HTTPClient.h
+++ b/llvm/include/llvm/Debuginfod/HTTPClient.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 
diff --git a/llvm/include/llvm/Debuginfod/HTTPServer.h b/llvm/include/llvm/Debuginfod/HTTPServer.h
index 15e611ec546f8c6..4ef2fc1def3589c 100644
--- a/llvm/include/llvm/Debuginfod/HTTPServer.h
+++ b/llvm/include/llvm/Debuginfod/HTTPServer.h
@@ -17,6 +17,7 @@
 #define LLVM_DEBUGINFOD_HTTPSERVER_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #ifdef LLVM_ENABLE_HTTPLIB
diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index 68db8c62a29e512..398d02f10e4945c 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -19,6 +19,7 @@
 #include "DemangleConfig.h"
 #include "StringViewExtras.h"
 #include "Utility.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <cctype>
diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangle.h b/llvm/include/llvm/Demangle/MicrosoftDemangle.h
index 1529b803debe5a8..d76e2de83a50ff1 100644
--- a/llvm/include/llvm/Demangle/MicrosoftDemangle.h
+++ b/llvm/include/llvm/Demangle/MicrosoftDemangle.h
@@ -10,6 +10,7 @@
 #define LLVM_DEMANGLE_MICROSOFTDEMANGLE_H
 
 #include "llvm/Demangle/MicrosoftDemangleNodes.h"
+#include "llvm/Support/Compiler.h"
 
 #include <cassert>
 #include <string_view>
diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
index 1913bff0ada7fd0..53dc23217fde10b 100644
--- a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
+++ b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_DEMANGLE_MICROSOFTDEMANGLENODES_H
 #define LLVM_DEMANGLE_MICROSOFTDEMANGLENODES_H
 
+#include "llvm/Support/Compiler.h"
 #include <array>
 #include <cstdint>
 #include <string>
diff --git a/llvm/include/llvm/Demangle/Utility.h b/llvm/include/llvm/Demangle/Utility.h
index a906d238cf447b4..fa6ab2d04bf27fb 100644
--- a/llvm/include/llvm/Demangle/Utility.h
+++ b/llvm/include/llvm/Demangle/Utility.h
@@ -17,6 +17,7 @@
 #define DEMANGLE_UTILITY_H
 
 #include "DemangleConfig.h"
+#include "llvm/Support/Compiler.h"
 
 #include <array>
 #include <cassert>
diff --git a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
index d26180a0f474644..087814c1ca107ea 100644
--- a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
+++ b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
@@ -25,6 +25,7 @@
 #include "llvm/Object/Binary.h"
 #include "llvm/Support/CBindingWrapping.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Mutex.h"
 #include "llvm/Target/TargetMachine.h"
diff --git a/llvm/include/llvm/ExecutionEngine/GenericValue.h b/llvm/include/llvm/ExecutionEngine/GenericValue.h
index 1ca989da1b7ee7a..347f7fcbc481bcf 100644
--- a/llvm/include/llvm/ExecutionEngine/GenericValue.h
+++ b/llvm/include/llvm/ExecutionEngine/GenericValue.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_GENERICVALUE_H
 
 #include "llvm/ADT/APInt.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/JITEventListener.h b/llvm/include/llvm/ExecutionEngine/JITEventListener.h
index effff2ea5cfab44..230b971d0b3a1da 100644
--- a/llvm/include/llvm/ExecutionEngine/JITEventListener.h
+++ b/llvm/include/llvm/ExecutionEngine/JITEventListener.h
@@ -19,6 +19,7 @@
 #include "llvm/ExecutionEngine/RuntimeDyld.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/COFF.h b/llvm/include/llvm/ExecutionEngine/JITLink/COFF.h
index 87d3648d37e8ba8..6f9780cbeb15d33 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/COFF.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/COFF.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_COFF_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h b/llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h
index fff32d6d960933c..3c7558d42db7108 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_COFF_X86_64_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h b/llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h
index d748d4b0fa5927f..50c43890b020efc 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h
@@ -10,6 +10,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_DWARFRECORDSECTIONSPLITTER_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h b/llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h
index 7fb61b6a021af96..1552fbed964abfe 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
 #include "llvm/ExecutionEngine/JITSymbol.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/TargetParser/Triple.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF.h
index 038591f9add0557..89c83d3eea261fb 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_ELF_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
index 25d1c3aac2c26e3..81d2e429b315ff7 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
 #include "llvm/ExecutionEngine/JITLink/aarch32.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
index 50eb598139ea0b9..d6496247f132794 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
@@ -16,6 +16,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_ELF_AARCH64_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h
index 44ebd9699461137..3bdf64a4b1c66f6 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h
@@ -16,6 +16,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_ELF_I386_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h
index 4d7655c4b988b74..82ea5f2cdd10f27 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h
@@ -16,6 +16,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_ELF_LOONGARCH_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h
index 8db986a4a9fa156..ab2d1f8a76404d3 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_ELF_PPC64_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm::jitlink {
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h
index a0e573baca066fa..8dada6381640540 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h
@@ -16,6 +16,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_ELF_RISCV_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h
index fbe5765438d240d..fa5471427528765 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_ELF_X86_64_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
index 568c9cf87f80e46..cb50e8c586a7be6 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
@@ -24,6 +24,7 @@
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/BinaryStreamReader.h"
 #include "llvm/Support/BinaryStreamWriter.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FormatVariadic.h"
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
index 6bb1b5a285b1623..3ee4300d9d57aa0 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_EXECUTIONENGINE_JITLINK_JITLINKDYLIB_H
 #define LLVM_EXECUTIONENGINE_JITLINK_JITLINKDYLIB_H
 
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
index 09e0d71cf0bd29c..b13e4ea96bb717a 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
@@ -20,6 +20,7 @@
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
 #include "llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MSVCErrorWorkarounds.h"
 #include "llvm/Support/Memory.h"
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/MachO.h b/llvm/include/llvm/ExecutionEngine/JITLink/MachO.h
index b8432c4d26c68c0..68239bf9b546674 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/MachO.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/MachO.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_MACHO_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h b/llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h
index 31721bf999ec18b..a8263e29bc076c6 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_MACHO_ARM64_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h b/llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h
index 6aee8c354f91e63..693adf5a074ed22 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_MACHO_X86_64_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h b/llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h
index 7ab8ae3e53cec29..150ff1411986cc7 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_TABLEMANAGER_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
index c05c7ab2ad83185..6368a04665235db 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
@@ -17,6 +17,7 @@
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
 #include "llvm/Support/ARMBuildAttributes.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h b/llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
index 50bebf335de1a38..c578bd836ed6df2 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
@@ -16,6 +16,7 @@
 #include "TableManager.h"
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
 #include "llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/i386.h b/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
index adfdabf44f0198d..3f244d62827ab5c 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
 #include "llvm/ExecutionEngine/JITLink/TableManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm::jitlink::i386 {
 /// Represets i386 fixups
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h b/llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h
index bec657723a38cf9..9919fbd8ae87193 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h
@@ -16,6 +16,7 @@
 #include "TableManager.h"
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
 #include "llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
index d4b7256e563a9e4..c158db261b7abf7 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
 #include "llvm/ExecutionEngine/JITLink/TableManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 
 namespace llvm::jitlink::ppc64 {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/riscv.h b/llvm/include/llvm/ExecutionEngine/JITLink/riscv.h
index c884cc28428b5c5..53802112dc1e5a2 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/riscv.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/riscv.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_JITLINK_RISCV_H
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace jitlink {
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h b/llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h
index 519aa192c641702..1d1b63f2a3df83e 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/JITLink/JITLink.h"
 #include "llvm/ExecutionEngine/JITLink/TableManager.h"
+#include "llvm/Support/Compiler.h"
 
 #include <limits>
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITSymbol.h b/llvm/include/llvm/ExecutionEngine/JITSymbol.h
index 440e10cc881f03a..e096fec62d1d9bf 100644
--- a/llvm/include/llvm/ExecutionEngine/JITSymbol.h
+++ b/llvm/include/llvm/ExecutionEngine/JITSymbol.h
@@ -25,6 +25,7 @@
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/MCJIT.h b/llvm/include/llvm/ExecutionEngine/MCJIT.h
index adce98f380c54f8..a94fa40cad80b04 100644
--- a/llvm/include/llvm/ExecutionEngine/MCJIT.h
+++ b/llvm/include/llvm/ExecutionEngine/MCJIT.h
@@ -15,6 +15,7 @@
 #define LLVM_EXECUTIONENGINE_MCJIT_H
 
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdlib>
 
 extern "C" void LLVMLinkInMCJIT();
diff --git a/llvm/include/llvm/ExecutionEngine/ObjectCache.h b/llvm/include/llvm/ExecutionEngine/ObjectCache.h
index 1c72ca39f7c1631..64512747cfad00b 100644
--- a/llvm/include/llvm/ExecutionEngine/ObjectCache.h
+++ b/llvm/include/llvm/ExecutionEngine/ObjectCache.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_EXECUTIONENGINE_OBJECTCACHE_H
 #define LLVM_EXECUTIONENGINE_OBJECTCACHE_H
 
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
index 4ef208dbbca22c0..b01520d26b04a6b 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
@@ -20,6 +20,7 @@
 #include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
 #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 
 #include <future>
 #include <memory>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h b/llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h
index e3904717f1b267b..b317a971a268d4f 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h
@@ -18,6 +18,7 @@
 #include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
 #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 
 #include <future>
 #include <memory>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
index 23a64b5836db85f..6c8a08659ea3e59 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
@@ -37,6 +37,7 @@
 #include "llvm/IR/Module.h"
 #include "llvm/IR/Type.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Utils/ValueMapper.h"
 #include <algorithm>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h
index ee53f2383cb07d6..8c9b35349d338bd 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h
@@ -16,6 +16,7 @@
 #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
 #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
 #include "llvm/ExecutionEngine/Orc/Layer.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
index c51a15c8ed3759c..612092b55ef83a7 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -24,6 +24,7 @@
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h"
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
 #include "llvm/ExecutionEngine/Orc/TaskDispatch.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ExtensibleRTTI.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h b/llvm/include/llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h
index 70f5230c5fceb68..75badc0b7f29b38 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h
@@ -17,6 +17,7 @@
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h"
 #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Memory.h"
 #include "llvm/Support/MemoryBufferRef.h"
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h
index c4ef06f1fbc65be..48c1b8d8bcd58c2 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/SymbolStringPool.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/raw_ostream.h"
 #include <memory>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h b/llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h
index e21d5823288ee49..2a222b57af13605 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h
@@ -16,6 +16,7 @@
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h"
 #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
index 84977711d63fd7d..94793eeefb8a821 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
@@ -18,6 +18,7 @@
 #include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
 #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 
 #include <future>
 #include <thread>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
index 201d52aa958158a..7de36f91bc13c37 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
@@ -16,6 +16,7 @@
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Memory.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h
index 63797edec89e611..6da14b2cdb7d160 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/ExecutionEngine/Orc/Core.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
index 9772c84b682a53b..3277986f4e3d8f0 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/JITLink/EHFrameSupport.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h
index 02e580c86f548e4..4e018393849f80a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h
@@ -20,6 +20,7 @@
 
 #include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
 #include "llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h
index 18656d03e441637..977b2f10562af9e 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h
@@ -20,6 +20,7 @@
 
 #include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
 #include "llvm/ExecutionEngine/Orc/Core.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h
index 8c1d457d06ab36c..3449b5c37f14d18 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h
@@ -19,6 +19,7 @@
 #define LLVM_EXECUTIONENGINE_ORC_EPCGENERICMEMORYACCESS_H
 
 #include "llvm/ExecutionEngine/Orc/Core.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h
index 2ea3c1b66cddcb1..0ba4c9bddc54e11 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
 #include "llvm/ExecutionEngine/RuntimeDyld.h"
+#include "llvm/Support/Compiler.h"
 
 #define DEBUG_TYPE "orc"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h
index 2834331b21f2087..26a97751724e8c4 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h
@@ -17,6 +17,7 @@
 #include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
 #include "llvm/ExecutionEngine/Orc/IndirectionUtils.h"
 #include "llvm/ExecutionEngine/Orc/LazyReexports.h"
+#include "llvm/Support/Compiler.h"
 
 #include <mutex>
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
index 2f13560061c4fc0..949b5a066cbe3ce 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
@@ -22,6 +22,7 @@
 #include "llvm/ExecutionEngine/Orc/Shared/OrcError.h"
 #include "llvm/ExecutionEngine/RuntimeDyld.h"
 #include "llvm/Object/Archive.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DynamicLibrary.h"
 #include <algorithm>
 #include <cstdint>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h b/llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h
index a16a3b9f92a1bc0..74fd51d0bce2778 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h
@@ -20,6 +20,7 @@
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
 #include "llvm/ExecutionEngine/Orc/SymbolStringPool.h"
 #include "llvm/ExecutionEngine/Orc/TaskDispatch.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DynamicLibrary.h"
 #include "llvm/Support/MSVCErrorWorkarounds.h"
 #include "llvm/TargetParser/Triple.h"
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
index f493d63a7c8a991..b39d26b21ec6e4e 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/ExecutionEngine/Orc/Layer.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <functional>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
index 4f1cde32ff1862b..bd3f598a1a3cc5f 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/ExecutionEngine/Orc/Layer.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
index 3b9ba55ef9c4c23..e632885bfe554fe 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
@@ -18,6 +18,7 @@
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/OrcABISupport.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Memory.h"
 #include "llvm/Support/Process.h"
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h b/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
index 0e72194aec9b1df..3b0b10c2f7b2ee6 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_ORC_JITTARGETMACHINEBUILDER_H
 
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
index d1affd9d2eb3cbc..5a02ca17bc130fb 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
@@ -20,6 +20,7 @@
 #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
 #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
 #include "llvm/ExecutionEngine/Orc/ThreadSafeModule.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ThreadPool.h"
 #include <variant>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Layer.h b/llvm/include/llvm/ExecutionEngine/Orc/Layer.h
index cfeedc2a0bdaab7..8e9c43492852141 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Layer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Layer.h
@@ -18,6 +18,7 @@
 #include "llvm/ExecutionEngine/Orc/ThreadSafeModule.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ExtensibleRTTI.h"
 #include "llvm/Support/MemoryBuffer.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h b/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
index 4916460a9b946cd..4abe704ebb14de0 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
@@ -20,6 +20,7 @@
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/IndirectionUtils.h"
 #include "llvm/ExecutionEngine/Orc/Speculation.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h b/llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h
index a598405ee4f6cea..93425d83b7c698a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 
 #include <vector>
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
index 15dae6f920d5793..c5645169aa9dd91 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
@@ -18,6 +18,7 @@
 #include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
 #include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 
 #include <future>
 #include <thread>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Mangling.h b/llvm/include/llvm/ExecutionEngine/Orc/Mangling.h
index 77429f4b11eefe4..d02875af38cb1d0 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Mangling.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Mangling.h
@@ -16,6 +16,7 @@
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/ThreadSafeModule.h"
 #include "llvm/IR/Module.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h
index b1897d557b1225d..1ffd23d58540d5d 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/IntervalMap.h"
 #include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"
 #include "llvm/ExecutionEngine/Orc/MemoryMapper.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h b/llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h
index 9f9ff06b2c2f687..5ed7d21bfae9ac4 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Process.h"
 
 #include <mutex>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h
index 1bf09069163e703..93a285bf76dfa5d 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h
@@ -15,6 +15,7 @@
 #define LLVM_EXECUTIONENGINE_ORC_OBJECTFILEINTERFACE_H
 
 #include "llvm/ExecutionEngine/Orc/Core.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
index c1f62408bb114ff..b2399f0e12dd4c9 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
@@ -21,6 +21,7 @@
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/Layer.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
index 9fc5fc0b902b6b1..36a6dbb6333d4bd 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/ExecutionEngine/Orc/Layer.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <memory>
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h b/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
index 5d25a3e8546484e..6ad4a0e2dd4b501 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
@@ -18,6 +18,7 @@
 #define LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
 
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MathExtras.h"
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
index 5d8c4e654c0d9d8..7d394321c8b2a2a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
@@ -22,6 +22,7 @@
 #include "llvm/ExecutionEngine/Orc/Layer.h"
 #include "llvm/ExecutionEngine/RuntimeDyld.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/AllocationActions.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/AllocationActions.h
index 6469b87c816f43d..7102c603d4d66f3 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/AllocationActions.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/AllocationActions.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Memory.h"
 
 #include <vector>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
index b7b98d55cc65b60..f439b449cb4d46b 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/identity.h"
 #include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h
index 5c58a7255ebd8b0..d860f6a293ab74f 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h
index c20366cfbb38883..7e75bc7bba6219c 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Memory.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h
index b7bc54b465a0043..b4ca812c51812c9 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_ORC_SHARED_OBJECTFORMATS_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h
index 8dffea70e3355ae..b80ead3ea034700 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_ORCERROR_H
 #define LLVM_EXECUTIONENGINE_ORC_SHARED_ORCERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/raw_ostream.h"
 #include <string>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h
index 8a55d5fb1795520..8d1e061471e2235 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h
@@ -36,6 +36,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/SwapByteOrder.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h
index ee3919c733409c5..bded4ea10ae3039 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
 #include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <atomic>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
index 09c73db44a947b3..98d7eacb6c81961 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
@@ -22,6 +22,7 @@
 #include "llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h"
 #include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h"
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Memory.h"
 
 #include <vector>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h
index bdb5ac143c34a92..39b2a54d06a536d 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
 #include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <type_traits>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h b/llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
index 25b79be48810c60..a1ddf4ccb0ae883 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
@@ -20,6 +20,7 @@
 #include "llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h"
 #include "llvm/ExecutionEngine/Orc/ExecutorProcessControl.h"
 #include "llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MSVCErrorWorkarounds.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h b/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
index 8c94f27ed683cc1..fad9dc5c0b9d377 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
@@ -16,6 +16,7 @@
 #include "llvm/Analysis/BranchProbabilityInfo.h"
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/Speculation.h"
+#include "llvm/Support/Compiler.h"
 
 #include <vector>
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h b/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
index 88c90f54acbd5ef..54ba127bb8b3695 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
@@ -17,6 +17,7 @@
 #include "llvm/ExecutionEngine/Orc/Core.h"
 #include "llvm/ExecutionEngine/Orc/DebugUtils.h"
 #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include <mutex>
 #include <type_traits>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
index 497e29da98bd59d..7395f47a7e3c884 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Compiler.h"
 #include <atomic>
 #include <mutex>
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h
index 32c127634b25ade..1dd604566661269 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace orc {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h
index 549a6c096510d85..e63d68b43d29868 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h"
 #include "llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h"
+#include "llvm/Support/Compiler.h"
 
 #include <atomic>
 #include <mutex>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h
index 99175d796974753..e6cdee0e535d7e1 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H
 
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 extern "C" llvm::orc::shared::CWrapperFunctionResult
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
index 04790afa6e31633..2421c8e54f4ad75 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
@@ -17,6 +17,7 @@
 #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H
 
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h
index fd4504cfb7fb064..1e2107c9bd69f2a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h
@@ -22,6 +22,7 @@
 #include "llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h"
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
 #include "llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DynamicLibrary.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h
index 97b333c68b63d37..2d99a8ac76c36b1 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h
@@ -20,6 +20,7 @@
 #include "llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h"
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
 #include "llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <mutex>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
index 07f01ecb68a48e6..d19c26f206789b6 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
@@ -21,6 +21,7 @@
 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
 #include "llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h"
 #include "llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DynamicLibrary.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
index 68acfa750fa0efc..f8449aae2864625 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
index 8c287f9fec0e898..bd5d98d9f4f2e8b 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
@@ -14,6 +14,7 @@
 #define LLVM_EXECUTIONENGINE_ORC_TASKDISPATCH_H
 
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ExtensibleRTTI.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h b/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
index c7c87ecdfa09a98..d71fb82d85d2b96 100644
--- a/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
@@ -17,6 +17,7 @@
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/ExecutionEngine/RuntimeDyld.h"
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <cstdint>
 #include <string>
diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
index 468296ac1523344..1248205f8f54a7d 100644
--- a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
+++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
@@ -19,6 +19,7 @@
 #include "llvm/DebugInfo/DIContext.h"
 #include "llvm/ExecutionEngine/JITSymbol.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
index 63cf5290b0c35e7..f4cc4fb6deca85a 100644
--- a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
+++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ExecutionEngine/JITSymbol.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h b/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h
index fa1b2355528dd0b..e1e0f8f4cb1f08b 100644
--- a/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Memory.h"
 #include <cstdint>
 #include <string>
diff --git a/llvm/include/llvm/FileCheck/FileCheck.h b/llvm/include/llvm/FileCheck/FileCheck.h
index d6d8dc531e1001c..018f20dec22e6bf 100644
--- a/llvm/include/llvm/FileCheck/FileCheck.h
+++ b/llvm/include/llvm/FileCheck/FileCheck.h
@@ -14,6 +14,7 @@
 #define LLVM_FILECHECK_FILECHECK_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/SMLoc.h"
 #include <bitset>
diff --git a/llvm/include/llvm/Frontend/HLSL/HLSLResource.h b/llvm/include/llvm/Frontend/HLSL/HLSLResource.h
index ba08ee519351f73..121a969de429a87 100644
--- a/llvm/include/llvm/Frontend/HLSL/HLSLResource.h
+++ b/llvm/include/llvm/Frontend/HLSL/HLSLResource.h
@@ -14,6 +14,7 @@
 #define LLVM_FRONTEND_HLSL_HLSLRESOURCE_H
 
 #include "llvm/IR/Metadata.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class GlobalVariable;
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPContext.h b/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
index b13b74ceab86516..47f621a84ed4381 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/Frontend/OpenMP/OMPConstants.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Triple;
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
index 3cf9ac84bf0bfea..37fc8be39f08a63 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
@@ -19,6 +19,7 @@
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <forward_list>
 #include <map>
 #include <optional>
diff --git a/llvm/include/llvm/FuzzMutate/FuzzerCLI.h b/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
index d6518107b24b6e3..8a0eaba9eb3b459 100644
--- a/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
+++ b/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_FUZZMUTATE_FUZZERCLI_H
 #define LLVM_FUZZMUTATE_FUZZERCLI_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <stddef.h>
 
diff --git a/llvm/include/llvm/FuzzMutate/IRMutator.h b/llvm/include/llvm/FuzzMutate/IRMutator.h
index dd4534bd9d1a8d6..1c954601c3b64d2 100644
--- a/llvm/include/llvm/FuzzMutate/IRMutator.h
+++ b/llvm/include/llvm/FuzzMutate/IRMutator.h
@@ -19,6 +19,7 @@
 #define LLVM_FUZZMUTATE_IRMUTATOR_H
 
 #include "llvm/FuzzMutate/OpDescriptor.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/FuzzMutate/OpDescriptor.h b/llvm/include/llvm/FuzzMutate/OpDescriptor.h
index f3b185dfedd8d98..1f9dce121df8a3b 100644
--- a/llvm/include/llvm/FuzzMutate/OpDescriptor.h
+++ b/llvm/include/llvm/FuzzMutate/OpDescriptor.h
@@ -21,6 +21,7 @@
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Type.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/FuzzMutate/Operations.h b/llvm/include/llvm/FuzzMutate/Operations.h
index 84155730a93cd85..c92a84bd867d072 100644
--- a/llvm/include/llvm/FuzzMutate/Operations.h
+++ b/llvm/include/llvm/FuzzMutate/Operations.h
@@ -17,6 +17,7 @@
 #include "llvm/FuzzMutate/OpDescriptor.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Instruction.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/FuzzMutate/Random.h b/llvm/include/llvm/FuzzMutate/Random.h
index 6eba9ca9e8d3c8f..3b14a1afe0b26bf 100644
--- a/llvm/include/llvm/FuzzMutate/Random.h
+++ b/llvm/include/llvm/FuzzMutate/Random.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_FUZZMUTATE_RANDOM_H
 #define LLVM_FUZZMUTATE_RANDOM_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <random>
 namespace llvm {
diff --git a/llvm/include/llvm/FuzzMutate/RandomIRBuilder.h b/llvm/include/llvm/FuzzMutate/RandomIRBuilder.h
index 8560f2ca2066e49..a3c5d9a9396d248 100644
--- a/llvm/include/llvm/FuzzMutate/RandomIRBuilder.h
+++ b/llvm/include/llvm/FuzzMutate/RandomIRBuilder.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <random>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/AbstractCallSite.h b/llvm/include/llvm/IR/AbstractCallSite.h
index 50afe016f0d633e..74334af55a437ae 100644
--- a/llvm/include/llvm/IR/AbstractCallSite.h
+++ b/llvm/include/llvm/IR/AbstractCallSite.h
@@ -18,6 +18,7 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/Argument.h b/llvm/include/llvm/IR/Argument.h
index f0c0ce75d2b7e18..9f46a7f05f5b62c 100644
--- a/llvm/include/llvm/IR/Argument.h
+++ b/llvm/include/llvm/IR/Argument.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/IR/Attributes.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/AssemblyAnnotationWriter.h b/llvm/include/llvm/IR/AssemblyAnnotationWriter.h
index 3fd3c57a6796395..b7ca692cec58856 100644
--- a/llvm/include/llvm/IR/AssemblyAnnotationWriter.h
+++ b/llvm/include/llvm/IR/AssemblyAnnotationWriter.h
@@ -16,6 +16,8 @@
 #ifndef LLVM_IR_ASSEMBLYANNOTATIONWRITER_H
 #define LLVM_IR_ASSEMBLYANNOTATIONWRITER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class Function;
diff --git a/llvm/include/llvm/IR/Assumptions.h b/llvm/include/llvm/IR/Assumptions.h
index 2d2ecfbde6e6b37..2b29fae7d1cbe8d 100644
--- a/llvm/include/llvm/IR/Assumptions.h
+++ b/llvm/include/llvm/IR/Assumptions.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/AttributeMask.h b/llvm/include/llvm/IR/AttributeMask.h
index 857761149ff46b5..b534e15460ae027 100644
--- a/llvm/include/llvm/IR/AttributeMask.h
+++ b/llvm/include/llvm/IR/AttributeMask.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/IR/Attributes.h"
+#include "llvm/Support/Compiler.h"
 #include <bitset>
 #include <cassert>
 #include <set>
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index db33b5400471685..0ebee35d6978ed0 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -22,6 +22,7 @@
 #include "llvm/Config/llvm-config.h"
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ModRef.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"
 #include <cassert>
diff --git a/llvm/include/llvm/IR/AutoUpgrade.h b/llvm/include/llvm/IR/AutoUpgrade.h
index 12952f25cbda973..36ff6f025ab3cea 100644
--- a/llvm/include/llvm/IR/AutoUpgrade.h
+++ b/llvm/include/llvm/IR/AutoUpgrade.h
@@ -14,6 +14,7 @@
 #define LLVM_IR_AUTOUPGRADE_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index 19bf9549a8caec0..d577afb69c44a0e 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/SymbolTableListTraits.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/IR/BuiltinGCs.h b/llvm/include/llvm/IR/BuiltinGCs.h
index 16aff01dbcf3d76..208b6c76c476caa 100644
--- a/llvm/include/llvm/IR/BuiltinGCs.h
+++ b/llvm/include/llvm/IR/BuiltinGCs.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_IR_BUILTINGCS_H
 #define LLVM_IR_BUILTINGCS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 /// FIXME: Collector instances are not useful on their own. These no longer
diff --git a/llvm/include/llvm/IR/CFG.h b/llvm/include/llvm/IR/CFG.h
index 12ca1b1b9aa9794..6c294bbb682febb 100644
--- a/llvm/include/llvm/IR/CFG.h
+++ b/llvm/include/llvm/IR/CFG.h
@@ -25,6 +25,7 @@
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/IR/Comdat.h b/llvm/include/llvm/IR/Comdat.h
index 1701802e697729a..e461153cd770ad9 100644
--- a/llvm/include/llvm/IR/Comdat.h
+++ b/llvm/include/llvm/IR/Comdat.h
@@ -18,6 +18,7 @@
 #include "llvm-c/Types.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/Constant.h b/llvm/include/llvm/IR/Constant.h
index 778764062227cb9..2f9d44e93990829 100644
--- a/llvm/include/llvm/IR/Constant.h
+++ b/llvm/include/llvm/IR/Constant.h
@@ -16,6 +16,7 @@
 #include "llvm/IR/User.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/ConstantFold.h b/llvm/include/llvm/IR/ConstantFold.h
index 77f5f0eb174a2bb..ccd3cb7701df887 100644
--- a/llvm/include/llvm/IR/ConstantFold.h
+++ b/llvm/include/llvm/IR/ConstantFold.h
@@ -22,6 +22,7 @@
 #define LLVM_IR_CONSTANTFOLD_H
 
 #include "llvm/IR/InstrTypes.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/ConstantFolder.h b/llvm/include/llvm/IR/ConstantFolder.h
index 56da3d205fe4b7c..3583ec1d3ae3b93 100644
--- a/llvm/include/llvm/IR/ConstantFolder.h
+++ b/llvm/include/llvm/IR/ConstantFolder.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/IRBuilderFolder.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/Operator.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h
index ecd6dd7b0a4f822..3a594efb5df5128 100644
--- a/llvm/include/llvm/IR/DIBuilder.h
+++ b/llvm/include/llvm/IR/DIBuilder.h
@@ -24,6 +24,7 @@
 #include "llvm/IR/DebugInfoMetadata.h"
 #include "llvm/IR/TrackingMDRef.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cstdint>
 #include <optional>
diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h
index 26a7cfbbb350234..0ee67a803863617 100644
--- a/llvm/include/llvm/IR/DebugInfo.h
+++ b/llvm/include/llvm/IR/DebugInfo.h
@@ -25,6 +25,7 @@
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index 656122405209712..5f071d254a10053 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -24,6 +24,7 @@
 #include "llvm/IR/Metadata.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Discriminator.h"
 #include <cassert>
 #include <climits>
diff --git a/llvm/include/llvm/IR/DebugLoc.h b/llvm/include/llvm/IR/DebugLoc.h
index c22d3e9b10d27fd..63b9d789e14a22f 100644
--- a/llvm/include/llvm/IR/DebugLoc.h
+++ b/llvm/include/llvm/IR/DebugLoc.h
@@ -15,6 +15,7 @@
 #define LLVM_IR_DEBUGLOC_H
 
 #include "llvm/IR/TrackingMDRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/DerivedUser.h b/llvm/include/llvm/IR/DerivedUser.h
index a25d316c2d60bc5..248535f81350974 100644
--- a/llvm/include/llvm/IR/DerivedUser.h
+++ b/llvm/include/llvm/IR/DerivedUser.h
@@ -10,6 +10,7 @@
 #define LLVM_IR_DERIVEDUSER_H
 
 #include "llvm/IR/User.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/DiagnosticHandler.h b/llvm/include/llvm/IR/DiagnosticHandler.h
index 55e5e5975808d97..da324750f134ef6 100644
--- a/llvm/include/llvm/IR/DiagnosticHandler.h
+++ b/llvm/include/llvm/IR/DiagnosticHandler.h
@@ -13,6 +13,7 @@
 #define LLVM_IR_DIAGNOSTICHANDLER_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class DiagnosticInfo;
diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h
index 628445fe9fb2cca..7aecf56f905379f 100644
--- a/llvm/include/llvm/IR/DiagnosticInfo.h
+++ b/llvm/include/llvm/IR/DiagnosticInfo.h
@@ -21,6 +21,7 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/TypeSize.h"
diff --git a/llvm/include/llvm/IR/DiagnosticPrinter.h b/llvm/include/llvm/IR/DiagnosticPrinter.h
index 2df6fc3dfe73903..84149bd3fc1cf4a 100644
--- a/llvm/include/llvm/IR/DiagnosticPrinter.h
+++ b/llvm/include/llvm/IR/DiagnosticPrinter.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_IR_DIAGNOSTICPRINTER_H
 #define LLVM_IR_DIAGNOSTICPRINTER_H
 
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h
index 6ceadbf30b895f4..a4f37501c7248b8 100644
--- a/llvm/include/llvm/IR/Dominators.h
+++ b/llvm/include/llvm/IR/Dominators.h
@@ -30,6 +30,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/Use.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/CFGDiff.h"
 #include "llvm/Support/CFGUpdate.h"
 #include "llvm/Support/GenericDomTree.h"
diff --git a/llvm/include/llvm/IR/EHPersonalities.h b/llvm/include/llvm/IR/EHPersonalities.h
index bd768440bfb9a62..1f426bb4c82a6cb 100644
--- a/llvm/include/llvm/IR/EHPersonalities.h
+++ b/llvm/include/llvm/IR/EHPersonalities.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/TinyPtrVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class BasicBlock;
diff --git a/llvm/include/llvm/IR/FMF.h b/llvm/include/llvm/IR/FMF.h
index 99e9a247777936b..753d1a6f224d05e 100644
--- a/llvm/include/llvm/IR/FMF.h
+++ b/llvm/include/llvm/IR/FMF.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_IR_FMF_H
 #define LLVM_IR_FMF_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class raw_ostream;
 
diff --git a/llvm/include/llvm/IR/FPEnv.h b/llvm/include/llvm/IR/FPEnv.h
index a0197377759daf3..fdf7667dd99ec9d 100644
--- a/llvm/include/llvm/IR/FPEnv.h
+++ b/llvm/include/llvm/IR/FPEnv.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/FloatingPointMode.h"
 #include "llvm/IR/FMF.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h
index 93cf0d27e9a73e5..135d6828cdb02d6 100644
--- a/llvm/include/llvm/IR/Function.h
+++ b/llvm/include/llvm/IR/Function.h
@@ -32,6 +32,7 @@
 #include "llvm/IR/OperandTraits.h"
 #include "llvm/IR/SymbolTableListTraits.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/IR/GCStrategy.h b/llvm/include/llvm/IR/GCStrategy.h
index 3186465f0018124..dee159e76f01894 100644
--- a/llvm/include/llvm/IR/GCStrategy.h
+++ b/llvm/include/llvm/IR/GCStrategy.h
@@ -47,6 +47,7 @@
 #ifndef LLVM_IR_GCSTRATEGY_H
 #define LLVM_IR_GCSTRATEGY_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Registry.h"
 #include <optional>
 #include <string>
diff --git a/llvm/include/llvm/IR/GVMaterializer.h b/llvm/include/llvm/IR/GVMaterializer.h
index d62da41ebc29662..6ed6b8dcf9ee398 100644
--- a/llvm/include/llvm/IR/GVMaterializer.h
+++ b/llvm/include/llvm/IR/GVMaterializer.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_IR_GVMATERIALIZER_H
 #define LLVM_IR_GVMATERIALIZER_H
 
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/GetElementPtrTypeIterator.h b/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
index 8c6ede96c873bb8..5f95ecbbe82c5f2 100644
--- a/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
+++ b/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
@@ -20,6 +20,7 @@
 #include "llvm/IR/Operator.h"
 #include "llvm/IR/User.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/IR/GlobalAlias.h b/llvm/include/llvm/IR/GlobalAlias.h
index de405da5ca23173..33365a26640ceeb 100644
--- a/llvm/include/llvm/IR/GlobalAlias.h
+++ b/llvm/include/llvm/IR/GlobalAlias.h
@@ -18,6 +18,7 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/OperandTraits.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/GlobalIFunc.h b/llvm/include/llvm/IR/GlobalIFunc.h
index c148ee7907789bc..23465293f74204f 100644
--- a/llvm/include/llvm/IR/GlobalIFunc.h
+++ b/llvm/include/llvm/IR/GlobalIFunc.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/GlobalObject.h"
 #include "llvm/IR/OperandTraits.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/GlobalObject.h b/llvm/include/llvm/IR/GlobalObject.h
index 889bd3a28e12b37..d40fc0c7dfb810f 100644
--- a/llvm/include/llvm/IR/GlobalObject.h
+++ b/llvm/include/llvm/IR/GlobalObject.h
@@ -18,6 +18,7 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/GlobalValue.h b/llvm/include/llvm/IR/GlobalValue.h
index d1891c157099d40..883592e730b1353 100644
--- a/llvm/include/llvm/IR/GlobalValue.h
+++ b/llvm/include/llvm/IR/GlobalValue.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MD5.h"
 #include <cassert>
diff --git a/llvm/include/llvm/IR/GlobalVariable.h b/llvm/include/llvm/IR/GlobalVariable.h
index 03c680e4f95585b..f8233a240b10ddc 100644
--- a/llvm/include/llvm/IR/GlobalVariable.h
+++ b/llvm/include/llvm/IR/GlobalVariable.h
@@ -25,6 +25,7 @@
 #include "llvm/IR/GlobalObject.h"
 #include "llvm/IR/OperandTraits.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index 28380a3f606f2cb..4d570f6cf05d874 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -42,6 +42,7 @@
 #include "llvm/Support/AtomicOrdering.h"
 #include "llvm/Support/CBindingWrapping.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <functional>
diff --git a/llvm/include/llvm/IR/IRBuilderFolder.h b/llvm/include/llvm/IR/IRBuilderFolder.h
index b2b27235a1e671a..beb4be8aa7cfb42 100644
--- a/llvm/include/llvm/IR/IRBuilderFolder.h
+++ b/llvm/include/llvm/IR/IRBuilderFolder.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Instruction.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/IRPrintingPasses.h b/llvm/include/llvm/IR/IRPrintingPasses.h
index 8928ecfce313e0d..f6bea67988c536a 100644
--- a/llvm/include/llvm/IR/IRPrintingPasses.h
+++ b/llvm/include/llvm/IR/IRPrintingPasses.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_IR_IRPRINTINGPASSES_H
 #define LLVM_IR_IRPRINTINGPASSES_H
 
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/InlineAsm.h b/llvm/include/llvm/IR/InlineAsm.h
index 6f21ca4dca777b5..5251815b9b12dc7 100644
--- a/llvm/include/llvm/IR/InlineAsm.h
+++ b/llvm/include/llvm/IR/InlineAsm.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <string>
 #include <vector>
diff --git a/llvm/include/llvm/IR/InstIterator.h b/llvm/include/llvm/IR/InstIterator.h
index 054fe4e9cbe9920..6da72254304d0ce 100644
--- a/llvm/include/llvm/IR/InstIterator.h
+++ b/llvm/include/llvm/IR/InstIterator.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/SymbolTableListTraits.h"
+#include "llvm/Support/Compiler.h"
 #include <iterator>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/InstVisitor.h b/llvm/include/llvm/IR/InstVisitor.h
index 311e0ac47ddfadd..48dac110be2beda 100644
--- a/llvm/include/llvm/IR/InstVisitor.h
+++ b/llvm/include/llvm/IR/InstVisitor.h
@@ -15,6 +15,7 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Module.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index a48852edb46e622..cdf7253dfa00057 100644
--- a/llvm/include/llvm/IR/InstrTypes.h
+++ b/llvm/include/llvm/IR/InstrTypes.h
@@ -29,6 +29,7 @@
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/OperandTraits.h"
 #include "llvm/IR/User.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h
index 5fd8b27447b77df..0b9c8eb9b64743d 100644
--- a/llvm/include/llvm/IR/Instruction.h
+++ b/llvm/include/llvm/IR/Instruction.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/User.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/AtomicOrdering.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <utility>
 
diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h
index d7b1568ea2c01cf..ba2426e570dc25e 100644
--- a/llvm/include/llvm/IR/Instructions.h
+++ b/llvm/include/llvm/IR/Instructions.h
@@ -32,6 +32,7 @@
 #include "llvm/IR/Use.h"
 #include "llvm/IR/User.h"
 #include "llvm/Support/AtomicOrdering.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/IR/IntrinsicInst.h b/llvm/include/llvm/IR/IntrinsicInst.h
index 62bd833198f022b..ada326d91a581ea 100644
--- a/llvm/include/llvm/IR/IntrinsicInst.h
+++ b/llvm/include/llvm/IR/IntrinsicInst.h
@@ -33,6 +33,7 @@
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <optional>
diff --git a/llvm/include/llvm/IR/Intrinsics.h b/llvm/include/llvm/IR/Intrinsics.h
index 6ac02567c43b5bc..fbadd753df5d51f 100644
--- a/llvm/include/llvm/IR/Intrinsics.h
+++ b/llvm/include/llvm/IR/Intrinsics.h
@@ -16,6 +16,7 @@
 #define LLVM_IR_INTRINSICS_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/TypeSize.h"
 #include <optional>
 #include <string>
diff --git a/llvm/include/llvm/IR/LLVMContext.h b/llvm/include/llvm/IR/LLVMContext.h
index c13a783e86c7a0d..2f243bb0fcc4822 100644
--- a/llvm/include/llvm/IR/LLVMContext.h
+++ b/llvm/include/llvm/IR/LLVMContext.h
@@ -17,6 +17,7 @@
 #include "llvm-c/Types.h"
 #include "llvm/IR/DiagnosticHandler.h"
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 #include <optional>
diff --git a/llvm/include/llvm/IR/LLVMRemarkStreamer.h b/llvm/include/llvm/IR/LLVMRemarkStreamer.h
index 7e78c4f806b4028..6710a61e6c3255b 100644
--- a/llvm/include/llvm/IR/LLVMRemarkStreamer.h
+++ b/llvm/include/llvm/IR/LLVMRemarkStreamer.h
@@ -15,6 +15,7 @@
 #define LLVM_IR_LLVMREMARKSTREAMER_H
 
 #include "llvm/Remarks/Remark.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <memory>
 #include <optional>
diff --git a/llvm/include/llvm/IR/LegacyPassManager.h b/llvm/include/llvm/IR/LegacyPassManager.h
index b3a4820ba0e492b..5163bb1f67f9039 100644
--- a/llvm/include/llvm/IR/LegacyPassManager.h
+++ b/llvm/include/llvm/IR/LegacyPassManager.h
@@ -17,6 +17,7 @@
 #define LLVM_IR_LEGACYPASSMANAGER_H
 
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/LegacyPassManagers.h b/llvm/include/llvm/IR/LegacyPassManagers.h
index 41c11d26aa456c6..0ab95fa03d77e0f 100644
--- a/llvm/include/llvm/IR/LegacyPassManagers.h
+++ b/llvm/include/llvm/IR/LegacyPassManagers.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 //===----------------------------------------------------------------------===//
diff --git a/llvm/include/llvm/IR/LegacyPassNameParser.h b/llvm/include/llvm/IR/LegacyPassNameParser.h
index c33b9fc404729f6..fca6d16405da519 100644
--- a/llvm/include/llvm/IR/LegacyPassNameParser.h
+++ b/llvm/include/llvm/IR/LegacyPassNameParser.h
@@ -28,6 +28,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cstring>
diff --git a/llvm/include/llvm/IR/MDBuilder.h b/llvm/include/llvm/IR/MDBuilder.h
index 39165453de16b09..213be47c49f98f6 100644
--- a/llvm/include/llvm/IR/MDBuilder.h
+++ b/llvm/include/llvm/IR/MDBuilder.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/GlobalValue.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <utility>
 
diff --git a/llvm/include/llvm/IR/Mangler.h b/llvm/include/llvm/IR/Mangler.h
index 747a4085235c9b8..f3380a279f28ead 100644
--- a/llvm/include/llvm/IR/Mangler.h
+++ b/llvm/include/llvm/IR/Mangler.h
@@ -14,6 +14,7 @@
 #define LLVM_IR_MANGLER_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/MatrixBuilder.h b/llvm/include/llvm/IR/MatrixBuilder.h
index dbf2cfb7c5e9666..694a1b7a8e9194e 100644
--- a/llvm/include/llvm/IR/MatrixBuilder.h
+++ b/llvm/include/llvm/IR/MatrixBuilder.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/Type.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/Metadata.h b/llvm/include/llvm/IR/Metadata.h
index 9659dbe4f281e42..9890a6518187883 100644
--- a/llvm/include/llvm/IR/Metadata.h
+++ b/llvm/include/llvm/IR/Metadata.h
@@ -28,6 +28,7 @@
 #include "llvm/IR/Value.h"
 #include "llvm/Support/CBindingWrapping.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/IR/Module.h b/llvm/include/llvm/IR/Module.h
index 670a40b28eabbea..9fa0fb34a8fcd6d 100644
--- a/llvm/include/llvm/IR/Module.h
+++ b/llvm/include/llvm/IR/Module.h
@@ -31,6 +31,7 @@
 #include "llvm/IR/SymbolTableListTraits.h"
 #include "llvm/Support/CBindingWrapping.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <cstdint>
 #include <iterator>
diff --git a/llvm/include/llvm/IR/ModuleSlotTracker.h b/llvm/include/llvm/IR/ModuleSlotTracker.h
index 37cfc0f07280cf9..9a56d485297b509 100644
--- a/llvm/include/llvm/IR/ModuleSlotTracker.h
+++ b/llvm/include/llvm/IR/ModuleSlotTracker.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_IR_MODULESLOTTRACKER_H
 #define LLVM_IR_MODULESLOTTRACKER_H
 
+#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <memory>
 #include <utility>
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index 91a0133500eb7be..3b8d4ee80fa6f2f 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -27,6 +27,7 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/ScaledNumber.h"
 #include "llvm/Support/StringSaver.h"
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h b/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
index 33e57e5f2102fde..0e23edbbc4608ad 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
@@ -10,6 +10,7 @@
 #define LLVM_IR_MODULESUMMARYINDEXYAML_H
 
 #include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/NoFolder.h b/llvm/include/llvm/IR/NoFolder.h
index 56ccfc694c5f1f8..9aecedce8f34758 100644
--- a/llvm/include/llvm/IR/NoFolder.h
+++ b/llvm/include/llvm/IR/NoFolder.h
@@ -28,6 +28,7 @@
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/Instructions.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/OperandTraits.h b/llvm/include/llvm/IR/OperandTraits.h
index 979ad35019f8c79..5998a545715e246 100644
--- a/llvm/include/llvm/IR/OperandTraits.h
+++ b/llvm/include/llvm/IR/OperandTraits.h
@@ -15,6 +15,7 @@
 #define LLVM_IR_OPERANDTRAITS_H
 
 #include "llvm/IR/User.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/Operator.h b/llvm/include/llvm/IR/Operator.h
index a9da6292e8c779d..a14c5110d2bdc1c 100644
--- a/llvm/include/llvm/IR/Operator.h
+++ b/llvm/include/llvm/IR/Operator.h
@@ -21,6 +21,7 @@
 #include "llvm/IR/Type.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <optional>
 
diff --git a/llvm/include/llvm/IR/OptBisect.h b/llvm/include/llvm/IR/OptBisect.h
index 2987e5ad90c4d3c..cbd66844aac09c4 100644
--- a/llvm/include/llvm/IR/OptBisect.h
+++ b/llvm/include/llvm/IR/OptBisect.h
@@ -15,6 +15,7 @@
 #define LLVM_IR_OPTBISECT_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <limits>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/PassInstrumentation.h b/llvm/include/llvm/IR/PassInstrumentation.h
index 519a5e46b4373b7..3337dcb9cff07f4 100644
--- a/llvm/include/llvm/IR/PassInstrumentation.h
+++ b/llvm/include/llvm/IR/PassInstrumentation.h
@@ -53,6 +53,7 @@
 #include "llvm/ADT/FunctionExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Compiler.h"
 #include <type_traits>
 #include <vector>
 
diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h
index 5fe28f8556e5bba..11af6b9ff3069b5 100644
--- a/llvm/include/llvm/IR/PassManager.h
+++ b/llvm/include/llvm/IR/PassManager.h
@@ -46,6 +46,7 @@
 #include "llvm/IR/Module.h"
 #include "llvm/IR/PassInstrumentation.h"
 #include "llvm/IR/PassManagerInternal.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/TimeProfiler.h"
 #include "llvm/Support/TypeName.h"
 #include <cassert>
diff --git a/llvm/include/llvm/IR/PassManagerInternal.h b/llvm/include/llvm/IR/PassManagerInternal.h
index 8e19f0aa16a9bb7..204dd03d3a18a4f 100644
--- a/llvm/include/llvm/IR/PassManagerInternal.h
+++ b/llvm/include/llvm/IR/PassManagerInternal.h
@@ -19,6 +19,7 @@
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <memory>
 #include <utility>
diff --git a/llvm/include/llvm/IR/PassTimingInfo.h b/llvm/include/llvm/IR/PassTimingInfo.h
index d464b998fa706af..0b0bd247410375d 100644
--- a/llvm/include/llvm/IR/PassTimingInfo.h
+++ b/llvm/include/llvm/IR/PassTimingInfo.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Timer.h"
 #include <memory>
 #include <utility>
diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
index 621eba6bd0b679b..e6d23dfaaeaf1ba 100644
--- a/llvm/include/llvm/IR/PatternMatch.h
+++ b/llvm/include/llvm/IR/PatternMatch.h
@@ -41,6 +41,7 @@
 #include "llvm/IR/Operator.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/PredIteratorCache.h b/llvm/include/llvm/IR/PredIteratorCache.h
index fc8cf20e9f759e9..a7751ce6279bd95 100644
--- a/llvm/include/llvm/IR/PredIteratorCache.h
+++ b/llvm/include/llvm/IR/PredIteratorCache.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/CFG.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/PrintPasses.h b/llvm/include/llvm/IR/PrintPasses.h
index 95b97e76c867cb2..96b44ba5644cf42 100644
--- a/llvm/include/llvm/IR/PrintPasses.h
+++ b/llvm/include/llvm/IR/PrintPasses.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/ProfDataUtils.h b/llvm/include/llvm/IR/ProfDataUtils.h
index 8019d0a3969b10e..649b861663ccf8c 100644
--- a/llvm/include/llvm/IR/ProfDataUtils.h
+++ b/llvm/include/llvm/IR/ProfDataUtils.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/IR/Metadata.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/ProfileSummary.h b/llvm/include/llvm/IR/ProfileSummary.h
index 4bb6bb8d4a405d4..6561ac7e48eceb7 100644
--- a/llvm/include/llvm/IR/ProfileSummary.h
+++ b/llvm/include/llvm/IR/ProfileSummary.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_IR_PROFILESUMMARY_H
 #define LLVM_IR_PROFILESUMMARY_H
 
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/IR/PseudoProbe.h b/llvm/include/llvm/IR/PseudoProbe.h
index cdbd498a8be61ac..fe25a552b1d48cf 100644
--- a/llvm/include/llvm/IR/PseudoProbe.h
+++ b/llvm/include/llvm/IR/PseudoProbe.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_IR_PSEUDOPROBE_H
 #define LLVM_IR_PSEUDOPROBE_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <limits>
diff --git a/llvm/include/llvm/IR/ReplaceConstant.h b/llvm/include/llvm/IR/ReplaceConstant.h
index 72823c9ab164dda..77a9a014829a1d4 100644
--- a/llvm/include/llvm/IR/ReplaceConstant.h
+++ b/llvm/include/llvm/IR/ReplaceConstant.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_IR_REPLACECONSTANT_H
 #define LLVM_IR_REPLACECONSTANT_H
 
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <vector>
 
diff --git a/llvm/include/llvm/IR/SSAContext.h b/llvm/include/llvm/IR/SSAContext.h
index 5180c92d65565f8..f13f23c999db67e 100644
--- a/llvm/include/llvm/IR/SSAContext.h
+++ b/llvm/include/llvm/IR/SSAContext.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/GenericSSAContext.h"
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/ModuleSlotTracker.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Printable.h"
 
 #include <memory>
diff --git a/llvm/include/llvm/IR/SafepointIRVerifier.h b/llvm/include/llvm/IR/SafepointIRVerifier.h
index 246d236adb389a0..f56e2f4837428f4 100644
--- a/llvm/include/llvm/IR/SafepointIRVerifier.h
+++ b/llvm/include/llvm/IR/SafepointIRVerifier.h
@@ -19,6 +19,7 @@
 #define LLVM_IR_SAFEPOINTIRVERIFIER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/Statepoint.h b/llvm/include/llvm/IR/Statepoint.h
index 21c4a3eaa5ac2d3..c976c315a1a33c7 100644
--- a/llvm/include/llvm/IR/Statepoint.h
+++ b/llvm/include/llvm/IR/Statepoint.h
@@ -25,6 +25,7 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/IR/StructuralHash.h b/llvm/include/llvm/IR/StructuralHash.h
index 1bdeb85afa3c50f..f7421b19caefe9f 100644
--- a/llvm/include/llvm/IR/StructuralHash.h
+++ b/llvm/include/llvm/IR/StructuralHash.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_IR_STRUCTURALHASH_H
 #define LLVM_IR_STRUCTURALHASH_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/SymbolTableListTraits.h b/llvm/include/llvm/IR/SymbolTableListTraits.h
index 8af712374bfafd0..d9dd06a248fa70a 100644
--- a/llvm/include/llvm/IR/SymbolTableListTraits.h
+++ b/llvm/include/llvm/IR/SymbolTableListTraits.h
@@ -26,6 +26,7 @@
 
 #include "llvm/ADT/ilist.h"
 #include "llvm/ADT/simple_ilist.h"
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/TrackingMDRef.h b/llvm/include/llvm/IR/TrackingMDRef.h
index d7377398b91b3cd..219630ba54f4304 100644
--- a/llvm/include/llvm/IR/TrackingMDRef.h
+++ b/llvm/include/llvm/IR/TrackingMDRef.h
@@ -14,6 +14,7 @@
 #define LLVM_IR_TRACKINGMDREF_H
 
 #include "llvm/IR/Metadata.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cassert>
 
diff --git a/llvm/include/llvm/IR/TypeFinder.h b/llvm/include/llvm/IR/TypeFinder.h
index dd2b70c65c2d2bb..770193a176a3b97 100644
--- a/llvm/include/llvm/IR/TypeFinder.h
+++ b/llvm/include/llvm/IR/TypeFinder.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/IR/Attributes.h"
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <vector>
 
diff --git a/llvm/include/llvm/IR/TypedPointerType.h b/llvm/include/llvm/IR/TypedPointerType.h
index 1bea715a64b6920..ccc303207970671 100644
--- a/llvm/include/llvm/IR/TypedPointerType.h
+++ b/llvm/include/llvm/IR/TypedPointerType.h
@@ -15,6 +15,7 @@
 #define LLVM_IR_TYPEDPOINTERTYPE_H
 
 #include "llvm/IR/Type.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/UseListOrder.h b/llvm/include/llvm/IR/UseListOrder.h
index a1f313e269b29ca..7d9b9bd7a8e3a5d 100644
--- a/llvm/include/llvm/IR/UseListOrder.h
+++ b/llvm/include/llvm/IR/UseListOrder.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_IR_USELISTORDER_H
 #define LLVM_IR_USELISTORDER_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <vector>
 
diff --git a/llvm/include/llvm/IR/Value.h b/llvm/include/llvm/IR/Value.h
index 16ae451114b52f1..4ee27d214d49bb4 100644
--- a/llvm/include/llvm/IR/Value.h
+++ b/llvm/include/llvm/IR/Value.h
@@ -21,6 +21,7 @@
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/CBindingWrapping.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <iterator>
 #include <memory>
diff --git a/llvm/include/llvm/IR/ValueHandle.h b/llvm/include/llvm/IR/ValueHandle.h
index 29560815ea559ea..e58c9d839c4e103 100644
--- a/llvm/include/llvm/IR/ValueHandle.h
+++ b/llvm/include/llvm/IR/ValueHandle.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/ValueMap.h b/llvm/include/llvm/IR/ValueMap.h
index d12d639aaa88866..44062ff655ae3e0 100644
--- a/llvm/include/llvm/IR/ValueMap.h
+++ b/llvm/include/llvm/IR/ValueMap.h
@@ -30,6 +30,7 @@
 #include "llvm/IR/TrackingMDRef.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Mutex.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/IR/ValueSymbolTable.h b/llvm/include/llvm/IR/ValueSymbolTable.h
index 43d00268f4b2218..19d4da2d2fc7cf2 100644
--- a/llvm/include/llvm/IR/ValueSymbolTable.h
+++ b/llvm/include/llvm/IR/ValueSymbolTable.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/Value.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IR/VectorBuilder.h b/llvm/include/llvm/IR/VectorBuilder.h
index 301edaed70fe88c..922f070ee4922b1 100644
--- a/llvm/include/llvm/IR/VectorBuilder.h
+++ b/llvm/include/llvm/IR/VectorBuilder.h
@@ -19,6 +19,7 @@
 #include <llvm/IR/InstrTypes.h>
 #include <llvm/IR/Instruction.h>
 #include <llvm/IR/Value.h>
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/IR/Verifier.h b/llvm/include/llvm/IR/Verifier.h
index b25f8eb77ee38b3..833e1a26c7036af 100644
--- a/llvm/include/llvm/IR/Verifier.h
+++ b/llvm/include/llvm/IR/Verifier.h
@@ -22,6 +22,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IRPrinter/IRPrintingPasses.h b/llvm/include/llvm/IRPrinter/IRPrintingPasses.h
index 4be1f3c967e2446..7db7a641887f063 100644
--- a/llvm/include/llvm/IRPrinter/IRPrintingPasses.h
+++ b/llvm/include/llvm/IRPrinter/IRPrintingPasses.h
@@ -19,6 +19,7 @@
 #define LLVM_IRPRINTER_IRPRINTINGPASSES_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/IRReader/IRReader.h b/llvm/include/llvm/IRReader/IRReader.h
index 644fea82bfbe056..eaec2c0a8486721 100644
--- a/llvm/include/llvm/IRReader/IRReader.h
+++ b/llvm/include/llvm/IRReader/IRReader.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Bitcode/BitcodeReader.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <optional>
 
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index c6fee47b464b952..a8352ab71f12bed 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_INITIALIZEPASSES_H
 #define LLVM_INITIALIZEPASSES_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class PassRegistry;
diff --git a/llvm/include/llvm/InterfaceStub/ELFObjHandler.h b/llvm/include/llvm/InterfaceStub/ELFObjHandler.h
index c15838c4ae0af1c..2ef0218a681b08b 100644
--- a/llvm/include/llvm/InterfaceStub/ELFObjHandler.h
+++ b/llvm/include/llvm/InterfaceStub/ELFObjHandler.h
@@ -14,6 +14,7 @@
 #define LLVM_INTERFACESTUB_ELFOBJHANDLER_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include <memory>
diff --git a/llvm/include/llvm/InterfaceStub/IFSHandler.h b/llvm/include/llvm/InterfaceStub/IFSHandler.h
index 09687bfb9e44f8b..faa3709dc556a53 100644
--- a/llvm/include/llvm/InterfaceStub/IFSHandler.h
+++ b/llvm/include/llvm/InterfaceStub/IFSHandler.h
@@ -16,6 +16,7 @@
 #define LLVM_INTERFACESTUB_IFSHANDLER_H
 
 #include "IFSStub.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/VersionTuple.h"
 #include <memory>
diff --git a/llvm/include/llvm/InterfaceStub/IFSStub.h b/llvm/include/llvm/InterfaceStub/IFSStub.h
index 09f96f72950cf68..03354f5d50c44f4 100644
--- a/llvm/include/llvm/InterfaceStub/IFSStub.h
+++ b/llvm/include/llvm/InterfaceStub/IFSStub.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_INTERFACESTUB_IFSSTUB_H
 #define LLVM_INTERFACESTUB_IFSSTUB_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/VersionTuple.h"
 #include <optional>
 #include <vector>
diff --git a/llvm/include/llvm/LTO/Config.h b/llvm/include/llvm/LTO/Config.h
index 5c23ba4f7ac498f..16d38ad8ad06da7 100644
--- a/llvm/include/llvm/LTO/Config.h
+++ b/llvm/include/llvm/LTO/Config.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/Passes/PassBuilder.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Target/TargetOptions.h"
 
 #include <functional>
diff --git a/llvm/include/llvm/LTO/LTO.h b/llvm/include/llvm/LTO/LTO.h
index 150b31e3e8e40c6..e8138978f076f1a 100644
--- a/llvm/include/llvm/LTO/LTO.h
+++ b/llvm/include/llvm/LTO/LTO.h
@@ -22,6 +22,7 @@
 #include "llvm/LTO/Config.h"
 #include "llvm/Object/IRSymtab.h"
 #include "llvm/Support/Caching.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/thread.h"
 #include "llvm/Transforms/IPO/FunctionAttrs.h"
diff --git a/llvm/include/llvm/LTO/LTOBackend.h b/llvm/include/llvm/LTO/LTOBackend.h
index de89f4bb10dff26..a010f6a24f4106e 100644
--- a/llvm/include/llvm/LTO/LTOBackend.h
+++ b/llvm/include/llvm/LTO/LTOBackend.h
@@ -20,6 +20,7 @@
 #include "llvm/IR/DiagnosticInfo.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/LTO/LTO.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Transforms/IPO/FunctionImport.h"
diff --git a/llvm/include/llvm/LTO/SummaryBasedOptimizations.h b/llvm/include/llvm/LTO/SummaryBasedOptimizations.h
index 508ab2587ac56a0..2923ee55dde0f03 100644
--- a/llvm/include/llvm/LTO/SummaryBasedOptimizations.h
+++ b/llvm/include/llvm/LTO/SummaryBasedOptimizations.h
@@ -8,6 +8,9 @@
 
 #ifndef LLVM_LTO_SUMMARYBASEDOPTIMIZATIONS_H
 #define LLVM_LTO_SUMMARYBASEDOPTIMIZATIONS_H
+
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class ModuleSummaryIndex;
 
diff --git a/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
index 2093eaa93c85401..d0af3c01748f216 100644
--- a/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
+++ b/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
@@ -45,6 +45,7 @@
 #include "llvm/LTO/Config.h"
 #include "llvm/LTO/LTO.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ToolOutputFile.h"
 #include "llvm/Target/TargetMachine.h"
diff --git a/llvm/include/llvm/LTO/legacy/LTOModule.h b/llvm/include/llvm/LTO/legacy/LTOModule.h
index 1b2de3b333855c8..f1c503128c51075 100644
--- a/llvm/include/llvm/LTO/legacy/LTOModule.h
+++ b/llvm/include/llvm/LTO/legacy/LTOModule.h
@@ -20,6 +20,7 @@
 #include "llvm/LTO/LTO.h"
 #include "llvm/Object/IRObjectFile.h"
 #include "llvm/Object/ModuleSymbolTable.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Target/TargetMachine.h"
 #include <string>
 #include <vector>
diff --git a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
index 37e9b175c452f6e..2b3a1f57f5fe793 100644
--- a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
+++ b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
@@ -21,6 +21,7 @@
 #include "llvm/LTO/LTO.h"
 #include "llvm/Support/CachePruning.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/TargetParser/Triple.h"
diff --git a/llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h b/llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h
index 25a8c553ccb8c1f..2fb42cf12eeb3e2 100644
--- a/llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h
+++ b/llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringSet.h"
 #include "llvm/IR/GlobalValue.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Linker/IRMover.h b/llvm/include/llvm/Linker/IRMover.h
index 1e3c5394ffa2af3..425190beee7b718 100644
--- a/llvm/include/llvm/Linker/IRMover.h
+++ b/llvm/include/llvm/Linker/IRMover.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/FunctionExtras.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Linker/Linker.h b/llvm/include/llvm/Linker/Linker.h
index ac8041d8df1afa6..7af75c934785f60 100644
--- a/llvm/include/llvm/Linker/Linker.h
+++ b/llvm/include/llvm/Linker/Linker.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringSet.h"
 #include "llvm/Linker/IRMover.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/MC/ConstantPools.h b/llvm/include/llvm/MC/ConstantPools.h
index 7eac75362effdc8..e032072a8ed3ec3 100644
--- a/llvm/include/llvm/MC/ConstantPools.h
+++ b/llvm/include/llvm/MC/ConstantPools.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <cstdint>
 #include <map>
diff --git a/llvm/include/llvm/MC/DXContainerPSVInfo.h b/llvm/include/llvm/MC/DXContainerPSVInfo.h
index e17054365d5cf84..f5cd5b2fcbe0c37 100644
--- a/llvm/include/llvm/MC/DXContainerPSVInfo.h
+++ b/llvm/include/llvm/MC/DXContainerPSVInfo.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_DXCONTAINERPSVINFO_H
 
 #include "llvm/BinaryFormat/DXContainer.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 
 #include <numeric>
diff --git a/llvm/include/llvm/MC/MCAsmBackend.h b/llvm/include/llvm/MC/MCAsmBackend.h
index 11bb612c4f30e3b..c5573bfecca6415 100644
--- a/llvm/include/llvm/MC/MCAsmBackend.h
+++ b/llvm/include/llvm/MC/MCAsmBackend.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/MC/MCDirectives.h"
 #include "llvm/MC/MCFixup.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/MC/MCAsmInfo.h b/llvm/include/llvm/MC/MCAsmInfo.h
index c28cd12112358c7..35386ecb878da1a 100644
--- a/llvm/include/llvm/MC/MCAsmInfo.h
+++ b/llvm/include/llvm/MC/MCAsmInfo.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCDirectives.h"
 #include "llvm/MC/MCTargetOptions.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCAsmInfoCOFF.h b/llvm/include/llvm/MC/MCAsmInfoCOFF.h
index 1dfb4750af66a91..17de5b0ab126512 100644
--- a/llvm/include/llvm/MC/MCAsmInfoCOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoCOFF.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCASMINFOCOFF_H
 
 #include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCAsmInfoDarwin.h b/llvm/include/llvm/MC/MCAsmInfoDarwin.h
index c889ce99cebeb87..ed66a3224eb42ec 100644
--- a/llvm/include/llvm/MC/MCAsmInfoDarwin.h
+++ b/llvm/include/llvm/MC/MCAsmInfoDarwin.h
@@ -15,6 +15,7 @@
 #define LLVM_MC_MCASMINFODARWIN_H
 
 #include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCAsmInfoELF.h b/llvm/include/llvm/MC/MCAsmInfoELF.h
index 408d4df76412e49..18e3cf1010ccd92 100644
--- a/llvm/include/llvm/MC/MCAsmInfoELF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoELF.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCASMINFOELF_H
 
 #include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCAsmInfoGOFF.h b/llvm/include/llvm/MC/MCAsmInfoGOFF.h
index 1f3b26311b37ef6..126739f90948fab 100644
--- a/llvm/include/llvm/MC/MCAsmInfoGOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoGOFF.h
@@ -16,6 +16,7 @@
 #define LLVM_MC_MCASMINFOGOFF_H
 
 #include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCAsmInfoGOFF : public MCAsmInfo {
diff --git a/llvm/include/llvm/MC/MCAsmInfoWasm.h b/llvm/include/llvm/MC/MCAsmInfoWasm.h
index 3afc610b8b07b65..ab350bf612714e3 100644
--- a/llvm/include/llvm/MC/MCAsmInfoWasm.h
+++ b/llvm/include/llvm/MC/MCAsmInfoWasm.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCASMINFOWASM_H
 
 #include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCAsmInfoWasm : public MCAsmInfo {
diff --git a/llvm/include/llvm/MC/MCAsmInfoXCOFF.h b/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
index 5483899d58753af..648548312c17040 100644
--- a/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCASMINFOXCOFF_H
 
 #include "llvm/MC/MCAsmInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCAsmLayout.h b/llvm/include/llvm/MC/MCAsmLayout.h
index 94cfb76bdce4db7..518c9d92dea0908 100644
--- a/llvm/include/llvm/MC/MCAsmLayout.h
+++ b/llvm/include/llvm/MC/MCAsmLayout.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCAssembler;
diff --git a/llvm/include/llvm/MC/MCAsmMacro.h b/llvm/include/llvm/MC/MCAsmMacro.h
index 3e8d898af308ab2..ae2258a44843856 100644
--- a/llvm/include/llvm/MC/MCAsmMacro.h
+++ b/llvm/include/llvm/MC/MCAsmMacro.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/SMLoc.h"
 #include <vector>
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index 5e1fc738b1dab4b..3f5a81436ae71ec 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -19,6 +19,7 @@
 #include "llvm/MC/MCDwarf.h"
 #include "llvm/MC/MCLinkerOptimizationHint.h"
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include "llvm/Support/VersionTuple.h"
 #include <algorithm>
diff --git a/llvm/include/llvm/MC/MCCodeEmitter.h b/llvm/include/llvm/MC/MCCodeEmitter.h
index a86b98c145fc84e..573f171b14bd733 100644
--- a/llvm/include/llvm/MC/MCCodeEmitter.h
+++ b/llvm/include/llvm/MC/MCCodeEmitter.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_MC_MCCODEEMITTER_H
 #define LLVM_MC_MCCODEEMITTER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class MCFixup;
diff --git a/llvm/include/llvm/MC/MCCodeView.h b/llvm/include/llvm/MC/MCCodeView.h
index 3e997b1be3b8bdf..65bfcaa10503732 100644
--- a/llvm/include/llvm/MC/MCCodeView.h
+++ b/llvm/include/llvm/MC/MCCodeView.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <vector>
 
diff --git a/llvm/include/llvm/MC/MCDXContainerStreamer.h b/llvm/include/llvm/MC/MCDXContainerStreamer.h
index 91d4ea9bc10654c..a2a9dee06a74c15 100644
--- a/llvm/include/llvm/MC/MCDXContainerStreamer.h
+++ b/llvm/include/llvm/MC/MCDXContainerStreamer.h
@@ -20,6 +20,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCObjectStreamer.h"
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCInst;
diff --git a/llvm/include/llvm/MC/MCDXContainerWriter.h b/llvm/include/llvm/MC/MCDXContainerWriter.h
index 8e78b1f48e16754..7c1ea6c8f317421 100644
--- a/llvm/include/llvm/MC/MCDXContainerWriter.h
+++ b/llvm/include/llvm/MC/MCDXContainerWriter.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCDXCONTAINERWRITER_H
 
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h b/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
index 865d81f70073933..79d58d41d0ca946 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/XCOFF.h"
 #include "llvm/MC/MCDisassembler/MCSymbolizer.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 #include <vector>
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h b/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
index 8af3bb2296ec134..4935d36dd72b8cf 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
@@ -17,6 +17,7 @@
 
 #include "llvm-c/DisassemblerTypes.h"
 #include "llvm/MC/MCDisassembler/MCSymbolizer.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h b/llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h
index efc59da1933539f..e85b47465009001 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h
@@ -15,6 +15,8 @@
 #ifndef LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H
 #define LLVM_MC_MCDISASSEMBLER_MCRELOCATIONINFO_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class MCContext;
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h b/llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h
index 1efb63f1a14256e..3acfda5672e322d 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/MC/MCDisassembler/MCRelocationInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 #include <utility>
diff --git a/llvm/include/llvm/MC/MCDwarf.h b/llvm/include/llvm/MC/MCDwarf.h
index 715714f8e55dbb5..1611cc93be08774 100644
--- a/llvm/include/llvm/MC/MCDwarf.h
+++ b/llvm/include/llvm/MC/MCDwarf.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/StringTableBuilder.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MD5.h"
 #include "llvm/Support/SMLoc.h"
diff --git a/llvm/include/llvm/MC/MCELFObjectWriter.h b/llvm/include/llvm/MC/MCELFObjectWriter.h
index aca77f5f2687a30..fde146ec04f57c9 100644
--- a/llvm/include/llvm/MC/MCELFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCELFObjectWriter.h
@@ -13,6 +13,7 @@
 #include "llvm/MC/MCObjectWriter.h"
 #include "llvm/MC/MCSectionELF.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/TargetParser/Triple.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/MC/MCELFStreamer.h b/llvm/include/llvm/MC/MCELFStreamer.h
index 1309b17bff9c14b..3b08190458968b7 100644
--- a/llvm/include/llvm/MC/MCELFStreamer.h
+++ b/llvm/include/llvm/MC/MCELFStreamer.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/MC/MCDirectives.h"
 #include "llvm/MC/MCObjectStreamer.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCExpr.h b/llvm/include/llvm/MC/MCExpr.h
index 5bc5e04f79ffc37..eb68426f5bcedc8 100644
--- a/llvm/include/llvm/MC/MCExpr.h
+++ b/llvm/include/llvm/MC/MCExpr.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCEXPR_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/MC/MCFixup.h b/llvm/include/llvm/MC/MCFixup.h
index 069ca058310fccf..1de078c803b74fa 100644
--- a/llvm/include/llvm/MC/MCFixup.h
+++ b/llvm/include/llvm/MC/MCFixup.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_MC_MCFIXUP_H
 #define LLVM_MC_MCFIXUP_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/SMLoc.h"
diff --git a/llvm/include/llvm/MC/MCFixupKindInfo.h b/llvm/include/llvm/MC/MCFixupKindInfo.h
index ecf85fa5693186f..a4d9a3b297fd856 100644
--- a/llvm/include/llvm/MC/MCFixupKindInfo.h
+++ b/llvm/include/llvm/MC/MCFixupKindInfo.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_MC_MCFIXUPKINDINFO_H
 #define LLVM_MC_MCFIXUPKINDINFO_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 /// Target independent information on a fixup kind.
diff --git a/llvm/include/llvm/MC/MCFragment.h b/llvm/include/llvm/MC/MCFragment.h
index 7be4792a4521983..bbad3c729e66706 100644
--- a/llvm/include/llvm/MC/MCFragment.h
+++ b/llvm/include/llvm/MC/MCFragment.h
@@ -17,6 +17,7 @@
 #include "llvm/MC/MCFixup.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <cstdint>
 #include <utility>
diff --git a/llvm/include/llvm/MC/MCInst.h b/llvm/include/llvm/MC/MCInst.h
index 2bc310852fe50d6..a615c5f7909ad5a 100644
--- a/llvm/include/llvm/MC/MCInst.h
+++ b/llvm/include/llvm/MC/MCInst.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/bit.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/MC/MCInstBuilder.h b/llvm/include/llvm/MC/MCInstBuilder.h
index 6e5e9dd69018f4f..c82a598454ab063 100644
--- a/llvm/include/llvm/MC/MCInstBuilder.h
+++ b/llvm/include/llvm/MC/MCInstBuilder.h
@@ -15,6 +15,7 @@
 #define LLVM_MC_MCINSTBUILDER_H
 
 #include "llvm/MC/MCInst.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCInstPrinter.h b/llvm/include/llvm/MC/MCInstPrinter.h
index 5e33e274c0b314c..3b45dd44ff70a77 100644
--- a/llvm/include/llvm/MC/MCInstPrinter.h
+++ b/llvm/include/llvm/MC/MCInstPrinter.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_MC_MCINSTPRINTER_H
 #define LLVM_MC_MCINSTPRINTER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Format.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/MC/MCInstrAnalysis.h b/llvm/include/llvm/MC/MCInstrAnalysis.h
index aca0f4daeeee89d..126b94382056c20 100644
--- a/llvm/include/llvm/MC/MCInstrAnalysis.h
+++ b/llvm/include/llvm/MC/MCInstrAnalysis.h
@@ -18,6 +18,7 @@
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCInstrDesc.h"
 #include "llvm/MC/MCInstrInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <vector>
 
diff --git a/llvm/include/llvm/MC/MCInstrDesc.h b/llvm/include/llvm/MC/MCInstrDesc.h
index 0f406cb719502c9..971b97c33c48603 100644
--- a/llvm/include/llvm/MC/MCInstrDesc.h
+++ b/llvm/include/llvm/MC/MCInstrDesc.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/MC/MCRegister.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCRegisterInfo;
diff --git a/llvm/include/llvm/MC/MCInstrInfo.h b/llvm/include/llvm/MC/MCInstrInfo.h
index 35ec1b797051656..e4cfcc0ae01a318 100644
--- a/llvm/include/llvm/MC/MCInstrInfo.h
+++ b/llvm/include/llvm/MC/MCInstrInfo.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCInstrDesc.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCInstrItineraries.h b/llvm/include/llvm/MC/MCInstrItineraries.h
index 652922feddc3384..36ddcdf2af66b71 100644
--- a/llvm/include/llvm/MC/MCInstrItineraries.h
+++ b/llvm/include/llvm/MC/MCInstrItineraries.h
@@ -16,6 +16,7 @@
 #define LLVM_MC_MCINSTRITINERARIES_H
 
 #include "llvm/MC/MCSchedule.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCLabel.h b/llvm/include/llvm/MC/MCLabel.h
index 0b8afac8f7548d8..21d781bb2fde2bc 100644
--- a/llvm/include/llvm/MC/MCLabel.h
+++ b/llvm/include/llvm/MC/MCLabel.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_MC_MCLABEL_H
 #define LLVM_MC_MCLABEL_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class raw_ostream;
diff --git a/llvm/include/llvm/MC/MCLinkerOptimizationHint.h b/llvm/include/llvm/MC/MCLinkerOptimizationHint.h
index b91fbc62aa75691..b994882d781ed0a 100644
--- a/llvm/include/llvm/MC/MCLinkerOptimizationHint.h
+++ b/llvm/include/llvm/MC/MCLinkerOptimizationHint.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 
diff --git a/llvm/include/llvm/MC/MCMachObjectWriter.h b/llvm/include/llvm/MC/MCMachObjectWriter.h
index 05d816671b1a405..6244421bdd3d955 100644
--- a/llvm/include/llvm/MC/MCMachObjectWriter.h
+++ b/llvm/include/llvm/MC/MCMachObjectWriter.h
@@ -16,6 +16,7 @@
 #include "llvm/MC/MCObjectWriter.h"
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/StringTableBuilder.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/EndianStream.h"
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/MC/MCObjectFileInfo.h b/llvm/include/llvm/MC/MCObjectFileInfo.h
index 54f696cb795fbc1..3ed0693f7d28788 100644
--- a/llvm/include/llvm/MC/MCObjectFileInfo.h
+++ b/llvm/include/llvm/MC/MCObjectFileInfo.h
@@ -15,6 +15,7 @@
 
 #include "llvm/BinaryFormat/Swift.h"
 #include "llvm/MC/MCSection.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/VersionTuple.h"
 #include "llvm/TargetParser/Triple.h"
 
diff --git a/llvm/include/llvm/MC/MCObjectStreamer.h b/llvm/include/llvm/MC/MCObjectStreamer.h
index 5e5b4b315017095..f0c5ee2753a0009 100644
--- a/llvm/include/llvm/MC/MCObjectStreamer.h
+++ b/llvm/include/llvm/MC/MCObjectStreamer.h
@@ -15,6 +15,7 @@
 #include "llvm/MC/MCFragment.h"
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/MCStreamer.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCContext;
diff --git a/llvm/include/llvm/MC/MCObjectWriter.h b/llvm/include/llvm/MC/MCObjectWriter.h
index 2a43266144b4d84..5bf6631c5a8254e 100644
--- a/llvm/include/llvm/MC/MCObjectWriter.h
+++ b/llvm/include/llvm/MC/MCObjectWriter.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCOBJECTWRITER_H
 
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/MC/MCParser/AsmCond.h b/llvm/include/llvm/MC/MCParser/AsmCond.h
index 44edd2b758ffe41..6b8c8ae4b508dd7 100644
--- a/llvm/include/llvm/MC/MCParser/AsmCond.h
+++ b/llvm/include/llvm/MC/MCParser/AsmCond.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_MC_MCPARSER_ASMCOND_H
 #define LLVM_MC_MCPARSER_ASMCOND_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 /// AsmCond - Class to support conditional assembly
diff --git a/llvm/include/llvm/MC/MCParser/AsmLexer.h b/llvm/include/llvm/MC/MCParser/AsmLexer.h
index 735b0c114f2aae8..0a0c59f6dbfdc79 100644
--- a/llvm/include/llvm/MC/MCParser/AsmLexer.h
+++ b/llvm/include/llvm/MC/MCParser/AsmLexer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCParser/MCAsmLexer.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmLexer.h b/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
index 9affb1f980bb071..3ea594ed3bfdaa4 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/MC/MCAsmMacro.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <string>
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParser.h b/llvm/include/llvm/MC/MCParser/MCAsmParser.h
index faa72d5f3144c43..1c36cd17efe447e 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParser.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParser.h
@@ -15,6 +15,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/MC/MCAsmMacro.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <cstdint>
 #include <string>
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h b/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
index e596a7195447dd5..ac1cf673e4ed5a2 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCParser/MCAsmParser.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h b/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
index d692da7402fefef..603c740d44300e7 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_MC_MCPARSER_MCASMPARSERUTILS_H
 #define LLVM_MC_MCPARSER_MCASMPARSERUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class MCAsmParser;
diff --git a/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h b/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h
index 0c9668904e8261b..59583b16b7c1afd 100644
--- a/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h
+++ b/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCPARSER_MCPARSEDASMOPERAND_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <string>
 
diff --git a/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h b/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
index 1d87f0131efcb06..3eecace2f7e2d73 100644
--- a/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
+++ b/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
@@ -14,6 +14,7 @@
 #include "llvm/MC/MCParser/MCAsmParserExtension.h"
 #include "llvm/MC/MCParser/MCParsedAsmOperand.h"
 #include "llvm/MC/MCTargetOptions.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include "llvm/TargetParser/SubtargetFeature.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/MC/MCPseudoProbe.h b/llvm/include/llvm/MC/MCPseudoProbe.h
index 4904cb4ca545676..d3625723c5df307 100644
--- a/llvm/include/llvm/MC/MCPseudoProbe.h
+++ b/llvm/include/llvm/MC/MCPseudoProbe.h
@@ -58,6 +58,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/PseudoProbe.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorOr.h"
 #include <list>
 #include <map>
diff --git a/llvm/include/llvm/MC/MCRegister.h b/llvm/include/llvm/MC/MCRegister.h
index 530c1870abd6adb..82f5477e510d0af 100644
--- a/llvm/include/llvm/MC/MCRegister.h
+++ b/llvm/include/llvm/MC/MCRegister.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/Hashing.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <limits>
 
diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h
index ede01d624924622..3afdd70e16b1d06 100644
--- a/llvm/include/llvm/MC/MCRegisterInfo.h
+++ b/llvm/include/llvm/MC/MCRegisterInfo.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/MC/LaneBitmask.h"
 #include "llvm/MC/MCRegister.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <iterator>
diff --git a/llvm/include/llvm/MC/MCSPIRVObjectWriter.h b/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
index a8baf96b83842ba..8c8c1b43f8da0cd 100644
--- a/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
+++ b/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCSPIRVOBJECTWRITER_H
 
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <memory>
 
diff --git a/llvm/include/llvm/MC/MCSPIRVStreamer.h b/llvm/include/llvm/MC/MCSPIRVStreamer.h
index b03ae5d4599c963..43cfdbb28acfb47 100644
--- a/llvm/include/llvm/MC/MCSPIRVStreamer.h
+++ b/llvm/include/llvm/MC/MCSPIRVStreamer.h
@@ -17,6 +17,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCObjectStreamer.h"
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCInst;
diff --git a/llvm/include/llvm/MC/MCSchedule.h b/llvm/include/llvm/MC/MCSchedule.h
index e6cf27ce2d6513f..06f8e3fd24865b2 100644
--- a/llvm/include/llvm/MC/MCSchedule.h
+++ b/llvm/include/llvm/MC/MCSchedule.h
@@ -15,6 +15,7 @@
 #define LLVM_MC_MCSCHEDULE_H
 
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <cassert>
 
diff --git a/llvm/include/llvm/MC/MCSection.h b/llvm/include/llvm/MC/MCSection.h
index 90bc48ec185ca4a..89fd6ba43277182 100644
--- a/llvm/include/llvm/MC/MCSection.h
+++ b/llvm/include/llvm/MC/MCSection.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ilist.h"
 #include "llvm/MC/MCFragment.h"
 #include "llvm/MC/SectionKind.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Alignment.h"
 #include <cassert>
 #include <utility>
diff --git a/llvm/include/llvm/MC/MCSectionCOFF.h b/llvm/include/llvm/MC/MCSectionCOFF.h
index 373863e21ff02eb..c84747a2deffac3 100644
--- a/llvm/include/llvm/MC/MCSectionCOFF.h
+++ b/llvm/include/llvm/MC/MCSectionCOFF.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/SectionKind.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCSectionDXContainer.h b/llvm/include/llvm/MC/MCSectionDXContainer.h
index 014684a93529503..7fdd3282eb0e3c7 100644
--- a/llvm/include/llvm/MC/MCSectionDXContainer.h
+++ b/llvm/include/llvm/MC/MCSectionDXContainer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/SectionKind.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCSectionELF.h b/llvm/include/llvm/MC/MCSectionELF.h
index 3b5239394493cea..152e2bcff8ff43c 100644
--- a/llvm/include/llvm/MC/MCSectionELF.h
+++ b/llvm/include/llvm/MC/MCSectionELF.h
@@ -18,6 +18,7 @@
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/MCSymbolELF.h"
 #include "llvm/MC/SectionKind.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCSectionGOFF.h b/llvm/include/llvm/MC/MCSectionGOFF.h
index d866329461ceae8..1f98199eea5a7f8 100644
--- a/llvm/include/llvm/MC/MCSectionGOFF.h
+++ b/llvm/include/llvm/MC/MCSectionGOFF.h
@@ -17,6 +17,7 @@
 
 #include "llvm/BinaryFormat/GOFF.h"
 #include "llvm/MC/MCSection.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCSectionMachO.h b/llvm/include/llvm/MC/MCSectionMachO.h
index fdf1773d400253b..b9ab4422e8d1d10 100644
--- a/llvm/include/llvm/MC/MCSectionMachO.h
+++ b/llvm/include/llvm/MC/MCSectionMachO.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/MachO.h"
 #include "llvm/MC/MCSection.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCSectionSPIRV.h b/llvm/include/llvm/MC/MCSectionSPIRV.h
index 6534599d2091c74..ba9a16cd32a3170 100644
--- a/llvm/include/llvm/MC/MCSectionSPIRV.h
+++ b/llvm/include/llvm/MC/MCSectionSPIRV.h
@@ -15,6 +15,7 @@
 
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/SectionKind.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCSectionWasm.h b/llvm/include/llvm/MC/MCSectionWasm.h
index 579f92a750567ed..4c9b5d8886aa306 100644
--- a/llvm/include/llvm/MC/MCSectionWasm.h
+++ b/llvm/include/llvm/MC/MCSectionWasm.h
@@ -14,6 +14,7 @@
 #define LLVM_MC_MCSECTIONWASM_H
 
 #include "llvm/MC/MCSection.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCSectionXCOFF.h b/llvm/include/llvm/MC/MCSectionXCOFF.h
index 68832f5daad5871..65092b14ab3585a 100644
--- a/llvm/include/llvm/MC/MCSectionXCOFF.h
+++ b/llvm/include/llvm/MC/MCSectionXCOFF.h
@@ -16,6 +16,7 @@
 #include "llvm/BinaryFormat/XCOFF.h"
 #include "llvm/MC/MCSection.h"
 #include "llvm/MC/MCSymbolXCOFF.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCStreamer.h b/llvm/include/llvm/MC/MCStreamer.h
index dcd84a6efda0e88..09b6fd664af75ad 100644
--- a/llvm/include/llvm/MC/MCStreamer.h
+++ b/llvm/include/llvm/MC/MCStreamer.h
@@ -22,6 +22,7 @@
 #include "llvm/MC/MCLinkerOptimizationHint.h"
 #include "llvm/MC/MCPseudoProbe.h"
 #include "llvm/MC/MCWinEH.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MD5.h"
 #include "llvm/Support/SMLoc.h"
diff --git a/llvm/include/llvm/MC/MCSubtargetInfo.h b/llvm/include/llvm/MC/MCSubtargetInfo.h
index c1533ac8d0059f5..ab45d1873fb1811 100644
--- a/llvm/include/llvm/MC/MCSubtargetInfo.h
+++ b/llvm/include/llvm/MC/MCSubtargetInfo.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCInstrItineraries.h"
 #include "llvm/MC/MCSchedule.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/SubtargetFeature.h"
 #include "llvm/TargetParser/Triple.h"
 #include <cassert>
diff --git a/llvm/include/llvm/MC/MCSymbol.h b/llvm/include/llvm/MC/MCSymbol.h
index d0d51f32e96779d..a50ce48bf330dca 100644
--- a/llvm/include/llvm/MC/MCSymbol.h
+++ b/llvm/include/llvm/MC/MCSymbol.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/MC/MCExpr.h"
 #include "llvm/MC/MCFragment.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MathExtras.h"
 #include <cassert>
diff --git a/llvm/include/llvm/MC/MCSymbolCOFF.h b/llvm/include/llvm/MC/MCSymbolCOFF.h
index 7983fff7e6afdaa..59ec933463b3629 100644
--- a/llvm/include/llvm/MC/MCSymbolCOFF.h
+++ b/llvm/include/llvm/MC/MCSymbolCOFF.h
@@ -11,6 +11,7 @@
 
 #include "llvm/BinaryFormat/COFF.h"
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCSymbolELF.h b/llvm/include/llvm/MC/MCSymbolELF.h
index 9fc49ea322ce21a..ef496b2feafc92d 100644
--- a/llvm/include/llvm/MC/MCSymbolELF.h
+++ b/llvm/include/llvm/MC/MCSymbolELF.h
@@ -9,6 +9,7 @@
 #define LLVM_MC_MCSYMBOLELF_H
 
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCSymbolELF : public MCSymbol {
diff --git a/llvm/include/llvm/MC/MCSymbolGOFF.h b/llvm/include/llvm/MC/MCSymbolGOFF.h
index cc4e2bbe246e2de..6cbc7080a99a3d2 100644
--- a/llvm/include/llvm/MC/MCSymbolGOFF.h
+++ b/llvm/include/llvm/MC/MCSymbolGOFF.h
@@ -14,6 +14,7 @@
 #define LLVM_MC_MCSYMBOLGOFF_H
 
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCSymbolMachO.h b/llvm/include/llvm/MC/MCSymbolMachO.h
index bce0f82da62cd67..14ac6faffcf14dc 100644
--- a/llvm/include/llvm/MC/MCSymbolMachO.h
+++ b/llvm/include/llvm/MC/MCSymbolMachO.h
@@ -10,6 +10,7 @@
 
 #include "llvm/ADT/Twine.h"
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MCSymbolMachO : public MCSymbol {
diff --git a/llvm/include/llvm/MC/MCSymbolWasm.h b/llvm/include/llvm/MC/MCSymbolWasm.h
index c67bd64e7cbdfda..3f88aaf19590f4c 100644
--- a/llvm/include/llvm/MC/MCSymbolWasm.h
+++ b/llvm/include/llvm/MC/MCSymbolWasm.h
@@ -10,6 +10,7 @@
 
 #include "llvm/BinaryFormat/Wasm.h"
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCSymbolXCOFF.h b/llvm/include/llvm/MC/MCSymbolXCOFF.h
index af5759f72618d5b..502e6e4c8c804c1 100644
--- a/llvm/include/llvm/MC/MCSymbolXCOFF.h
+++ b/llvm/include/llvm/MC/MCSymbolXCOFF.h
@@ -11,6 +11,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/XCOFF.h"
 #include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCTargetOptions.h b/llvm/include/llvm/MC/MCTargetOptions.h
index 9fc1e07d085ebaa..8556502ec6dc0f4 100644
--- a/llvm/include/llvm/MC/MCTargetOptions.h
+++ b/llvm/include/llvm/MC/MCTargetOptions.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCTARGETOPTIONS_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Compression.h"
 #include <string>
 #include <vector>
diff --git a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
index 7f6ee6c8be224ab..fef63b27cf11f47 100644
--- a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
+++ b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
 #define LLVM_MC_MCTARGETOPTIONSCOMMANDFLAGS_H
 
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <string>
 
diff --git a/llvm/include/llvm/MC/MCValue.h b/llvm/include/llvm/MC/MCValue.h
index 37265d72c9df93b..927514b013da948 100644
--- a/llvm/include/llvm/MC/MCValue.h
+++ b/llvm/include/llvm/MC/MCValue.h
@@ -14,6 +14,7 @@
 #define LLVM_MC_MCVALUE_H
 
 #include "llvm/MC/MCExpr.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCWasmObjectWriter.h b/llvm/include/llvm/MC/MCWasmObjectWriter.h
index 3d5b09407507a9c..22cfd1b74bb38c2 100644
--- a/llvm/include/llvm/MC/MCWasmObjectWriter.h
+++ b/llvm/include/llvm/MC/MCWasmObjectWriter.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCWASMOBJECTWRITER_H
 
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCWasmStreamer.h b/llvm/include/llvm/MC/MCWasmStreamer.h
index f58405214a80a3c..e9bd97046ca4576 100644
--- a/llvm/include/llvm/MC/MCWasmStreamer.h
+++ b/llvm/include/llvm/MC/MCWasmStreamer.h
@@ -14,6 +14,7 @@
 #include "llvm/MC/MCDirectives.h"
 #include "llvm/MC/MCObjectStreamer.h"
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCWin64EH.h b/llvm/include/llvm/MC/MCWin64EH.h
index 622a666b78dd233..1a0858c3a8e4bae 100644
--- a/llvm/include/llvm/MC/MCWin64EH.h
+++ b/llvm/include/llvm/MC/MCWin64EH.h
@@ -15,6 +15,7 @@
 #define LLVM_MC_MCWIN64EH_H
 
 #include "llvm/MC/MCWinEH.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Win64EH.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h b/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
index 307800e73c687c2..3f4d1b23331f684 100644
--- a/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCWINCOFFOBJECTWRITER_H
 
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCWinCOFFStreamer.h b/llvm/include/llvm/MC/MCWinCOFFStreamer.h
index 52563f120fdb4b6..b036d9bf51e2f41 100644
--- a/llvm/include/llvm/MC/MCWinCOFFStreamer.h
+++ b/llvm/include/llvm/MC/MCWinCOFFStreamer.h
@@ -11,6 +11,7 @@
 
 #include "llvm/MC/MCDirectives.h"
 #include "llvm/MC/MCObjectStreamer.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCWinEH.h b/llvm/include/llvm/MC/MCWinEH.h
index fcce2dcd54837c5..ae8a77cf0f95ca4 100644
--- a/llvm/include/llvm/MC/MCWinEH.h
+++ b/llvm/include/llvm/MC/MCWinEH.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCWINEH_H
 
 #include "llvm/ADT/MapVector.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MC/MCXCOFFObjectWriter.h b/llvm/include/llvm/MC/MCXCOFFObjectWriter.h
index faad2ceb26910d9..3a4f49ee334e02a 100644
--- a/llvm/include/llvm/MC/MCXCOFFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCXCOFFObjectWriter.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCXCOFFOBJECTWRITER_H
 
 #include "llvm/MC/MCObjectWriter.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MCXCOFFStreamer.h b/llvm/include/llvm/MC/MCXCOFFStreamer.h
index a3db636e5b3a933..f358faec7f4bcd7 100644
--- a/llvm/include/llvm/MC/MCXCOFFStreamer.h
+++ b/llvm/include/llvm/MC/MCXCOFFStreamer.h
@@ -10,6 +10,7 @@
 #define LLVM_MC_MCXCOFFSTREAMER_H
 
 #include "llvm/MC/MCObjectStreamer.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/MachineLocation.h b/llvm/include/llvm/MC/MachineLocation.h
index 5872540e6104dea..5b9d26ddfdc748f 100644
--- a/llvm/include/llvm/MC/MachineLocation.h
+++ b/llvm/include/llvm/MC/MachineLocation.h
@@ -16,6 +16,7 @@
 
 #include <cstdint>
 #include <cassert>
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/MC/SectionKind.h b/llvm/include/llvm/MC/SectionKind.h
index 61e400fe9edeea4..14d11e0051a87e4 100644
--- a/llvm/include/llvm/MC/SectionKind.h
+++ b/llvm/include/llvm/MC/SectionKind.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_MC_SECTIONKIND_H
 #define LLVM_MC_SECTIONKIND_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 /// SectionKind - This is a simple POD value that classifies the properties of
diff --git a/llvm/include/llvm/MC/StringTableBuilder.h b/llvm/include/llvm/MC/StringTableBuilder.h
index d0d5aaa0373893f..718f61d0c531b65 100644
--- a/llvm/include/llvm/MC/StringTableBuilder.h
+++ b/llvm/include/llvm/MC/StringTableBuilder.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <cstdint>
 
diff --git a/llvm/include/llvm/MC/TargetRegistry.h b/llvm/include/llvm/MC/TargetRegistry.h
index 3fa150fc1349cee..ed9be225d743acb 100644
--- a/llvm/include/llvm/MC/TargetRegistry.h
+++ b/llvm/include/llvm/MC/TargetRegistry.h
@@ -23,6 +23,7 @@
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/MC/MCObjectFileInfo.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/TargetParser/Triple.h"
diff --git a/llvm/include/llvm/MCA/CodeEmitter.h b/llvm/include/llvm/MCA/CodeEmitter.h
index 431ceea2706486b..3c8ecaf2c1070a9 100644
--- a/llvm/include/llvm/MCA/CodeEmitter.h
+++ b/llvm/include/llvm/MCA/CodeEmitter.h
@@ -23,6 +23,7 @@
 #include "llvm/MC/MCCodeEmitter.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCSubtargetInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Context.h b/llvm/include/llvm/MCA/Context.h
index 0abcfd7ce9f05e4..1c9573a2ffa0acf 100644
--- a/llvm/include/llvm/MCA/Context.h
+++ b/llvm/include/llvm/MCA/Context.h
@@ -23,6 +23,7 @@
 #include "llvm/MCA/HardwareUnits/HardwareUnit.h"
 #include "llvm/MCA/Pipeline.h"
 #include "llvm/MCA/SourceMgr.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MCA/CustomBehaviour.h b/llvm/include/llvm/MCA/CustomBehaviour.h
index b3774894517ab45..77bff2f27db46c5 100644
--- a/llvm/include/llvm/MCA/CustomBehaviour.h
+++ b/llvm/include/llvm/MCA/CustomBehaviour.h
@@ -24,6 +24,7 @@
 #include "llvm/MC/MCSubtargetInfo.h"
 #include "llvm/MCA/SourceMgr.h"
 #include "llvm/MCA/View.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/HWEventListener.h b/llvm/include/llvm/MCA/HWEventListener.h
index 4a7d0df6b18a93a..a0e422e2f7a88b2 100644
--- a/llvm/include/llvm/MCA/HWEventListener.h
+++ b/llvm/include/llvm/MCA/HWEventListener.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/MCA/Instruction.h"
 #include "llvm/MCA/Support.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h b/llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h
index 85350e4eb7f076f..20533500c4b794f 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h
@@ -15,6 +15,8 @@
 #ifndef LLVM_MCA_HARDWAREUNITS_HARDWAREUNIT_H
 #define LLVM_MCA_HARDWAREUNITS_HARDWAREUNIT_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 namespace mca {
 
diff --git a/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h b/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
index 81a5453bac26c4c..28ce2ffd127d254 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
@@ -20,6 +20,7 @@
 #include "llvm/MC/MCSchedule.h"
 #include "llvm/MCA/HardwareUnits/HardwareUnit.h"
 #include "llvm/MCA/Instruction.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h b/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h
index 5bd74ad5fe7882a..68c9cf2ddcb4019 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h
@@ -22,6 +22,7 @@
 #include "llvm/MC/MCSchedule.h"
 #include "llvm/MC/MCSubtargetInfo.h"
 #include "llvm/MCA/HardwareUnits/HardwareUnit.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h b/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h
index 88085d0bc453b82..4a9269383d525d0 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h
@@ -20,6 +20,7 @@
 #include "llvm/MC/MCSchedule.h"
 #include "llvm/MCA/Instruction.h"
 #include "llvm/MCA/Support.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h b/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h
index 4342a3e72fa8c44..51a794232ad5312 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h
@@ -17,6 +17,7 @@
 #include "llvm/MC/MCSchedule.h"
 #include "llvm/MCA/HardwareUnits/HardwareUnit.h"
 #include "llvm/MCA/Instruction.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h b/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h
index 8c0ad2699b8db85..d363c22cea4022f 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h
@@ -20,6 +20,7 @@
 #include "llvm/MCA/HardwareUnits/LSUnit.h"
 #include "llvm/MCA/HardwareUnits/ResourceManager.h"
 #include "llvm/MCA/Support.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/IncrementalSourceMgr.h b/llvm/include/llvm/MCA/IncrementalSourceMgr.h
index d53f1138b94059b..b3dc5c24c47f6e5 100644
--- a/llvm/include/llvm/MCA/IncrementalSourceMgr.h
+++ b/llvm/include/llvm/MCA/IncrementalSourceMgr.h
@@ -15,6 +15,7 @@
 #define LLVM_MCA_INCREMENTALSOURCEMGR_H
 
 #include "llvm/MCA/SourceMgr.h"
+#include "llvm/Support/Compiler.h"
 #include <deque>
 
 namespace llvm {
diff --git a/llvm/include/llvm/MCA/InstrBuilder.h b/llvm/include/llvm/MCA/InstrBuilder.h
index c8619af04b330ff..4c5b5287ac6aaa2 100644
--- a/llvm/include/llvm/MCA/InstrBuilder.h
+++ b/llvm/include/llvm/MCA/InstrBuilder.h
@@ -22,6 +22,7 @@
 #include "llvm/MCA/CustomBehaviour.h"
 #include "llvm/MCA/Instruction.h"
 #include "llvm/MCA/Support.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/MCA/Instruction.h b/llvm/include/llvm/MCA/Instruction.h
index e48a70164bec6c1..9c6bd9ed3b13787 100644
--- a/llvm/include/llvm/MCA/Instruction.h
+++ b/llvm/include/llvm/MCA/Instruction.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/MC/MCRegister.h" // definition of MCPhysReg.
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 
 #ifndef NDEBUG
diff --git a/llvm/include/llvm/MCA/Pipeline.h b/llvm/include/llvm/MCA/Pipeline.h
index 18032fdfe012c20..484cda3289342ee 100644
--- a/llvm/include/llvm/MCA/Pipeline.h
+++ b/llvm/include/llvm/MCA/Pipeline.h
@@ -16,6 +16,7 @@
 #define LLVM_MCA_PIPELINE_H
 
 #include "llvm/MCA/Stages/Stage.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/MCA/SourceMgr.h b/llvm/include/llvm/MCA/SourceMgr.h
index 16a60d1116ad6bf..23682d3820912e8 100644
--- a/llvm/include/llvm/MCA/SourceMgr.h
+++ b/llvm/include/llvm/MCA/SourceMgr.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/MCA/Instruction.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Stages/DispatchStage.h b/llvm/include/llvm/MCA/Stages/DispatchStage.h
index c2b521993c2fb7e..7a2cc95c26497a0 100644
--- a/llvm/include/llvm/MCA/Stages/DispatchStage.h
+++ b/llvm/include/llvm/MCA/Stages/DispatchStage.h
@@ -24,6 +24,7 @@
 #include "llvm/MCA/HardwareUnits/RetireControlUnit.h"
 #include "llvm/MCA/Instruction.h"
 #include "llvm/MCA/Stages/Stage.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Stages/EntryStage.h b/llvm/include/llvm/MCA/Stages/EntryStage.h
index fb1244aa1933a65..c157c34c989ebe6 100644
--- a/llvm/include/llvm/MCA/Stages/EntryStage.h
+++ b/llvm/include/llvm/MCA/Stages/EntryStage.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/MCA/SourceMgr.h"
 #include "llvm/MCA/Stages/Stage.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Stages/ExecuteStage.h b/llvm/include/llvm/MCA/Stages/ExecuteStage.h
index 03a78a8b6b85b14..21c27669ee052e4 100644
--- a/llvm/include/llvm/MCA/Stages/ExecuteStage.h
+++ b/llvm/include/llvm/MCA/Stages/ExecuteStage.h
@@ -21,6 +21,7 @@
 #include "llvm/MCA/HardwareUnits/Scheduler.h"
 #include "llvm/MCA/Instruction.h"
 #include "llvm/MCA/Stages/Stage.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Stages/InOrderIssueStage.h b/llvm/include/llvm/MCA/Stages/InOrderIssueStage.h
index f9286acef9006da..16973c55c6c3abb 100644
--- a/llvm/include/llvm/MCA/Stages/InOrderIssueStage.h
+++ b/llvm/include/llvm/MCA/Stages/InOrderIssueStage.h
@@ -18,6 +18,7 @@
 #include "llvm/MCA/HardwareUnits/ResourceManager.h"
 #include "llvm/MCA/SourceMgr.h"
 #include "llvm/MCA/Stages/Stage.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Stages/InstructionTables.h b/llvm/include/llvm/MCA/Stages/InstructionTables.h
index 9617fd49db6e05a..84861cc0b056fe4 100644
--- a/llvm/include/llvm/MCA/Stages/InstructionTables.h
+++ b/llvm/include/llvm/MCA/Stages/InstructionTables.h
@@ -21,6 +21,7 @@
 #include "llvm/MCA/HardwareUnits/Scheduler.h"
 #include "llvm/MCA/Stages/Stage.h"
 #include "llvm/MCA/Support.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h b/llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h
index d9e3264c5951fba..d4608fe595c8861 100644
--- a/llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h
+++ b/llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h
@@ -18,6 +18,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/MCA/Stages/Stage.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Stages/RetireStage.h b/llvm/include/llvm/MCA/Stages/RetireStage.h
index aafe2815df15036..ab6d21e9c4de6eb 100644
--- a/llvm/include/llvm/MCA/Stages/RetireStage.h
+++ b/llvm/include/llvm/MCA/Stages/RetireStage.h
@@ -21,6 +21,7 @@
 #include "llvm/MCA/HardwareUnits/RegisterFile.h"
 #include "llvm/MCA/HardwareUnits/RetireControlUnit.h"
 #include "llvm/MCA/Stages/Stage.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace mca {
diff --git a/llvm/include/llvm/MCA/Stages/Stage.h b/llvm/include/llvm/MCA/Stages/Stage.h
index a1fc7a8af7ad69c..f869e825b05ab66 100644
--- a/llvm/include/llvm/MCA/Stages/Stage.h
+++ b/llvm/include/llvm/MCA/Stages/Stage.h
@@ -16,6 +16,7 @@
 #define LLVM_MCA_STAGES_STAGE_H
 
 #include "llvm/MCA/HWEventListener.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <set>
 
diff --git a/llvm/include/llvm/MCA/Support.h b/llvm/include/llvm/MCA/Support.h
index e5e6278171051f0..67aec1ed7610e04 100644
--- a/llvm/include/llvm/MCA/Support.h
+++ b/llvm/include/llvm/MCA/Support.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/MC/MCSchedule.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MathExtras.h"
 
diff --git a/llvm/include/llvm/MCA/View.h b/llvm/include/llvm/MCA/View.h
index ff8fc1ceb3f1414..9bf69f88360015e 100644
--- a/llvm/include/llvm/MCA/View.h
+++ b/llvm/include/llvm/MCA/View.h
@@ -17,6 +17,7 @@
 
 #include "llvm/MC/MCInstPrinter.h"
 #include "llvm/MCA/HWEventListener.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/ObjCopy/COFF/COFFConfig.h b/llvm/include/llvm/ObjCopy/COFF/COFFConfig.h
index d69285d7b5b3c84..533c2f9ce759250 100644
--- a/llvm/include/llvm/ObjCopy/COFF/COFFConfig.h
+++ b/llvm/include/llvm/ObjCopy/COFF/COFFConfig.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_OBJCOPY_COFF_COFFCONFIG_H
 #define LLVM_OBJCOPY_COFF_COFFCONFIG_H
 
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h b/llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h
index d9043d6c5d019c8..75ec4fe2f5efd17 100644
--- a/llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_OBJCOPY_COFF_COFFOBJCOPY_H
 #define LLVM_OBJCOPY_COFF_COFFOBJCOPY_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class Error;
 class raw_ostream;
diff --git a/llvm/include/llvm/ObjCopy/CommonConfig.h b/llvm/include/llvm/ObjCopy/CommonConfig.h
index 17ca9e8be228ea6..3555b3186d8a768 100644
--- a/llvm/include/llvm/ObjCopy/CommonConfig.h
+++ b/llvm/include/llvm/ObjCopy/CommonConfig.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Object/ELFTypes.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GlobPattern.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/Regex.h"
diff --git a/llvm/include/llvm/ObjCopy/ConfigManager.h b/llvm/include/llvm/ObjCopy/ConfigManager.h
index 2962cf99b270df0..9859f3a8723864a 100644
--- a/llvm/include/llvm/ObjCopy/ConfigManager.h
+++ b/llvm/include/llvm/ObjCopy/ConfigManager.h
@@ -16,6 +16,7 @@
 #include "llvm/ObjCopy/MultiFormatConfig.h"
 #include "llvm/ObjCopy/wasm/WasmConfig.h"
 #include "llvm/ObjCopy/XCOFF/XCOFFConfig.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace objcopy {
diff --git a/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h b/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h
index 1e98b10919af112..cbaef0268fe58a2 100644
--- a/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h
+++ b/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Object/ELFTypes.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h b/llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h
index 552b6fb655f1864..042a7a98cf86be8 100644
--- a/llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_OBJCOPY_ELF_ELFOBJCOPY_H
 #define LLVM_OBJCOPY_ELF_ELFOBJCOPY_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class Error;
 class MemoryBuffer;
diff --git a/llvm/include/llvm/ObjCopy/MachO/MachOConfig.h b/llvm/include/llvm/ObjCopy/MachO/MachOConfig.h
index 15f9699357f042d..ce2671b08fb63de 100644
--- a/llvm/include/llvm/ObjCopy/MachO/MachOConfig.h
+++ b/llvm/include/llvm/ObjCopy/MachO/MachOConfig.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <vector>
 
diff --git a/llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h b/llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h
index 73690d7ace8a51d..1aebb8b6775adca 100644
--- a/llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_OBJCOPY_MACHO_MACHOOBJCOPY_H
 #define LLVM_OBJCOPY_MACHO_MACHOOBJCOPY_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class Error;
 class raw_ostream;
diff --git a/llvm/include/llvm/ObjCopy/MultiFormatConfig.h b/llvm/include/llvm/ObjCopy/MultiFormatConfig.h
index 180f2f82a908b89..a8b22847123b006 100644
--- a/llvm/include/llvm/ObjCopy/MultiFormatConfig.h
+++ b/llvm/include/llvm/ObjCopy/MultiFormatConfig.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_OBJCOPY_MULTIFORMATCONFIG_H
 #define LLVM_OBJCOPY_MULTIFORMATCONFIG_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ObjCopy/ObjCopy.h b/llvm/include/llvm/ObjCopy/ObjCopy.h
index 023814002c72710..d9808b9d99d8b48 100644
--- a/llvm/include/llvm/ObjCopy/ObjCopy.h
+++ b/llvm/include/llvm/ObjCopy/ObjCopy.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_OBJCOPY_OBJCOPY_H
 #define LLVM_OBJCOPY_OBJCOPY_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h b/llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h
index adaeedc82b73b4c..143a62d9d693fd3 100644
--- a/llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h
+++ b/llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_OBJCOPY_XCOFF_XCOFFCONFIG_H
 #define LLVM_OBJCOPY_XCOFF_XCOFFCONFIG_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 namespace objcopy {
 
diff --git a/llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h b/llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h
index 9fc85cb39fa5b00..63501ec297ac6a9 100644
--- a/llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_OBJCOPY_XCOFF_XCOFFOBJCOPY_H
 #define LLVM_OBJCOPY_XCOFF_XCOFFOBJCOPY_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class Error;
 class raw_ostream;
diff --git a/llvm/include/llvm/ObjCopy/wasm/WasmConfig.h b/llvm/include/llvm/ObjCopy/wasm/WasmConfig.h
index 56a7055da9a77e0..fdb767002f67cfd 100644
--- a/llvm/include/llvm/ObjCopy/wasm/WasmConfig.h
+++ b/llvm/include/llvm/ObjCopy/wasm/WasmConfig.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_OBJCOPY_WASM_WASMCONFIG_H
 #define LLVM_OBJCOPY_WASM_WASMCONFIG_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 namespace objcopy {
 
diff --git a/llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h b/llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h
index 5b4181c22b97988..526ed0c3c13f504 100644
--- a/llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_OBJCOPY_WASM_WASMOBJCOPY_H
 #define LLVM_OBJCOPY_WASM_WASMOBJCOPY_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class Error;
 class raw_ostream;
diff --git a/llvm/include/llvm/Object/Archive.h b/llvm/include/llvm/Object/Archive.h
index 27f504779c4f525..600f74ca6dd98a1 100644
--- a/llvm/include/llvm/Object/Archive.h
+++ b/llvm/include/llvm/Object/Archive.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Support/Chrono.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/MemoryBuffer.h"
diff --git a/llvm/include/llvm/Object/ArchiveWriter.h b/llvm/include/llvm/Object/ArchiveWriter.h
index c89246f1d5694ef..be9d21a3e1cd490 100644
--- a/llvm/include/llvm/Object/ArchiveWriter.h
+++ b/llvm/include/llvm/Object/ArchiveWriter.h
@@ -14,6 +14,7 @@
 #define LLVM_OBJECT_ARCHIVEWRITER_H
 
 #include "llvm/Object/Archive.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Object/Binary.h b/llvm/include/llvm/Object/Binary.h
index ce870e25acafe0c..9a1566c8d0e401d 100644
--- a/llvm/include/llvm/Object/Binary.h
+++ b/llvm/include/llvm/Object/Binary.h
@@ -16,6 +16,7 @@
 #include "llvm-c/Types.h"
 #include "llvm/Object/Error.h"
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/TargetParser/Triple.h"
diff --git a/llvm/include/llvm/Object/BuildID.h b/llvm/include/llvm/Object/BuildID.h
index b20f32b4d133ea3..9cbc3527cd8b972 100644
--- a/llvm/include/llvm/Object/BuildID.h
+++ b/llvm/include/llvm/Object/BuildID.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace object {
diff --git a/llvm/include/llvm/Object/COFF.h b/llvm/include/llvm/Object/COFF.h
index e6a607921da0efc..a2fb51913d73b46 100644
--- a/llvm/include/llvm/Object/COFF.h
+++ b/llvm/include/llvm/Object/COFF.h
@@ -20,6 +20,7 @@
 #include "llvm/Object/Error.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Support/BinaryByteStream.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/ErrorHandling.h"
diff --git a/llvm/include/llvm/Object/COFFImportFile.h b/llvm/include/llvm/Object/COFFImportFile.h
index 3d148112dcbb61f..a1e64c66d502a47 100644
--- a/llvm/include/llvm/Object/COFFImportFile.h
+++ b/llvm/include/llvm/Object/COFFImportFile.h
@@ -20,6 +20,7 @@
 #include "llvm/Object/COFF.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Object/SymbolicFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/Object/COFFModuleDefinition.h b/llvm/include/llvm/Object/COFFModuleDefinition.h
index a4ed9978dcc0a26..e8c5114f2ac11d1 100644
--- a/llvm/include/llvm/Object/COFFModuleDefinition.h
+++ b/llvm/include/llvm/Object/COFFModuleDefinition.h
@@ -20,6 +20,7 @@
 
 #include "llvm/BinaryFormat/COFF.h"
 #include "llvm/Object/COFFImportFile.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace object {
diff --git a/llvm/include/llvm/Object/CVDebugRecord.h b/llvm/include/llvm/Object/CVDebugRecord.h
index d41c7391f70199f..7db7b778f4431ce 100644
--- a/llvm/include/llvm/Object/CVDebugRecord.h
+++ b/llvm/include/llvm/Object/CVDebugRecord.h
@@ -10,6 +10,7 @@
 #define LLVM_OBJECT_CVDEBUGRECORD_H
 
 #include "llvm/Support/Endian.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace OMF {
diff --git a/llvm/include/llvm/Object/DXContainer.h b/llvm/include/llvm/Object/DXContainer.h
index 55371d14a368938..33aa18470af387e 100644
--- a/llvm/include/llvm/Object/DXContainer.h
+++ b/llvm/include/llvm/Object/DXContainer.h
@@ -20,6 +20,7 @@
 #include "llvm/BinaryFormat/DXContainer.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBufferRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 #include <variant>
 
diff --git a/llvm/include/llvm/Object/Decompressor.h b/llvm/include/llvm/Object/Decompressor.h
index d361b3fba81da19..a51fa8691635b8c 100644
--- a/llvm/include/llvm/Object/Decompressor.h
+++ b/llvm/include/llvm/Object/Decompressor.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Compression.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index a1cf47a1c4a6173..2119c9b54566e85 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -21,6 +21,7 @@
 #include "llvm/BinaryFormat/ELF.h"
 #include "llvm/Object/ELFTypes.h"
 #include "llvm/Object/Error.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cassert>
diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h
index f3016cc141b0eda..152155fb8a27080 100644
--- a/llvm/include/llvm/Object/ELFObjectFile.h
+++ b/llvm/include/llvm/Object/ELFObjectFile.h
@@ -25,6 +25,7 @@
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Object/SymbolicFile.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ELFAttributeParser.h"
 #include "llvm/Support/ELFAttributes.h"
 #include "llvm/Support/Endian.h"
diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h
index 215313ee6f9b362..f8a698bb35a5364 100644
--- a/llvm/include/llvm/Object/ELFTypes.h
+++ b/llvm/include/llvm/Object/ELFTypes.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/ELF.h"
 #include "llvm/Object/Error.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MathExtras.h"
diff --git a/llvm/include/llvm/Object/Error.h b/llvm/include/llvm/Object/Error.h
index 8875fb6e1a2086c..d76df0494b22f69 100644
--- a/llvm/include/llvm/Object/Error.h
+++ b/llvm/include/llvm/Object/Error.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_OBJECT_ERROR_H
 #define LLVM_OBJECT_ERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <system_error>
 
diff --git a/llvm/include/llvm/Object/FaultMapParser.h b/llvm/include/llvm/Object/FaultMapParser.h
index 4d1f0397a0dd222..32f8075bb10b703 100644
--- a/llvm/include/llvm/Object/FaultMapParser.h
+++ b/llvm/include/llvm/Object/FaultMapParser.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_OBJECT_FAULTMAPPARSER_H
 #define LLVM_OBJECT_FAULTMAPPARSER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/Object/GOFF.h b/llvm/include/llvm/Object/GOFF.h
index f4aa04cd99fcf5d..ac1923b5a83fd31 100644
--- a/llvm/include/llvm/Object/GOFF.h
+++ b/llvm/include/llvm/Object/GOFF.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/BinaryFormat/GOFF.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/Object/GOFFObjectFile.h b/llvm/include/llvm/Object/GOFFObjectFile.h
index 6c7e9cf92e430ba..f99eb82cc096e4a 100644
--- a/llvm/include/llvm/Object/GOFFObjectFile.h
+++ b/llvm/include/llvm/Object/GOFFObjectFile.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/IndexedMap.h"
 #include "llvm/BinaryFormat/GOFF.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ConvertEBCDIC.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Endian.h"
diff --git a/llvm/include/llvm/Object/IRObjectFile.h b/llvm/include/llvm/Object/IRObjectFile.h
index 55d910fe970e831..d0e339192df11fe 100644
--- a/llvm/include/llvm/Object/IRObjectFile.h
+++ b/llvm/include/llvm/Object/IRObjectFile.h
@@ -17,6 +17,7 @@
 #include "llvm/Object/IRSymtab.h"
 #include "llvm/Object/ModuleSymbolTable.h"
 #include "llvm/Object/SymbolicFile.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Object/IRSymtab.h b/llvm/include/llvm/Object/IRSymtab.h
index 72a51ffa1022de2..0b7a2fccb2d0d47 100644
--- a/llvm/include/llvm/Object/IRSymtab.h
+++ b/llvm/include/llvm/Object/IRSymtab.h
@@ -30,6 +30,7 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/Object/SymbolicFile.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cassert>
diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h
index 54c876a8cb4f9fc..8ea599fbcde2082 100644
--- a/llvm/include/llvm/Object/MachO.h
+++ b/llvm/include/llvm/Object/MachO.h
@@ -25,6 +25,7 @@
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Object/SymbolicFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/MemoryBuffer.h"
diff --git a/llvm/include/llvm/Object/MachOUniversal.h b/llvm/include/llvm/Object/MachOUniversal.h
index 5e3a63e05dbf4c5..e94c7d56f953f6c 100644
--- a/llvm/include/llvm/Object/MachOUniversal.h
+++ b/llvm/include/llvm/Object/MachOUniversal.h
@@ -17,6 +17,7 @@
 #include "llvm/BinaryFormat/MachO.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/MachO.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Object/MachOUniversalWriter.h b/llvm/include/llvm/Object/MachOUniversalWriter.h
index 4004f25f3fb7ecc..2ead8ef6f4e2b9f 100644
--- a/llvm/include/llvm/Object/MachOUniversalWriter.h
+++ b/llvm/include/llvm/Object/MachOUniversalWriter.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/BinaryFormat/MachO.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <string>
diff --git a/llvm/include/llvm/Object/Minidump.h b/llvm/include/llvm/Object/Minidump.h
index e45d4de0090def7..71338087ff3540e 100644
--- a/llvm/include/llvm/Object/Minidump.h
+++ b/llvm/include/llvm/Object/Minidump.h
@@ -14,6 +14,7 @@
 #include "llvm/ADT/iterator.h"
 #include "llvm/BinaryFormat/Minidump.h"
 #include "llvm/Object/Binary.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Object/ModuleSymbolTable.h b/llvm/include/llvm/Object/ModuleSymbolTable.h
index 1134b98c2247e25..b84de8e02d11537 100644
--- a/llvm/include/llvm/Object/ModuleSymbolTable.h
+++ b/llvm/include/llvm/Object/ModuleSymbolTable.h
@@ -20,6 +20,7 @@
 #include "llvm/IR/Mangler.h"
 #include "llvm/Object/SymbolicFile.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <string>
 #include <utility>
diff --git a/llvm/include/llvm/Object/ObjectFile.h b/llvm/include/llvm/Object/ObjectFile.h
index 2b614185c694b63..01552f5d15f5601 100644
--- a/llvm/include/llvm/Object/ObjectFile.h
+++ b/llvm/include/llvm/Object/ObjectFile.h
@@ -23,6 +23,7 @@
 #include "llvm/Object/Error.h"
 #include "llvm/Object/SymbolicFile.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include "llvm/TargetParser/Triple.h"
diff --git a/llvm/include/llvm/Object/OffloadBinary.h b/llvm/include/llvm/Object/OffloadBinary.h
index 320a8e1f6d8ff90..0a6ebbc591b631e 100644
--- a/llvm/include/llvm/Object/OffloadBinary.h
+++ b/llvm/include/llvm/Object/OffloadBinary.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Object/Binary.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <memory>
diff --git a/llvm/include/llvm/Object/RelocationResolver.h b/llvm/include/llvm/Object/RelocationResolver.h
index 2acdf5ed2fe1a15..f5262137ae08010 100644
--- a/llvm/include/llvm/Object/RelocationResolver.h
+++ b/llvm/include/llvm/Object/RelocationResolver.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_OBJECT_RELOCATIONRESOLVER_H
 #define LLVM_OBJECT_RELOCATIONRESOLVER_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <utility>
 
diff --git a/llvm/include/llvm/Object/SymbolSize.h b/llvm/include/llvm/Object/SymbolSize.h
index 085623e35907d5f..6c372ddcfdeeca9 100644
--- a/llvm/include/llvm/Object/SymbolSize.h
+++ b/llvm/include/llvm/Object/SymbolSize.h
@@ -11,6 +11,7 @@
 #define LLVM_OBJECT_SYMBOLSIZE_H
 
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace object {
diff --git a/llvm/include/llvm/Object/SymbolicFile.h b/llvm/include/llvm/Object/SymbolicFile.h
index b13588c147d9b2b..8877019b950bd65 100644
--- a/llvm/include/llvm/Object/SymbolicFile.h
+++ b/llvm/include/llvm/Object/SymbolicFile.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/BinaryFormat/Magic.h"
 #include "llvm/Object/Binary.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/MemoryBufferRef.h"
diff --git a/llvm/include/llvm/Object/TapiFile.h b/llvm/include/llvm/Object/TapiFile.h
index 53889a3125cb1ac..5a0cde7b26cbf17 100644
--- a/llvm/include/llvm/Object/TapiFile.h
+++ b/llvm/include/llvm/Object/TapiFile.h
@@ -17,6 +17,7 @@
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Object/SymbolicFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include "llvm/TextAPI/Architecture.h"
diff --git a/llvm/include/llvm/Object/TapiUniversal.h b/llvm/include/llvm/Object/TapiUniversal.h
index fff66c28c1a4143..b5a3d5d748e741b 100644
--- a/llvm/include/llvm/Object/TapiUniversal.h
+++ b/llvm/include/llvm/Object/TapiUniversal.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Object/Binary.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include "llvm/TextAPI/Architecture.h"
diff --git a/llvm/include/llvm/Object/Wasm.h b/llvm/include/llvm/Object/Wasm.h
index 8dd8918ddf21d50..eb325bab7064528 100644
--- a/llvm/include/llvm/Object/Wasm.h
+++ b/llvm/include/llvm/Object/Wasm.h
@@ -23,6 +23,7 @@
 #include "llvm/MC/MCSymbolWasm.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <cstddef>
diff --git a/llvm/include/llvm/Object/WindowsMachineFlag.h b/llvm/include/llvm/Object/WindowsMachineFlag.h
index 05b8f0d52d3fdc2..443c73381c559b1 100644
--- a/llvm/include/llvm/Object/WindowsMachineFlag.h
+++ b/llvm/include/llvm/Object/WindowsMachineFlag.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_OBJECT_WINDOWSMACHINEFLAG_H
 #define LLVM_OBJECT_WINDOWSMACHINEFLAG_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class StringRef;
diff --git a/llvm/include/llvm/Object/WindowsResource.h b/llvm/include/llvm/Object/WindowsResource.h
index ec390a4814cca39..c229260bc857a57 100644
--- a/llvm/include/llvm/Object/WindowsResource.h
+++ b/llvm/include/llvm/Object/WindowsResource.h
@@ -34,6 +34,7 @@
 #include "llvm/Object/Error.h"
 #include "llvm/Support/BinaryByteStream.h"
 #include "llvm/Support/BinaryStreamReader.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
diff --git a/llvm/include/llvm/Object/XCOFFObjectFile.h b/llvm/include/llvm/Object/XCOFFObjectFile.h
index 1f8ba6f32634eee..db72da15faab48c 100644
--- a/llvm/include/llvm/Object/XCOFFObjectFile.h
+++ b/llvm/include/llvm/Object/XCOFFObjectFile.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/BinaryFormat/XCOFF.h"
 #include "llvm/Object/ObjectFile.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <limits>
 
diff --git a/llvm/include/llvm/ObjectYAML/ArchiveYAML.h b/llvm/include/llvm/ObjectYAML/ArchiveYAML.h
index c83c7ee56f1f9a5..542e32be0fb2311 100644
--- a/llvm/include/llvm/ObjectYAML/ArchiveYAML.h
+++ b/llvm/include/llvm/ObjectYAML/ArchiveYAML.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_OBJECTYAML_ARCHIVEYAML_H
 #define LLVM_OBJECTYAML_ARCHIVEYAML_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include "llvm/ObjectYAML/YAML.h"
 #include "llvm/ADT/MapVector.h"
diff --git a/llvm/include/llvm/ObjectYAML/COFFYAML.h b/llvm/include/llvm/ObjectYAML/COFFYAML.h
index 1d941ae7b1a3e39..811fe2b5930f862 100644
--- a/llvm/include/llvm/ObjectYAML/COFFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/COFFYAML.h
@@ -19,6 +19,7 @@
 #include "llvm/ObjectYAML/CodeViewYAMLTypeHashing.h"
 #include "llvm/ObjectYAML/CodeViewYAMLTypes.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <optional>
 #include <vector>
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h b/llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h
index 6c712956dfb5d67..a3c7d76f3cfb609 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h
@@ -19,6 +19,7 @@
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
 #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h b/llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h
index 7c05c9eea05edfd..b66629a9e1d1d32 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h
@@ -16,6 +16,7 @@
 
 #include "llvm/DebugInfo/CodeView/CodeView.h"
 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <memory>
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h b/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h
index 25ba27c7c7a2281..14d956b59f2de0b 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/CodeView/TypeHashing.h"
 #include "llvm/ObjectYAML/YAML.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h b/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h
index 04b5e0ba3aa1a09..822bb42cf74d24a 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
index ee421b2efc72bc2..e7dd82f6663f055 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
@@ -14,6 +14,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/TargetParser/Host.h"
diff --git a/llvm/include/llvm/ObjectYAML/DWARFYAML.h b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
index a70ddf3a180a2d0..5f0d2cd0454c599 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
 #include <optional>
diff --git a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
index 299c8bfaaa20cef..23970dae385f625 100644
--- a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/BinaryFormat/DXContainer.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
 #include <optional>
diff --git a/llvm/include/llvm/ObjectYAML/ELFYAML.h b/llvm/include/llvm/ObjectYAML/ELFYAML.h
index 1ba41232f552e3a..5396ef461adf7a8 100644
--- a/llvm/include/llvm/ObjectYAML/ELFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/ELFYAML.h
@@ -20,6 +20,7 @@
 #include "llvm/Object/ELFTypes.h"
 #include "llvm/ObjectYAML/DWARFYAML.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/ObjectYAML/MachOYAML.h b/llvm/include/llvm/ObjectYAML/MachOYAML.h
index ccb81f5702d0e3f..b29d46c61c4a180 100644
--- a/llvm/include/llvm/ObjectYAML/MachOYAML.h
+++ b/llvm/include/llvm/ObjectYAML/MachOYAML.h
@@ -19,6 +19,7 @@
 #include "llvm/BinaryFormat/MachO.h"
 #include "llvm/ObjectYAML/DWARFYAML.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
 #include <optional>
diff --git a/llvm/include/llvm/ObjectYAML/MinidumpYAML.h b/llvm/include/llvm/ObjectYAML/MinidumpYAML.h
index b0cee541cef206a..0621edecaff6114 100644
--- a/llvm/include/llvm/ObjectYAML/MinidumpYAML.h
+++ b/llvm/include/llvm/ObjectYAML/MinidumpYAML.h
@@ -12,6 +12,7 @@
 #include "llvm/BinaryFormat/Minidump.h"
 #include "llvm/Object/Minidump.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/ObjectYAML/ObjectYAML.h b/llvm/include/llvm/ObjectYAML/ObjectYAML.h
index b63607e6796b0b7..e9fa5a4d3995873 100644
--- a/llvm/include/llvm/ObjectYAML/ObjectYAML.h
+++ b/llvm/include/llvm/ObjectYAML/ObjectYAML.h
@@ -18,6 +18,7 @@
 #include "llvm/ObjectYAML/OffloadYAML.h"
 #include "llvm/ObjectYAML/WasmYAML.h"
 #include "llvm/ObjectYAML/XCOFFYAML.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <memory>
 
diff --git a/llvm/include/llvm/ObjectYAML/OffloadYAML.h b/llvm/include/llvm/ObjectYAML/OffloadYAML.h
index 95d64c6eca184ae..79dee0763c40e05 100644
--- a/llvm/include/llvm/ObjectYAML/OffloadYAML.h
+++ b/llvm/include/llvm/ObjectYAML/OffloadYAML.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/MapVector.h"
 #include "llvm/Object/OffloadBinary.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/ObjectYAML/WasmYAML.h b/llvm/include/llvm/ObjectYAML/WasmYAML.h
index 0f6c4f06665fb8d..666f71c0edfff38 100644
--- a/llvm/include/llvm/ObjectYAML/WasmYAML.h
+++ b/llvm/include/llvm/ObjectYAML/WasmYAML.h
@@ -19,6 +19,7 @@
 #include "llvm/BinaryFormat/Wasm.h"
 #include "llvm/ObjectYAML/YAML.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <memory>
 #include <vector>
diff --git a/llvm/include/llvm/ObjectYAML/XCOFFYAML.h b/llvm/include/llvm/ObjectYAML/XCOFFYAML.h
index f1e821fe5fa369f..0ba0fb3a19223fc 100644
--- a/llvm/include/llvm/ObjectYAML/XCOFFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/XCOFFYAML.h
@@ -14,6 +14,7 @@
 
 #include "llvm/BinaryFormat/XCOFF.h"
 #include "llvm/ObjectYAML/YAML.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <vector>
 
diff --git a/llvm/include/llvm/ObjectYAML/YAML.h b/llvm/include/llvm/ObjectYAML/YAML.h
index 3bf6527a7e2da6e..4b3afabd7edf013 100644
--- a/llvm/include/llvm/ObjectYAML/YAML.h
+++ b/llvm/include/llvm/ObjectYAML/YAML.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/ObjectYAML/yaml2obj.h b/llvm/include/llvm/ObjectYAML/yaml2obj.h
index 000da077bb18c6a..3aabd748bfb55c6 100644
--- a/llvm/include/llvm/ObjectYAML/yaml2obj.h
+++ b/llvm/include/llvm/ObjectYAML/yaml2obj.h
@@ -12,6 +12,7 @@
 #define LLVM_OBJECTYAML_YAML2OBJ_H
 
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Option/Arg.h b/llvm/include/llvm/Option/Arg.h
index 5a718438bf4a3ec..b9f52ed23a2482b 100644
--- a/llvm/include/llvm/Option/Arg.h
+++ b/llvm/include/llvm/Option/Arg.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Option/Option.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Option/ArgList.h b/llvm/include/llvm/Option/ArgList.h
index 310c8900af9ef52..a8b8b103dec08d5 100644
--- a/llvm/include/llvm/Option/ArgList.h
+++ b/llvm/include/llvm/Option/ArgList.h
@@ -19,6 +19,7 @@
 #include "llvm/Option/Arg.h"
 #include "llvm/Option/OptSpecifier.h"
 #include "llvm/Option/Option.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <cstddef>
 #include <initializer_list>
diff --git a/llvm/include/llvm/Option/OptSpecifier.h b/llvm/include/llvm/Option/OptSpecifier.h
index 7a5fcfb18b38862..8bcb02298e99a98 100644
--- a/llvm/include/llvm/Option/OptSpecifier.h
+++ b/llvm/include/llvm/Option/OptSpecifier.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_OPTION_OPTSPECIFIER_H
 #define LLVM_OPTION_OPTSPECIFIER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 namespace opt {
 
diff --git a/llvm/include/llvm/Option/OptTable.h b/llvm/include/llvm/Option/OptTable.h
index 6f3d6032e59ac56..90613e42cff2ec3 100644
--- a/llvm/include/llvm/Option/OptTable.h
+++ b/llvm/include/llvm/Option/OptTable.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Option/OptSpecifier.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/StringSaver.h"
 #include <cassert>
 #include <string>
diff --git a/llvm/include/llvm/Option/Option.h b/llvm/include/llvm/Option/Option.h
index 9b35e81cd99144b..ebc02dda55cd194 100644
--- a/llvm/include/llvm/Option/Option.h
+++ b/llvm/include/llvm/Option/Option.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Option/OptSpecifier.h"
 #include "llvm/Option/OptTable.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 #include <string>
diff --git a/llvm/include/llvm/Pass.h b/llvm/include/llvm/Pass.h
index 44b6dd95cc278c7..71ac3e1c864b78e 100644
--- a/llvm/include/llvm/Pass.h
+++ b/llvm/include/llvm/Pass.h
@@ -28,6 +28,7 @@
 #ifndef LLVM_PASS_H
 #define LLVM_PASS_H
 
+#include "llvm/Support/Compiler.h"
 #ifdef EXPENSIVE_CHECKS
 #include <cstdint>
 #endif
diff --git a/llvm/include/llvm/PassAnalysisSupport.h b/llvm/include/llvm/PassAnalysisSupport.h
index 4bed3cb55a901cf..cdf2bcd6f389de0 100644
--- a/llvm/include/llvm/PassAnalysisSupport.h
+++ b/llvm/include/llvm/PassAnalysisSupport.h
@@ -24,6 +24,7 @@
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <tuple>
 #include <utility>
diff --git a/llvm/include/llvm/PassInfo.h b/llvm/include/llvm/PassInfo.h
index 686fc044ebcb33a..4ecd5d9f05481e8 100644
--- a/llvm/include/llvm/PassInfo.h
+++ b/llvm/include/llvm/PassInfo.h
@@ -14,6 +14,7 @@
 #define LLVM_PASSINFO_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <vector>
 
diff --git a/llvm/include/llvm/PassRegistry.h b/llvm/include/llvm/PassRegistry.h
index 5d7f3a84a6be740..82b3346600f5742 100644
--- a/llvm/include/llvm/PassRegistry.h
+++ b/llvm/include/llvm/PassRegistry.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/RWMutex.h"
 #include <memory>
 #include <vector>
diff --git a/llvm/include/llvm/PassSupport.h b/llvm/include/llvm/PassSupport.h
index 774ece89bf01e24..99785a0c593f9a2 100644
--- a/llvm/include/llvm/PassSupport.h
+++ b/llvm/include/llvm/PassSupport.h
@@ -27,6 +27,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/PassInfo.h"
 #include "llvm/PassRegistry.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Threading.h"
 #include <functional>
diff --git a/llvm/include/llvm/Passes/OptimizationLevel.h b/llvm/include/llvm/Passes/OptimizationLevel.h
index d2c3fde4935fb0a..544f99ba63de05e 100644
--- a/llvm/include/llvm/Passes/OptimizationLevel.h
+++ b/llvm/include/llvm/Passes/OptimizationLevel.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_PASSES_OPTIMIZATIONLEVEL_H
 #define LLVM_PASSES_OPTIMIZATIONLEVEL_H
 
+#include "llvm/Support/Compiler.h"
 #include <assert.h>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Passes/PassBuilder.h b/llvm/include/llvm/Passes/PassBuilder.h
index b95fd41554bf283..f493d5f900daf5c 100644
--- a/llvm/include/llvm/Passes/PassBuilder.h
+++ b/llvm/include/llvm/Passes/PassBuilder.h
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/CGSCCPassManager.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Passes/OptimizationLevel.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/PGOOptions.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/Passes/StandardInstrumentations.h b/llvm/include/llvm/Passes/StandardInstrumentations.h
index 331130c6b22d990..380c3a95efe2feb 100644
--- a/llvm/include/llvm/Passes/StandardInstrumentations.h
+++ b/llvm/include/llvm/Passes/StandardInstrumentations.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/PassTimingInfo.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/TimeProfiler.h"
 #include "llvm/Transforms/IPO/SampleProfileProbe.h"
 
diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
index 326c1b0d33384e3..510199a2864ede7 100644
--- a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
+++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ProfileData/Coverage/CoverageMapping.h"
 #include "llvm/ProfileData/InstrProf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <cstddef>
diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h
index 14206755881b92e..a21c6cd68acea61 100644
--- a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h
+++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ProfileData/Coverage/CoverageMapping.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/ProfileData/GCOV.h b/llvm/include/llvm/ProfileData/GCOV.h
index 674260c81fa6a24..8d1de661172239e 100644
--- a/llvm/include/llvm/ProfileData/GCOV.h
+++ b/llvm/include/llvm/ProfileData/GCOV.h
@@ -21,6 +21,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/ProfileData/InstrProfCorrelator.h b/llvm/include/llvm/ProfileData/InstrProfCorrelator.h
index 2e26a21e8839ba9..5096693312df35f 100644
--- a/llvm/include/llvm/ProfileData/InstrProfCorrelator.h
+++ b/llvm/include/llvm/ProfileData/InstrProfCorrelator.h
@@ -14,6 +14,7 @@
 
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ProfileData/InstrProf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/YAMLTraits.h"
diff --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h
index 80c5284d8a7dde6..f0e811980b154fc 100644
--- a/llvm/include/llvm/ProfileData/InstrProfReader.h
+++ b/llvm/include/llvm/ProfileData/InstrProfReader.h
@@ -21,6 +21,7 @@
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/ProfileData/InstrProfCorrelator.h"
 #include "llvm/ProfileData/MemProf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/LineIterator.h"
diff --git a/llvm/include/llvm/ProfileData/InstrProfWriter.h b/llvm/include/llvm/ProfileData/InstrProfWriter.h
index e50705ee053eea8..9ba4e67ed1bd550 100644
--- a/llvm/include/llvm/ProfileData/InstrProfWriter.h
+++ b/llvm/include/llvm/ProfileData/InstrProfWriter.h
@@ -21,6 +21,7 @@
 #include "llvm/Object/BuildID.h"
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/ProfileData/MemProf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h b/llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h
index e634f9c223e1642..25951537e1d0597 100644
--- a/llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h
+++ b/llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_PROFILEDATA_ITANIUMMANGLINGCANONICALIZER_H
 #define LLVM_PROFILEDATA_ITANIUMMANGLINGCANONICALIZER_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h
index d0ba5b10be02e62..3f1e06738466469 100644
--- a/llvm/include/llvm/ProfileData/MemProf.h
+++ b/llvm/include/llvm/ProfileData/MemProf.h
@@ -6,6 +6,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/ProfileData/MemProfData.inc"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/EndianStream.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/ProfileData/ProfileCommon.h b/llvm/include/llvm/ProfileData/ProfileCommon.h
index eaab59484c947a7..7b0142a26b81a3e 100644
--- a/llvm/include/llvm/ProfileData/ProfileCommon.h
+++ b/llvm/include/llvm/ProfileData/ProfileCommon.h
@@ -18,6 +18,7 @@
 #include "llvm/IR/ProfileSummary.h"
 #include "llvm/ProfileData/InstrProf.h"
 #include "llvm/ProfileData/SampleProf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <algorithm>
 #include <cstdint>
diff --git a/llvm/include/llvm/ProfileData/RawMemProfReader.h b/llvm/include/llvm/ProfileData/RawMemProfReader.h
index 4141cfb42e0d96a..85b6d8bc7e144c2 100644
--- a/llvm/include/llvm/ProfileData/RawMemProfReader.h
+++ b/llvm/include/llvm/ProfileData/RawMemProfReader.h
@@ -23,6 +23,7 @@
 #include "llvm/ProfileData/InstrProfReader.h"
 #include "llvm/ProfileData/MemProf.h"
 #include "llvm/ProfileData/MemProfData.inc"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MemoryBuffer.h"
 
diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h
index 12cc1f2fd002b9e..309e0be6b5aa12b 100644
--- a/llvm/include/llvm/ProfileData/SampleProf.h
+++ b/llvm/include/llvm/ProfileData/SampleProf.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/MathExtras.h"
diff --git a/llvm/include/llvm/ProfileData/SampleProfReader.h b/llvm/include/llvm/ProfileData/SampleProfReader.h
index e14b0bfc7912aa1..6b115603774399d 100644
--- a/llvm/include/llvm/ProfileData/SampleProfReader.h
+++ b/llvm/include/llvm/ProfileData/SampleProfReader.h
@@ -233,6 +233,7 @@
 #include "llvm/ProfileData/GCOV.h"
 #include "llvm/ProfileData/SampleProf.h"
 #include "llvm/ProfileData/SymbolRemappingReader.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Discriminator.h"
 #include "llvm/Support/ErrorOr.h"
diff --git a/llvm/include/llvm/ProfileData/SampleProfWriter.h b/llvm/include/llvm/ProfileData/SampleProfWriter.h
index 1f19283ea1dd0a8..7495bdfb0aa71ae 100644
--- a/llvm/include/llvm/ProfileData/SampleProfWriter.h
+++ b/llvm/include/llvm/ProfileData/SampleProfWriter.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/ProfileSummary.h"
 #include "llvm/ProfileData/SampleProf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/ProfileData/SymbolRemappingReader.h b/llvm/include/llvm/ProfileData/SymbolRemappingReader.h
index 61d32134e981a8d..ecfe40c5755d4d5 100644
--- a/llvm/include/llvm/ProfileData/SymbolRemappingReader.h
+++ b/llvm/include/llvm/ProfileData/SymbolRemappingReader.h
@@ -61,6 +61,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ProfileData/ItaniumManglingCanonicalizer.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Remarks/BitstreamRemarkParser.h b/llvm/include/llvm/Remarks/BitstreamRemarkParser.h
index bfa60332d1a90ef..5c5edf20314a356 100644
--- a/llvm/include/llvm/Remarks/BitstreamRemarkParser.h
+++ b/llvm/include/llvm/Remarks/BitstreamRemarkParser.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Bitstream/BitstreamReader.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <array>
 #include <cstdint>
diff --git a/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h b/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h
index 623680033750831..cf26b3b9c95531f 100644
--- a/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h
+++ b/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h
@@ -17,6 +17,7 @@
 #include "llvm/Bitstream/BitstreamWriter.h"
 #include "llvm/Remarks/BitstreamRemarkContainer.h"
 #include "llvm/Remarks/RemarkSerializer.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Remarks/HotnessThresholdParser.h b/llvm/include/llvm/Remarks/HotnessThresholdParser.h
index 4cd0d2dff2fe640..737c8cde15fccd3 100644
--- a/llvm/include/llvm/Remarks/HotnessThresholdParser.h
+++ b/llvm/include/llvm/Remarks/HotnessThresholdParser.h
@@ -16,6 +16,7 @@
 #define LLVM_REMARKS_HOTNESSTHRESHOLDPARSER_H
 
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Remarks/Remark.h b/llvm/include/llvm/Remarks/Remark.h
index 2ac881be6196517..3cbe7b6e60f7af5 100644
--- a/llvm/include/llvm/Remarks/Remark.h
+++ b/llvm/include/llvm/Remarks/Remark.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <string>
 
diff --git a/llvm/include/llvm/Remarks/RemarkFormat.h b/llvm/include/llvm/Remarks/RemarkFormat.h
index 9c589eed44f3980..009c92a2376633b 100644
--- a/llvm/include/llvm/Remarks/RemarkFormat.h
+++ b/llvm/include/llvm/Remarks/RemarkFormat.h
@@ -14,6 +14,7 @@
 #define LLVM_REMARKS_REMARKFORMAT_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Remarks/RemarkLinker.h b/llvm/include/llvm/Remarks/RemarkLinker.h
index f538718941c5d45..cd1a4a6e93c2318 100644
--- a/llvm/include/llvm/Remarks/RemarkLinker.h
+++ b/llvm/include/llvm/Remarks/RemarkLinker.h
@@ -16,6 +16,7 @@
 #include "llvm/Remarks/Remark.h"
 #include "llvm/Remarks/RemarkFormat.h"
 #include "llvm/Remarks/RemarkStringTable.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <memory>
 #include <optional>
diff --git a/llvm/include/llvm/Remarks/RemarkParser.h b/llvm/include/llvm/Remarks/RemarkParser.h
index 1333c582eba4f83..fe3b323f0de37cf 100644
--- a/llvm/include/llvm/Remarks/RemarkParser.h
+++ b/llvm/include/llvm/Remarks/RemarkParser.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Remarks/RemarkFormat.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <memory>
 #include <optional>
diff --git a/llvm/include/llvm/Remarks/RemarkSerializer.h b/llvm/include/llvm/Remarks/RemarkSerializer.h
index f73135f4fbd3851..64361cd3afaf63f 100644
--- a/llvm/include/llvm/Remarks/RemarkSerializer.h
+++ b/llvm/include/llvm/Remarks/RemarkSerializer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Remarks/RemarkFormat.h"
 #include "llvm/Remarks/RemarkStringTable.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Remarks/RemarkStreamer.h b/llvm/include/llvm/Remarks/RemarkStreamer.h
index 5b1cc81cdbf5010..37c2b47046b9cd4 100644
--- a/llvm/include/llvm/Remarks/RemarkStreamer.h
+++ b/llvm/include/llvm/Remarks/RemarkStreamer.h
@@ -31,6 +31,7 @@
 #define LLVM_REMARKS_REMARKSTREAMER_H
 
 #include "llvm/Remarks/RemarkSerializer.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Regex.h"
 #include <memory>
diff --git a/llvm/include/llvm/Remarks/RemarkStringTable.h b/llvm/include/llvm/Remarks/RemarkStringTable.h
index fe302c64d17f0b3..351b23faaa56036 100644
--- a/llvm/include/llvm/Remarks/RemarkStringTable.h
+++ b/llvm/include/llvm/Remarks/RemarkStringTable.h
@@ -18,6 +18,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h b/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h
index d2a1db5791ae02f..95353e92d0a8df2 100644
--- a/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h
+++ b/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h
@@ -14,6 +14,7 @@
 #define LLVM_REMARKS_YAMLREMARKSERIALIZER_H
 
 #include "llvm/Remarks/RemarkSerializer.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/Support/AMDGPUMetadata.h b/llvm/include/llvm/Support/AMDGPUMetadata.h
index e0838a1f425ea5e..a0ab3992f702dad 100644
--- a/llvm/include/llvm/Support/AMDGPUMetadata.h
+++ b/llvm/include/llvm/Support/AMDGPUMetadata.h
@@ -16,6 +16,7 @@
 #define LLVM_SUPPORT_AMDGPUMETADATA_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <string>
 #include <system_error>
diff --git a/llvm/include/llvm/Support/ARMAttributeParser.h b/llvm/include/llvm/Support/ARMAttributeParser.h
index d1d953120ae7ed7..116f0403d19bc9b 100644
--- a/llvm/include/llvm/Support/ARMAttributeParser.h
+++ b/llvm/include/llvm/Support/ARMAttributeParser.h
@@ -12,6 +12,7 @@
 #include "ARMBuildAttributes.h"
 #include "ELFAttributeParser.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/ARMBuildAttributes.h b/llvm/include/llvm/Support/ARMBuildAttributes.h
index 35f8992ca932968..f99b729e7fce6d6 100644
--- a/llvm/include/llvm/Support/ARMBuildAttributes.h
+++ b/llvm/include/llvm/Support/ARMBuildAttributes.h
@@ -18,6 +18,7 @@
 #ifndef LLVM_SUPPORT_ARMBUILDATTRIBUTES_H
 #define LLVM_SUPPORT_ARMBUILDATTRIBUTES_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ELFAttributes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/ARMWinEH.h b/llvm/include/llvm/Support/ARMWinEH.h
index b6710cca95650df..25011a7c870065f 100644
--- a/llvm/include/llvm/Support/ARMWinEH.h
+++ b/llvm/include/llvm/Support/ARMWinEH.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_ARMWINEH_H
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/Alignment.h b/llvm/include/llvm/Support/Alignment.h
index 8d4a7e7ddce5f45..8153ec31e0cc7c0 100644
--- a/llvm/include/llvm/Support/Alignment.h
+++ b/llvm/include/llvm/Support/Alignment.h
@@ -21,6 +21,7 @@
 #ifndef LLVM_SUPPORT_ALIGNMENT_H_
 #define LLVM_SUPPORT_ALIGNMENT_H_
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <cassert>
 #include <optional>
diff --git a/llvm/include/llvm/Support/ArrayRecycler.h b/llvm/include/llvm/Support/ArrayRecycler.h
index 5256ce80c0282ce..69f542b10b95871 100644
--- a/llvm/include/llvm/Support/ArrayRecycler.h
+++ b/llvm/include/llvm/Support/ArrayRecycler.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/Automaton.h b/llvm/include/llvm/Support/Automaton.h
index c2b921311a8ceb4..e7c5e88e2cf4768 100644
--- a/llvm/include/llvm/Support/Automaton.h
+++ b/llvm/include/llvm/Support/Automaton.h
@@ -30,6 +30,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include <deque>
 #include <map>
 #include <memory>
diff --git a/llvm/include/llvm/Support/BLAKE3.h b/llvm/include/llvm/Support/BLAKE3.h
index 7b30dbccd173485..6c3b5492570aef3 100644
--- a/llvm/include/llvm/Support/BLAKE3.h
+++ b/llvm/include/llvm/Support/BLAKE3.h
@@ -16,6 +16,7 @@
 #include "llvm-c/blake3.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Support/BalancedPartitioning.h b/llvm/include/llvm/Support/BalancedPartitioning.h
index a8464ac0fe60e58..5e8cfe8091ef3e3 100644
--- a/llvm/include/llvm/Support/BalancedPartitioning.h
+++ b/llvm/include/llvm/Support/BalancedPartitioning.h
@@ -41,6 +41,7 @@
 
 #include "raw_ostream.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 
 #include <atomic>
 #include <condition_variable>
diff --git a/llvm/include/llvm/Support/Base64.h b/llvm/include/llvm/Support/Base64.h
index 3d96884749b32f4..77e41d58ad4878f 100644
--- a/llvm/include/llvm/Support/Base64.h
+++ b/llvm/include/llvm/Support/Base64.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_BASE64_H
 #define LLVM_SUPPORT_BASE64_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <string>
diff --git a/llvm/include/llvm/Support/BinaryByteStream.h b/llvm/include/llvm/Support/BinaryByteStream.h
index 474a8df3ab38170..5f2e996f981d412 100644
--- a/llvm/include/llvm/Support/BinaryByteStream.h
+++ b/llvm/include/llvm/Support/BinaryByteStream.h
@@ -14,6 +14,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/BinaryStream.h"
 #include "llvm/Support/BinaryStreamError.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FileOutputBuffer.h"
 #include "llvm/Support/MemoryBuffer.h"
diff --git a/llvm/include/llvm/Support/BinaryItemStream.h b/llvm/include/llvm/Support/BinaryItemStream.h
index eb512bf4721a8d3..bfdec2331d2bcf6 100644
--- a/llvm/include/llvm/Support/BinaryItemStream.h
+++ b/llvm/include/llvm/Support/BinaryItemStream.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/BinaryStream.h"
 #include "llvm/Support/BinaryStreamError.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/Support/BinaryStream.h b/llvm/include/llvm/Support/BinaryStream.h
index e87129d8c201f37..1a1546f82c7ef0e 100644
--- a/llvm/include/llvm/Support/BinaryStream.h
+++ b/llvm/include/llvm/Support/BinaryStream.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/Support/BinaryStreamError.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/Support/BinaryStreamArray.h b/llvm/include/llvm/Support/BinaryStreamArray.h
index ef2233c53ec2cc4..4dd27eb806d887d 100644
--- a/llvm/include/llvm/Support/BinaryStreamArray.h
+++ b/llvm/include/llvm/Support/BinaryStreamArray.h
@@ -26,6 +26,7 @@
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cassert>
 #include <cstdint>
diff --git a/llvm/include/llvm/Support/BinaryStreamError.h b/llvm/include/llvm/Support/BinaryStreamError.h
index cf6e034ffd2cebd..ad1f62f911b2289 100644
--- a/llvm/include/llvm/Support/BinaryStreamError.h
+++ b/llvm/include/llvm/Support/BinaryStreamError.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_BINARYSTREAMERROR_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <string>
diff --git a/llvm/include/llvm/Support/BinaryStreamReader.h b/llvm/include/llvm/Support/BinaryStreamReader.h
index 056d2a5036d6a43..885f6483beb9a87 100644
--- a/llvm/include/llvm/Support/BinaryStreamReader.h
+++ b/llvm/include/llvm/Support/BinaryStreamReader.h
@@ -14,6 +14,7 @@
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
diff --git a/llvm/include/llvm/Support/BinaryStreamRef.h b/llvm/include/llvm/Support/BinaryStreamRef.h
index 0cea224527ac50f..f00a018be01bef8 100644
--- a/llvm/include/llvm/Support/BinaryStreamRef.h
+++ b/llvm/include/llvm/Support/BinaryStreamRef.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/BinaryStream.h"
 #include "llvm/Support/BinaryStreamError.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
 #include <memory>
diff --git a/llvm/include/llvm/Support/BinaryStreamWriter.h b/llvm/include/llvm/Support/BinaryStreamWriter.h
index d3d5edbf69e5204..10ac2f49881f82a 100644
--- a/llvm/include/llvm/Support/BinaryStreamWriter.h
+++ b/llvm/include/llvm/Support/BinaryStreamWriter.h
@@ -14,6 +14,7 @@
 #include "llvm/Support/BinaryStreamArray.h"
 #include "llvm/Support/BinaryStreamError.h"
 #include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
 #include <cstdint>
diff --git a/llvm/include/llvm/Support/CFGDiff.h b/llvm/include/llvm/Support/CFGDiff.h
index c90b9aca78b514b..aa7e37f584c8be1 100644
--- a/llvm/include/llvm/Support/CFGDiff.h
+++ b/llvm/include/llvm/Support/CFGDiff.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/iterator.h"
 #include "llvm/ADT/iterator_range.h"
 #include "llvm/Support/CFGUpdate.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/type_traits.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/Support/CSKYAttributeParser.h b/llvm/include/llvm/Support/CSKYAttributeParser.h
index e926ebe5e306e3a..00cc50bfb4b66fa 100644
--- a/llvm/include/llvm/Support/CSKYAttributeParser.h
+++ b/llvm/include/llvm/Support/CSKYAttributeParser.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_CSKYATTRIBUTEPARSER_H
 
 #include "llvm/Support/CSKYAttributes.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ELFAttributeParser.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/CSKYAttributes.h b/llvm/include/llvm/Support/CSKYAttributes.h
index 723f2ceee8fb790..23c88b347179110 100644
--- a/llvm/include/llvm/Support/CSKYAttributes.h
+++ b/llvm/include/llvm/Support/CSKYAttributes.h
@@ -12,6 +12,7 @@
 #ifndef LLVM_SUPPORT_CSKYATTRIBUTES_H
 #define LLVM_SUPPORT_CSKYATTRIBUTES_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ELFAttributes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
index 17e148830a73f9a..de976636a2381e5 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_CACHEPRUNING_H
 #define LLVM_SUPPORT_CACHEPRUNING_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <chrono>
 #include <optional>
diff --git a/llvm/include/llvm/Support/Caching.h b/llvm/include/llvm/Support/Caching.h
index 4fa57cc92e51f7c..3182df35b357f3c 100644
--- a/llvm/include/llvm/Support/Caching.h
+++ b/llvm/include/llvm/Support/Caching.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_SUPPORT_CACHING_H
 #define LLVM_SUPPORT_CACHING_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/CodeGenCoverage.h b/llvm/include/llvm/Support/CodeGenCoverage.h
index 2acdd6a36a514c7..218fdd90ed81721 100644
--- a/llvm/include/llvm/Support/CodeGenCoverage.h
+++ b/llvm/include/llvm/Support/CodeGenCoverage.h
@@ -12,6 +12,7 @@
 #define LLVM_SUPPORT_CODEGENCOVERAGE_H
 
 #include "llvm/ADT/BitVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class MemoryBuffer;
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
index d2079fead66808c..4ed41480ba54ddb 100644
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/include/llvm/Support/CommandLine.h
@@ -27,6 +27,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/StringSaver.h"
diff --git a/llvm/include/llvm/Support/Compression.h b/llvm/include/llvm/Support/Compression.h
index c3ba3274d6ed87e..a144443345d8ed6 100644
--- 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/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/ConvertEBCDIC.h b/llvm/include/llvm/Support/ConvertEBCDIC.h
index ea761b31e022b74..2ec7404198ce787 100644
--- a/llvm/include/llvm/Support/ConvertEBCDIC.h
+++ b/llvm/include/llvm/Support/ConvertEBCDIC.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <system_error>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/CrashRecoveryContext.h b/llvm/include/llvm/Support/CrashRecoveryContext.h
index 26ddf97b3ef02ec..5374618f4b669a7 100644
--- 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/STLFunctionalExtras.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class CrashRecoveryContextCleanup;
diff --git a/llvm/include/llvm/Support/DJB.h b/llvm/include/llvm/Support/DJB.h
index 8a04a324a5dc6cc..b0826927f5afca6 100644
--- 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/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Support/DOTGraphTraits.h b/llvm/include/llvm/Support/DOTGraphTraits.h
index ffa9abe328c830b..0ffd36f699308c3 100644
--- a/llvm/include/llvm/Support/DOTGraphTraits.h
+++ b/llvm/include/llvm/Support/DOTGraphTraits.h
@@ -16,6 +16,7 @@
 #ifndef LLVM_SUPPORT_DOTGRAPHTRAITS_H
 #define LLVM_SUPPORT_DOTGRAPHTRAITS_H
 
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/DataExtractor.h b/llvm/include/llvm/Support/DataExtractor.h
index f4f5905d4bccd61..c3c0c5dce035761 100644
--- a/llvm/include/llvm/Support/DataExtractor.h
+++ b/llvm/include/llvm/Support/DataExtractor.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_DATAEXTRACTOR_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/Support/DebugCounter.h b/llvm/include/llvm/Support/DebugCounter.h
index 9fa4620ade3c8ff..b61c1cfa78ae9e8 100644
--- a/llvm/include/llvm/Support/DebugCounter.h
+++ b/llvm/include/llvm/Support/DebugCounter.h
@@ -46,6 +46,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/UniqueVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include <string>
 
diff --git a/llvm/include/llvm/Support/DivisionByConstantInfo.h b/llvm/include/llvm/Support/DivisionByConstantInfo.h
index caa0b35e7144757..3c172ca4ba9481e 100644
--- a/llvm/include/llvm/Support/DivisionByConstantInfo.h
+++ b/llvm/include/llvm/Support/DivisionByConstantInfo.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_DIVISIONBYCONSTANTINFO_H
 
 #include "llvm/ADT/APInt.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Support/Duration.h b/llvm/include/llvm/Support/Duration.h
index a5a0e2a3357aa8c..ab340627139647a 100644
--- a/llvm/include/llvm/Support/Duration.h
+++ b/llvm/include/llvm/Support/Duration.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_DURATION_H
 #define LLVM_SUPPORT_DURATION_H
 
+#include "llvm/Support/Compiler.h"
 #include <chrono>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/ELFAttributeParser.h b/llvm/include/llvm/Support/ELFAttributeParser.h
index 75ed82b3f683976..cf8e2e9f9888074 100644
--- a/llvm/include/llvm/Support/ELFAttributeParser.h
+++ b/llvm/include/llvm/Support/ELFAttributeParser.h
@@ -11,6 +11,7 @@
 
 #include "ELFAttributes.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/Error.h"
diff --git a/llvm/include/llvm/Support/ELFAttributes.h b/llvm/include/llvm/Support/ELFAttributes.h
index 295d0f46698124c..e2abe6537385286 100644
--- 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/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/EndianStream.h b/llvm/include/llvm/Support/EndianStream.h
index 8ff87d23e83b145..439c27b8f89a9ef 100644
--- a/llvm/include/llvm/Support/EndianStream.h
+++ b/llvm/include/llvm/Support/EndianStream.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/Support/ErrorOr.h b/llvm/include/llvm/Support/ErrorOr.h
index 97c7abe1f20c5e1..cc26a6b1033d166 100644
--- a/llvm/include/llvm/Support/ErrorOr.h
+++ b/llvm/include/llvm/Support/ErrorOr.h
@@ -16,6 +16,7 @@
 #define LLVM_SUPPORT_ERROROR_H
 
 #include "llvm/Support/AlignOf.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <system_error>
 #include <type_traits>
diff --git a/llvm/include/llvm/Support/FileCollector.h b/llvm/include/llvm/Support/FileCollector.h
index 232dc8658aa3828..00a492b91eec2fa 100644
--- a/llvm/include/llvm/Support/FileCollector.h
+++ b/llvm/include/llvm/Support/FileCollector.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringSet.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/VirtualFileSystem.h"
 #include <mutex>
 #include <string>
diff --git a/llvm/include/llvm/Support/FileOutputBuffer.h b/llvm/include/llvm/Support/FileOutputBuffer.h
index d4b73522115dbf5..ca59f8ec696dacb 100644
--- a/llvm/include/llvm/Support/FileOutputBuffer.h
+++ b/llvm/include/llvm/Support/FileOutputBuffer.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_FILEOUTPUTBUFFER_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Error.h"
 
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h
index 033482977a105ca..874cf1352b60f3d 100644
--- a/llvm/include/llvm/Support/FileSystem.h
+++ b/llvm/include/llvm/Support/FileSystem.h
@@ -30,6 +30,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Chrono.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
diff --git a/llvm/include/llvm/Support/FileSystem/UniqueID.h b/llvm/include/llvm/Support/FileSystem/UniqueID.h
index 0d5367236e8dcfc..ef3f2597393d772 100644
--- a/llvm/include/llvm/Support/FileSystem/UniqueID.h
+++ b/llvm/include/llvm/Support/FileSystem/UniqueID.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/Hashing.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <utility>
 
diff --git a/llvm/include/llvm/Support/FileUtilities.h b/llvm/include/llvm/Support/FileUtilities.h
index 9707724d631708b..0fd172732251cab 100644
--- a/llvm/include/llvm/Support/FileUtilities.h
+++ b/llvm/include/llvm/Support/FileUtilities.h
@@ -15,6 +15,7 @@
 #define LLVM_SUPPORT_FILEUTILITIES_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FileSystem.h"
 
diff --git a/llvm/include/llvm/Support/Format.h b/llvm/include/llvm/Support/Format.h
index 89b6ae35ba5de3f..b6900267c0de8ab 100644
--- a/llvm/include/llvm/Support/Format.h
+++ b/llvm/include/llvm/Support/Format.h
@@ -25,6 +25,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <cassert>
 #include <cstdio>
diff --git a/llvm/include/llvm/Support/FormatAdapters.h b/llvm/include/llvm/Support/FormatAdapters.h
index 495205d11748b4e..7a6fa97edaa01e4 100644
--- a/llvm/include/llvm/Support/FormatAdapters.h
+++ b/llvm/include/llvm/Support/FormatAdapters.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_FORMATADAPTERS_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FormatCommon.h"
 #include "llvm/Support/FormatVariadicDetails.h"
diff --git a/llvm/include/llvm/Support/FormatCommon.h b/llvm/include/llvm/Support/FormatCommon.h
index 3c119d12529aeed..337243eae1212ef 100644
--- a/llvm/include/llvm/Support/FormatCommon.h
+++ b/llvm/include/llvm/Support/FormatCommon.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_FORMATCOMMON_H
 
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FormatVariadicDetails.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/Support/FormatProviders.h b/llvm/include/llvm/Support/FormatProviders.h
index aa0773847161c12..1b916d493e21ff3 100644
--- a/llvm/include/llvm/Support/FormatProviders.h
+++ b/llvm/include/llvm/Support/FormatProviders.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FormatVariadicDetails.h"
 #include "llvm/Support/NativeFormatting.h"
 
diff --git a/llvm/include/llvm/Support/FormatVariadic.h b/llvm/include/llvm/Support/FormatVariadic.h
index ddd80d89f1cddd8..3ac46de25a714da 100644
--- a/llvm/include/llvm/Support/FormatVariadic.h
+++ b/llvm/include/llvm/Support/FormatVariadic.h
@@ -30,6 +30,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/FormatCommon.h"
 #include "llvm/Support/FormatProviders.h"
 #include "llvm/Support/FormatVariadicDetails.h"
diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h
index 068c327df396781..3f0938f73bca7ae 100644
--- a/llvm/include/llvm/Support/FormatVariadicDetails.h
+++ b/llvm/include/llvm/Support/FormatVariadicDetails.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 #include <type_traits>
diff --git a/llvm/include/llvm/Support/FormattedStream.h b/llvm/include/llvm/Support/FormattedStream.h
index 5f937cfa798408a..218c8def4872769 100644
--- a/llvm/include/llvm/Support/FormattedStream.h
+++ b/llvm/include/llvm/Support/FormattedStream.h
@@ -15,6 +15,7 @@
 #define LLVM_SUPPORT_FORMATTEDSTREAM_H
 
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <utility>
 
diff --git a/llvm/include/llvm/Support/GenericDomTree.h b/llvm/include/llvm/Support/GenericDomTree.h
index 62186a368e964df..e9a97beaec60732 100644
--- a/llvm/include/llvm/Support/GenericDomTree.h
+++ b/llvm/include/llvm/Support/GenericDomTree.h
@@ -31,6 +31,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/CFGDiff.h"
 #include "llvm/Support/CFGUpdate.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/Support/GenericDomTreeConstruction.h b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
index 2e7716cb0b4b88d..262ce60e4eee384 100644
--- a/llvm/include/llvm/Support/GenericDomTreeConstruction.h
+++ b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
@@ -42,6 +42,7 @@
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/GenericDomTree.h"
 #include <optional>
diff --git a/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h b/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h
index 5723fb58edcd826..dfb4179cb62f1cc 100644
--- a/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h
+++ b/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h
@@ -26,6 +26,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericDomTree.h"
 #include <queue>
 
diff --git a/llvm/include/llvm/Support/GenericLoopInfo.h b/llvm/include/llvm/Support/GenericLoopInfo.h
index ac4f2d7010b411e..7a35e723a6ce7cf 100644
--- a/llvm/include/llvm/Support/GenericLoopInfo.h
+++ b/llvm/include/llvm/Support/GenericLoopInfo.h
@@ -45,6 +45,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SetOperations.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericDomTree.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/GenericLoopInfoImpl.h b/llvm/include/llvm/Support/GenericLoopInfoImpl.h
index 85233d38f0f6db9..f157163c4195628 100644
--- a/llvm/include/llvm/Support/GenericLoopInfoImpl.h
+++ b/llvm/include/llvm/Support/GenericLoopInfoImpl.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/PostOrderIterator.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SetOperations.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericLoopInfo.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
index 9dda9f6cecf11f3..d9e0fae86a9bcbc 100644
--- a/llvm/include/llvm/Support/GlobPattern.h
+++ b/llvm/include/llvm/Support/GlobPattern.h
@@ -15,6 +15,7 @@
 #define LLVM_SUPPORT_GLOBPATTERN_H
 
 #include "llvm/ADT/BitVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <optional>
 #include <vector>
diff --git a/llvm/include/llvm/Support/GraphWriter.h b/llvm/include/llvm/Support/GraphWriter.h
index dfda605365de3c8..b768b95e0af1f15 100644
--- a/llvm/include/llvm/Support/GraphWriter.h
+++ b/llvm/include/llvm/Support/GraphWriter.h
@@ -25,6 +25,7 @@
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DOTGraphTraits.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/Support/HashBuilder.h b/llvm/include/llvm/Support/HashBuilder.h
index 04a7b2e7dc8ab26..6b3625b9cb71a20 100644
--- a/llvm/include/llvm/Support/HashBuilder.h
+++ b/llvm/include/llvm/Support/HashBuilder.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/Hashing.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/type_traits.h"
 
diff --git a/llvm/include/llvm/Support/InitLLVM.h b/llvm/include/llvm/Support/InitLLVM.h
index 172d13bf21a5581..b42441d645ba5bd 100644
--- a/llvm/include/llvm/Support/InitLLVM.h
+++ b/llvm/include/llvm/Support/InitLLVM.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/PrettyStackTrace.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/Support/InstructionCost.h b/llvm/include/llvm/Support/InstructionCost.h
index ada0b8962881d3c..258d6c3a62dc73c 100644
--- a/llvm/include/llvm/Support/InstructionCost.h
+++ b/llvm/include/llvm/Support/InstructionCost.h
@@ -18,6 +18,7 @@
 #ifndef LLVM_SUPPORT_INSTRUCTIONCOST_H
 #define LLVM_SUPPORT_INSTRUCTIONCOST_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <limits>
 #include <optional>
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
index a81881c52d6c960..e87cb01ebcab336 100644
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -50,6 +50,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/include/llvm/Support/KnownBits.h b/llvm/include/llvm/Support/KnownBits.h
index 8462aa11202d5d7..f99788ba6c80461 100644
--- a/llvm/include/llvm/Support/KnownBits.h
+++ b/llvm/include/llvm/Support/KnownBits.h
@@ -15,6 +15,7 @@
 #define LLVM_SUPPORT_KNOWNBITS_H
 
 #include "llvm/ADT/APInt.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/LEB128.h b/llvm/include/llvm/Support/LEB128.h
index a5d367279aefe64..878b04bd14d4d45 100644
--- 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/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/LineIterator.h b/llvm/include/llvm/Support/LineIterator.h
index fc6871baf99a65d..bae202522557ffb 100644
--- a/llvm/include/llvm/Support/LineIterator.h
+++ b/llvm/include/llvm/Support/LineIterator.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_LINEITERATOR_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include <iterator>
diff --git a/llvm/include/llvm/Support/LockFileManager.h b/llvm/include/llvm/Support/LockFileManager.h
index 92c7ceed6a929ff..af1c77760abacca 100644
--- a/llvm/include/llvm/Support/LockFileManager.h
+++ b/llvm/include/llvm/Support/LockFileManager.h
@@ -9,6 +9,7 @@
 #define LLVM_SUPPORT_LOCKFILEMANAGER_H
 
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <system_error>
 #include <utility> // for std::pair
diff --git a/llvm/include/llvm/Support/MD5.h b/llvm/include/llvm/Support/MD5.h
index fa2f477261dd905..59dda28760cca72 100644
--- a/llvm/include/llvm/Support/MD5.h
+++ b/llvm/include/llvm/Support/MD5.h
@@ -29,6 +29,7 @@
 #define LLVM_SUPPORT_MD5_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <array>
 #include <cstdint>
diff --git a/llvm/include/llvm/Support/MSP430AttributeParser.h b/llvm/include/llvm/Support/MSP430AttributeParser.h
index bc9b214944708f0..2fa350872237961 100644
--- a/llvm/include/llvm/Support/MSP430AttributeParser.h
+++ b/llvm/include/llvm/Support/MSP430AttributeParser.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_MSP430ATTRIBUTEPARSER_H
 #define LLVM_SUPPORT_MSP430ATTRIBUTEPARSER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ELFAttributeParser.h"
 #include "llvm/Support/MSP430Attributes.h"
 
diff --git a/llvm/include/llvm/Support/MSP430Attributes.h b/llvm/include/llvm/Support/MSP430Attributes.h
index fccd65e844c35d9..ebec10d15f02174 100644
--- a/llvm/include/llvm/Support/MSP430Attributes.h
+++ b/llvm/include/llvm/Support/MSP430Attributes.h
@@ -18,6 +18,7 @@
 #ifndef LLVM_SUPPORT_MSP430ATTRIBUTES_H
 #define LLVM_SUPPORT_MSP430ATTRIBUTES_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ELFAttributes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/MSVCErrorWorkarounds.h b/llvm/include/llvm/Support/MSVCErrorWorkarounds.h
index bf983dc1e406b9c..5424b2fd22c5b76 100644
--- a/llvm/include/llvm/Support/MSVCErrorWorkarounds.h
+++ b/llvm/include/llvm/Support/MSVCErrorWorkarounds.h
@@ -18,6 +18,7 @@
 #ifndef LLVM_SUPPORT_MSVCERRORWORKAROUNDS_H
 #define LLVM_SUPPORT_MSVCERRORWORKAROUNDS_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/MemoryBuffer.h b/llvm/include/llvm/Support/MemoryBuffer.h
index b3477f1db0e9a6c..0d5c1d91abb44bd 100644
--- a/llvm/include/llvm/Support/MemoryBuffer.h
+++ b/llvm/include/llvm/Support/MemoryBuffer.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/CBindingWrapping.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include <cstddef>
diff --git a/llvm/include/llvm/Support/MemoryBufferRef.h b/llvm/include/llvm/Support/MemoryBufferRef.h
index b38a1f3b65651af..994654c783cb0f8 100644
--- a/llvm/include/llvm/Support/MemoryBufferRef.h
+++ b/llvm/include/llvm/Support/MemoryBufferRef.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_MEMORYBUFFERREF_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Support/ModRef.h b/llvm/include/llvm/Support/ModRef.h
index 7687280111a1f86..daff3fda0941cc5 100644
--- a/llvm/include/llvm/Support/ModRef.h
+++ b/llvm/include/llvm/Support/ModRef.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/Sequence.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/Mutex.h b/llvm/include/llvm/Support/Mutex.h
index d61e3fd96efbecb..d835ea50ecc2b9b 100644
--- a/llvm/include/llvm/Support/Mutex.h
+++ b/llvm/include/llvm/Support/Mutex.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_MUTEX_H
 #define LLVM_SUPPORT_MUTEX_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Threading.h"
 #include <cassert>
 #include <mutex>
diff --git a/llvm/include/llvm/Support/OnDiskHashTable.h b/llvm/include/llvm/Support/OnDiskHashTable.h
index bb90d8fc3ac7d0f..ad5a94c15e3a157 100644
--- a/llvm/include/llvm/Support/OnDiskHashTable.h
+++ b/llvm/include/llvm/Support/OnDiskHashTable.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/EndianStream.h"
 #include "llvm/Support/MathExtras.h"
diff --git a/llvm/include/llvm/Support/OptimizedStructLayout.h b/llvm/include/llvm/Support/OptimizedStructLayout.h
index 619990d132beba6..f4574da70a3882d 100644
--- a/llvm/include/llvm/Support/OptimizedStructLayout.h
+++ b/llvm/include/llvm/Support/OptimizedStructLayout.h
@@ -37,6 +37,7 @@
 
 #include "llvm/Support/Alignment.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/PGOOptions.h b/llvm/include/llvm/Support/PGOOptions.h
index 35670c457745a5c..8214b844ab04508 100644
--- a/llvm/include/llvm/Support/PGOOptions.h
+++ b/llvm/include/llvm/Support/PGOOptions.h
@@ -15,6 +15,7 @@
 #define LLVM_SUPPORT_PGOOPTIONS_H
 
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/Parallel.h b/llvm/include/llvm/Support/Parallel.h
index 8170da98f15a8c4..701246ad570ad52 100644
--- a/llvm/include/llvm/Support/Parallel.h
+++ b/llvm/include/llvm/Support/Parallel.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/Threading.h"
diff --git a/llvm/include/llvm/Support/Path.h b/llvm/include/llvm/Support/Path.h
index ce69f32b6cc81ba..d5782b10709b624 100644
--- a/llvm/include/llvm/Support/Path.h
+++ b/llvm/include/llvm/Support/Path.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/Twine.h"
 #include "llvm/ADT/iterator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <iterator>
 
diff --git a/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h b/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h
index f94d18f62e9abd7..8ea7a17655bb02b 100644
--- a/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h
+++ b/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_PERTHREADBUMPPTRALLOCATOR_H
 
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Parallel.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
index 1b15f930bd87d97..78d47e724151930 100644
--- a/llvm/include/llvm/Support/PointerLikeTypeTraits.h
+++ b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
 #define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <cassert>
 #include <type_traits>
diff --git a/llvm/include/llvm/Support/Printable.h b/llvm/include/llvm/Support/Printable.h
index 8e76f01f6ba27f9..12e2129c637d495 100644
--- a/llvm/include/llvm/Support/Printable.h
+++ b/llvm/include/llvm/Support/Printable.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_PRINTABLE_H
 #define LLVM_SUPPORT_PRINTABLE_H
 
+#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <utility>
 
diff --git a/llvm/include/llvm/Support/Process.h b/llvm/include/llvm/Support/Process.h
index 83f1fcd8b2abca5..2e2d0a1595511fb 100644
--- a/llvm/include/llvm/Support/Process.h
+++ b/llvm/include/llvm/Support/Process.h
@@ -25,6 +25,7 @@
 #define LLVM_SUPPORT_PROCESS_H
 
 #include "llvm/Support/Chrono.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Program.h"
diff --git a/llvm/include/llvm/Support/Program.h b/llvm/include/llvm/Support/Program.h
index 4c1133e44a21c91..c7a541e46e8ba99 100644
--- a/llvm/include/llvm/Support/Program.h
+++ b/llvm/include/llvm/Support/Program.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/FileSystem.h"
 #include <chrono>
diff --git a/llvm/include/llvm/Support/RISCVAttributeParser.h b/llvm/include/llvm/Support/RISCVAttributeParser.h
index 305adffbe851e79..5ff943af96e0eec 100644
--- a/llvm/include/llvm/Support/RISCVAttributeParser.h
+++ b/llvm/include/llvm/Support/RISCVAttributeParser.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
 #define LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ELFAttributeParser.h"
 #include "llvm/Support/RISCVAttributes.h"
 
diff --git a/llvm/include/llvm/Support/RISCVAttributes.h b/llvm/include/llvm/Support/RISCVAttributes.h
index a8ce8f4d8daf452..781e5ff383ad448 100644
--- a/llvm/include/llvm/Support/RISCVAttributes.h
+++ b/llvm/include/llvm/Support/RISCVAttributes.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_SUPPORT_RISCVATTRIBUTES_H
 #define LLVM_SUPPORT_RISCVATTRIBUTES_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ELFAttributes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/RISCVISAInfo.h b/llvm/include/llvm/Support/RISCVISAInfo.h
index 6eb085c32b5b2fd..9870bfc2bcf30d4 100644
--- a/llvm/include/llvm/Support/RISCVISAInfo.h
+++ b/llvm/include/llvm/Support/RISCVISAInfo.h
@@ -10,6 +10,7 @@
 #define LLVM_SUPPORT_RISCVISAINFO_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 #include <map>
diff --git a/llvm/include/llvm/Support/RWMutex.h b/llvm/include/llvm/Support/RWMutex.h
index 984487f94c693cf..e6309fccbf7bac4 100644
--- a/llvm/include/llvm/Support/RWMutex.h
+++ b/llvm/include/llvm/Support/RWMutex.h
@@ -14,6 +14,7 @@
 #define LLVM_SUPPORT_RWMUTEX_H
 
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Threading.h"
 #include <cassert>
 #include <mutex>
diff --git a/llvm/include/llvm/Support/Recycler.h b/llvm/include/llvm/Support/Recycler.h
index bbd9ae321ae30c6..45ff199f4a0c25f 100644
--- a/llvm/include/llvm/Support/Recycler.h
+++ b/llvm/include/llvm/Support/Recycler.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/ilist.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
 
diff --git a/llvm/include/llvm/Support/RecyclingAllocator.h b/llvm/include/llvm/Support/RecyclingAllocator.h
index 2c29dacfe21272d..6be387f38b3555d 100644
--- a/llvm/include/llvm/Support/RecyclingAllocator.h
+++ b/llvm/include/llvm/Support/RecyclingAllocator.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_RECYCLINGALLOCATOR_H
 #define LLVM_SUPPORT_RECYCLINGALLOCATOR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Recycler.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/Regex.h b/llvm/include/llvm/Support/Regex.h
index ae4b9516f194e3a..0cac08055936c9d 100644
--- a/llvm/include/llvm/Support/Regex.h
+++ b/llvm/include/llvm/Support/Regex.h
@@ -17,6 +17,7 @@
 #define LLVM_SUPPORT_REGEX_H
 
 #include "llvm/ADT/BitmaskEnum.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 struct llvm_regex;
diff --git a/llvm/include/llvm/Support/SMLoc.h b/llvm/include/llvm/Support/SMLoc.h
index 60b052a3b86351a..d71258ebf993924 100644
--- a/llvm/include/llvm/Support/SMLoc.h
+++ b/llvm/include/llvm/Support/SMLoc.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_SMLOC_H
 #define LLVM_SUPPORT_SMLOC_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <optional>
 
diff --git a/llvm/include/llvm/Support/SMTAPI.h b/llvm/include/llvm/Support/SMTAPI.h
index 9389c96956dd137..970df1653adf2fc 100644
--- a/llvm/include/llvm/Support/SMTAPI.h
+++ b/llvm/include/llvm/Support/SMTAPI.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APSInt.h"
 #include "llvm/ADT/FoldingSet.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <memory>
 
diff --git a/llvm/include/llvm/Support/SaveAndRestore.h b/llvm/include/llvm/Support/SaveAndRestore.h
index 06cfdfffa0b7fe2..a137b04fceae3c0 100644
--- a/llvm/include/llvm/Support/SaveAndRestore.h
+++ b/llvm/include/llvm/Support/SaveAndRestore.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_SUPPORT_SAVEANDRESTORE_H
 #define LLVM_SUPPORT_SAVEANDRESTORE_H
 
+#include "llvm/Support/Compiler.h"
 #include <utility>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/ScaledNumber.h b/llvm/include/llvm/Support/ScaledNumber.h
index faf3ce351c3e522..4804f58c7a24ac3 100644
--- a/llvm/include/llvm/Support/ScaledNumber.h
+++ b/llvm/include/llvm/Support/ScaledNumber.h
@@ -21,6 +21,7 @@
 #ifndef LLVM_SUPPORT_SCALEDNUMBER_H
 #define LLVM_SUPPORT_SCALEDNUMBER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <algorithm>
 #include <cstdint>
diff --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h
index aaaed3f5ceac62a..a5b9c0308357ebd 100644
--- a/llvm/include/llvm/Support/ScopedPrinter.h
+++ b/llvm/include/llvm/Support/ScopedPrinter.h
@@ -14,6 +14,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/JSON.h"
diff --git a/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h b/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h
index f7f2d4e54e705d6..a730ce8cce223b9 100644
--- 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/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/Support/SourceMgr.h b/llvm/include/llvm/Support/SourceMgr.h
index eced4574c82e152..b01ece4840090cf 100644
--- a/llvm/include/llvm/Support/SourceMgr.h
+++ b/llvm/include/llvm/Support/SourceMgr.h
@@ -16,6 +16,7 @@
 #define LLVM_SUPPORT_SOURCEMGR_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/SMLoc.h"
 #include <vector>
diff --git a/llvm/include/llvm/Support/SpecialCaseList.h b/llvm/include/llvm/Support/SpecialCaseList.h
index b6d1b56a09623cc..77b0af06fb588ba 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList.h
@@ -53,6 +53,7 @@
 #define LLVM_SUPPORT_SPECIALCASELIST_H
 
 #include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Regex.h"
 #include <memory>
 #include <string>
diff --git a/llvm/include/llvm/Support/StringSaver.h b/llvm/include/llvm/Support/StringSaver.h
index fa9db30eae30c90..6d911c9b65cb5f7 100644
--- a/llvm/include/llvm/Support/StringSaver.h
+++ b/llvm/include/llvm/Support/StringSaver.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Support/SuffixTree.h b/llvm/include/llvm/Support/SuffixTree.h
index 4940fbbf308d8b7..7ab495e78e73b0d 100644
--- a/llvm/include/llvm/Support/SuffixTree.h
+++ b/llvm/include/llvm/Support/SuffixTree.h
@@ -34,6 +34,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SuffixTreeNode.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/SuffixTreeNode.h b/llvm/include/llvm/Support/SuffixTreeNode.h
index 7d0d1cf0c58b95f..96c1588782a2b02 100644
--- a/llvm/include/llvm/Support/SuffixTreeNode.h
+++ b/llvm/include/llvm/Support/SuffixTreeNode.h
@@ -26,6 +26,7 @@
 #ifndef LLVM_SUPPORT_SUFFIXTREE_NODE_H
 #define LLVM_SUPPORT_SUFFIXTREE_NODE_H
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Support/TarWriter.h b/llvm/include/llvm/Support/TarWriter.h
index 48d810ac65e3514..706324a603da502 100644
--- a/llvm/include/llvm/Support/TarWriter.h
+++ b/llvm/include/llvm/Support/TarWriter.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h
index 5e67a312d5c7b57..d25347f0d7d3809 100644
--- a/llvm/include/llvm/Support/ThreadPool.h
+++ b/llvm/include/llvm/Support/ThreadPool.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/RWMutex.h"
 #include "llvm/Support/Threading.h"
 #include "llvm/Support/thread.h"
diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h
index 454a65f70231f45..1305bcf6c0fab5e 100644
--- a/llvm/include/llvm/Support/TimeProfiler.h
+++ b/llvm/include/llvm/Support/TimeProfiler.h
@@ -77,6 +77,7 @@
 #define LLVM_SUPPORT_TIMEPROFILER_H
 
 #include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h
index 1a32832b6c65366..4edf63e42bca67c 100644
--- a/llvm/include/llvm/Support/Timer.h
+++ b/llvm/include/llvm/Support/Timer.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <cassert>
 #include <memory>
diff --git a/llvm/include/llvm/Support/ToolOutputFile.h b/llvm/include/llvm/Support/ToolOutputFile.h
index e3fb83fdfd2c3f9..8bf27c5dff5872a 100644
--- a/llvm/include/llvm/Support/ToolOutputFile.h
+++ b/llvm/include/llvm/Support/ToolOutputFile.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_TOOLOUTPUTFILE_H
 #define LLVM_SUPPORT_TOOLOUTPUTFILE_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/Support/Unicode.h b/llvm/include/llvm/Support/Unicode.h
index 861548728d4f854..6c343245c803c3c 100644
--- a/llvm/include/llvm/Support/Unicode.h
+++ b/llvm/include/llvm/Support/Unicode.h
@@ -15,6 +15,7 @@
 #define LLVM_SUPPORT_UNICODE_H
 
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <string>
 
diff --git a/llvm/include/llvm/Support/VersionTuple.h b/llvm/include/llvm/Support/VersionTuple.h
index 828a6db54708dfa..c40cb80ece7efa7 100644
--- a/llvm/include/llvm/Support/VersionTuple.h
+++ b/llvm/include/llvm/Support/VersionTuple.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/ADT/Hashing.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include <optional>
 #include <string>
diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
index 697343c7e763e57..879399a998f733d 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/Support/Chrono.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/FileSystem.h"
diff --git a/llvm/include/llvm/Support/Win64EH.h b/llvm/include/llvm/Support/Win64EH.h
index e84fd6d72bedbeb..f7c06d6c77bc3f5 100644
--- a/llvm/include/llvm/Support/Win64EH.h
+++ b/llvm/include/llvm/Support/Win64EH.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_SUPPORT_WIN64EH_H
 #define LLVM_SUPPORT_WIN64EH_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/Endian.h"
 
diff --git a/llvm/include/llvm/Support/WindowsError.h b/llvm/include/llvm/Support/WindowsError.h
index 19540522412438b..12624a2fab81e0b 100644
--- a/llvm/include/llvm/Support/WindowsError.h
+++ b/llvm/include/llvm/Support/WindowsError.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_SUPPORT_WINDOWSERROR_H
 #define LLVM_SUPPORT_WINDOWSERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include <system_error>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/WithColor.h b/llvm/include/llvm/Support/WithColor.h
index 205400592847661..5838013f2b1fd93 100644
--- 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/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h b/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
index 169b8e97986e154..43d73a1b9e78bf4 100644
--- a/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
+++ b/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
@@ -16,6 +16,7 @@
 #ifndef LLVM_SUPPORT_X86DISASSEMBLERDECODERCOMMON_H
 #define LLVM_SUPPORT_X86DISASSEMBLERDECODERCOMMON_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/YAMLParser.h b/llvm/include/llvm/Support/YAMLParser.h
index f4767641647c217..5280c0f9b94151a 100644
--- a/llvm/include/llvm/Support/YAMLParser.h
+++ b/llvm/include/llvm/Support/YAMLParser.h
@@ -38,6 +38,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include "llvm/Support/SourceMgr.h"
 #include <cassert>
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
index 3ed29821fa8f034..0ed4d02e319d01f 100644
--- a/llvm/include/llvm/Support/YAMLTraits.h
+++ b/llvm/include/llvm/Support/YAMLTraits.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/AlignOf.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/SMLoc.h"
 #include "llvm/Support/SourceMgr.h"
diff --git a/llvm/include/llvm/Support/circular_raw_ostream.h b/llvm/include/llvm/Support/circular_raw_ostream.h
index 17fb8fa0e476f67..859a575c362a7b8 100644
--- a/llvm/include/llvm/Support/circular_raw_ostream.h
+++ b/llvm/include/llvm/Support/circular_raw_ostream.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H
 #define LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/raw_os_ostream.h b/llvm/include/llvm/Support/raw_os_ostream.h
index c51a94da3a28d2c..3c9f4e94b1efb1b 100644
--- a/llvm/include/llvm/Support/raw_os_ostream.h
+++ b/llvm/include/llvm/Support/raw_os_ostream.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
 #define LLVM_SUPPORT_RAW_OS_OSTREAM_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <iosfwd>
 
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
index 1e01eb9ea19c418..ddbcb8d1c64ac37 100644
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <cassert>
 #include <cstddef>
diff --git a/llvm/include/llvm/Support/thread.h b/llvm/include/llvm/Support/thread.h
index 69c06c050aac5f2..01f7a6049fd0844 100644
--- a/llvm/include/llvm/Support/thread.h
+++ b/llvm/include/llvm/Support/thread.h
@@ -17,6 +17,7 @@
 #define LLVM_SUPPORT_THREAD_H
 
 #include "llvm/Config/llvm-config.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 #ifdef _WIN32
diff --git a/llvm/include/llvm/Support/xxhash.h b/llvm/include/llvm/Support/xxhash.h
index 6fd67ff9ce1c557..7e26fb663047acc 100644
--- a/llvm/include/llvm/Support/xxhash.h
+++ b/llvm/include/llvm/Support/xxhash.h
@@ -40,6 +40,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 uint64_t xxHash64(llvm::StringRef Data);
diff --git a/llvm/include/llvm/TableGen/Error.h b/llvm/include/llvm/TableGen/Error.h
index 2e639224c9c0312..93c1ee002571042 100644
--- a/llvm/include/llvm/TableGen/Error.h
+++ b/llvm/include/llvm/TableGen/Error.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_TABLEGEN_ERROR_H
 #define LLVM_TABLEGEN_ERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/TableGen/Record.h"
 
diff --git a/llvm/include/llvm/TableGen/Main.h b/llvm/include/llvm/TableGen/Main.h
index 4639ec756e9b173..c983da3c9201ab5 100644
--- a/llvm/include/llvm/TableGen/Main.h
+++ b/llvm/include/llvm/TableGen/Main.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_TABLEGEN_MAIN_H
 #define LLVM_TABLEGEN_MAIN_H
 
+#include "llvm/Support/Compiler.h"
 #include <functional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/TableGen/Parser.h b/llvm/include/llvm/TableGen/Parser.h
index 411259e4033cf01..36771d57eac6b32 100644
--- a/llvm/include/llvm/TableGen/Parser.h
+++ b/llvm/include/llvm/TableGen/Parser.h
@@ -14,6 +14,7 @@
 #define LLVM_TABLEGEN_PARSER_H
 
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 #include <vector>
 
diff --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h
index b77336a896fc4d7..d6d717c4679c6d9 100644
--- a/llvm/include/llvm/TableGen/Record.h
+++ b/llvm/include/llvm/TableGen/Record.h
@@ -23,6 +23,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/SMLoc.h"
 #include "llvm/Support/Timer.h"
diff --git a/llvm/include/llvm/TableGen/SetTheory.h b/llvm/include/llvm/TableGen/SetTheory.h
index 4cff688164b0c4f..146905451b2711a 100644
--- a/llvm/include/llvm/TableGen/SetTheory.h
+++ b/llvm/include/llvm/TableGen/SetTheory.h
@@ -51,6 +51,7 @@
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SMLoc.h"
 #include <map>
 #include <memory>
diff --git a/llvm/include/llvm/TableGen/StringMatcher.h b/llvm/include/llvm/TableGen/StringMatcher.h
index 795b7a6d41dcc6a..856a3cd7a689613 100644
--- a/llvm/include/llvm/TableGen/StringMatcher.h
+++ b/llvm/include/llvm/TableGen/StringMatcher.h
@@ -14,6 +14,7 @@
 #define LLVM_TABLEGEN_STRINGMATCHER_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 #include <utility>
 #include <vector>
diff --git a/llvm/include/llvm/TableGen/TableGenBackend.h b/llvm/include/llvm/TableGen/TableGenBackend.h
index 39f1e14bc950841..560927078e1343c 100644
--- a/llvm/include/llvm/TableGen/TableGenBackend.h
+++ b/llvm/include/llvm/TableGen/TableGenBackend.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ManagedStatic.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Target/CGPassBuilderOption.h b/llvm/include/llvm/Target/CGPassBuilderOption.h
index bf297ae498b2de5..08969ee7c22a910 100644
--- a/llvm/include/llvm/Target/CGPassBuilderOption.h
+++ b/llvm/include/llvm/Target/CGPassBuilderOption.h
@@ -15,6 +15,7 @@
 #define LLVM_TARGET_CGPASSBUILDEROPTION_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Target/TargetOptions.h"
 #include <optional>
 
diff --git a/llvm/include/llvm/Target/TargetIntrinsicInfo.h b/llvm/include/llvm/Target/TargetIntrinsicInfo.h
index dc59f11c8d9a136..ef571b15153e7db 100644
--- a/llvm/include/llvm/Target/TargetIntrinsicInfo.h
+++ b/llvm/include/llvm/Target/TargetIntrinsicInfo.h
@@ -14,6 +14,7 @@
 #define LLVM_TARGET_TARGETINTRINSICINFO_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Target/TargetLoweringObjectFile.h b/llvm/include/llvm/Target/TargetLoweringObjectFile.h
index 0c09cfe684783bf..4ebbf95466c9e37 100644
--- a/llvm/include/llvm/Target/TargetLoweringObjectFile.h
+++ b/llvm/include/llvm/Target/TargetLoweringObjectFile.h
@@ -16,6 +16,7 @@
 
 #include "llvm/MC/MCObjectFileInfo.h"
 #include "llvm/MC/MCRegister.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
index b6ba36fb09b1bce..7599aa7ff492d9f 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/include/llvm/Target/TargetMachine.h
@@ -18,6 +18,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/CodeGen.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/PGOOptions.h"
 #include "llvm/Target/CGPassBuilderOption.h"
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index d6d767f3d22c73e..ee6598fda4fbb7d 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/FloatingPointMode.h"
 #include "llvm/MC/MCTargetOptions.h"
+#include "llvm/Support/Compiler.h"
 
 #include <memory>
 
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index dc4cdfa8e90ac12..594f70a4e60a013 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/VersionTuple.h"
 #include <array>
 #include <vector>
diff --git a/llvm/include/llvm/TargetParser/ARMTargetParser.h b/llvm/include/llvm/TargetParser/ARMTargetParser.h
index 9a81415681fdb7a..a7c63f8ff469376 100644
--- a/llvm/include/llvm/TargetParser/ARMTargetParser.h
+++ b/llvm/include/llvm/TargetParser/ARMTargetParser.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/ARMBuildAttributes.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/ARMTargetParserCommon.h"
 #include <vector>
 
diff --git a/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h b/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h
index e3d9ffc1d4db52b..0e9bae86fed558f 100644
--- a/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h
+++ b/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h
@@ -14,6 +14,7 @@
 #define LLVM_TARGETPARSER_ARMTARGETPARSERCOMMON_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace ARM {
diff --git a/llvm/include/llvm/TargetParser/CSKYTargetParser.h b/llvm/include/llvm/TargetParser/CSKYTargetParser.h
index 4c4ec06f758a88e..5a9f95056801e37 100644
--- a/llvm/include/llvm/TargetParser/CSKYTargetParser.h
+++ b/llvm/include/llvm/TargetParser/CSKYTargetParser.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_TARGETPARSER_CSKYTARGETPARSER_H
 #define LLVM_TARGETPARSER_CSKYTARGETPARSER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 #include <vector>
 
diff --git a/llvm/include/llvm/TargetParser/Host.h b/llvm/include/llvm/TargetParser/Host.h
index af72045a8fe67fd..2c86d26c395ce7d 100644
--- a/llvm/include/llvm/TargetParser/Host.h
+++ b/llvm/include/llvm/TargetParser/Host.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_TARGETPARSER_HOST_H
 #define LLVM_TARGETPARSER_HOST_H
 
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/TargetParser/LoongArchTargetParser.h b/llvm/include/llvm/TargetParser/LoongArchTargetParser.h
index ff325a76d1356dc..b715a0078eca80a 100644
--- a/llvm/include/llvm/TargetParser/LoongArchTargetParser.h
+++ b/llvm/include/llvm/TargetParser/LoongArchTargetParser.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_TARGETPARSER_LOONGARCHTARGETPARSER_H
 #define LLVM_TARGETPARSER_LOONGARCHTARGETPARSER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 #include <vector>
 
diff --git a/llvm/include/llvm/TargetParser/RISCVTargetParser.h b/llvm/include/llvm/TargetParser/RISCVTargetParser.h
index a4cb7988eb398b7..d4ab3ad48439f23 100644
--- a/llvm/include/llvm/TargetParser/RISCVTargetParser.h
+++ b/llvm/include/llvm/TargetParser/RISCVTargetParser.h
@@ -15,6 +15,7 @@
 #define LLVM_TARGETPARSER_RISCVTARGETPARSER_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <vector>
 
 namespace llvm {
diff --git a/llvm/include/llvm/TargetParser/SubtargetFeature.h b/llvm/include/llvm/TargetParser/SubtargetFeature.h
index a898275c1493cc5..9f64929a669ff26 100644
--- a/llvm/include/llvm/TargetParser/SubtargetFeature.h
+++ b/llvm/include/llvm/TargetParser/SubtargetFeature.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <array>
 #include <initializer_list>
diff --git a/llvm/include/llvm/TargetParser/TargetParser.h b/llvm/include/llvm/TargetParser/TargetParser.h
index c91fafb9e1e79e7..c5712bf247f8666 100644
--- a/llvm/include/llvm/TargetParser/TargetParser.h
+++ b/llvm/include/llvm/TargetParser/TargetParser.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index e496f5dba393c11..6f8809bae8744fe 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -10,6 +10,7 @@
 #define LLVM_TARGETPARSER_TRIPLE_H
 
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/VersionTuple.h"
 
 // Some system headers or GCC predefined macros conflict with identifiers in
diff --git a/llvm/include/llvm/TargetParser/X86TargetParser.h b/llvm/include/llvm/TargetParser/X86TargetParser.h
index 7a302c3d6454176..1a0e05cd5e20d39 100644
--- a/llvm/include/llvm/TargetParser/X86TargetParser.h
+++ b/llvm/include/llvm/TargetParser/X86TargetParser.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 template <typename T> class SmallVectorImpl;
diff --git a/llvm/include/llvm/Testing/Annotations/Annotations.h b/llvm/include/llvm/Testing/Annotations/Annotations.h
index 4d38002f029de28..cba192d12bcb79d 100644
--- a/llvm/include/llvm/Testing/Annotations/Annotations.h
+++ b/llvm/include/llvm/Testing/Annotations/Annotations.h
@@ -11,6 +11,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <tuple>
 #include <vector>
 
diff --git a/llvm/include/llvm/Testing/Support/Error.h b/llvm/include/llvm/Testing/Support/Error.h
index 5ed8f11e6189b5d..6987b0c38e342d2 100644
--- a/llvm/include/llvm/Testing/Support/Error.h
+++ b/llvm/include/llvm/Testing/Support/Error.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_TESTING_SUPPORT_ERROR_H
 #define LLVM_TESTING_SUPPORT_ERROR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Testing/Support/SupportHelpers.h"
 
diff --git a/llvm/include/llvm/Testing/Support/SupportHelpers.h b/llvm/include/llvm/Testing/Support/SupportHelpers.h
index 95c2765027ba0e3..e82c413bea769f5 100644
--- a/llvm/include/llvm/Testing/Support/SupportHelpers.h
+++ b/llvm/include/llvm/Testing/Support/SupportHelpers.h
@@ -10,6 +10,7 @@
 #define LLVM_TESTING_SUPPORT_SUPPORTHELPERS_H
 
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
diff --git a/llvm/include/llvm/TextAPI/Architecture.h b/llvm/include/llvm/TextAPI/Architecture.h
index 978359995074b93..ece107731f1ceb3 100644
--- a/llvm/include/llvm/TextAPI/Architecture.h
+++ b/llvm/include/llvm/TextAPI/Architecture.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_TEXTAPI_ARCHITECTURE_H
 #define LLVM_TEXTAPI_ARCHITECTURE_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <utility>
 
diff --git a/llvm/include/llvm/TextAPI/ArchitectureSet.h b/llvm/include/llvm/TextAPI/ArchitectureSet.h
index f17cb74c91839bf..1555a047d0e7a42 100644
--- a/llvm/include/llvm/TextAPI/ArchitectureSet.h
+++ b/llvm/include/llvm/TextAPI/ArchitectureSet.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_TEXTAPI_ARCHITECTURESET_H
 #define LLVM_TEXTAPI_ARCHITECTURESET_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/TextAPI/Architecture.h"
 #include <cstddef>
 #include <iterator>
diff --git a/llvm/include/llvm/TextAPI/InterfaceFile.h b/llvm/include/llvm/TextAPI/InterfaceFile.h
index 7d20c6f6348607b..4431d07b02d5819 100644
--- a/llvm/include/llvm/TextAPI/InterfaceFile.h
+++ b/llvm/include/llvm/TextAPI/InterfaceFile.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TextAPI/ArchitectureSet.h"
 #include "llvm/TextAPI/PackedVersion.h"
 #include "llvm/TextAPI/Platform.h"
diff --git a/llvm/include/llvm/TextAPI/PackedVersion.h b/llvm/include/llvm/TextAPI/PackedVersion.h
index eafa5089673521b..983f7d1623efdef 100644
--- a/llvm/include/llvm/TextAPI/PackedVersion.h
+++ b/llvm/include/llvm/TextAPI/PackedVersion.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_TEXTAPI_PACKEDVERSION_H
 #define LLVM_TEXTAPI_PACKEDVERSION_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <string>
 #include <utility>
diff --git a/llvm/include/llvm/TextAPI/Platform.h b/llvm/include/llvm/TextAPI/Platform.h
index d828d9ac49f65fe..56938e85b219658 100644
--- a/llvm/include/llvm/TextAPI/Platform.h
+++ b/llvm/include/llvm/TextAPI/Platform.h
@@ -14,6 +14,7 @@
 
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/BinaryFormat/MachO.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/VersionTuple.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/TextAPI/Symbol.h b/llvm/include/llvm/TextAPI/Symbol.h
index 48627c3d893a285..ab62a2b2cb99153 100644
--- a/llvm/include/llvm/TextAPI/Symbol.h
+++ b/llvm/include/llvm/TextAPI/Symbol.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/BitmaskEnum.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/TextAPI/ArchitectureSet.h"
 #include "llvm/TextAPI/Target.h"
diff --git a/llvm/include/llvm/TextAPI/Target.h b/llvm/include/llvm/TextAPI/Target.h
index edcc0708d147892..a889cb6f9934f9e 100644
--- a/llvm/include/llvm/TextAPI/Target.h
+++ b/llvm/include/llvm/TextAPI/Target.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_TEXTAPI_TARGET_H
 #define LLVM_TEXTAPI_TARGET_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/VersionTuple.h"
 #include "llvm/TargetParser/Triple.h"
diff --git a/llvm/include/llvm/TextAPI/TextAPIReader.h b/llvm/include/llvm/TextAPI/TextAPIReader.h
index 389335312a74ed5..19f1a00cf883c0e 100644
--- a/llvm/include/llvm/TextAPI/TextAPIReader.h
+++ b/llvm/include/llvm/TextAPI/TextAPIReader.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_TEXTAPI_TEXTAPIREADER_H
 #define LLVM_TEXTAPI_TEXTAPIREADER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/TextAPI/TextAPIWriter.h b/llvm/include/llvm/TextAPI/TextAPIWriter.h
index 9bdaaf58d09f31e..9e24c069b80cc1b 100644
--- a/llvm/include/llvm/TextAPI/TextAPIWriter.h
+++ b/llvm/include/llvm/TextAPI/TextAPIWriter.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_TEXTAPI_TEXTAPIWRITER_H
 #define LLVM_TEXTAPI_TEXTAPIWRITER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class Error;
diff --git a/llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h b/llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
index d144f62f1cc1ad9..4d4e0128ecee112 100644
--- a/llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
+++ b/llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_TOOLDRIVERS_LLVM_DLLTOOL_DLLTOOLDRIVER_H
 #define LLVM_TOOLDRIVERS_LLVM_DLLTOOL_DLLTOOLDRIVER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 template <typename T> class ArrayRef;
 
diff --git a/llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h b/llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h
index 23a2fc348a89272..badfa57ddf8d6e0 100644
--- a/llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h
+++ b/llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_TOOLDRIVERS_LLVM_LIB_LIBDRIVER_H
 #define LLVM_TOOLDRIVERS_LLVM_LIB_LIBDRIVER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 template <typename T> class ArrayRef;
 
diff --git a/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h b/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h
index 2d76546316fafb1..c7d4124a0b3853e 100644
--- a/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h
+++ b/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_AGGRESSIVEINSTCOMBINE_AGGRESSIVEINSTCOMBINE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/CFGuard.h b/llvm/include/llvm/Transforms/CFGuard.h
index 86fcbc3c13e8b71..35ed6144dbe8f56 100644
--- a/llvm/include/llvm/Transforms/CFGuard.h
+++ b/llvm/include/llvm/Transforms/CFGuard.h
@@ -11,6 +11,8 @@
 #ifndef LLVM_TRANSFORMS_CFGUARD_H
 #define LLVM_TRANSFORMS_CFGUARD_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class FunctionPass;
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h b/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h
index 3000a38258f4fff..19c727952cfcc2e 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_COROUTINES_COROCLEANUP_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h b/llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h
index 86b0449b8713df4..6433072c332d825 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_COROUTINES_COROCONDITIONALWRAPPER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h b/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h
index d55dcc6dfa6db8e..71b312dbf5170e2 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h
@@ -18,6 +18,7 @@
 #define LLVM_TRANSFORMS_COROUTINES_COROEARLY_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroElide.h b/llvm/include/llvm/Transforms/Coroutines/CoroElide.h
index ff73cf20c5bf2a6..b458584374da5f0 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroElide.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroElide.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_COROUTINES_COROELIDE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h b/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
index a2be1099ff68fca..c0ce3cf648efb56 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/CGSCCPassManager.h"
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO.h b/llvm/include/llvm/Transforms/IPO.h
index 4995b000c454244..a509ea9ecadd0d0 100644
--- a/llvm/include/llvm/Transforms/IPO.h
+++ b/llvm/include/llvm/Transforms/IPO.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_IPO_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 #include <vector>
 
diff --git a/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h b/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h
index 252cfd4dc5f372a..6dac984a66bab81 100644
--- a/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h
+++ b/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_IPO_ALWAYSINLINER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h b/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h
index dee2759d854f7ae..f2cd083c37af40e 100644
--- a/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h
+++ b/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_IPO_ANNOTATION2METADATA_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h b/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
index 3865f098b8de065..60b8350f221af8f 100644
--- a/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
+++ b/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
@@ -12,6 +12,7 @@
 #include "llvm/Analysis/CGSCCPassManager.h"
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 834a8b0922d5841..1bd31cd558b7446 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -126,6 +126,7 @@
 #include "llvm/Support/Alignment.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DOTGraphTraits.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ModRef.h"
diff --git a/llvm/include/llvm/Transforms/IPO/BlockExtractor.h b/llvm/include/llvm/Transforms/IPO/BlockExtractor.h
index 6211027bd672a4c..b596e24732f1e67 100644
--- a/llvm/include/llvm/Transforms/IPO/BlockExtractor.h
+++ b/llvm/include/llvm/Transforms/IPO/BlockExtractor.h
@@ -18,6 +18,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class BasicBlock;
diff --git a/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h b/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h
index 782633799ede62b..89af01b7e8f2bbf 100644
--- a/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h
+++ b/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h
@@ -20,6 +20,7 @@
 #define LLVM_TRANSFORMS_IPO_CALLEDVALUEPROPAGATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/ConstantMerge.h b/llvm/include/llvm/Transforms/IPO/ConstantMerge.h
index 12d38b5f58fa0d2..1a3e0fd20f7aaa0 100644
--- a/llvm/include/llvm/Transforms/IPO/ConstantMerge.h
+++ b/llvm/include/llvm/Transforms/IPO/ConstantMerge.h
@@ -20,6 +20,7 @@
 #define LLVM_TRANSFORMS_IPO_CONSTANTMERGE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h b/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h
index d34a51081101803..709a63a4f8a2a70 100644
--- a/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h
+++ b/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_IPO_CROSSDSOCFI_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class CrossDSOCFIPass : public PassInfoMixin<CrossDSOCFIPass> {
diff --git a/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h b/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h
index 63e1ad043d49f62..1193946d20ed4a9 100644
--- a/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h
+++ b/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h
@@ -23,6 +23,7 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <set>
 #include <string>
diff --git a/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h b/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h
index 92c319b3cce30a2..4ddbc4ba0ae6f5a 100644
--- a/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h
+++ b/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_IPO_ELIMAVAILEXTERN_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h b/llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h
index f323c61483fd30a..47303a8e8618b1d 100644
--- a/llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h
+++ b/llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h
@@ -19,6 +19,7 @@
 #define LLVM_TRANSFORMS_IPO_EMBEDBITCODEPASS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/IPO/ExtractGV.h b/llvm/include/llvm/Transforms/IPO/ExtractGV.h
index 45e29ba9a3ecfea..df68ed63d176a72 100644
--- a/llvm/include/llvm/Transforms/IPO/ExtractGV.h
+++ b/llvm/include/llvm/Transforms/IPO/ExtractGV.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/SetVector.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h
index 52667e19bc88b35..d52e296e103797e 100644
--- a/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h
+++ b/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_IPO_FORCEFUNCTIONATTRS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h
index 6a21ff616d50670..320efbb22b20519 100644
--- a/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h
+++ b/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h
@@ -19,6 +19,7 @@
 #include "llvm/Analysis/CGSCCPassManager.h"
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/FunctionImport.h b/llvm/include/llvm/Transforms/IPO/FunctionImport.h
index 3e4b3eb30e77b27..aca2543c164ff79 100644
--- a/llvm/include/llvm/Transforms/IPO/FunctionImport.h
+++ b/llvm/include/llvm/Transforms/IPO/FunctionImport.h
@@ -15,6 +15,7 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <functional>
 #include <map>
diff --git a/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h b/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
index f780385f7f67dab..0dca5ae6697eae2 100644
--- a/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
+++ b/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
@@ -53,6 +53,7 @@
 #include "llvm/Analysis/InlineCost.h"
 #include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/IR/InstVisitor.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Scalar/SCCP.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/Transforms/Utils/SCCPSolver.h"
diff --git a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
index 92c30d4b54a2612..9072df72d12e372 100644
--- a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
+++ b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
@@ -21,6 +21,7 @@
 #include "llvm/ADT/SmallSet.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <unordered_map>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/IPO/GlobalOpt.h b/llvm/include/llvm/Transforms/IPO/GlobalOpt.h
index 48a861ff2cf8f48..f75c99c64343ecb 100644
--- a/llvm/include/llvm/Transforms/IPO/GlobalOpt.h
+++ b/llvm/include/llvm/Transforms/IPO/GlobalOpt.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_IPO_GLOBALOPT_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/GlobalSplit.h b/llvm/include/llvm/Transforms/IPO/GlobalSplit.h
index 690b23a2d78535a..e7f158cc55d08dd 100644
--- a/llvm/include/llvm/Transforms/IPO/GlobalSplit.h
+++ b/llvm/include/llvm/Transforms/IPO/GlobalSplit.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_IPO_GLOBALSPLIT_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h b/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h
index 8c3049fbaac468e..493073661a5492c 100644
--- a/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h
+++ b/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h
@@ -13,6 +13,7 @@
 #define LLVM_TRANSFORMS_IPO_HOTCOLDSPLITTING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/IROutliner.h b/llvm/include/llvm/Transforms/IPO/IROutliner.h
index 28970f7dcdf10e2..2f21deab0b56c91 100644
--- a/llvm/include/llvm/Transforms/IPO/IROutliner.h
+++ b/llvm/include/llvm/Transforms/IPO/IROutliner.h
@@ -43,6 +43,7 @@
 
 #include "llvm/Analysis/IRSimilarityIdentifier.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/InstructionCost.h"
 #include "llvm/Transforms/Utils/CodeExtractor.h"
 
diff --git a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h
index 8addf49fc0d81fa..68fadcd0989643e 100644
--- a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h
+++ b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_IPO_INFERFUNCTIONATTRS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/IPO/Inliner.h b/llvm/include/llvm/Transforms/IPO/Inliner.h
index 401aa2d3a0cc632..b9ab31191c47913 100644
--- a/llvm/include/llvm/Transforms/IPO/Inliner.h
+++ b/llvm/include/llvm/Transforms/IPO/Inliner.h
@@ -15,6 +15,7 @@
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/Internalize.h b/llvm/include/llvm/Transforms/IPO/Internalize.h
index ece5bfe77b79833..3ccef96f6ab4d3a 100644
--- a/llvm/include/llvm/Transforms/IPO/Internalize.h
+++ b/llvm/include/llvm/Transforms/IPO/Internalize.h
@@ -24,6 +24,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringSet.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/IPO/LoopExtractor.h b/llvm/include/llvm/Transforms/IPO/LoopExtractor.h
index aa697484d0e95eb..06971e7c8a2196f 100644
--- a/llvm/include/llvm/Transforms/IPO/LoopExtractor.h
+++ b/llvm/include/llvm/Transforms/IPO/LoopExtractor.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h b/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
index eb682c437b94bca..105d7823afc346f 100644
--- a/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
+++ b/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <cstring>
 #include <limits>
diff --git a/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h b/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h
index f4c20a5749f0be1..88e3aa2722a73e9 100644
--- a/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h
+++ b/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h
@@ -20,6 +20,7 @@
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/IPO/MergeFunctions.h b/llvm/include/llvm/Transforms/IPO/MergeFunctions.h
index 822f0fd99188d00..67c17b2ebe6aeb0 100644
--- a/llvm/include/llvm/Transforms/IPO/MergeFunctions.h
+++ b/llvm/include/llvm/Transforms/IPO/MergeFunctions.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_IPO_MERGEFUNCTIONS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/ModuleInliner.h b/llvm/include/llvm/Transforms/IPO/ModuleInliner.h
index 24cfff6083ffb3a..def16aecc095800 100644
--- a/llvm/include/llvm/Transforms/IPO/ModuleInliner.h
+++ b/llvm/include/llvm/Transforms/IPO/ModuleInliner.h
@@ -12,6 +12,7 @@
 #include "llvm/Analysis/InlineAdvisor.h"
 #include "llvm/Analysis/InlineCost.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h b/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
index 4ab0035f3b42001..0039c9678fc5086 100644
--- a/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
+++ b/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
@@ -12,6 +12,7 @@
 #include "llvm/Analysis/CGSCCPassManager.h"
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/PartialInlining.h b/llvm/include/llvm/Transforms/IPO/PartialInlining.h
index 3b8297d6598756a..a56beeb6d0b2dbe 100644
--- a/llvm/include/llvm/Transforms/IPO/PartialInlining.h
+++ b/llvm/include/llvm/Transforms/IPO/PartialInlining.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_IPO_PARTIALINLINING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h b/llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h
index bc8360a80bc02bd..df9eff8128b66f4 100644
--- a/llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h
+++ b/llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h
@@ -14,6 +14,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ProfileData/SampleProf.h"
 #include "llvm/ProfileData/SampleProfReader.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/IPO/SampleContextTracker.h"
 #include <queue>
 #include <set>
diff --git a/llvm/include/llvm/Transforms/IPO/SCCP.h b/llvm/include/llvm/Transforms/IPO/SCCP.h
index 980737253eef511..dbb59e16a8d1a7f 100644
--- a/llvm/include/llvm/Transforms/IPO/SCCP.h
+++ b/llvm/include/llvm/Transforms/IPO/SCCP.h
@@ -21,6 +21,7 @@
 #define LLVM_TRANSFORMS_IPO_SCCP_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h b/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
index 347dac1e9684db1..24d0b71b7e4fbdb 100644
--- a/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
+++ b/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/ProfileData/SampleProf.h"
+#include "llvm/Support/Compiler.h"
 #include <map>
 #include <queue>
 #include <vector>
diff --git a/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h b/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
index 601fe6ce8a2e25b..fccfcb3ab62313e 100644
--- a/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
+++ b/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
@@ -19,6 +19,7 @@
 #include "llvm/Analysis/LazyCallGraph.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/ProfileData/SampleProf.h"
+#include "llvm/Support/Compiler.h"
 #include <unordered_map>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h b/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h
index 4a2eaad63113e26..7947bb7acf0cf13 100644
--- a/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h
+++ b/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_IPO_STRIPDEADPROTOTYPES_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/StripSymbols.h b/llvm/include/llvm/Transforms/IPO/StripSymbols.h
index dd76d481d668c56..3e5425e3e3d5bdc 100644
--- a/llvm/include/llvm/Transforms/IPO/StripSymbols.h
+++ b/llvm/include/llvm/Transforms/IPO/StripSymbols.h
@@ -23,6 +23,7 @@
 #define LLVM_TRANSFORMS_IPO_STRIPSYMBOLS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h b/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h
index 5338ac9b0ebc575..36c3450b60e5f42 100644
--- a/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h
+++ b/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_IPO_SYNTHETICCOUNTSPROPAGATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h b/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
index 9bcb01c9dbe43e1..c48488d367af5e0 100644
--- a/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
+++ b/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_IPO_THINLTOBITCODEWRITER_H
 
 #include <llvm/IR/PassManager.h>
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h b/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
index 9e121d9c6f4ed10..89a569ae7f59481 100644
--- a/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
+++ b/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
@@ -16,6 +16,7 @@
 
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <map>
diff --git a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
index 3e1c6e0fcdc6ab5..6970937ab503296 100644
--- a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
+++ b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
@@ -19,6 +19,7 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 #define DEBUG_TYPE "instcombine"
 #include "llvm/Transforms/Utils/InstructionWorklist.h"
diff --git a/llvm/include/llvm/Transforms/Instrumentation.h b/llvm/include/llvm/Transforms/Instrumentation.h
index 392983a19844451..72a9d09a019864e 100644
--- a/llvm/include/llvm/Transforms/Instrumentation.h
+++ b/llvm/include/llvm/Transforms/Instrumentation.h
@@ -19,6 +19,7 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/Instruction.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 #include <limits>
diff --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
index ca54387306664c9..0cb701021ab407e 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/IR/PassManager.h"
 #include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
index 4affc11429016c9..1bbf120e3f5d84d 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
@@ -19,6 +19,7 @@
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Module.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/BlockCoverageInference.h b/llvm/include/llvm/Transforms/Instrumentation/BlockCoverageInference.h
index 12f236481b251e1..28e2f26432dd2fd 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/BlockCoverageInference.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/BlockCoverageInference.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SetVector.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h b/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
index b1b1ece3eff5a0c..e2703bd4cc6e50b 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_BOUNDSCHECKING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/CFGMST.h b/llvm/include/llvm/Transforms/Instrumentation/CFGMST.h
index 4d31898bb3147b6..66530a3e7da0b9d 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/CFGMST.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/CFGMST.h
@@ -20,6 +20,7 @@
 #include "llvm/Analysis/BranchProbabilityInfo.h"
 #include "llvm/Analysis/CFG.h"
 #include "llvm/Support/BranchProbability.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
diff --git a/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h b/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h
index 9f9ce42277a0c12..561dd7a53e98c15 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h
@@ -13,6 +13,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_CGPROFILE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h b/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
index 0bace514c361957..4f4ac2df4bba638 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_CONTROLHEIGHTREDUCTION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h
index 41ba05cd67f0c83..a1fcc401fdc5986 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h
@@ -9,6 +9,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_DATAFLOWSANITIZER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 #include <vector>
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h b/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h
index e5b4520f36a2fd4..42d337bb71dbb1b 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h
@@ -13,6 +13,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_GCOVPROFILER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Instrumentation.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
index 11ea66780d8c5d7..05c17195272f377 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h b/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h
index e3d75f675c93bc1..dc18f71b011faff 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h
@@ -12,6 +12,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_INSTRORDERFILE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h b/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
index cb0c055dcb74ae8..16da3bea77cef01 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
@@ -18,6 +18,7 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/ProfileData/InstrProf.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include <cstdint>
 #include <cstring>
diff --git a/llvm/include/llvm/Transforms/Instrumentation/KCFI.h b/llvm/include/llvm/Transforms/Instrumentation/KCFI.h
index 9caa644f4747eb7..1eb2def3482ab76 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/KCFI.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/KCFI.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_KCFI_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class KCFIPass : public PassInfoMixin<KCFIPass> {
diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h b/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
index 293133b29cd9f96..6fabbf783940f79 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
@@ -14,6 +14,7 @@
 
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
index 0984e8ec32656ac..c25d15756b139ee 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h b/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
index b497c0cc53afb26..66e4b72b2de2e56 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <string>
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h b/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h
index 4ec7ec809db7103..28e3af7c40f1e0b 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_POISONCHECKING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h b/llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h
index 800a1d583f8015c..140428cda4c88ec 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h
@@ -16,6 +16,7 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Instrumentation.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
index 89ab4fd114fccf8..d2e31eb78c4a783 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_SANITIZERCOVERAGE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/SpecialCaseList.h"
 #include "llvm/Support/VirtualFileSystem.h"
 #include "llvm/Transforms/Instrumentation.h"
diff --git a/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
index fd37130d5459682..cde17227cc1590a 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_INSTRUMENTATION_THREADSANITIZER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Transforms/ObjCARC.h b/llvm/include/llvm/Transforms/ObjCARC.h
index bd17c58e842eeb6..d675eca43874a91 100644
--- a/llvm/include/llvm/Transforms/ObjCARC.h
+++ b/llvm/include/llvm/Transforms/ObjCARC.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_OBJCARC_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index aaba710cfde61cc..ffbe70f6193dcd0 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_TRANSFORMS_SCALAR_H
 #define LLVM_TRANSFORMS_SCALAR_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/SimplifyCFGOptions.h"
 #include <functional>
 
diff --git a/llvm/include/llvm/Transforms/Scalar/ADCE.h b/llvm/include/llvm/Transforms/Scalar/ADCE.h
index 7d8b7ae68c00461..4b53757482d122f 100644
--- a/llvm/include/llvm/Transforms/Scalar/ADCE.h
+++ b/llvm/include/llvm/Transforms/Scalar/ADCE.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_SCALAR_ADCE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h b/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h
index 10b6e1c6a21b639..9c057fd6d7c2701 100644
--- a/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h
+++ b/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h
@@ -18,6 +18,7 @@
 #define LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h b/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h
index 45983ad9d57167a..66713f7cd2e94f8 100644
--- a/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h
+++ b/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_ANNOTATIONREMARKS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/BDCE.h b/llvm/include/llvm/Transforms/Scalar/BDCE.h
index 0763f31dfad45b9..c7df1ac9ca79b01 100644
--- a/llvm/include/llvm/Transforms/Scalar/BDCE.h
+++ b/llvm/include/llvm/Transforms/Scalar/BDCE.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_SCALAR_BDCE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h b/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h
index 661340f4598f130..0dc26db470aae05 100644
--- a/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h
+++ b/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_CALLSITESPLITTING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h b/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h
index e59734b92244080..94fa04582a80a3f 100644
--- a/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h
+++ b/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h
@@ -42,6 +42,7 @@
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <algorithm>
 #include <vector>
 
diff --git a/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h b/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h
index 544a6c2eae552ed..6db317bc2b90e4a 100644
--- a/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_CONSTRAINTELIMINATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h b/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h
index 25795de5d951fa2..9767d40e98e68c1 100644
--- a/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h
+++ b/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_CORRELATEDVALUEPROPAGATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/DCE.h b/llvm/include/llvm/Transforms/Scalar/DCE.h
index 8d1616a7b75dbc4..34c35000038015b 100644
--- a/llvm/include/llvm/Transforms/Scalar/DCE.h
+++ b/llvm/include/llvm/Transforms/Scalar/DCE.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_SCALAR_DCE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h b/llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h
index 4e9fbf65e16362a..b7b0824b67e4d22 100644
--- a/llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h
+++ b/llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_SCALAR_DFAJUMPTHREADING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h b/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h
index b66b0de90c790be..73e82c7c97aaba6 100644
--- a/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h
@@ -18,6 +18,7 @@
 #define LLVM_TRANSFORMS_SCALAR_DEADSTOREELIMINATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h b/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h
index 7401e02cb4ab455..bb490af353ea449 100644
--- a/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h
+++ b/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_DIVREMPAIRS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h b/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h
index 877d8145e746c0f..14a65c0d9919ee9 100644
--- a/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h
+++ b/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_EARLYCSE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/FlattenCFG.h b/llvm/include/llvm/Transforms/Scalar/FlattenCFG.h
index ff49a4ab7ceb16f..fdf5c09be42105a 100644
--- a/llvm/include/llvm/Transforms/Scalar/FlattenCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/FlattenCFG.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_FLATTENCFG_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 struct FlattenCFGPass : PassInfoMixin<FlattenCFGPass> {
diff --git a/llvm/include/llvm/Transforms/Scalar/Float2Int.h b/llvm/include/llvm/Transforms/Scalar/Float2Int.h
index 83be329bed60bab..63e0c3f24bf3277 100644
--- a/llvm/include/llvm/Transforms/Scalar/Float2Int.h
+++ b/llvm/include/llvm/Transforms/Scalar/Float2Int.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/SetVector.h"
 #include "llvm/IR/ConstantRange.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class DominatorTree;
diff --git a/llvm/include/llvm/Transforms/Scalar/GuardWidening.h b/llvm/include/llvm/Transforms/Scalar/GuardWidening.h
index fa03d5f678fd40b..5f9aba64d8bddad 100644
--- a/llvm/include/llvm/Transforms/Scalar/GuardWidening.h
+++ b/llvm/include/llvm/Transforms/Scalar/GuardWidening.h
@@ -17,6 +17,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h b/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h
index 4136c45e190519e..f5446e4767d2688 100644
--- a/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h
+++ b/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h
@@ -11,6 +11,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LPMUpdater;
diff --git a/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h b/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h
index b5d544f1149c6dd..9589919b06408e9 100644
--- a/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h
+++ b/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h
@@ -16,6 +16,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h b/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h
index 11fb80e494867af..291edd5a33e65a9 100644
--- a/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_INDUCTIVERANGECHECKELIMINATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h b/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h
index 9a56b073f1c6b65..f23143034d56b39 100644
--- a/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h
+++ b/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_INFERADDRESSSPACES_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h b/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h
index 09a4a95401d84cd..54b9c3e7f30f161 100644
--- a/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h
+++ b/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_INSTSIMPLIFYPASS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/JumpThreading.h b/llvm/include/llvm/Transforms/Scalar/JumpThreading.h
index 3364d7eaee42476..1ce6d4dcb25535f 100644
--- a/llvm/include/llvm/Transforms/Scalar/JumpThreading.h
+++ b/llvm/include/llvm/Transforms/Scalar/JumpThreading.h
@@ -22,6 +22,7 @@
 #include "llvm/Analysis/BranchProbabilityInfo.h"
 #include "llvm/Analysis/DomTreeUpdater.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <utility>
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LICM.h b/llvm/include/llvm/Transforms/Scalar/LICM.h
index f7dd40be47e588b..030196a2b3b9f55 100644
--- a/llvm/include/llvm/Transforms/Scalar/LICM.h
+++ b/llvm/include/llvm/Transforms/Scalar/LICM.h
@@ -35,6 +35,7 @@
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h b/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h
index 4d1f934ae91d72c..cc65792b0262959 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOOPACCESSANALYSISPRINTER_H
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h b/llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h
index 0c597bf295b2ec5..4c995f61fe81f97 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h
@@ -11,6 +11,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LPMUpdater;
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h b/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h
index d5e15ffff07509d..35ee3164aa6a8c3 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOOPDATAPREFETCH_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h b/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h
index 459a5cd3ece48c1..3ba4ac42b584f57 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h b/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h
index 1a82176490c50db..8a455c1b0225712 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOOPDISTRIBUTE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h b/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h
index 311b843e83b5147..e531c919a48ea56 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LPMUpdater;
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopFuse.h b/llvm/include/llvm/Transforms/Scalar/LoopFuse.h
index d3a02db6bd28d0f..4dc81f8133ddc22 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopFuse.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopFuse.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOOPFUSE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h b/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
index 0c6406d86185185..1766d481cd3fe06 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
@@ -17,6 +17,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h b/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h
index f6e86d11ed9561c..9c40b4a1bd2f6e6 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h b/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h
index 8fa14d747f5c05c..b76711a604bd1d6 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h
@@ -11,6 +11,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h b/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h
index 65b9aabb8f51893..40d19fa8f8c01e0 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOOPLOADELIMINATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
index c8c4d5e9a53922d..4515ab88996a763 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
@@ -41,6 +41,7 @@
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Analysis/LoopNestAnalysis.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/LCSSA.h"
 #include "llvm/Transforms/Utils/LoopSimplify.h"
 #include "llvm/Transforms/Utils/LoopUtils.h"
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPredication.h b/llvm/include/llvm/Transforms/Scalar/LoopPredication.h
index 83f5336034192e8..264189f988c1722 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopPredication.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopPredication.h
@@ -16,6 +16,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopReroll.h b/llvm/include/llvm/Transforms/Scalar/LoopReroll.h
index 496e8df85ea05d1..0e9a92d4b020832 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopReroll.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopReroll.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOOPREROLL_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Scalar/LoopPassManager.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopRotation.h b/llvm/include/llvm/Transforms/Scalar/LoopRotation.h
index cd108f7383e4c5c..89b8a4f35b3e840 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopRotation.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopRotation.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LPMUpdater;
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h
index 82c8a4406d00a3b..e35265f40291b34 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h
@@ -18,6 +18,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopSink.h b/llvm/include/llvm/Transforms/Scalar/LoopSink.h
index 26e50590a62572b..08736bad9750344 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopSink.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopSink.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOOPSINK_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h b/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h
index 5cf805bc49393a8..3f8269a68ab1843 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h
@@ -23,6 +23,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h b/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h
index 54f70d7ed4b3916..9a6b7bfc124d101 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h
@@ -11,6 +11,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LPMUpdater;
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h b/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h
index 8d8c2f254f02f44..696abf9cfd5c759 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h
@@ -12,6 +12,7 @@
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h b/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h
index 04e0012330da7d1..eee9ad538b0ec16 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h
@@ -11,6 +11,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LPMUpdater;
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h b/llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h
index 60bbf916fced4b0..b484a6679a988f5 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOWERATOMICPASS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h b/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h
index e8e404bb93d6e42..7747ed98cbd9646 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOWERCONSTANTINTRINSICS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h b/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
index 95ef0f73e8af5c7..61ca1a18f562e96 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOWEREXPECTINTRINSIC_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h b/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
index 0c885b957b0fbc7..cffe7ede71e4b8c 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOWERGUARDINTRINSIC_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h b/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h
index d44d297dd4ffc7c..0bcd681e8601a8e 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOWERMATRIXINTRINSICS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class LowerMatrixIntrinsicsPass
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h b/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h
index 81c6f00e27fdf22..d2a966390ab2a06 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_SCALAR_LOWERWIDENABLECONDITION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h b/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
index a20b31f3ab5e8cd..1e195a81ef22fde 100644
--- a/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
+++ b/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
@@ -34,6 +34,7 @@
 #define LLVM_TRANSFORMS_SCALAR_MAKEGUARDSEXPLICIT_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h b/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h
index 9ce64623e25b274..e8c5da6d67b16db 100644
--- a/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h
+++ b/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h
@@ -16,6 +16,7 @@
 
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/MergeICmps.h b/llvm/include/llvm/Transforms/Scalar/MergeICmps.h
index 63bdbf8f4d095c5..287e4a8a484f508 100644
--- a/llvm/include/llvm/Transforms/Scalar/MergeICmps.h
+++ b/llvm/include/llvm/Transforms/Scalar/MergeICmps.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_MERGEICMPS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h b/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
index 71e11e59a4712d6..d7c60f500038c37 100644
--- a/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
+++ b/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
@@ -25,6 +25,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h b/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h
index f0474bc4352e36e..4614a9c7b2ac833 100644
--- a/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h
+++ b/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h
@@ -82,6 +82,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/NewGVN.h b/llvm/include/llvm/Transforms/Scalar/NewGVN.h
index 1f3680fec79cfd6..6b225cb8a171eb5 100644
--- a/llvm/include/llvm/Transforms/Scalar/NewGVN.h
+++ b/llvm/include/llvm/Transforms/Scalar/NewGVN.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_NEWGVN_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h b/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h
index b8a8fcc71e57c61..03964150d75278b 100644
--- a/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h
+++ b/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_SCALAR_PARTIALLYINLINELIBCALLS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h b/llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h
index 60ffe6e58b11b2f..a325d4181ad755d 100644
--- a/llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h
+++ b/llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h
@@ -51,6 +51,7 @@
 #define LLVM_TRANSFORMS_SCALAR_PLACESAFEPOINTS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/Reassociate.h b/llvm/include/llvm/Transforms/Scalar/Reassociate.h
index 28794d27325adec..e1888ba908d113b 100644
--- a/llvm/include/llvm/Transforms/Scalar/Reassociate.h
+++ b/llvm/include/llvm/Transforms/Scalar/Reassociate.h
@@ -27,6 +27,7 @@
 #include "llvm/ADT/SetVector.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include <deque>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h b/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h
index 25f6563d7dcfc2e..dc86c1bd51dd879 100644
--- a/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h
+++ b/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_SCALAR_REG2MEM_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h b/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
index 29845ce3b62da48..fc5a490dc8247f9 100644
--- a/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
+++ b/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_SCALAR_REWRITESTATEPOINTSFORGC_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/SCCP.h b/llvm/include/llvm/Transforms/Scalar/SCCP.h
index 7803f008c618b89..ae083bcb047d526 100644
--- a/llvm/include/llvm/Transforms/Scalar/SCCP.h
+++ b/llvm/include/llvm/Transforms/Scalar/SCCP.h
@@ -21,6 +21,7 @@
 #define LLVM_TRANSFORMS_SCALAR_SCCP_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Transforms/Scalar/SROA.h b/llvm/include/llvm/Transforms/Scalar/SROA.h
index b18e3054ef3ae4b..aa8f7e6abfd923c 100644
--- a/llvm/include/llvm/Transforms/Scalar/SROA.h
+++ b/llvm/include/llvm/Transforms/Scalar/SROA.h
@@ -21,6 +21,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include <variant>
 #include <vector>
 
diff --git a/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h b/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h
index 5e876fc82ac17e1..f5ea32121ebe6d7 100644
--- a/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h
+++ b/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_SCALAR_SCALARIZEMASKEDMEMINTRIN_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/Scalarizer.h b/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
index 5524b55b81b58a3..4acc490be70a7dd 100644
--- a/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
+++ b/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
@@ -19,6 +19,7 @@
 #define LLVM_TRANSFORMS_SCALAR_SCALARIZER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h b/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h
index 7b37eb7118a04f6..ca4a689d1e1a093 100644
--- a/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h
+++ b/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_SEPARATECONSTOFFSETFROMGEP_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h b/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
index 68c121560b13ee8..c0b34baa9fbf6ae 100644
--- a/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
+++ b/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
@@ -12,6 +12,7 @@
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
index 67db5031a443837..82bd2099af03e3d 100644
--- a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
@@ -16,6 +16,7 @@
 
 #include "llvm/IR/Function.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/SimplifyCFGOptions.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Scalar/Sink.h b/llvm/include/llvm/Transforms/Scalar/Sink.h
index 759153f22853d09..ea93197a071bab5 100644
--- a/llvm/include/llvm/Transforms/Scalar/Sink.h
+++ b/llvm/include/llvm/Transforms/Scalar/Sink.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_SCALAR_SINK_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h b/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h
index 0ec2a395f875e74..086dc76c22d45cb 100644
--- a/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h
+++ b/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h
@@ -63,6 +63,7 @@
 #define LLVM_TRANSFORMS_SCALAR_SPECULATIVEEXECUTION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class TargetTransformInfo;
diff --git a/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h b/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h
index 11233cc65efac5f..eda294a0720d353 100644
--- a/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h
+++ b/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_STRAIGHTLINESTRENGTHREDUCE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h b/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h
index 50d41acd529e769..8e8db441326c764 100644
--- a/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_SCALAR_STRUCTURIZECFG_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 struct StructurizeCFGPass : PassInfoMixin<StructurizeCFGPass> {
diff --git a/llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h b/llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h
index 2a1b02b40eebff7..95e67e79050c67a 100644
--- a/llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h
+++ b/llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h
@@ -65,6 +65,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h b/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h
index 57b1ed9bf4fe845..152ea060e86b326 100644
--- a/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h
@@ -53,6 +53,7 @@
 #define LLVM_TRANSFORMS_SCALAR_TAILRECURSIONELIMINATION_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h b/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h
index 8f8cad0aab6de3f..f809810cb98d4ae 100644
--- a/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h
+++ b/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_SCALAR_WARNMISSEDTRANSFORMS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 // New pass manager boilerplate.
diff --git a/llvm/include/llvm/Transforms/Utils.h b/llvm/include/llvm/Transforms/Utils.h
index 0fa6de3f67130a0..34f504aed71c7bf 100644
--- a/llvm/include/llvm/Transforms/Utils.h
+++ b/llvm/include/llvm/Transforms/Utils.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_H
 #define LLVM_TRANSFORMS_UTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class ModulePass;
diff --git a/llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h b/llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h
index 55e92c37a167616..6627fb8f24b2bb7 100644
--- a/llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h
+++ b/llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_UTILS_AMDGPUEMITPRINTF_H
 
 #include "llvm/IR/IRBuilder.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h b/llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h
index f87588db4ee2a77..7e437e1ff663cc9 100644
--- a/llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h
+++ b/llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h
@@ -13,6 +13,7 @@
 #define LLVM_TRANSFORMS_UTILS_ASANSTACKFRAMELAYOUT_H
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h b/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h
index 0aee2fe95cad3e6..cb739e8b0ea9076 100644
--- a/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h
+++ b/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_UTILS_ADDDISCRIMINATORS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
index 7c3c8eb8d6a44e9..6312855d1877ce1 100644
--- a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
+++ b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
@@ -18,6 +18,7 @@
 
 #include "llvm/Analysis/AssumeBundleQueries.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class AssumeInst;
diff --git a/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h b/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
index d65c2fe5fe6b38e..713788bf2657e97 100644
--- a/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/SetVector.h"
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/Dominators.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h b/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h
index 6de080ce31281c5..3223c26092b70c1 100644
--- a/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h
+++ b/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h
@@ -18,6 +18,7 @@
 #define LLVM_TRANSFORMS_UTILS_BREAKCRITICALEDGES_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h b/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
index 429970cbe3042c1..1a0dafe127888ce 100644
--- a/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
+++ b/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_UTILS_BUILDLIBCALLS_H
 
 #include "llvm/Analysis/TargetLibraryInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
   class Value;
diff --git a/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h b/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h
index bd98c902d1ab422..abaff302fd21b18 100644
--- a/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h
+++ b/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h
@@ -20,6 +20,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DenseMapInfo.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h b/llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
index 7e6683fd0c8a224..f571ce542afee86 100644
--- a/llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
+++ b/llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
@@ -17,6 +17,7 @@
 
 #include "llvm/Analysis/CGSCCPassManager.h"
 #include "llvm/Analysis/LazyCallGraph.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h b/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
index fcb384ec361339d..159e53f50c3c1c4 100644
--- a/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_CALLPROMOTIONUTILS_H
 #define LLVM_TRANSFORMS_UTILS_CALLPROMOTIONUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class CallBase;
 class CastInst;
diff --git a/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h b/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h
index 0bdc1a12d1fb0de..96414df506f8069 100644
--- a/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h
+++ b/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_UTILS_CANONICALIZEALIASES_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h b/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h
index 924b6cdf7ca0bdc..28418513df92ef0 100644
--- a/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h
+++ b/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Loop;
diff --git a/llvm/include/llvm/Transforms/Utils/Cloning.h b/llvm/include/llvm/Transforms/Utils/Cloning.h
index 1c342b871a4a45e..29ac1eddeec4a8f 100644
--- a/llvm/include/llvm/Transforms/Utils/Cloning.h
+++ b/llvm/include/llvm/Transforms/Utils/Cloning.h
@@ -22,6 +22,7 @@
 #include "llvm/Analysis/AssumptionCache.h"
 #include "llvm/Analysis/InlineCost.h"
 #include "llvm/IR/ValueHandle.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/ValueMapper.h"
 #include <functional>
 #include <memory>
diff --git a/llvm/include/llvm/Transforms/Utils/CodeExtractor.h b/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
index bb23cf4a9a3cbbb..f7ef661ba3fa88f 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SetVector.h"
+#include "llvm/Support/Compiler.h"
 #include <limits>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/CodeLayout.h b/llvm/include/llvm/Transforms/Utils/CodeLayout.h
index e8106e474332199..4a292088422c244 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeLayout.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeLayout.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_UTILS_CODELAYOUT_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Compiler.h"
 
 #include <vector>
 
diff --git a/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h b/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
index 0f32a97f9fccff4..212ae1f87f914b2 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_CODEMOVERUTILS_H
 #define LLVM_TRANSFORMS_UTILS_CODEMOVERUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class BasicBlock;
diff --git a/llvm/include/llvm/Transforms/Utils/CountVisits.h b/llvm/include/llvm/Transforms/Utils/CountVisits.h
index 7000afbc4985b7c..84926b714fd3528 100644
--- a/llvm/include/llvm/Transforms/Utils/CountVisits.h
+++ b/llvm/include/llvm/Transforms/Utils/CountVisits.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/StringMap.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/CtorUtils.h b/llvm/include/llvm/Transforms/Utils/CtorUtils.h
index 40b290a5a6f4e54..d1b9fe9386665a3 100644
--- a/llvm/include/llvm/Transforms/Utils/CtorUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/CtorUtils.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_UTILS_CTORUTILS_H
 
 #include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/Debugify.h b/llvm/include/llvm/Transforms/Utils/Debugify.h
index d4440942a64efa6..5a51d1f5c27ac01 100644
--- a/llvm/include/llvm/Transforms/Utils/Debugify.h
+++ b/llvm/include/llvm/Transforms/Utils/Debugify.h
@@ -22,6 +22,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 using DebugFnMap =
     llvm::MapVector<const llvm::Function *, const llvm::DISubprogram *>;
diff --git a/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h b/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h
index f2b038494a5db42..fe2775f69cca50f 100644
--- a/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h
+++ b/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_UTILS_ENTRYEXITINSTRUMENTER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h b/llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h
index 3d8447e9bf233f5..4c829dfabe1cd59 100644
--- a/llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h
+++ b/llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h
@@ -16,6 +16,7 @@
 
 #include "llvm/IR/Function.h"
 #include "llvm/IR/IRBuilder.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/Evaluator.h b/llvm/include/llvm/Transforms/Utils/Evaluator.h
index 5d53773b5d6b657..d87bdd26d1e1b06 100644
--- a/llvm/include/llvm/Transforms/Utils/Evaluator.h
+++ b/llvm/include/llvm/Transforms/Utils/Evaluator.h
@@ -19,6 +19,7 @@
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/GlobalVariable.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <deque>
 #include <memory>
diff --git a/llvm/include/llvm/Transforms/Utils/FixIrreducible.h b/llvm/include/llvm/Transforms/Utils/FixIrreducible.h
index 0c00b7bdbaf9a17..0d76879e9f489ef 100644
--- a/llvm/include/llvm/Transforms/Utils/FixIrreducible.h
+++ b/llvm/include/llvm/Transforms/Utils/FixIrreducible.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_UTILS_FIXIRREDUCIBLE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 struct FixIrreduciblePass : PassInfoMixin<FixIrreduciblePass> {
diff --git a/llvm/include/llvm/Transforms/Utils/FunctionComparator.h b/llvm/include/llvm/Transforms/Utils/FunctionComparator.h
index 78761fc78fee8c7..4239db35230ca4f 100644
--- a/llvm/include/llvm/Transforms/Utils/FunctionComparator.h
+++ b/llvm/include/llvm/Transforms/Utils/FunctionComparator.h
@@ -21,6 +21,7 @@
 #include "llvm/IR/ValueMap.h"
 #include "llvm/Support/AtomicOrdering.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <tuple>
 
diff --git a/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h b/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h
index 749b7b2bb5d8696..53c8a5b22051ce9 100644
--- a/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/SetVector.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Module;
diff --git a/llvm/include/llvm/Transforms/Utils/GlobalStatus.h b/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
index 60c91fc30174de3..6efa07f02cb9c4a 100644
--- a/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
+++ b/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
@@ -11,6 +11,7 @@
 
 #include "llvm/IR/Instructions.h"
 #include "llvm/Support/AtomicOrdering.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/GuardUtils.h b/llvm/include/llvm/Transforms/Utils/GuardUtils.h
index 7ab5d9ef4f23895..c3f49c0271fde0c 100644
--- a/llvm/include/llvm/Transforms/Utils/GuardUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/GuardUtils.h
@@ -12,6 +12,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_GUARDUTILS_H
 #define LLVM_TRANSFORMS_UTILS_GUARDUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class BranchInst;
diff --git a/llvm/include/llvm/Transforms/Utils/HelloWorld.h b/llvm/include/llvm/Transforms/Utils/HelloWorld.h
index e29dda54586e744..f4beb523d0cd277 100644
--- a/llvm/include/llvm/Transforms/Utils/HelloWorld.h
+++ b/llvm/include/llvm/Transforms/Utils/HelloWorld.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_UTILS_HELLOWORLD_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h b/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h
index b6c402402b17a0b..f2399ef10efb18d 100644
--- a/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h
+++ b/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_UTILS_INJECTTLIMAPPINGS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Function;
diff --git a/llvm/include/llvm/Transforms/Utils/InstructionNamer.h b/llvm/include/llvm/Transforms/Utils/InstructionNamer.h
index 4f4cc2666f10690..e7e92d792017c98 100644
--- a/llvm/include/llvm/Transforms/Utils/InstructionNamer.h
+++ b/llvm/include/llvm/Transforms/Utils/InstructionNamer.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_UTILS_INSTRUCTIONNAMER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 struct InstructionNamerPass : PassInfoMixin<InstructionNamerPass> {
diff --git a/llvm/include/llvm/Transforms/Utils/IntegerDivision.h b/llvm/include/llvm/Transforms/Utils/IntegerDivision.h
index 35cae9aa2269edc..aaf0c950d09df40 100644
--- a/llvm/include/llvm/Transforms/Utils/IntegerDivision.h
+++ b/llvm/include/llvm/Transforms/Utils/IntegerDivision.h
@@ -16,6 +16,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_INTEGERDIVISION_H
 #define LLVM_TRANSFORMS_UTILS_INTEGERDIVISION_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
   class BinaryOperator;
 }
diff --git a/llvm/include/llvm/Transforms/Utils/LCSSA.h b/llvm/include/llvm/Transforms/Utils/LCSSA.h
index b01c8022a65bc8c..a39e4a38cdf67c8 100644
--- a/llvm/include/llvm/Transforms/Utils/LCSSA.h
+++ b/llvm/include/llvm/Transforms/Utils/LCSSA.h
@@ -30,6 +30,7 @@
 #define LLVM_TRANSFORMS_UTILS_LCSSA_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h b/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h
index ff1537ace329ea4..960952ce1876562 100644
--- a/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h
+++ b/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h
@@ -12,6 +12,7 @@
 #define LLVM_TRANSFORMS_UTILS_LIBCALLSSHRINKWRAP_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h
index 4578af069814d02..b8fa1614eda7d47 100644
--- a/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/llvm/include/llvm/Transforms/Utils/Local.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/SimplifyCFGOptions.h"
 #include <cstdint>
 
diff --git a/llvm/include/llvm/Transforms/Utils/LoopPeel.h b/llvm/include/llvm/Transforms/Utils/LoopPeel.h
index 0b78700ca71bb92..e1f941c6f47f408 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopPeel.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopPeel.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
 
 #include "llvm/Analysis/TargetTransformInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/ValueMapper.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h b/llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h
index 61bf93b74a15a0e..79f38fad4a9f0d7 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h
@@ -13,6 +13,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
 #define LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class AssumptionCache;
diff --git a/llvm/include/llvm/Transforms/Utils/LoopSimplify.h b/llvm/include/llvm/Transforms/Utils/LoopSimplify.h
index d017fd12026d6a7..bbdc4c24191ec4b 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopSimplify.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopSimplify.h
@@ -39,6 +39,7 @@
 #define LLVM_TRANSFORMS_UTILS_LOOPSIMPLIFY_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/LoopUtils.h b/llvm/include/llvm/Transforms/Utils/LoopUtils.h
index c6864124e0bcbe7..004c994e4574f45 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopUtils.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Analysis/IVDescriptors.h"
 #include "llvm/Analysis/LoopAccessAnalysis.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/ValueMapper.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
index eeab98c56b66c16..8c4ec94a481f600 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/LoopUtils.h"
 #include "llvm/Transforms/Utils/ValueMapper.h"
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerAtomic.h b/llvm/include/llvm/Transforms/Utils/LowerAtomic.h
index b25b281667f9cb8..04c0bb8ed4afc1a 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerAtomic.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerAtomic.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_UTILS_LOWERATOMIC_H
 
 #include "llvm/IR/Instructions.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h b/llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h
index 993a6f57361ccfc..dc340b24e4b83f5 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_UTILS_LOWERGLOBALDTORS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerIFunc.h b/llvm/include/llvm/Transforms/Utils/LowerIFunc.h
index 87ddc18d7c063c0..f9438a99377b089 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerIFunc.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerIFunc.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_UTILS_LOWERIFUNC_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerInvoke.h b/llvm/include/llvm/Transforms/Utils/LowerInvoke.h
index c1198b08d3ded88..8a577ca7b625108 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerInvoke.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerInvoke.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_UTILS_LOWERINVOKE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h b/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h
index 314435324b473ba..94653e3201d4fe9 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_TRANSFORMS_UTILS_LOWERMEMINTRINSICS_H
 #define LLVM_TRANSFORMS_UTILS_LOWERMEMINTRINSICS_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <optional>
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerSwitch.h b/llvm/include/llvm/Transforms/Utils/LowerSwitch.h
index 97086987ffcbdfa..bdc8a9dbbedb63f 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerSwitch.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerSwitch.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_UTILS_LOWERSWITCH_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 struct LowerSwitchPass : public PassInfoMixin<LowerSwitchPass> {
diff --git a/llvm/include/llvm/Transforms/Utils/MatrixUtils.h b/llvm/include/llvm/Transforms/Utils/MatrixUtils.h
index ffad57002935e35..751d30a74ee96b2 100644
--- a/llvm/include/llvm/Transforms/Utils/MatrixUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/MatrixUtils.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_UTILS_MATRIXUTILS_H
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class DomTreeUpdater;
diff --git a/llvm/include/llvm/Transforms/Utils/Mem2Reg.h b/llvm/include/llvm/Transforms/Utils/Mem2Reg.h
index 76c1c2c5bffeca1..005aeb3213c3ad8 100644
--- a/llvm/include/llvm/Transforms/Utils/Mem2Reg.h
+++ b/llvm/include/llvm/Transforms/Utils/Mem2Reg.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_UTILS_MEM2REG_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h b/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
index fdb586e153ff917..bf40230ef4a7193 100644
--- a/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
+++ b/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Analysis/TargetLibraryInfo.h"
 #include "llvm/IR/DiagnosticInfo.h"
+#include "llvm/Support/Compiler.h"
 #include <optional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h b/llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h
index 990cf60a09c2704..183679d18f9a647 100644
--- a/llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h
+++ b/llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Analysis/StackSafetyAnalysis.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class DominatorTree;
diff --git a/llvm/include/llvm/Transforms/Utils/MetaRenamer.h b/llvm/include/llvm/Transforms/Utils/MetaRenamer.h
index fff3dff75837e0b..3dc8fb22a4d2448 100644
--- a/llvm/include/llvm/Transforms/Utils/MetaRenamer.h
+++ b/llvm/include/llvm/Transforms/Utils/MetaRenamer.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_UTILS_METARENAMER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 struct MetaRenamerPass : PassInfoMixin<MetaRenamerPass> {
diff --git a/llvm/include/llvm/Transforms/Utils/MisExpect.h b/llvm/include/llvm/Transforms/Utils/MisExpect.h
index 216c99a26259a17..77107c7771efc4b 100644
--- a/llvm/include/llvm/Transforms/Utils/MisExpect.h
+++ b/llvm/include/llvm/Transforms/Utils/MisExpect.h
@@ -21,6 +21,7 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/LLVMContext.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 namespace misexpect {
diff --git a/llvm/include/llvm/Transforms/Utils/ModuleUtils.h b/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
index e37547cb4efff45..2a83eefde31e829 100644
--- a/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/GlobalIFunc.h"
 #include "llvm/Support/Alignment.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MemoryBufferRef.h"
 #include <utility> // for std::pair
 
diff --git a/llvm/include/llvm/Transforms/Utils/MoveAutoInit.h b/llvm/include/llvm/Transforms/Utils/MoveAutoInit.h
index 980b55f46f114ed..86cc076ef2f1cb9 100644
--- a/llvm/include/llvm/Transforms/Utils/MoveAutoInit.h
+++ b/llvm/include/llvm/Transforms/Utils/MoveAutoInit.h
@@ -17,6 +17,7 @@
 #define LLVM_TRANSFORMS_UTILS_MOVEAUTOINIT_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h b/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
index a59f9bc3ebfb32f..ef56312ec6b5a0e 100644
--- a/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
+++ b/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
@@ -15,6 +15,7 @@
 #define LLVM_TRANSFORMS_UTILS_NAMEANONGLOBALS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
index d2224b61103c987..ec473f03d8ce92c 100644
--- a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
+++ b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
@@ -58,6 +58,7 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h b/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h
index f827ffd3e676aca..f9bf610d0ed1a9a 100644
--- a/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h
+++ b/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
 #define LLVM_TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 template <typename T> class ArrayRef;
diff --git a/llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h b/llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h
index 0992a4456c9d0f7..c4377c42bd5c723 100644
--- a/llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h
+++ b/llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h
@@ -52,6 +52,7 @@
 #define LLVM_TRANSFORMS_UTILS_RELLOOKUPTABLECONVERTER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/SCCPSolver.h b/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
index 7930d95e1deafaf..7c907e117ec6111 100644
--- a/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
+++ b/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Analysis/DomTreeUpdater.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Transforms/Utils/PredicateInfo.h"
 #include <vector>
 
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdater.h b/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
index 36fbf536f6d015c..6c62d4fed4808af 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
@@ -15,6 +15,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h b/llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h
index ad24cb454d5e759..5cf569a84431ebe 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/IR/PredIteratorCache.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h b/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
index a3e5ac3ac19d452..8af392eeb7b9bad 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 
diff --git a/llvm/include/llvm/Transforms/Utils/SampleProfileInference.h b/llvm/include/llvm/Transforms/Utils/SampleProfileInference.h
index e9bc3d18bdcbf87..3245b8f226570ee 100644
--- a/llvm/include/llvm/Transforms/Utils/SampleProfileInference.h
+++ b/llvm/include/llvm/Transforms/Utils/SampleProfileInference.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
index 1c6ba530e3df4cc..37f663503a96d89 100644
--- a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
+++ b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
@@ -38,6 +38,7 @@
 #include "llvm/ProfileData/SampleProf.h"
 #include "llvm/ProfileData/SampleProfReader.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericDomTree.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Utils/SampleProfileInference.h"
diff --git a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h
index bd7175aa96ffed5..5ec3d3be87c23cd 100644
--- a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h
+++ b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h
@@ -18,6 +18,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ProfileData/SampleProf.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 using namespace sampleprof;
diff --git a/llvm/include/llvm/Transforms/Utils/SanitizerStats.h b/llvm/include/llvm/Transforms/Utils/SanitizerStats.h
index 14e8ae045cddd16..36f0f341f46af13 100644
--- a/llvm/include/llvm/Transforms/Utils/SanitizerStats.h
+++ b/llvm/include/llvm/Transforms/Utils/SanitizerStats.h
@@ -14,6 +14,7 @@
 #define LLVM_TRANSFORMS_UTILS_SANITIZERSTATS_H
 
 #include "llvm/IR/IRBuilder.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h b/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
index 555897083469aee..ac51ae6159f190e 100644
--- a/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
+++ b/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
@@ -23,6 +23,7 @@
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/InstructionCost.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h b/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
index 8008fc6e8422d32..304e8c0ec6e9bdb 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
@@ -16,6 +16,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_SIMPLIFYCFGOPTIONS_H
 #define LLVM_TRANSFORMS_UTILS_SIMPLIFYCFGOPTIONS_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class AssumptionCache;
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h b/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h
index ff60811b616859e..3ebb8bfb65620b8 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h
@@ -15,6 +15,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_SIMPLIFYINDVAR_H
 #define LLVM_TRANSFORMS_UTILS_SIMPLIFYINDVAR_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 
 class Type;
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
index eb10545ee149e4c..7588ddcca86f3f2 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/Analysis/TargetLibraryInfo.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class AssumptionCache;
diff --git a/llvm/include/llvm/Transforms/Utils/SizeOpts.h b/llvm/include/llvm/Transforms/Utils/SizeOpts.h
index a9e72768f81e397..ed629aa4ec54ec8 100644
--- a/llvm/include/llvm/Transforms/Utils/SizeOpts.h
+++ b/llvm/include/llvm/Transforms/Utils/SizeOpts.h
@@ -15,6 +15,7 @@
 
 #include "llvm/Analysis/ProfileSummaryInfo.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 extern cl::opt<bool> EnablePGSO;
diff --git a/llvm/include/llvm/Transforms/Utils/SplitModule.h b/llvm/include/llvm/Transforms/Utils/SplitModule.h
index a5450738060a84c..d01724ad5740417 100644
--- a/llvm/include/llvm/Transforms/Utils/SplitModule.h
+++ b/llvm/include/llvm/Transforms/Utils/SplitModule.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_UTILS_SPLITMODULE_H
 
 #include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h b/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h
index 13e6d8ac26a7ff9..2f741bfe203c137 100644
--- a/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h
+++ b/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_UTILS_STRIPGCRELOCATES_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h b/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h
index 20d0aabd29385c7..c51d52b54043869 100644
--- a/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h
+++ b/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_UTILS_STRIPNONLINETABLEDEBUGINFO_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h b/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h
index 80dc6a42d931143..cfd4bb95fc4b4b4 100644
--- a/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h
+++ b/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h
@@ -33,6 +33,7 @@
 #define LLVM_TRANSFORMS_UTILS_SYMBOLREWRITER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 #include <list>
 #include <memory>
 #include <string>
diff --git a/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
index 461669d6a217876..ac5f0defb1c22fe 100644
--- a/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
+++ b/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
@@ -16,6 +16,7 @@
 
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h b/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h
index 0b219cd122226cc..2bc80295655d56f 100644
--- a/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h
+++ b/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_UTILS_UNIFYLOOPEXITS_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Utils/UnrollLoop.h b/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
index 4f3010965b591df..10de4938e8dd7c4 100644
--- a/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
+++ b/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/Analysis/TargetTransformInfo.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/InstructionCost.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/VNCoercion.h b/llvm/include/llvm/Transforms/Utils/VNCoercion.h
index f1ea94bf60fcc68..8fb185d9c81f4e3 100644
--- a/llvm/include/llvm/Transforms/Utils/VNCoercion.h
+++ b/llvm/include/llvm/Transforms/Utils/VNCoercion.h
@@ -21,6 +21,8 @@
 #ifndef LLVM_TRANSFORMS_UTILS_VNCOERCION_H
 #define LLVM_TRANSFORMS_UTILS_VNCOERCION_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class Constant;
 class StoreInst;
diff --git a/llvm/include/llvm/Transforms/Utils/ValueMapper.h b/llvm/include/llvm/Transforms/Utils/ValueMapper.h
index 5f15af7f99903b8..38b5e0e8e106cd6 100644
--- a/llvm/include/llvm/Transforms/Utils/ValueMapper.h
+++ b/llvm/include/llvm/Transforms/Utils/ValueMapper.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/IR/ValueMap.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h b/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
index 15a46baa190d83d..0f8a57a463daaeb 100644
--- a/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
+++ b/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
@@ -10,6 +10,7 @@
 #define LLVM_TRANSFORMS_VECTORIZE_LOADSTOREVECTORIZER_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 class Pass;
diff --git a/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h b/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
index f97029ce7e50f64..e8cef241a35fffc 100644
--- a/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
+++ b/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
@@ -28,6 +28,7 @@
 
 #include "llvm/ADT/MapVector.h"
 #include "llvm/Analysis/LoopAccessAnalysis.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/TypeSize.h"
 #include "llvm/Transforms/Utils/LoopUtils.h"
 
diff --git a/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h b/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
index da9fec8d63e9a83..d400e2deebb1526 100644
--- a/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
+++ b/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
@@ -58,6 +58,7 @@
 
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 #include <functional>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
index 326006fbb88039d..082dcbe41fc929c 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
@@ -23,6 +23,7 @@
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h b/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h
index 935f739b7667ac6..da41a90b9062a00 100644
--- a/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h
+++ b/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h
@@ -16,6 +16,7 @@
 #define LLVM_TRANSFORMS_VECTORIZE_VECTORCOMBINE_H
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
diff --git a/llvm/include/llvm/WindowsDriver/MSVCPaths.h b/llvm/include/llvm/WindowsDriver/MSVCPaths.h
index 51ffd6b6bc2c210..29a41dbc9ed60e3 100644
--- a/llvm/include/llvm/WindowsDriver/MSVCPaths.h
+++ b/llvm/include/llvm/WindowsDriver/MSVCPaths.h
@@ -11,6 +11,7 @@
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Triple.h"
 #include <optional>
 #include <string>
diff --git a/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h b/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h
index 2da74bb9dce8c66..efbef51f17f5da9 100644
--- a/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h
+++ b/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h
@@ -25,6 +25,7 @@
 #ifndef LLVM_WINDOWSMANIFEST_WINDOWSMANIFESTMERGER_H
 #define LLVM_WINDOWSMANIFEST_WINDOWSMANIFESTMERGER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/XRay/BlockIndexer.h b/llvm/include/llvm/XRay/BlockIndexer.h
index 77af77e5ec269cd..02315002e69b99c 100644
--- a/llvm/include/llvm/XRay/BlockIndexer.h
+++ b/llvm/include/llvm/XRay/BlockIndexer.h
@@ -14,6 +14,7 @@
 #define LLVM_XRAY_BLOCKINDEXER_H
 
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/XRay/FDRRecords.h"
 #include <cstdint>
 #include <vector>
diff --git a/llvm/include/llvm/XRay/BlockPrinter.h b/llvm/include/llvm/XRay/BlockPrinter.h
index 2f9fed668069c73..5c445e231114e83 100644
--- a/llvm/include/llvm/XRay/BlockPrinter.h
+++ b/llvm/include/llvm/XRay/BlockPrinter.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_XRAY_BLOCKPRINTER_H
 #define LLVM_XRAY_BLOCKPRINTER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/XRay/FDRRecords.h"
 #include "llvm/XRay/RecordPrinter.h"
diff --git a/llvm/include/llvm/XRay/BlockVerifier.h b/llvm/include/llvm/XRay/BlockVerifier.h
index 0175584d8235e5b..83b0da89a664cbb 100644
--- a/llvm/include/llvm/XRay/BlockVerifier.h
+++ b/llvm/include/llvm/XRay/BlockVerifier.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_XRAY_BLOCKVERIFIER_H
 #define LLVM_XRAY_BLOCKVERIFIER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/XRay/FDRRecords.h"
 #include <array>
 #include <bitset>
diff --git a/llvm/include/llvm/XRay/FDRRecordConsumer.h b/llvm/include/llvm/XRay/FDRRecordConsumer.h
index 8fff9fb861582a7..90132c380d9143e 100644
--- a/llvm/include/llvm/XRay/FDRRecordConsumer.h
+++ b/llvm/include/llvm/XRay/FDRRecordConsumer.h
@@ -8,6 +8,7 @@
 #ifndef LLVM_XRAY_FDRRECORDCONSUMER_H
 #define LLVM_XRAY_FDRRECORDCONSUMER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/XRay/FDRRecords.h"
 #include <algorithm>
diff --git a/llvm/include/llvm/XRay/FDRRecordProducer.h b/llvm/include/llvm/XRay/FDRRecordProducer.h
index 25c123aec1b298f..9a85b0e76f7bab5 100644
--- a/llvm/include/llvm/XRay/FDRRecordProducer.h
+++ b/llvm/include/llvm/XRay/FDRRecordProducer.h
@@ -8,6 +8,7 @@
 #ifndef LLVM_XRAY_FDRRECORDPRODUCER_H
 #define LLVM_XRAY_FDRRECORDPRODUCER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/XRay/FDRRecords.h"
 #include "llvm/XRay/XRayRecord.h"
diff --git a/llvm/include/llvm/XRay/FDRRecords.h b/llvm/include/llvm/XRay/FDRRecords.h
index 8af88f5b0e13290..e6391a4fb322788 100644
--- a/llvm/include/llvm/XRay/FDRRecords.h
+++ b/llvm/include/llvm/XRay/FDRRecords.h
@@ -18,6 +18,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/Error.h"
 #include "llvm/XRay/XRayRecord.h"
diff --git a/llvm/include/llvm/XRay/FDRTraceExpander.h b/llvm/include/llvm/XRay/FDRTraceExpander.h
index 197c123fff1e36e..2f46c4ab1798287 100644
--- a/llvm/include/llvm/XRay/FDRTraceExpander.h
+++ b/llvm/include/llvm/XRay/FDRTraceExpander.h
@@ -14,6 +14,7 @@
 #define LLVM_XRAY_FDRTRACEEXPANDER_H
 
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/XRay/FDRRecords.h"
 #include "llvm/XRay/XRayRecord.h"
 
diff --git a/llvm/include/llvm/XRay/FDRTraceWriter.h b/llvm/include/llvm/XRay/FDRTraceWriter.h
index 40d5f5af91c9279..ffa8717055b537d 100644
--- a/llvm/include/llvm/XRay/FDRTraceWriter.h
+++ b/llvm/include/llvm/XRay/FDRTraceWriter.h
@@ -12,6 +12,7 @@
 #ifndef LLVM_XRAY_FDRTRACEWRITER_H
 #define LLVM_XRAY_FDRTRACEWRITER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/EndianStream.h"
 #include "llvm/XRay/FDRRecords.h"
diff --git a/llvm/include/llvm/XRay/FileHeaderReader.h b/llvm/include/llvm/XRay/FileHeaderReader.h
index 485d26d71456b52..c385129dbe1419f 100644
--- a/llvm/include/llvm/XRay/FileHeaderReader.h
+++ b/llvm/include/llvm/XRay/FileHeaderReader.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_XRAY_FILEHEADERREADER_H
 #define LLVM_XRAY_FILEHEADERREADER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/Error.h"
 #include "llvm/XRay/XRayRecord.h"
diff --git a/llvm/include/llvm/XRay/InstrumentationMap.h b/llvm/include/llvm/XRay/InstrumentationMap.h
index 1979108ff4133be..b3eb96d9725ed72 100644
--- a/llvm/include/llvm/XRay/InstrumentationMap.h
+++ b/llvm/include/llvm/XRay/InstrumentationMap.h
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include <cstdint>
 #include <optional>
diff --git a/llvm/include/llvm/XRay/Profile.h b/llvm/include/llvm/XRay/Profile.h
index 79d9b53387f3933..721a5c67e1d3827 100644
--- a/llvm/include/llvm/XRay/Profile.h
+++ b/llvm/include/llvm/XRay/Profile.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include <list>
 #include <utility>
diff --git a/llvm/include/llvm/XRay/RecordPrinter.h b/llvm/include/llvm/XRay/RecordPrinter.h
index 8ca4794dce5e208..13ecf23b39060d0 100644
--- a/llvm/include/llvm/XRay/RecordPrinter.h
+++ b/llvm/include/llvm/XRay/RecordPrinter.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_XRAY_RECORDPRINTER_H
 #define LLVM_XRAY_RECORDPRINTER_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/XRay/FDRRecords.h"
 
diff --git a/llvm/include/llvm/XRay/Trace.h b/llvm/include/llvm/XRay/Trace.h
index eb1f03b2a0d4a3c..ec405f069d0c55e 100644
--- a/llvm/include/llvm/XRay/Trace.h
+++ b/llvm/include/llvm/XRay/Trace.h
@@ -16,6 +16,7 @@
 #include <vector>
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataExtractor.h"
 #include "llvm/Support/Error.h"
 #include "llvm/XRay/XRayRecord.h"
diff --git a/llvm/include/llvm/XRay/XRayRecord.h b/llvm/include/llvm/XRay/XRayRecord.h
index 238bf3daf6ea5e5..221df9670acddc0 100644
--- a/llvm/include/llvm/XRay/XRayRecord.h
+++ b/llvm/include/llvm/XRay/XRayRecord.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_XRAY_XRAYRECORD_H
 #define LLVM_XRAY_XRAYRECORD_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <vector>
 #include <string>
diff --git a/llvm/include/llvm/XRay/YAMLXRayRecord.h b/llvm/include/llvm/XRay/YAMLXRayRecord.h
index 606260693fc4f4d..2b81a368df5a3a2 100644
--- a/llvm/include/llvm/XRay/YAMLXRayRecord.h
+++ b/llvm/include/llvm/XRay/YAMLXRayRecord.h
@@ -14,6 +14,7 @@
 
 #include <type_traits>
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/YAMLTraits.h"
 #include "llvm/XRay/XRayRecord.h"
 

>From 4c82d72fbd3818a4538c3e7d206109fbddc90677 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Thu, 3 Aug 2023 20:55:59 +0000
Subject: [PATCH 06/39] CMake changes

---
 llvm/include/llvm/Support/Compiler.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 10d5cec231a523c..25dfd58ca0fd420 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -114,7 +114,7 @@
 /// this attribute will be made public and visible outside of any shared library
 /// they are linked in to.
 
-#if LLVM_HAS_CPP_ATTRIBUTE(gnu::visibility)
+#if LLVM_HAS_CPP_ATTRIBUTE(gnu::visibility) && defined(__GNUC__) && !defined(__clang__)
 #define LLVM_ATTRIBUTE_VISIBILITY_HIDDEN [[gnu::visibility("hidden")]]
 #define LLVM_ATTRIBUTE_VISIBILITY_DEFAULT [[gnu::visibility("default")]]
 #elif __has_attribute(visibility)
@@ -139,6 +139,19 @@
 #define LLVM_EXTERNAL_VISIBILITY
 #endif
 
+#if defined(__ELF__)
+# define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
+#elif defined(__MACH__) || defined(__WASM__)
+# define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
+#else
+# if defined(LLVM_ABI_EXPORTS)
+#   define LLVM_ABI __declspec(dllexport)
+# else
+#   define LLVM_ABI __declspec(dllimport)
+# endif
+#endif
+
+
 #if defined(__GNUC__)
 #define LLVM_PREFETCH(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
 #else

>From 4c467e4469c5ec9d1ed95c6121005677700cc04d Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Thu, 3 Aug 2023 20:58:18 +0000
Subject: [PATCH 07/39] XXX: CMake changes

---
 llvm/include/llvm/Support/Compiler.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 25dfd58ca0fd420..0f5e8d73d38eb41 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -141,17 +141,24 @@
 
 #if defined(__ELF__)
 # define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
+# define LLVM_CLASS_ABI LLVM_ABI
+# define LLVM_FUNC_ABI LLVM_ABI
 #elif defined(__MACH__) || defined(__WASM__)
 # define LLVM_ABI LLVM_ATTRIBUTE_VISIBILITY_DEFAULT
+# define LLVM_CLASS_ABI LLVM_ABI
+# define LLVM_FUNC_ABI LLVM_ABI
 #else
 # if defined(LLVM_ABI_EXPORTS)
 #   define LLVM_ABI __declspec(dllexport)
 # else
 #   define LLVM_ABI __declspec(dllimport)
 # endif
+# define LLVM_CLASS_ABI
+# define LLVM_FUNC_ABI LLVM_ABI
 #endif
 
 
+
 #if defined(__GNUC__)
 #define LLVM_PREFETCH(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
 #else

>From 3995c8307a1f85e85b0bebc5a3b330f6e3eb5021 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Thu, 3 Aug 2023 23:39:57 +0000
Subject: [PATCH 08/39] XXX: headers

---
 llvm/include/llvm/ADT/DenseMapInfo.h | 1 +
 llvm/include/llvm/Support/Debug.h    | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/llvm/include/llvm/ADT/DenseMapInfo.h b/llvm/include/llvm/ADT/DenseMapInfo.h
index 5b7dce7b53c62fb..d97ff7ecc985dfa 100644
--- a/llvm/include/llvm/ADT/DenseMapInfo.h
+++ b/llvm/include/llvm/ADT/DenseMapInfo.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_ADT_DENSEMAPINFO_H
 #define LLVM_ADT_DENSEMAPINFO_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
diff --git a/llvm/include/llvm/Support/Debug.h b/llvm/include/llvm/Support/Debug.h
index 5788ab3b21380db..a921bd5aa294e95 100644
--- 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/Compiler.h"
+
 namespace llvm {
 
 class raw_ostream;

>From c3afc30a178ee83f6566b657272a905e00205293 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 25 Jul 2023 19:31:26 +0000
Subject: [PATCH 09/39] XXX: Add headers

---
 llvm/include/llvm-c/Error.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm-c/Error.h b/llvm/include/llvm-c/Error.h
index c3baaf65186aac6..9f50496bd15fdd0 100644
--- a/llvm/include/llvm-c/Error.h
+++ b/llvm/include/llvm-c/Error.h
@@ -15,6 +15,7 @@
 #define LLVM_C_ERROR_H
 
 #include "llvm-c/ExternC.h"
+#include "llvm/Support/Compiler.h"
 
 LLVM_C_EXTERN_C_BEGIN
 

>From ee994f967974ddd150f5ac8101f058b01eb2c019 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 26 Jul 2023 03:01:28 +0000
Subject: [PATCH 10/39] XXX: Headers

---
 llvm/include/llvm/ADT/DAGDeltaAlgorithm.h     | 1 +
 llvm/include/llvm/ADT/DeltaAlgorithm.h        | 1 +
 llvm/include/llvm/Demangle/Demangle.h         | 1 +
 llvm/include/llvm/Support/Atomic.h            | 1 +
 llvm/include/llvm/Support/BlockFrequency.h    | 1 +
 llvm/include/llvm/Support/BranchProbability.h | 1 +
 llvm/include/llvm/Support/BuryPointer.h       | 1 +
 llvm/include/llvm/Support/COM.h               | 2 ++
 llvm/include/llvm/Support/CRC.h               | 1 +
 llvm/include/llvm/Support/ConvertUTF.h        | 1 +
 llvm/include/llvm/Support/DynamicLibrary.h    | 1 +
 llvm/include/llvm/Support/Errno.h             | 1 +
 llvm/include/llvm/Support/Locale.h            | 2 ++
 llvm/include/llvm/Support/ManagedStatic.h     | 1 +
 llvm/include/llvm/Support/Memory.h            | 1 +
 llvm/include/llvm/Support/NativeFormatting.h  | 1 +
 llvm/include/llvm/Support/PluginLoader.h      | 2 ++
 llvm/include/llvm/Support/SHA1.h              | 1 +
 llvm/include/llvm/Support/SHA256.h            | 1 +
 llvm/include/llvm/Support/Signals.h           | 1 +
 llvm/include/llvm/Support/Signposts.h         | 1 +
 llvm/include/llvm/Support/SystemUtils.h       | 2 ++
 llvm/include/llvm/Support/Valgrind.h          | 1 +
 23 files changed, 27 insertions(+)

diff --git a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
index c3872af2a0b4ecf..3d733c2a4a62f66 100644
--- a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
+++ b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
@@ -8,6 +8,7 @@
 #ifndef LLVM_ADT_DAGDELTAALGORITHM_H
 #define LLVM_ADT_DAGDELTAALGORITHM_H
 
+#include "llvm/Support/Compiler.h"
 #include <set>
 #include <utility>
 #include <vector>
diff --git a/llvm/include/llvm/ADT/DeltaAlgorithm.h b/llvm/include/llvm/ADT/DeltaAlgorithm.h
index e1743fd001968b1..a9843177662d467 100644
--- a/llvm/include/llvm/ADT/DeltaAlgorithm.h
+++ b/llvm/include/llvm/ADT/DeltaAlgorithm.h
@@ -8,6 +8,7 @@
 #ifndef LLVM_ADT_DELTAALGORITHM_H
 #define LLVM_ADT_DELTAALGORITHM_H
 
+#include "llvm/Support/Compiler.h"
 #include <set>
 #include <vector>
 
diff --git a/llvm/include/llvm/Demangle/Demangle.h b/llvm/include/llvm/Demangle/Demangle.h
index e1f73c422db8335..59d8828b6607143 100644
--- a/llvm/include/llvm/Demangle/Demangle.h
+++ b/llvm/include/llvm/Demangle/Demangle.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_DEMANGLE_DEMANGLE_H
 #define LLVM_DEMANGLE_DEMANGLE_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <string>
 #include <string_view>
diff --git a/llvm/include/llvm/Support/Atomic.h b/llvm/include/llvm/Support/Atomic.h
index a8445fddc1a8553..dbe321a7f21e714 100644
--- a/llvm/include/llvm/Support/Atomic.h
+++ b/llvm/include/llvm/Support/Atomic.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_SUPPORT_ATOMIC_H
 #define LLVM_SUPPORT_ATOMIC_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 // Windows will at times define MemoryFence.
diff --git a/llvm/include/llvm/Support/BlockFrequency.h b/llvm/include/llvm/Support/BlockFrequency.h
index 6c624d7dad7d801..a194599a3f9db49 100644
--- a/llvm/include/llvm/Support/BlockFrequency.h
+++ b/llvm/include/llvm/Support/BlockFrequency.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_BLOCKFREQUENCY_H
 #define LLVM_SUPPORT_BLOCKFREQUENCY_H
 
+#include "llvm/Support/Compiler.h"
 #include <cassert>
 #include <cstdint>
 
diff --git a/llvm/include/llvm/Support/BranchProbability.h b/llvm/include/llvm/Support/BranchProbability.h
index 79d70cf611d4156..66bb7c44cc8fe5e 100644
--- a/llvm/include/llvm/Support/BranchProbability.h
+++ b/llvm/include/llvm/Support/BranchProbability.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_BRANCHPROBABILITY_H
 #define LLVM_SUPPORT_BRANCHPROBABILITY_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <algorithm>
 #include <cassert>
diff --git a/llvm/include/llvm/Support/BuryPointer.h b/llvm/include/llvm/Support/BuryPointer.h
index 276a5b7089c3e7e..79690c66a65d255 100644
--- a/llvm/include/llvm/Support/BuryPointer.h
+++ b/llvm/include/llvm/Support/BuryPointer.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_SUPPORT_BURYPOINTER_H
 #define LLVM_SUPPORT_BURYPOINTER_H
 
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/COM.h b/llvm/include/llvm/Support/COM.h
index d59966f849b4854..ea4199600d9913e 100644
--- a/llvm/include/llvm/Support/COM.h
+++ b/llvm/include/llvm/Support/COM.h
@@ -14,6 +14,8 @@
 #ifndef LLVM_SUPPORT_COM_H
 #define LLVM_SUPPORT_COM_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 namespace sys {
 
diff --git a/llvm/include/llvm/Support/CRC.h b/llvm/include/llvm/Support/CRC.h
index 210890ae06d47cd..c34aa605ffc4bbd 100644
--- a/llvm/include/llvm/Support/CRC.h
+++ b/llvm/include/llvm/Support/CRC.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_CRC_H
 #define LLVM_SUPPORT_CRC_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h
index c892bb3c03cb569..b2fe1bc258b59aa 100644
--- a/llvm/include/llvm/Support/ConvertUTF.h
+++ b/llvm/include/llvm/Support/ConvertUTF.h
@@ -105,6 +105,7 @@
 #ifndef LLVM_SUPPORT_CONVERTUTF_H
 #define LLVM_SUPPORT_CONVERTUTF_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 #include <string>
 
diff --git a/llvm/include/llvm/Support/DynamicLibrary.h b/llvm/include/llvm/Support/DynamicLibrary.h
index f7db8fba39084cf..2f76eba260ef160 100644
--- a/llvm/include/llvm/Support/DynamicLibrary.h
+++ b/llvm/include/llvm/Support/DynamicLibrary.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_DYNAMICLIBRARY_H
 #define LLVM_SUPPORT_DYNAMICLIBRARY_H
 
+#include "llvm/Support/Compiler.h"
 #include <string>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/Errno.h b/llvm/include/llvm/Support/Errno.h
index e095c66b9086000..be12e2889b4b7f0 100644
--- a/llvm/include/llvm/Support/Errno.h
+++ b/llvm/include/llvm/Support/Errno.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_ERRNO_H
 #define LLVM_SUPPORT_ERRNO_H
 
+#include "llvm/Support/Compiler.h"
 #include <cerrno>
 #include <string>
 
diff --git a/llvm/include/llvm/Support/Locale.h b/llvm/include/llvm/Support/Locale.h
index f7a2c036ed5e11b..e99184a19a1268e 100644
--- a/llvm/include/llvm/Support/Locale.h
+++ b/llvm/include/llvm/Support/Locale.h
@@ -1,6 +1,8 @@
 #ifndef LLVM_SUPPORT_LOCALE_H
 #define LLVM_SUPPORT_LOCALE_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class StringRef;
 
diff --git a/llvm/include/llvm/Support/ManagedStatic.h b/llvm/include/llvm/Support/ManagedStatic.h
index f2b41422f131559..f1d492d861af2b5 100644
--- a/llvm/include/llvm/Support/ManagedStatic.h
+++ b/llvm/include/llvm/Support/ManagedStatic.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_MANAGEDSTATIC_H
 #define LLVM_SUPPORT_MANAGEDSTATIC_H
 
+#include "llvm/Support/Compiler.h"
 #include <atomic>
 #include <cstddef>
 
diff --git a/llvm/include/llvm/Support/Memory.h b/llvm/include/llvm/Support/Memory.h
index d7d60371d315f0b..af68710c0e1c9ab 100644
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_MEMORY_H
 #define LLVM_SUPPORT_MEMORY_H
 
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/DataTypes.h"
 #include <system_error>
 
diff --git a/llvm/include/llvm/Support/NativeFormatting.h b/llvm/include/llvm/Support/NativeFormatting.h
index ab85ae20161c203..47433ed7d4f3b63 100644
--- a/llvm/include/llvm/Support/NativeFormatting.h
+++ b/llvm/include/llvm/Support/NativeFormatting.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_SUPPORT_NATIVEFORMATTING_H
 #define LLVM_SUPPORT_NATIVEFORMATTING_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <optional>
 
diff --git a/llvm/include/llvm/Support/PluginLoader.h b/llvm/include/llvm/Support/PluginLoader.h
index bdd36366d1cf97c..8a5598f60c89973 100644
--- a/llvm/include/llvm/Support/PluginLoader.h
+++ b/llvm/include/llvm/Support/PluginLoader.h
@@ -16,6 +16,8 @@
 #ifndef LLVM_SUPPORT_PLUGINLOADER_H
 #define LLVM_SUPPORT_PLUGINLOADER_H
 
+#include "llvm/Support/Compiler.h"
+
 #ifndef DONT_GET_PLUGIN_LOADER_OPTION
 #include "llvm/Support/CommandLine.h"
 #endif
diff --git a/llvm/include/llvm/Support/SHA1.h b/llvm/include/llvm/Support/SHA1.h
index ae6d62aed723aa0..aaa2c914756e90d 100644
--- a/llvm/include/llvm/Support/SHA1.h
+++ b/llvm/include/llvm/Support/SHA1.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_SUPPORT_SHA1_H
 #define LLVM_SUPPORT_SHA1_H
 
+#include "llvm/Support/Compiler.h"
 #include <array>
 #include <cstdint>
 
diff --git a/llvm/include/llvm/Support/SHA256.h b/llvm/include/llvm/Support/SHA256.h
index 68b32c7b483489e..449effa0daf893e 100644
--- a/llvm/include/llvm/Support/SHA256.h
+++ b/llvm/include/llvm/Support/SHA256.h
@@ -22,6 +22,7 @@
 #ifndef LLVM_SUPPORT_SHA256_H
 #define LLVM_SUPPORT_SHA256_H
 
+#include "llvm/Support/Compiler.h"
 #include <array>
 #include <cstdint>
 
diff --git a/llvm/include/llvm/Support/Signals.h b/llvm/include/llvm/Support/Signals.h
index 70749ce30184a7a..87c5d389ef48f3f 100644
--- a/llvm/include/llvm/Support/Signals.h
+++ b/llvm/include/llvm/Support/Signals.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_SUPPORT_SIGNALS_H
 #define LLVM_SUPPORT_SIGNALS_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 #include <string>
 
diff --git a/llvm/include/llvm/Support/Signposts.h b/llvm/include/llvm/Support/Signposts.h
index 37089bd1c17d3c1..8a2d7a639bdd712 100644
--- a/llvm/include/llvm/Support/Signposts.h
+++ b/llvm/include/llvm/Support/Signposts.h
@@ -16,6 +16,7 @@
 #ifndef LLVM_SUPPORT_SIGNPOSTS_H
 #define LLVM_SUPPORT_SIGNPOSTS_H
 
+#include "llvm/Support/Compiler.h"
 #include <memory>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/SystemUtils.h b/llvm/include/llvm/Support/SystemUtils.h
index 786bea3fcfae681..bba1d34112f7a80 100644
--- 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/Compiler.h"
+
 namespace llvm {
 class raw_ostream;
 
diff --git a/llvm/include/llvm/Support/Valgrind.h b/llvm/include/llvm/Support/Valgrind.h
index 1e14dfec9a6186c..b0d68f8a49cfca9 100644
--- a/llvm/include/llvm/Support/Valgrind.h
+++ b/llvm/include/llvm/Support/Valgrind.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_SUPPORT_VALGRIND_H
 #define LLVM_SUPPORT_VALGRIND_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstddef>
 
 namespace llvm {

>From e8ef0ff6c564a788db871f1eefdc76b88ad1b416 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 26 Jul 2023 03:01:28 +0000
Subject: [PATCH 11/39] XXX: Test run

---
 llvm/include/llvm-c/Error.h                 |  12 +-
 llvm/include/llvm/ADT/APInt.h               |  28 ++---
 llvm/include/llvm/ADT/APSInt.h              |   4 +-
 llvm/include/llvm/ADT/ArrayRef.h            |   8 +-
 llvm/include/llvm/ADT/DenseMapInfo.h        |  28 ++---
 llvm/include/llvm/ADT/Hashing.h             |  16 +--
 llvm/include/llvm/ADT/STLExtras.h           | 124 ++++++++++----------
 llvm/include/llvm/ADT/STLForwardCompat.h    |   2 +-
 llvm/include/llvm/ADT/STLFunctionalExtras.h |   2 +-
 llvm/include/llvm/ADT/SmallString.h         |   2 +-
 llvm/include/llvm/ADT/SmallVector.h         |  20 ++--
 llvm/include/llvm/ADT/StringExtras.h        |  20 ++--
 llvm/include/llvm/ADT/StringRef.h           |  16 +--
 llvm/include/llvm/ADT/Twine.h               |   2 +-
 llvm/include/llvm/ADT/bit.h                 |  16 +--
 llvm/include/llvm/ADT/identity.h            |   2 +-
 llvm/include/llvm/ADT/iterator.h            |   8 +-
 llvm/include/llvm/ADT/iterator_range.h      |   6 +-
 llvm/include/llvm/Support/AlignOf.h         |   2 +-
 llvm/include/llvm/Support/Debug.h           |   6 +-
 llvm/include/llvm/Support/Error.h           |  68 +++++------
 llvm/include/llvm/Support/ErrorHandling.h   |  22 ++--
 llvm/include/llvm/Support/ErrorOr.h         |   2 +-
 llvm/include/llvm/Support/Format.h          |  14 +--
 llvm/include/llvm/Support/MathExtras.h      |   2 +-
 llvm/include/llvm/Support/raw_ostream.h     |  28 ++---
 llvm/include/llvm/Support/type_traits.h     |  30 ++---
 27 files changed, 245 insertions(+), 245 deletions(-)

diff --git a/llvm/include/llvm-c/Error.h b/llvm/include/llvm-c/Error.h
index 9f50496bd15fdd0..526b76b2ee29a6f 100644
--- a/llvm/include/llvm-c/Error.h
+++ b/llvm/include/llvm-c/Error.h
@@ -42,7 +42,7 @@ typedef const void *LLVMErrorTypeId;
  * Returns the type id for the given error instance, which must be a failure
  * value (i.e. non-null).
  */
-LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err);
+LLVM_FUNC_ABI LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err);
 
 /**
  * Dispose of the given error without handling it. This operation consumes the
@@ -50,7 +50,7 @@ LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err);
  * 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_FUNC_ABI void LLVMConsumeError(LLVMErrorRef Err);
 
 /**
  * Returns the given string's error message. This operation consumes the error,
@@ -58,22 +58,22 @@ void LLVMConsumeError(LLVMErrorRef Err);
  * The caller is responsible for disposing of the string by calling
  * LLVMDisposeErrorMessage.
  */
-char *LLVMGetErrorMessage(LLVMErrorRef Err);
+LLVM_FUNC_ABI char *LLVMGetErrorMessage(LLVMErrorRef Err);
 
 /**
  * Dispose of the given error message.
  */
-void LLVMDisposeErrorMessage(char *ErrMsg);
+LLVM_FUNC_ABI void LLVMDisposeErrorMessage(char *ErrMsg);
 
 /**
  * Returns the type id for llvm StringError.
  */
-LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
+LLVM_FUNC_ABI LLVMErrorTypeId LLVMGetStringErrorTypeId(void);
 
 /**
  * Create a StringError.
  */
-LLVMErrorRef LLVMCreateStringError(const char *ErrMsg);
+LLVM_FUNC_ABI LLVMErrorRef LLVMCreateStringError(const char *ErrMsg);
 
 /**
  * @}
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index 6f2f25548cc84ba..c436ce28952c517 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -36,7 +36,7 @@ template <typename T, typename Enable> struct DenseMapInfo;
 
 class APInt;
 
-inline APInt operator-(APInt);
+LLVM_FUNC_ABI inline APInt operator-(APInt);
 
 //===----------------------------------------------------------------------===//
 //                              APInt Class
@@ -73,7 +73,7 @@ inline APInt operator-(APInt);
 ///     shifts are defined, but sign extension and ashr is not.  Zero bit values
 ///     compare and hash equal to themselves, and countLeadingZeros returns 0.
 ///
-class [[nodiscard]] APInt {
+class LLVM_CLASS_ABI [[nodiscard]] APInt {
 public:
   typedef uint64_t WordType;
 
@@ -539,7 +539,7 @@ class [[nodiscard]] APInt {
   }
 
   /// Overload to compute a hash_code for an APInt value.
-  friend hash_code hash_value(const APInt &Arg);
+  friend LLVM_FUNC_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
@@ -2193,7 +2193,7 @@ inline const APInt &umax(const APInt &A, const APInt &B) {
 /// using Stein's algorithm.
 ///
 /// \returns the greatest common divisor of A and B.
-APInt GreatestCommonDivisor(APInt A, APInt B);
+LLVM_FUNC_ABI APInt GreatestCommonDivisor(APInt A, APInt B);
 
 /// Converts the given APInt to a double value.
 ///
@@ -2224,7 +2224,7 @@ inline float RoundSignedAPIntToFloat(const APInt &APIVal) {
 /// 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_FUNC_ABI APInt RoundDoubleToAPInt(double Double, unsigned width);
 
 /// Converts a float value into a APInt.
 ///
@@ -2234,10 +2234,10 @@ inline APInt RoundFloatToAPInt(float Float, unsigned width) {
 }
 
 /// Return A unsign-divided by B, rounded by the given rounding mode.
-APInt RoundingUDiv(const APInt &A, const APInt &B, APInt::Rounding RM);
+LLVM_FUNC_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_FUNC_ABI APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM);
 
 /// Let q(n) = An^2 + Bn + C, and BW = bit width of the value range
 /// (e.g. 32 for i32).
@@ -2272,12 +2272,12 @@ APInt RoundingSDiv(const APInt &A, const APInt &B, APInt::Rounding RM);
 ///
 /// The returned value may have a different bit width from the input
 /// coefficients.
-std::optional<APInt> SolveQuadraticEquationWrap(APInt A, APInt B, APInt C,
+LLVM_FUNC_ABI std::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.
-std::optional<unsigned> GetMostSignificantDifferentBit(const APInt &A,
+LLVM_FUNC_ABI std::optional<unsigned> GetMostSignificantDifferentBit(const APInt &A,
                                                        const APInt &B);
 
 /// Splat/Merge neighboring bits to widen/narrow the bitmask represented
@@ -2291,24 +2291,24 @@ std::optional<unsigned> GetMostSignificantDifferentBit(const APInt &A,
 /// e.g. ScaleBitMask(0b0101, 8) -> 0b00110011
 /// e.g. ScaleBitMask(0b00011011, 4) -> 0b0001
 /// A.getBitwidth() or NewBitWidth must be a whole multiples of the other.
-APInt ScaleBitMask(const APInt &A, unsigned NewBitWidth,
+LLVM_FUNC_ABI APInt ScaleBitMask(const APInt &A, unsigned NewBitWidth,
                    bool MatchAllBits = false);
 } // namespace APIntOps
 
 // See friend declaration above. This additional declaration is required in
 // order to compile LLVM with IBM xlC compiler.
-hash_code hash_value(const APInt &Arg);
+LLVM_FUNC_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_FUNC_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_FUNC_ABI void LoadIntFromMemory(APInt &IntVal, const uint8_t *Src, unsigned LoadBytes);
 
 /// Provide DenseMapInfo for APInt.
-template <> struct DenseMapInfo<APInt, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<APInt, void> {
   static inline APInt getEmptyKey() {
     APInt V(nullptr, 0);
     V.U.VAL = ~0ULL;
diff --git a/llvm/include/llvm/ADT/APSInt.h b/llvm/include/llvm/ADT/APSInt.h
index a7201cdcb708805..27b21f056b86830 100644
--- a/llvm/include/llvm/ADT/APSInt.h
+++ b/llvm/include/llvm/ADT/APSInt.h
@@ -21,7 +21,7 @@
 namespace llvm {
 
 /// An arbitrary precision integer that knows its signedness.
-class [[nodiscard]] APSInt : public APInt {
+class LLVM_CLASS_ABI [[nodiscard]] APSInt : public APInt {
   bool IsUnsigned = false;
 
 public:
@@ -368,7 +368,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const APSInt &I) {
 }
 
 /// Provide DenseMapInfo for APSInt, using the DenseMapInfo for APInt.
-template <> struct DenseMapInfo<APSInt, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<APSInt, void> {
   static inline APSInt getEmptyKey() {
     return APSInt(DenseMapInfo<APInt, void>::getEmptyKey());
   }
diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h
index a25cf1cf817ef02..53be066de9289b9 100644
--- a/llvm/include/llvm/ADT/ArrayRef.h
+++ b/llvm/include/llvm/ADT/ArrayRef.h
@@ -38,7 +38,7 @@ namespace llvm {
   /// This is intended to be trivially copyable, so it should be passed by
   /// value.
   template<typename T>
-  class LLVM_GSL_POINTER [[nodiscard]] ArrayRef {
+  class LLVM_CLASS_ABI LLVM_GSL_POINTER [[nodiscard]] ArrayRef {
   public:
     using value_type = T;
     using pointer = value_type *;
@@ -302,7 +302,7 @@ namespace llvm {
   /// This is intended to be trivially copyable, so it should be passed by
   /// value.
   template<typename T>
-  class [[nodiscard]] MutableArrayRef : public ArrayRef<T> {
+  class LLVM_CLASS_ABI [[nodiscard]] MutableArrayRef : public ArrayRef<T> {
   public:
     using value_type = T;
     using pointer = value_type *;
@@ -444,7 +444,7 @@ namespace llvm {
   };
 
   /// This is a MutableArrayRef that owns its array.
-  template <typename T> class OwningArrayRef : public MutableArrayRef<T> {
+  template <typename T> class LLVM_CLASS_ABI OwningArrayRef : public MutableArrayRef<T> {
   public:
     OwningArrayRef() = default;
     OwningArrayRef(size_t Size) : MutableArrayRef<T>(new T[Size], Size) {}
@@ -691,7 +691,7 @@ namespace llvm {
   }
 
   // Provide DenseMapInfo for ArrayRefs.
-  template <typename T> struct DenseMapInfo<ArrayRef<T>, void> {
+  template <typename T> struct LLVM_CLASS_ABI DenseMapInfo<ArrayRef<T>, void> {
     static inline ArrayRef<T> getEmptyKey() {
       return ArrayRef<T>(
           reinterpret_cast<const T *>(~static_cast<uintptr_t>(0)), size_t(0));
diff --git a/llvm/include/llvm/ADT/DenseMapInfo.h b/llvm/include/llvm/ADT/DenseMapInfo.h
index d97ff7ecc985dfa..5f19061d289da6e 100644
--- a/llvm/include/llvm/ADT/DenseMapInfo.h
+++ b/llvm/include/llvm/ADT/DenseMapInfo.h
@@ -48,7 +48,7 @@ static inline unsigned combineHashValue(unsigned a, unsigned b) {
 /// in derived DenseMapInfo specializations; in non-SFINAE use cases this should
 /// just be `void`.
 template<typename T, typename Enable = void>
-struct DenseMapInfo {
+struct LLVM_CLASS_ABI DenseMapInfo {
   //static inline T getEmptyKey();
   //static inline T getTombstoneKey();
   //static unsigned getHashValue(const T &Val);
@@ -61,7 +61,7 @@ struct DenseMapInfo {
 // declared key types. Assume that no pointer key type requires more than 4096
 // bytes of alignment.
 template<typename T>
-struct DenseMapInfo<T*> {
+struct LLVM_CLASS_ABI DenseMapInfo<T*> {
   // The following should hold, but it would require T to be complete:
   // static_assert(alignof(T) <= (1 << Log2MaxAlign),
   //               "DenseMap does not support pointer keys requiring more than "
@@ -89,7 +89,7 @@ struct DenseMapInfo<T*> {
 };
 
 // Provide DenseMapInfo for chars.
-template<> struct DenseMapInfo<char> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<char> {
   static inline char getEmptyKey() { return ~0; }
   static inline char getTombstoneKey() { return ~0 - 1; }
   static unsigned getHashValue(const char& Val) { return Val * 37U; }
@@ -100,7 +100,7 @@ template<> struct DenseMapInfo<char> {
 };
 
 // Provide DenseMapInfo for unsigned chars.
-template <> struct DenseMapInfo<unsigned char> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<unsigned char> {
   static inline unsigned char getEmptyKey() { return ~0; }
   static inline unsigned char getTombstoneKey() { return ~0 - 1; }
   static unsigned getHashValue(const unsigned char &Val) { return Val * 37U; }
@@ -111,7 +111,7 @@ template <> struct DenseMapInfo<unsigned char> {
 };
 
 // Provide DenseMapInfo for unsigned shorts.
-template <> struct DenseMapInfo<unsigned short> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<unsigned short> {
   static inline unsigned short getEmptyKey() { return 0xFFFF; }
   static inline unsigned short getTombstoneKey() { return 0xFFFF - 1; }
   static unsigned getHashValue(const unsigned short &Val) { return Val * 37U; }
@@ -122,7 +122,7 @@ template <> struct DenseMapInfo<unsigned short> {
 };
 
 // Provide DenseMapInfo for unsigned ints.
-template<> struct DenseMapInfo<unsigned> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<unsigned> {
   static inline unsigned getEmptyKey() { return ~0U; }
   static inline unsigned getTombstoneKey() { return ~0U - 1; }
   static unsigned getHashValue(const unsigned& Val) { return Val * 37U; }
@@ -133,7 +133,7 @@ template<> struct DenseMapInfo<unsigned> {
 };
 
 // Provide DenseMapInfo for unsigned longs.
-template<> struct DenseMapInfo<unsigned long> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<unsigned long> {
   static inline unsigned long getEmptyKey() { return ~0UL; }
   static inline unsigned long getTombstoneKey() { return ~0UL - 1L; }
 
@@ -147,7 +147,7 @@ template<> struct DenseMapInfo<unsigned long> {
 };
 
 // Provide DenseMapInfo for unsigned long longs.
-template<> struct DenseMapInfo<unsigned long long> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<unsigned long long> {
   static inline unsigned long long getEmptyKey() { return ~0ULL; }
   static inline unsigned long long getTombstoneKey() { return ~0ULL - 1ULL; }
 
@@ -162,7 +162,7 @@ template<> struct DenseMapInfo<unsigned long long> {
 };
 
 // Provide DenseMapInfo for shorts.
-template <> struct DenseMapInfo<short> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<short> {
   static inline short getEmptyKey() { return 0x7FFF; }
   static inline short getTombstoneKey() { return -0x7FFF - 1; }
   static unsigned getHashValue(const short &Val) { return Val * 37U; }
@@ -170,7 +170,7 @@ template <> struct DenseMapInfo<short> {
 };
 
 // Provide DenseMapInfo for ints.
-template<> struct DenseMapInfo<int> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<int> {
   static inline int getEmptyKey() { return 0x7fffffff; }
   static inline int getTombstoneKey() { return -0x7fffffff - 1; }
   static unsigned getHashValue(const int& Val) { return (unsigned)(Val * 37U); }
@@ -181,7 +181,7 @@ template<> struct DenseMapInfo<int> {
 };
 
 // Provide DenseMapInfo for longs.
-template<> struct DenseMapInfo<long> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<long> {
   static inline long getEmptyKey() {
     return (1UL << (sizeof(long) * 8 - 1)) - 1UL;
   }
@@ -198,7 +198,7 @@ template<> struct DenseMapInfo<long> {
 };
 
 // Provide DenseMapInfo for long longs.
-template<> struct DenseMapInfo<long long> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<long long> {
   static inline long long getEmptyKey() { return 0x7fffffffffffffffLL; }
   static inline long long getTombstoneKey() { return -0x7fffffffffffffffLL-1; }
 
@@ -214,7 +214,7 @@ template<> struct DenseMapInfo<long long> {
 
 // Provide DenseMapInfo for all pairs whose members have info.
 template<typename T, typename U>
-struct DenseMapInfo<std::pair<T, U>> {
+struct LLVM_CLASS_ABI DenseMapInfo<std::pair<T, U>> {
   using Pair = std::pair<T, U>;
   using FirstInfo = DenseMapInfo<T>;
   using SecondInfo = DenseMapInfo<U>;
@@ -249,7 +249,7 @@ struct DenseMapInfo<std::pair<T, U>> {
 };
 
 // Provide DenseMapInfo for all tuples whose members have info.
-template <typename... Ts> struct DenseMapInfo<std::tuple<Ts...>> {
+template <typename... Ts> struct LLVM_CLASS_ABI DenseMapInfo<std::tuple<Ts...>> {
   using Tuple = std::tuple<Ts...>;
 
   static inline Tuple getEmptyKey() {
diff --git a/llvm/include/llvm/ADT/Hashing.h b/llvm/include/llvm/ADT/Hashing.h
index b0ff47f4c6c89a6..4264d0267eb2743 100644
--- a/llvm/include/llvm/ADT/Hashing.h
+++ b/llvm/include/llvm/ADT/Hashing.h
@@ -72,7 +72,7 @@ template <typename T, typename Enable> struct DenseMapInfo;
 ///   using llvm::hash_value;
 ///   llvm::hash_code code = hash_value(x);
 /// \endcode
-class hash_code {
+class LLVM_CLASS_ABI hash_code {
   size_t value;
 
 public:
@@ -141,7 +141,7 @@ template <typename T> hash_code hash_value(const std::optional<T> &arg);
 /// undone. This makes it thread-hostile and very hard to use outside of
 /// immediately on start of a simple program designed for reproducible
 /// behavior.
-void set_fixed_execution_hash_seed(uint64_t fixed_value);
+LLVM_FUNC_ABI void set_fixed_execution_hash_seed(uint64_t fixed_value);
 
 
 // All of the implementation details of actually computing the various hash
@@ -266,7 +266,7 @@ inline uint64_t hash_short(const char *s, size_t length, uint64_t seed) {
 /// The intermediate state used during hashing.
 /// Currently, the algorithm for computing hash codes is based on CityHash and
 /// keeps 56 bytes of arbitrary state.
-struct hash_state {
+struct LLVM_CLASS_ABI hash_state {
   uint64_t h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0, h5 = 0, h6 = 0;
 
   /// Create a new hash_state structure and initialize it based on the
@@ -329,7 +329,7 @@ struct hash_state {
 /// This variable can be set using the \see llvm::set_fixed_execution_seed
 /// function. See that function for details. Do not, under any circumstances,
 /// set or read this variable.
-extern uint64_t fixed_seed_override;
+LLVM_FUNC_ABI extern uint64_t fixed_seed_override;
 
 inline uint64_t get_execution_seed() {
   // FIXME: This needs to be a per-execution seed. This is just a placeholder
@@ -356,7 +356,7 @@ inline uint64_t get_execution_seed() {
 // for equality. For all the platforms we care about, this holds for integers
 // and pointers, but there are platforms where it doesn't and we would like to
 // support user-defined types which happen to satisfy this property.
-template <typename T> struct is_hashable_data
+template <typename T> struct LLVM_CLASS_ABI is_hashable_data
   : std::integral_constant<bool, ((is_integral_or_enum<T>::value ||
                                    std::is_pointer<T>::value) &&
                                   64 % sizeof(T) == 0)> {};
@@ -365,7 +365,7 @@ template <typename T> struct is_hashable_data
 // is no alignment-derived padding in the pair. This is a bit of a lie because
 // std::pair isn't truly POD, but it's close enough in all reasonable
 // implementations for our use case of hashing the underlying data.
-template <typename T, typename U> struct is_hashable_data<std::pair<T, U> >
+template <typename T, typename U> struct LLVM_CLASS_ABI is_hashable_data<std::pair<T, U> >
   : std::integral_constant<bool, (is_hashable_data<T>::value &&
                                   is_hashable_data<U>::value &&
                                   (sizeof(T) + sizeof(U)) ==
@@ -505,7 +505,7 @@ namespace detail {
 /// recursive combining of arguments used in hash_combine. It is particularly
 /// useful at minimizing the code in the recursive calls to ease the pain
 /// caused by a lack of variadic functions.
-struct hash_combine_recursive_helper {
+struct LLVM_CLASS_ABI hash_combine_recursive_helper {
   char buffer[64] = {};
   hash_state state;
   const uint64_t seed;
@@ -675,7 +675,7 @@ template <typename T> hash_code hash_value(const std::optional<T> &arg) {
   return arg ? hash_combine(true, *arg) : hash_value(false);
 }
 
-template <> struct DenseMapInfo<hash_code, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<hash_code, void> {
   static inline hash_code getEmptyKey() { return hash_code(-1); }
   static inline hash_code getTombstoneKey() { return hash_code(-2); }
   static unsigned getHashValue(hash_code val) { return val; }
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index d5cf0f3df334349..1e0dcfbea863461 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -52,20 +52,20 @@ namespace llvm {
 //     Extra additions to <type_traits>
 //===----------------------------------------------------------------------===//
 
-template <typename T> struct make_const_ptr {
+template <typename T> struct LLVM_CLASS_ABI make_const_ptr {
   using type = std::add_pointer_t<std::add_const_t<T>>;
 };
 
-template <typename T> struct make_const_ref {
+template <typename T> struct LLVM_CLASS_ABI make_const_ref {
   using type = std::add_lvalue_reference_t<std::add_const_t<T>>;
 };
 
 namespace detail {
-template <class, template <class...> class Op, class... Args> struct detector {
+template <class, template <class...> class Op, class... Args> struct LLVM_CLASS_ABI detector {
   using value_t = std::false_type;
 };
 template <template <class...> class Op, class... Args>
-struct detector<std::void_t<Op<Args...>>, Op, Args...> {
+struct LLVM_CLASS_ABI detector<std::void_t<Op<Args...>>, Op, Args...> {
   using value_t = std::true_type;
 };
 } // end namespace detail
@@ -85,11 +85,11 @@ using is_detected = typename detail::detector<void, Op, Args...>::value_t;
 ///   * To access the type of an argument: Traits::arg_t<Index>
 ///   * To access the type of the result:  Traits::result_t
 template <typename T, bool isClass = std::is_class<T>::value>
-struct function_traits : public function_traits<decltype(&T::operator())> {};
+struct LLVM_CLASS_ABI function_traits : public function_traits<decltype(&T::operator())> {};
 
 /// Overload for class function types.
 template <typename ClassType, typename ReturnType, typename... Args>
-struct function_traits<ReturnType (ClassType::*)(Args...) const, false> {
+struct LLVM_CLASS_ABI function_traits<ReturnType (ClassType::*)(Args...) const, false> {
   /// The number of arguments to this function.
   enum { num_args = sizeof...(Args) };
 
@@ -102,11 +102,11 @@ struct function_traits<ReturnType (ClassType::*)(Args...) const, false> {
 };
 /// Overload for class function types.
 template <typename ClassType, typename ReturnType, typename... Args>
-struct function_traits<ReturnType (ClassType::*)(Args...), false>
+struct LLVM_CLASS_ABI function_traits<ReturnType (ClassType::*)(Args...), false>
     : public function_traits<ReturnType (ClassType::*)(Args...) const> {};
 /// Overload for non-class function types.
 template <typename ReturnType, typename... Args>
-struct function_traits<ReturnType (*)(Args...), false> {
+struct LLVM_CLASS_ABI function_traits<ReturnType (*)(Args...), false> {
   /// The number of arguments to this function.
   enum { num_args = sizeof...(Args) };
 
@@ -118,11 +118,11 @@ struct function_traits<ReturnType (*)(Args...), false> {
   using arg_t = std::tuple_element_t<i, std::tuple<Args...>>;
 };
 template <typename ReturnType, typename... Args>
-struct function_traits<ReturnType (*const)(Args...), false>
+struct LLVM_CLASS_ABI function_traits<ReturnType (*const)(Args...), false>
     : public function_traits<ReturnType (*)(Args...)> {};
 /// Overload for non-class function type references.
 template <typename ReturnType, typename... Args>
-struct function_traits<ReturnType (&)(Args...), false>
+struct LLVM_CLASS_ABI function_traits<ReturnType (&)(Args...), false>
     : public function_traits<ReturnType (*)(Args...)> {};
 
 /// traits class for checking whether type T is one of any of the given
@@ -138,10 +138,10 @@ using are_base_of = std::conjunction<std::is_base_of<T, Ts>...>;
 namespace detail {
 template <typename T, typename... Us> struct TypesAreDistinct;
 template <typename T, typename... Us>
-struct TypesAreDistinct
+struct LLVM_CLASS_ABI TypesAreDistinct
     : std::integral_constant<bool, !is_one_of<T, Us...>::value &&
                                        TypesAreDistinct<Us...>::value> {};
-template <typename T> struct TypesAreDistinct<T> : std::true_type {};
+template <typename T> struct LLVM_CLASS_ABI TypesAreDistinct<T> : std::true_type {};
 } // namespace detail
 
 /// Determine if all types in Ts are distinct.
@@ -152,9 +152,9 @@ template <typename T> struct TypesAreDistinct<T> : std::true_type {};
 /// Expensive (currently quadratic in sizeof(Ts...)), and so should only be
 /// asserted once per instantiation of a type which requires it.
 template <typename... Ts> struct TypesAreDistinct;
-template <> struct TypesAreDistinct<> : std::true_type {};
+template <> struct LLVM_CLASS_ABI TypesAreDistinct<> : std::true_type {};
 template <typename... Ts>
-struct TypesAreDistinct
+struct LLVM_CLASS_ABI TypesAreDistinct
     : std::integral_constant<bool, detail::TypesAreDistinct<Ts...>::value> {};
 
 /// Find the first index where a type appears in a list of types.
@@ -169,10 +169,10 @@ struct TypesAreDistinct
 /// if is_one_of<T, Us...>::value is false.
 template <typename T, typename... Us> struct FirstIndexOfType;
 template <typename T, typename U, typename... Us>
-struct FirstIndexOfType<T, U, Us...>
+struct LLVM_CLASS_ABI FirstIndexOfType<T, U, Us...>
     : std::integral_constant<size_t, 1 + FirstIndexOfType<T, Us...>::value> {};
 template <typename T, typename... Us>
-struct FirstIndexOfType<T, T, Us...> : std::integral_constant<size_t, 0> {};
+struct LLVM_CLASS_ABI FirstIndexOfType<T, T, Us...> : std::integral_constant<size_t, 0> {};
 
 /// Find the type at a given index in a list of types.
 ///
@@ -209,7 +209,7 @@ namespace callable_detail {
 ///  - Function object
 template <typename T,
           bool = std::is_function_v<std::remove_pointer_t<remove_cvref_t<T>>>>
-class Callable {
+class LLVM_CLASS_ABI Callable {
   using value_type = std::remove_reference_t<T>;
   using reference = value_type &;
   using const_reference = value_type const &;
@@ -261,7 +261,7 @@ class Callable {
 
 // Function specialization.  No need to waste extra space wrapping with a
 // std::optional.
-template <typename T> class Callable<T, true> {
+template <typename T> class LLVM_CLASS_ABI Callable<T, true> {
   static constexpr bool IsPtr = std::is_pointer_v<remove_cvref_t<T>>;
 
   using StorageT = std::conditional_t<IsPtr, T, std::remove_reference_t<T> *>;
@@ -346,7 +346,7 @@ template <typename T> auto drop_end(T &&RangeOrContainer, size_t N = 1) {
 template <typename ItTy, typename FuncTy,
           typename ReferenceTy =
               decltype(std::declval<FuncTy>()(*std::declval<ItTy>()))>
-class mapped_iterator
+class LLVM_CLASS_ABI mapped_iterator
     : public iterator_adaptor_base<
           mapped_iterator<ItTy, FuncTy>, ItTy,
           typename std::iterator_traits<ItTy>::iterator_category,
@@ -387,7 +387,7 @@ auto map_range(ContainerTy &&C, FuncTy F) {
 /// that defines how to map a value of the iterator to the provided reference
 /// type.
 template <typename DerivedT, typename ItTy, typename ReferenceTy>
-class mapped_iterator_base
+class LLVM_CLASS_ABI mapped_iterator_base
     : public iterator_adaptor_base<
           DerivedT, ItTy,
           typename std::iterator_traits<ItTy>::iterator_category,
@@ -408,7 +408,7 @@ class mapped_iterator_base
 };
 
 /// Helper to determine if type T has a member called rbegin().
-template <typename Ty> class has_rbegin_impl {
+template <typename Ty> class LLVM_CLASS_ABI has_rbegin_impl {
   using yes = char[1];
   using no = char[2];
 
@@ -424,7 +424,7 @@ template <typename Ty> class has_rbegin_impl {
 
 /// Metafunction to determine if T& or T has a member called rbegin().
 template <typename Ty>
-struct has_rbegin : has_rbegin_impl<std::remove_reference_t<Ty>> {};
+struct LLVM_CLASS_ABI has_rbegin : has_rbegin_impl<std::remove_reference_t<Ty>> {};
 
 // Returns an iterator_range over the given container which iterates in reverse.
 template <typename ContainerTy> auto reverse(ContainerTy &&C) {
@@ -452,7 +452,7 @@ template <typename ContainerTy> auto reverse(ContainerTy &&C) {
 /// filter_iterator_impl exists to provide support for bidirectional iteration,
 /// conditional on whether the wrapped iterator supports it.
 template <typename WrappedIteratorT, typename PredicateT, typename IterTag>
-class filter_iterator_base
+class LLVM_CLASS_ABI filter_iterator_base
     : public iterator_adaptor_base<
           filter_iterator_base<WrappedIteratorT, PredicateT, IterTag>,
           WrappedIteratorT,
@@ -504,7 +504,7 @@ class filter_iterator_base
 /// Specialization of filter_iterator_base for forward iteration only.
 template <typename WrappedIteratorT, typename PredicateT,
           typename IterTag = std::forward_iterator_tag>
-class filter_iterator_impl
+class LLVM_CLASS_ABI filter_iterator_impl
     : public filter_iterator_base<WrappedIteratorT, PredicateT, IterTag> {
 public:
   filter_iterator_impl() = default;
@@ -516,7 +516,7 @@ class filter_iterator_impl
 
 /// Specialization of filter_iterator_base for bidirectional iteration.
 template <typename WrappedIteratorT, typename PredicateT>
-class filter_iterator_impl<WrappedIteratorT, PredicateT,
+class LLVM_CLASS_ABI filter_iterator_impl<WrappedIteratorT, PredicateT,
                            std::bidirectional_iterator_tag>
     : public filter_iterator_base<WrappedIteratorT, PredicateT,
                                   std::bidirectional_iterator_tag> {
@@ -545,18 +545,18 @@ class filter_iterator_impl<WrappedIteratorT, PredicateT,
 
 namespace detail {
 
-template <bool is_bidirectional> struct fwd_or_bidi_tag_impl {
+template <bool is_bidirectional> struct LLVM_CLASS_ABI fwd_or_bidi_tag_impl {
   using type = std::forward_iterator_tag;
 };
 
-template <> struct fwd_or_bidi_tag_impl<true> {
+template <> struct LLVM_CLASS_ABI fwd_or_bidi_tag_impl<true> {
   using type = std::bidirectional_iterator_tag;
 };
 
 /// Helper which sets its type member to forward_iterator_tag if the category
 /// of \p IterT does not derive from bidirectional_iterator_tag, and to
 /// bidirectional_iterator_tag otherwise.
-template <typename IterT> struct fwd_or_bidi_tag {
+template <typename IterT> struct LLVM_CLASS_ABI fwd_or_bidi_tag {
   using type = typename fwd_or_bidi_tag_impl<std::is_base_of<
       std::bidirectional_iterator_tag,
       typename std::iterator_traits<IterT>::iterator_category>::value>::type;
@@ -608,7 +608,7 @@ make_filter_range(RangeT &&Range, PredicateT Pred) {
 /// This means you can only dereference the iterator once, and you can only
 /// increment it once between dereferences.
 template <typename WrappedIteratorT>
-class early_inc_iterator_impl
+class LLVM_CLASS_ABI early_inc_iterator_impl
     : public iterator_adaptor_base<early_inc_iterator_impl<WrappedIteratorT>,
                                    WrappedIteratorT, std::input_iterator_tag> {
   using BaseT = typename early_inc_iterator_impl::iterator_adaptor_base;
@@ -688,7 +688,7 @@ using std::declval;
 
 // We have to alias this since inlining the actual type at the usage site
 // in the parameter list of iterator_facade_base<> below ICEs MSVC 2017.
-template<typename... Iters> struct ZipTupleType {
+template<typename... Iters> struct LLVM_CLASS_ABI ZipTupleType {
   using type = std::tuple<decltype(*declval<Iters>())...>;
 };
 
@@ -709,7 +709,7 @@ using zip_traits = iterator_facade_base<
     ReferenceTupleType *, ReferenceTupleType>;
 
 template <typename ZipType, typename ReferenceTupleType, typename... Iters>
-struct zip_common : public zip_traits<ZipType, ReferenceTupleType, Iters...> {
+struct LLVM_CLASS_ABI zip_common : public zip_traits<ZipType, ReferenceTupleType, Iters...> {
   using Base = zip_traits<ZipType, ReferenceTupleType, Iters...>;
   using IndexSequence = std::index_sequence_for<Iters...>;
   using value_type = typename Base::value_type;
@@ -760,7 +760,7 @@ struct zip_common : public zip_traits<ZipType, ReferenceTupleType, Iters...> {
 };
 
 template <typename... Iters>
-struct zip_first : zip_common<zip_first<Iters...>,
+struct LLVM_CLASS_ABI zip_first : zip_common<zip_first<Iters...>,
                               typename ZipTupleType<Iters...>::type, Iters...> {
   using zip_common<zip_first, typename ZipTupleType<Iters...>::type,
                    Iters...>::zip_common;
@@ -771,7 +771,7 @@ struct zip_first : zip_common<zip_first<Iters...>,
 };
 
 template <typename... Iters>
-struct zip_shortest
+struct LLVM_CLASS_ABI zip_shortest
     : zip_common<zip_shortest<Iters...>, typename ZipTupleType<Iters...>::type,
                  Iters...> {
   using zip_common<zip_shortest, typename ZipTupleType<Iters...>::type,
@@ -798,7 +798,7 @@ struct ZippyIteratorTuple;
 /// Partial specialization for non-const tuple storage.
 template <template <typename...> class ItType, typename... Args,
           std::size_t... Ns>
-struct ZippyIteratorTuple<ItType, std::tuple<Args...>,
+struct LLVM_CLASS_ABI ZippyIteratorTuple<ItType, std::tuple<Args...>,
                           std::index_sequence<Ns...>> {
   using type = ItType<decltype(adl_begin(
       std::get<Ns>(declval<std::tuple<Args...> &>())))...>;
@@ -807,13 +807,13 @@ struct ZippyIteratorTuple<ItType, std::tuple<Args...>,
 /// Partial specialization for const tuple storage.
 template <template <typename...> class ItType, typename... Args,
           std::size_t... Ns>
-struct ZippyIteratorTuple<ItType, const std::tuple<Args...>,
+struct LLVM_CLASS_ABI ZippyIteratorTuple<ItType, const std::tuple<Args...>,
                           std::index_sequence<Ns...>> {
   using type = ItType<decltype(adl_begin(
       std::get<Ns>(declval<const std::tuple<Args...> &>())))...>;
 };
 
-template <template <typename...> class ItType, typename... Args> class zippy {
+template <template <typename...> class ItType, typename... Args> class LLVM_CLASS_ABI zippy {
 private:
   std::tuple<Args...> storage;
   using IndexSequence = std::index_sequence_for<Args...>;
@@ -909,17 +909,17 @@ auto deref_or_none(const Iter &I, const Iter &End) -> std::optional<
   return *I;
 }
 
-template <typename Iter> struct ZipLongestItemType {
+template <typename Iter> struct LLVM_CLASS_ABI ZipLongestItemType {
   using type = std::optional<std::remove_const_t<
       std::remove_reference_t<decltype(*std::declval<Iter>())>>>;
 };
 
-template <typename... Iters> struct ZipLongestTupleType {
+template <typename... Iters> struct LLVM_CLASS_ABI ZipLongestTupleType {
   using type = std::tuple<typename ZipLongestItemType<Iters>::type...>;
 };
 
 template <typename... Iters>
-class zip_longest_iterator
+class LLVM_CLASS_ABI zip_longest_iterator
     : public iterator_facade_base<
           zip_longest_iterator<Iters...>,
           std::common_type_t<
@@ -974,7 +974,7 @@ class zip_longest_iterator
   }
 };
 
-template <typename... Args> class zip_longest_range {
+template <typename... Args> class LLVM_CLASS_ABI zip_longest_range {
 public:
   using iterator =
       zip_longest_iterator<decltype(adl_begin(std::declval<Args>()))...>;
@@ -1029,7 +1029,7 @@ detail::zip_longest_range<T, U, Args...> zip_longest(T &&t, U &&u,
 /// Currently this only supports forward or higher iterator categories as
 /// inputs and always exposes a forward iterator interface.
 template <typename ValueT, typename... IterTs>
-class concat_iterator
+class LLVM_CLASS_ABI concat_iterator
     : public iterator_facade_base<concat_iterator<ValueT, IterTs...>,
                                   std::forward_iterator_tag, ValueT> {
   using BaseT = typename concat_iterator::iterator_facade_base;
@@ -1134,7 +1134,7 @@ namespace detail {
 /// This is designed to facilitate providing actual storage when temporaries
 /// are passed into the constructor such that we can use it as part of range
 /// based for loops.
-template <typename ValueT, typename... RangeTs> class concat_range {
+template <typename ValueT, typename... RangeTs> class LLVM_CLASS_ABI concat_range {
 public:
   using iterator =
       concat_iterator<ValueT,
@@ -1195,7 +1195,7 @@ detail::concat_range<ValueT, RangeTs...> concat(RangeTs &&... Ranges) {
 /// and an index. The iterator moves the index but keeps the base constant.
 template <typename DerivedT, typename BaseT, typename T,
           typename PointerT = T *, typename ReferenceT = T &>
-class indexed_accessor_iterator
+class LLVM_CLASS_ABI indexed_accessor_iterator
     : public llvm::iterator_facade_base<DerivedT,
                                         std::random_access_iterator_tag, T,
                                         std::ptrdiff_t, PointerT, ReferenceT> {
@@ -1247,7 +1247,7 @@ namespace detail {
 ///       elements.
 template <typename DerivedT, typename BaseT, typename T,
           typename PointerT = T *, typename ReferenceT = T &>
-class indexed_accessor_range_base {
+class LLVM_CLASS_ABI indexed_accessor_range_base {
 public:
   using RangeBaseT = indexed_accessor_range_base;
 
@@ -1377,7 +1377,7 @@ class indexed_accessor_range_base {
 ///     - Dereference an iterator pointing to a parent base at the given index.
 template <typename DerivedT, typename BaseT, typename T,
           typename PointerT = T *, typename ReferenceT = T &>
-class indexed_accessor_range
+class LLVM_CLASS_ABI indexed_accessor_range
     : public detail::indexed_accessor_range_base<
           DerivedT, std::pair<BaseT, ptrdiff_t>, T, PointerT, ReferenceT> {
 public:
@@ -1417,7 +1417,7 @@ namespace detail {
 /// When passing a range whose iterators return values instead of references,
 /// the reference must be dropped from `decltype((elt.first))`, which will
 /// always be a reference, to avoid returning a reference to a temporary.
-template <typename EltTy, typename FirstTy> class first_or_second_type {
+template <typename EltTy, typename FirstTy> class LLVM_CLASS_ABI first_or_second_type {
 public:
   using type = std::conditional_t<std::is_reference<EltTy>::value, FirstTy,
                                   std::remove_reference_t<FirstTy>>;
@@ -1453,7 +1453,7 @@ template <typename ContainerTy> auto make_second_range(ContainerTy &&c) {
 /// Function object to check whether the first component of a container
 /// supported by std::get (like std::pair and std::tuple) compares less than the
 /// first component of another container.
-struct less_first {
+struct LLVM_CLASS_ABI less_first {
   template <typename T> bool operator()(const T &lhs, const T &rhs) const {
     return std::less<>()(std::get<0>(lhs), std::get<0>(rhs));
   }
@@ -1462,7 +1462,7 @@ struct less_first {
 /// Function object to check whether the second component of a container
 /// supported by std::get (like std::pair and std::tuple) compares less than the
 /// second component of another container.
-struct less_second {
+struct LLVM_CLASS_ABI less_second {
   template <typename T> bool operator()(const T &lhs, const T &rhs) const {
     return std::less<>()(std::get<1>(lhs), std::get<1>(rhs));
   }
@@ -1471,7 +1471,7 @@ struct less_second {
 /// \brief Function object to apply a binary function to the first component of
 /// a std::pair.
 template<typename FuncTy>
-struct on_first {
+struct LLVM_CLASS_ABI on_first {
   FuncTy func;
 
   template <typename T>
@@ -1482,8 +1482,8 @@ struct on_first {
 
 /// Utility type to build an inheritance chain that makes it easy to rank
 /// overload candidates.
-template <int N> struct rank : rank<N - 1> {};
-template <> struct rank<0> {};
+template <int N> struct LLVM_CLASS_ABI rank : rank<N - 1> {};
+template <> struct LLVM_CLASS_ABI rank<0> {};
 
 /// traits class for checking whether type T is one of any of the given
 /// types in the variadic list.
@@ -1499,7 +1499,7 @@ namespace detail {
 template <typename... Ts> struct Visitor;
 
 template <typename HeadT, typename... TailTs>
-struct Visitor<HeadT, TailTs...> : remove_cvref_t<HeadT>, Visitor<TailTs...> {
+struct LLVM_CLASS_ABI Visitor<HeadT, TailTs...> : remove_cvref_t<HeadT>, Visitor<TailTs...> {
   explicit constexpr Visitor(HeadT &&Head, TailTs &&...Tail)
       : remove_cvref_t<HeadT>(std::forward<HeadT>(Head)),
         Visitor<TailTs...>(std::forward<TailTs>(Tail)...) {}
@@ -1507,7 +1507,7 @@ struct Visitor<HeadT, TailTs...> : remove_cvref_t<HeadT>, Visitor<TailTs...> {
   using Visitor<TailTs...>::operator();
 };
 
-template <typename HeadT> struct Visitor<HeadT> : remove_cvref_t<HeadT> {
+template <typename HeadT> struct LLVM_CLASS_ABI Visitor<HeadT> : remove_cvref_t<HeadT> {
   explicit constexpr Visitor(HeadT &&Head)
       : remove_cvref_t<HeadT>(std::forward<HeadT>(Head)) {}
   using remove_cvref_t<HeadT>::operator();
@@ -2143,14 +2143,14 @@ inline void interleaveComma(const Container &c, StreamT &os) {
 //     Extra additions to <memory>
 //===----------------------------------------------------------------------===//
 
-struct FreeDeleter {
+struct LLVM_CLASS_ABI FreeDeleter {
   void operator()(void* v) {
     ::free(v);
   }
 };
 
 template<typename First, typename Second>
-struct pair_hash {
+struct LLVM_CLASS_ABI pair_hash {
   size_t operator()(const std::pair<First, Second> &P) const {
     return std::hash<First>()(P.first) * 31 + std::hash<Second>()(P.second);
   }
@@ -2158,7 +2158,7 @@ struct pair_hash {
 
 /// Binary functor that adapts to any other binary functor after dereferencing
 /// operands.
-template <typename T> struct deref {
+template <typename T> struct LLVM_CLASS_ABI deref {
   T func;
 
   // Could be further improved to cope with non-derivable functors and
@@ -2191,7 +2191,7 @@ using EnumeratorTupleType = enumerator_result<decltype(*declval<Iters>())...>;
 /// This is similar to `std::vector<bool>::iterator` that returns bit reference
 /// wrappers on dereference.
 template <typename... Iters>
-struct zip_enumerator : zip_common<zip_enumerator<Iters...>,
+struct LLVM_CLASS_ABI zip_enumerator : zip_common<zip_enumerator<Iters...>,
                                    EnumeratorTupleType<Iters...>, Iters...> {
   static_assert(sizeof...(Iters) >= 2, "Expected at least two iteratees");
   using zip_common<zip_enumerator<Iters...>, EnumeratorTupleType<Iters...>,
@@ -2202,7 +2202,7 @@ struct zip_enumerator : zip_common<zip_enumerator<Iters...>,
   }
 };
 
-template <typename... Refs> struct enumerator_result<std::size_t, Refs...> {
+template <typename... Refs> struct LLVM_CLASS_ABI enumerator_result<std::size_t, Refs...> {
   static constexpr std::size_t NumRefs = sizeof...(Refs);
   static_assert(NumRefs != 0);
   // `NumValues` includes the index.
@@ -2273,7 +2273,7 @@ template <typename... Refs> struct enumerator_result<std::size_t, Refs...> {
 };
 
 /// Infinite stream of increasing 0-based `size_t` indices.
-struct index_stream {
+struct LLVM_CLASS_ABI index_stream {
   struct iterator : iterator_facade_base<iterator, std::forward_iterator_tag,
                                          const iterator> {
     iterator &operator++() {
@@ -2491,15 +2491,15 @@ template <class T> constexpr T *to_address(T *P) { return P; }
 
 namespace std {
 template <typename... Refs>
-struct tuple_size<llvm::detail::enumerator_result<Refs...>>
+struct LLVM_CLASS_ABI tuple_size<llvm::detail::enumerator_result<Refs...>>
     : std::integral_constant<std::size_t, sizeof...(Refs)> {};
 
 template <std::size_t I, typename... Refs>
-struct tuple_element<I, llvm::detail::enumerator_result<Refs...>>
+struct LLVM_CLASS_ABI tuple_element<I, llvm::detail::enumerator_result<Refs...>>
     : std::tuple_element<I, std::tuple<Refs...>> {};
 
 template <std::size_t I, typename... Refs>
-struct tuple_element<I, const llvm::detail::enumerator_result<Refs...>>
+struct LLVM_CLASS_ABI tuple_element<I, const llvm::detail::enumerator_result<Refs...>>
     : std::tuple_element<I, std::tuple<Refs...>> {};
 
 } // namespace std
diff --git a/llvm/include/llvm/ADT/STLForwardCompat.h b/llvm/include/llvm/ADT/STLForwardCompat.h
index 97d0bff9aaedbd5..8944ac98a45049f 100644
--- a/llvm/include/llvm/ADT/STLForwardCompat.h
+++ b/llvm/include/llvm/ADT/STLForwardCompat.h
@@ -27,7 +27,7 @@ namespace llvm {
 //===----------------------------------------------------------------------===//
 
 template <typename T>
-struct remove_cvref // NOLINT(readability-identifier-naming)
+struct LLVM_CLASS_ABI remove_cvref // NOLINT(readability-identifier-naming)
 {
   using type = std::remove_cv_t<std::remove_reference_t<T>>;
 };
diff --git a/llvm/include/llvm/ADT/STLFunctionalExtras.h b/llvm/include/llvm/ADT/STLFunctionalExtras.h
index dd7fc6dc7486455..2b086966191f069 100644
--- a/llvm/include/llvm/ADT/STLFunctionalExtras.h
+++ b/llvm/include/llvm/ADT/STLFunctionalExtras.h
@@ -36,7 +36,7 @@ namespace llvm {
 template<typename Fn> class function_ref;
 
 template<typename Ret, typename ...Params>
-class function_ref<Ret(Params...)> {
+class LLVM_CLASS_ABI function_ref<Ret(Params...)> {
   Ret (*callback)(intptr_t callable, Params ...params) = nullptr;
   intptr_t callable;
 
diff --git a/llvm/include/llvm/ADT/SmallString.h b/llvm/include/llvm/ADT/SmallString.h
index 5d63a780d0c6902..e706f4cb47958fd 100644
--- a/llvm/include/llvm/ADT/SmallString.h
+++ b/llvm/include/llvm/ADT/SmallString.h
@@ -24,7 +24,7 @@ namespace llvm {
 /// SmallString - A SmallString is just a SmallVector with methods and accessors
 /// that make it work better as a string (e.g. operator+ etc).
 template<unsigned InternalLen>
-class SmallString : public SmallVector<char, InternalLen> {
+class LLVM_CLASS_ABI SmallString : public SmallVector<char, InternalLen> {
 public:
   /// Default ctor - Initialize to empty.
   SmallString() = default;
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index 93d94916745d2bb..61d3dc51e0e33e6 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -49,7 +49,7 @@ using EnableIfConvertibleToInputIterator = std::enable_if_t<std::is_convertible<
 /// Using 64 bit size is desirable for cases like SmallVector<char>, where a
 /// 32 bit size would limit the vector to ~4GB. SmallVectors are used for
 /// buffering bitcode output - which can exceed 4GB.
-template <class Size_T> class SmallVectorBase {
+template <class Size_T> class LLVM_CLASS_ABI SmallVectorBase {
 protected:
   void *BeginX;
   Size_T Size = 0, Capacity;
@@ -110,7 +110,7 @@ using SmallVectorSizeType =
                        uint32_t>;
 
 /// Figure out the offset of the first element.
-template <class T, typename = void> struct SmallVectorAlignmentAndSize {
+template <class T, typename = void> struct LLVM_CLASS_ABI SmallVectorAlignmentAndSize {
   alignas(SmallVectorBase<SmallVectorSizeType<T>>) char Base[sizeof(
       SmallVectorBase<SmallVectorSizeType<T>>)];
   alignas(T) char FirstEl[sizeof(T)];
@@ -120,7 +120,7 @@ template <class T, typename = void> struct SmallVectorAlignmentAndSize {
 /// the type T is a POD. The extra dummy template argument is used by ArrayRef
 /// to avoid unnecessarily requiring T to be complete.
 template <typename T, typename = void>
-class SmallVectorTemplateCommon
+class LLVM_CLASS_ABI SmallVectorTemplateCommon
     : public SmallVectorBase<SmallVectorSizeType<T>> {
   using Base = SmallVectorBase<SmallVectorSizeType<T>>;
 
@@ -329,7 +329,7 @@ class SmallVectorTemplateCommon
 template <typename T, bool = (is_trivially_copy_constructible<T>::value) &&
                              (is_trivially_move_constructible<T>::value) &&
                              std::is_trivially_destructible<T>::value>
-class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
+class LLVM_CLASS_ABI SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
   friend class SmallVectorTemplateCommon<T>;
 
 protected:
@@ -476,7 +476,7 @@ void SmallVectorTemplateBase<T, TriviallyCopyable>::takeAllocationForGrow(
 /// T's. This allows using memcpy in place of copy/move construction and
 /// skipping destruction.
 template <typename T>
-class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
+class LLVM_CLASS_ABI SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
   friend class SmallVectorTemplateCommon<T>;
 
 protected:
@@ -574,7 +574,7 @@ class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
 /// This class consists of common code factored out of the SmallVector class to
 /// reduce code duplication based on the SmallVector 'N' template parameter.
 template <typename T>
-class SmallVectorImpl : public SmallVectorTemplateBase<T> {
+class LLVM_CLASS_ABI SmallVectorImpl : public SmallVectorTemplateBase<T> {
   using SuperClass = SmallVectorTemplateBase<T>;
 
 public:
@@ -1111,14 +1111,14 @@ SmallVectorImpl<T> &SmallVectorImpl<T>::operator=(SmallVectorImpl<T> &&RHS) {
 /// Storage for the SmallVector elements.  This is specialized for the N=0 case
 /// to avoid allocating unnecessary storage.
 template <typename T, unsigned N>
-struct SmallVectorStorage {
+struct LLVM_CLASS_ABI SmallVectorStorage {
   alignas(T) char InlineElts[N * sizeof(T)];
 };
 
 /// We need the storage to be properly aligned even for small-size of 0 so that
 /// the pointer math in \a SmallVectorTemplateCommon::getFirstEl() is
 /// well-defined.
-template <typename T> struct alignas(T) SmallVectorStorage<T, 0> {};
+template <typename T> struct LLVM_CLASS_ABI alignas(T) SmallVectorStorage<T, 0> {};
 
 /// Forward declaration of SmallVector so that
 /// calculateSmallVectorDefaultInlinedElements can reference
@@ -1130,7 +1130,7 @@ template <typename T, unsigned N> class LLVM_GSL_OWNER SmallVector;
 ///
 /// This should be migrated to a constexpr function when our minimum
 /// compiler support is enough for multi-statement constexpr functions.
-template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
+template <typename T> struct LLVM_CLASS_ABI CalculateSmallVectorDefaultInlinedElements {
   // Parameter controlling the default number of inlined elements
   // for `SmallVector<T>`.
   //
@@ -1196,7 +1196,7 @@ template <typename T> struct CalculateSmallVectorDefaultInlinedElements {
 /// \see https://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h
 template <typename T,
           unsigned N = CalculateSmallVectorDefaultInlinedElements<T>::value>
-class LLVM_GSL_OWNER SmallVector : public SmallVectorImpl<T>,
+class LLVM_CLASS_ABI LLVM_GSL_OWNER SmallVector : public SmallVectorImpl<T>,
                                    SmallVectorStorage<T, N> {
 public:
   SmallVector() : SmallVectorImpl<T>(N) {}
diff --git a/llvm/include/llvm/ADT/StringExtras.h b/llvm/include/llvm/ADT/StringExtras.h
index 1e7f05bc3be86c0..13f48af846573ec 100644
--- a/llvm/include/llvm/ADT/StringExtras.h
+++ b/llvm/include/llvm/ADT/StringExtras.h
@@ -330,7 +330,7 @@ inline std::string toString(const APSInt &I, unsigned Radix) {
 /// 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_FUNC_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
@@ -338,12 +338,12 @@ StringRef::size_type StrInStrNoCase(StringRef s1, StringRef s2);
 /// 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.
-std::pair<StringRef, StringRef> getToken(StringRef Source,
+LLVM_FUNC_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.
-void SplitString(StringRef Source,
+LLVM_FUNC_ABI void SplitString(StringRef Source,
                  SmallVectorImpl<StringRef> &OutFragments,
                  StringRef Delimiters = " \t\n\v\f\r");
 
@@ -368,25 +368,25 @@ inline StringRef getOrdinalSuffix(unsigned Val) {
 
 /// 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_FUNC_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_FUNC_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_FUNC_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_FUNC_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_FUNC_ABI std::string convertToCamelFromSnakeCase(StringRef input,
                                         bool capitalizeFirst = false);
 
 namespace detail {
@@ -499,7 +499,7 @@ inline std::string join_items(Sep Separator, Args &&... Items) {
 ///   for (auto &I : C)
 ///     OS << LS << I.getName();
 /// \end
-class ListSeparator {
+class LLVM_CLASS_ABI ListSeparator {
   bool First = true;
   StringRef Separator;
 
@@ -515,7 +515,7 @@ class ListSeparator {
 };
 
 /// A forward iterator over partitions of string over a separator.
-class SplittingIterator
+class LLVM_CLASS_ABI SplittingIterator
     : public iterator_facade_base<SplittingIterator, std::forward_iterator_tag,
                                   StringRef> {
   char SeparatorStorage;
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h
index 235a7b27c384406..bcde6326d1b20a1 100644
--- a/llvm/include/llvm/ADT/StringRef.h
+++ b/llvm/include/llvm/ADT/StringRef.h
@@ -31,14 +31,14 @@ namespace llvm {
   class StringRef;
 
   /// Helper functions for StringRef::getAsInteger.
-  bool getAsUnsignedInteger(StringRef Str, unsigned Radix,
+  LLVM_FUNC_ABI bool getAsUnsignedInteger(StringRef Str, unsigned Radix,
                             unsigned long long &Result);
 
-  bool getAsSignedInteger(StringRef Str, unsigned Radix, long long &Result);
+  LLVM_FUNC_ABI bool getAsSignedInteger(StringRef Str, unsigned Radix, long long &Result);
 
-  bool consumeUnsignedInteger(StringRef &Str, unsigned Radix,
+  LLVM_FUNC_ABI bool consumeUnsignedInteger(StringRef &Str, unsigned Radix,
                               unsigned long long &Result);
-  bool consumeSignedInteger(StringRef &Str, unsigned Radix, long long &Result);
+  LLVM_FUNC_ABI bool consumeSignedInteger(StringRef &Str, unsigned Radix, long long &Result);
 
   /// StringRef - Represent a constant reference to a string, i.e. a character
   /// array and a length, which need not be null terminated.
@@ -47,7 +47,7 @@ namespace llvm {
   /// 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_CLASS_ABI LLVM_GSL_POINTER StringRef {
   public:
     static constexpr size_t npos = ~size_t(0);
 
@@ -854,7 +854,7 @@ namespace llvm {
   ///
   /// constexpr StringLiteral S("test");
   ///
-  class StringLiteral : public StringRef {
+  class LLVM_CLASS_ABI StringLiteral : public StringRef {
   private:
     constexpr StringLiteral(const char *Str, size_t N) : StringRef(Str, N) {
     }
@@ -911,10 +911,10 @@ namespace llvm {
   /// @}
 
   /// Compute a hash_code for a StringRef.
-  [[nodiscard]] hash_code hash_value(StringRef S);
+  [[nodiscard]] LLVM_FUNC_ABI hash_code hash_value(StringRef S);
 
   // Provide DenseMapInfo for StringRefs.
-  template <> struct DenseMapInfo<StringRef, void> {
+  template <> struct LLVM_CLASS_ABI DenseMapInfo<StringRef, void> {
     static inline StringRef getEmptyKey() {
       return StringRef(
           reinterpret_cast<const char *>(~static_cast<uintptr_t>(0)), 0);
diff --git a/llvm/include/llvm/ADT/Twine.h b/llvm/include/llvm/ADT/Twine.h
index 547af57cad81423..d90085426f2ef62 100644
--- a/llvm/include/llvm/ADT/Twine.h
+++ b/llvm/include/llvm/ADT/Twine.h
@@ -79,7 +79,7 @@ namespace llvm {
   /// 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_CLASS_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/ADT/bit.h b/llvm/include/llvm/ADT/bit.h
index 2840c5f608d3ea8..0dd55e31da0a8c9 100644
--- a/llvm/include/llvm/ADT/bit.h
+++ b/llvm/include/llvm/ADT/bit.h
@@ -112,7 +112,7 @@ template <typename T, typename = std::enable_if_t<std::is_unsigned_v<T>>>
 }
 
 namespace detail {
-template <typename T, std::size_t SizeOfT> struct TrailingZerosCounter {
+template <typename T, std::size_t SizeOfT> struct LLVM_CLASS_ABI TrailingZerosCounter {
   static unsigned count(T Val) {
     if (!Val)
       return std::numeric_limits<T>::digits;
@@ -136,7 +136,7 @@ template <typename T, std::size_t SizeOfT> struct TrailingZerosCounter {
 };
 
 #if defined(__GNUC__) || defined(_MSC_VER)
-template <typename T> struct TrailingZerosCounter<T, 4> {
+template <typename T> struct LLVM_CLASS_ABI TrailingZerosCounter<T, 4> {
   static unsigned count(T Val) {
     if (Val == 0)
       return 32;
@@ -152,7 +152,7 @@ template <typename T> struct TrailingZerosCounter<T, 4> {
 };
 
 #if !defined(_MSC_VER) || defined(_M_X64)
-template <typename T> struct TrailingZerosCounter<T, 8> {
+template <typename T> struct LLVM_CLASS_ABI TrailingZerosCounter<T, 8> {
   static unsigned count(T Val) {
     if (Val == 0)
       return 64;
@@ -183,7 +183,7 @@ template <typename T> [[nodiscard]] int countr_zero(T Val) {
 }
 
 namespace detail {
-template <typename T, std::size_t SizeOfT> struct LeadingZerosCounter {
+template <typename T, std::size_t SizeOfT> struct LLVM_CLASS_ABI LeadingZerosCounter {
   static unsigned count(T Val) {
     if (!Val)
       return std::numeric_limits<T>::digits;
@@ -202,7 +202,7 @@ template <typename T, std::size_t SizeOfT> struct LeadingZerosCounter {
 };
 
 #if defined(__GNUC__) || defined(_MSC_VER)
-template <typename T> struct LeadingZerosCounter<T, 4> {
+template <typename T> struct LLVM_CLASS_ABI LeadingZerosCounter<T, 4> {
   static unsigned count(T Val) {
     if (Val == 0)
       return 32;
@@ -218,7 +218,7 @@ template <typename T> struct LeadingZerosCounter<T, 4> {
 };
 
 #if !defined(_MSC_VER) || defined(_M_X64)
-template <typename T> struct LeadingZerosCounter<T, 8> {
+template <typename T> struct LLVM_CLASS_ABI LeadingZerosCounter<T, 8> {
   static unsigned count(T Val) {
     if (Val == 0)
       return 64;
@@ -312,7 +312,7 @@ template <typename T> [[nodiscard]] T bit_ceil(T Value) {
 }
 
 namespace detail {
-template <typename T, std::size_t SizeOfT> struct PopulationCounter {
+template <typename T, std::size_t SizeOfT> struct LLVM_CLASS_ABI PopulationCounter {
   static int count(T Value) {
     // Generic version, forward to 32 bits.
     static_assert(SizeOfT <= 4, "Not implemented!");
@@ -327,7 +327,7 @@ template <typename T, std::size_t SizeOfT> struct PopulationCounter {
   }
 };
 
-template <typename T> struct PopulationCounter<T, 8> {
+template <typename T> struct LLVM_CLASS_ABI PopulationCounter<T, 8> {
   static int count(T Value) {
 #if defined(__GNUC__)
     return (int)__builtin_popcountll(Value);
diff --git a/llvm/include/llvm/ADT/identity.h b/llvm/include/llvm/ADT/identity.h
index 7309032362077ee..6e73d7f2c77bb7f 100644
--- a/llvm/include/llvm/ADT/identity.h
+++ b/llvm/include/llvm/ADT/identity.h
@@ -19,7 +19,7 @@
 namespace llvm {
 
 // Similar to `std::identity` from C++20.
-template <class Ty> struct identity {
+template <class Ty> struct LLVM_CLASS_ABI identity {
   using is_transparent = void;
   using argument_type = Ty;
 
diff --git a/llvm/include/llvm/ADT/iterator.h b/llvm/include/llvm/ADT/iterator.h
index 23065ea71cedad6..cd1e381d2226659 100644
--- a/llvm/include/llvm/ADT/iterator.h
+++ b/llvm/include/llvm/ADT/iterator.h
@@ -78,7 +78,7 @@ namespace llvm {
 template <typename DerivedT, typename IteratorCategoryT, typename T,
           typename DifferenceTypeT = std::ptrdiff_t, typename PointerT = T *,
           typename ReferenceT = T &>
-class iterator_facade_base {
+class LLVM_CLASS_ABI iterator_facade_base {
 public:
   using iterator_category = IteratorCategoryT;
   using value_type = T;
@@ -233,7 +233,7 @@ template <
         std::is_same<T, typename std::iterator_traits<
                             WrappedIteratorT>::value_type>::value,
         typename std::iterator_traits<WrappedIteratorT>::reference, T &>>
-class iterator_adaptor_base
+class LLVM_CLASS_ABI iterator_adaptor_base
     : public iterator_facade_base<DerivedT, IteratorCategoryT, T,
                                   DifferenceTypeT, PointerT, ReferenceT> {
   using BaseT = typename iterator_adaptor_base::iterator_facade_base;
@@ -318,7 +318,7 @@ class iterator_adaptor_base
 template <typename WrappedIteratorT,
           typename T = std::remove_reference_t<decltype(
               **std::declval<WrappedIteratorT>())>>
-struct pointee_iterator
+struct LLVM_CLASS_ABI pointee_iterator
     : iterator_adaptor_base<
           pointee_iterator<WrappedIteratorT, T>, WrappedIteratorT,
           typename std::iterator_traits<WrappedIteratorT>::iterator_category,
@@ -342,7 +342,7 @@ make_pointee_range(RangeT &&Range) {
 
 template <typename WrappedIteratorT,
           typename T = decltype(&*std::declval<WrappedIteratorT>())>
-class pointer_iterator
+class LLVM_CLASS_ABI pointer_iterator
     : public iterator_adaptor_base<
           pointer_iterator<WrappedIteratorT, T>, WrappedIteratorT,
           typename std::iterator_traits<WrappedIteratorT>::iterator_category,
diff --git a/llvm/include/llvm/ADT/iterator_range.h b/llvm/include/llvm/ADT/iterator_range.h
index 05379c114f7ca28..dd8cfd5e6ab5617 100644
--- a/llvm/include/llvm/ADT/iterator_range.h
+++ b/llvm/include/llvm/ADT/iterator_range.h
@@ -25,10 +25,10 @@
 namespace llvm {
 
 template <typename From, typename To, typename = void>
-struct explicitly_convertible : std::false_type {};
+struct LLVM_CLASS_ABI explicitly_convertible : std::false_type {};
 
 template <typename From, typename To>
-struct explicitly_convertible<
+struct LLVM_CLASS_ABI explicitly_convertible<
     From, To,
     std::void_t<decltype(static_cast<To>(
         std::declval<std::add_rvalue_reference_t<From>>()))>> : std::true_type {
@@ -39,7 +39,7 @@ struct explicitly_convertible<
 /// This just wraps two iterators into a range-compatible interface. Nothing
 /// fancy at all.
 template <typename IteratorT>
-class iterator_range {
+class LLVM_CLASS_ABI iterator_range {
   IteratorT begin_iterator, end_iterator;
 
 public:
diff --git a/llvm/include/llvm/Support/AlignOf.h b/llvm/include/llvm/Support/AlignOf.h
index f586d7f182aab6e..6a9cff27d1efafe 100644
--- a/llvm/include/llvm/Support/AlignOf.h
+++ b/llvm/include/llvm/Support/AlignOf.h
@@ -24,7 +24,7 @@ namespace llvm {
 /// use it due to a bug in the MSVC x86 compiler:
 /// https://github.com/microsoft/STL/issues/1533
 /// Using `alignas` here works around the bug.
-template <typename T, typename... Ts> struct AlignedCharArrayUnion {
+template <typename T, typename... Ts> struct LLVM_CLASS_ABI AlignedCharArrayUnion {
   using AlignedUnion = std::aligned_union_t<1, T, Ts...>;
   alignas(alignof(AlignedUnion)) char buffer[sizeof(AlignedUnion)];
 };
diff --git a/llvm/include/llvm/Support/Debug.h b/llvm/include/llvm/Support/Debug.h
index a921bd5aa294e95..e05b089c21cc5ec 100644
--- a/llvm/include/llvm/Support/Debug.h
+++ b/llvm/include/llvm/Support/Debug.h
@@ -78,7 +78,7 @@ void setCurrentDebugTypes(const char **Types, unsigned Count);
 /// is specified.  This should probably not be referenced directly, instead, use
 /// the DEBUG macro below.
 ///
-extern bool DebugFlag;
+LLVM_FUNC_ABI extern bool DebugFlag;
 
 /// EnableDebugBuffering - This defaults to false.  If true, the debug
 /// stream will install signal handlers to dump any buffered debug
@@ -86,12 +86,12 @@ extern bool DebugFlag;
 /// to install signal handlers if they are certain there will be no
 /// conflict.
 ///
-extern bool EnableDebugBuffering;
+LLVM_FUNC_ABI extern 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_FUNC_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/Error.h b/llvm/include/llvm/Support/Error.h
index 0f1b6321762d0ca..f63553ddae920c5 100644
--- a/llvm/include/llvm/Support/Error.h
+++ b/llvm/include/llvm/Support/Error.h
@@ -44,7 +44,7 @@ class ErrorSuccess;
 
 /// Base class for error info classes. Do not extend this directly: Extend
 /// the ErrorInfo template subclass instead.
-class ErrorInfoBase {
+class LLVM_CLASS_ABI ErrorInfoBase {
 public:
   virtual ~ErrorInfoBase() = default;
 
@@ -153,7 +153,7 @@ class ErrorInfoBase {
 /// *All* Error instances must be checked before destruction, even if
 /// they're moved-assigned or constructed from Success values that have already
 /// been checked. This enforces checking through all levels of the call stack.
-class [[nodiscard]] Error {
+class LLVM_CLASS_ABI [[nodiscard]] Error {
   // ErrorList needs to be able to yank ErrorInfoBase pointers out of Errors
   // to add to the error list. It can't rely on handleErrors for this, since
   // handleErrors does not support ErrorList handlers.
@@ -168,7 +168,7 @@ class [[nodiscard]] Error {
   template <typename T> friend class Expected;
 
   // wrap needs to be able to steal the payload.
-  friend LLVMErrorRef wrap(Error);
+  friend LLVM_FUNC_ABI LLVMErrorRef wrap(Error);
 
 protected:
   /// Create a success value. Prefer using 'Error::success()' for readability
@@ -325,7 +325,7 @@ class [[nodiscard]] Error {
 /// Subclass of Error for the sole purpose of identifying the success path in
 /// the type system. This allows to catch invalid conversion to Expected<T> at
 /// compile time.
-class ErrorSuccess final : public Error {};
+class LLVM_CLASS_ABI ErrorSuccess final : public Error {};
 
 inline ErrorSuccess Error::success() { return ErrorSuccess(); }
 
@@ -345,7 +345,7 @@ template <typename ErrT, typename... ArgTs> Error make_error(ArgTs &&... Args) {
 /// This class provides an implementation of the ErrorInfoBase::kind
 /// method, which is used by the Error RTTI system.
 template <typename ThisErrT, typename ParentErrT = ErrorInfoBase>
-class ErrorInfo : public ParentErrT {
+class LLVM_CLASS_ABI ErrorInfo : public ParentErrT {
 public:
   using ParentErrT::ParentErrT; // inherit constructors
 
@@ -360,14 +360,14 @@ class ErrorInfo : public ParentErrT {
 
 /// Special ErrorInfo subclass representing a list of ErrorInfos.
 /// Instances of this class are constructed by joinError.
-class ErrorList final : public ErrorInfo<ErrorList> {
+class LLVM_CLASS_ABI ErrorList final : public ErrorInfo<ErrorList> {
   // handleErrors needs to be able to iterate the payload list of an
   // ErrorList.
   template <typename... HandlerTs>
   friend Error handleErrors(Error E, HandlerTs &&... Handlers);
 
   // joinErrors is implemented in terms of join.
-  friend Error joinErrors(Error, Error);
+  friend LLVM_FUNC_ABI Error joinErrors(Error, Error);
 
 public:
   void log(raw_ostream &OS) const override {
@@ -467,7 +467,7 @@ inline Error joinErrors(Error E1, Error E2) {
 ///  For unit-testing a function returning an 'Expected<T>', see the
 ///  'EXPECT_THAT_EXPECTED' macros in llvm/Testing/Support/Error.h
 
-template <class T> class [[nodiscard]] Expected {
+template <class T> class LLVM_CLASS_ABI [[nodiscard]] Expected {
   template <class T1> friend class ExpectedAsOutParameter;
   template <class OtherT> friend class Expected;
 
@@ -727,7 +727,7 @@ template <class T> class [[nodiscard]] Expected {
 
 /// 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_FUNC_ABI void report_fatal_error(Error Err, bool gen_crash_diag = true);
 
 /// Report a fatal error if Err is a failure value.
 ///
@@ -821,12 +821,12 @@ T& cantFail(Expected<T&> ValOrErr, const char *Msg = nullptr) {
 /// Helper for testing applicability of, and applying, handlers for
 /// ErrorInfo types.
 template <typename HandlerT>
-class ErrorHandlerTraits
+class LLVM_CLASS_ABI ErrorHandlerTraits
     : public ErrorHandlerTraits<
           decltype(&std::remove_reference_t<HandlerT>::operator())> {};
 
 // Specialization functions of the form 'Error (const ErrT&)'.
-template <typename ErrT> class ErrorHandlerTraits<Error (&)(ErrT &)> {
+template <typename ErrT> class LLVM_CLASS_ABI ErrorHandlerTraits<Error (&)(ErrT &)> {
 public:
   static bool appliesTo(const ErrorInfoBase &E) {
     return E.template isA<ErrT>();
@@ -840,7 +840,7 @@ template <typename ErrT> class ErrorHandlerTraits<Error (&)(ErrT &)> {
 };
 
 // Specialization functions of the form 'void (const ErrT&)'.
-template <typename ErrT> class ErrorHandlerTraits<void (&)(ErrT &)> {
+template <typename ErrT> class LLVM_CLASS_ABI ErrorHandlerTraits<void (&)(ErrT &)> {
 public:
   static bool appliesTo(const ErrorInfoBase &E) {
     return E.template isA<ErrT>();
@@ -856,7 +856,7 @@ template <typename ErrT> class ErrorHandlerTraits<void (&)(ErrT &)> {
 
 /// Specialization for functions of the form 'Error (std::unique_ptr<ErrT>)'.
 template <typename ErrT>
-class ErrorHandlerTraits<Error (&)(std::unique_ptr<ErrT>)> {
+class LLVM_CLASS_ABI ErrorHandlerTraits<Error (&)(std::unique_ptr<ErrT>)> {
 public:
   static bool appliesTo(const ErrorInfoBase &E) {
     return E.template isA<ErrT>();
@@ -872,7 +872,7 @@ class ErrorHandlerTraits<Error (&)(std::unique_ptr<ErrT>)> {
 
 /// Specialization for functions of the form 'void (std::unique_ptr<ErrT>)'.
 template <typename ErrT>
-class ErrorHandlerTraits<void (&)(std::unique_ptr<ErrT>)> {
+class LLVM_CLASS_ABI ErrorHandlerTraits<void (&)(std::unique_ptr<ErrT>)> {
 public:
   static bool appliesTo(const ErrorInfoBase &E) {
     return E.template isA<ErrT>();
@@ -889,34 +889,34 @@ class ErrorHandlerTraits<void (&)(std::unique_ptr<ErrT>)> {
 
 // Specialization for member functions of the form 'RetT (const ErrT&)'.
 template <typename C, typename RetT, typename ErrT>
-class ErrorHandlerTraits<RetT (C::*)(ErrT &)>
+class LLVM_CLASS_ABI ErrorHandlerTraits<RetT (C::*)(ErrT &)>
     : public ErrorHandlerTraits<RetT (&)(ErrT &)> {};
 
 // Specialization for member functions of the form 'RetT (const ErrT&) const'.
 template <typename C, typename RetT, typename ErrT>
-class ErrorHandlerTraits<RetT (C::*)(ErrT &) const>
+class LLVM_CLASS_ABI ErrorHandlerTraits<RetT (C::*)(ErrT &) const>
     : public ErrorHandlerTraits<RetT (&)(ErrT &)> {};
 
 // Specialization for member functions of the form 'RetT (const ErrT&)'.
 template <typename C, typename RetT, typename ErrT>
-class ErrorHandlerTraits<RetT (C::*)(const ErrT &)>
+class LLVM_CLASS_ABI ErrorHandlerTraits<RetT (C::*)(const ErrT &)>
     : public ErrorHandlerTraits<RetT (&)(ErrT &)> {};
 
 // Specialization for member functions of the form 'RetT (const ErrT&) const'.
 template <typename C, typename RetT, typename ErrT>
-class ErrorHandlerTraits<RetT (C::*)(const ErrT &) const>
+class LLVM_CLASS_ABI ErrorHandlerTraits<RetT (C::*)(const ErrT &) const>
     : public ErrorHandlerTraits<RetT (&)(ErrT &)> {};
 
 /// Specialization for member functions of the form
 /// 'RetT (std::unique_ptr<ErrT>)'.
 template <typename C, typename RetT, typename ErrT>
-class ErrorHandlerTraits<RetT (C::*)(std::unique_ptr<ErrT>)>
+class LLVM_CLASS_ABI ErrorHandlerTraits<RetT (C::*)(std::unique_ptr<ErrT>)>
     : public ErrorHandlerTraits<RetT (&)(std::unique_ptr<ErrT>)> {};
 
 /// Specialization for member functions of the form
 /// 'RetT (std::unique_ptr<ErrT>) const'.
 template <typename C, typename RetT, typename ErrT>
-class ErrorHandlerTraits<RetT (C::*)(std::unique_ptr<ErrT>) const>
+class LLVM_CLASS_ABI ErrorHandlerTraits<RetT (C::*)(std::unique_ptr<ErrT>) const>
     : public ErrorHandlerTraits<RetT (&)(std::unique_ptr<ErrT>)> {};
 
 inline Error handleErrorImpl(std::unique_ptr<ErrorInfoBase> Payload) {
@@ -1021,7 +1021,7 @@ Expected<T> handleExpected(Expected<T> ValOrErr, RecoveryFtor &&RecoveryPath,
 /// 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_FUNC_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.
@@ -1101,7 +1101,7 @@ inline bool errorToBool(Error Err) {
 /// created inside every condition that verified that Error was non-null. By
 /// taking an Error pointer we can just create one instance at the top of the
 /// function.
-class ErrorAsOutParameter {
+class LLVM_CLASS_ABI ErrorAsOutParameter {
 public:
   ErrorAsOutParameter(Error *Err) : Err(Err) {
     // Raise the checked bit if Err is success.
@@ -1123,7 +1123,7 @@ class ErrorAsOutParameter {
 ///
 /// See ErrorAsOutParameter.
 template <typename T>
-class ExpectedAsOutParameter {
+class LLVM_CLASS_ABI ExpectedAsOutParameter {
 public:
   ExpectedAsOutParameter(Expected<T> *ValOrErr)
     : ValOrErr(ValOrErr) {
@@ -1145,8 +1145,8 @@ class ExpectedAsOutParameter {
 /// 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_CLASS_ABI ECError : public ErrorInfo<ECError> {
+  friend LLVM_FUNC_ABI Error errorCodeToError(std::error_code);
 
   void anchor() override;
 
@@ -1171,16 +1171,16 @@ class ECError : public ErrorInfo<ECError> {
 /// 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_FUNC_ABI std::error_code inconvertibleErrorCode();
 
 /// Helper for converting an std::error_code to a Error.
-Error errorCodeToError(std::error_code EC);
+LLVM_FUNC_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_FUNC_ABI std::error_code errorToErrorCode(Error Err);
 
 /// Convert an ErrorOr<T> to an Expected<T>.
 template <typename T> Expected<T> errorOrToExpected(ErrorOr<T> &&EO) {
@@ -1220,7 +1220,7 @@ template <typename T> ErrorOr<T> expectedToErrorOr(Expected<T> &&E) {
 ///   }
 ///   @endcode
 ///
-class StringError : public ErrorInfo<StringError> {
+class LLVM_CLASS_ABI StringError : public ErrorInfo<StringError> {
 public:
   static char ID;
 
@@ -1251,7 +1251,7 @@ inline Error createStringError(std::error_code EC, char const *Fmt,
   return make_error<StringError>(Stream.str(), EC);
 }
 
-Error createStringError(std::error_code EC, char const *Msg);
+LLVM_FUNC_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());
@@ -1267,10 +1267,10 @@ inline Error createStringError(std::errc EC, char const *Fmt,
 ///
 /// 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_CLASS_ABI FileError final : public ErrorInfo<FileError> {
 
-  friend Error createFileError(const Twine &, Error);
-  friend Error createFileError(const Twine &, size_t, Error);
+  friend LLVM_FUNC_ABI Error createFileError(const Twine &, Error);
+  friend LLVM_FUNC_ABI Error createFileError(const Twine &, size_t, Error);
 
 public:
   void log(raw_ostream &OS) const override {
@@ -1352,7 +1352,7 @@ Error createFileError(const Twine &F, ErrorSuccess) = delete;
 ///
 /// For tool use only. NOT FOR USE IN LIBRARY CODE.
 ///
-class ExitOnError {
+class LLVM_CLASS_ABI ExitOnError {
 public:
   /// Create an error on exit helper.
   ExitOnError(std::string Banner = "", int DefaultErrorExitCode = 1)
diff --git a/llvm/include/llvm/Support/ErrorHandling.h b/llvm/include/llvm/Support/ErrorHandling.h
index 9c8e3448f3a03e3..5f51eb8a783ebca 100644
--- a/llvm/include/llvm/Support/ErrorHandling.h
+++ b/llvm/include/llvm/Support/ErrorHandling.h
@@ -41,16 +41,16 @@ namespace llvm {
   ///
   /// \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_FUNC_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_FUNC_ABI void remove_fatal_error_handler();
 
   /// ScopedFatalErrorHandler - This is a simple helper class which just
   /// calls install_fatal_error_handler in its constructor and
   /// remove_fatal_error_handler in its destructor.
-  struct ScopedFatalErrorHandler {
+  struct LLVM_CLASS_ABI ScopedFatalErrorHandler {
     explicit ScopedFatalErrorHandler(fatal_error_handler_t handler,
                                      void *user_data = nullptr) {
       install_fatal_error_handler(handler, user_data);
@@ -68,11 +68,11 @@ namespace llvm {
 /// After the error handler is called this function will call abort(), it
 /// does not return.
 /// NOTE: The std::string variant was removed to avoid a <string> dependency.
-[[noreturn]] void report_fatal_error(const char *reason,
+[[noreturn]] LLVM_FUNC_ABI void report_fatal_error(const char *reason,
                                      bool gen_crash_diag = true);
-[[noreturn]] void report_fatal_error(StringRef reason,
+[[noreturn]] LLVM_FUNC_ABI void report_fatal_error(StringRef reason,
                                      bool gen_crash_diag = true);
-[[noreturn]] void report_fatal_error(const Twine &reason,
+[[noreturn]] LLVM_FUNC_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
@@ -91,13 +91,13 @@ namespace llvm {
 ///
 /// \param user_data - An argument which will be passed to the installed error
 /// handler.
-void install_bad_alloc_error_handler(fatal_error_handler_t handler,
+LLVM_FUNC_ABI void install_bad_alloc_error_handler(fatal_error_handler_t handler,
                                      void *user_data = nullptr);
 
 /// Restores default bad alloc error handling behavior.
-void remove_bad_alloc_error_handler();
+LLVM_FUNC_ABI void remove_bad_alloc_error_handler();
 
-void install_out_of_memory_new_handler();
+LLVM_FUNC_ABI void install_out_of_memory_new_handler();
 
 /// Reports a bad alloc error, calling any user defined bad alloc
 /// error handler. In contrast to the generic 'report_fatal_error'
@@ -111,13 +111,13 @@ void install_out_of_memory_new_handler();
 /// 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_FUNC_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_FUNC_ABI void
 llvm_unreachable_internal(const char *msg = nullptr, const char *file = nullptr,
                           unsigned line = 0);
 }
diff --git a/llvm/include/llvm/Support/ErrorOr.h b/llvm/include/llvm/Support/ErrorOr.h
index cc26a6b1033d166..5cee533c5a8b821 100644
--- a/llvm/include/llvm/Support/ErrorOr.h
+++ b/llvm/include/llvm/Support/ErrorOr.h
@@ -54,7 +54,7 @@ namespace llvm {
 ///
 /// T cannot be a rvalue reference.
 template<class T>
-class ErrorOr {
+class LLVM_CLASS_ABI ErrorOr {
   template <class OtherT> friend class ErrorOr;
 
   static constexpr bool isRef = std::is_reference_v<T>;
diff --git a/llvm/include/llvm/Support/Format.h b/llvm/include/llvm/Support/Format.h
index b6900267c0de8ab..4b8ec95390175a8 100644
--- a/llvm/include/llvm/Support/Format.h
+++ b/llvm/include/llvm/Support/Format.h
@@ -37,7 +37,7 @@ namespace llvm {
 
 /// 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_CLASS_ABI format_object_base {
 protected:
   const char *Fmt;
   ~format_object_base() = default; // Disallow polymorphic deletion.
@@ -81,15 +81,15 @@ class format_object_base {
 // Helper to validate that format() parameters are scalars or pointers.
 template <typename... Args> struct validate_format_parameters;
 template <typename Arg, typename... Args>
-struct validate_format_parameters<Arg, Args...> {
+struct LLVM_CLASS_ABI validate_format_parameters<Arg, Args...> {
   static_assert(std::is_scalar_v<Arg>,
                 "format can't be used with non fundamental / non pointer type");
   validate_format_parameters() { validate_format_parameters<Args...>(); }
 };
-template <> struct validate_format_parameters<> {};
+template <> struct LLVM_CLASS_ABI validate_format_parameters<> {};
 
 template <typename... Ts>
-class format_object final : public format_object_base {
+class LLVM_CLASS_ABI format_object final : public format_object_base {
   std::tuple<Ts...> Vals;
 
   template <std::size_t... Is>
@@ -128,7 +128,7 @@ inline format_object<Ts...> format(const char *Fmt, const Ts &... Vals) {
 }
 
 /// This is a helper class for left_justify, right_justify, and center_justify.
-class FormattedString {
+class LLVM_CLASS_ABI FormattedString {
 public:
   enum Justification { JustifyNone, JustifyLeft, JustifyRight, JustifyCenter };
   FormattedString(StringRef S, unsigned W, Justification J)
@@ -163,7 +163,7 @@ inline FormattedString center_justify(StringRef Str, unsigned Width) {
 }
 
 /// This is a helper class used for format_hex() and format_decimal().
-class FormattedNumber {
+class LLVM_CLASS_ABI FormattedNumber {
   uint64_t HexValue;
   int64_t DecValue;
   unsigned Width;
@@ -214,7 +214,7 @@ inline FormattedNumber format_decimal(int64_t N, unsigned Width) {
   return FormattedNumber(0, N, Width, false, false, false);
 }
 
-class FormattedBytes {
+class LLVM_CLASS_ABI FormattedBytes {
   ArrayRef<uint8_t> Bytes;
 
   // If not std::nullopt, display offsets for each line relative to starting
diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h
index dc095941fdc8a9f..64dbe67db80c67b 100644
--- a/llvm/include/llvm/Support/MathExtras.h
+++ b/llvm/include/llvm/Support/MathExtras.h
@@ -559,7 +559,7 @@ SaturatingMultiplyAdd(T X, T Y, T A, bool *ResultOverflowed = nullptr) {
 }
 
 /// Use this rather than HUGE_VALF; the latter causes warnings on MSVC.
-extern const float huge_valf;
+LLVM_FUNC_ABI extern const float huge_valf;
 
 
 /// Add two signed integers, computing the two's complement truncated result,
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
index ddbcb8d1c64ac37..bb613614df48c12 100644
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -50,7 +50,7 @@ class FileLocker;
 /// 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_CLASS_ABI raw_ostream {
 public:
   // Class kinds to support LLVM-style RTTI.
   enum class OStreamKind {
@@ -426,7 +426,7 @@ operator<<(OStream &&OS, const T &Value) {
 /// 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_CLASS_ABI raw_pwrite_stream : public raw_ostream {
   virtual void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) = 0;
   void anchor() override;
 
@@ -452,7 +452,7 @@ class raw_pwrite_stream : public raw_ostream {
 
 /// A raw_ostream that writes to a file descriptor.
 ///
-class raw_fd_ostream : public raw_pwrite_stream {
+class LLVM_CLASS_ABI raw_fd_ostream : public raw_pwrite_stream {
   int FD;
   bool ShouldClose;
   bool SupportsSeeking = false;
@@ -591,17 +591,17 @@ class raw_fd_ostream : public raw_pwrite_stream {
 
 /// This returns a reference to a raw_fd_ostream for standard output. Use it
 /// like: outs() << "foo" << "bar";
-raw_fd_ostream &outs();
+LLVM_FUNC_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_FUNC_ABI raw_fd_ostream &errs();
 
 /// This returns a reference to a raw_ostream which simply discards output.
-raw_ostream &nulls();
+LLVM_FUNC_ABI raw_ostream &nulls();
 
 //===----------------------------------------------------------------------===//
 // File Streams
@@ -609,7 +609,7 @@ raw_ostream &nulls();
 
 /// A raw_ostream of a file for reading/writing/seeking.
 ///
-class raw_fd_stream : public raw_fd_ostream {
+class LLVM_CLASS_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
@@ -640,7 +640,7 @@ class raw_fd_stream : public raw_fd_ostream {
 /// raw_string_ostream operates without a buffer, delegating all memory
 /// management to the std::string. Thus the std::string is always up-to-date,
 /// may be used directly and there is no need to call flush().
-class raw_string_ostream : public raw_ostream {
+class LLVM_CLASS_ABI raw_string_ostream : public raw_ostream {
   std::string &OS;
 
   /// See raw_ostream::write_impl.
@@ -670,7 +670,7 @@ class raw_string_ostream : public raw_ostream {
 /// 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_CLASS_ABI raw_svector_ostream : public raw_pwrite_stream {
   SmallVectorImpl<char> &OS;
 
   /// See raw_ostream::write_impl.
@@ -703,7 +703,7 @@ class raw_svector_ostream : public raw_pwrite_stream {
 };
 
 /// A raw_ostream that discards all output.
-class raw_null_ostream : public raw_pwrite_stream {
+class LLVM_CLASS_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;
@@ -717,7 +717,7 @@ class raw_null_ostream : public raw_pwrite_stream {
   ~raw_null_ostream() override;
 };
 
-class buffer_ostream : public raw_svector_ostream {
+class LLVM_CLASS_ABI buffer_ostream : public raw_svector_ostream {
   raw_ostream &OS;
   SmallVector<char, 0> Buffer;
 
@@ -728,7 +728,7 @@ class buffer_ostream : public raw_svector_ostream {
   ~buffer_ostream() override { OS << str(); }
 };
 
-class buffer_unique_ostream : public raw_svector_ostream {
+class LLVM_CLASS_ABI buffer_unique_ostream : public raw_svector_ostream {
   std::unique_ptr<raw_ostream> OS;
   SmallVector<char, 0> Buffer;
 
@@ -752,10 +752,10 @@ class Error;
 /// 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_FUNC_ABI Error writeToOutput(StringRef OutputFileName,
                     std::function<Error(raw_ostream &)> Write);
 
-raw_ostream &operator<<(raw_ostream &OS, std::nullopt_t);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, std::nullopt_t);
 
 template <typename T, typename = decltype(std::declval<raw_ostream &>()
                                           << std::declval<const T &>())>
diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h
index 86f07c19477d60a..02e92fa8eed6761 100644
--- a/llvm/include/llvm/Support/type_traits.h
+++ b/llvm/include/llvm/Support/type_traits.h
@@ -27,7 +27,7 @@ namespace llvm {
 /// because it is based on being implicitly convertible to an integral type.
 /// Also note that enum classes aren't implicitly convertible to integral types,
 /// the value may therefore need to be explicitly converted before being used.
-template <typename T> class is_integral_or_enum {
+template <typename T> class LLVM_CLASS_ABI is_integral_or_enum {
   using UnderlyingT = std::remove_reference_t<T>;
 
 public:
@@ -41,10 +41,10 @@ template <typename T> class is_integral_or_enum {
 
 /// If T is a pointer, just return it. If it is not, return T&.
 template<typename T, typename Enable = void>
-struct add_lvalue_reference_if_not_pointer { using type = T &; };
+struct LLVM_CLASS_ABI add_lvalue_reference_if_not_pointer { using type = T &; };
 
 template <typename T>
-struct add_lvalue_reference_if_not_pointer<
+struct LLVM_CLASS_ABI add_lvalue_reference_if_not_pointer<
     T, std::enable_if_t<std::is_pointer_v<T>>> {
   using type = T;
 };
@@ -52,19 +52,19 @@ struct add_lvalue_reference_if_not_pointer<
 /// If T is a pointer to X, return a pointer to const X. If it is not,
 /// return const T.
 template<typename T, typename Enable = void>
-struct add_const_past_pointer { using type = const T; };
+struct LLVM_CLASS_ABI add_const_past_pointer { using type = const T; };
 
 template <typename T>
-struct add_const_past_pointer<T, std::enable_if_t<std::is_pointer_v<T>>> {
+struct LLVM_CLASS_ABI add_const_past_pointer<T, std::enable_if_t<std::is_pointer_v<T>>> {
   using type = const std::remove_pointer_t<T> *;
 };
 
 template <typename T, typename Enable = void>
-struct const_pointer_or_const_ref {
+struct LLVM_CLASS_ABI const_pointer_or_const_ref {
   using type = const T &;
 };
 template <typename T>
-struct const_pointer_or_const_ref<T, std::enable_if_t<std::is_pointer_v<T>>> {
+struct LLVM_CLASS_ABI const_pointer_or_const_ref<T, std::enable_if_t<std::is_pointer_v<T>>> {
   using type = typename add_const_past_pointer<T>::type;
 };
 
@@ -94,28 +94,28 @@ union trivial_helper {
 /// An implementation of `std::is_trivially_copy_constructible` since we have
 /// users with STLs that don't yet include it.
 template <typename T>
-struct is_trivially_copy_constructible
+struct LLVM_CLASS_ABI is_trivially_copy_constructible
     : std::is_copy_constructible<
           ::llvm::detail::copy_construction_triviality_helper<T>> {};
 template <typename T>
-struct is_trivially_copy_constructible<T &> : std::true_type {};
+struct LLVM_CLASS_ABI is_trivially_copy_constructible<T &> : std::true_type {};
 template <typename T>
-struct is_trivially_copy_constructible<T &&> : std::false_type {};
+struct LLVM_CLASS_ABI is_trivially_copy_constructible<T &&> : std::false_type {};
 
 /// An implementation of `std::is_trivially_move_constructible` since we have
 /// users with STLs that don't yet include it.
 template <typename T>
-struct is_trivially_move_constructible
+struct LLVM_CLASS_ABI is_trivially_move_constructible
     : std::is_move_constructible<
           ::llvm::detail::move_construction_triviality_helper<T>> {};
 template <typename T>
-struct is_trivially_move_constructible<T &> : std::true_type {};
+struct LLVM_CLASS_ABI is_trivially_move_constructible<T &> : std::true_type {};
 template <typename T>
-struct is_trivially_move_constructible<T &&> : std::true_type {};
+struct LLVM_CLASS_ABI is_trivially_move_constructible<T &&> : std::true_type {};
 
 
 template <typename T>
-struct is_copy_assignable {
+struct LLVM_CLASS_ABI is_copy_assignable {
   template<class F>
     static auto get(F*) -> decltype(std::declval<F &>() = std::declval<const F &>(), std::true_type{});
     static std::false_type get(...);
@@ -123,7 +123,7 @@ struct is_copy_assignable {
 };
 
 template <typename T>
-struct is_move_assignable {
+struct LLVM_CLASS_ABI is_move_assignable {
   template<class F>
     static auto get(F*) -> decltype(std::declval<F &>() = std::declval<F &&>(), std::true_type{});
     static std::false_type get(...);

>From 36a6ea8212624b91ebc0edbb3f43dfe4fffd3805 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 4 Aug 2023 18:31:18 +0000
Subject: [PATCH 12/39] XXX: Headers

---
 llvm/include/llvm/Support/ExtensibleRTTI.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/include/llvm/Support/ExtensibleRTTI.h b/llvm/include/llvm/Support/ExtensibleRTTI.h
index d3193be6f529e1a..2e2b1abb75f4817 100644
--- 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/Compiler.h"
+
 namespace llvm {
 
 /// Base class for the extensible RTTI hierarchy.

>From dcdc7782097554b027afff893eb5e0e26f1d6961 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 4 Aug 2023 19:29:44 +0000
Subject: [PATCH 13/39] XXX: Header

---
 llvm/include/llvm/ADT/IntrusiveRefCntPtr.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
index e41eb0639ce30eb..50fdb27aff65280 100644
--- a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
+++ b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
@@ -60,6 +60,7 @@
 #ifndef LLVM_ADT_INTRUSIVEREFCNTPTR_H
 #define LLVM_ADT_INTRUSIVEREFCNTPTR_H
 
+#include "llvm/Support/Compiler.h"
 #include <atomic>
 #include <cassert>
 #include <cstddef>

>From a14e3e27288370991d8f68a1405d97a9609794f6 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 4 Aug 2023 19:30:52 +0000
Subject: [PATCH 14/39] XXX: Header

---
 llvm/include/llvm/ADT/identity.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/ADT/identity.h b/llvm/include/llvm/ADT/identity.h
index 6e73d7f2c77bb7f..ece3913449794e5 100644
--- a/llvm/include/llvm/ADT/identity.h
+++ b/llvm/include/llvm/ADT/identity.h
@@ -15,6 +15,7 @@
 #ifndef LLVM_ADT_IDENTITY_H
 #define LLVM_ADT_IDENTITY_H
 
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 

>From 5b92dae8d8d058e3433ceb2bd3a9ed26e79a0c66 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 4 Aug 2023 19:46:44 +0000
Subject: [PATCH 15/39] XXX: headers

---
 llvm/include/llvm/Support/Errc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/Support/Errc.h b/llvm/include/llvm/Support/Errc.h
index 9df522cbe45c76c..00557c59a47695b 100644
--- a/llvm/include/llvm/Support/Errc.h
+++ b/llvm/include/llvm/Support/Errc.h
@@ -29,6 +29,7 @@
 #ifndef LLVM_SUPPORT_ERRC_H
 #define LLVM_SUPPORT_ERRC_H
 
+#include "llvm/Support/Compiler.h"
 #include <system_error>
 
 namespace llvm {

>From bf3e5bb4737a8eb94aeb618da345e4d63c40fb2e Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 4 Aug 2023 20:06:47 +0000
Subject: [PATCH 16/39] Annotations from llvm

---
 llvm/include/llvm-c/Analysis.h                |    8 +-
 llvm/include/llvm-c/BitReader.h               |   16 +-
 llvm/include/llvm-c/BitWriter.h               |    8 +-
 llvm/include/llvm-c/Comdat.h                  |   10 +-
 llvm/include/llvm-c/Core.h                    | 1236 ++++++++---------
 llvm/include/llvm-c/DebugInfo.h               |  180 +--
 llvm/include/llvm-c/Disassembler.h            |   12 +-
 llvm/include/llvm-c/DisassemblerTypes.h       |    4 +-
 llvm/include/llvm-c/ErrorHandling.h           |    6 +-
 llvm/include/llvm-c/ExecutionEngine.h         |   78 +-
 llvm/include/llvm-c/IRReader.h                |    2 +-
 llvm/include/llvm-c/LLJIT.h                   |   40 +-
 llvm/include/llvm-c/Linker.h                  |    2 +-
 llvm/include/llvm-c/Object.h                  |   74 +-
 llvm/include/llvm-c/Orc.h                     |  160 +--
 llvm/include/llvm-c/OrcEE.h                   |    6 +-
 llvm/include/llvm-c/Remarks.h                 |   50 +-
 llvm/include/llvm-c/Support.h                 |    8 +-
 llvm/include/llvm-c/Target.h                  |   44 +-
 llvm/include/llvm-c/TargetMachine.h           |   48 +-
 llvm/include/llvm-c/Transforms/PassBuilder.h  |   30 +-
 llvm/include/llvm-c/blake3.h                  |   22 +-
 llvm/include/llvm-c/lto.h                     |  156 +--
 llvm/include/llvm/ADT/APFixedPoint.h          |    8 +-
 llvm/include/llvm/ADT/APFloat.h               |   44 +-
 llvm/include/llvm/ADT/AddressRanges.h         |   10 +-
 llvm/include/llvm/ADT/AllocatorList.h         |    2 +-
 llvm/include/llvm/ADT/BitVector.h             |    6 +-
 llvm/include/llvm/ADT/Bitfields.h             |   16 +-
 llvm/include/llvm/ADT/BitmaskEnum.h           |    6 +-
 llvm/include/llvm/ADT/BreadthFirstIterator.h  |    4 +-
 llvm/include/llvm/ADT/CachedHashString.h      |    8 +-
 llvm/include/llvm/ADT/CoalescingBitVector.h   |    2 +-
 llvm/include/llvm/ADT/CombinationGenerator.h  |    2 +-
 llvm/include/llvm/ADT/ConcurrentHashtable.h   |    4 +-
 llvm/include/llvm/ADT/DAGDeltaAlgorithm.h     |    2 +-
 llvm/include/llvm/ADT/DeltaAlgorithm.h        |    2 +-
 llvm/include/llvm/ADT/DenseMap.h              |   10 +-
 llvm/include/llvm/ADT/DenseSet.h              |   10 +-
 llvm/include/llvm/ADT/DepthFirstIterator.h    |   14 +-
 llvm/include/llvm/ADT/DirectedGraph.h         |    6 +-
 llvm/include/llvm/ADT/EnumeratedArray.h       |    2 +-
 llvm/include/llvm/ADT/EpochTracker.h          |    2 +-
 llvm/include/llvm/ADT/EquivalenceClasses.h    |    2 +-
 llvm/include/llvm/ADT/FloatingPointMode.h     |    8 +-
 llvm/include/llvm/ADT/FoldingSet.h            |   40 +-
 llvm/include/llvm/ADT/FunctionExtras.h        |    6 +-
 llvm/include/llvm/ADT/GenericCycleImpl.h      |    2 +-
 llvm/include/llvm/ADT/GenericCycleInfo.h      |   10 +-
 llvm/include/llvm/ADT/GenericSSAContext.h     |    2 +-
 llvm/include/llvm/ADT/GenericUniformityImpl.h |    8 +-
 llvm/include/llvm/ADT/GenericUniformityInfo.h |    4 +-
 llvm/include/llvm/ADT/GraphTraits.h           |    6 +-
 llvm/include/llvm/ADT/IndexedMap.h            |    2 +-
 llvm/include/llvm/ADT/IntEqClasses.h          |    2 +-
 llvm/include/llvm/ADT/IntervalMap.h           |   22 +-
 llvm/include/llvm/ADT/IntervalTree.h          |    4 +-
 llvm/include/llvm/ADT/IntrusiveRefCntPtr.h    |   12 +-
 llvm/include/llvm/ADT/MapVector.h             |    4 +-
 llvm/include/llvm/ADT/PackedVector.h          |    6 +-
 llvm/include/llvm/ADT/PointerEmbeddedInt.h    |    6 +-
 llvm/include/llvm/ADT/PointerIntPair.h        |   14 +-
 llvm/include/llvm/ADT/PointerSumType.h        |    8 +-
 llvm/include/llvm/ADT/PointerUnion.h          |   20 +-
 llvm/include/llvm/ADT/PostOrderIterator.h     |   14 +-
 llvm/include/llvm/ADT/PriorityQueue.h         |    2 +-
 llvm/include/llvm/ADT/PriorityWorklist.h      |    4 +-
 llvm/include/llvm/ADT/SCCIterator.h           |    6 +-
 llvm/include/llvm/ADT/STLForwardCompat.h      |    1 +
 llvm/include/llvm/ADT/ScopeExit.h             |    2 +-
 llvm/include/llvm/ADT/ScopedHashTable.h       |    8 +-
 llvm/include/llvm/ADT/Sequence.h              |   10 +-
 llvm/include/llvm/ADT/SetVector.h             |    4 +-
 llvm/include/llvm/ADT/SmallBitVector.h        |    4 +-
 llvm/include/llvm/ADT/SmallPtrSet.h           |   16 +-
 llvm/include/llvm/ADT/SmallSet.h              |    6 +-
 llvm/include/llvm/ADT/SparseBitVector.h       |    4 +-
 llvm/include/llvm/ADT/SparseMultiSet.h        |    2 +-
 llvm/include/llvm/ADT/SparseSet.h             |    8 +-
 llvm/include/llvm/ADT/Statistic.h             |   20 +-
 llvm/include/llvm/ADT/StringMap.h             |   12 +-
 llvm/include/llvm/ADT/StringMapEntry.h        |   12 +-
 llvm/include/llvm/ADT/StringSet.h             |    2 +-
 llvm/include/llvm/ADT/StringSwitch.h          |    2 +-
 llvm/include/llvm/ADT/TinyPtrVector.h         |    2 +-
 llvm/include/llvm/ADT/UniqueVector.h          |    2 +-
 llvm/include/llvm/ADT/fallible_iterator.h     |    2 +-
 llvm/include/llvm/ADT/ilist.h                 |   16 +-
 llvm/include/llvm/ADT/ilist_base.h            |    2 +-
 llvm/include/llvm/ADT/ilist_iterator.h        |   14 +-
 llvm/include/llvm/ADT/ilist_node.h            |   12 +-
 llvm/include/llvm/ADT/ilist_node_base.h       |    4 +-
 llvm/include/llvm/ADT/ilist_node_options.h    |   32 +-
 llvm/include/llvm/ADT/iterator_range.h        |    1 +
 llvm/include/llvm/ADT/simple_ilist.h          |    2 +-
 llvm/include/llvm/Analysis/AliasAnalysis.h    |   42 +-
 .../llvm/Analysis/AliasAnalysisEvaluator.h    |    4 +-
 llvm/include/llvm/Analysis/AliasSetTracker.h  |    6 +-
 .../llvm/Analysis/AssumeBundleQueries.h       |   22 +-
 llvm/include/llvm/Analysis/AssumptionCache.h  |   12 +-
 .../llvm/Analysis/BasicAliasAnalysis.h        |    8 +-
 .../llvm/Analysis/BlockFrequencyInfo.h        |    8 +-
 .../llvm/Analysis/BlockFrequencyInfoImpl.h    |   30 +-
 .../llvm/Analysis/BranchProbabilityInfo.h     |    8 +-
 llvm/include/llvm/Analysis/CFG.h              |   14 +-
 llvm/include/llvm/Analysis/CFGPrinter.h       |   18 +-
 llvm/include/llvm/Analysis/CFGSCCPrinter.h    |    2 +-
 llvm/include/llvm/Analysis/CGSCCPassManager.h |   18 +-
 llvm/include/llvm/Analysis/CallGraph.h        |   20 +-
 llvm/include/llvm/Analysis/CallGraphSCCPass.h |    8 +-
 llvm/include/llvm/Analysis/CallPrinter.h      |    8 +-
 llvm/include/llvm/Analysis/CaptureTracking.h  |   18 +-
 llvm/include/llvm/Analysis/CmpInstAnalysis.h  |   10 +-
 llvm/include/llvm/Analysis/CodeMetrics.h      |    2 +-
 llvm/include/llvm/Analysis/ConstantFolding.h  |   52 +-
 llvm/include/llvm/Analysis/ConstraintSystem.h |    2 +-
 llvm/include/llvm/Analysis/CostModel.h        |    2 +-
 llvm/include/llvm/Analysis/CycleAnalysis.h    |    6 +-
 llvm/include/llvm/Analysis/DDG.h              |   38 +-
 llvm/include/llvm/Analysis/DDGPrinter.h       |    4 +-
 .../llvm/Analysis/DOTGraphTraitsPass.h        |   16 +-
 llvm/include/llvm/Analysis/Delinearization.h  |   14 +-
 llvm/include/llvm/Analysis/DemandedBits.h     |    6 +-
 .../llvm/Analysis/DependenceAnalysis.h        |   14 +-
 .../llvm/Analysis/DependenceGraphBuilder.h    |    2 +-
 llvm/include/llvm/Analysis/DomPrinter.h       |   38 +-
 llvm/include/llvm/Analysis/DomTreeUpdater.h   |    2 +-
 .../include/llvm/Analysis/DominanceFrontier.h |   12 +-
 .../llvm/Analysis/DominanceFrontierImpl.h     |    2 +-
 .../Analysis/FunctionPropertiesAnalysis.h     |    8 +-
 llvm/include/llvm/Analysis/GlobalsModRef.h    |   10 +-
 llvm/include/llvm/Analysis/GuardUtils.h       |   10 +-
 llvm/include/llvm/Analysis/HeatUtils.h        |    8 +-
 .../llvm/Analysis/IRSimilarityIdentifier.h    |   20 +-
 llvm/include/llvm/Analysis/IVDescriptors.h    |    4 +-
 llvm/include/llvm/Analysis/IVUsers.h          |   10 +-
 .../Analysis/IndirectCallPromotionAnalysis.h  |    2 +-
 .../llvm/Analysis/IndirectCallVisitor.h       |    2 +-
 llvm/include/llvm/Analysis/InlineAdvisor.h    |   34 +-
 llvm/include/llvm/Analysis/InlineCost.h       |   34 +-
 .../llvm/Analysis/InlineModelFeatureMaps.h    |   12 +-
 llvm/include/llvm/Analysis/InlineOrder.h      |    8 +-
 .../Analysis/InlineSizeEstimatorAnalysis.h    |    4 +-
 llvm/include/llvm/Analysis/InstCount.h        |    2 +-
 .../llvm/Analysis/InstSimplifyFolder.h        |    2 +-
 .../Analysis/InstructionPrecedenceTracking.h  |    6 +-
 .../llvm/Analysis/InstructionSimplify.h       |   94 +-
 .../llvm/Analysis/InteractiveModelRunner.h    |    2 +-
 llvm/include/llvm/Analysis/Interval.h         |    6 +-
 llvm/include/llvm/Analysis/IntervalIterator.h |    2 +-
 .../include/llvm/Analysis/IntervalPartition.h |    2 +-
 .../llvm/Analysis/IteratedDominanceFrontier.h |    4 +-
 .../llvm/Analysis/LazyBlockFrequencyInfo.h    |    6 +-
 .../llvm/Analysis/LazyBranchProbabilityInfo.h |    8 +-
 llvm/include/llvm/Analysis/LazyCallGraph.h    |   12 +-
 llvm/include/llvm/Analysis/LazyValueInfo.h    |    6 +-
 llvm/include/llvm/Analysis/Lint.h             |    6 +-
 llvm/include/llvm/Analysis/Loads.h            |   22 +-
 .../llvm/Analysis/LoopAccessAnalysis.h        |   26 +-
 .../llvm/Analysis/LoopAnalysisManager.h       |    4 +-
 .../include/llvm/Analysis/LoopCacheAnalysis.h |   14 +-
 llvm/include/llvm/Analysis/LoopInfo.h         |   42 +-
 llvm/include/llvm/Analysis/LoopIterator.h     |   10 +-
 llvm/include/llvm/Analysis/LoopNestAnalysis.h |    6 +-
 llvm/include/llvm/Analysis/LoopPass.h         |    6 +-
 .../llvm/Analysis/LoopUnrollAnalyzer.h        |    2 +-
 llvm/include/llvm/Analysis/MLInlineAdvisor.h  |    4 +-
 llvm/include/llvm/Analysis/MLModelRunner.h    |    2 +-
 llvm/include/llvm/Analysis/MemDerefPrinter.h  |    2 +-
 llvm/include/llvm/Analysis/MemoryBuiltins.h   |   40 +-
 .../llvm/Analysis/MemoryDependenceAnalysis.h  |   12 +-
 llvm/include/llvm/Analysis/MemoryLocation.h   |    8 +-
 .../include/llvm/Analysis/MemoryProfileInfo.h |   16 +-
 llvm/include/llvm/Analysis/MemorySSA.h        |   54 +-
 llvm/include/llvm/Analysis/MemorySSAUpdater.h |    2 +-
 .../llvm/Analysis/ModuleDebugInfoPrinter.h    |    2 +-
 .../llvm/Analysis/ModuleSummaryAnalysis.h     |   14 +-
 llvm/include/llvm/Analysis/MustExecute.h      |   16 +-
 .../llvm/Analysis/NoInferenceModelRunner.h    |    2 +-
 .../llvm/Analysis/ObjCARCAliasAnalysis.h      |    4 +-
 .../llvm/Analysis/ObjCARCAnalysisUtils.h      |    6 +-
 llvm/include/llvm/Analysis/ObjCARCInstKind.h  |   28 +-
 .../llvm/Analysis/OptimizationRemarkEmitter.h |    6 +-
 .../llvm/Analysis/OverflowInstAnalysis.h      |    4 +-
 llvm/include/llvm/Analysis/PHITransAddr.h     |    2 +-
 llvm/include/llvm/Analysis/Passes.h           |   12 +-
 llvm/include/llvm/Analysis/PhiValues.h        |    8 +-
 llvm/include/llvm/Analysis/PostDominators.h   |   12 +-
 .../llvm/Analysis/ProfileSummaryInfo.h        |    8 +-
 llvm/include/llvm/Analysis/PtrUseVisitor.h    |    4 +-
 llvm/include/llvm/Analysis/RegionInfo.h       |   26 +-
 llvm/include/llvm/Analysis/RegionIterator.h   |    8 +-
 llvm/include/llvm/Analysis/RegionPass.h       |    4 +-
 llvm/include/llvm/Analysis/RegionPrinter.h    |   10 +-
 .../llvm/Analysis/ReleaseModeModelRunner.h    |    4 +-
 .../llvm/Analysis/ReplayInlineAdvisor.h       |   10 +-
 llvm/include/llvm/Analysis/ScalarEvolution.h  |   32 +-
 .../Analysis/ScalarEvolutionAliasAnalysis.h   |    8 +-
 .../llvm/Analysis/ScalarEvolutionDivision.h   |    2 +-
 .../Analysis/ScalarEvolutionExpressions.h     |   56 +-
 .../Analysis/ScalarEvolutionNormalization.h   |    6 +-
 llvm/include/llvm/Analysis/ScopedNoAliasAA.h  |    8 +-
 .../include/llvm/Analysis/SparsePropagation.h |    6 +-
 llvm/include/llvm/Analysis/StackLifetime.h    |    6 +-
 .../llvm/Analysis/StackSafetyAnalysis.h       |   20 +-
 .../llvm/Analysis/SyntheticCountsUtils.h      |    2 +-
 llvm/include/llvm/Analysis/TargetFolder.h     |    2 +-
 .../include/llvm/Analysis/TargetLibraryInfo.h |   10 +-
 .../llvm/Analysis/TargetTransformInfo.h       |   16 +-
 .../llvm/Analysis/TargetTransformInfoImpl.h   |    4 +-
 llvm/include/llvm/Analysis/TensorSpec.h       |    6 +-
 llvm/include/llvm/Analysis/Trace.h            |    2 +-
 .../llvm/Analysis/TypeBasedAliasAnalysis.h    |    8 +-
 .../include/llvm/Analysis/TypeMetadataUtils.h |   10 +-
 .../llvm/Analysis/UniformityAnalysis.h        |    6 +-
 .../ImportedFunctionsInliningStatistics.h     |    2 +-
 llvm/include/llvm/Analysis/Utils/Local.h      |    2 +-
 .../llvm/Analysis/Utils/TrainingLogger.h      |    2 +-
 llvm/include/llvm/Analysis/ValueLattice.h     |    4 +-
 .../include/llvm/Analysis/ValueLatticeUtils.h |    6 +-
 llvm/include/llvm/Analysis/ValueTracking.h    |  178 +--
 llvm/include/llvm/Analysis/VectorUtils.h      |   74 +-
 llvm/include/llvm/AsmParser/LLLexer.h         |    2 +-
 llvm/include/llvm/AsmParser/LLParser.h        |    4 +-
 llvm/include/llvm/AsmParser/Parser.h          |   28 +-
 llvm/include/llvm/AsmParser/SlotMapping.h     |    2 +-
 .../BinaryFormat/AMDGPUMetadataVerifier.h     |    2 +-
 llvm/include/llvm/BinaryFormat/COFF.h         |   34 +-
 llvm/include/llvm/BinaryFormat/DXContainer.h  |   42 +-
 llvm/include/llvm/BinaryFormat/Dwarf.h        |  142 +-
 llvm/include/llvm/BinaryFormat/ELF.h          |   40 +-
 llvm/include/llvm/BinaryFormat/MachO.h        |  184 +--
 llvm/include/llvm/BinaryFormat/Magic.h        |    6 +-
 llvm/include/llvm/BinaryFormat/Minidump.h     |   26 +-
 .../llvm/BinaryFormat/MsgPackDocument.h       |   10 +-
 .../include/llvm/BinaryFormat/MsgPackReader.h |    6 +-
 .../include/llvm/BinaryFormat/MsgPackWriter.h |    2 +-
 llvm/include/llvm/BinaryFormat/Wasm.h         |   62 +-
 llvm/include/llvm/BinaryFormat/WasmTraits.h   |    8 +-
 llvm/include/llvm/BinaryFormat/XCOFF.h        |   18 +-
 llvm/include/llvm/Bitcode/BitcodeAnalyzer.h   |    4 +-
 llvm/include/llvm/Bitcode/BitcodeCommon.h     |    2 +-
 llvm/include/llvm/Bitcode/BitcodeReader.h     |   42 +-
 llvm/include/llvm/Bitcode/BitcodeWriter.h     |   10 +-
 llvm/include/llvm/Bitcode/BitcodeWriterPass.h |    6 +-
 llvm/include/llvm/Bitstream/BitCodes.h        |    4 +-
 llvm/include/llvm/Bitstream/BitstreamReader.h |    8 +-
 llvm/include/llvm/Bitstream/BitstreamWriter.h |    2 +-
 llvm/include/llvm/CodeGen/AccelTable.h        |   26 +-
 llvm/include/llvm/CodeGen/Analysis.h          |   34 +-
 llvm/include/llvm/CodeGen/AntiDepBreaker.h    |    6 +-
 llvm/include/llvm/CodeGen/AsmPrinter.h        |    2 +-
 llvm/include/llvm/CodeGen/AsmPrinterHandler.h |    2 +-
 .../llvm/CodeGen/AssignmentTrackingAnalysis.h |    6 +-
 llvm/include/llvm/CodeGen/AtomicExpandUtils.h |    2 +-
 .../llvm/CodeGen/BasicBlockSectionUtils.h     |    6 +-
 .../CodeGen/BasicBlockSectionsProfileReader.h |    6 +-
 llvm/include/llvm/CodeGen/BasicTTIImpl.h      |    6 +-
 llvm/include/llvm/CodeGen/ByteProvider.h      |    2 +-
 llvm/include/llvm/CodeGen/CFIFixup.h          |    2 +-
 llvm/include/llvm/CodeGen/CSEConfigBase.h     |    2 +-
 llvm/include/llvm/CodeGen/CalcSpillWeights.h  |    2 +-
 llvm/include/llvm/CodeGen/CallingConvLower.h  |    6 +-
 llvm/include/llvm/CodeGen/CodeGenCommonISel.h |    8 +-
 .../include/llvm/CodeGen/CodeGenPassBuilder.h |    2 +-
 llvm/include/llvm/CodeGen/CommandFlags.h      |  142 +-
 .../llvm/CodeGen/ComplexDeinterleavingPass.h  |    2 +-
 llvm/include/llvm/CodeGen/CostTable.h         |    4 +-
 llvm/include/llvm/CodeGen/DFAPacketizer.h     |    6 +-
 llvm/include/llvm/CodeGen/DIE.h               |   46 +-
 .../llvm/CodeGen/DbgEntityHistoryCalculator.h |    8 +-
 llvm/include/llvm/CodeGen/DebugHandlerBase.h  |    4 +-
 llvm/include/llvm/CodeGen/DetectDeadLanes.h   |    2 +-
 .../llvm/CodeGen/DwarfStringPoolEntry.h       |    4 +-
 llvm/include/llvm/CodeGen/EdgeBundles.h       |    2 +-
 .../include/llvm/CodeGen/ExecutionDomainFix.h |    4 +-
 llvm/include/llvm/CodeGen/ExpandReductions.h  |    2 +-
 .../llvm/CodeGen/ExpandVectorPredication.h    |    2 +-
 llvm/include/llvm/CodeGen/FastISel.h          |    2 +-
 llvm/include/llvm/CodeGen/FaultMaps.h         |    2 +-
 .../llvm/CodeGen/FunctionLoweringInfo.h       |    2 +-
 llvm/include/llvm/CodeGen/GCMetadata.h        |    8 +-
 llvm/include/llvm/CodeGen/GCMetadataPrinter.h |    2 +-
 .../include/llvm/CodeGen/GlobalISel/CSEInfo.h |   16 +-
 .../llvm/CodeGen/GlobalISel/CSEMIRBuilder.h   |    2 +-
 .../llvm/CodeGen/GlobalISel/CallLowering.h    |    2 +-
 .../llvm/CodeGen/GlobalISel/Combiner.h        |    2 +-
 .../llvm/CodeGen/GlobalISel/CombinerHelper.h  |   16 +-
 .../llvm/CodeGen/GlobalISel/CombinerInfo.h    |    2 +-
 .../CodeGen/GlobalISel/GIMatchTableExecutor.h |    4 +-
 .../CodeGen/GlobalISel/GISelChangeObserver.h  |   10 +-
 .../llvm/CodeGen/GlobalISel/GISelKnownBits.h  |    4 +-
 .../llvm/CodeGen/GlobalISel/GISelWorkList.h   |    2 +-
 .../CodeGen/GlobalISel/GenericMachineInstrs.h |   44 +-
 .../llvm/CodeGen/GlobalISel/IRTranslator.h    |    2 +-
 .../CodeGen/GlobalISel/InlineAsmLowering.h    |    2 +-
 .../CodeGen/GlobalISel/InstructionSelect.h    |    2 +-
 .../CodeGen/GlobalISel/InstructionSelector.h  |    2 +-
 .../CodeGen/GlobalISel/LegacyLegalizerInfo.h  |    8 +-
 .../GlobalISel/LegalizationArtifactCombiner.h |    2 +-
 .../llvm/CodeGen/GlobalISel/Legalizer.h       |    2 +-
 .../llvm/CodeGen/GlobalISel/LegalizerHelper.h |    8 +-
 .../llvm/CodeGen/GlobalISel/LegalizerInfo.h   |   86 +-
 .../llvm/CodeGen/GlobalISel/LoadStoreOpt.h    |   10 +-
 .../llvm/CodeGen/GlobalISel/Localizer.h       |    2 +-
 .../CodeGen/GlobalISel/LostDebugLocObserver.h |    2 +-
 .../llvm/CodeGen/GlobalISel/MIPatternMatch.h  |   56 +-
 .../CodeGen/GlobalISel/MachineIRBuilder.h     |    8 +-
 .../llvm/CodeGen/GlobalISel/RegBankSelect.h   |    2 +-
 llvm/include/llvm/CodeGen/GlobalISel/Utils.h  |  126 +-
 llvm/include/llvm/CodeGen/HardwareLoops.h     |    4 +-
 llvm/include/llvm/CodeGen/ISDOpcodes.h        |   28 +-
 llvm/include/llvm/CodeGen/IndirectThunks.h    |    2 +-
 llvm/include/llvm/CodeGen/IntrinsicLowering.h |    2 +-
 .../llvm/CodeGen/LatencyPriorityQueue.h       |    4 +-
 .../CodeGen/LazyMachineBlockFrequencyInfo.h   |    2 +-
 llvm/include/llvm/CodeGen/LexicalScopes.h     |    4 +-
 .../llvm/CodeGen/LinkAllAsmWriterComponents.h |    2 +-
 .../llvm/CodeGen/LinkAllCodegenComponents.h   |    2 +-
 llvm/include/llvm/CodeGen/LiveInterval.h      |   14 +-
 llvm/include/llvm/CodeGen/LiveIntervalCalc.h  |    2 +-
 llvm/include/llvm/CodeGen/LiveIntervalUnion.h |    2 +-
 llvm/include/llvm/CodeGen/LiveIntervals.h     |    4 +-
 llvm/include/llvm/CodeGen/LivePhysRegs.h      |   10 +-
 llvm/include/llvm/CodeGen/LiveRangeCalc.h     |    2 +-
 llvm/include/llvm/CodeGen/LiveRangeEdit.h     |    2 +-
 llvm/include/llvm/CodeGen/LiveRegMatrix.h     |    2 +-
 llvm/include/llvm/CodeGen/LiveRegUnits.h      |    2 +-
 llvm/include/llvm/CodeGen/LiveStacks.h        |    2 +-
 llvm/include/llvm/CodeGen/LiveVariables.h     |    2 +-
 llvm/include/llvm/CodeGen/LoopTraversal.h     |    2 +-
 llvm/include/llvm/CodeGen/LowLevelType.h      |    4 +-
 llvm/include/llvm/CodeGen/LowLevelTypeUtils.h |   10 +-
 llvm/include/llvm/CodeGen/MBFIWrapper.h       |    2 +-
 .../include/llvm/CodeGen/MIRFSDiscriminator.h |    2 +-
 llvm/include/llvm/CodeGen/MIRFormatter.h      |    2 +-
 .../include/llvm/CodeGen/MIRParser/MIParser.h |   24 +-
 .../llvm/CodeGen/MIRParser/MIRParser.h        |    6 +-
 llvm/include/llvm/CodeGen/MIRPrinter.h        |    6 +-
 llvm/include/llvm/CodeGen/MIRYamlMapping.h    |   84 +-
 llvm/include/llvm/CodeGen/MachineBasicBlock.h |   22 +-
 .../llvm/CodeGen/MachineBlockFrequencyInfo.h  |    2 +-
 .../CodeGen/MachineBranchProbabilityInfo.h    |    2 +-
 llvm/include/llvm/CodeGen/MachineCFGPrinter.h |    6 +-
 .../llvm/CodeGen/MachineConstantPool.h        |    6 +-
 .../llvm/CodeGen/MachineCycleAnalysis.h       |    4 +-
 .../llvm/CodeGen/MachineDominanceFrontier.h   |    2 +-
 llvm/include/llvm/CodeGen/MachineDominators.h |   10 +-
 llvm/include/llvm/CodeGen/MachineFrameInfo.h  |    4 +-
 llvm/include/llvm/CodeGen/MachineFunction.h   |   22 +-
 .../llvm/CodeGen/MachineFunctionPass.h        |    2 +-
 llvm/include/llvm/CodeGen/MachineInstr.h      |    4 +-
 .../llvm/CodeGen/MachineInstrBuilder.h        |   20 +-
 .../include/llvm/CodeGen/MachineInstrBundle.h |   22 +-
 .../llvm/CodeGen/MachineInstrBundleIterator.h |   14 +-
 .../llvm/CodeGen/MachineJumpTableInfo.h       |    6 +-
 llvm/include/llvm/CodeGen/MachineLoopInfo.h   |    8 +-
 llvm/include/llvm/CodeGen/MachineLoopUtils.h  |    2 +-
 llvm/include/llvm/CodeGen/MachineMemOperand.h |    4 +-
 llvm/include/llvm/CodeGen/MachineModuleInfo.h |    8 +-
 .../llvm/CodeGen/MachineModuleInfoImpls.h     |    8 +-
 .../llvm/CodeGen/MachineModuleSlotTracker.h   |    2 +-
 llvm/include/llvm/CodeGen/MachineOperand.h    |    8 +-
 .../MachineOptimizationRemarkEmitter.h        |   12 +-
 llvm/include/llvm/CodeGen/MachineOutliner.h   |    4 +-
 .../include/llvm/CodeGen/MachinePassManager.h |    4 +-
 .../llvm/CodeGen/MachinePassRegistry.h        |    8 +-
 llvm/include/llvm/CodeGen/MachinePipeliner.h  |   14 +-
 .../llvm/CodeGen/MachinePostDominators.h      |    2 +-
 llvm/include/llvm/CodeGen/MachineRegionInfo.h |   14 +-
 .../llvm/CodeGen/MachineRegisterInfo.h        |    4 +-
 llvm/include/llvm/CodeGen/MachineSSAContext.h |    2 +-
 llvm/include/llvm/CodeGen/MachineSSAUpdater.h |    2 +-
 llvm/include/llvm/CodeGen/MachineScheduler.h  |   58 +-
 llvm/include/llvm/CodeGen/MachineSizeOpts.h   |    6 +-
 llvm/include/llvm/CodeGen/MachineStableHash.h |    8 +-
 .../llvm/CodeGen/MachineTraceMetrics.h        |    4 +-
 .../llvm/CodeGen/MachineUniformityAnalysis.h  |    2 +-
 llvm/include/llvm/CodeGen/MachineValueType.h  |    2 +-
 llvm/include/llvm/CodeGen/MacroFusion.h       |    8 +-
 llvm/include/llvm/CodeGen/ModuloSchedule.h    |    8 +-
 .../llvm/CodeGen/MultiHazardRecognizer.h      |    2 +-
 .../llvm/CodeGen/NonRelocatableStringpool.h   |    8 +-
 .../include/llvm/CodeGen/PBQP/CostAllocator.h |    4 +-
 llvm/include/llvm/CodeGen/PBQP/Graph.h        |    4 +-
 llvm/include/llvm/CodeGen/PBQP/Math.h         |   12 +-
 llvm/include/llvm/CodeGen/PBQP/Solution.h     |    2 +-
 llvm/include/llvm/CodeGen/PBQPRAConstraint.h  |    4 +-
 llvm/include/llvm/CodeGen/ParallelCG.h        |    2 +-
 llvm/include/llvm/CodeGen/Passes.h            |  292 ++--
 .../llvm/CodeGen/PreISelIntrinsicLowering.h   |    2 +-
 llvm/include/llvm/CodeGen/PseudoSourceValue.h |   16 +-
 llvm/include/llvm/CodeGen/RDFGraph.h          |   74 +-
 llvm/include/llvm/CodeGen/RDFLiveness.h       |    6 +-
 llvm/include/llvm/CodeGen/RDFRegisters.h      |   26 +-
 .../llvm/CodeGen/ReachingDefAnalysis.h        |    6 +-
 llvm/include/llvm/CodeGen/RegAllocPBQP.h      |   16 +-
 llvm/include/llvm/CodeGen/RegAllocRegistry.h  |    4 +-
 llvm/include/llvm/CodeGen/Register.h          |    4 +-
 llvm/include/llvm/CodeGen/RegisterBank.h      |    2 +-
 llvm/include/llvm/CodeGen/RegisterBankInfo.h  |    4 +-
 llvm/include/llvm/CodeGen/RegisterClassInfo.h |    2 +-
 llvm/include/llvm/CodeGen/RegisterPressure.h  |   24 +-
 .../include/llvm/CodeGen/RegisterScavenging.h |    4 +-
 llvm/include/llvm/CodeGen/RegisterUsageInfo.h |    2 +-
 llvm/include/llvm/CodeGen/ReplaceWithVeclib.h |    4 +-
 .../llvm/CodeGen/ResourcePriorityQueue.h      |    4 +-
 llvm/include/llvm/CodeGen/RuntimeLibcalls.h   |   30 +-
 llvm/include/llvm/CodeGen/ScheduleDAG.h       |   16 +-
 llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h |   10 +-
 .../llvm/CodeGen/ScheduleDAGMutation.h        |    2 +-
 llvm/include/llvm/CodeGen/ScheduleDFS.h       |    6 +-
 .../llvm/CodeGen/ScheduleHazardRecognizer.h   |    2 +-
 llvm/include/llvm/CodeGen/SchedulerRegistry.h |   18 +-
 .../llvm/CodeGen/ScoreboardHazardRecognizer.h |    2 +-
 llvm/include/llvm/CodeGen/SelectionDAG.h      |   14 +-
 .../CodeGen/SelectionDAGAddressAnalysis.h     |    2 +-
 llvm/include/llvm/CodeGen/SelectionDAGISel.h  |    2 +-
 llvm/include/llvm/CodeGen/SelectionDAGNodes.h |  182 +--
 .../llvm/CodeGen/SelectionDAGTargetInfo.h     |    2 +-
 llvm/include/llvm/CodeGen/SlotIndexes.h       |   10 +-
 llvm/include/llvm/CodeGen/Spiller.h           |    4 +-
 llvm/include/llvm/CodeGen/StackMaps.h         |    8 +-
 llvm/include/llvm/CodeGen/StackProtector.h    |    2 +-
 .../llvm/CodeGen/SwiftErrorValueTracking.h    |    2 +-
 .../llvm/CodeGen/SwitchLoweringUtils.h        |   24 +-
 llvm/include/llvm/CodeGen/TailDuplicator.h    |    2 +-
 llvm/include/llvm/CodeGen/TargetCallingConv.h |    6 +-
 .../llvm/CodeGen/TargetFrameLowering.h        |    2 +-
 llvm/include/llvm/CodeGen/TargetInstrInfo.h   |   10 +-
 llvm/include/llvm/CodeGen/TargetLowering.h    |    8 +-
 .../CodeGen/TargetLoweringObjectFileImpl.h    |   12 +-
 llvm/include/llvm/CodeGen/TargetPassConfig.h  |    6 +-
 .../include/llvm/CodeGen/TargetRegisterInfo.h |   22 +-
 llvm/include/llvm/CodeGen/TargetSchedule.h    |    2 +-
 .../llvm/CodeGen/TargetSubtargetInfo.h        |    2 +-
 llvm/include/llvm/CodeGen/TileShapeInfo.h     |    2 +-
 llvm/include/llvm/CodeGen/TypePromotion.h     |    2 +-
 .../llvm/CodeGen/UnreachableBlockElim.h       |    2 +-
 .../llvm/CodeGen/VLIWMachineScheduler.h       |    6 +-
 llvm/include/llvm/CodeGen/ValueTypes.h        |    2 +-
 llvm/include/llvm/CodeGen/VirtRegMap.h        |    2 +-
 llvm/include/llvm/CodeGen/WasmEHFuncInfo.h    |    4 +-
 llvm/include/llvm/CodeGen/WinEHFuncInfo.h     |   22 +-
 llvm/include/llvm/Config/abi-breaking.h.cmake |    6 +-
 llvm/include/llvm/DWARFLinker/DWARFLinker.h   |    8 +-
 .../llvm/DWARFLinker/DWARFLinkerCompileUnit.h |    4 +-
 .../llvm/DWARFLinker/DWARFLinkerDeclContext.h |    8 +-
 llvm/include/llvm/DWARFLinker/DWARFStreamer.h |    2 +-
 .../llvm/DWARFLinkerParallel/AddressesMap.h   |    2 +-
 .../llvm/DWARFLinkerParallel/DWARFFile.h      |    2 +-
 .../llvm/DWARFLinkerParallel/DWARFLinker.h    |    4 +-
 .../llvm/DWARFLinkerParallel/StringPool.h     |    4 +-
 .../llvm/DWARFLinkerParallel/StringTable.h    |    2 +-
 llvm/include/llvm/DWP/DWP.h                   |   20 +-
 llvm/include/llvm/DWP/DWPError.h              |    2 +-
 llvm/include/llvm/DWP/DWPStringPool.h         |    2 +-
 .../CodeView/AppendingTypeTableBuilder.h      |    2 +-
 .../llvm/DebugInfo/CodeView/CVRecord.h        |    4 +-
 .../llvm/DebugInfo/CodeView/CVSymbolVisitor.h |    2 +-
 .../llvm/DebugInfo/CodeView/CVTypeVisitor.h   |   16 +-
 .../llvm/DebugInfo/CodeView/CodeView.h        |   12 +-
 .../llvm/DebugInfo/CodeView/CodeViewError.h   |    6 +-
 .../DebugInfo/CodeView/CodeViewRecordIO.h     |    4 +-
 .../CodeView/ContinuationRecordBuilder.h      |    2 +-
 .../CodeView/DebugChecksumsSubsection.h       |    8 +-
 .../CodeView/DebugCrossExSubsection.h         |    4 +-
 .../CodeView/DebugCrossImpSubsection.h        |    8 +-
 .../CodeView/DebugFrameDataSubsection.h       |    4 +-
 .../CodeView/DebugInlineeLinesSubsection.h    |   10 +-
 .../DebugInfo/CodeView/DebugLinesSubsection.h |   16 +-
 .../CodeView/DebugStringTableSubsection.h     |    4 +-
 .../llvm/DebugInfo/CodeView/DebugSubsection.h |    4 +-
 .../CodeView/DebugSubsectionRecord.h          |    8 +-
 .../CodeView/DebugSubsectionVisitor.h         |    4 +-
 .../CodeView/DebugSymbolRVASubsection.h       |    4 +-
 .../CodeView/DebugSymbolsSubsection.h         |    4 +-
 .../CodeView/DebugUnknownSubsection.h         |    2 +-
 .../llvm/DebugInfo/CodeView/EnumTables.h      |   58 +-
 .../llvm/DebugInfo/CodeView/Formatters.h      |    6 +-
 llvm/include/llvm/DebugInfo/CodeView/GUID.h   |    4 +-
 .../CodeView/GlobalTypeTableBuilder.h         |    2 +-
 .../CodeView/LazyRandomTypeCollection.h       |    2 +-
 llvm/include/llvm/DebugInfo/CodeView/Line.h   |    6 +-
 .../CodeView/MergingTypeTableBuilder.h        |    2 +-
 .../llvm/DebugInfo/CodeView/RecordName.h      |    4 +-
 .../DebugInfo/CodeView/RecordSerialization.h  |   32 +-
 .../DebugInfo/CodeView/SimpleTypeSerializer.h |    2 +-
 .../DebugInfo/CodeView/StringsAndChecksums.h  |    4 +-
 .../DebugInfo/CodeView/SymbolDeserializer.h   |    2 +-
 .../DebugInfo/CodeView/SymbolDumpDelegate.h   |    2 +-
 .../llvm/DebugInfo/CodeView/SymbolDumper.h    |    2 +-
 .../llvm/DebugInfo/CodeView/SymbolRecord.h    |  102 +-
 .../DebugInfo/CodeView/SymbolRecordHelpers.h  |    6 +-
 .../DebugInfo/CodeView/SymbolRecordMapping.h  |    2 +-
 .../DebugInfo/CodeView/SymbolSerializer.h     |    2 +-
 .../CodeView/SymbolVisitorCallbackPipeline.h  |    2 +-
 .../CodeView/SymbolVisitorCallbacks.h         |    2 +-
 .../CodeView/SymbolVisitorDelegate.h          |    2 +-
 .../llvm/DebugInfo/CodeView/TypeCollection.h  |    2 +-
 .../DebugInfo/CodeView/TypeDeserializer.h     |    4 +-
 .../llvm/DebugInfo/CodeView/TypeDumpVisitor.h |    2 +-
 .../llvm/DebugInfo/CodeView/TypeHashing.h     |   12 +-
 .../llvm/DebugInfo/CodeView/TypeIndex.h       |    8 +-
 .../DebugInfo/CodeView/TypeIndexDiscovery.h   |   16 +-
 .../llvm/DebugInfo/CodeView/TypeRecord.h      |   80 +-
 .../DebugInfo/CodeView/TypeRecordHelpers.h    |    8 +-
 .../DebugInfo/CodeView/TypeRecordMapping.h    |    2 +-
 .../DebugInfo/CodeView/TypeStreamMerger.h     |   14 +-
 .../DebugInfo/CodeView/TypeTableCollection.h  |    2 +-
 .../CodeView/TypeVisitorCallbackPipeline.h    |    2 +-
 .../DebugInfo/CodeView/TypeVisitorCallbacks.h |    2 +-
 llvm/include/llvm/DebugInfo/DIContext.h       |   18 +-
 .../DWARF/DWARFAbbreviationDeclaration.h      |    2 +-
 .../DebugInfo/DWARF/DWARFAcceleratorTable.h   |    6 +-
 .../llvm/DebugInfo/DWARF/DWARFAddressRange.h  |    4 +-
 .../llvm/DebugInfo/DWARF/DWARFAttribute.h     |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFCompileUnit.h   |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFContext.h       |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFDataExtractor.h |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h   |    4 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugAddr.h     |    2 +-
 .../DebugInfo/DWARF/DWARFDebugArangeSet.h     |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugAranges.h  |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugFrame.h    |   26 +-
 .../DebugInfo/DWARF/DWARFDebugInfoEntry.h     |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugLine.h     |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugLoc.h      |   10 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugMacro.h    |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugPubTable.h |    2 +-
 .../DebugInfo/DWARF/DWARFDebugRangeList.h     |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFDebugRnglists.h |    6 +-
 llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h  |   12 +-
 .../llvm/DebugInfo/DWARF/DWARFExpression.h    |    4 +-
 .../llvm/DebugInfo/DWARF/DWARFFormValue.h     |    4 +-
 .../llvm/DebugInfo/DWARF/DWARFGdbIndex.h      |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFListTable.h     |    8 +-
 .../DebugInfo/DWARF/DWARFLocationExpression.h |    4 +-
 .../llvm/DebugInfo/DWARF/DWARFObject.h        |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFRelocMap.h      |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFSection.h       |    4 +-
 .../llvm/DebugInfo/DWARF/DWARFTypePrinter.h   |    2 +-
 .../llvm/DebugInfo/DWARF/DWARFTypeUnit.h      |    2 +-
 llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h |   12 +-
 .../llvm/DebugInfo/DWARF/DWARFUnitIndex.h     |    6 +-
 .../llvm/DebugInfo/DWARF/DWARFVerifier.h      |    2 +-
 .../llvm/DebugInfo/GSYM/DwarfTransformer.h    |    2 +-
 .../llvm/DebugInfo/GSYM/ExtractRanges.h       |   16 +-
 llvm/include/llvm/DebugInfo/GSYM/FileEntry.h  |    4 +-
 llvm/include/llvm/DebugInfo/GSYM/FileWriter.h |    2 +-
 .../llvm/DebugInfo/GSYM/FunctionInfo.h        |    4 +-
 .../include/llvm/DebugInfo/GSYM/GsymCreator.h |    2 +-
 llvm/include/llvm/DebugInfo/GSYM/GsymReader.h |    2 +-
 llvm/include/llvm/DebugInfo/GSYM/Header.h     |    6 +-
 llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h |    4 +-
 llvm/include/llvm/DebugInfo/GSYM/LineEntry.h  |    2 +-
 llvm/include/llvm/DebugInfo/GSYM/LineTable.h  |    4 +-
 .../llvm/DebugInfo/GSYM/LookupResult.h        |    8 +-
 .../DebugInfo/GSYM/ObjectFileTransformer.h    |    2 +-
 .../include/llvm/DebugInfo/GSYM/StringTable.h |    2 +-
 .../DebugInfo/LogicalView/Core/LVCompare.h    |    2 +-
 .../DebugInfo/LogicalView/Core/LVElement.h    |    2 +-
 .../llvm/DebugInfo/LogicalView/Core/LVLine.h  |    6 +-
 .../DebugInfo/LogicalView/Core/LVLocation.h   |    6 +-
 .../DebugInfo/LogicalView/Core/LVObject.h     |   14 +-
 .../DebugInfo/LogicalView/Core/LVOptions.h    |    4 +-
 .../llvm/DebugInfo/LogicalView/Core/LVRange.h |    4 +-
 .../DebugInfo/LogicalView/Core/LVReader.h     |    4 +-
 .../llvm/DebugInfo/LogicalView/Core/LVScope.h |   26 +-
 .../llvm/DebugInfo/LogicalView/Core/LVSort.h  |   18 +-
 .../DebugInfo/LogicalView/Core/LVStringPool.h |    2 +-
 .../DebugInfo/LogicalView/Core/LVSupport.h    |   16 +-
 .../DebugInfo/LogicalView/Core/LVSymbol.h     |    2 +-
 .../llvm/DebugInfo/LogicalView/Core/LVType.h  |   12 +-
 .../DebugInfo/LogicalView/LVReaderHandler.h   |    2 +-
 .../LogicalView/Readers/LVBinaryReader.h      |    6 +-
 .../LogicalView/Readers/LVCodeViewReader.h    |    4 +-
 .../LogicalView/Readers/LVCodeViewVisitor.h   |    8 +-
 .../LogicalView/Readers/LVELFReader.h         |    2 +-
 llvm/include/llvm/DebugInfo/MSF/IMSFFile.h    |    2 +-
 llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h  |    2 +-
 llvm/include/llvm/DebugInfo/MSF/MSFCommon.h   |   10 +-
 llvm/include/llvm/DebugInfo/MSF/MSFError.h    |    6 +-
 .../llvm/DebugInfo/MSF/MappedBlockStream.h    |    4 +-
 .../DebugInfo/PDB/ConcreteSymbolEnumerator.h  |    2 +-
 .../include/llvm/DebugInfo/PDB/DIA/DIAError.h |    6 +-
 .../include/llvm/DebugInfo/PDB/GenericError.h |    6 +-
 .../llvm/DebugInfo/PDB/IPDBDataStream.h       |    2 +-
 .../llvm/DebugInfo/PDB/IPDBEnumChildren.h     |    4 +-
 .../llvm/DebugInfo/PDB/IPDBFrameData.h        |    2 +-
 .../llvm/DebugInfo/PDB/IPDBInjectedSource.h   |    2 +-
 .../llvm/DebugInfo/PDB/IPDBLineNumber.h       |    2 +-
 .../llvm/DebugInfo/PDB/IPDBRawSymbol.h        |    4 +-
 .../llvm/DebugInfo/PDB/IPDBSectionContrib.h   |    2 +-
 llvm/include/llvm/DebugInfo/PDB/IPDBSession.h |    2 +-
 .../llvm/DebugInfo/PDB/IPDBSourceFile.h       |    2 +-
 llvm/include/llvm/DebugInfo/PDB/IPDBTable.h   |    2 +-
 .../PDB/Native/DbiModuleDescriptor.h          |    4 +-
 .../PDB/Native/DbiModuleDescriptorBuilder.h   |    6 +-
 .../llvm/DebugInfo/PDB/Native/DbiModuleList.h |    4 +-
 .../llvm/DebugInfo/PDB/Native/DbiStream.h     |    2 +-
 .../DebugInfo/PDB/Native/DbiStreamBuilder.h   |    2 +-
 .../llvm/DebugInfo/PDB/Native/EnumTables.h    |    2 +-
 .../llvm/DebugInfo/PDB/Native/FormatUtil.h    |   16 +-
 .../DebugInfo/PDB/Native/GSIStreamBuilder.h   |    6 +-
 .../llvm/DebugInfo/PDB/Native/GlobalsStream.h |    6 +-
 llvm/include/llvm/DebugInfo/PDB/Native/Hash.h |    6 +-
 .../llvm/DebugInfo/PDB/Native/HashTable.h     |    8 +-
 .../PDB/Native/ISectionContribVisitor.h       |    2 +-
 .../llvm/DebugInfo/PDB/Native/InfoStream.h    |    2 +-
 .../DebugInfo/PDB/Native/InfoStreamBuilder.h  |    2 +-
 .../PDB/Native/InjectedSourceStream.h         |    2 +-
 .../llvm/DebugInfo/PDB/Native/InputFile.h     |   12 +-
 .../llvm/DebugInfo/PDB/Native/LinePrinter.h   |   10 +-
 .../DebugInfo/PDB/Native/ModuleDebugStream.h  |    2 +-
 .../DebugInfo/PDB/Native/NamedStreamMap.h     |    4 +-
 .../PDB/Native/NativeCompilandSymbol.h        |    2 +-
 .../DebugInfo/PDB/Native/NativeEnumGlobals.h  |    2 +-
 .../PDB/Native/NativeEnumInjectedSources.h    |    2 +-
 .../PDB/Native/NativeEnumLineNumbers.h        |    2 +-
 .../DebugInfo/PDB/Native/NativeEnumModules.h  |    2 +-
 .../DebugInfo/PDB/Native/NativeEnumSymbols.h  |    2 +-
 .../DebugInfo/PDB/Native/NativeEnumTypes.h    |    2 +-
 .../DebugInfo/PDB/Native/NativeExeSymbol.h    |    2 +-
 .../PDB/Native/NativeFunctionSymbol.h         |    2 +-
 .../PDB/Native/NativeInlineSiteSymbol.h       |    2 +-
 .../DebugInfo/PDB/Native/NativeLineNumber.h   |    2 +-
 .../DebugInfo/PDB/Native/NativePublicSymbol.h |    2 +-
 .../DebugInfo/PDB/Native/NativeRawSymbol.h    |    2 +-
 .../llvm/DebugInfo/PDB/Native/NativeSession.h |    2 +-
 .../DebugInfo/PDB/Native/NativeSourceFile.h   |    2 +-
 .../PDB/Native/NativeSymbolEnumerator.h       |    2 +-
 .../DebugInfo/PDB/Native/NativeTypeArray.h    |    2 +-
 .../DebugInfo/PDB/Native/NativeTypeBuiltin.h  |    2 +-
 .../DebugInfo/PDB/Native/NativeTypeEnum.h     |    2 +-
 .../PDB/Native/NativeTypeFunctionSig.h        |    2 +-
 .../DebugInfo/PDB/Native/NativeTypePointer.h  |    2 +-
 .../DebugInfo/PDB/Native/NativeTypeTypedef.h  |    2 +-
 .../llvm/DebugInfo/PDB/Native/NativeTypeUDT.h |    2 +-
 .../DebugInfo/PDB/Native/NativeTypeVTShape.h  |    2 +-
 .../llvm/DebugInfo/PDB/Native/PDBFile.h       |    2 +-
 .../DebugInfo/PDB/Native/PDBFileBuilder.h     |    2 +-
 .../DebugInfo/PDB/Native/PDBStringTable.h     |    2 +-
 .../PDB/Native/PDBStringTableBuilder.h        |    4 +-
 .../llvm/DebugInfo/PDB/Native/PublicsStream.h |    2 +-
 .../llvm/DebugInfo/PDB/Native/RawError.h      |    6 +-
 .../llvm/DebugInfo/PDB/Native/RawTypes.h      |   38 +-
 .../llvm/DebugInfo/PDB/Native/SymbolCache.h   |    2 +-
 .../llvm/DebugInfo/PDB/Native/SymbolStream.h  |    2 +-
 .../llvm/DebugInfo/PDB/Native/TpiHashing.h    |    6 +-
 .../llvm/DebugInfo/PDB/Native/TpiStream.h     |    2 +-
 .../DebugInfo/PDB/Native/TpiStreamBuilder.h   |    4 +-
 llvm/include/llvm/DebugInfo/PDB/PDB.h         |    4 +-
 llvm/include/llvm/DebugInfo/PDB/PDBContext.h  |    2 +-
 llvm/include/llvm/DebugInfo/PDB/PDBExtras.h   |   38 +-
 .../include/llvm/DebugInfo/PDB/PDBSymDumper.h |    2 +-
 llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h   |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolAnnotation.h  |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolBlock.h       |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolCompiland.h   |    2 +-
 .../DebugInfo/PDB/PDBSymbolCompilandDetails.h |    2 +-
 .../DebugInfo/PDB/PDBSymbolCompilandEnv.h     |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolCustom.h      |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolData.h        |    2 +-
 .../include/llvm/DebugInfo/PDB/PDBSymbolExe.h |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolFunc.h        |    2 +-
 .../DebugInfo/PDB/PDBSymbolFuncDebugEnd.h     |    2 +-
 .../DebugInfo/PDB/PDBSymbolFuncDebugStart.h   |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolLabel.h       |    2 +-
 .../DebugInfo/PDB/PDBSymbolPublicSymbol.h     |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolThunk.h       |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeArray.h   |    2 +-
 .../DebugInfo/PDB/PDBSymbolTypeBaseClass.h    |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h  |    2 +-
 .../DebugInfo/PDB/PDBSymbolTypeDimension.h    |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h    |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h  |    2 +-
 .../DebugInfo/PDB/PDBSymbolTypeFunctionArg.h  |    2 +-
 .../DebugInfo/PDB/PDBSymbolTypeFunctionSig.h  |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypePointer.h |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h     |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h  |    2 +-
 .../DebugInfo/PDB/PDBSymbolTypeVTableShape.h  |    2 +-
 .../llvm/DebugInfo/PDB/PDBSymbolUnknown.h     |    2 +-
 .../DebugInfo/PDB/PDBSymbolUsingNamespace.h   |    2 +-
 llvm/include/llvm/DebugInfo/PDB/PDBTypes.h    |    8 +-
 llvm/include/llvm/DebugInfo/PDB/UDTLayout.h   |   14 +-
 .../llvm/DebugInfo/Symbolize/DIPrinter.h      |   14 +-
 .../include/llvm/DebugInfo/Symbolize/Markup.h |    4 +-
 .../llvm/DebugInfo/Symbolize/MarkupFilter.h   |    2 +-
 .../DebugInfo/Symbolize/SymbolizableModule.h  |    2 +-
 .../Symbolize/SymbolizableObjectFile.h        |    2 +-
 .../llvm/DebugInfo/Symbolize/Symbolize.h      |    4 +-
 llvm/include/llvm/Debuginfod/BuildIDFetcher.h |    2 +-
 llvm/include/llvm/Debuginfod/Debuginfod.h     |   26 +-
 llvm/include/llvm/Debuginfod/HTTPClient.h     |    8 +-
 llvm/include/llvm/Debuginfod/HTTPServer.h     |   10 +-
 llvm/include/llvm/Demangle/Demangle.h         |   14 +-
 llvm/include/llvm/Demangle/ItaniumDemangle.h  |  174 +--
 .../include/llvm/Demangle/MicrosoftDemangle.h |    6 +-
 .../llvm/Demangle/MicrosoftDemangleNodes.h    |   60 +-
 llvm/include/llvm/Demangle/Utility.h          |    4 +-
 .../llvm/ExecutionEngine/ExecutionEngine.h    |    6 +-
 .../llvm/ExecutionEngine/GenericValue.h       |    2 +-
 .../llvm/ExecutionEngine/Interpreter.h        |    2 +-
 .../llvm/ExecutionEngine/JITEventListener.h   |    2 +-
 .../llvm/ExecutionEngine/JITLink/COFF.h       |    4 +-
 .../ExecutionEngine/JITLink/COFF_x86_64.h     |    6 +-
 .../JITLink/DWARFRecordSectionSplitter.h      |    2 +-
 .../ExecutionEngine/JITLink/EHFrameSupport.h  |    8 +-
 .../llvm/ExecutionEngine/JITLink/ELF.h        |    4 +-
 .../ExecutionEngine/JITLink/ELF_aarch32.h     |    4 +-
 .../ExecutionEngine/JITLink/ELF_aarch64.h     |    4 +-
 .../llvm/ExecutionEngine/JITLink/ELF_i386.h   |    4 +-
 .../ExecutionEngine/JITLink/ELF_loongarch.h   |    4 +-
 .../llvm/ExecutionEngine/JITLink/ELF_ppc64.h  |    8 +-
 .../llvm/ExecutionEngine/JITLink/ELF_riscv.h  |    6 +-
 .../llvm/ExecutionEngine/JITLink/ELF_x86_64.h |    4 +-
 .../llvm/ExecutionEngine/JITLink/JITLink.h    |   54 +-
 .../ExecutionEngine/JITLink/JITLinkDylib.h    |    2 +-
 .../JITLink/JITLinkMemoryManager.h            |    8 +-
 .../llvm/ExecutionEngine/JITLink/MachO.h      |    4 +-
 .../ExecutionEngine/JITLink/MachO_arm64.h     |    8 +-
 .../ExecutionEngine/JITLink/MachO_x86_64.h    |    8 +-
 .../ExecutionEngine/JITLink/TableManager.h    |    2 +-
 .../llvm/ExecutionEngine/JITLink/aarch32.h    |   32 +-
 .../llvm/ExecutionEngine/JITLink/aarch64.h    |   10 +-
 .../llvm/ExecutionEngine/JITLink/i386.h       |   12 +-
 .../llvm/ExecutionEngine/JITLink/loongarch.h  |   12 +-
 .../llvm/ExecutionEngine/JITLink/ppc64.h      |   12 +-
 .../llvm/ExecutionEngine/JITLink/riscv.h      |    2 +-
 .../llvm/ExecutionEngine/JITLink/x86_64.h     |   12 +-
 llvm/include/llvm/ExecutionEngine/JITSymbol.h |   12 +-
 llvm/include/llvm/ExecutionEngine/MCJIT.h     |    2 +-
 .../llvm/ExecutionEngine/ObjectCache.h        |    2 +-
 .../llvm/ExecutionEngine/Orc/COFFPlatform.h   |    2 +-
 .../Orc/COFFVCRuntimeSupport.h                |    2 +-
 .../Orc/CompileOnDemandLayer.h                |    2 +-
 .../llvm/ExecutionEngine/Orc/CompileUtils.h   |    8 +-
 llvm/include/llvm/ExecutionEngine/Orc/Core.h  |   48 +-
 .../Orc/DebugObjectManagerPlugin.h            |    2 +-
 .../llvm/ExecutionEngine/Orc/DebugUtils.h     |   42 +-
 .../Orc/DebuggerSupportPlugin.h               |    2 +-
 .../llvm/ExecutionEngine/Orc/ELFNixPlatform.h |   14 +-
 .../Orc/EPCDebugObjectRegistrar.h             |    6 +-
 .../Orc/EPCDynamicLibrarySearchGenerator.h    |    2 +-
 .../ExecutionEngine/Orc/EPCEHFrameRegistrar.h |    2 +-
 .../Orc/EPCGenericDylibManager.h              |    2 +-
 .../Orc/EPCGenericJITLinkMemoryManager.h      |    4 +-
 .../Orc/EPCGenericMemoryAccess.h              |    2 +-
 .../Orc/EPCGenericRTDyldMemoryManager.h       |    2 +-
 .../ExecutionEngine/Orc/EPCIndirectionUtils.h |    6 +-
 .../llvm/ExecutionEngine/Orc/ExecutionUtils.h |   22 +-
 .../Orc/ExecutorProcessControl.h              |    6 +-
 .../llvm/ExecutionEngine/Orc/IRCompileLayer.h |    2 +-
 .../ExecutionEngine/Orc/IRTransformLayer.h    |    2 +-
 .../ExecutionEngine/Orc/IndirectionUtils.h    |   34 +-
 .../Orc/JITTargetMachineBuilder.h             |    2 +-
 llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h |   26 +-
 llvm/include/llvm/ExecutionEngine/Orc/Layer.h |   10 +-
 .../llvm/ExecutionEngine/Orc/LazyReexports.h  |    8 +-
 .../Orc/LookupAndRecordAddrs.h                |    6 +-
 .../llvm/ExecutionEngine/Orc/MachOPlatform.h  |    2 +-
 .../llvm/ExecutionEngine/Orc/Mangling.h       |    4 +-
 .../Orc/MapperJITLinkMemoryManager.h          |    2 +-
 .../llvm/ExecutionEngine/Orc/MemoryMapper.h   |    6 +-
 .../ExecutionEngine/Orc/ObjectFileInterface.h |    4 +-
 .../ExecutionEngine/Orc/ObjectLinkingLayer.h  |    4 +-
 .../Orc/ObjectTransformLayer.h                |    2 +-
 .../llvm/ExecutionEngine/Orc/OrcABISupport.h  |   26 +-
 .../Orc/RTDyldObjectLinkingLayer.h            |    2 +-
 .../Orc/Shared/AllocationActions.h            |    8 +-
 .../Orc/Shared/ExecutorAddress.h              |   12 +-
 .../Orc/Shared/ExecutorSymbolDef.h            |    2 +-
 .../ExecutionEngine/Orc/Shared/MemoryFlags.h  |    8 +-
 .../Orc/Shared/ObjectFormats.h                |   70 +-
 .../ExecutionEngine/Orc/Shared/OrcError.h     |    6 +-
 .../ExecutionEngine/Orc/Shared/OrcRTBridge.h  |   44 +-
 .../Orc/Shared/SimplePackedSerialization.h    |   66 +-
 .../Orc/Shared/SimpleRemoteEPCUtils.h         |   22 +-
 .../Orc/Shared/TargetProcessControlTypes.h    |   28 +-
 .../Orc/Shared/WrapperFunctionUtils.h         |   54 +-
 .../ExecutionEngine/Orc/SimpleRemoteEPC.h     |    2 +-
 .../ExecutionEngine/Orc/SpeculateAnalyses.h   |    6 +-
 .../llvm/ExecutionEngine/Orc/Speculation.h    |    6 +-
 .../ExecutionEngine/Orc/SymbolStringPool.h    |   14 +-
 .../TargetProcess/ExecutorBootstrapService.h  |    2 +-
 .../ExecutorSharedMemoryMapperService.h       |    2 +-
 .../Orc/TargetProcess/JITLoaderGDB.h          |    4 +-
 .../Orc/TargetProcess/RegisterEHFrames.h      |    8 +-
 .../SimpleExecutorDylibManager.h              |    2 +-
 .../SimpleExecutorMemoryManager.h             |    2 +-
 .../Orc/TargetProcess/SimpleRemoteEPCServer.h |    2 +-
 .../Orc/TargetProcess/TargetExecutionUtils.h  |    6 +-
 .../llvm/ExecutionEngine/Orc/TaskDispatch.h   |   12 +-
 .../ExecutionEngine/Orc/ThreadSafeModule.h    |    6 +-
 .../ExecutionEngine/RTDyldMemoryManager.h     |    4 +-
 .../llvm/ExecutionEngine/RuntimeDyld.h        |    8 +-
 .../llvm/ExecutionEngine/RuntimeDyldChecker.h |    2 +-
 .../ExecutionEngine/SectionMemoryManager.h    |    2 +-
 llvm/include/llvm/FileCheck/FileCheck.h       |    8 +-
 .../include/llvm/Frontend/HLSL/HLSLResource.h |    2 +-
 .../include/llvm/Frontend/OpenMP/OMPContext.h |   42 +-
 .../llvm/Frontend/OpenMP/OMPIRBuilder.h       |   22 +-
 llvm/include/llvm/FuzzMutate/FuzzerCLI.h      |    8 +-
 llvm/include/llvm/FuzzMutate/IRMutator.h      |   26 +-
 llvm/include/llvm/FuzzMutate/OpDescriptor.h   |    8 +-
 llvm/include/llvm/FuzzMutate/Operations.h     |   38 +-
 llvm/include/llvm/FuzzMutate/Random.h         |    2 +-
 .../include/llvm/FuzzMutate/RandomIRBuilder.h |    2 +-
 llvm/include/llvm/IR/AbstractCallSite.h       |    2 +-
 llvm/include/llvm/IR/Argument.h               |    2 +-
 .../llvm/IR/AssemblyAnnotationWriter.h        |    2 +-
 llvm/include/llvm/IR/Assumptions.h            |   16 +-
 llvm/include/llvm/IR/AttributeMask.h          |    2 +-
 llvm/include/llvm/IR/Attributes.h             |   28 +-
 llvm/include/llvm/IR/AutoUpgrade.h            |   34 +-
 llvm/include/llvm/IR/BasicBlock.h             |    4 +-
 llvm/include/llvm/IR/BuiltinGCs.h             |    6 +-
 llvm/include/llvm/IR/CFG.h                    |   20 +-
 llvm/include/llvm/IR/Comdat.h                 |    2 +-
 llvm/include/llvm/IR/Constant.h               |    2 +-
 llvm/include/llvm/IR/ConstantFold.h           |   22 +-
 llvm/include/llvm/IR/ConstantFolder.h         |    2 +-
 llvm/include/llvm/IR/ConstantRange.h          |    4 +-
 llvm/include/llvm/IR/Constants.h              |   50 +-
 llvm/include/llvm/IR/DIBuilder.h              |    2 +-
 llvm/include/llvm/IR/DataLayout.h             |    8 +-
 llvm/include/llvm/IR/DebugInfo.h              |   52 +-
 llvm/include/llvm/IR/DebugInfoMetadata.h      |   92 +-
 llvm/include/llvm/IR/DebugLoc.h               |    2 +-
 llvm/include/llvm/IR/DerivedTypes.h           |   20 +-
 llvm/include/llvm/IR/DerivedUser.h            |    2 +-
 llvm/include/llvm/IR/DiagnosticHandler.h      |    2 +-
 llvm/include/llvm/IR/DiagnosticInfo.h         |   52 +-
 llvm/include/llvm/IR/DiagnosticPrinter.h      |    4 +-
 llvm/include/llvm/IR/Dominators.h             |   24 +-
 llvm/include/llvm/IR/EHPersonalities.h        |   10 +-
 llvm/include/llvm/IR/FMF.h                    |    2 +-
 llvm/include/llvm/IR/FPEnv.h                  |   10 +-
 llvm/include/llvm/IR/Function.h               |    4 +-
 llvm/include/llvm/IR/GCStrategy.h             |    4 +-
 llvm/include/llvm/IR/GVMaterializer.h         |    2 +-
 .../llvm/IR/GetElementPtrTypeIterator.h       |    2 +-
 llvm/include/llvm/IR/GlobalAlias.h            |    4 +-
 llvm/include/llvm/IR/GlobalIFunc.h            |    4 +-
 llvm/include/llvm/IR/GlobalObject.h           |    2 +-
 llvm/include/llvm/IR/GlobalValue.h            |    2 +-
 llvm/include/llvm/IR/GlobalVariable.h         |    4 +-
 llvm/include/llvm/IR/IRBuilder.h              |   16 +-
 llvm/include/llvm/IR/IRBuilderFolder.h        |    2 +-
 llvm/include/llvm/IR/IRPrintingPasses.h       |    8 +-
 llvm/include/llvm/IR/InlineAsm.h              |    2 +-
 llvm/include/llvm/IR/InstIterator.h           |    2 +-
 llvm/include/llvm/IR/InstVisitor.h            |    2 +-
 llvm/include/llvm/IR/InstrTypes.h             |   30 +-
 llvm/include/llvm/IR/Instruction.h            |    4 +-
 llvm/include/llvm/IR/Instructions.h           |  132 +-
 llvm/include/llvm/IR/IntrinsicInst.h          |  110 +-
 llvm/include/llvm/IR/Intrinsics.h             |   34 +-
 llvm/include/llvm/IR/LLVMContext.h            |    2 +-
 llvm/include/llvm/IR/LLVMRemarkStreamer.h     |   14 +-
 llvm/include/llvm/IR/LegacyPassManager.h      |    8 +-
 llvm/include/llvm/IR/LegacyPassManagers.h     |   10 +-
 llvm/include/llvm/IR/LegacyPassNameParser.h   |    2 +-
 llvm/include/llvm/IR/MDBuilder.h              |    2 +-
 llvm/include/llvm/IR/Mangler.h                |    6 +-
 llvm/include/llvm/IR/MatrixBuilder.h          |    2 +-
 llvm/include/llvm/IR/Metadata.h               |   50 +-
 llvm/include/llvm/IR/Module.h                 |    2 +-
 llvm/include/llvm/IR/ModuleSlotTracker.h      |    4 +-
 llvm/include/llvm/IR/ModuleSummaryIndex.h     |   42 +-
 llvm/include/llvm/IR/ModuleSummaryIndexYAML.h |   32 +-
 llvm/include/llvm/IR/NoFolder.h               |    2 +-
 llvm/include/llvm/IR/OperandTraits.h          |    8 +-
 llvm/include/llvm/IR/Operator.h               |   36 +-
 llvm/include/llvm/IR/OptBisect.h              |    6 +-
 llvm/include/llvm/IR/PassInstrumentation.h    |    6 +-
 llvm/include/llvm/IR/PassManager.h            |   34 +-
 llvm/include/llvm/IR/PassManagerInternal.h    |   16 +-
 llvm/include/llvm/IR/PassTimingInfo.h         |    6 +-
 llvm/include/llvm/IR/PatternMatch.h           |  196 +--
 llvm/include/llvm/IR/PredIteratorCache.h      |    2 +-
 llvm/include/llvm/IR/PrintPasses.h            |   32 +-
 llvm/include/llvm/IR/ProfDataUtils.h          |   22 +-
 llvm/include/llvm/IR/ProfileSummary.h         |    4 +-
 llvm/include/llvm/IR/PseudoProbe.h            |   10 +-
 llvm/include/llvm/IR/ReplaceConstant.h        |    2 +-
 llvm/include/llvm/IR/SSAContext.h             |    2 +-
 llvm/include/llvm/IR/SafepointIRVerifier.h    |    6 +-
 llvm/include/llvm/IR/Statepoint.h             |    8 +-
 llvm/include/llvm/IR/StructuralHash.h         |    4 +-
 llvm/include/llvm/IR/SymbolTableListTraits.h  |    6 +-
 llvm/include/llvm/IR/TrackingMDRef.h          |   12 +-
 llvm/include/llvm/IR/Type.h                   |    4 +-
 llvm/include/llvm/IR/TypeFinder.h             |    2 +-
 llvm/include/llvm/IR/TypedPointerType.h       |    2 +-
 llvm/include/llvm/IR/Use.h                    |    6 +-
 llvm/include/llvm/IR/UseListOrder.h           |    2 +-
 llvm/include/llvm/IR/User.h                   |    6 +-
 llvm/include/llvm/IR/Value.h                  |   30 +-
 llvm/include/llvm/IR/ValueHandle.h            |   28 +-
 llvm/include/llvm/IR/ValueMap.h               |   12 +-
 llvm/include/llvm/IR/ValueSymbolTable.h       |    2 +-
 llvm/include/llvm/IR/VectorBuilder.h          |    2 +-
 llvm/include/llvm/IR/Verifier.h               |   12 +-
 .../include/llvm/IRPrinter/IRPrintingPasses.h |    4 +-
 llvm/include/llvm/IRReader/IRReader.h         |    8 +-
 llvm/include/llvm/InitializePasses.h          |  604 ++++----
 .../llvm/InterfaceStub/ELFObjHandler.h        |    4 +-
 llvm/include/llvm/InterfaceStub/IFSHandler.h  |   14 +-
 llvm/include/llvm/InterfaceStub/IFSStub.h     |   20 +-
 llvm/include/llvm/LTO/Config.h                |    6 +-
 llvm/include/llvm/LTO/LTO.h                   |   26 +-
 llvm/include/llvm/LTO/LTOBackend.h            |   14 +-
 .../llvm/LTO/SummaryBasedOptimizations.h      |    2 +-
 .../llvm/LTO/legacy/LTOCodeGenerator.h        |    6 +-
 llvm/include/llvm/LTO/legacy/LTOModule.h      |    2 +-
 .../llvm/LTO/legacy/ThinLTOCodeGenerator.h    |    4 +-
 .../llvm/LTO/legacy/UpdateCompilerUsed.h      |    2 +-
 llvm/include/llvm/LineEditor/LineEditor.h     |    2 +-
 llvm/include/llvm/LinkAllIR.h                 |    2 +-
 llvm/include/llvm/LinkAllPasses.h             |    2 +-
 llvm/include/llvm/Linker/IRMover.h            |    2 +-
 llvm/include/llvm/Linker/Linker.h             |    2 +-
 llvm/include/llvm/MC/ConstantPools.h          |    6 +-
 llvm/include/llvm/MC/DXContainerPSVInfo.h     |    2 +-
 llvm/include/llvm/MC/LaneBitmask.h            |    2 +-
 llvm/include/llvm/MC/MCAsmBackend.h           |    2 +-
 llvm/include/llvm/MC/MCAsmInfo.h              |    2 +-
 llvm/include/llvm/MC/MCAsmInfoCOFF.h          |    6 +-
 llvm/include/llvm/MC/MCAsmInfoDarwin.h        |    2 +-
 llvm/include/llvm/MC/MCAsmInfoELF.h           |    2 +-
 llvm/include/llvm/MC/MCAsmInfoGOFF.h          |    2 +-
 llvm/include/llvm/MC/MCAsmInfoWasm.h          |    2 +-
 llvm/include/llvm/MC/MCAsmInfoXCOFF.h         |    2 +-
 llvm/include/llvm/MC/MCAsmLayout.h            |    2 +-
 llvm/include/llvm/MC/MCAsmMacro.h             |    6 +-
 llvm/include/llvm/MC/MCAssembler.h            |    8 +-
 llvm/include/llvm/MC/MCCodeEmitter.h          |    2 +-
 llvm/include/llvm/MC/MCCodeView.h             |    6 +-
 llvm/include/llvm/MC/MCContext.h              |    2 +-
 llvm/include/llvm/MC/MCDXContainerStreamer.h  |    2 +-
 llvm/include/llvm/MC/MCDXContainerWriter.h    |    4 +-
 .../llvm/MC/MCDisassembler/MCDisassembler.h   |    6 +-
 .../MC/MCDisassembler/MCExternalSymbolizer.h  |    2 +-
 .../llvm/MC/MCDisassembler/MCRelocationInfo.h |    2 +-
 .../llvm/MC/MCDisassembler/MCSymbolizer.h     |    2 +-
 llvm/include/llvm/MC/MCDwarf.h                |   32 +-
 llvm/include/llvm/MC/MCELFObjectWriter.h      |    8 +-
 llvm/include/llvm/MC/MCELFStreamer.h          |    4 +-
 llvm/include/llvm/MC/MCExpr.h                 |   12 +-
 llvm/include/llvm/MC/MCFixup.h                |    2 +-
 llvm/include/llvm/MC/MCFixupKindInfo.h        |    2 +-
 llvm/include/llvm/MC/MCFragment.h             |   40 +-
 llvm/include/llvm/MC/MCInst.h                 |    4 +-
 llvm/include/llvm/MC/MCInstBuilder.h          |    2 +-
 llvm/include/llvm/MC/MCInstPrinter.h          |   12 +-
 llvm/include/llvm/MC/MCInstrAnalysis.h        |    2 +-
 llvm/include/llvm/MC/MCInstrDesc.h            |    4 +-
 llvm/include/llvm/MC/MCInstrInfo.h            |    2 +-
 llvm/include/llvm/MC/MCInstrItineraries.h     |    6 +-
 llvm/include/llvm/MC/MCLabel.h                |    2 +-
 .../llvm/MC/MCLinkerOptimizationHint.h        |    4 +-
 llvm/include/llvm/MC/MCMachObjectWriter.h     |    6 +-
 llvm/include/llvm/MC/MCObjectFileInfo.h       |    2 +-
 llvm/include/llvm/MC/MCObjectStreamer.h       |    2 +-
 llvm/include/llvm/MC/MCObjectWriter.h         |    4 +-
 llvm/include/llvm/MC/MCParser/AsmCond.h       |    2 +-
 llvm/include/llvm/MC/MCParser/AsmLexer.h      |    2 +-
 llvm/include/llvm/MC/MCParser/MCAsmLexer.h    |    4 +-
 llvm/include/llvm/MC/MCParser/MCAsmParser.h   |   14 +-
 .../llvm/MC/MCParser/MCAsmParserExtension.h   |    2 +-
 .../llvm/MC/MCParser/MCAsmParserUtils.h       |    2 +-
 .../llvm/MC/MCParser/MCParsedAsmOperand.h     |    2 +-
 .../llvm/MC/MCParser/MCTargetAsmParser.h      |   14 +-
 llvm/include/llvm/MC/MCPseudoProbe.h          |   20 +-
 llvm/include/llvm/MC/MCRegister.h             |    6 +-
 llvm/include/llvm/MC/MCRegisterInfo.h         |   20 +-
 llvm/include/llvm/MC/MCSPIRVObjectWriter.h    |    4 +-
 llvm/include/llvm/MC/MCSPIRVStreamer.h        |    2 +-
 llvm/include/llvm/MC/MCSchedule.h             |   18 +-
 llvm/include/llvm/MC/MCSection.h              |    4 +-
 llvm/include/llvm/MC/MCSectionCOFF.h          |    2 +-
 llvm/include/llvm/MC/MCSectionDXContainer.h   |    2 +-
 llvm/include/llvm/MC/MCSectionELF.h           |    2 +-
 llvm/include/llvm/MC/MCSectionGOFF.h          |    2 +-
 llvm/include/llvm/MC/MCSectionMachO.h         |    2 +-
 llvm/include/llvm/MC/MCSectionSPIRV.h         |    2 +-
 llvm/include/llvm/MC/MCSectionWasm.h          |    2 +-
 llvm/include/llvm/MC/MCSectionXCOFF.h         |    2 +-
 llvm/include/llvm/MC/MCStreamer.h             |    8 +-
 llvm/include/llvm/MC/MCSubtargetInfo.h        |    6 +-
 llvm/include/llvm/MC/MCSymbol.h               |    2 +-
 llvm/include/llvm/MC/MCSymbolCOFF.h           |    2 +-
 llvm/include/llvm/MC/MCSymbolELF.h            |    2 +-
 llvm/include/llvm/MC/MCSymbolGOFF.h           |    2 +-
 llvm/include/llvm/MC/MCSymbolMachO.h          |    2 +-
 llvm/include/llvm/MC/MCSymbolWasm.h           |    2 +-
 llvm/include/llvm/MC/MCSymbolXCOFF.h          |    2 +-
 llvm/include/llvm/MC/MCTargetOptions.h        |    2 +-
 .../llvm/MC/MCTargetOptionsCommandFlags.h     |   32 +-
 llvm/include/llvm/MC/MCValue.h                |    2 +-
 llvm/include/llvm/MC/MCWasmObjectWriter.h     |    6 +-
 llvm/include/llvm/MC/MCWasmStreamer.h         |    2 +-
 llvm/include/llvm/MC/MCWin64EH.h              |    8 +-
 llvm/include/llvm/MC/MCWinCOFFObjectWriter.h  |    6 +-
 llvm/include/llvm/MC/MCWinCOFFStreamer.h      |    2 +-
 llvm/include/llvm/MC/MCWinEH.h                |    6 +-
 llvm/include/llvm/MC/MCXCOFFObjectWriter.h    |    4 +-
 llvm/include/llvm/MC/MCXCOFFStreamer.h        |    2 +-
 llvm/include/llvm/MC/MachineLocation.h        |    2 +-
 llvm/include/llvm/MC/SectionKind.h            |    2 +-
 llvm/include/llvm/MC/StringTableBuilder.h     |    2 +-
 llvm/include/llvm/MC/TargetRegistry.h         |   66 +-
 llvm/include/llvm/MCA/CodeEmitter.h           |    2 +-
 llvm/include/llvm/MCA/Context.h               |    4 +-
 llvm/include/llvm/MCA/CustomBehaviour.h       |    8 +-
 llvm/include/llvm/MCA/HWEventListener.h       |   14 +-
 .../llvm/MCA/HardwareUnits/HardwareUnit.h     |    2 +-
 llvm/include/llvm/MCA/HardwareUnits/LSUnit.h  |    6 +-
 .../llvm/MCA/HardwareUnits/RegisterFile.h     |    4 +-
 .../llvm/MCA/HardwareUnits/ResourceManager.h  |    8 +-
 .../MCA/HardwareUnits/RetireControlUnit.h     |    2 +-
 .../llvm/MCA/HardwareUnits/Scheduler.h        |    6 +-
 llvm/include/llvm/MCA/IncrementalSourceMgr.h  |    2 +-
 llvm/include/llvm/MCA/InstrBuilder.h          |    4 +-
 llvm/include/llvm/MCA/Instruction.h           |   24 +-
 llvm/include/llvm/MCA/Pipeline.h              |    2 +-
 llvm/include/llvm/MCA/SourceMgr.h             |    4 +-
 llvm/include/llvm/MCA/Stages/DispatchStage.h  |    2 +-
 llvm/include/llvm/MCA/Stages/EntryStage.h     |    2 +-
 llvm/include/llvm/MCA/Stages/ExecuteStage.h   |    2 +-
 .../llvm/MCA/Stages/InOrderIssueStage.h       |    4 +-
 .../llvm/MCA/Stages/InstructionTables.h       |    2 +-
 .../llvm/MCA/Stages/MicroOpQueueStage.h       |    2 +-
 llvm/include/llvm/MCA/Stages/RetireStage.h    |    2 +-
 llvm/include/llvm/MCA/Stages/Stage.h          |    4 +-
 llvm/include/llvm/MCA/Support.h               |    8 +-
 llvm/include/llvm/MCA/View.h                  |    2 +-
 llvm/include/llvm/ObjCopy/COFF/COFFConfig.h   |    2 +-
 llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h  |    2 +-
 llvm/include/llvm/ObjCopy/CommonConfig.h      |   16 +-
 llvm/include/llvm/ObjCopy/ConfigManager.h     |    2 +-
 llvm/include/llvm/ObjCopy/ELF/ELFConfig.h     |    2 +-
 llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h    |    6 +-
 llvm/include/llvm/ObjCopy/MachO/MachOConfig.h |    2 +-
 .../include/llvm/ObjCopy/MachO/MachOObjcopy.h |    4 +-
 llvm/include/llvm/ObjCopy/MultiFormatConfig.h |    2 +-
 llvm/include/llvm/ObjCopy/ObjCopy.h           |    4 +-
 llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h |    2 +-
 .../include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h |    2 +-
 llvm/include/llvm/ObjCopy/wasm/WasmConfig.h   |    2 +-
 llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h  |    2 +-
 llvm/include/llvm/Object/Archive.h            |   16 +-
 llvm/include/llvm/Object/ArchiveWriter.h      |    8 +-
 llvm/include/llvm/Object/Binary.h             |    8 +-
 llvm/include/llvm/Object/BuildID.h            |    6 +-
 llvm/include/llvm/Object/COFF.h               |   94 +-
 llvm/include/llvm/Object/COFFImportFile.h     |    6 +-
 .../llvm/Object/COFFModuleDefinition.h        |    4 +-
 llvm/include/llvm/Object/CVDebugRecord.h      |    6 +-
 llvm/include/llvm/Object/DXContainer.h        |    4 +-
 llvm/include/llvm/Object/Decompressor.h       |    2 +-
 llvm/include/llvm/Object/ELF.h                |   20 +-
 llvm/include/llvm/Object/ELFObjectFile.h      |   20 +-
 llvm/include/llvm/Object/ELFTypes.h           |   70 +-
 llvm/include/llvm/Object/Error.h              |   10 +-
 llvm/include/llvm/Object/FaultMapParser.h     |    8 +-
 llvm/include/llvm/Object/GOFF.h               |    8 +-
 llvm/include/llvm/Object/GOFFObjectFile.h     |    2 +-
 llvm/include/llvm/Object/IRObjectFile.h       |    6 +-
 llvm/include/llvm/Object/IRSymtab.h           |   24 +-
 llvm/include/llvm/Object/MachO.h              |   20 +-
 llvm/include/llvm/Object/MachOUniversal.h     |    2 +-
 .../llvm/Object/MachOUniversalWriter.h        |    6 +-
 llvm/include/llvm/Object/Minidump.h           |    2 +-
 llvm/include/llvm/Object/ModuleSymbolTable.h  |    2 +-
 llvm/include/llvm/Object/ObjectFile.h         |   20 +-
 llvm/include/llvm/Object/OffloadBinary.h      |   14 +-
 llvm/include/llvm/Object/RelocationResolver.h |    4 +-
 llvm/include/llvm/Object/StackMapParser.h     |    2 +-
 llvm/include/llvm/Object/SymbolSize.h         |    6 +-
 llvm/include/llvm/Object/SymbolicFile.h       |    6 +-
 llvm/include/llvm/Object/TapiFile.h           |    2 +-
 llvm/include/llvm/Object/TapiUniversal.h      |    2 +-
 llvm/include/llvm/Object/Wasm.h               |   10 +-
 llvm/include/llvm/Object/WindowsMachineFlag.h |    4 +-
 llvm/include/llvm/Object/WindowsResource.h    |   18 +-
 llvm/include/llvm/Object/XCOFFObjectFile.h    |   78 +-
 llvm/include/llvm/ObjectYAML/ArchiveYAML.h    |    6 +-
 llvm/include/llvm/ObjectYAML/COFFYAML.h       |   68 +-
 .../ObjectYAML/CodeViewYAMLDebugSections.h    |   28 +-
 .../llvm/ObjectYAML/CodeViewYAMLSymbols.h     |    2 +-
 .../llvm/ObjectYAML/CodeViewYAMLTypeHashing.h |    8 +-
 .../llvm/ObjectYAML/CodeViewYAMLTypes.h       |    8 +-
 llvm/include/llvm/ObjectYAML/DWARFEmitter.h   |   36 +-
 llvm/include/llvm/ObjectYAML/DWARFYAML.h      |  120 +-
 .../include/llvm/ObjectYAML/DXContainerYAML.h |   34 +-
 llvm/include/llvm/ObjectYAML/ELFYAML.h        |  180 +--
 llvm/include/llvm/ObjectYAML/MachOYAML.h      |   76 +-
 llvm/include/llvm/ObjectYAML/MinidumpYAML.h   |   28 +-
 llvm/include/llvm/ObjectYAML/ObjectYAML.h     |    4 +-
 llvm/include/llvm/ObjectYAML/OffloadYAML.h    |   12 +-
 llvm/include/llvm/ObjectYAML/WasmYAML.h       |  162 +--
 llvm/include/llvm/ObjectYAML/XCOFFYAML.h      |   56 +-
 llvm/include/llvm/ObjectYAML/YAML.h           |    6 +-
 llvm/include/llvm/ObjectYAML/yaml2obj.h       |   22 +-
 llvm/include/llvm/Option/Arg.h                |    2 +-
 llvm/include/llvm/Option/ArgList.h            |    8 +-
 llvm/include/llvm/Option/OptSpecifier.h       |    2 +-
 llvm/include/llvm/Option/OptTable.h           |    6 +-
 llvm/include/llvm/Option/Option.h             |    2 +-
 llvm/include/llvm/Pass.h                      |   12 +-
 llvm/include/llvm/PassAnalysisSupport.h       |    4 +-
 llvm/include/llvm/PassInfo.h                  |    2 +-
 llvm/include/llvm/PassRegistry.h              |    2 +-
 llvm/include/llvm/PassSupport.h               |    8 +-
 llvm/include/llvm/Passes/OptimizationLevel.h  |    2 +-
 llvm/include/llvm/Passes/PassBuilder.h        |    6 +-
 llvm/include/llvm/Passes/PassPlugin.h         |    6 +-
 .../llvm/Passes/StandardInstrumentations.h    |   46 +-
 .../ProfileData/Coverage/CoverageMapping.h    |   52 +-
 .../Coverage/CoverageMappingReader.h          |   16 +-
 .../Coverage/CoverageMappingWriter.h          |    4 +-
 llvm/include/llvm/ProfileData/GCOV.h          |   14 +-
 llvm/include/llvm/ProfileData/InstrProf.h     |   72 +-
 .../llvm/ProfileData/InstrProfCorrelator.h    |    6 +-
 .../llvm/ProfileData/InstrProfData.inc        |   16 +-
 .../llvm/ProfileData/InstrProfReader.h        |   18 +-
 .../llvm/ProfileData/InstrProfWriter.h        |    2 +-
 .../ItaniumManglingCanonicalizer.h            |    2 +-
 llvm/include/llvm/ProfileData/MemProf.h       |   22 +-
 llvm/include/llvm/ProfileData/MemProfData.inc |    2 +-
 llvm/include/llvm/ProfileData/ProfileCommon.h |   20 +-
 .../llvm/ProfileData/RawMemProfReader.h       |    2 +-
 llvm/include/llvm/ProfileData/SampleProf.h    |   38 +-
 .../llvm/ProfileData/SampleProfReader.h       |   16 +-
 .../llvm/ProfileData/SampleProfWriter.h       |   16 +-
 .../llvm/ProfileData/SymbolRemappingReader.h  |    4 +-
 .../llvm/Remarks/BitstreamRemarkParser.h      |    6 +-
 .../llvm/Remarks/BitstreamRemarkSerializer.h  |    6 +-
 .../llvm/Remarks/HotnessThresholdParser.h     |    2 +-
 llvm/include/llvm/Remarks/Remark.h            |    6 +-
 llvm/include/llvm/Remarks/RemarkFormat.h      |    4 +-
 llvm/include/llvm/Remarks/RemarkLinker.h      |    4 +-
 llvm/include/llvm/Remarks/RemarkParser.h      |   12 +-
 llvm/include/llvm/Remarks/RemarkSerializer.h  |    8 +-
 llvm/include/llvm/Remarks/RemarkStreamer.h    |    2 +-
 llvm/include/llvm/Remarks/RemarkStringTable.h |    2 +-
 .../llvm/Remarks/YAMLRemarkSerializer.h       |    8 +-
 llvm/include/llvm/Support/AMDGPUMetadata.h    |   16 +-
 .../include/llvm/Support/ARMAttributeParser.h |    2 +-
 .../include/llvm/Support/ARMBuildAttributes.h |    2 +-
 llvm/include/llvm/Support/ARMWinEH.h          |   12 +-
 llvm/include/llvm/Support/AlignOf.h           |    1 +
 llvm/include/llvm/Support/Alignment.h         |   22 +-
 llvm/include/llvm/Support/Allocator.h         |    6 +-
 llvm/include/llvm/Support/AllocatorBase.h     |    8 +-
 llvm/include/llvm/Support/ArrayRecycler.h     |    2 +-
 llvm/include/llvm/Support/Atomic.h            |    4 +-
 llvm/include/llvm/Support/Automaton.h         |    6 +-
 llvm/include/llvm/Support/BLAKE3.h            |    4 +-
 .../llvm/Support/BalancedPartitioning.h       |    6 +-
 llvm/include/llvm/Support/Base64.h            |    2 +-
 llvm/include/llvm/Support/BinaryByteStream.h  |   10 +-
 llvm/include/llvm/Support/BinaryItemStream.h  |    4 +-
 llvm/include/llvm/Support/BinaryStream.h      |    4 +-
 llvm/include/llvm/Support/BinaryStreamArray.h |   10 +-
 llvm/include/llvm/Support/BinaryStreamError.h |    2 +-
 .../include/llvm/Support/BinaryStreamReader.h |    2 +-
 llvm/include/llvm/Support/BinaryStreamRef.h   |    8 +-
 .../include/llvm/Support/BinaryStreamWriter.h |    2 +-
 llvm/include/llvm/Support/BlockFrequency.h    |    2 +-
 llvm/include/llvm/Support/BranchProbability.h |    2 +-
 llvm/include/llvm/Support/BuryPointer.h       |    2 +-
 llvm/include/llvm/Support/CFGDiff.h           |    2 +-
 llvm/include/llvm/Support/CFGUpdate.h         |    2 +-
 llvm/include/llvm/Support/COM.h               |    2 +-
 llvm/include/llvm/Support/CRC.h               |    6 +-
 .../llvm/Support/CSKYAttributeParser.h        |    2 +-
 llvm/include/llvm/Support/CSKYAttributes.h    |    2 +-
 llvm/include/llvm/Support/CachePruning.h      |    6 +-
 llvm/include/llvm/Support/Caching.h           |    4 +-
 llvm/include/llvm/Support/Casting.h           |   86 +-
 llvm/include/llvm/Support/Chrono.h            |   20 +-
 llvm/include/llvm/Support/CodeGenCoverage.h   |    2 +-
 llvm/include/llvm/Support/CommandLine.h       |  178 +--
 llvm/include/llvm/Support/Compression.h       |   28 +-
 llvm/include/llvm/Support/ConvertEBCDIC.h     |    4 +-
 llvm/include/llvm/Support/ConvertUTF.h        |   44 +-
 .../llvm/Support/CrashRecoveryContext.h       |   14 +-
 llvm/include/llvm/Support/DJB.h               |    2 +-
 llvm/include/llvm/Support/DOTGraphTraits.h    |    4 +-
 llvm/include/llvm/Support/DataExtractor.h     |    4 +-
 llvm/include/llvm/Support/DebugCounter.h      |    2 +-
 .../llvm/Support/DivisionByConstantInfo.h     |    4 +-
 llvm/include/llvm/Support/Duration.h          |    2 +-
 llvm/include/llvm/Support/DynamicLibrary.h    |    2 +-
 .../include/llvm/Support/ELFAttributeParser.h |    2 +-
 llvm/include/llvm/Support/ELFAttributes.h     |    6 +-
 llvm/include/llvm/Support/Endian.h            |    4 +-
 llvm/include/llvm/Support/EndianStream.h      |    2 +-
 llvm/include/llvm/Support/Errc.h              |    2 +-
 llvm/include/llvm/Support/Errno.h             |    4 +-
 llvm/include/llvm/Support/ExtensibleRTTI.h    |    4 +-
 llvm/include/llvm/Support/FileCollector.h     |    4 +-
 llvm/include/llvm/Support/FileOutputBuffer.h  |    2 +-
 llvm/include/llvm/Support/FileSystem.h        |  172 +--
 .../llvm/Support/FileSystem/UniqueID.h        |    4 +-
 llvm/include/llvm/Support/FileUtilities.h     |    6 +-
 llvm/include/llvm/Support/FormatAdapters.h    |   10 +-
 llvm/include/llvm/Support/FormatCommon.h      |    2 +-
 llvm/include/llvm/Support/FormatProviders.h   |   32 +-
 llvm/include/llvm/Support/FormatVariadic.h    |    6 +-
 .../llvm/Support/FormatVariadicDetails.h      |   20 +-
 llvm/include/llvm/Support/FormattedStream.h   |    8 +-
 llvm/include/llvm/Support/GenericDomTree.h    |    6 +-
 .../llvm/Support/GenericDomTreeConstruction.h |    2 +-
 .../GenericIteratedDominanceFrontier.h        |    4 +-
 llvm/include/llvm/Support/GenericLoopInfo.h   |    4 +-
 .../llvm/Support/GenericLoopInfoImpl.h        |    2 +-
 llvm/include/llvm/Support/GlobPattern.h       |    2 +-
 llvm/include/llvm/Support/GraphWriter.h       |   10 +-
 llvm/include/llvm/Support/InitLLVM.h          |    2 +-
 llvm/include/llvm/Support/InstructionCost.h   |    2 +-
 llvm/include/llvm/Support/JSON.h              |   32 +-
 llvm/include/llvm/Support/KnownBits.h         |    2 +-
 llvm/include/llvm/Support/LEB128.h            |    4 +-
 llvm/include/llvm/Support/LLVMDriver.h        |    2 +-
 llvm/include/llvm/Support/LineIterator.h      |    2 +-
 llvm/include/llvm/Support/Locale.h            |    4 +-
 llvm/include/llvm/Support/LockFileManager.h   |    2 +-
 llvm/include/llvm/Support/MD5.h               |    2 +-
 .../llvm/Support/MSP430AttributeParser.h      |    2 +-
 llvm/include/llvm/Support/MSP430Attributes.h  |    2 +-
 .../llvm/Support/MSVCErrorWorkarounds.h       |    4 +-
 llvm/include/llvm/Support/ManagedStatic.h     |   14 +-
 llvm/include/llvm/Support/MemAlloc.h          |    4 +-
 llvm/include/llvm/Support/Memory.h            |    6 +-
 llvm/include/llvm/Support/MemoryBuffer.h      |    6 +-
 llvm/include/llvm/Support/MemoryBufferRef.h   |    2 +-
 llvm/include/llvm/Support/ModRef.h            |    6 +-
 llvm/include/llvm/Support/Mutex.h             |    2 +-
 llvm/include/llvm/Support/NativeFormatting.h  |   20 +-
 llvm/include/llvm/Support/OnDiskHashTable.h   |    6 +-
 .../llvm/Support/OptimizedStructLayout.h      |    4 +-
 llvm/include/llvm/Support/PGOOptions.h        |    2 +-
 llvm/include/llvm/Support/Parallel.h          |   12 +-
 llvm/include/llvm/Support/Path.h              |   92 +-
 .../llvm/Support/PerThreadBumpPtrAllocator.h  |    2 +-
 llvm/include/llvm/Support/PluginLoader.h      |    2 +-
 .../llvm/Support/PointerLikeTypeTraits.h      |   26 +-
 llvm/include/llvm/Support/PrettyStackTrace.h  |   22 +-
 llvm/include/llvm/Support/Printable.h         |    2 +-
 llvm/include/llvm/Support/Process.h           |    2 +-
 llvm/include/llvm/Support/Program.h           |   28 +-
 .../llvm/Support/RISCVAttributeParser.h       |    2 +-
 llvm/include/llvm/Support/RISCVAttributes.h   |    2 +-
 llvm/include/llvm/Support/RISCVISAInfo.h      |    4 +-
 llvm/include/llvm/Support/RWMutex.h           |    2 +-
 .../llvm/Support/RandomNumberGenerator.h      |    4 +-
 llvm/include/llvm/Support/Recycler.h          |    4 +-
 .../include/llvm/Support/RecyclingAllocator.h |    2 +-
 llvm/include/llvm/Support/Regex.h             |    2 +-
 llvm/include/llvm/Support/Registry.h          |    4 +-
 llvm/include/llvm/Support/SHA1.h              |    2 +-
 llvm/include/llvm/Support/SHA256.h            |    2 +-
 llvm/include/llvm/Support/SMLoc.h             |    4 +-
 llvm/include/llvm/Support/SMTAPI.h            |    8 +-
 llvm/include/llvm/Support/SaveAndRestore.h    |    2 +-
 llvm/include/llvm/Support/ScaledNumber.h      |   12 +-
 llvm/include/llvm/Support/ScopedPrinter.h     |   18 +-
 llvm/include/llvm/Support/Signals.h           |   28 +-
 llvm/include/llvm/Support/Signposts.h         |    2 +-
 .../llvm/Support/SmallVectorMemoryBuffer.h    |    2 +-
 llvm/include/llvm/Support/SourceMgr.h         |    6 +-
 llvm/include/llvm/Support/SpecialCaseList.h   |    2 +-
 llvm/include/llvm/Support/StringSaver.h       |    4 +-
 llvm/include/llvm/Support/SuffixTree.h        |    2 +-
 llvm/include/llvm/Support/SuffixTreeNode.h    |    6 +-
 llvm/include/llvm/Support/SystemUtils.h       |    2 +-
 llvm/include/llvm/Support/TarWriter.h         |    2 +-
 llvm/include/llvm/Support/ThreadPool.h        |    4 +-
 llvm/include/llvm/Support/Threading.h         |   20 +-
 llvm/include/llvm/Support/TimeProfiler.h      |   20 +-
 llvm/include/llvm/Support/Timer.h             |   12 +-
 llvm/include/llvm/Support/ToolOutputFile.h    |    2 +-
 llvm/include/llvm/Support/TrailingObjects.h   |   16 +-
 llvm/include/llvm/Support/TypeSize.h          |   12 +-
 llvm/include/llvm/Support/Unicode.h           |   18 +-
 llvm/include/llvm/Support/UnicodeCharRanges.h |    4 +-
 llvm/include/llvm/Support/Valgrind.h          |    4 +-
 llvm/include/llvm/Support/VersionTuple.h      |    6 +-
 llvm/include/llvm/Support/VirtualFileSystem.h |   42 +-
 llvm/include/llvm/Support/Watchdog.h          |    2 +-
 llvm/include/llvm/Support/Win64EH.h           |    4 +-
 llvm/include/llvm/Support/WindowsError.h      |    2 +-
 llvm/include/llvm/Support/WithColor.h         |    4 +-
 .../Support/X86DisassemblerDecoderCommon.h    |    2 +-
 llvm/include/llvm/Support/YAMLParser.h        |   32 +-
 llvm/include/llvm/Support/YAMLTraits.h        |  154 +-
 .../llvm/Support/circular_raw_ostream.h       |    2 +-
 llvm/include/llvm/Support/raw_os_ostream.h    |    2 +-
 llvm/include/llvm/Support/thread.h            |   12 +-
 llvm/include/llvm/Support/xxhash.h            |    4 +-
 llvm/include/llvm/TableGen/Error.h            |   42 +-
 llvm/include/llvm/TableGen/Main.h             |    2 +-
 llvm/include/llvm/TableGen/Parser.h           |    2 +-
 llvm/include/llvm/TableGen/Record.h           |  100 +-
 llvm/include/llvm/TableGen/SetTheory.h        |    2 +-
 llvm/include/llvm/TableGen/StringMatcher.h    |    2 +-
 llvm/include/llvm/TableGen/TableGenBackend.h  |   10 +-
 .../include/llvm/Target/CGPassBuilderOption.h |    4 +-
 .../include/llvm/Target/TargetIntrinsicInfo.h |    2 +-
 .../llvm/Target/TargetLoweringObjectFile.h    |    2 +-
 llvm/include/llvm/Target/TargetMachine.h      |    4 +-
 llvm/include/llvm/Target/TargetOptions.h      |    2 +-
 .../llvm/TargetParser/AArch64TargetParser.h   |   28 +-
 .../llvm/TargetParser/ARMTargetParser.h       |   72 +-
 .../llvm/TargetParser/ARMTargetParserCommon.h |   12 +-
 .../llvm/TargetParser/CSKYTargetParser.h      |   34 +-
 llvm/include/llvm/TargetParser/Host.h         |   24 +-
 .../llvm/TargetParser/LoongArchTargetParser.h |    8 +-
 .../llvm/TargetParser/RISCVTargetParser.h     |   10 +-
 .../llvm/TargetParser/SubtargetFeature.h      |    6 +-
 llvm/include/llvm/TargetParser/TargetParser.h |   26 +-
 llvm/include/llvm/TargetParser/Triple.h       |    2 +-
 .../llvm/TargetParser/X86TargetParser.h       |   22 +-
 .../llvm/Testing/Annotations/Annotations.h    |    4 +-
 llvm/include/llvm/Testing/Support/Error.h     |   10 +-
 .../llvm/Testing/Support/SupportHelpers.h     |   14 +-
 llvm/include/llvm/TextAPI/Architecture.h      |   14 +-
 llvm/include/llvm/TextAPI/ArchitectureSet.h   |    4 +-
 llvm/include/llvm/TextAPI/InterfaceFile.h     |    8 +-
 llvm/include/llvm/TextAPI/PackedVersion.h     |    2 +-
 llvm/include/llvm/TextAPI/Platform.h          |   14 +-
 llvm/include/llvm/TextAPI/Symbol.h            |    2 +-
 llvm/include/llvm/TextAPI/Target.h            |   12 +-
 llvm/include/llvm/TextAPI/TextAPIReader.h     |    2 +-
 llvm/include/llvm/TextAPI/TextAPIWriter.h     |    2 +-
 .../ToolDrivers/llvm-dlltool/DlltoolDriver.h  |    2 +-
 .../llvm/ToolDrivers/llvm-lib/LibDriver.h     |    2 +-
 .../AggressiveInstCombine.h                   |    2 +-
 llvm/include/llvm/Transforms/CFGuard.h        |    4 +-
 .../llvm/Transforms/Coroutines/CoroCleanup.h  |    2 +-
 .../Coroutines/CoroConditionalWrapper.h       |    2 +-
 .../llvm/Transforms/Coroutines/CoroEarly.h    |    2 +-
 .../llvm/Transforms/Coroutines/CoroElide.h    |    2 +-
 .../llvm/Transforms/Coroutines/CoroSplit.h    |    2 +-
 llvm/include/llvm/Transforms/IPO.h            |   10 +-
 .../llvm/Transforms/IPO/AlwaysInliner.h       |    4 +-
 .../llvm/Transforms/IPO/Annotation2Metadata.h |    2 +-
 .../llvm/Transforms/IPO/ArgumentPromotion.h   |    2 +-
 llvm/include/llvm/Transforms/IPO/Attributor.h |  202 +--
 .../llvm/Transforms/IPO/BlockExtractor.h      |    2 +-
 .../Transforms/IPO/CalledValuePropagation.h   |    2 +-
 .../llvm/Transforms/IPO/ConstantMerge.h       |    2 +-
 .../include/llvm/Transforms/IPO/CrossDSOCFI.h |    2 +-
 .../Transforms/IPO/DeadArgumentElimination.h  |    2 +-
 .../llvm/Transforms/IPO/ElimAvailExtern.h     |    2 +-
 .../llvm/Transforms/IPO/EmbedBitcodePass.h    |    4 +-
 llvm/include/llvm/Transforms/IPO/ExtractGV.h  |    2 +-
 .../llvm/Transforms/IPO/ForceFunctionAttrs.h  |    2 +-
 .../llvm/Transforms/IPO/FunctionAttrs.h       |    8 +-
 .../llvm/Transforms/IPO/FunctionImport.h      |   26 +-
 .../Transforms/IPO/FunctionSpecialization.h   |    8 +-
 llvm/include/llvm/Transforms/IPO/GlobalDCE.h  |    2 +-
 llvm/include/llvm/Transforms/IPO/GlobalOpt.h  |    2 +-
 .../include/llvm/Transforms/IPO/GlobalSplit.h |    2 +-
 .../llvm/Transforms/IPO/HotColdSplitting.h    |    4 +-
 llvm/include/llvm/Transforms/IPO/IROutliner.h |    6 +-
 .../llvm/Transforms/IPO/InferFunctionAttrs.h  |    2 +-
 llvm/include/llvm/Transforms/IPO/Inliner.h    |    4 +-
 .../include/llvm/Transforms/IPO/Internalize.h |    2 +-
 .../llvm/Transforms/IPO/LoopExtractor.h       |    2 +-
 .../llvm/Transforms/IPO/LowerTypeTests.h      |   12 +-
 .../IPO/MemProfContextDisambiguation.h        |    2 +-
 .../llvm/Transforms/IPO/MergeFunctions.h      |    2 +-
 .../llvm/Transforms/IPO/ModuleInliner.h       |    2 +-
 llvm/include/llvm/Transforms/IPO/OpenMPOpt.h  |   12 +-
 .../llvm/Transforms/IPO/PartialInlining.h     |    2 +-
 .../llvm/Transforms/IPO/ProfiledCallGraph.h   |   10 +-
 llvm/include/llvm/Transforms/IPO/SCCP.h       |    4 +-
 .../Transforms/IPO/SampleContextTracker.h     |    4 +-
 .../llvm/Transforms/IPO/SampleProfile.h       |   14 +-
 .../llvm/Transforms/IPO/SampleProfileProbe.h  |    8 +-
 .../llvm/Transforms/IPO/StripDeadPrototypes.h |    2 +-
 .../llvm/Transforms/IPO/StripSymbols.h        |    8 +-
 .../IPO/SyntheticCountsPropagation.h          |    2 +-
 .../Transforms/IPO/ThinLTOBitcodeWriter.h     |    2 +-
 .../llvm/Transforms/IPO/WholeProgramDevirt.h  |   30 +-
 .../llvm/Transforms/InstCombine/InstCombine.h |    8 +-
 .../include/llvm/Transforms/Instrumentation.h |   16 +-
 .../Instrumentation/AddressSanitizer.h        |    6 +-
 .../Instrumentation/AddressSanitizerCommon.h  |    4 +-
 .../Instrumentation/BlockCoverageInference.h  |    2 +-
 .../Instrumentation/BoundsChecking.h          |    2 +-
 .../llvm/Transforms/Instrumentation/CFGMST.h  |    2 +-
 .../Transforms/Instrumentation/CGProfile.h    |    2 +-
 .../Instrumentation/ControlHeightReduction.h  |    2 +-
 .../Instrumentation/DataFlowSanitizer.h       |    2 +-
 .../Transforms/Instrumentation/GCOVProfiler.h |    2 +-
 .../Instrumentation/HWAddressSanitizer.h      |    4 +-
 .../Instrumentation/InstrOrderFile.h          |    2 +-
 .../Instrumentation/InstrProfiling.h          |    2 +-
 .../llvm/Transforms/Instrumentation/KCFI.h    |    2 +-
 .../Transforms/Instrumentation/MemProfiler.h  |    6 +-
 .../Instrumentation/MemorySanitizer.h         |    4 +-
 .../Instrumentation/PGOInstrumentation.h      |   16 +-
 .../Instrumentation/PoisonChecking.h          |    2 +-
 .../Instrumentation/SanitizerBinaryMetadata.h |    4 +-
 .../Instrumentation/SanitizerCoverage.h       |    2 +-
 .../Instrumentation/ThreadSanitizer.h         |    4 +-
 llvm/include/llvm/Transforms/ObjCARC.h        |   12 +-
 llvm/include/llvm/Transforms/Scalar.h         |   84 +-
 llvm/include/llvm/Transforms/Scalar/ADCE.h    |    2 +-
 .../Scalar/AlignmentFromAssumptions.h         |    2 +-
 .../Transforms/Scalar/AnnotationRemarks.h     |    2 +-
 llvm/include/llvm/Transforms/Scalar/BDCE.h    |    2 +-
 .../Transforms/Scalar/CallSiteSplitting.h     |    2 +-
 .../llvm/Transforms/Scalar/ConstantHoisting.h |   10 +-
 .../Transforms/Scalar/ConstraintElimination.h |    2 +-
 .../Scalar/CorrelatedValuePropagation.h       |    2 +-
 llvm/include/llvm/Transforms/Scalar/DCE.h     |    4 +-
 .../llvm/Transforms/Scalar/DFAJumpThreading.h |    2 +-
 .../Transforms/Scalar/DeadStoreElimination.h  |    2 +-
 .../llvm/Transforms/Scalar/DivRemPairs.h      |    2 +-
 .../include/llvm/Transforms/Scalar/EarlyCSE.h |    2 +-
 .../llvm/Transforms/Scalar/FlattenCFG.h       |    2 +-
 .../llvm/Transforms/Scalar/Float2Int.h        |    2 +-
 llvm/include/llvm/Transforms/Scalar/GVN.h     |   12 +-
 .../llvm/Transforms/Scalar/GVNExpression.h    |   28 +-
 .../llvm/Transforms/Scalar/GuardWidening.h    |    2 +-
 .../llvm/Transforms/Scalar/IVUsersPrinter.h   |    2 +-
 .../llvm/Transforms/Scalar/IndVarSimplify.h   |    2 +-
 .../Scalar/InductiveRangeCheckElimination.h   |    2 +-
 .../Transforms/Scalar/InferAddressSpaces.h    |    2 +-
 .../llvm/Transforms/Scalar/InstSimplifyPass.h |    2 +-
 .../llvm/Transforms/Scalar/JumpThreading.h    |    2 +-
 llvm/include/llvm/Transforms/Scalar/LICM.h    |   10 +-
 .../Scalar/LoopAccessAnalysisPrinter.h        |    2 +-
 .../llvm/Transforms/Scalar/LoopBoundSplit.h   |    2 +-
 .../llvm/Transforms/Scalar/LoopDataPrefetch.h |    2 +-
 .../llvm/Transforms/Scalar/LoopDeletion.h     |    2 +-
 .../llvm/Transforms/Scalar/LoopDistribute.h   |    2 +-
 .../llvm/Transforms/Scalar/LoopFlatten.h      |    2 +-
 .../include/llvm/Transforms/Scalar/LoopFuse.h |    2 +-
 .../Transforms/Scalar/LoopIdiomRecognize.h    |    4 +-
 .../llvm/Transforms/Scalar/LoopInstSimplify.h |    2 +-
 .../llvm/Transforms/Scalar/LoopInterchange.h  |    2 +-
 .../Transforms/Scalar/LoopLoadElimination.h   |    2 +-
 .../llvm/Transforms/Scalar/LoopPassManager.h  |   10 +-
 .../llvm/Transforms/Scalar/LoopPredication.h  |    2 +-
 .../llvm/Transforms/Scalar/LoopReroll.h       |    2 +-
 .../llvm/Transforms/Scalar/LoopRotation.h     |    2 +-
 .../llvm/Transforms/Scalar/LoopSimplifyCFG.h  |    2 +-
 .../include/llvm/Transforms/Scalar/LoopSink.h |    2 +-
 .../Transforms/Scalar/LoopStrengthReduce.h    |    2 +-
 .../Transforms/Scalar/LoopUnrollAndJamPass.h  |    2 +-
 .../llvm/Transforms/Scalar/LoopUnrollPass.h   |    8 +-
 .../Transforms/Scalar/LoopVersioningLICM.h    |    2 +-
 .../llvm/Transforms/Scalar/LowerAtomicPass.h  |    2 +-
 .../Scalar/LowerConstantIntrinsics.h          |    2 +-
 .../Transforms/Scalar/LowerExpectIntrinsic.h  |    2 +-
 .../Transforms/Scalar/LowerGuardIntrinsic.h   |    2 +-
 .../Transforms/Scalar/LowerMatrixIntrinsics.h |    2 +-
 .../Scalar/LowerWidenableCondition.h          |    2 +-
 .../Transforms/Scalar/MakeGuardsExplicit.h    |    2 +-
 .../llvm/Transforms/Scalar/MemCpyOptimizer.h  |    2 +-
 .../llvm/Transforms/Scalar/MergeICmps.h       |    2 +-
 .../Transforms/Scalar/MergedLoadStoreMotion.h |    4 +-
 .../llvm/Transforms/Scalar/NaryReassociate.h  |    2 +-
 llvm/include/llvm/Transforms/Scalar/NewGVN.h  |    2 +-
 .../Scalar/PartiallyInlineLibCalls.h          |    2 +-
 .../llvm/Transforms/Scalar/PlaceSafepoints.h  |    2 +-
 .../llvm/Transforms/Scalar/Reassociate.h      |    6 +-
 llvm/include/llvm/Transforms/Scalar/Reg2Mem.h |    2 +-
 .../Scalar/RewriteStatepointsForGC.h          |    2 +-
 llvm/include/llvm/Transforms/Scalar/SCCP.h    |    2 +-
 llvm/include/llvm/Transforms/Scalar/SROA.h    |    6 +-
 .../Scalar/ScalarizeMaskedMemIntrin.h         |    2 +-
 .../llvm/Transforms/Scalar/Scalarizer.h       |    6 +-
 .../Scalar/SeparateConstOffsetFromGEP.h       |    2 +-
 .../Transforms/Scalar/SimpleLoopUnswitch.h    |    4 +-
 .../llvm/Transforms/Scalar/SimplifyCFG.h      |    2 +-
 llvm/include/llvm/Transforms/Scalar/Sink.h    |    2 +-
 .../Transforms/Scalar/SpeculativeExecution.h  |    2 +-
 .../Scalar/StraightLineStrengthReduce.h       |    2 +-
 .../llvm/Transforms/Scalar/StructurizeCFG.h   |    2 +-
 .../llvm/Transforms/Scalar/TLSVariableHoist.h |    6 +-
 .../Scalar/TailRecursionElimination.h         |    2 +-
 .../Transforms/Scalar/WarnMissedTransforms.h  |    2 +-
 llvm/include/llvm/Transforms/Utils.h          |   30 +-
 .../llvm/Transforms/Utils/AMDGPUEmitPrintf.h  |    2 +-
 .../Transforms/Utils/ASanStackFrameLayout.h   |   12 +-
 .../llvm/Transforms/Utils/AddDiscriminators.h |    2 +-
 .../Transforms/Utils/AssumeBundleBuilder.h    |   12 +-
 .../llvm/Transforms/Utils/BasicBlockUtils.h   |   78 +-
 .../Transforms/Utils/BreakCriticalEdges.h     |    2 +-
 .../llvm/Transforms/Utils/BuildLibCalls.h     |   94 +-
 .../Transforms/Utils/BypassSlowDivision.h     |    6 +-
 .../llvm/Transforms/Utils/CallGraphUpdater.h  |    2 +-
 .../Transforms/Utils/CallPromotionUtils.h     |   10 +-
 .../Transforms/Utils/CanonicalizeAliases.h    |    2 +-
 .../Utils/CanonicalizeFreezeInLoops.h         |    2 +-
 llvm/include/llvm/Transforms/Utils/Cloning.h  |   42 +-
 .../llvm/Transforms/Utils/CodeExtractor.h     |    4 +-
 .../llvm/Transforms/Utils/CodeLayout.h        |    6 +-
 .../llvm/Transforms/Utils/CodeMoverUtils.h    |   16 +-
 .../llvm/Transforms/Utils/CountVisits.h       |    2 +-
 .../include/llvm/Transforms/Utils/CtorUtils.h |    2 +-
 llvm/include/llvm/Transforms/Utils/Debugify.h |   30 +-
 .../Transforms/Utils/EntryExitInstrumenter.h  |    2 +-
 .../llvm/Transforms/Utils/EscapeEnumerator.h  |    2 +-
 .../include/llvm/Transforms/Utils/Evaluator.h |    2 +-
 .../llvm/Transforms/Utils/FixIrreducible.h    |    2 +-
 .../Transforms/Utils/FunctionComparator.h     |    4 +-
 .../Transforms/Utils/FunctionImportUtils.h    |    4 +-
 .../llvm/Transforms/Utils/GlobalStatus.h      |    4 +-
 .../llvm/Transforms/Utils/GuardUtils.h        |    6 +-
 .../llvm/Transforms/Utils/HelloWorld.h        |    2 +-
 .../llvm/Transforms/Utils/InjectTLIMappings.h |    2 +-
 .../llvm/Transforms/Utils/InstructionNamer.h  |    2 +-
 .../Transforms/Utils/InstructionWorklist.h    |    2 +-
 .../llvm/Transforms/Utils/IntegerDivision.h   |   12 +-
 llvm/include/llvm/Transforms/Utils/LCSSA.h    |    2 +-
 .../Transforms/Utils/LibCallsShrinkWrap.h     |    2 +-
 llvm/include/llvm/Transforms/Utils/Local.h    |  110 +-
 llvm/include/llvm/Transforms/Utils/LoopPeel.h |    8 +-
 .../llvm/Transforms/Utils/LoopRotationUtils.h |    2 +-
 .../llvm/Transforms/Utils/LoopSimplify.h      |    4 +-
 .../include/llvm/Transforms/Utils/LoopUtils.h |  110 +-
 .../llvm/Transforms/Utils/LoopVersioning.h    |    4 +-
 .../llvm/Transforms/Utils/LowerAtomic.h       |    6 +-
 .../llvm/Transforms/Utils/LowerGlobalDtors.h  |    2 +-
 .../llvm/Transforms/Utils/LowerIFunc.h        |    2 +-
 .../llvm/Transforms/Utils/LowerInvoke.h       |    2 +-
 .../Transforms/Utils/LowerMemIntrinsics.h     |   12 +-
 .../llvm/Transforms/Utils/LowerSwitch.h       |    2 +-
 .../llvm/Transforms/Utils/MatrixUtils.h       |    2 +-
 llvm/include/llvm/Transforms/Utils/Mem2Reg.h  |    2 +-
 .../llvm/Transforms/Utils/MemoryOpRemark.h    |    4 +-
 .../Transforms/Utils/MemoryTaggingSupport.h   |   16 +-
 .../llvm/Transforms/Utils/MetaRenamer.h       |    2 +-
 .../include/llvm/Transforms/Utils/MisExpect.h |    8 +-
 .../llvm/Transforms/Utils/ModuleUtils.h       |   32 +-
 .../llvm/Transforms/Utils/MoveAutoInit.h      |    2 +-
 .../llvm/Transforms/Utils/NameAnonGlobals.h   |    2 +-
 .../llvm/Transforms/Utils/PredicateInfo.h     |   20 +-
 .../llvm/Transforms/Utils/PromoteMemToReg.h   |    4 +-
 .../Utils/RelLookupTableConverter.h           |    2 +-
 .../llvm/Transforms/Utils/SCCPSolver.h        |    4 +-
 .../llvm/Transforms/Utils/SSAUpdater.h        |    4 +-
 .../llvm/Transforms/Utils/SSAUpdaterBulk.h    |    2 +-
 .../llvm/Transforms/Utils/SSAUpdaterImpl.h    |    2 +-
 .../Transforms/Utils/SampleProfileInference.h |   14 +-
 .../Utils/SampleProfileLoaderBaseUtil.h       |   14 +-
 .../llvm/Transforms/Utils/SanitizerStats.h    |    2 +-
 .../Utils/ScalarEvolutionExpander.h           |    8 +-
 .../Transforms/Utils/SimplifyCFGOptions.h     |    2 +-
 .../llvm/Transforms/Utils/SimplifyIndVar.h    |   10 +-
 .../llvm/Transforms/Utils/SimplifyLibCalls.h  |    4 +-
 llvm/include/llvm/Transforms/Utils/SizeOpts.h |   22 +-
 .../llvm/Transforms/Utils/SplitModule.h       |    2 +-
 .../llvm/Transforms/Utils/StripGCRelocates.h  |    2 +-
 .../Utils/StripNonLineTableDebugInfo.h        |    2 +-
 .../llvm/Transforms/Utils/SymbolRewriter.h    |    6 +-
 .../Transforms/Utils/UnifyFunctionExitNodes.h |    6 +-
 .../llvm/Transforms/Utils/UnifyLoopExits.h    |    2 +-
 .../llvm/Transforms/Utils/UnrollLoop.h        |   22 +-
 .../llvm/Transforms/Utils/VNCoercion.h        |   18 +-
 .../llvm/Transforms/Utils/ValueMapper.h       |    6 +-
 llvm/include/llvm/Transforms/Vectorize.h      |    2 +-
 .../Vectorize/LoadStoreVectorizer.h           |    4 +-
 .../Vectorize/LoopVectorizationLegality.h     |    6 +-
 .../llvm/Transforms/Vectorize/LoopVectorize.h |   18 +-
 .../llvm/Transforms/Vectorize/SLPVectorizer.h |    2 +-
 .../llvm/Transforms/Vectorize/VectorCombine.h |    2 +-
 llvm/include/llvm/WindowsDriver/MSVCPaths.h   |   24 +-
 .../WindowsManifest/WindowsManifestMerger.h   |    6 +-
 llvm/include/llvm/XRay/BlockIndexer.h         |    2 +-
 llvm/include/llvm/XRay/BlockPrinter.h         |    2 +-
 llvm/include/llvm/XRay/BlockVerifier.h        |    2 +-
 llvm/include/llvm/XRay/FDRRecordConsumer.h    |    6 +-
 llvm/include/llvm/XRay/FDRRecordProducer.h    |    4 +-
 llvm/include/llvm/XRay/FDRRecords.h           |   32 +-
 llvm/include/llvm/XRay/FDRTraceExpander.h     |    2 +-
 llvm/include/llvm/XRay/FDRTraceWriter.h       |    2 +-
 llvm/include/llvm/XRay/FileHeaderReader.h     |    2 +-
 llvm/include/llvm/XRay/Graph.h                |    2 +-
 llvm/include/llvm/XRay/InstrumentationMap.h   |   14 +-
 llvm/include/llvm/XRay/Profile.h              |   10 +-
 llvm/include/llvm/XRay/RecordPrinter.h        |    2 +-
 llvm/include/llvm/XRay/Trace.h                |    8 +-
 llvm/include/llvm/XRay/XRayRecord.h           |    4 +-
 llvm/include/llvm/XRay/YAMLXRayRecord.h       |   14 +-
 .../googlemock/include/gmock/gmock-actions.h  |   56 +-
 .../include/gmock/gmock-cardinalities.h       |    2 +-
 .../include/gmock/gmock-generated-actions.h   |    6 +-
 .../googlemock/include/gmock/gmock-matchers.h |  144 +-
 .../include/gmock/gmock-nice-strict.h         |    6 +-
 .../include/gmock/gmock-spec-builders.h       |   26 +-
 .../gmock/internal/gmock-internal-utils.h     |   44 +-
 .../googletest/include/gtest/gtest-message.h  |    2 +-
 .../include/gtest/gtest-test-part.h           |    2 +-
 .../unittest/googletest/include/gtest/gtest.h |   12 +-
 .../internal/gtest-death-test-internal.h      |    2 +-
 .../include/gtest/internal/gtest-internal.h   |    2 +-
 .../include/gtest/internal/gtest-port.h       |   16 +-
 1613 files changed, 9890 insertions(+), 9885 deletions(-)

diff --git a/llvm/include/llvm-c/Analysis.h b/llvm/include/llvm-c/Analysis.h
index e515ef311aee3e5..26538ce7cd6d687 100644
--- a/llvm/include/llvm-c/Analysis.h
+++ b/llvm/include/llvm-c/Analysis.h
@@ -42,17 +42,17 @@ typedef enum {
 /* Verifies that a module is valid, taking the specified action if not.
    Optionally returns a human-readable description of any invalid constructs.
    OutMessage must be disposed with LLVMDisposeMessage. */
-LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
+LLVM_FUNC_ABI LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,
                           char **OutMessage);
 
 /* Verifies that a single function is valid, taking the specified action. Useful
    for debugging. */
-LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
+LLVM_FUNC_ABI LLVMBool LLVMVerifyFunction(LLVMValueRef Fn, LLVMVerifierFailureAction Action);
 
 /* Open up a ghostview window that displays the CFG of the current function.
    Useful for debugging. */
-void LLVMViewFunctionCFG(LLVMValueRef Fn);
-void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
+LLVM_FUNC_ABI void LLVMViewFunctionCFG(LLVMValueRef Fn);
+LLVM_FUNC_ABI void LLVMViewFunctionCFGOnly(LLVMValueRef Fn);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/BitReader.h b/llvm/include/llvm-c/BitReader.h
index 1a960118979a22c..fbfa4a5186fd58d 100644
--- a/llvm/include/llvm-c/BitReader.h
+++ b/llvm/include/llvm-c/BitReader.h
@@ -37,20 +37,20 @@ LLVM_C_EXTERN_C_BEGIN
    Optionally returns a human-readable error message via OutMessage.
 
    This is deprecated. Use LLVMParseBitcode2. */
-LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
+LLVM_FUNC_ABI LLVMBool LLVMParseBitcode(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutModule,
                           char **OutMessage);
 
 /* Builds a module from the bitcode in the specified memory buffer, returning a
    reference to the module via the OutModule parameter. Returns 0 on success. */
-LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
+LLVM_FUNC_ABI LLVMBool LLVMParseBitcode2(LLVMMemoryBufferRef MemBuf,
                            LLVMModuleRef *OutModule);
 
 /* This is deprecated. Use LLVMParseBitcodeInContext2. */
-LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
+LLVM_FUNC_ABI LLVMBool LLVMParseBitcodeInContext(LLVMContextRef ContextRef,
                                    LLVMMemoryBufferRef MemBuf,
                                    LLVMModuleRef *OutModule, char **OutMessage);
 
-LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
+LLVM_FUNC_ABI LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
                                     LLVMMemoryBufferRef MemBuf,
                                     LLVMModuleRef *OutModule);
 
@@ -58,7 +58,7 @@ LLVMBool LLVMParseBitcodeInContext2(LLVMContextRef ContextRef,
     a module provider which performs lazy deserialization. Returns 0 on success.
     Optionally returns a human-readable error message via OutMessage.
     This is deprecated. Use LLVMGetBitcodeModuleInContext2. */
-LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
+LLVM_FUNC_ABI LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
                                        LLVMMemoryBufferRef MemBuf,
                                        LLVMModuleRef *OutM, char **OutMessage);
 
@@ -69,15 +69,15 @@ LLVMBool LLVMGetBitcodeModuleInContext(LLVMContextRef ContextRef,
  *
  * Takes ownership of \p MemBuf if (and only if) the module was read
  * successfully. */
-LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
+LLVM_FUNC_ABI LLVMBool LLVMGetBitcodeModuleInContext2(LLVMContextRef ContextRef,
                                         LLVMMemoryBufferRef MemBuf,
                                         LLVMModuleRef *OutM);
 
 /* This is deprecated. Use LLVMGetBitcodeModule2. */
-LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
+LLVM_FUNC_ABI LLVMBool LLVMGetBitcodeModule(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
                               char **OutMessage);
 
-LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
+LLVM_FUNC_ABI LLVMBool LLVMGetBitcodeModule2(LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/BitWriter.h b/llvm/include/llvm-c/BitWriter.h
index 5baba8cbe7cf45c..c7c9c065cfc266e 100644
--- a/llvm/include/llvm-c/BitWriter.h
+++ b/llvm/include/llvm-c/BitWriter.h
@@ -35,18 +35,18 @@ LLVM_C_EXTERN_C_BEGIN
 /*===-- Operations on modules ---------------------------------------------===*/
 
 /** Writes a module to the specified path. Returns 0 on success. */
-int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
+LLVM_FUNC_ABI int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path);
 
 /** Writes a module to an open file descriptor. Returns 0 on success. */
-int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
+LLVM_FUNC_ABI int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
                          int Unbuffered);
 
 /** Deprecated for LLVMWriteBitcodeToFD. Writes a module to an open file
     descriptor. Returns 0 on success. Closes the Handle. */
-int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
+LLVM_FUNC_ABI int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
 
 /** Writes a module to a new memory buffer and returns it. */
-LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/Comdat.h b/llvm/include/llvm-c/Comdat.h
index 8ef628366cf36ed..c391f50a1f12386 100644
--- a/llvm/include/llvm-c/Comdat.h
+++ b/llvm/include/llvm-c/Comdat.h
@@ -44,35 +44,35 @@ typedef enum {
  *
  * @see llvm::Module::getOrInsertComdat()
  */
-LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
+LLVM_FUNC_ABI LLVMComdatRef LLVMGetOrInsertComdat(LLVMModuleRef M, const char *Name);
 
 /**
  * Get the Comdat assigned to the given global object.
  *
  * @see llvm::GlobalObject::getComdat()
  */
-LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
+LLVM_FUNC_ABI LLVMComdatRef LLVMGetComdat(LLVMValueRef V);
 
 /**
  * Assign the Comdat to the given global object.
  *
  * @see llvm::GlobalObject::setComdat()
  */
-void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
+LLVM_FUNC_ABI void LLVMSetComdat(LLVMValueRef V, LLVMComdatRef C);
 
 /*
  * Get the conflict resolution selection kind for the Comdat.
  *
  * @see llvm::Comdat::getSelectionKind()
  */
-LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
+LLVM_FUNC_ABI LLVMComdatSelectionKind LLVMGetComdatSelectionKind(LLVMComdatRef C);
 
 /*
  * Set the conflict resolution selection kind for the Comdat.
  *
  * @see llvm::Comdat::setSelectionKind()
  */
-void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);
+LLVM_FUNC_ABI void LLVMSetComdatSelectionKind(LLVMComdatRef C, LLVMComdatSelectionKind Kind);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index 372830b09a855b2..435ed90f3833b1f 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -478,7 +478,7 @@ typedef unsigned LLVMAttributeIndex;
 /** Deallocate and destroy all ManagedStatic variables.
     @see llvm::llvm_shutdown
     @see ManagedStatic */
-void LLVMShutdown(void);
+LLVM_FUNC_ABI void LLVMShutdown(void);
 
 /*===-- Version query -----------------------------------------------------===*/
 
@@ -488,12 +488,12 @@ void LLVMShutdown(void);
  * The version components are returned via the function's three output
  * parameters or skipped if a NULL pointer was supplied.
  */
-void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch);
+LLVM_FUNC_ABI void LLVMGetVersion(unsigned *Major, unsigned *Minor, unsigned *Patch);
 
 /*===-- Error handling ----------------------------------------------------===*/
 
-char *LLVMCreateMessage(const char *Message);
-void LLVMDisposeMessage(char *Message);
+LLVM_FUNC_ABI char *LLVMCreateMessage(const char *Message);
+LLVM_FUNC_ABI void LLVMDisposeMessage(char *Message);
 
 /**
  * @defgroup LLVMCCoreContext Contexts
@@ -516,36 +516,36 @@ typedef void (*LLVMYieldCallback)(LLVMContextRef, void *);
  * Every call to this function should be paired with a call to
  * LLVMContextDispose() or the context will leak memory.
  */
-LLVMContextRef LLVMContextCreate(void);
+LLVM_FUNC_ABI LLVMContextRef LLVMContextCreate(void);
 
 /**
  * Obtain the global context instance.
  */
-LLVMContextRef LLVMGetGlobalContext(void);
+LLVM_FUNC_ABI LLVMContextRef LLVMGetGlobalContext(void);
 
 /**
  * Set the diagnostic handler for this context.
  */
-void LLVMContextSetDiagnosticHandler(LLVMContextRef C,
+LLVM_FUNC_ABI void LLVMContextSetDiagnosticHandler(LLVMContextRef C,
                                      LLVMDiagnosticHandler Handler,
                                      void *DiagnosticContext);
 
 /**
  * Get the diagnostic handler of this context.
  */
-LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMDiagnosticHandler LLVMContextGetDiagnosticHandler(LLVMContextRef C);
 
 /**
  * Get the diagnostic context of this context.
  */
-void *LLVMContextGetDiagnosticContext(LLVMContextRef C);
+LLVM_FUNC_ABI void *LLVMContextGetDiagnosticContext(LLVMContextRef C);
 
 /**
  * Set the yield callback function for this context.
  *
  * @see LLVMContext::setYieldCallback()
  */
-void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback,
+LLVM_FUNC_ABI void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback,
                                  void *OpaqueHandle);
 
 /**
@@ -553,7 +553,7 @@ void LLVMContextSetYieldCallback(LLVMContextRef C, LLVMYieldCallback Callback,
  *
  * @see LLVMContext::shouldDiscardValueNames()
  */
-LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C);
 
 /**
  * Set whether the given context discards all value names.
@@ -563,7 +563,7 @@ LLVMBool LLVMContextShouldDiscardValueNames(LLVMContextRef C);
  *
  * @see LLVMContext::setDiscardValueNames()
  */
-void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard);
+LLVM_FUNC_ABI void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard);
 
 /**
  * Destroy a context instance.
@@ -571,7 +571,7 @@ void LLVMContextSetDiscardValueNames(LLVMContextRef C, LLVMBool Discard);
  * This should be called for every call to LLVMContextCreate() or memory
  * will be leaked.
  */
-void LLVMContextDispose(LLVMContextRef C);
+LLVM_FUNC_ABI void LLVMContextDispose(LLVMContextRef C);
 
 /**
  * Return a string representation of the DiagnosticInfo. Use
@@ -579,18 +579,18 @@ void LLVMContextDispose(LLVMContextRef C);
  *
  * @see DiagnosticInfo::print()
  */
-char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI);
+LLVM_FUNC_ABI char *LLVMGetDiagInfoDescription(LLVMDiagnosticInfoRef DI);
 
 /**
  * Return an enum LLVMDiagnosticSeverity.
  *
  * @see DiagnosticInfo::getSeverity()
  */
-LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI);
+LLVM_FUNC_ABI LLVMDiagnosticSeverity LLVMGetDiagInfoSeverity(LLVMDiagnosticInfoRef DI);
 
-unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
+LLVM_FUNC_ABI unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
                                   unsigned SLen);
-unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
+LLVM_FUNC_ABI unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
 
 /**
  * Return an unique id given the name of a enum attribute,
@@ -603,65 +603,65 @@ unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
  * NB: Attribute names and/or id are subject to change without
  * going through the C API deprecation cycle.
  */
-unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen);
-unsigned LLVMGetLastEnumAttributeKind(void);
+LLVM_FUNC_ABI unsigned LLVMGetEnumAttributeKindForName(const char *Name, size_t SLen);
+LLVM_FUNC_ABI unsigned LLVMGetLastEnumAttributeKind(void);
 
 /**
  * Create an enum attribute.
  */
-LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID,
+LLVM_FUNC_ABI LLVMAttributeRef LLVMCreateEnumAttribute(LLVMContextRef C, unsigned KindID,
                                          uint64_t Val);
 
 /**
  * Get the unique id corresponding to the enum attribute
  * passed as argument.
  */
-unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A);
+LLVM_FUNC_ABI unsigned LLVMGetEnumAttributeKind(LLVMAttributeRef A);
 
 /**
  * Get the enum attribute's value. 0 is returned if none exists.
  */
-uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A);
+LLVM_FUNC_ABI uint64_t LLVMGetEnumAttributeValue(LLVMAttributeRef A);
 
 /**
  * Create a type attribute
  */
-LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID,
+LLVM_FUNC_ABI LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID,
                                          LLVMTypeRef type_ref);
 
 /**
  * Get the type attribute's value.
  */
-LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
 
 /**
  * Create a string attribute.
  */
-LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C,
+LLVM_FUNC_ABI LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C,
                                            const char *K, unsigned KLength,
                                            const char *V, unsigned VLength);
 
 /**
  * Get the string attribute's kind.
  */
-const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length);
+LLVM_FUNC_ABI const char *LLVMGetStringAttributeKind(LLVMAttributeRef A, unsigned *Length);
 
 /**
  * Get the string attribute's value.
  */
-const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length);
+LLVM_FUNC_ABI const char *LLVMGetStringAttributeValue(LLVMAttributeRef A, unsigned *Length);
 
 /**
  * Check for the different types of attributes.
  */
-LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A);
-LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A);
-LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A);
+LLVM_FUNC_ABI LLVMBool LLVMIsEnumAttribute(LLVMAttributeRef A);
+LLVM_FUNC_ABI LLVMBool LLVMIsStringAttribute(LLVMAttributeRef A);
+LLVM_FUNC_ABI LLVMBool LLVMIsTypeAttribute(LLVMAttributeRef A);
 
 /**
  * Obtain a Type from a context by its registered name.
  */
-LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name);
 
 /**
  * @}
@@ -686,7 +686,7 @@ LLVMTypeRef LLVMGetTypeByName2(LLVMContextRef C, const char *Name);
  * Every invocation should be paired with LLVMDisposeModule() or memory
  * will be leaked.
  */
-LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
+LLVM_FUNC_ABI LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
 
 /**
  * Create a new, empty module in a specific context.
@@ -694,12 +694,12 @@ LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID);
  * Every invocation should be paired with LLVMDisposeModule() or memory
  * will be leaked.
  */
-LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID,
+LLVM_FUNC_ABI LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID,
                                                 LLVMContextRef C);
 /**
  * Return an exact copy of the specified module.
  */
-LLVMModuleRef LLVMCloneModule(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMModuleRef LLVMCloneModule(LLVMModuleRef M);
 
 /**
  * Destroy a module instance.
@@ -707,7 +707,7 @@ LLVMModuleRef LLVMCloneModule(LLVMModuleRef M);
  * This must be called for every created module or memory will be
  * leaked.
  */
-void LLVMDisposeModule(LLVMModuleRef M);
+LLVM_FUNC_ABI void LLVMDisposeModule(LLVMModuleRef M);
 
 /**
  * Obtain the identifier of a module.
@@ -717,7 +717,7 @@ void LLVMDisposeModule(LLVMModuleRef M);
  * @return The identifier of M.
  * @see Module::getModuleIdentifier()
  */
-const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
+LLVM_FUNC_ABI const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
 
 /**
  * Set the identifier of a module to a string Ident with length Len.
@@ -727,7 +727,7 @@ const char *LLVMGetModuleIdentifier(LLVMModuleRef M, size_t *Len);
  * @param Len Length of Ident
  * @see Module::setModuleIdentifier()
  */
-void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len);
+LLVM_FUNC_ABI void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len);
 
 /**
  * Obtain the module's original source file name.
@@ -737,7 +737,7 @@ void LLVMSetModuleIdentifier(LLVMModuleRef M, const char *Ident, size_t Len);
  * @return The original source file name of M
  * @see Module::getSourceFileName()
  */
-const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len);
+LLVM_FUNC_ABI const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len);
 
 /**
  * Set the original source file name of a module to a string Name with length
@@ -748,7 +748,7 @@ const char *LLVMGetSourceFileName(LLVMModuleRef M, size_t *Len);
  * @param Len Length of Name
  * @see Module::setSourceFileName()
  */
-void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len);
+LLVM_FUNC_ABI void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len);
 
 /**
  * Obtain the data layout for a module.
@@ -759,29 +759,29 @@ void LLVMSetSourceFileName(LLVMModuleRef M, const char *Name, size_t Len);
  * but match the name of another method on the module. Prefer the use
  * of LLVMGetDataLayoutStr, which is not ambiguous.
  */
-const char *LLVMGetDataLayoutStr(LLVMModuleRef M);
-const char *LLVMGetDataLayout(LLVMModuleRef M);
+LLVM_FUNC_ABI const char *LLVMGetDataLayoutStr(LLVMModuleRef M);
+LLVM_FUNC_ABI const char *LLVMGetDataLayout(LLVMModuleRef M);
 
 /**
  * Set the data layout for a module.
  *
  * @see Module::setDataLayout()
  */
-void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr);
+LLVM_FUNC_ABI void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr);
 
 /**
  * Obtain the target triple for a module.
  *
  * @see Module::getTargetTriple()
  */
-const char *LLVMGetTarget(LLVMModuleRef M);
+LLVM_FUNC_ABI const char *LLVMGetTarget(LLVMModuleRef M);
 
 /**
  * Set the target triple for a module.
  *
  * @see Module::setTargetTriple()
  */
-void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
+LLVM_FUNC_ABI void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
 
 /**
  * Returns the module flags as an array of flag-key-value triples.  The caller
@@ -790,19 +790,19 @@ void LLVMSetTarget(LLVMModuleRef M, const char *Triple);
  *
  * @see Module::getModuleFlagsMetadata()
  */
-LLVMModuleFlagEntry *LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len);
+LLVM_FUNC_ABI LLVMModuleFlagEntry *LLVMCopyModuleFlagsMetadata(LLVMModuleRef M, size_t *Len);
 
 /**
  * Destroys module flags metadata entries.
  */
-void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries);
+LLVM_FUNC_ABI void LLVMDisposeModuleFlagsMetadata(LLVMModuleFlagEntry *Entries);
 
 /**
  * Returns the flag behavior for a module flag entry at a specific index.
  *
  * @see Module::ModuleFlagEntry::Behavior
  */
-LLVMModuleFlagBehavior
+LLVM_FUNC_ABI LLVMModuleFlagBehavior
 LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries,
                                      unsigned Index);
 
@@ -811,7 +811,7 @@ LLVMModuleFlagEntriesGetFlagBehavior(LLVMModuleFlagEntry *Entries,
  *
  * @see Module::ModuleFlagEntry::Key
  */
-const char *LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries,
+LLVM_FUNC_ABI const char *LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries,
                                         unsigned Index, size_t *Len);
 
 /**
@@ -819,7 +819,7 @@ const char *LLVMModuleFlagEntriesGetKey(LLVMModuleFlagEntry *Entries,
  *
  * @see Module::ModuleFlagEntry::Val
  */
-LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries,
                                                  unsigned Index);
 
 /**
@@ -828,7 +828,7 @@ LLVMMetadataRef LLVMModuleFlagEntriesGetMetadata(LLVMModuleFlagEntry *Entries,
  *
  * @see Module::getModuleFlag()
  */
-LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M,
                                   const char *Key, size_t KeyLen);
 
 /**
@@ -837,7 +837,7 @@ LLVMMetadataRef LLVMGetModuleFlag(LLVMModuleRef M,
  *
  * @see Module::addModuleFlag()
  */
-void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior,
+LLVM_FUNC_ABI void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior,
                        const char *Key, size_t KeyLen,
                        LLVMMetadataRef Val);
 
@@ -846,7 +846,7 @@ void LLVMAddModuleFlag(LLVMModuleRef M, LLVMModuleFlagBehavior Behavior,
  *
  * @see Module::dump()
  */
-void LLVMDumpModule(LLVMModuleRef M);
+LLVM_FUNC_ABI void LLVMDumpModule(LLVMModuleRef M);
 
 /**
  * Print a representation of a module to a file. The ErrorMessage needs to be
@@ -854,7 +854,7 @@ void LLVMDumpModule(LLVMModuleRef M);
  *
  * @see Module::print()
  */
-LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
+LLVM_FUNC_ABI LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
                                char **ErrorMessage);
 
 /**
@@ -863,35 +863,35 @@ LLVMBool LLVMPrintModuleToFile(LLVMModuleRef M, const char *Filename,
  *
  * @see Module::print()
  */
-char *LLVMPrintModuleToString(LLVMModuleRef M);
+LLVM_FUNC_ABI char *LLVMPrintModuleToString(LLVMModuleRef M);
 
 /**
  * Get inline assembly for a module.
  *
  * @see Module::getModuleInlineAsm()
  */
-const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len);
+LLVM_FUNC_ABI const char *LLVMGetModuleInlineAsm(LLVMModuleRef M, size_t *Len);
 
 /**
  * Set inline assembly for a module.
  *
  * @see Module::setModuleInlineAsm()
  */
-void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len);
+LLVM_FUNC_ABI void LLVMSetModuleInlineAsm2(LLVMModuleRef M, const char *Asm, size_t Len);
 
 /**
  * Append inline assembly to a module.
  *
  * @see Module::appendModuleInlineAsm()
  */
-void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len);
+LLVM_FUNC_ABI void LLVMAppendModuleInlineAsm(LLVMModuleRef M, const char *Asm, size_t Len);
 
 /**
  * Create the specified uniqued inline asm string.
  *
  * @see InlineAsm::get()
  */
-LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, char *AsmString,
+LLVM_FUNC_ABI LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, char *AsmString,
                               size_t AsmStringSize, char *Constraints,
                               size_t ConstraintsSize, LLVMBool HasSideEffects,
                               LLVMBool IsAlignStack,
@@ -902,24 +902,24 @@ LLVMValueRef LLVMGetInlineAsm(LLVMTypeRef Ty, char *AsmString,
  *
  * @see Module::getContext()
  */
-LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M);
 
 /** Deprecated: Use LLVMGetTypeByName2 instead. */
-LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name);
 
 /**
  * Obtain an iterator to the first NamedMDNode in a Module.
  *
  * @see llvm::Module::named_metadata_begin()
  */
-LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetFirstNamedMetadata(LLVMModuleRef M);
 
 /**
  * Obtain an iterator to the last NamedMDNode in a Module.
  *
  * @see llvm::Module::named_metadata_end()
  */
-LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M);
 
 /**
  * Advance a NamedMDNode iterator to the next NamedMDNode.
@@ -927,7 +927,7 @@ LLVMNamedMDNodeRef LLVMGetLastNamedMetadata(LLVMModuleRef M);
  * Returns NULL if the iterator was already at the end and there are no more
  * named metadata nodes.
  */
-LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode);
+LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode);
 
 /**
  * Decrement a NamedMDNode iterator to the previous NamedMDNode.
@@ -935,7 +935,7 @@ LLVMNamedMDNodeRef LLVMGetNextNamedMetadata(LLVMNamedMDNodeRef NamedMDNode);
  * Returns NULL if the iterator was already at the beginning and there are
  * no previous named metadata nodes.
  */
-LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode);
+LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode);
 
 /**
  * Retrieve a NamedMDNode with the given name, returning NULL if no such
@@ -943,7 +943,7 @@ LLVMNamedMDNodeRef LLVMGetPreviousNamedMetadata(LLVMNamedMDNodeRef NamedMDNode);
  *
  * @see llvm::Module::getNamedMetadata()
  */
-LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M,
                                         const char *Name, size_t NameLen);
 
 /**
@@ -952,7 +952,7 @@ LLVMNamedMDNodeRef LLVMGetNamedMetadata(LLVMModuleRef M,
  *
  * @see llvm::Module::getOrInsertNamedMetadata()
  */
-LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata(LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata(LLVMModuleRef M,
                                                 const char *Name,
                                                 size_t NameLen);
 
@@ -961,7 +961,7 @@ LLVMNamedMDNodeRef LLVMGetOrInsertNamedMetadata(LLVMModuleRef M,
  *
  * @see llvm::NamedMDNode::getName()
  */
-const char *LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD,
+LLVM_FUNC_ABI const char *LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD,
                                      size_t *NameLen);
 
 /**
@@ -969,7 +969,7 @@ const char *LLVMGetNamedMetadataName(LLVMNamedMDNodeRef NamedMD,
  *
  * @see llvm::Module::getNamedMetadata()
  */
-unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name);
+LLVM_FUNC_ABI unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name);
 
 /**
  * Obtain the named metadata operands for a module.
@@ -982,7 +982,7 @@ unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char *Name);
  * @see llvm::Module::getNamedMetadata()
  * @see llvm::MDNode::getOperand()
  */
-void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name,
+LLVM_FUNC_ABI void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name,
                                   LLVMValueRef *Dest);
 
 /**
@@ -991,7 +991,7 @@ void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char *Name,
  * @see llvm::Module::getNamedMetadata()
  * @see llvm::MDNode::addOperand()
  */
-void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name,
+LLVM_FUNC_ABI void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name,
                                  LLVMValueRef Val);
 
 /**
@@ -1002,7 +1002,7 @@ void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Name,
  * @see llvm::GlobalVariable::getDebugInfo()
  * @see llvm::Function::getSubprogram()
  */
-const char *LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length);
+LLVM_FUNC_ABI const char *LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length);
 
 /**
  * Return the filename of the debug location for this value, which must be
@@ -1012,7 +1012,7 @@ const char *LLVMGetDebugLocDirectory(LLVMValueRef Val, unsigned *Length);
  * @see llvm::GlobalVariable::getDebugInfo()
  * @see llvm::Function::getSubprogram()
  */
-const char *LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length);
+LLVM_FUNC_ABI const char *LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length);
 
 /**
  * Return the line number of the debug location for this value, which must be
@@ -1022,7 +1022,7 @@ const char *LLVMGetDebugLocFilename(LLVMValueRef Val, unsigned *Length);
  * @see llvm::GlobalVariable::getDebugInfo()
  * @see llvm::Function::getSubprogram()
  */
-unsigned LLVMGetDebugLocLine(LLVMValueRef Val);
+LLVM_FUNC_ABI unsigned LLVMGetDebugLocLine(LLVMValueRef Val);
 
 /**
  * Return the column number of the debug location for this value, which must be
@@ -1030,14 +1030,14 @@ unsigned LLVMGetDebugLocLine(LLVMValueRef Val);
  *
  * @see llvm::Instruction::getDebugLoc()
  */
-unsigned LLVMGetDebugLocColumn(LLVMValueRef Val);
+LLVM_FUNC_ABI unsigned LLVMGetDebugLocColumn(LLVMValueRef Val);
 
 /**
  * Add a function to a module under a specified name.
  *
  * @see llvm::Function::Create()
  */
-LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
+LLVM_FUNC_ABI LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
                              LLVMTypeRef FunctionTy);
 
 /**
@@ -1047,21 +1047,21 @@ LLVMValueRef LLVMAddFunction(LLVMModuleRef M, const char *Name,
  *
  * @see llvm::Module::getFunction()
  */
-LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNamedFunction(LLVMModuleRef M, const char *Name);
 
 /**
  * Obtain an iterator to the first Function in a Module.
  *
  * @see llvm::Module::begin()
  */
-LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstFunction(LLVMModuleRef M);
 
 /**
  * Obtain an iterator to the last Function in a Module.
  *
  * @see llvm::Module::end()
  */
-LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M);
 
 /**
  * Advance a Function iterator to the next Function.
@@ -1069,7 +1069,7 @@ LLVMValueRef LLVMGetLastFunction(LLVMModuleRef M);
  * Returns NULL if the iterator was already at the end and there are no more
  * functions.
  */
-LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn);
 
 /**
  * Decrement a Function iterator to the previous Function.
@@ -1077,10 +1077,10 @@ LLVMValueRef LLVMGetNextFunction(LLVMValueRef Fn);
  * Returns NULL if the iterator was already at the beginning and there are
  * no previous functions.
  */
-LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousFunction(LLVMValueRef Fn);
 
 /** Deprecated: Use LLVMSetModuleInlineAsm2 instead. */
-void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
+LLVM_FUNC_ABI void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
 
 /**
  * @}
@@ -1120,7 +1120,7 @@ void LLVMSetModuleInlineAsm(LLVMModuleRef M, const char *Asm);
  *
  * @see llvm::Type:getTypeID()
  */
-LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
 
 /**
  * Whether the type has a known size.
@@ -1129,21 +1129,21 @@ LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
  *
  * @see llvm::Type::isSized()
  */
-LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty);
 
 /**
  * Obtain the context to which this type instance is associated.
  *
  * @see llvm::Type::getContext()
  */
-LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty);
 
 /**
  * Dump a representation of a type to stderr.
  *
  * @see llvm::Type::dump()
  */
-void LLVMDumpType(LLVMTypeRef Val);
+LLVM_FUNC_ABI void LLVMDumpType(LLVMTypeRef Val);
 
 /**
  * Return a string representation of the type. Use
@@ -1151,7 +1151,7 @@ void LLVMDumpType(LLVMTypeRef Val);
  *
  * @see llvm::Type::print()
  */
-char *LLVMPrintTypeToString(LLVMTypeRef Val);
+LLVM_FUNC_ABI char *LLVMPrintTypeToString(LLVMTypeRef Val);
 
 /**
  * @defgroup LLVMCCoreTypeInt Integer Types
@@ -1164,26 +1164,26 @@ char *LLVMPrintTypeToString(LLVMTypeRef Val);
 /**
  * Obtain an integer type from a context with specified bit width.
  */
-LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C);
-LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C);
-LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C);
-LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C);
-LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C);
-LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C);
-LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt1TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt8TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt16TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt32TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt64TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt128TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMIntTypeInContext(LLVMContextRef C, unsigned NumBits);
 
 /**
  * Obtain an integer type from the global context with a specified bit
  * width.
  */
-LLVMTypeRef LLVMInt1Type(void);
-LLVMTypeRef LLVMInt8Type(void);
-LLVMTypeRef LLVMInt16Type(void);
-LLVMTypeRef LLVMInt32Type(void);
-LLVMTypeRef LLVMInt64Type(void);
-LLVMTypeRef LLVMInt128Type(void);
-LLVMTypeRef LLVMIntType(unsigned NumBits);
-unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt1Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt8Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt16Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt32Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt64Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMInt128Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMIntType(unsigned NumBits);
+LLVM_FUNC_ABI unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
 
 /**
  * @}
@@ -1198,51 +1198,51 @@ unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
 /**
  * Obtain a 16-bit floating point type from a context.
  */
-LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMHalfTypeInContext(LLVMContextRef C);
 
 /**
  * Obtain a 16-bit brain floating point type from a context.
  */
-LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMBFloatTypeInContext(LLVMContextRef C);
 
 /**
  * Obtain a 32-bit floating point type from a context.
  */
-LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMFloatTypeInContext(LLVMContextRef C);
 
 /**
  * Obtain a 64-bit floating point type from a context.
  */
-LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMDoubleTypeInContext(LLVMContextRef C);
 
 /**
  * Obtain a 80-bit floating point type (X87) from a context.
  */
-LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMX86FP80TypeInContext(LLVMContextRef C);
 
 /**
  * Obtain a 128-bit floating point type (112-bit mantissa) from a
  * context.
  */
-LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMFP128TypeInContext(LLVMContextRef C);
 
 /**
  * Obtain a 128-bit floating point type (two 64-bits) from a context.
  */
-LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMPPCFP128TypeInContext(LLVMContextRef C);
 
 /**
  * Obtain a floating point type from the global context.
  *
  * These map to the functions in this group of the same name.
  */
-LLVMTypeRef LLVMHalfType(void);
-LLVMTypeRef LLVMBFloatType(void);
-LLVMTypeRef LLVMFloatType(void);
-LLVMTypeRef LLVMDoubleType(void);
-LLVMTypeRef LLVMX86FP80Type(void);
-LLVMTypeRef LLVMFP128Type(void);
-LLVMTypeRef LLVMPPCFP128Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMHalfType(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMBFloatType(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMFloatType(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMDoubleType(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMX86FP80Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMFP128Type(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMPPCFP128Type(void);
 
 /**
  * @}
@@ -1260,24 +1260,24 @@ LLVMTypeRef LLVMPPCFP128Type(void);
  * The function is defined as a tuple of a return Type, a list of
  * parameter types, and whether the function is variadic.
  */
-LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
+LLVM_FUNC_ABI LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
                              LLVMTypeRef *ParamTypes, unsigned ParamCount,
                              LLVMBool IsVarArg);
 
 /**
  * Returns whether a function type is variadic.
  */
-LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
+LLVM_FUNC_ABI LLVMBool LLVMIsFunctionVarArg(LLVMTypeRef FunctionTy);
 
 /**
  * Obtain the Type this function Type returns.
  */
-LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGetReturnType(LLVMTypeRef FunctionTy);
 
 /**
  * Obtain the number of parameters this function accepts.
  */
-unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
+LLVM_FUNC_ABI unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
 
 /**
  * Obtain the types of a function's parameters.
@@ -1290,7 +1290,7 @@ unsigned LLVMCountParamTypes(LLVMTypeRef FunctionTy);
  * @param FunctionTy The function type to operate on.
  * @param Dest Memory address of an array to be filled with result.
  */
-void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
+LLVM_FUNC_ABI void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
 
 /**
  * @}
@@ -1314,7 +1314,7 @@ void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest);
  *
  * @see llvm::StructType::create()
  */
-LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes,
+LLVM_FUNC_ABI LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes,
                                     unsigned ElementCount, LLVMBool Packed);
 
 /**
@@ -1322,7 +1322,7 @@ LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes,
  *
  * @see llvm::StructType::create()
  */
-LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
+LLVM_FUNC_ABI LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
                            LLVMBool Packed);
 
 /**
@@ -1330,21 +1330,21 @@ LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount,
  *
  * @see llvm::StructType::create()
  */
-LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name);
+LLVM_FUNC_ABI LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name);
 
 /**
  * Obtain the name of a structure.
  *
  * @see llvm::StructType::getName()
  */
-const char *LLVMGetStructName(LLVMTypeRef Ty);
+LLVM_FUNC_ABI const char *LLVMGetStructName(LLVMTypeRef Ty);
 
 /**
  * Set the contents of a structure type.
  *
  * @see llvm::StructType::setBody()
  */
-void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
+LLVM_FUNC_ABI void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
                        unsigned ElementCount, LLVMBool Packed);
 
 /**
@@ -1352,7 +1352,7 @@ void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes,
  *
  * @see llvm::StructType::getNumElements()
  */
-unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
+LLVM_FUNC_ABI unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
 
 /**
  * Get the elements within a structure.
@@ -1364,35 +1364,35 @@ unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy);
  * of the structure type itself, which is the lifetime of the context it
  * is contained in.
  */
-void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
+LLVM_FUNC_ABI void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest);
 
 /**
  * Get the type of the element at a given index in the structure.
  *
  * @see llvm::StructType::getTypeAtIndex()
  */
-LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i);
+LLVM_FUNC_ABI LLVMTypeRef LLVMStructGetTypeAtIndex(LLVMTypeRef StructTy, unsigned i);
 
 /**
  * Determine whether a structure is packed.
  *
  * @see llvm::StructType::isPacked()
  */
-LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy);
+LLVM_FUNC_ABI LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy);
 
 /**
  * Determine whether a structure is opaque.
  *
  * @see llvm::StructType::isOpaque()
  */
-LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy);
+LLVM_FUNC_ABI LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy);
 
 /**
  * Determine whether a structure is literal.
  *
  * @see llvm::StructType::isLiteral()
  */
-LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy);
+LLVM_FUNC_ABI LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy);
 
 /**
  * @}
@@ -1412,21 +1412,21 @@ LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy);
  *
  * @see llvm::SequentialType::getElementType()
  */
-LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGetElementType(LLVMTypeRef Ty);
 
 /**
  * Returns type's subtypes
  *
  * @see llvm::Type::subtypes()
  */
-void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr);
+LLVM_FUNC_ABI void LLVMGetSubtypes(LLVMTypeRef Tp, LLVMTypeRef *Arr);
 
 /**
  *  Return the number of types in the derived type.
  *
  * @see llvm::Type::getNumContainedTypes()
  */
-unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp);
+LLVM_FUNC_ABI unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp);
 
 /**
  * Create a fixed size array type that refers to a specific type.
@@ -1438,7 +1438,7 @@ unsigned LLVMGetNumContainedTypes(LLVMTypeRef Tp);
  * LLVMArrayType2
  * @see llvm::ArrayType::get()
  */
-LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
+LLVM_FUNC_ABI LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
 
 /**
  * Create a fixed size array type that refers to a specific type.
@@ -1448,7 +1448,7 @@ LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount);
  *
  * @see llvm::ArrayType::get()
  */
-LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount);
+LLVM_FUNC_ABI LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount);
 
 /**
  * Obtain the length of an array type.
@@ -1459,7 +1459,7 @@ LLVMTypeRef LLVMArrayType2(LLVMTypeRef ElementType, uint64_t ElementCount);
  * LLVMGetArrayLength2
  * @see llvm::ArrayType::getNumElements()
  */
-unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
+LLVM_FUNC_ABI unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
 
 /**
  * Obtain the length of an array type.
@@ -1468,7 +1468,7 @@ unsigned LLVMGetArrayLength(LLVMTypeRef ArrayTy);
  *
  * @see llvm::ArrayType::getNumElements()
  */
-uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy);
+LLVM_FUNC_ABI uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy);
 
 /**
  * Create a pointer type that points to a defined type.
@@ -1478,7 +1478,7 @@ uint64_t LLVMGetArrayLength2(LLVMTypeRef ArrayTy);
  *
  * @see llvm::PointerType::get()
  */
-LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
+LLVM_FUNC_ABI LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
 
 /**
  * Determine whether a pointer is opaque.
@@ -1487,14 +1487,14 @@ LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace);
  *
  * @see llvm::Type::isOpaquePointerTy()
  */
-LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMBool LLVMPointerTypeIsOpaque(LLVMTypeRef Ty);
 
 /**
  * Create an opaque pointer type in a context.
  *
  * @see llvm::PointerType::get()
  */
-LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace);
+LLVM_FUNC_ABI LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace);
 
 /**
  * Obtain the address space of a pointer type.
@@ -1503,7 +1503,7 @@ LLVMTypeRef LLVMPointerTypeInContext(LLVMContextRef C, unsigned AddressSpace);
  *
  * @see llvm::PointerType::getAddressSpace()
  */
-unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
+LLVM_FUNC_ABI unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
 
 /**
  * Create a vector type that contains a defined type and has a specific
@@ -1514,7 +1514,7 @@ unsigned LLVMGetPointerAddressSpace(LLVMTypeRef PointerTy);
  *
  * @see llvm::VectorType::get()
  */
-LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
+LLVM_FUNC_ABI LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
 
 /**
  * Create a vector type that contains a defined type and has a scalable
@@ -1525,7 +1525,7 @@ LLVMTypeRef LLVMVectorType(LLVMTypeRef ElementType, unsigned ElementCount);
  *
  * @see llvm::ScalableVectorType::get()
  */
-LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType,
+LLVM_FUNC_ABI LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType,
                                    unsigned ElementCount);
 
 /**
@@ -1535,7 +1535,7 @@ LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType,
  *
  * @see llvm::VectorType::getNumElements()
  */
-unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
+LLVM_FUNC_ABI unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
 
 /**
  * @}
@@ -1550,46 +1550,46 @@ unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
 /**
  * Create a void type in a context.
  */
-LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C);
 
 /**
  * Create a label type in a context.
  */
-LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C);
 
 /**
  * Create a X86 MMX type in a context.
  */
-LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C);
 
 /**
  * Create a X86 AMX type in a context.
  */
-LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMX86AMXTypeInContext(LLVMContextRef C);
 
 /**
  * Create a token type in a context.
  */
-LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMTokenTypeInContext(LLVMContextRef C);
 
 /**
  * Create a metadata type in a context.
  */
-LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C);
 
 /**
  * These are similar to the above functions except they operate on the
  * global context.
  */
-LLVMTypeRef LLVMVoidType(void);
-LLVMTypeRef LLVMLabelType(void);
-LLVMTypeRef LLVMX86MMXType(void);
-LLVMTypeRef LLVMX86AMXType(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMVoidType(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMLabelType(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMX86MMXType(void);
+LLVM_FUNC_ABI LLVMTypeRef LLVMX86AMXType(void);
 
 /**
  * Create a target extension type in LLVM context.
  */
-LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name,
+LLVM_FUNC_ABI LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name,
                                        LLVMTypeRef *TypeParams,
                                        unsigned TypeParamCount,
                                        unsigned *IntParams,
@@ -1729,35 +1729,35 @@ LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, const char *Name,
  *
  * @see llvm::Value::getType()
  */
-LLVMTypeRef LLVMTypeOf(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMTypeRef LLVMTypeOf(LLVMValueRef Val);
 
 /**
  * Obtain the enumerated type of a Value instance.
  *
  * @see llvm::Value::getValueID()
  */
-LLVMValueKind LLVMGetValueKind(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMValueKind LLVMGetValueKind(LLVMValueRef Val);
 
 /**
  * Obtain the string name of a value.
  *
  * @see llvm::Value::getName()
  */
-const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
+LLVM_FUNC_ABI const char *LLVMGetValueName2(LLVMValueRef Val, size_t *Length);
 
 /**
  * Set the string name of a value.
  *
  * @see llvm::Value::setName()
  */
-void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen);
+LLVM_FUNC_ABI void LLVMSetValueName2(LLVMValueRef Val, const char *Name, size_t NameLen);
 
 /**
  * Dump a representation of a value to stderr.
  *
  * @see llvm::Value::dump()
  */
-void LLVMDumpValue(LLVMValueRef Val);
+LLVM_FUNC_ABI void LLVMDumpValue(LLVMValueRef Val);
 
 /**
  * Return a string representation of the value. Use
@@ -1765,29 +1765,29 @@ void LLVMDumpValue(LLVMValueRef Val);
  *
  * @see llvm::Value::print()
  */
-char *LLVMPrintValueToString(LLVMValueRef Val);
+LLVM_FUNC_ABI char *LLVMPrintValueToString(LLVMValueRef Val);
 
 /**
  * Replace all uses of a value with another one.
  *
  * @see llvm::Value::replaceAllUsesWith()
  */
-void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal);
+LLVM_FUNC_ABI void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal);
 
 /**
  * Determine whether the specified value instance is constant.
  */
-LLVMBool LLVMIsConstant(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMBool LLVMIsConstant(LLVMValueRef Val);
 
 /**
  * Determine whether a value instance is undefined.
  */
-LLVMBool LLVMIsUndef(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMBool LLVMIsUndef(LLVMValueRef Val);
 
 /**
  * Determine whether a value instance is poisonous.
  */
-LLVMBool LLVMIsPoison(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMBool LLVMIsPoison(LLVMValueRef Val);
 
 /**
  * Convert value instances between types.
@@ -1802,16 +1802,16 @@ LLVMBool LLVMIsPoison(LLVMValueRef Val);
  */
 #define LLVM_DECLARE_VALUE_CAST(name) \
   LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
-LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLARE_VALUE_CAST)
+LLVM_FUNC_ABI LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLARE_VALUE_CAST)
 
-LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val);
-LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val);
-LLVMValueRef LLVMIsAMDString(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMValueRef LLVMIsAValueAsMetadata(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMValueRef LLVMIsAMDString(LLVMValueRef Val);
 
 /** Deprecated: Use LLVMGetValueName2 instead. */
-const char *LLVMGetValueName(LLVMValueRef Val);
+LLVM_FUNC_ABI const char *LLVMGetValueName(LLVMValueRef Val);
 /** Deprecated: Use LLVMSetValueName2 instead. */
-void LLVMSetValueName(LLVMValueRef Val, const char *Name);
+LLVM_FUNC_ABI void LLVMSetValueName(LLVMValueRef Val, const char *Name);
 
 /**
  * @}
@@ -1840,7 +1840,7 @@ void LLVMSetValueName(LLVMValueRef Val, const char *Name);
  *
  * @see llvm::Value::use_begin()
  */
-LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val);
 
 /**
  * Obtain the next use of a value.
@@ -1848,7 +1848,7 @@ LLVMUseRef LLVMGetFirstUse(LLVMValueRef Val);
  * This effectively advances the iterator. It returns NULL if you are on
  * the final use and no more are available.
  */
-LLVMUseRef LLVMGetNextUse(LLVMUseRef U);
+LLVM_FUNC_ABI LLVMUseRef LLVMGetNextUse(LLVMUseRef U);
 
 /**
  * Obtain the user value for a user.
@@ -1857,14 +1857,14 @@ LLVMUseRef LLVMGetNextUse(LLVMUseRef U);
  *
  * @see llvm::Use::getUser()
  */
-LLVMValueRef LLVMGetUser(LLVMUseRef U);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetUser(LLVMUseRef U);
 
 /**
  * Obtain the value this use corresponds to.
  *
  * @see llvm::Use::get().
  */
-LLVMValueRef LLVMGetUsedValue(LLVMUseRef U);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetUsedValue(LLVMUseRef U);
 
 /**
  * @}
@@ -1885,28 +1885,28 @@ LLVMValueRef LLVMGetUsedValue(LLVMUseRef U);
  *
  * @see llvm::User::getOperand()
  */
-LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetOperand(LLVMValueRef Val, unsigned Index);
 
 /**
  * Obtain the use of an operand at a specific index in a llvm::User value.
  *
  * @see llvm::User::getOperandUse()
  */
-LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index);
+LLVM_FUNC_ABI LLVMUseRef LLVMGetOperandUse(LLVMValueRef Val, unsigned Index);
 
 /**
  * Set an operand at a specific index in a llvm::User value.
  *
  * @see llvm::User::setOperand()
  */
-void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val);
+LLVM_FUNC_ABI void LLVMSetOperand(LLVMValueRef User, unsigned Index, LLVMValueRef Val);
 
 /**
  * Obtain the number of operands in a llvm::User value.
  *
  * @see llvm::User::getNumOperands()
  */
-int LLVMGetNumOperands(LLVMValueRef Val);
+LLVM_FUNC_ABI int LLVMGetNumOperands(LLVMValueRef Val);
 
 /**
  * @}
@@ -1929,7 +1929,7 @@ int LLVMGetNumOperands(LLVMValueRef Val);
  *
  * @see llvm::Constant::getNullValue()
  */
-LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
 
 /**
  * Obtain a constant value referring to the instance of a type
@@ -1939,34 +1939,34 @@ LLVMValueRef LLVMConstNull(LLVMTypeRef Ty); /* all zeroes */
  *
  * @see llvm::Constant::getAllOnesValue()
  */
-LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstAllOnes(LLVMTypeRef Ty);
 
 /**
  * Obtain a constant value referring to an undefined value of a type.
  *
  * @see llvm::UndefValue::get()
  */
-LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetUndef(LLVMTypeRef Ty);
 
 /**
  * Obtain a constant value referring to a poison value of a type.
  *
  * @see llvm::PoisonValue::get()
  */
-LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetPoison(LLVMTypeRef Ty);
 
 /**
  * Determine whether a value instance is null.
  *
  * @see llvm::Constant::isNullValue()
  */
-LLVMBool LLVMIsNull(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMBool LLVMIsNull(LLVMValueRef Val);
 
 /**
  * Obtain a constant that is a constant pointer pointing to NULL for a
  * specified type.
  */
-LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty);
 
 /**
  * @defgroup LLVMCCoreValueConstantScalar Scalar constants
@@ -1995,7 +1995,7 @@ LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty);
  * @param N The value the returned instance should refer to.
  * @param SignExtend Whether to sign extend the produced value.
  */
-LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
                           LLVMBool SignExtend);
 
 /**
@@ -2003,7 +2003,7 @@ LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,
  *
  * @see llvm::ConstantInt::get()
  */
-LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy,
                                               unsigned NumWords,
                                               const uint64_t Words[]);
 
@@ -2016,7 +2016,7 @@ LLVMValueRef LLVMConstIntOfArbitraryPrecision(LLVMTypeRef IntTy,
  *
  * @see llvm::ConstantInt::get()
  */
-LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text,
                                   uint8_t Radix);
 
 /**
@@ -2025,13 +2025,13 @@ LLVMValueRef LLVMConstIntOfString(LLVMTypeRef IntTy, const char *Text,
  *
  * @see llvm::ConstantInt::get()
  */
-LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char *Text,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstIntOfStringAndSize(LLVMTypeRef IntTy, const char *Text,
                                          unsigned SLen, uint8_t Radix);
 
 /**
  * Obtain a constant value referring to a double floating point value.
  */
-LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
 
 /**
  * Obtain a constant for a floating point value parsed from a string.
@@ -2039,12 +2039,12 @@ LLVMValueRef LLVMConstReal(LLVMTypeRef RealTy, double N);
  * A similar API, LLVMConstRealOfStringAndSize is also available. It
  * should be used if the input string's length is known.
  */
-LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstRealOfString(LLVMTypeRef RealTy, const char *Text);
 
 /**
  * Obtain a constant for a floating point value parsed from a string.
  */
-LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text,
                                           unsigned SLen);
 
 /**
@@ -2052,14 +2052,14 @@ LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealTy, const char *Text,
  *
  * @see llvm::ConstantInt::getZExtValue()
  */
-unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
+LLVM_FUNC_ABI unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
 
 /**
  * Obtain the sign extended value for an integer constant value.
  *
  * @see llvm::ConstantInt::getSExtValue()
  */
-long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
+LLVM_FUNC_ABI long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
 
 /**
  * Obtain the double value for an floating point constant value.
@@ -2067,7 +2067,7 @@ long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
  *
  * @see llvm::ConstantFP::getDoubleValue
  */
-double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
+LLVM_FUNC_ABI double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
 
 /**
  * @}
@@ -2086,7 +2086,7 @@ double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
  *
  * @see llvm::ConstantDataArray::getString()
  */
-LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str,
                                       unsigned Length, LLVMBool DontNullTerminate);
 
 /**
@@ -2098,7 +2098,7 @@ LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str,
  * @see LLVMConstStringInContext()
  * @see llvm::ConstantDataArray::getString()
  */
-LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
                              LLVMBool DontNullTerminate);
 
 /**
@@ -2106,21 +2106,21 @@ LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
  *
  * @see ConstantDataSequential::getAsString()
  */
-LLVMBool LLVMIsConstantString(LLVMValueRef c);
+LLVM_FUNC_ABI LLVMBool LLVMIsConstantString(LLVMValueRef c);
 
 /**
  * Get the given constant data sequential as a string.
  *
  * @see ConstantDataSequential::getAsString()
  */
-const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
+LLVM_FUNC_ABI const char *LLVMGetAsString(LLVMValueRef c, size_t *Length);
 
 /**
  * Create an anonymous ConstantStruct with the specified values.
  *
  * @see llvm::ConstantStruct::getAnon()
  */
-LLVMValueRef LLVMConstStructInContext(LLVMContextRef C,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstStructInContext(LLVMContextRef C,
                                       LLVMValueRef *ConstantVals,
                                       unsigned Count, LLVMBool Packed);
 
@@ -2132,7 +2132,7 @@ LLVMValueRef LLVMConstStructInContext(LLVMContextRef C,
  *
  * @see LLVMConstStructInContext()
  */
-LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
                              LLVMBool Packed);
 
 /**
@@ -2142,7 +2142,7 @@ LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
  * LLVMConstArray2
  * @see llvm::ConstantArray::get()
  */
-LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
                             LLVMValueRef *ConstantVals, unsigned Length);
 
 /**
@@ -2150,7 +2150,7 @@ LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
  *
  * @see llvm::ConstantArray::get()
  */
-LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals,
                              uint64_t Length);
 
 /**
@@ -2158,7 +2158,7 @@ LLVMValueRef LLVMConstArray2(LLVMTypeRef ElementTy, LLVMValueRef *ConstantVals,
  *
  * @see llvm::ConstantStruct::get()
  */
-LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy,
                                   LLVMValueRef *ConstantVals,
                                   unsigned Count);
 
@@ -2170,14 +2170,14 @@ LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy,
  *
  * @see llvm::Constant::getAggregateElement()
  */
-LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx);
 
 /**
  * Get an element at specified index as a constant.
  *
  * @see ConstantDataSequential::getElementAsConstant()
  */
-LLVM_ATTRIBUTE_C_DEPRECATED(
+LLVM_FUNC_ABI LLVM_ATTRIBUTE_C_DEPRECATED(
     LLVMValueRef LLVMGetElementAsConstant(LLVMValueRef C, unsigned idx),
     "Use LLVMGetAggregateElement instead");
 
@@ -2186,7 +2186,7 @@ LLVM_ATTRIBUTE_C_DEPRECATED(
  *
  * @see llvm::ConstantVector::get()
  */
-LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
 
 /**
  * @}
@@ -2201,73 +2201,73 @@ LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size);
  *
  * @{
  */
-LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal);
-LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty);
-LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty);
-LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal);
-LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal);
-LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal);
-LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal);
-LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
+LLVM_FUNC_ABI LLVMOpcode LLVMGetConstOpcode(LLVMValueRef ConstantVal);
+LLVM_FUNC_ABI LLVMValueRef LLVMAlignOf(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNUWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNSWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNUWSub(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstAnd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstOr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstICmp(LLVMIntPredicate Predicate,
                            LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstFCmp(LLVMRealPredicate Predicate,
                            LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstLShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstAShr(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
                            LLVMValueRef *ConstantIndices, unsigned NumIndices);
-LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
                                    LLVMValueRef *ConstantIndices,
                                    unsigned NumIndices);
-LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstSExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstZExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstFPTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstFPExt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstUIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstSIToFP(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstFPToUI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstFPToSI(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstBitCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstAddrSpaceCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstZExtOrBitCast(LLVMValueRef ConstantVal,
                                     LLVMTypeRef ToType);
-LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstSExtOrBitCast(LLVMValueRef ConstantVal,
                                     LLVMTypeRef ToType);
-LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstTruncOrBitCast(LLVMValueRef ConstantVal,
                                      LLVMTypeRef ToType);
-LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstPointerCast(LLVMValueRef ConstantVal,
                                   LLVMTypeRef ToType);
-LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstIntCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType,
                               LLVMBool isSigned);
-LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
-LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstFPCast(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
+LLVM_FUNC_ABI LLVMValueRef LLVMConstExtractElement(LLVMValueRef VectorConstant,
                                      LLVMValueRef IndexConstant);
-LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstInsertElement(LLVMValueRef VectorConstant,
                                     LLVMValueRef ElementValueConstant,
                                     LLVMValueRef IndexConstant);
-LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant,
                                     LLVMValueRef VectorBConstant,
                                     LLVMValueRef MaskConstant);
-LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB);
 
 /** Deprecated: Use LLVMGetInlineAsm instead. */
-LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty,
                                 const char *AsmString, const char *Constraints,
                                 LLVMBool HasSideEffects, LLVMBool IsAlignStack);
 
@@ -2286,18 +2286,18 @@ LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty,
  * @{
  */
 
-LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global);
-LLVMBool LLVMIsDeclaration(LLVMValueRef Global);
-LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
-void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
-const char *LLVMGetSection(LLVMValueRef Global);
-void LLVMSetSection(LLVMValueRef Global, const char *Section);
-LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
-void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
-LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global);
-void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class);
-LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global);
-void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr);
+LLVM_FUNC_ABI LLVMModuleRef LLVMGetGlobalParent(LLVMValueRef Global);
+LLVM_FUNC_ABI LLVMBool LLVMIsDeclaration(LLVMValueRef Global);
+LLVM_FUNC_ABI LLVMLinkage LLVMGetLinkage(LLVMValueRef Global);
+LLVM_FUNC_ABI void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage);
+LLVM_FUNC_ABI const char *LLVMGetSection(LLVMValueRef Global);
+LLVM_FUNC_ABI void LLVMSetSection(LLVMValueRef Global, const char *Section);
+LLVM_FUNC_ABI LLVMVisibility LLVMGetVisibility(LLVMValueRef Global);
+LLVM_FUNC_ABI void LLVMSetVisibility(LLVMValueRef Global, LLVMVisibility Viz);
+LLVM_FUNC_ABI LLVMDLLStorageClass LLVMGetDLLStorageClass(LLVMValueRef Global);
+LLVM_FUNC_ABI void LLVMSetDLLStorageClass(LLVMValueRef Global, LLVMDLLStorageClass Class);
+LLVM_FUNC_ABI LLVMUnnamedAddr LLVMGetUnnamedAddress(LLVMValueRef Global);
+LLVM_FUNC_ABI void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr);
 
 /**
  * Returns the "value type" of a global value.  This differs from the formal
@@ -2305,12 +2305,12 @@ void LLVMSetUnnamedAddress(LLVMValueRef Global, LLVMUnnamedAddr UnnamedAddr);
  *
  * @see llvm::GlobalValue::getValueType()
  */
-LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global);
 
 /** Deprecated: Use LLVMGetUnnamedAddress instead. */
-LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global);
+LLVM_FUNC_ABI LLVMBool LLVMHasUnnamedAddr(LLVMValueRef Global);
 /** Deprecated: Use LLVMSetUnnamedAddress instead. */
-void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
+LLVM_FUNC_ABI void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
 
 /**
  * @defgroup LLVMCCoreValueWithAlignment Values with alignment
@@ -2328,7 +2328,7 @@ void LLVMSetUnnamedAddr(LLVMValueRef Global, LLVMBool HasUnnamedAddr);
  * @see llvm::AtomicCmpXchgInst::setAlignment()
  * @see llvm::GlobalValue::getAlignment()
  */
-unsigned LLVMGetAlignment(LLVMValueRef V);
+LLVM_FUNC_ABI unsigned LLVMGetAlignment(LLVMValueRef V);
 
 /**
  * Set the preferred alignment of the value.
@@ -2339,7 +2339,7 @@ unsigned LLVMGetAlignment(LLVMValueRef V);
  * @see llvm::AtomicCmpXchgInst::setAlignment()
  * @see llvm::GlobalValue::setAlignment()
  */
-void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
+LLVM_FUNC_ABI void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
 
 /**
  * Sets a metadata attachment, erasing the existing metadata attachment if
@@ -2347,7 +2347,7 @@ void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes);
  *
  * @see llvm::GlobalObject::setMetadata()
  */
-void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
+LLVM_FUNC_ABI void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
                            LLVMMetadataRef MD);
 
 /**
@@ -2355,14 +2355,14 @@ void LLVMGlobalSetMetadata(LLVMValueRef Global, unsigned Kind,
  *
  * @see llvm::GlobalObject::eraseMetadata()
  */
-void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
+LLVM_FUNC_ABI void LLVMGlobalEraseMetadata(LLVMValueRef Global, unsigned Kind);
 
 /**
  * Removes all metadata attachments from this value.
  *
  * @see llvm::GlobalObject::clearMetadata()
  */
-void LLVMGlobalClearMetadata(LLVMValueRef Global);
+LLVM_FUNC_ABI void LLVMGlobalClearMetadata(LLVMValueRef Global);
 
 /**
  * Retrieves an array of metadata entries representing the metadata attached to
@@ -2371,25 +2371,25 @@ void LLVMGlobalClearMetadata(LLVMValueRef Global);
  *
  * @see llvm::GlobalObject::getAllMetadata()
  */
-LLVMValueMetadataEntry *LLVMGlobalCopyAllMetadata(LLVMValueRef Value,
+LLVM_FUNC_ABI LLVMValueMetadataEntry *LLVMGlobalCopyAllMetadata(LLVMValueRef Value,
                                                   size_t *NumEntries);
 
 /**
  * Destroys value metadata entries.
  */
-void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries);
+LLVM_FUNC_ABI void LLVMDisposeValueMetadataEntries(LLVMValueMetadataEntry *Entries);
 
 /**
  * Returns the kind of a value metadata entry at a specific index.
  */
-unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries,
+LLVM_FUNC_ABI unsigned LLVMValueMetadataEntriesGetKind(LLVMValueMetadataEntry *Entries,
                                          unsigned Index);
 
 /**
  * Returns the underlying metadata node of a value metadata entry at a
  * specific index.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries,
                                     unsigned Index);
 
@@ -2406,26 +2406,26 @@ LLVMValueMetadataEntriesGetMetadata(LLVMValueMetadataEntry *Entries,
  *
  * @{
  */
-LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name);
-LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMAddGlobal(LLVMModuleRef M, LLVMTypeRef Ty, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMAddGlobalInAddressSpace(LLVMModuleRef M, LLVMTypeRef Ty,
                                          const char *Name,
                                          unsigned AddressSpace);
-LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name);
-LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M);
-LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M);
-LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar);
-LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar);
-void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
-LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
-void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
-LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar);
-void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
-LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar);
-void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant);
-LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar);
-void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode);
-LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar);
-void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNamedGlobal(LLVMModuleRef M, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstGlobal(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetLastGlobal(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNextGlobal(LLVMValueRef GlobalVar);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousGlobal(LLVMValueRef GlobalVar);
+LLVM_FUNC_ABI void LLVMDeleteGlobal(LLVMValueRef GlobalVar);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetInitializer(LLVMValueRef GlobalVar);
+LLVM_FUNC_ABI void LLVMSetInitializer(LLVMValueRef GlobalVar, LLVMValueRef ConstantVal);
+LLVM_FUNC_ABI LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar);
+LLVM_FUNC_ABI void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
+LLVM_FUNC_ABI LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar);
+LLVM_FUNC_ABI void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant);
+LLVM_FUNC_ABI LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar);
+LLVM_FUNC_ABI void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode);
+LLVM_FUNC_ABI LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar);
+LLVM_FUNC_ABI void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit);
 
 /**
  * @}
@@ -2446,7 +2446,7 @@ void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit);
  *
  * @see llvm::GlobalAlias::create()
  */
-LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy,
+LLVM_FUNC_ABI LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy,
                            unsigned AddrSpace, LLVMValueRef Aliasee,
                            const char *Name);
 
@@ -2457,7 +2457,7 @@ LLVMValueRef LLVMAddAlias2(LLVMModuleRef M, LLVMTypeRef ValueTy,
  *
  * @see llvm::Module::getNamedAlias()
  */
-LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M,
                                      const char *Name, size_t NameLen);
 
 /**
@@ -2465,14 +2465,14 @@ LLVMValueRef LLVMGetNamedGlobalAlias(LLVMModuleRef M,
  *
  * @see llvm::Module::alias_begin()
  */
-LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstGlobalAlias(LLVMModuleRef M);
 
 /**
  * Obtain an iterator to the last GlobalAlias in a Module.
  *
  * @see llvm::Module::alias_end()
  */
-LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M);
 
 /**
  * Advance a GlobalAlias iterator to the next GlobalAlias.
@@ -2480,7 +2480,7 @@ LLVMValueRef LLVMGetLastGlobalAlias(LLVMModuleRef M);
  * Returns NULL if the iterator was already at the end and there are no more
  * global aliases.
  */
-LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA);
 
 /**
  * Decrement a GlobalAlias iterator to the previous GlobalAlias.
@@ -2488,17 +2488,17 @@ LLVMValueRef LLVMGetNextGlobalAlias(LLVMValueRef GA);
  * Returns NULL if the iterator was already at the beginning and there are
  * no previous global aliases.
  */
-LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousGlobalAlias(LLVMValueRef GA);
 
 /**
  * Retrieve the target value of an alias.
  */
-LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias);
+LLVM_FUNC_ABI LLVMValueRef LLVMAliasGetAliasee(LLVMValueRef Alias);
 
 /**
  * Set the target value of an alias.
  */
-void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee);
+LLVM_FUNC_ABI void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee);
 
 /**
  * @}
@@ -2520,42 +2520,42 @@ void LLVMAliasSetAliasee(LLVMValueRef Alias, LLVMValueRef Aliasee);
  *
  * @see llvm::Function::eraseFromParent()
  */
-void LLVMDeleteFunction(LLVMValueRef Fn);
+LLVM_FUNC_ABI void LLVMDeleteFunction(LLVMValueRef Fn);
 
 /**
  * Check whether the given function has a personality function.
  *
  * @see llvm::Function::hasPersonalityFn()
  */
-LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMBool LLVMHasPersonalityFn(LLVMValueRef Fn);
 
 /**
  * Obtain the personality function attached to the function.
  *
  * @see llvm::Function::getPersonalityFn()
  */
-LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetPersonalityFn(LLVMValueRef Fn);
 
 /**
  * Set the personality function attached to the function.
  *
  * @see llvm::Function::setPersonalityFn()
  */
-void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
+LLVM_FUNC_ABI void LLVMSetPersonalityFn(LLVMValueRef Fn, LLVMValueRef PersonalityFn);
 
 /**
  * Obtain the intrinsic ID number which matches the given function name.
  *
  * @see llvm::Function::lookupIntrinsicID()
  */
-unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
+LLVM_FUNC_ABI unsigned LLVMLookupIntrinsicID(const char *Name, size_t NameLen);
 
 /**
  * Obtain the ID number from a function instance.
  *
  * @see llvm::Function::getIntrinsicID()
  */
-unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
+LLVM_FUNC_ABI unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
 
 /**
  * Create or insert the declaration of an intrinsic.  For overloaded intrinsics,
@@ -2563,7 +2563,7 @@ unsigned LLVMGetIntrinsicID(LLVMValueRef Fn);
  *
  * @see llvm::Intrinsic::getDeclaration()
  */
-LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod,
+LLVM_FUNC_ABI LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod,
                                          unsigned ID,
                                          LLVMTypeRef *ParamTypes,
                                          size_t ParamCount);
@@ -2574,7 +2574,7 @@ LLVMValueRef LLVMGetIntrinsicDeclaration(LLVMModuleRef Mod,
  *
  * @see llvm::Intrinsic::getType()
  */
-LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID,
+LLVM_FUNC_ABI LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID,
                                  LLVMTypeRef *ParamTypes, size_t ParamCount);
 
 /**
@@ -2582,10 +2582,10 @@ LLVMTypeRef LLVMIntrinsicGetType(LLVMContextRef Ctx, unsigned ID,
  *
  * @see llvm::Intrinsic::getName()
  */
-const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
+LLVM_FUNC_ABI const char *LLVMIntrinsicGetName(unsigned ID, size_t *NameLength);
 
 /** Deprecated: Use LLVMIntrinsicCopyOverloadedName2 instead. */
-const char *LLVMIntrinsicCopyOverloadedName(unsigned ID,
+LLVM_FUNC_ABI const char *LLVMIntrinsicCopyOverloadedName(unsigned ID,
                                             LLVMTypeRef *ParamTypes,
                                             size_t ParamCount,
                                             size_t *NameLength);
@@ -2601,7 +2601,7 @@ const char *LLVMIntrinsicCopyOverloadedName(unsigned ID,
  *
  * @see llvm::Intrinsic::getName()
  */
-const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID,
+LLVM_FUNC_ABI const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID,
                                              LLVMTypeRef *ParamTypes,
                                              size_t ParamCount,
                                              size_t *NameLength);
@@ -2611,7 +2611,7 @@ const char *LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod, unsigned ID,
  *
  * @see llvm::Intrinsic::isOverloaded()
  */
-LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID);
+LLVM_FUNC_ABI LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID);
 
 /**
  * Obtain the calling function of a function.
@@ -2620,7 +2620,7 @@ LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID);
  *
  * @see llvm::Function::getCallingConv()
  */
-unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn);
+LLVM_FUNC_ABI unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn);
 
 /**
  * Set the calling convention of a function.
@@ -2630,7 +2630,7 @@ unsigned LLVMGetFunctionCallConv(LLVMValueRef Fn);
  * @param Fn Function to operate on
  * @param CC LLVMCallConv to set calling convention to
  */
-void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
+LLVM_FUNC_ABI void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
 
 /**
  * Obtain the name of the garbage collector to use during code
@@ -2638,41 +2638,41 @@ void LLVMSetFunctionCallConv(LLVMValueRef Fn, unsigned CC);
  *
  * @see llvm::Function::getGC()
  */
-const char *LLVMGetGC(LLVMValueRef Fn);
+LLVM_FUNC_ABI const char *LLVMGetGC(LLVMValueRef Fn);
 
 /**
  * Define the garbage collector to use during code generation.
  *
  * @see llvm::Function::setGC()
  */
-void LLVMSetGC(LLVMValueRef Fn, const char *Name);
+LLVM_FUNC_ABI void LLVMSetGC(LLVMValueRef Fn, const char *Name);
 
 /**
  * Add an attribute to a function.
  *
  * @see llvm::Function::addAttribute()
  */
-void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI void LLVMAddAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
                              LLVMAttributeRef A);
-unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx);
-void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx);
+LLVM_FUNC_ABI void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
                               LLVMAttributeRef *Attrs);
-LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F,
+LLVM_FUNC_ABI LLVMAttributeRef LLVMGetEnumAttributeAtIndex(LLVMValueRef F,
                                              LLVMAttributeIndex Idx,
                                              unsigned KindID);
-LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F,
+LLVM_FUNC_ABI LLVMAttributeRef LLVMGetStringAttributeAtIndex(LLVMValueRef F,
                                                LLVMAttributeIndex Idx,
                                                const char *K, unsigned KLen);
-void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI void LLVMRemoveEnumAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
                                     unsigned KindID);
-void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI void LLVMRemoveStringAttributeAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
                                       const char *K, unsigned KLen);
 
 /**
  * Add a target-dependent attribute to a function
  * @see llvm::AttrBuilder::addAttribute()
  */
-void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A,
+LLVM_FUNC_ABI void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A,
                                         const char *V);
 
 /**
@@ -2691,7 +2691,7 @@ void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A,
  *
  * @see llvm::Function::arg_size()
  */
-unsigned LLVMCountParams(LLVMValueRef Fn);
+LLVM_FUNC_ABI unsigned LLVMCountParams(LLVMValueRef Fn);
 
 /**
  * Obtain the parameters in a function.
@@ -2704,7 +2704,7 @@ unsigned LLVMCountParams(LLVMValueRef Fn);
  *
  * @see llvm::Function::arg_begin()
  */
-void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
+LLVM_FUNC_ABI void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
 
 /**
  * Obtain the parameter at the specified index.
@@ -2713,7 +2713,7 @@ void LLVMGetParams(LLVMValueRef Fn, LLVMValueRef *Params);
  *
  * @see llvm::Function::arg_begin()
  */
-LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index);
 
 /**
  * Obtain the function to which this argument belongs.
@@ -2724,21 +2724,21 @@ LLVMValueRef LLVMGetParam(LLVMValueRef Fn, unsigned Index);
  * The returned LLVMValueRef is the llvm::Function to which this
  * argument belongs.
  */
-LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetParamParent(LLVMValueRef Inst);
 
 /**
  * Obtain the first parameter to a function.
  *
  * @see llvm::Function::arg_begin()
  */
-LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn);
 
 /**
  * Obtain the last parameter to a function.
  *
  * @see llvm::Function::arg_end()
  */
-LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn);
 
 /**
  * Obtain the next parameter to a function.
@@ -2747,14 +2747,14 @@ LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn);
  * actually a wrapped iterator) and obtains the next parameter from the
  * underlying iterator.
  */
-LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg);
 
 /**
  * Obtain the previous parameter to a function.
  *
  * This is the opposite of LLVMGetNextParam().
  */
-LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg);
 
 /**
  * Set the alignment for a function parameter.
@@ -2762,7 +2762,7 @@ LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg);
  * @see llvm::Argument::addAttr()
  * @see llvm::AttrBuilder::addAlignmentAttr()
  */
-void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
+LLVM_FUNC_ABI void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
 
 /**
  * @}
@@ -2784,7 +2784,7 @@ void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned Align);
  *
  * @see llvm::GlobalIFunc::create()
  */
-LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M,
                                 const char *Name, size_t NameLen,
                                 LLVMTypeRef Ty, unsigned AddrSpace,
                                 LLVMValueRef Resolver);
@@ -2796,7 +2796,7 @@ LLVMValueRef LLVMAddGlobalIFunc(LLVMModuleRef M,
  *
  * @see llvm::Module::getNamedIFunc()
  */
-LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M,
                                      const char *Name, size_t NameLen);
 
 /**
@@ -2804,14 +2804,14 @@ LLVMValueRef LLVMGetNamedGlobalIFunc(LLVMModuleRef M,
  *
  * @see llvm::Module::ifunc_begin()
  */
-LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstGlobalIFunc(LLVMModuleRef M);
 
 /**
  * Obtain an iterator to the last GlobalIFunc in a Module.
  *
  * @see llvm::Module::ifunc_end()
  */
-LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M);
 
 /**
  * Advance a GlobalIFunc iterator to the next GlobalIFunc.
@@ -2819,7 +2819,7 @@ LLVMValueRef LLVMGetLastGlobalIFunc(LLVMModuleRef M);
  * Returns NULL if the iterator was already at the end and there are no more
  * global aliases.
  */
-LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc);
 
 /**
  * Decrement a GlobalIFunc iterator to the previous GlobalIFunc.
@@ -2827,7 +2827,7 @@ LLVMValueRef LLVMGetNextGlobalIFunc(LLVMValueRef IFunc);
  * Returns NULL if the iterator was already at the beginning and there are
  * no previous global aliases.
  */
-LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc);
 
 /**
  * Retrieves the resolver function associated with this indirect function, or
@@ -2835,21 +2835,21 @@ LLVMValueRef LLVMGetPreviousGlobalIFunc(LLVMValueRef IFunc);
  *
  * @see llvm::GlobalIFunc::getResolver()
  */
-LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetGlobalIFuncResolver(LLVMValueRef IFunc);
 
 /**
  * Sets the resolver function associated with this indirect function.
  *
  * @see llvm::GlobalIFunc::setResolver()
  */
-void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver);
+LLVM_FUNC_ABI void LLVMSetGlobalIFuncResolver(LLVMValueRef IFunc, LLVMValueRef Resolver);
 
 /**
  * Remove a global indirect function from its parent module and delete it.
  *
  * @see llvm::GlobalIFunc::eraseFromParent()
  */
-void LLVMEraseGlobalIFunc(LLVMValueRef IFunc);
+LLVM_FUNC_ABI void LLVMEraseGlobalIFunc(LLVMValueRef IFunc);
 
 /**
  * Remove a global indirect function from its parent module.
@@ -2859,7 +2859,7 @@ void LLVMEraseGlobalIFunc(LLVMValueRef IFunc);
  *
  * @see llvm::GlobalIFunc::removeFromParent()
  */
-void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc);
+LLVM_FUNC_ABI void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc);
 
 /**
  * @}
@@ -2891,7 +2891,7 @@ void LLVMRemoveGlobalIFunc(LLVMValueRef IFunc);
  *
  * @see llvm::MDString::get()
  */
-LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str,
                                        size_t SLen);
 
 /**
@@ -2899,18 +2899,18 @@ LLVMMetadataRef LLVMMDStringInContext2(LLVMContextRef C, const char *Str,
  *
  * @see llvm::MDNode::get()
  */
-LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMMDNodeInContext2(LLVMContextRef C, LLVMMetadataRef *MDs,
                                      size_t Count);
 
 /**
  * Obtain a Metadata as a Value.
  */
-LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD);
+LLVM_FUNC_ABI LLVMValueRef LLVMMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD);
 
 /**
  * Obtain a Value as a Metadata.
  */
-LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val);
 
 /**
  * Obtain the underlying string from a MDString value.
@@ -2919,7 +2919,7 @@ LLVMMetadataRef LLVMValueAsMetadata(LLVMValueRef Val);
  * @param Length Memory address which will hold length of returned string.
  * @return String data in MDString.
  */
-const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
+LLVM_FUNC_ABI const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
 
 /**
  * Obtain the number of operands from an MDNode value.
@@ -2927,7 +2927,7 @@ const char *LLVMGetMDString(LLVMValueRef V, unsigned *Length);
  * @param V MDNode to get number of operands from.
  * @return Number of operands of the MDNode.
  */
-unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V);
+LLVM_FUNC_ABI unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V);
 
 /**
  * Obtain the given MDNode's operands.
@@ -2940,26 +2940,26 @@ unsigned LLVMGetMDNodeNumOperands(LLVMValueRef V);
  * @param V MDNode to get the operands from.
  * @param Dest Destination array for operands.
  */
-void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest);
+LLVM_FUNC_ABI void LLVMGetMDNodeOperands(LLVMValueRef V, LLVMValueRef *Dest);
 
 /**
  * Replace an operand at a specific index in a llvm::MDNode value.
  *
  * @see llvm::MDNode::replaceOperandWith()
  */
-void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index,
+LLVM_FUNC_ABI void LLVMReplaceMDNodeOperandWith(LLVMValueRef V, unsigned Index,
                                   LLVMMetadataRef Replacement);
 
 /** Deprecated: Use LLVMMDStringInContext2 instead. */
-LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str,
+LLVM_FUNC_ABI LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str,
                                    unsigned SLen);
 /** Deprecated: Use LLVMMDStringInContext2 instead. */
-LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
+LLVM_FUNC_ABI LLVMValueRef LLVMMDString(const char *Str, unsigned SLen);
 /** Deprecated: Use LLVMMDNodeInContext2 instead. */
-LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals,
+LLVM_FUNC_ABI LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals,
                                  unsigned Count);
 /** Deprecated: Use LLVMMDNodeInContext2 instead. */
-LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
+LLVM_FUNC_ABI LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
 
 /**
  * @}
@@ -2985,29 +2985,29 @@ LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
 /**
  * Convert a basic block instance to a value type.
  */
-LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB);
 
 /**
  * Determine whether an LLVMValueRef is itself a basic block.
  */
-LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMBool LLVMValueIsBasicBlock(LLVMValueRef Val);
 
 /**
  * Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
  */
-LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMValueAsBasicBlock(LLVMValueRef Val);
 
 /**
  * Obtain the string name of a basic block.
  */
-const char *LLVMGetBasicBlockName(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI const char *LLVMGetBasicBlockName(LLVMBasicBlockRef BB);
 
 /**
  * Obtain the function to which a basic block belongs.
  *
  * @see llvm::BasicBlock::getParent()
  */
-LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB);
 
 /**
  * Obtain the terminator instruction for a basic block.
@@ -3019,14 +3019,14 @@ LLVMValueRef LLVMGetBasicBlockParent(LLVMBasicBlockRef BB);
  *
  * @see llvm::BasicBlock::getTerminator()
  */
-LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetBasicBlockTerminator(LLVMBasicBlockRef BB);
 
 /**
  * Obtain the number of basic blocks in a function.
  *
  * @param Fn Function value to operate on.
  */
-unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
+LLVM_FUNC_ABI unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
 
 /**
  * Obtain all of the basic blocks in a function.
@@ -3036,7 +3036,7 @@ unsigned LLVMCountBasicBlocks(LLVMValueRef Fn);
  * LLVMCountBasicBlocks() in length. This array is populated with
  * LLVMBasicBlockRef instances.
  */
-void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
+LLVM_FUNC_ABI void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
 
 /**
  * Obtain the first basic block in a function.
@@ -3046,24 +3046,24 @@ void LLVMGetBasicBlocks(LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks);
  *
  * @see llvm::Function::begin()
  */
-LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetFirstBasicBlock(LLVMValueRef Fn);
 
 /**
  * Obtain the last basic block in a function.
  *
  * @see llvm::Function::end()
  */
-LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetLastBasicBlock(LLVMValueRef Fn);
 
 /**
  * Advance a basic block iterator.
  */
-LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetNextBasicBlock(LLVMBasicBlockRef BB);
 
 /**
  * Go backwards in a basic block iterator.
  */
-LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB);
 
 /**
  * Obtain the basic block that corresponds to the entry point of a
@@ -3071,7 +3071,7 @@ LLVMBasicBlockRef LLVMGetPreviousBasicBlock(LLVMBasicBlockRef BB);
  *
  * @see llvm::Function::getEntryBlock()
  */
-LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn);
 
 /**
  * Insert the given basic block after the insertion point of the given builder.
@@ -3080,7 +3080,7 @@ LLVMBasicBlockRef LLVMGetEntryBasicBlock(LLVMValueRef Fn);
  *
  * @see llvm::Function::BasicBlockListType::insertAfter()
  */
-void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder,
+LLVM_FUNC_ABI void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder,
                                                   LLVMBasicBlockRef BB);
 
 /**
@@ -3088,7 +3088,7 @@ void LLVMInsertExistingBasicBlockAfterInsertBlock(LLVMBuilderRef Builder,
  *
  * @see llvm::Function::BasicBlockListType::push_back()
  */
-void LLVMAppendExistingBasicBlock(LLVMValueRef Fn,
+LLVM_FUNC_ABI void LLVMAppendExistingBasicBlock(LLVMValueRef Fn,
                                   LLVMBasicBlockRef BB);
 
 /**
@@ -3096,7 +3096,7 @@ void LLVMAppendExistingBasicBlock(LLVMValueRef Fn,
  *
  * @see llvm::BasicBlock::Create()
  */
-LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C,
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C,
                                                 const char *Name);
 
 /**
@@ -3104,7 +3104,7 @@ LLVMBasicBlockRef LLVMCreateBasicBlockInContext(LLVMContextRef C,
  *
  * @see llvm::BasicBlock::Create()
  */
-LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C,
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C,
                                                 LLVMValueRef Fn,
                                                 const char *Name);
 
@@ -3114,7 +3114,7 @@ LLVMBasicBlockRef LLVMAppendBasicBlockInContext(LLVMContextRef C,
  *
  * @see llvm::BasicBlock::Create()
  */
-LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name);
 
 /**
  * Insert a basic block in a function before another basic block.
@@ -3124,7 +3124,7 @@ LLVMBasicBlockRef LLVMAppendBasicBlock(LLVMValueRef Fn, const char *Name);
  *
  * @see llvm::BasicBlock::Create()
  */
-LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C,
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C,
                                                 LLVMBasicBlockRef BB,
                                                 const char *Name);
 
@@ -3133,7 +3133,7 @@ LLVMBasicBlockRef LLVMInsertBasicBlockInContext(LLVMContextRef C,
  *
  * @see llvm::BasicBlock::Create()
  */
-LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB,
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB,
                                        const char *Name);
 
 /**
@@ -3144,7 +3144,7 @@ LLVMBasicBlockRef LLVMInsertBasicBlock(LLVMBasicBlockRef InsertBeforeBB,
  *
  * @see llvm::BasicBlock::eraseFromParent()
  */
-void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB);
 
 /**
  * Remove a basic block from a function.
@@ -3154,21 +3154,21 @@ void LLVMDeleteBasicBlock(LLVMBasicBlockRef BB);
  *
  * @see llvm::BasicBlock::removeFromParent()
  */
-void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI void LLVMRemoveBasicBlockFromParent(LLVMBasicBlockRef BB);
 
 /**
  * Move a basic block to before another one.
  *
  * @see llvm::BasicBlock::moveBefore()
  */
-void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos);
+LLVM_FUNC_ABI void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos);
 
 /**
  * Move a basic block to after another one.
  *
  * @see llvm::BasicBlock::moveAfter()
  */
-void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos);
+LLVM_FUNC_ABI void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos);
 
 /**
  * Obtain the first instruction in a basic block.
@@ -3176,14 +3176,14 @@ void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos);
  * The returned LLVMValueRef corresponds to a llvm::Instruction
  * instance.
  */
-LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetFirstInstruction(LLVMBasicBlockRef BB);
 
 /**
  * Obtain the last instruction in a basic block.
  *
  * The returned LLVMValueRef corresponds to an LLVM:Instruction.
  */
-LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB);
 
 /**
  * @}
@@ -3209,17 +3209,17 @@ LLVMValueRef LLVMGetLastInstruction(LLVMBasicBlockRef BB);
 /**
  * Determine whether an instruction has any metadata attached.
  */
-int LLVMHasMetadata(LLVMValueRef Val);
+LLVM_FUNC_ABI int LLVMHasMetadata(LLVMValueRef Val);
 
 /**
  * Return metadata associated with an instruction value.
  */
-LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID);
 
 /**
  * Set metadata associated with an instruction value.
  */
-void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node);
+LLVM_FUNC_ABI void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node);
 
 /**
  * Returns the metadata associated with an instruction value, but filters out
@@ -3227,7 +3227,7 @@ void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node);
  *
  * @see llvm::Instruction::getAllMetadataOtherThanDebugLoc()
  */
-LLVMValueMetadataEntry *
+LLVM_FUNC_ABI LLVMValueMetadataEntry *
 LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Instr,
                                                size_t *NumEntries);
 
@@ -3236,7 +3236,7 @@ LLVMInstructionGetAllMetadataOtherThanDebugLoc(LLVMValueRef Instr,
  *
  * @see llvm::Instruction::getParent()
  */
-LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst);
 
 /**
  * Obtain the instruction that occurs after the one specified.
@@ -3246,7 +3246,7 @@ LLVMBasicBlockRef LLVMGetInstructionParent(LLVMValueRef Inst);
  * If this is the last instruction in a basic block, NULL will be
  * returned.
  */
-LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst);
 
 /**
  * Obtain the instruction that occurred before this one.
@@ -3254,7 +3254,7 @@ LLVMValueRef LLVMGetNextInstruction(LLVMValueRef Inst);
  * If the instruction is the first instruction in a basic block, NULL
  * will be returned.
  */
-LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst);
 
 /**
  * Remove an instruction.
@@ -3264,7 +3264,7 @@ LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst);
  *
  * @see llvm::Instruction::removeFromParent()
  */
-void LLVMInstructionRemoveFromParent(LLVMValueRef Inst);
+LLVM_FUNC_ABI void LLVMInstructionRemoveFromParent(LLVMValueRef Inst);
 
 /**
  * Remove and delete an instruction.
@@ -3274,7 +3274,7 @@ void LLVMInstructionRemoveFromParent(LLVMValueRef Inst);
  *
  * @see llvm::Instruction::eraseFromParent()
  */
-void LLVMInstructionEraseFromParent(LLVMValueRef Inst);
+LLVM_FUNC_ABI void LLVMInstructionEraseFromParent(LLVMValueRef Inst);
 
 /**
  * Delete an instruction.
@@ -3284,14 +3284,14 @@ void LLVMInstructionEraseFromParent(LLVMValueRef Inst);
  *
  * @see llvm::Value::deleteValue()
  */
-void LLVMDeleteInstruction(LLVMValueRef Inst);
+LLVM_FUNC_ABI void LLVMDeleteInstruction(LLVMValueRef Inst);
 
 /**
  * Obtain the code opcode for an individual instruction.
  *
  * @see llvm::Instruction::getOpCode()
  */
-LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst);
 
 /**
  * Obtain the predicate of an instruction.
@@ -3301,7 +3301,7 @@ LLVMOpcode LLVMGetInstructionOpcode(LLVMValueRef Inst);
  *
  * @see llvm::ICmpInst::getPredicate()
  */
-LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst);
 
 /**
  * Obtain the float predicate of an instruction.
@@ -3311,7 +3311,7 @@ LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst);
  *
  * @see llvm::FCmpInst::getPredicate()
  */
-LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst);
 
 /**
  * Create a copy of 'this' instruction that is identical in all ways
@@ -3321,7 +3321,7 @@ LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst);
  *
  * @see llvm::Instruction::clone()
  */
-LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst);
 
 /**
  * Determine whether an instruction is a terminator. This routine is named to
@@ -3330,7 +3330,7 @@ LLVMValueRef LLVMInstructionClone(LLVMValueRef Inst);
  *
  * @see llvm::Instruction::isTerminator()
  */
-LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst);
 
 /**
  * @defgroup LLVMCCoreValueInstructionCall Call Sites and Invocations
@@ -3352,7 +3352,7 @@ LLVMValueRef LLVMIsATerminatorInst(LLVMValueRef Inst);
  * @see llvm::InvokeInst::getNumArgOperands()
  * @see llvm::FuncletPadInst::getNumArgOperands()
  */
-unsigned LLVMGetNumArgOperands(LLVMValueRef Instr);
+LLVM_FUNC_ABI unsigned LLVMGetNumArgOperands(LLVMValueRef Instr);
 
 /**
  * Set the calling convention for a call instruction.
@@ -3363,7 +3363,7 @@ unsigned LLVMGetNumArgOperands(LLVMValueRef Instr);
  * @see llvm::CallInst::setCallingConv()
  * @see llvm::InvokeInst::setCallingConv()
  */
-void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
+LLVM_FUNC_ABI void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
 
 /**
  * Obtain the calling convention for a call instruction.
@@ -3373,25 +3373,25 @@ void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
  *
  * @see LLVMSetInstructionCallConv()
  */
-unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
+LLVM_FUNC_ABI unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
 
-void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx,
                                 unsigned Align);
 
-void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
                               LLVMAttributeRef A);
-unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx);
-void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI unsigned LLVMGetCallSiteAttributeCount(LLVMValueRef C, LLVMAttributeIndex Idx);
+LLVM_FUNC_ABI void LLVMGetCallSiteAttributes(LLVMValueRef C, LLVMAttributeIndex Idx,
                                LLVMAttributeRef *Attrs);
-LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C,
+LLVM_FUNC_ABI LLVMAttributeRef LLVMGetCallSiteEnumAttribute(LLVMValueRef C,
                                               LLVMAttributeIndex Idx,
                                               unsigned KindID);
-LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C,
+LLVM_FUNC_ABI LLVMAttributeRef LLVMGetCallSiteStringAttribute(LLVMValueRef C,
                                                 LLVMAttributeIndex Idx,
                                                 const char *K, unsigned KLen);
-void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI void LLVMRemoveCallSiteEnumAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
                                      unsigned KindID);
-void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
+LLVM_FUNC_ABI void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
                                        const char *K, unsigned KLen);
 
 /**
@@ -3399,7 +3399,7 @@ void LLVMRemoveCallSiteStringAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,
  *
  * @see llvm::CallBase::getFunctionType()
  */
-LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C);
 
 /**
  * Obtain the pointer to the function invoked by this instruction.
@@ -3410,7 +3410,7 @@ LLVMTypeRef LLVMGetCalledFunctionType(LLVMValueRef C);
  * @see llvm::CallInst::getCalledOperand()
  * @see llvm::InvokeInst::getCalledOperand()
  */
-LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr);
 
 /**
  * Obtain whether a call instruction is a tail call.
@@ -3419,7 +3419,7 @@ LLVMValueRef LLVMGetCalledValue(LLVMValueRef Instr);
  *
  * @see llvm::CallInst::isTailCall()
  */
-LLVMBool LLVMIsTailCall(LLVMValueRef CallInst);
+LLVM_FUNC_ABI LLVMBool LLVMIsTailCall(LLVMValueRef CallInst);
 
 /**
  * Set whether a call instruction is a tail call.
@@ -3428,7 +3428,7 @@ LLVMBool LLVMIsTailCall(LLVMValueRef CallInst);
  *
  * @see llvm::CallInst::setTailCall()
  */
-void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
+LLVM_FUNC_ABI void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
 
 /**
  * Return the normal destination basic block.
@@ -3437,7 +3437,7 @@ void LLVMSetTailCall(LLVMValueRef CallInst, LLVMBool IsTailCall);
  *
  * @see llvm::InvokeInst::getNormalDest()
  */
-LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst);
 
 /**
  * Return the unwind destination basic block.
@@ -3449,7 +3449,7 @@ LLVMBasicBlockRef LLVMGetNormalDest(LLVMValueRef InvokeInst);
  * @see llvm::CleanupReturnInst::getUnwindDest()
  * @see llvm::CatchSwitchInst::getUnwindDest()
  */
-LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst);
 
 /**
  * Set the normal destination basic block.
@@ -3458,7 +3458,7 @@ LLVMBasicBlockRef LLVMGetUnwindDest(LLVMValueRef InvokeInst);
  *
  * @see llvm::InvokeInst::setNormalDest()
  */
-void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B);
+LLVM_FUNC_ABI void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B);
 
 /**
  * Set the unwind destination basic block.
@@ -3470,7 +3470,7 @@ void LLVMSetNormalDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B);
  * @see llvm::CleanupReturnInst::setUnwindDest()
  * @see llvm::CatchSwitchInst::setUnwindDest()
  */
-void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B);
+LLVM_FUNC_ABI void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B);
 
 /**
  * @}
@@ -3490,21 +3490,21 @@ void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B);
  *
  * @see llvm::Instruction::getNumSuccessors
  */
-unsigned LLVMGetNumSuccessors(LLVMValueRef Term);
+LLVM_FUNC_ABI unsigned LLVMGetNumSuccessors(LLVMValueRef Term);
 
 /**
  * Return the specified successor.
  *
  * @see llvm::Instruction::getSuccessor
  */
-LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetSuccessor(LLVMValueRef Term, unsigned i);
 
 /**
  * Update the specified successor to point at the provided block.
  *
  * @see llvm::Instruction::setSuccessor
  */
-void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block);
+LLVM_FUNC_ABI void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block);
 
 /**
  * Return if a branch is conditional.
@@ -3513,7 +3513,7 @@ void LLVMSetSuccessor(LLVMValueRef Term, unsigned i, LLVMBasicBlockRef block);
  *
  * @see llvm::BranchInst::isConditional
  */
-LLVMBool LLVMIsConditional(LLVMValueRef Branch);
+LLVM_FUNC_ABI LLVMBool LLVMIsConditional(LLVMValueRef Branch);
 
 /**
  * Return the condition of a branch instruction.
@@ -3522,7 +3522,7 @@ LLVMBool LLVMIsConditional(LLVMValueRef Branch);
  *
  * @see llvm::BranchInst::getCondition
  */
-LLVMValueRef LLVMGetCondition(LLVMValueRef Branch);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetCondition(LLVMValueRef Branch);
 
 /**
  * Set the condition of a branch instruction.
@@ -3531,7 +3531,7 @@ LLVMValueRef LLVMGetCondition(LLVMValueRef Branch);
  *
  * @see llvm::BranchInst::setCondition
  */
-void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond);
+LLVM_FUNC_ABI void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond);
 
 /**
  * Obtain the default destination basic block of a switch instruction.
@@ -3540,7 +3540,7 @@ void LLVMSetCondition(LLVMValueRef Branch, LLVMValueRef Cond);
  *
  * @see llvm::SwitchInst::getDefaultDest()
  */
-LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr);
 
 /**
  * @}
@@ -3558,7 +3558,7 @@ LLVMBasicBlockRef LLVMGetSwitchDefaultDest(LLVMValueRef SwitchInstr);
 /**
  * Obtain the type that is being allocated by the alloca instruction.
  */
-LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca);
 
 /**
  * @}
@@ -3576,17 +3576,17 @@ LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca);
 /**
  * Check whether the given GEP operator is inbounds.
  */
-LLVMBool LLVMIsInBounds(LLVMValueRef GEP);
+LLVM_FUNC_ABI LLVMBool LLVMIsInBounds(LLVMValueRef GEP);
 
 /**
  * Set the given GEP instruction to be inbounds or not.
  */
-void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds);
+LLVM_FUNC_ABI void LLVMSetIsInBounds(LLVMValueRef GEP, LLVMBool InBounds);
 
 /**
  * Get the source element type of the given GEP operator.
  */
-LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP);
+LLVM_FUNC_ABI LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP);
 
 /**
  * @}
@@ -3604,23 +3604,23 @@ LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP);
 /**
  * Add an incoming value to the end of a PHI list.
  */
-void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
+LLVM_FUNC_ABI void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
                      LLVMBasicBlockRef *IncomingBlocks, unsigned Count);
 
 /**
  * Obtain the number of incoming basic blocks to a PHI node.
  */
-unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
+LLVM_FUNC_ABI unsigned LLVMCountIncoming(LLVMValueRef PhiNode);
 
 /**
  * Obtain an incoming value to a PHI node as an LLVMValueRef.
  */
-LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetIncomingValue(LLVMValueRef PhiNode, unsigned Index);
 
 /**
  * Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
  */
-LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index);
 
 /**
  * @}
@@ -3640,12 +3640,12 @@ LLVMBasicBlockRef LLVMGetIncomingBlock(LLVMValueRef PhiNode, unsigned Index);
  * Obtain the number of indices.
  * NB: This also works on GEP operators.
  */
-unsigned LLVMGetNumIndices(LLVMValueRef Inst);
+LLVM_FUNC_ABI unsigned LLVMGetNumIndices(LLVMValueRef Inst);
 
 /**
  * Obtain the indices as an array.
  */
-const unsigned *LLVMGetIndices(LLVMValueRef Inst);
+LLVM_FUNC_ABI const unsigned *LLVMGetIndices(LLVMValueRef Inst);
 
 /**
  * @}
@@ -3668,18 +3668,18 @@ const unsigned *LLVMGetIndices(LLVMValueRef Inst);
  * @{
  */
 
-LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C);
-LLVMBuilderRef LLVMCreateBuilder(void);
-void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
+LLVM_FUNC_ABI LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C);
+LLVM_FUNC_ABI LLVMBuilderRef LLVMCreateBuilder(void);
+LLVM_FUNC_ABI void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
                          LLVMValueRef Instr);
-void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr);
-void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block);
-LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder);
-void LLVMClearInsertionPosition(LLVMBuilderRef Builder);
-void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr);
-void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr,
+LLVM_FUNC_ABI void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr);
+LLVM_FUNC_ABI void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block);
+LLVM_FUNC_ABI LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder);
+LLVM_FUNC_ABI void LLVMClearInsertionPosition(LLVMBuilderRef Builder);
+LLVM_FUNC_ABI void LLVMInsertIntoBuilder(LLVMBuilderRef Builder, LLVMValueRef Instr);
+LLVM_FUNC_ABI void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr,
                                    const char *Name);
-void LLVMDisposeBuilder(LLVMBuilderRef Builder);
+LLVM_FUNC_ABI void LLVMDisposeBuilder(LLVMBuilderRef Builder);
 
 /* Metadata */
 
@@ -3688,7 +3688,7 @@ void LLVMDisposeBuilder(LLVMBuilderRef Builder);
  *
  * @see llvm::IRBuilder::getCurrentDebugLocation()
  */
-LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder);
 
 /**
  * Set location information used by debugging information.
@@ -3697,7 +3697,7 @@ LLVMMetadataRef LLVMGetCurrentDebugLocation2(LLVMBuilderRef Builder);
  *
  * @see llvm::IRBuilder::SetCurrentDebugLocation()
  */
-void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc);
+LLVM_FUNC_ABI void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc);
 
 /**
  * Attempts to set the debug location for the given instruction using the
@@ -3709,21 +3709,21 @@ void LLVMSetCurrentDebugLocation2(LLVMBuilderRef Builder, LLVMMetadataRef Loc);
  *
  * @see llvm::IRBuilder::SetInstDebugLocation()
  */
-void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst);
+LLVM_FUNC_ABI void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst);
 
 /**
  * Adds the metadata registered with the given builder to the given instruction.
  *
  * @see llvm::IRBuilder::AddMetadataToInst()
  */
-void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst);
+LLVM_FUNC_ABI void LLVMAddMetadataToInst(LLVMBuilderRef Builder, LLVMValueRef Inst);
 
 /**
  * Get the dafult floating-point math metadata for a given builder.
  *
  * @see llvm::IRBuilder::getDefaultFPMathTag()
  */
-LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder);
 
 /**
  * Set the default floating-point math metadata for the given builder.
@@ -3732,84 +3732,84 @@ LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder);
  *
  * @see llvm::IRBuilder::setDefaultFPMathTag()
  */
-void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder,
+LLVM_FUNC_ABI void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder,
                                     LLVMMetadataRef FPMathTag);
 
 /**
  * Deprecated: Passing the NULL location will crash.
  * Use LLVMGetCurrentDebugLocation2 instead.
  */
-void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L);
+LLVM_FUNC_ABI void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L);
 /**
  * Deprecated: Returning the NULL location will crash.
  * Use LLVMGetCurrentDebugLocation2 instead.
  */
-LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder);
 
 /* Terminators */
-LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef);
-LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V);
-LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildAggregateRet(LLVMBuilderRef, LLVMValueRef *RetVals,
                                    unsigned N);
-LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest);
-LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildBr(LLVMBuilderRef, LLVMBasicBlockRef Dest);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildCondBr(LLVMBuilderRef, LLVMValueRef If,
                              LLVMBasicBlockRef Then, LLVMBasicBlockRef Else);
-LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef, LLVMValueRef V,
                              LLVMBasicBlockRef Else, unsigned NumCases);
-LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr,
                                  unsigned NumDests);
-LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn,
                               LLVMValueRef *Args, unsigned NumArgs,
                               LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
                               const char *Name);
-LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
 
 /* Exception Handling */
-LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn);
-LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty,
                                  LLVMValueRef PersFn, unsigned NumClauses,
                                  const char *Name);
-LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildCleanupRet(LLVMBuilderRef B, LLVMValueRef CatchPad,
                                  LLVMBasicBlockRef BB);
-LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildCatchRet(LLVMBuilderRef B, LLVMValueRef CatchPad,
                                LLVMBasicBlockRef BB);
-LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildCatchPad(LLVMBuilderRef B, LLVMValueRef ParentPad,
                                LLVMValueRef *Args, unsigned NumArgs,
                                const char *Name);
-LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildCleanupPad(LLVMBuilderRef B, LLVMValueRef ParentPad,
                                  LLVMValueRef *Args, unsigned NumArgs,
                                  const char *Name);
-LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildCatchSwitch(LLVMBuilderRef B, LLVMValueRef ParentPad,
                                   LLVMBasicBlockRef UnwindBB,
                                   unsigned NumHandlers, const char *Name);
 
 /* Add a case to the switch instruction */
-void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
+LLVM_FUNC_ABI void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
                  LLVMBasicBlockRef Dest);
 
 /* Add a destination to the indirectbr instruction */
-void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest);
+LLVM_FUNC_ABI void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest);
 
 /* Get the number of clauses on the landingpad instruction */
-unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
+LLVM_FUNC_ABI unsigned LLVMGetNumClauses(LLVMValueRef LandingPad);
 
 /* Get the value of the clause at index Idx on the landingpad instruction */
-LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetClause(LLVMValueRef LandingPad, unsigned Idx);
 
 /* Add a catch or filter clause to the landingpad instruction */
-void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
+LLVM_FUNC_ABI void LLVMAddClause(LLVMValueRef LandingPad, LLVMValueRef ClauseVal);
 
 /* Get the 'cleanup' flag in the landingpad instruction */
-LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad);
+LLVM_FUNC_ABI LLVMBool LLVMIsCleanup(LLVMValueRef LandingPad);
 
 /* Set the 'cleanup' flag in the landingpad instruction */
-void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
+LLVM_FUNC_ABI void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
 
 /* Add a destination to the catchswitch instruction */
-void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest);
+LLVM_FUNC_ABI void LLVMAddHandler(LLVMValueRef CatchSwitch, LLVMBasicBlockRef Dest);
 
 /* Get the number of handlers on the catchswitch instruction */
-unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
+LLVM_FUNC_ABI unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
 
 /**
  * Obtain the basic blocks acting as handlers for a catchswitch instruction.
@@ -3822,15 +3822,15 @@ unsigned LLVMGetNumHandlers(LLVMValueRef CatchSwitch);
  * @param CatchSwitch The catchswitch instruction to operate on.
  * @param Handlers Memory address of an array to be filled with basic blocks.
  */
-void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers);
+LLVM_FUNC_ABI void LLVMGetHandlers(LLVMValueRef CatchSwitch, LLVMBasicBlockRef *Handlers);
 
 /* Funclets */
 
 /* Get the number of funcletpad arguments. */
-LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetArgOperand(LLVMValueRef Funclet, unsigned i);
 
 /* Set a funcletpad argument at the given index. */
-void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value);
+LLVM_FUNC_ABI void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value);
 
 /**
  * Get the parent catchswitch instruction of a catchpad instruction.
@@ -3839,7 +3839,7 @@ void LLVMSetArgOperand(LLVMValueRef Funclet, unsigned i, LLVMValueRef value);
  *
  * @see llvm::CatchPadInst::getCatchSwitch()
  */
-LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad);
+LLVM_FUNC_ABI LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad);
 
 /**
  * Set the parent catchswitch instruction of a catchpad instruction.
@@ -3848,82 +3848,82 @@ LLVMValueRef LLVMGetParentCatchSwitch(LLVMValueRef CatchPad);
  *
  * @see llvm::CatchPadInst::setCatchSwitch()
  */
-void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch);
+LLVM_FUNC_ABI void LLVMSetParentCatchSwitch(LLVMValueRef CatchPad, LLVMValueRef CatchSwitch);
 
 /* Arithmetic */
-LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                           const char *Name);
-LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNSWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                              const char *Name);
-LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNUWAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                              const char *Name);
-LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                           const char *Name);
-LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNSWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                              const char *Name);
-LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNUWSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                              const char *Name);
-LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFSub(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                           const char *Name);
-LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNSWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                              const char *Name);
-LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNUWMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                              const char *Name);
-LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFMul(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildExactUDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                                 const char *Name);
-LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildExactSDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                                 const char *Name);
-LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFDiv(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildURem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildSRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFRem(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildShl(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildLShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildAShr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildAnd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                           const char *Name);
-LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildOr(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                           const char *Name);
-LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildXor(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
                           const char *Name);
-LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildBinOp(LLVMBuilderRef B, LLVMOpcode Op,
                             LLVMValueRef LHS, LLVMValueRef RHS,
                             const char *Name);
-LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name);
-LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V,
                              const char *Name);
-LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V,
                              const char *Name);
-LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name);
-LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef, LLVMValueRef V, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildNot(LLVMBuilderRef, LLVMValueRef V, const char *Name);
 
-LLVMBool LLVMGetNUW(LLVMValueRef ArithInst);
-void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
-LLVMBool LLVMGetNSW(LLVMValueRef ArithInst);
-void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
-LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst);
-void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
+LLVM_FUNC_ABI LLVMBool LLVMGetNUW(LLVMValueRef ArithInst);
+LLVM_FUNC_ABI void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
+LLVM_FUNC_ABI LLVMBool LLVMGetNSW(LLVMValueRef ArithInst);
+LLVM_FUNC_ABI void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
+LLVM_FUNC_ABI LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst);
+LLVM_FUNC_ABI void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
 
 /* Memory */
-LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
-LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty,
                                   LLVMValueRef Val, const char *Name);
 
 /**
@@ -3932,7 +3932,7 @@ LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef, LLVMTypeRef Ty,
  *
  * @see llvm::IRRBuilder::CreateMemSet()
  */
-LLVMValueRef LLVMBuildMemSet(LLVMBuilderRef B, LLVMValueRef Ptr,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildMemSet(LLVMBuilderRef B, LLVMValueRef Ptr,
                              LLVMValueRef Val, LLVMValueRef Len,
                              unsigned Align);
 /**
@@ -3940,7 +3940,7 @@ LLVMValueRef LLVMBuildMemSet(LLVMBuilderRef B, LLVMValueRef Ptr,
  *
  * @see llvm::IRRBuilder::CreateMemCpy()
  */
-LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B,
                              LLVMValueRef Dst, unsigned DstAlign,
                              LLVMValueRef Src, unsigned SrcAlign,
                              LLVMValueRef Size);
@@ -3949,138 +3949,138 @@ LLVMValueRef LLVMBuildMemCpy(LLVMBuilderRef B,
  *
  * @see llvm::IRRBuilder::CreateMemMove()
  */
-LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildMemMove(LLVMBuilderRef B,
                               LLVMValueRef Dst, unsigned DstAlign,
                               LLVMValueRef Src, unsigned SrcAlign,
                               LLVMValueRef Size);
 
-LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
-LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildArrayAlloca(LLVMBuilderRef, LLVMTypeRef Ty,
                                   LLVMValueRef Val, const char *Name);
-LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal);
-LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFree(LLVMBuilderRef, LLVMValueRef PointerVal);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty,
                             LLVMValueRef PointerVal, const char *Name);
-LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr);
-LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildStore(LLVMBuilderRef, LLVMValueRef Val, LLVMValueRef Ptr);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
                            LLVMValueRef Pointer, LLVMValueRef *Indices,
                            unsigned NumIndices, const char *Name);
-LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
                                    LLVMValueRef Pointer, LLVMValueRef *Indices,
                                    unsigned NumIndices, const char *Name);
-LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
                                  LLVMValueRef Pointer, unsigned Idx,
                                  const char *Name);
-LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildGlobalString(LLVMBuilderRef B, const char *Str,
                                    const char *Name);
-LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildGlobalStringPtr(LLVMBuilderRef B, const char *Str,
                                       const char *Name);
-LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst);
-void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile);
-LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst);
-void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
-LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst);
-void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering);
-LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst);
-void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp);
+LLVM_FUNC_ABI LLVMBool LLVMGetVolatile(LLVMValueRef MemoryAccessInst);
+LLVM_FUNC_ABI void LLVMSetVolatile(LLVMValueRef MemoryAccessInst, LLVMBool IsVolatile);
+LLVM_FUNC_ABI LLVMBool LLVMGetWeak(LLVMValueRef CmpXchgInst);
+LLVM_FUNC_ABI void LLVMSetWeak(LLVMValueRef CmpXchgInst, LLVMBool IsWeak);
+LLVM_FUNC_ABI LLVMAtomicOrdering LLVMGetOrdering(LLVMValueRef MemoryAccessInst);
+LLVM_FUNC_ABI void LLVMSetOrdering(LLVMValueRef MemoryAccessInst, LLVMAtomicOrdering Ordering);
+LLVM_FUNC_ABI LLVMAtomicRMWBinOp LLVMGetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst);
+LLVM_FUNC_ABI void LLVMSetAtomicRMWBinOp(LLVMValueRef AtomicRMWInst, LLVMAtomicRMWBinOp BinOp);
 
 /* Casts */
-LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildTrunc(LLVMBuilderRef, LLVMValueRef Val,
                             LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildZExt(LLVMBuilderRef, LLVMValueRef Val,
                            LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildSExt(LLVMBuilderRef, LLVMValueRef Val,
                            LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPToUI(LLVMBuilderRef, LLVMValueRef Val,
                              LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPToSI(LLVMBuilderRef, LLVMValueRef Val,
                              LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildUIToFP(LLVMBuilderRef, LLVMValueRef Val,
                              LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildSIToFP(LLVMBuilderRef, LLVMValueRef Val,
                              LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPTrunc(LLVMBuilderRef, LLVMValueRef Val,
                               LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPExt(LLVMBuilderRef, LLVMValueRef Val,
                             LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildPtrToInt(LLVMBuilderRef, LLVMValueRef Val,
                                LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildIntToPtr(LLVMBuilderRef, LLVMValueRef Val,
                                LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildBitCast(LLVMBuilderRef, LLVMValueRef Val,
                               LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildAddrSpaceCast(LLVMBuilderRef, LLVMValueRef Val,
                                     LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildZExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val,
                                     LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildSExtOrBitCast(LLVMBuilderRef, LLVMValueRef Val,
                                     LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildTruncOrBitCast(LLVMBuilderRef, LLVMValueRef Val,
                                      LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildCast(LLVMBuilderRef B, LLVMOpcode Op, LLVMValueRef Val,
                            LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildPointerCast(LLVMBuilderRef, LLVMValueRef Val,
                                   LLVMTypeRef DestTy, const char *Name);
-LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildIntCast2(LLVMBuilderRef, LLVMValueRef Val,
                                LLVMTypeRef DestTy, LLVMBool IsSigned,
                                const char *Name);
-LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFPCast(LLVMBuilderRef, LLVMValueRef Val,
                              LLVMTypeRef DestTy, const char *Name);
 
 /** Deprecated: This cast is always signed. Use LLVMBuildIntCast2 instead. */
-LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, /*Signed cast!*/
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildIntCast(LLVMBuilderRef, LLVMValueRef Val, /*Signed cast!*/
                               LLVMTypeRef DestTy, const char *Name);
 
-LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned,
+LLVM_FUNC_ABI LLVMOpcode LLVMGetCastOpcode(LLVMValueRef Src, LLVMBool SrcIsSigned,
                              LLVMTypeRef DestTy, LLVMBool DestIsSigned);
 
 /* Comparisons */
-LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildICmp(LLVMBuilderRef, LLVMIntPredicate Op,
                            LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
-LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFCmp(LLVMBuilderRef, LLVMRealPredicate Op,
                            LLVMValueRef LHS, LLVMValueRef RHS,
                            const char *Name);
 
 /* Miscellaneous instructions */
-LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
-LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildPhi(LLVMBuilderRef, LLVMTypeRef Ty, const char *Name);
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn,
                             LLVMValueRef *Args, unsigned NumArgs,
                             const char *Name);
-LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildSelect(LLVMBuilderRef, LLVMValueRef If,
                              LLVMValueRef Then, LLVMValueRef Else,
                              const char *Name);
-LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildVAArg(LLVMBuilderRef, LLVMValueRef List, LLVMTypeRef Ty,
                             const char *Name);
-LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildExtractElement(LLVMBuilderRef, LLVMValueRef VecVal,
                                      LLVMValueRef Index, const char *Name);
-LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildInsertElement(LLVMBuilderRef, LLVMValueRef VecVal,
                                     LLVMValueRef EltVal, LLVMValueRef Index,
                                     const char *Name);
-LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildShuffleVector(LLVMBuilderRef, LLVMValueRef V1,
                                     LLVMValueRef V2, LLVMValueRef Mask,
                                     const char *Name);
-LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildExtractValue(LLVMBuilderRef, LLVMValueRef AggVal,
                                    unsigned Index, const char *Name);
-LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildInsertValue(LLVMBuilderRef, LLVMValueRef AggVal,
                                   LLVMValueRef EltVal, unsigned Index,
                                   const char *Name);
-LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFreeze(LLVMBuilderRef, LLVMValueRef Val,
                              const char *Name);
 
-LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildIsNull(LLVMBuilderRef, LLVMValueRef Val,
                              const char *Name);
-LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val,
                                 const char *Name);
-LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy,
                                LLVMValueRef LHS, LLVMValueRef RHS,
                                const char *Name);
-LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildFence(LLVMBuilderRef B, LLVMAtomicOrdering ordering,
                             LLVMBool singleThread, const char *Name);
-LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B, LLVMAtomicRMWBinOp op,
                                 LLVMValueRef PTR, LLVMValueRef Val,
                                 LLVMAtomicOrdering ordering,
                                 LLVMBool singleThread);
-LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr,
+LLVM_FUNC_ABI LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr,
                                     LLVMValueRef Cmp, LLVMValueRef New,
                                     LLVMAtomicOrdering SuccessOrdering,
                                     LLVMAtomicOrdering FailureOrdering,
@@ -4089,13 +4089,13 @@ LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Ptr,
 /**
  * Get the number of elements in the mask of a ShuffleVector instruction.
  */
-unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
+LLVM_FUNC_ABI unsigned LLVMGetNumMaskElements(LLVMValueRef ShuffleVectorInst);
 
 /**
  * \returns a constant that specifies that the result of a \c ShuffleVectorInst
  * is undefined.
  */
-int LLVMGetUndefMaskElem(void);
+LLVM_FUNC_ABI int LLVMGetUndefMaskElem(void);
 
 /**
  * Get the mask value at position Elt in the mask of a ShuffleVector
@@ -4104,16 +4104,16 @@ int LLVMGetUndefMaskElem(void);
  * \Returns the result of \c LLVMGetUndefMaskElem() if the mask value is
  * poison at that position.
  */
-int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
+LLVM_FUNC_ABI int LLVMGetMaskValue(LLVMValueRef ShuffleVectorInst, unsigned Elt);
 
-LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst);
-void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread);
+LLVM_FUNC_ABI LLVMBool LLVMIsAtomicSingleThread(LLVMValueRef AtomicInst);
+LLVM_FUNC_ABI void LLVMSetAtomicSingleThread(LLVMValueRef AtomicInst, LLVMBool SingleThread);
 
-LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst);
-void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst,
+LLVM_FUNC_ABI LLVMAtomicOrdering LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst);
+LLVM_FUNC_ABI void LLVMSetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst,
                                    LLVMAtomicOrdering Ordering);
-LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst);
-void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst,
+LLVM_FUNC_ABI LLVMAtomicOrdering LLVMGetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst);
+LLVM_FUNC_ABI void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst,
                                    LLVMAtomicOrdering Ordering);
 
 /**
@@ -4130,13 +4130,13 @@ void LLVMSetCmpXchgFailureOrdering(LLVMValueRef CmpXchgInst,
  * Changes the type of M so it can be passed to FunctionPassManagers and the
  * JIT.  They take ModuleProviders for historical reasons.
  */
-LLVMModuleProviderRef
+LLVM_FUNC_ABI LLVMModuleProviderRef
 LLVMCreateModuleProviderForExistingModule(LLVMModuleRef M);
 
 /**
  * Destroys the module M.
  */
-void LLVMDisposeModuleProvider(LLVMModuleProviderRef M);
+LLVM_FUNC_ABI void LLVMDisposeModuleProvider(LLVMModuleProviderRef M);
 
 /**
  * @}
@@ -4148,21 +4148,21 @@ void LLVMDisposeModuleProvider(LLVMModuleProviderRef M);
  * @{
  */
 
-LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path,
+LLVM_FUNC_ABI LLVMBool LLVMCreateMemoryBufferWithContentsOfFile(const char *Path,
                                                   LLVMMemoryBufferRef *OutMemBuf,
                                                   char **OutMessage);
-LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
+LLVM_FUNC_ABI LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf,
                                          char **OutMessage);
-LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData,
+LLVM_FUNC_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData,
                                                           size_t InputDataLength,
                                                           const char *BufferName,
                                                           LLVMBool RequiresNullTerminator);
-LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData,
+LLVM_FUNC_ABI LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData,
                                                               size_t InputDataLength,
                                                               const char *BufferName);
-const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf);
-size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf);
-void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf);
+LLVM_FUNC_ABI const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf);
+LLVM_FUNC_ABI size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf);
+LLVM_FUNC_ABI void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf);
 
 /**
  * @}
@@ -4178,43 +4178,43 @@ void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf);
 /** Constructs a new whole-module pass pipeline. This type of pipeline is
     suitable for link-time optimization and whole-module transformations.
     @see llvm::PassManager::PassManager */
-LLVMPassManagerRef LLVMCreatePassManager(void);
+LLVM_FUNC_ABI LLVMPassManagerRef LLVMCreatePassManager(void);
 
 /** Constructs a new function-by-function pass pipeline over the module
     provider. It does not take ownership of the module provider. This type of
     pipeline is suitable for code generation and JIT compilation tasks.
     @see llvm::FunctionPassManager::FunctionPassManager */
-LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMPassManagerRef LLVMCreateFunctionPassManagerForModule(LLVMModuleRef M);
 
 /** Deprecated: Use LLVMCreateFunctionPassManagerForModule instead. */
-LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP);
+LLVM_FUNC_ABI LLVMPassManagerRef LLVMCreateFunctionPassManager(LLVMModuleProviderRef MP);
 
 /** Initializes, executes on the provided module, and finalizes all of the
     passes scheduled in the pass manager. Returns 1 if any of the passes
     modified the module, 0 otherwise.
     @see llvm::PassManager::run(Module&) */
-LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMBool LLVMRunPassManager(LLVMPassManagerRef PM, LLVMModuleRef M);
 
 /** Initializes all of the function passes scheduled in the function pass
     manager. Returns 1 if any of the passes modified the module, 0 otherwise.
     @see llvm::FunctionPassManager::doInitialization */
-LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM);
+LLVM_FUNC_ABI LLVMBool LLVMInitializeFunctionPassManager(LLVMPassManagerRef FPM);
 
 /** Executes all of the function passes scheduled in the function pass manager
     on the provided function. Returns 1 if any of the passes modified the
     function, false otherwise.
     @see llvm::FunctionPassManager::run(Function&) */
-LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F);
+LLVM_FUNC_ABI LLVMBool LLVMRunFunctionPassManager(LLVMPassManagerRef FPM, LLVMValueRef F);
 
 /** Finalizes all of the function passes scheduled in the function pass
     manager. Returns 1 if any of the passes modified the module, 0 otherwise.
     @see llvm::FunctionPassManager::doFinalization */
-LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM);
+LLVM_FUNC_ABI LLVMBool LLVMFinalizeFunctionPassManager(LLVMPassManagerRef FPM);
 
 /** Frees the memory of a pass pipeline. For function pipelines, does not free
     the module provider.
     @see llvm::PassManagerBase::~PassManagerBase. */
-void LLVMDisposePassManager(LLVMPassManagerRef PM);
+LLVM_FUNC_ABI void LLVMDisposePassManager(LLVMPassManagerRef PM);
 
 /**
  * @}
@@ -4231,15 +4231,15 @@ void LLVMDisposePassManager(LLVMPassManagerRef PM);
 /** Deprecated: Multi-threading can only be enabled/disabled with the compile
     time define LLVM_ENABLE_THREADS.  This function always returns
     LLVMIsMultithreaded(). */
-LLVMBool LLVMStartMultithreaded(void);
+LLVM_FUNC_ABI LLVMBool LLVMStartMultithreaded(void);
 
 /** Deprecated: Multi-threading can only be enabled/disabled with the compile
     time define LLVM_ENABLE_THREADS. */
-void LLVMStopMultithreaded(void);
+LLVM_FUNC_ABI void LLVMStopMultithreaded(void);
 
 /** Check whether LLVM is executing in thread-safe mode or not.
     @see llvm::llvm_is_multithreaded */
-LLVMBool LLVMIsMultithreaded(void);
+LLVM_FUNC_ABI LLVMBool LLVMIsMultithreaded(void);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h
index dc0e7432db6f969..870949e9eda823e 100644
--- a/llvm/include/llvm-c/DebugInfo.h
+++ b/llvm/include/llvm-c/DebugInfo.h
@@ -206,12 +206,12 @@ typedef enum {
 /**
  * The current debug metadata version number.
  */
-unsigned LLVMDebugMetadataVersion(void);
+LLVM_FUNC_ABI unsigned LLVMDebugMetadataVersion(void);
 
 /**
  * The version of debug metadata that's present in the provided \c Module.
  */
-unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module);
+LLVM_FUNC_ABI unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module);
 
 /**
  * Strip debug info in the module if it exists.
@@ -219,37 +219,37 @@ unsigned LLVMGetModuleDebugMetadataVersion(LLVMModuleRef Module);
  * metadata for debugging. We also remove debug locations for instructions.
  * Return true if module is modified.
  */
-LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module);
+LLVM_FUNC_ABI LLVMBool LLVMStripModuleDebugInfo(LLVMModuleRef Module);
 
 /**
  * Construct a builder for a module, and do not allow for unresolved nodes
  * attached to the module.
  */
-LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMDIBuilderRef LLVMCreateDIBuilderDisallowUnresolved(LLVMModuleRef M);
 
 /**
  * Construct a builder for a module and collect unresolved nodes attached
  * to the module in order to resolve cycles during a call to
  * \c LLVMDIBuilderFinalize.
  */
-LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMDIBuilderRef LLVMCreateDIBuilder(LLVMModuleRef M);
 
 /**
  * Deallocates the \c DIBuilder and everything it owns.
  * @note You must call \c LLVMDIBuilderFinalize before this
  */
-void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder);
+LLVM_FUNC_ABI void LLVMDisposeDIBuilder(LLVMDIBuilderRef Builder);
 
 /**
  * Construct any deferred debug info descriptors.
  */
-void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder);
+LLVM_FUNC_ABI void LLVMDIBuilderFinalize(LLVMDIBuilderRef Builder);
 
 /**
  * Finalize a specific subprogram.
  * No new variables may be added to this subprogram afterwards.
  */
-void LLVMDIBuilderFinalizeSubprogram(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI void LLVMDIBuilderFinalizeSubprogram(LLVMDIBuilderRef Builder,
                                      LLVMMetadataRef Subprogram);
 
 /**
@@ -284,7 +284,7 @@ void LLVMDIBuilderFinalizeSubprogram(LLVMDIBuilderRef Builder,
  * \param SDK           The SDK. On Darwin, the last component of the sysroot.
  * \param SDKLen        The length of the C string passed to \c SDK.
  */
-LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(
     LLVMDIBuilderRef Builder, LLVMDWARFSourceLanguage Lang,
     LLVMMetadataRef FileRef, const char *Producer, size_t ProducerLen,
     LLVMBool isOptimized, const char *Flags, size_t FlagsLen,
@@ -301,7 +301,7 @@ LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(
  * \param Directory    Directory.
  * \param DirectoryLen The length of the C string passed to \c Directory.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
                         size_t FilenameLen, const char *Directory,
                         size_t DirectoryLen);
@@ -320,7 +320,7 @@ LLVMDIBuilderCreateFile(LLVMDIBuilderRef Builder, const char *Filename,
  * \param APINotesFile    The path to an API notes file for the module.
  * \param APINotesFileLen The length of the C string passed to \c APINotestFile.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope,
                           const char *Name, size_t NameLen,
                           const char *ConfigMacros, size_t ConfigMacrosLen,
@@ -336,7 +336,7 @@ LLVMDIBuilderCreateModule(LLVMDIBuilderRef Builder, LLVMMetadataRef ParentScope,
  * \param ExportSymbols    Whether or not the namespace exports symbols, e.g.
  *                         this is true of C++ inline namespaces.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder,
                              LLVMMetadataRef ParentScope,
                              const char *Name, size_t NameLen,
@@ -360,7 +360,7 @@ LLVMDIBuilderCreateNameSpace(LLVMDIBuilderRef Builder,
  *                        used to emit dwarf attributes.
  * \param IsOptimized     True if optimization is ON.
  */
-LLVMMetadataRef LLVMDIBuilderCreateFunction(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateFunction(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, const char *LinkageName, size_t LinkageNameLen,
     LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
@@ -375,7 +375,7 @@ LLVMMetadataRef LLVMDIBuilderCreateFunction(
  * \param Line         The line in the source file.
  * \param Column       The column in the source file.
  */
-LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
     LLVMMetadataRef File, unsigned Line, unsigned Column);
 
@@ -386,7 +386,7 @@ LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(
  * \param File           Source file.
  * \param Discriminator  DWARF path discriminator value.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder,
                                     LLVMMetadataRef Scope,
                                     LLVMMetadataRef File,
@@ -400,7 +400,7 @@ LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Builder,
  * \param File       File where the declaration is located.
  * \param Line       Line number of the declaration.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder,
                                                LLVMMetadataRef Scope,
                                                LLVMMetadataRef NS,
@@ -418,7 +418,7 @@ LLVMDIBuilderCreateImportedModuleFromNamespace(LLVMDIBuilderRef Builder,
  * \param Elements       Renamed elements.
  * \param NumElements    Number of renamed elements.
  */
-LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope,
     LLVMMetadataRef ImportedEntity, LLVMMetadataRef File, unsigned Line,
     LLVMMetadataRef *Elements, unsigned NumElements);
@@ -433,7 +433,7 @@ LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromAlias(
  * \param Elements       Renamed elements.
  * \param NumElements    Number of renamed elements.
  */
-LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef M,
     LLVMMetadataRef File, unsigned Line, LLVMMetadataRef *Elements,
     unsigned NumElements);
@@ -453,7 +453,7 @@ LLVMMetadataRef LLVMDIBuilderCreateImportedModuleFromModule(
  * \param Elements       Renamed elements.
  * \param NumElements    Number of renamed elements.
  */
-LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, LLVMMetadataRef Decl,
     LLVMMetadataRef File, unsigned Line, const char *Name, size_t NameLen,
     LLVMMetadataRef *Elements, unsigned NumElements);
@@ -468,7 +468,7 @@ LLVMMetadataRef LLVMDIBuilderCreateImportedDeclaration(
  * \note If the item to which this location is attached cannot be
  *       attributed to a source line, pass 0 for the line and column.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line,
                                  unsigned Column, LLVMMetadataRef Scope,
                                  LLVMMetadataRef InlinedAt);
@@ -479,7 +479,7 @@ LLVMDIBuilderCreateDebugLocation(LLVMContextRef Ctx, unsigned Line,
  *
  * @see DILocation::getLine()
  */
-unsigned LLVMDILocationGetLine(LLVMMetadataRef Location);
+LLVM_FUNC_ABI unsigned LLVMDILocationGetLine(LLVMMetadataRef Location);
 
 /**
  * Get the column number of this debug location.
@@ -487,7 +487,7 @@ unsigned LLVMDILocationGetLine(LLVMMetadataRef Location);
  *
  * @see DILocation::getColumn()
  */
-unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location);
+LLVM_FUNC_ABI unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location);
 
 /**
  * Get the local scope associated with this debug location.
@@ -495,7 +495,7 @@ unsigned LLVMDILocationGetColumn(LLVMMetadataRef Location);
  *
  * @see DILocation::getScope()
  */
-LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location);
 
 /**
  * Get the "inline at" location associated with this debug location.
@@ -503,7 +503,7 @@ LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location);
  *
  * @see DILocation::getInlinedAt()
  */
-LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location);
 
 /**
  * Get the metadata of the file associated with a given scope.
@@ -511,7 +511,7 @@ LLVMMetadataRef LLVMDILocationGetInlinedAt(LLVMMetadataRef Location);
  *
  * @see DIScope::getFile()
  */
-LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope);
 
 /**
  * Get the directory of a given file.
@@ -520,7 +520,7 @@ LLVMMetadataRef LLVMDIScopeGetFile(LLVMMetadataRef Scope);
  *
  * @see DIFile::getDirectory()
  */
-const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len);
+LLVM_FUNC_ABI const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len);
 
 /**
  * Get the name of a given file.
@@ -529,7 +529,7 @@ const char *LLVMDIFileGetDirectory(LLVMMetadataRef File, unsigned *Len);
  *
  * @see DIFile::getFilename()
  */
-const char *LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len);
+LLVM_FUNC_ABI const char *LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len);
 
 /**
  * Get the source of a given file.
@@ -538,7 +538,7 @@ const char *LLVMDIFileGetFilename(LLVMMetadataRef File, unsigned *Len);
  *
  * @see DIFile::getSource()
  */
-const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len);
+LLVM_FUNC_ABI const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len);
 
 /**
  * Create a type array.
@@ -546,7 +546,7 @@ const char *LLVMDIFileGetSource(LLVMMetadataRef File, unsigned *Len);
  * \param Data           The type elements.
  * \param NumElements    Number of type elements.
  */
-LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder,
                                                   LLVMMetadataRef *Data,
                                                   size_t NumElements);
 
@@ -560,7 +560,7 @@ LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Builder,
  * \param Flags           E.g.: \c LLVMDIFlagLValueReference.
  *                        These flags are used to emit dwarf attributes.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder,
                                   LLVMMetadataRef File,
                                   LLVMMetadataRef *ParameterTypes,
@@ -578,7 +578,7 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder,
  * @param Value           Macro value.
  * @param ValueLen        Macro value length.
  */
-LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder,
                                          LLVMMetadataRef ParentMacroFile,
                                          unsigned Line,
                                          LLVMDWARFMacinfoRecordType RecordType,
@@ -594,7 +594,7 @@ LLVMMetadataRef LLVMDIBuilderCreateMacro(LLVMDIBuilderRef Builder,
  * @param Line            Source line number where the macro file is included.
  * @param File            File descriptor containing the name of the macro file.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateTempMacroFile(LLVMDIBuilderRef Builder,
                                  LLVMMetadataRef ParentMacroFile, unsigned Line,
                                  LLVMMetadataRef File);
@@ -607,7 +607,7 @@ LLVMDIBuilderCreateTempMacroFile(LLVMDIBuilderRef Builder,
  * @param Value          Enumerator value.
  * @param IsUnsigned     True if the value is unsigned.
  */
-LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
                                               const char *Name, size_t NameLen,
                                               int64_t Value,
                                               LLVMBool IsUnsigned);
@@ -626,7 +626,7 @@ LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
  * \param NumElements    Number of enumeration elements.
  * \param ClassTy        Underlying type of a C++11/ObjC fixed enum.
  */
-LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
     uint64_t SizeInBits, uint32_t AlignInBits, LLVMMetadataRef *Elements,
@@ -649,7 +649,7 @@ LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
  * \param UniqueId     A unique identifier for the union.
  * \param UniqueIdLen  Length of unique identifier.
  */
-LLVMMetadataRef LLVMDIBuilderCreateUnionType(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateUnionType(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
     uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
@@ -666,7 +666,7 @@ LLVMMetadataRef LLVMDIBuilderCreateUnionType(
  * \param Subscripts   Subscripts.
  * \param NumSubscripts Number of subscripts.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size,
                              uint32_t AlignInBits, LLVMMetadataRef Ty,
                              LLVMMetadataRef *Subscripts,
@@ -681,7 +681,7 @@ LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Builder, uint64_t Size,
  * \param Subscripts   Subscripts.
  * \param NumSubscripts Number of subscripts.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size,
                               uint32_t AlignInBits, LLVMMetadataRef Ty,
                               LLVMMetadataRef *Subscripts,
@@ -693,7 +693,7 @@ LLVMDIBuilderCreateVectorType(LLVMDIBuilderRef Builder, uint64_t Size,
  * \param Name      The unspecified type's name.
  * \param NameLen   Length of type name.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name,
                                    size_t NameLen);
 
@@ -707,7 +707,7 @@ LLVMDIBuilderCreateUnspecifiedType(LLVMDIBuilderRef Builder, const char *Name,
  * \param Encoding    DWARF encoding code, e.g. \c LLVMDWARFTypeEncoding_float.
  * \param Flags       Flags to encode optional attribute like endianity
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name,
                              size_t NameLen, uint64_t SizeInBits,
                              LLVMDWARFTypeEncoding Encoding,
@@ -723,7 +723,7 @@ LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Builder, const char *Name,
  * \param Name              Pointer type name. (optional)
  * \param NameLen           Length of pointer type name. (optional)
  */
-LLVMMetadataRef LLVMDIBuilderCreatePointerType(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreatePointerType(
     LLVMDIBuilderRef Builder, LLVMMetadataRef PointeeTy,
     uint64_t SizeInBits, uint32_t AlignInBits, unsigned AddressSpace,
     const char *Name, size_t NameLen);
@@ -746,7 +746,7 @@ LLVMMetadataRef LLVMDIBuilderCreatePointerType(
  * \param UniqueId     A unique identifier for the struct.
  * \param UniqueIdLen  Length of the unique identifier for the struct.
  */
-LLVMMetadataRef LLVMDIBuilderCreateStructType(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateStructType(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
     uint64_t SizeInBits, uint32_t AlignInBits, LLVMDIFlags Flags,
@@ -768,7 +768,7 @@ LLVMMetadataRef LLVMDIBuilderCreateStructType(
  * \param Flags        Flags to encode member attribute, e.g. private
  * \param Ty           Parent type.
  */
-LLVMMetadataRef LLVMDIBuilderCreateMemberType(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateMemberType(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, LLVMMetadataRef File, unsigned LineNo,
     uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
@@ -788,7 +788,7 @@ LLVMMetadataRef LLVMDIBuilderCreateMemberType(
  * \param ConstantVal  Const initializer of the member.
  * \param AlignInBits  Member alignment.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateStaticMemberType(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,
@@ -804,7 +804,7 @@ LLVMDIBuilderCreateStaticMemberType(
  * \param AlignInBits  Alignment.
  * \param Flags        Flags.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder,
                                      LLVMMetadataRef PointeeType,
                                      LLVMMetadataRef ClassType,
@@ -825,7 +825,7 @@ LLVMDIBuilderCreateMemberPointerType(LLVMDIBuilderRef Builder,
  * \param Ty           Parent type.
  * \param PropertyNode Property associated with this ivar.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateObjCIVar(LLVMDIBuilderRef Builder,
                             const char *Name, size_t NameLen,
                             LLVMMetadataRef File, unsigned LineNo,
@@ -847,7 +847,7 @@ LLVMDIBuilderCreateObjCIVar(LLVMDIBuilderRef Builder,
  * \param PropertyAttributes Objective C property attributes.
  * \param Ty                 Type.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder,
                                 const char *Name, size_t NameLen,
                                 LLVMMetadataRef File, unsigned LineNo,
@@ -861,7 +861,7 @@ LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder,
  * \param Builder   The DIBuilder.
  * \param Type      The underlying type to which this pointer points.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder,
                                      LLVMMetadataRef Type);
 
@@ -873,7 +873,7 @@ LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder,
  *                    e.g. LLVMDWARFTypeQualifier_volatile_type
  * \param Type        Base Type.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag,
                                  LLVMMetadataRef Type);
 
@@ -884,7 +884,7 @@ LLVMDIBuilderCreateQualifiedType(LLVMDIBuilderRef Builder, unsigned Tag,
  * \param Tag       Tag identifying type,
  * \param Type      Base Type.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag,
                                  LLVMMetadataRef Type);
 
@@ -892,7 +892,7 @@ LLVMDIBuilderCreateReferenceType(LLVMDIBuilderRef Builder, unsigned Tag,
  * Create C++11 nullptr type.
  * \param Builder   The DIBuilder.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder);
 
 /**
@@ -904,7 +904,7 @@ LLVMDIBuilderCreateNullPtrType(LLVMDIBuilderRef Builder);
  * \param LineNo     Line number.
  * \param Scope      The surrounding context for the typedef.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type,
                            const char *Name, size_t NameLen,
                            LLVMMetadataRef File, unsigned LineNo,
@@ -920,7 +920,7 @@ LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Builder, LLVMMetadataRef Type,
  * \param VBPtrOffset  Virtual base pointer offset.
  * \param Flags         Flags to describe inheritance attribute, e.g. private
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateInheritance(LLVMDIBuilderRef Builder,
                                LLVMMetadataRef Ty, LLVMMetadataRef BaseTy,
                                uint64_t BaseOffset, uint32_t VBPtrOffset,
@@ -942,7 +942,7 @@ LLVMDIBuilderCreateInheritance(LLVMDIBuilderRef Builder,
  * \param UniqueIdentifier    A unique identifier for the type.
  * \param UniqueIdentifierLen Length of the unique identifier.
  */
-LLVMMetadataRef LLVMDIBuilderCreateForwardDecl(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateForwardDecl(
     LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
     size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
     unsigned RuntimeLang, uint64_t SizeInBits, uint32_t AlignInBits,
@@ -965,7 +965,7 @@ LLVMMetadataRef LLVMDIBuilderCreateForwardDecl(
  * \param UniqueIdentifier    A unique identifier for the type.
  * \param UniqueIdentifierLen Length of the unique identifier.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateReplaceableCompositeType(
     LLVMDIBuilderRef Builder, unsigned Tag, const char *Name,
     size_t NameLen, LLVMMetadataRef Scope, LLVMMetadataRef File, unsigned Line,
@@ -987,7 +987,7 @@ LLVMDIBuilderCreateReplaceableCompositeType(
  * \param Flags               Flags to encode member attribute.
  * \param Type                Parent type.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder,
                                       LLVMMetadataRef Scope,
                                       const char *Name, size_t NameLen,
@@ -1019,7 +1019,7 @@ LLVMDIBuilderCreateBitFieldMemberType(LLVMDIBuilderRef Builder,
  * \param UniqueIdentifier    A unique identifier for the type.
  * \param UniqueIdentifierLen Length of the unique identifier.
  */
-LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder,
     LLVMMetadataRef Scope, const char *Name, size_t NameLen,
     LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits,
     uint32_t AlignInBits, uint64_t OffsetInBits, LLVMDIFlags Flags,
@@ -1033,7 +1033,7 @@ LLVMMetadataRef LLVMDIBuilderCreateClassType(LLVMDIBuilderRef Builder,
  * \param Builder     The DIBuilder.
  * \param Type        The underlying type.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder,
                                   LLVMMetadataRef Type);
 
@@ -1044,7 +1044,7 @@ LLVMDIBuilderCreateArtificialType(LLVMDIBuilderRef Builder,
  *
  * @see DIType::getName()
  */
-const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
+LLVM_FUNC_ABI const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
 
 /**
  * Get the size of this DIType in bits.
@@ -1052,7 +1052,7 @@ const char *LLVMDITypeGetName(LLVMMetadataRef DType, size_t *Length);
  *
  * @see DIType::getSizeInBits()
  */
-uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType);
+LLVM_FUNC_ABI uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType);
 
 /**
  * Get the offset of this DIType in bits.
@@ -1060,7 +1060,7 @@ uint64_t LLVMDITypeGetSizeInBits(LLVMMetadataRef DType);
  *
  * @see DIType::getOffsetInBits()
  */
-uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType);
+LLVM_FUNC_ABI uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType);
 
 /**
  * Get the alignment of this DIType in bits.
@@ -1068,7 +1068,7 @@ uint64_t LLVMDITypeGetOffsetInBits(LLVMMetadataRef DType);
  *
  * @see DIType::getAlignInBits()
  */
-uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType);
+LLVM_FUNC_ABI uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType);
 
 /**
  * Get the source line where this DIType is declared.
@@ -1076,7 +1076,7 @@ uint32_t LLVMDITypeGetAlignInBits(LLVMMetadataRef DType);
  *
  * @see DIType::getLine()
  */
-unsigned LLVMDITypeGetLine(LLVMMetadataRef DType);
+LLVM_FUNC_ABI unsigned LLVMDITypeGetLine(LLVMMetadataRef DType);
 
 /**
  * Get the flags associated with this DIType.
@@ -1084,7 +1084,7 @@ unsigned LLVMDITypeGetLine(LLVMMetadataRef DType);
  *
  * @see DIType::getFlags()
  */
-LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType);
+LLVM_FUNC_ABI LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType);
 
 /**
  * Create a descriptor for a value range.
@@ -1092,7 +1092,7 @@ LLVMDIFlags LLVMDITypeGetFlags(LLVMMetadataRef DType);
  * \param LowerBound Lower bound of the subrange, e.g. 0 for C, 1 for Fortran.
  * \param Count      Count of elements in the subrange.
  */
-LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder,
                                                  int64_t LowerBound,
                                                  int64_t Count);
 
@@ -1102,7 +1102,7 @@ LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Builder,
  * \param Data           The DI Node elements.
  * \param NumElements    Number of DI Node elements.
  */
-LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder,
                                               LLVMMetadataRef *Data,
                                               size_t NumElements);
 
@@ -1113,7 +1113,7 @@ LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Builder,
  * \param Addr        An array of complex address operations.
  * \param Length      Length of the address operation array.
  */
-LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder,
                                               uint64_t *Addr, size_t Length);
 
 /**
@@ -1122,7 +1122,7 @@ LLVMMetadataRef LLVMDIBuilderCreateExpression(LLVMDIBuilderRef Builder,
  * \param Builder     The DIBuilder.
  * \param Value       The constant value.
  */
-LLVMMetadataRef
+LLVM_FUNC_ABI LLVMMetadataRef
 LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder,
                                            uint64_t Value);
 
@@ -1145,7 +1145,7 @@ LLVMDIBuilderCreateConstantValueExpression(LLVMDIBuilderRef Builder,
  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
  *                    specified)
  */
-LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, const char *Linkage, size_t LinkLen, LLVMMetadataRef File,
     unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
@@ -1155,7 +1155,7 @@ LLVMMetadataRef LLVMDIBuilderCreateGlobalVariableExpression(
 /**
  * Get the dwarf::Tag of a DINode
  */
-uint16_t LLVMGetDINodeTag(LLVMMetadataRef MD);
+LLVM_FUNC_ABI uint16_t LLVMGetDINodeTag(LLVMMetadataRef MD);
 
 /**
  * Retrieves the \c DIVariable associated with this global variable expression.
@@ -1163,7 +1163,7 @@ uint16_t LLVMGetDINodeTag(LLVMMetadataRef MD);
  *
  * @see llvm::DIGlobalVariableExpression::getVariable()
  */
-LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE);
 
 /**
  * Retrieves the \c DIExpression associated with this global variable expression.
@@ -1171,7 +1171,7 @@ LLVMMetadataRef LLVMDIGlobalVariableExpressionGetVariable(LLVMMetadataRef GVE);
  *
  * @see llvm::DIGlobalVariableExpression::getExpression()
  */
-LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression(
     LLVMMetadataRef GVE);
 
 /**
@@ -1180,7 +1180,7 @@ LLVMMetadataRef LLVMDIGlobalVariableExpressionGetExpression(
  *
  * @see DIVariable::getFile()
  */
-LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var);
 
 /**
  * Get the metadata of the scope associated with a given variable.
@@ -1188,7 +1188,7 @@ LLVMMetadataRef LLVMDIVariableGetFile(LLVMMetadataRef Var);
  *
  * @see DIVariable::getScope()
  */
-LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var);
 
 /**
  * Get the source line where this \c DIVariable is declared.
@@ -1196,7 +1196,7 @@ LLVMMetadataRef LLVMDIVariableGetScope(LLVMMetadataRef Var);
  *
  * @see DIVariable::getLine()
  */
-unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var);
+LLVM_FUNC_ABI unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var);
 
 /**
  * Create a new temporary \c MDNode.  Suitable for use in constructing cyclic
@@ -1206,7 +1206,7 @@ unsigned LLVMDIVariableGetLine(LLVMMetadataRef Var);
  * \param Data           The metadata elements.
  * \param NumElements    Number of metadata elements.
  */
-LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data,
+LLVM_FUNC_ABI LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data,
                                     size_t NumElements);
 
 /**
@@ -1216,14 +1216,14 @@ LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef Ctx, LLVMMetadataRef *Data,
  * references will be reset.
  * \param TempNode    The temporary metadata node.
  */
-void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode);
+LLVM_FUNC_ABI void LLVMDisposeTemporaryMDNode(LLVMMetadataRef TempNode);
 
 /**
  * Replace all uses of temporary metadata.
  * \param TempTargetMetadata    The temporary metadata node.
  * \param Replacement           The replacement metadata node.
  */
-void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata,
+LLVM_FUNC_ABI void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata,
                                     LLVMMetadataRef Replacement);
 
 /**
@@ -1243,7 +1243,7 @@ void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef TempTargetMetadata,
  * \param AlignInBits Variable alignment(or 0 if no alignment attr was
  *                    specified)
  */
-LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, const char *Linkage, size_t LnkLen, LLVMMetadataRef File,
     unsigned LineNo, LLVMMetadataRef Ty, LLVMBool LocalToUnit,
@@ -1258,7 +1258,7 @@ LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDecl(
  * \param DebugLoc    Debug info location.
  * \param Instr       Instruction acting as a location for the new intrinsic.
  */
-LLVMValueRef LLVMDIBuilderInsertDeclareBefore(
+LLVM_FUNC_ABI LLVMValueRef LLVMDIBuilderInsertDeclareBefore(
   LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
   LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr);
 
@@ -1273,7 +1273,7 @@ LLVMValueRef LLVMDIBuilderInsertDeclareBefore(
  * \param DebugLoc    Debug info location.
  * \param Block       Basic block acting as a location for the new intrinsic.
  */
-LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(
+LLVM_FUNC_ABI LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(
     LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo,
     LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block);
 
@@ -1286,7 +1286,7 @@ LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(
  * \param DebugLoc    Debug info location.
  * \param Instr       Instruction acting as a location for the new intrinsic.
  */
-LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder,
                                                LLVMValueRef Val,
                                                LLVMMetadataRef VarInfo,
                                                LLVMMetadataRef Expr,
@@ -1304,7 +1304,7 @@ LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder,
  * \param DebugLoc    Debug info location.
  * \param Block       Basic block acting as a location for the new intrinsic.
  */
-LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder,
+LLVM_FUNC_ABI LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder,
                                               LLVMValueRef Val,
                                               LLVMMetadataRef VarInfo,
                                               LLVMMetadataRef Expr,
@@ -1324,7 +1324,7 @@ LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder,
  * \param Flags           Flags.
  * \param AlignInBits     Variable alignment.
  */
-LLVMMetadataRef LLVMDIBuilderCreateAutoVariable(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateAutoVariable(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, LLVMMetadataRef File, unsigned LineNo, LLVMMetadataRef Ty,
     LLVMBool AlwaysPreserve, LLVMDIFlags Flags, uint32_t AlignInBits);
@@ -1342,7 +1342,7 @@ LLVMMetadataRef LLVMDIBuilderCreateAutoVariable(
  * \param AlwaysPreserve  If true, this descriptor will survive optimizations.
  * \param Flags           Flags.
  */
-LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
+LLVM_FUNC_ABI LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
     LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
     size_t NameLen, unsigned ArgNo, LLVMMetadataRef File, unsigned LineNo,
     LLVMMetadataRef Ty, LLVMBool AlwaysPreserve, LLVMDIFlags Flags);
@@ -1352,14 +1352,14 @@ LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
  *
  * @see llvm::Function::getSubprogram()
  */
-LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMGetSubprogram(LLVMValueRef Func);
 
 /**
  * Set the subprogram attached to a function.
  *
  * @see llvm::Function::setSubprogram()
  */
-void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP);
+LLVM_FUNC_ABI void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP);
 
 /**
  * Get the line associated with a given subprogram.
@@ -1367,14 +1367,14 @@ void LLVMSetSubprogram(LLVMValueRef Func, LLVMMetadataRef SP);
  *
  * @see DISubprogram::getLine()
  */
-unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram);
+LLVM_FUNC_ABI unsigned LLVMDISubprogramGetLine(LLVMMetadataRef Subprogram);
 
 /**
  * Get the debug location for the given instruction.
  *
  * @see llvm::Instruction::getDebugLoc()
  */
-LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst);
+LLVM_FUNC_ABI LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst);
 
 /**
  * Set the debug location for the given instruction.
@@ -1383,14 +1383,14 @@ LLVMMetadataRef LLVMInstructionGetDebugLoc(LLVMValueRef Inst);
  *
  * @see llvm::Instruction::setDebugLoc()
  */
-void LLVMInstructionSetDebugLoc(LLVMValueRef Inst, LLVMMetadataRef Loc);
+LLVM_FUNC_ABI void LLVMInstructionSetDebugLoc(LLVMValueRef Inst, LLVMMetadataRef Loc);
 
 /**
  * Obtain the enumerated type of a Metadata instance.
  *
  * @see llvm::Metadata::getMetadataID()
  */
-LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata);
+LLVM_FUNC_ABI LLVMMetadataKind LLVMGetMetadataKind(LLVMMetadataRef Metadata);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/Disassembler.h b/llvm/include/llvm-c/Disassembler.h
index 8f832318f9d1676..b65c23306c03fda 100644
--- a/llvm/include/llvm-c/Disassembler.h
+++ b/llvm/include/llvm-c/Disassembler.h
@@ -36,7 +36,7 @@ LLVM_C_EXTERN_C_BEGIN
  * returns NULL. This function is equivalent to calling
  * LLVMCreateDisasmCPUFeatures() with an empty CPU name and feature set.
  */
-LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
+LLVM_FUNC_ABI LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
                                       int TagType, LLVMOpInfoCallback GetOpInfo,
                                       LLVMSymbolLookupCallback SymbolLookUp);
 
@@ -48,7 +48,7 @@ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
  * disassembler context.  If not, it returns NULL. This function is equivalent
  * to calling LLVMCreateDisasmCPUFeatures() with an empty feature set.
  */
-LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU,
+LLVM_FUNC_ABI LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU,
                                          void *DisInfo, int TagType,
                                          LLVMOpInfoCallback GetOpInfo,
                                          LLVMSymbolLookupCallback SymbolLookUp);
@@ -60,7 +60,7 @@ LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU,
  * described above.  These can all be passed * as NULL.  If successful, this
  * returns a disassembler context.  If not, it returns NULL.
  */
-LLVMDisasmContextRef
+LLVM_FUNC_ABI LLVMDisasmContextRef
 LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU,
                             const char *Features, void *DisInfo, int TagType,
                             LLVMOpInfoCallback GetOpInfo,
@@ -70,7 +70,7 @@ LLVMCreateDisasmCPUFeatures(const char *Triple, const char *CPU,
  * Set the disassembler's options.  Returns 1 if it can set the Options and 0
  * otherwise.
  */
-int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options);
+LLVM_FUNC_ABI int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options);
 
 /* The option to produce marked up assembly. */
 #define LLVMDisassembler_Option_UseMarkup 1
@@ -86,7 +86,7 @@ int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options);
 /**
  * Dispose of a disassembler context.
  */
-void LLVMDisasmDispose(LLVMDisasmContextRef DC);
+LLVM_FUNC_ABI void LLVMDisasmDispose(LLVMDisasmContextRef DC);
 
 /**
  * Disassemble a single instruction using the disassembler context specified in
@@ -98,7 +98,7 @@ void LLVMDisasmDispose(LLVMDisasmContextRef DC);
  * function returns the number of bytes in the instruction or zero if there was
  * no valid instruction.
  */
-size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes,
+LLVM_FUNC_ABI size_t LLVMDisasmInstruction(LLVMDisasmContextRef DC, uint8_t *Bytes,
                              uint64_t BytesSize, uint64_t PC,
                              char *OutString, size_t OutStringSize);
 
diff --git a/llvm/include/llvm-c/DisassemblerTypes.h b/llvm/include/llvm-c/DisassemblerTypes.h
index 06ebfec6c32ba0f..9eb7ef542d16b61 100644
--- a/llvm/include/llvm-c/DisassemblerTypes.h
+++ b/llvm/include/llvm-c/DisassemblerTypes.h
@@ -70,13 +70,13 @@ typedef int (*LLVMOpInfoCallback)(void *DisInfo, uint64_t PC, uint64_t Offset,
  * type is one of the Target specific #defines below and is used to print
  * operands like "_foo at GOT", ":lower16:_foo", etc.
  */
-struct LLVMOpInfoSymbol1 {
+struct LLVM_CLASS_ABI LLVMOpInfoSymbol1 {
   uint64_t Present;  /* 1 if this symbol is present */
   const char *Name;  /* symbol name if not NULL */
   uint64_t Value;    /* symbol value if name is NULL */
 };
 
-struct LLVMOpInfo1 {
+struct LLVM_CLASS_ABI LLVMOpInfo1 {
   struct LLVMOpInfoSymbol1 AddSymbol;
   struct LLVMOpInfoSymbol1 SubtractSymbol;
   uint64_t Value;
diff --git a/llvm/include/llvm-c/ErrorHandling.h b/llvm/include/llvm-c/ErrorHandling.h
index d9b9f22752b8f72..79527feee71ce2f 100644
--- a/llvm/include/llvm-c/ErrorHandling.h
+++ b/llvm/include/llvm-c/ErrorHandling.h
@@ -33,20 +33,20 @@ typedef void (*LLVMFatalErrorHandler)(const char *Reason);
  * function allows you to install a callback that will be invoked prior to the
  * call to exit(1).
  */
-void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);
+LLVM_FUNC_ABI void LLVMInstallFatalErrorHandler(LLVMFatalErrorHandler Handler);
 
 /**
  * Reset the fatal error handler. This resets LLVM's fatal error handling
  * behavior to the default.
  */
-void LLVMResetFatalErrorHandler(void);
+LLVM_FUNC_ABI void LLVMResetFatalErrorHandler(void);
 
 /**
  * Enable LLVM's built-in stack trace code. This intercepts the OS's crash
  * signals and prints which component of LLVM you were in at the time if the
  * crash.
  */
-void LLVMEnablePrettyStackTrace(void);
+LLVM_FUNC_ABI void LLVMEnablePrettyStackTrace(void);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/ExecutionEngine.h b/llvm/include/llvm-c/ExecutionEngine.h
index ba8353b4796f16c..76185ab47e83973 100644
--- a/llvm/include/llvm-c/ExecutionEngine.h
+++ b/llvm/include/llvm-c/ExecutionEngine.h
@@ -34,14 +34,14 @@ LLVM_C_EXTERN_C_BEGIN
  * @{
  */
 
-void LLVMLinkInMCJIT(void);
-void LLVMLinkInInterpreter(void);
+LLVM_FUNC_ABI void LLVMLinkInMCJIT(void);
+LLVM_FUNC_ABI void LLVMLinkInInterpreter(void);
 
 typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef;
 typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef;
 typedef struct LLVMOpaqueMCJITMemoryManager *LLVMMCJITMemoryManagerRef;
 
-struct LLVMMCJITCompilerOptions {
+struct LLVM_CLASS_ABI LLVMMCJITCompilerOptions {
   unsigned OptLevel;
   LLVMCodeModel CodeModel;
   LLVMBool NoFramePointerElim;
@@ -51,41 +51,41 @@ struct LLVMMCJITCompilerOptions {
 
 /*===-- Operations on generic values --------------------------------------===*/
 
-LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
+LLVM_FUNC_ABI LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
                                                 unsigned long long N,
                                                 LLVMBool IsSigned);
 
-LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P);
+LLVM_FUNC_ABI LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P);
 
-LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N);
+LLVM_FUNC_ABI LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N);
 
-unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef);
+LLVM_FUNC_ABI unsigned LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef);
 
-unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal,
+LLVM_FUNC_ABI unsigned long long LLVMGenericValueToInt(LLVMGenericValueRef GenVal,
                                          LLVMBool IsSigned);
 
-void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal);
+LLVM_FUNC_ABI void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal);
 
-double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal);
+LLVM_FUNC_ABI double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal);
 
-void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal);
+LLVM_FUNC_ABI void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal);
 
 /*===-- Operations on execution engines -----------------------------------===*/
 
-LLVMBool LLVMCreateExecutionEngineForModule(LLVMExecutionEngineRef *OutEE,
+LLVM_FUNC_ABI LLVMBool LLVMCreateExecutionEngineForModule(LLVMExecutionEngineRef *OutEE,
                                             LLVMModuleRef M,
                                             char **OutError);
 
-LLVMBool LLVMCreateInterpreterForModule(LLVMExecutionEngineRef *OutInterp,
+LLVM_FUNC_ABI LLVMBool LLVMCreateInterpreterForModule(LLVMExecutionEngineRef *OutInterp,
                                         LLVMModuleRef M,
                                         char **OutError);
 
-LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT,
+LLVM_FUNC_ABI LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT,
                                         LLVMModuleRef M,
                                         unsigned OptLevel,
                                         char **OutError);
 
-void LLVMInitializeMCJITCompilerOptions(
+LLVM_FUNC_ABI void LLVMInitializeMCJITCompilerOptions(
   struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions);
 
 /**
@@ -105,54 +105,54 @@ void LLVMInitializeMCJITCompilerOptions(
  *
  * LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);
  */
-LLVMBool LLVMCreateMCJITCompilerForModule(
+LLVM_FUNC_ABI LLVMBool LLVMCreateMCJITCompilerForModule(
   LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M,
   struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions,
   char **OutError);
 
-void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE);
+LLVM_FUNC_ABI void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE);
 
-void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE);
+LLVM_FUNC_ABI void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE);
 
-void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE);
+LLVM_FUNC_ABI void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE);
 
-int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F,
+LLVM_FUNC_ABI int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F,
                           unsigned ArgC, const char * const *ArgV,
                           const char * const *EnvP);
 
-LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F,
+LLVM_FUNC_ABI LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F,
                                     unsigned NumArgs,
                                     LLVMGenericValueRef *Args);
 
-void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F);
+LLVM_FUNC_ABI void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F);
 
-void LLVMAddModule(LLVMExecutionEngineRef EE, LLVMModuleRef M);
+LLVM_FUNC_ABI void LLVMAddModule(LLVMExecutionEngineRef EE, LLVMModuleRef M);
 
-LLVMBool LLVMRemoveModule(LLVMExecutionEngineRef EE, LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMBool LLVMRemoveModule(LLVMExecutionEngineRef EE, LLVMModuleRef M,
                           LLVMModuleRef *OutMod, char **OutError);
 
-LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
+LLVM_FUNC_ABI LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
                           LLVMValueRef *OutFn);
 
-void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE,
+LLVM_FUNC_ABI void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE,
                                      LLVMValueRef Fn);
 
-LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE);
-LLVMTargetMachineRef
+LLVM_FUNC_ABI LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE);
+LLVM_FUNC_ABI LLVMTargetMachineRef
 LLVMGetExecutionEngineTargetMachine(LLVMExecutionEngineRef EE);
 
-void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
+LLVM_FUNC_ABI void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
                           void* Addr);
 
-void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
+LLVM_FUNC_ABI void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
 
-uint64_t LLVMGetGlobalValueAddress(LLVMExecutionEngineRef EE, const char *Name);
+LLVM_FUNC_ABI uint64_t LLVMGetGlobalValueAddress(LLVMExecutionEngineRef EE, const char *Name);
 
-uint64_t LLVMGetFunctionAddress(LLVMExecutionEngineRef EE, const char *Name);
+LLVM_FUNC_ABI uint64_t LLVMGetFunctionAddress(LLVMExecutionEngineRef EE, const char *Name);
 
 /// Returns true on error, false on success. If true is returned then the error
 /// message is copied to OutStr and cleared in the ExecutionEngine instance.
-LLVMBool LLVMExecutionEngineGetErrMsg(LLVMExecutionEngineRef EE,
+LLVM_FUNC_ABI LLVMBool LLVMExecutionEngineGetErrMsg(LLVMExecutionEngineRef EE,
                                       char **OutError);
 
 /*===-- Operations on memory managers -------------------------------------===*/
@@ -178,21 +178,21 @@ typedef void (*LLVMMemoryManagerDestroyCallback)(void *Opaque);
  * @param FinalizeMemory Set page permissions and flush cache. Return 0 on
  *   success, 1 on error.
  */
-LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
+LLVM_FUNC_ABI LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager(
   void *Opaque,
   LLVMMemoryManagerAllocateCodeSectionCallback AllocateCodeSection,
   LLVMMemoryManagerAllocateDataSectionCallback AllocateDataSection,
   LLVMMemoryManagerFinalizeMemoryCallback FinalizeMemory,
   LLVMMemoryManagerDestroyCallback Destroy);
 
-void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM);
+LLVM_FUNC_ABI void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM);
 
 /*===-- JIT Event Listener functions -------------------------------------===*/
 
-LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void);
-LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void);
-LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void);
-LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void);
+LLVM_FUNC_ABI LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void);
+LLVM_FUNC_ABI LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void);
+LLVM_FUNC_ABI LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void);
+LLVM_FUNC_ABI LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/IRReader.h b/llvm/include/llvm-c/IRReader.h
index 629dce589715728..c809c7976abbd19 100644
--- a/llvm/include/llvm-c/IRReader.h
+++ b/llvm/include/llvm-c/IRReader.h
@@ -36,7 +36,7 @@ LLVM_C_EXTERN_C_BEGIN
  *
  * @see llvm::ParseIR()
  */
-LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
+LLVM_FUNC_ABI LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
                               LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
                               char **OutMessage);
 
diff --git a/llvm/include/llvm-c/LLJIT.h b/llvm/include/llvm-c/LLJIT.h
index 961bf2daa909f11..a8dfd2022804724 100644
--- a/llvm/include/llvm-c/LLJIT.h
+++ b/llvm/include/llvm-c/LLJIT.h
@@ -72,14 +72,14 @@ typedef struct LLVMOrcOpaqueLLJIT *LLVMOrcLLJITRef;
  * The client owns the resulting LLJITBuilder and should dispose of it using
  * LLVMOrcDisposeLLJITBuilder once they are done with it.
  */
-LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder(void);
+LLVM_FUNC_ABI LLVMOrcLLJITBuilderRef LLVMOrcCreateLLJITBuilder(void);
 
 /**
  * Dispose of an LLVMOrcLLJITBuilderRef. This should only be called if ownership
  * has not been passed to LLVMOrcCreateLLJIT (e.g. because some error prevented
  * that function from being called).
  */
-void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder);
+LLVM_FUNC_ABI void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder);
 
 /**
  * Set the JITTargetMachineBuilder to be used when constructing the LLJIT
@@ -90,13 +90,13 @@ void LLVMOrcDisposeLLJITBuilder(LLVMOrcLLJITBuilderRef Builder);
  * This function takes ownership of the JTMB argument: clients should not
  * dispose of the JITTargetMachineBuilder after calling this function.
  */
-void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(
+LLVM_FUNC_ABI void LLVMOrcLLJITBuilderSetJITTargetMachineBuilder(
     LLVMOrcLLJITBuilderRef Builder, LLVMOrcJITTargetMachineBuilderRef JTMB);
 
 /**
  * Set an ObjectLinkingLayer creator function for this LLJIT instance.
  */
-void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(
+LLVM_FUNC_ABI void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(
     LLVMOrcLLJITBuilderRef Builder,
     LLVMOrcLLJITBuilderObjectLinkingLayerCreatorFunction F, void *Ctx);
 
@@ -114,13 +114,13 @@ void LLVMOrcLLJITBuilderSetObjectLinkingLayerCreator(
  * LLJIT instance will free all memory managed by the JIT, including JIT'd code
  * and not-yet compiled modules.
  */
-LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateLLJIT(LLVMOrcLLJITRef *Result,
                                 LLVMOrcLLJITBuilderRef Builder);
 
 /**
  * Dispose of an LLJIT instance.
  */
-LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J);
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J);
 
 /**
  * Get a reference to the ExecutionSession for this LLJIT instance.
@@ -128,7 +128,7 @@ LLVMErrorRef LLVMOrcDisposeLLJIT(LLVMOrcLLJITRef J);
  * The ExecutionSession is owned by the LLJIT instance. The client is not
  * responsible for managing its memory.
  */
-LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J);
+LLVM_FUNC_ABI LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J);
 
 /**
  * Return a reference to the Main JITDylib.
@@ -136,18 +136,18 @@ LLVMOrcExecutionSessionRef LLVMOrcLLJITGetExecutionSession(LLVMOrcLLJITRef J);
  * The JITDylib is owned by the LLJIT instance. The client is not responsible
  * for managing its memory.
  */
-LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J);
+LLVM_FUNC_ABI LLVMOrcJITDylibRef LLVMOrcLLJITGetMainJITDylib(LLVMOrcLLJITRef J);
 
 /**
  * Return the target triple for this LLJIT instance. This string is owned by
  * the LLJIT instance and should not be freed by the client.
  */
-const char *LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J);
+LLVM_FUNC_ABI const char *LLVMOrcLLJITGetTripleString(LLVMOrcLLJITRef J);
 
 /**
  * Returns the global prefix character according to the LLJIT's DataLayout.
  */
-char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J);
+LLVM_FUNC_ABI char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J);
 
 /**
  * Mangles the given string according to the LLJIT instance's DataLayout, then
@@ -156,7 +156,7 @@ char LLVMOrcLLJITGetGlobalPrefix(LLVMOrcLLJITRef J);
  * decrement the ref-count on the pool entry once they are finished with this
  * value.
  */
-LLVMOrcSymbolStringPoolEntryRef
+LLVM_FUNC_ABI LLVMOrcSymbolStringPoolEntryRef
 LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName);
 
 /**
@@ -168,7 +168,7 @@ LLVMOrcLLJITMangleAndIntern(LLVMOrcLLJITRef J, const char *UnmangledName);
  * Resources associated with the given object will be tracked by the given
  * JITDylib's default resource tracker.
  */
-LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD,
                                        LLVMMemoryBufferRef ObjBuffer);
 
 /**
@@ -180,7 +180,7 @@ LLVMErrorRef LLVMOrcLLJITAddObjectFile(LLVMOrcLLJITRef J, LLVMOrcJITDylibRef JD,
  * Resources associated with the given object will be tracked by ResourceTracker
  * RT.
  */
-LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J,
                                              LLVMOrcResourceTrackerRef RT,
                                              LLVMMemoryBufferRef ObjBuffer);
 
@@ -193,7 +193,7 @@ LLVMErrorRef LLVMOrcLLJITAddObjectFileWithRT(LLVMOrcLLJITRef J,
  * Resources associated with the given Module will be tracked by the given
  * JITDylib's default resource tracker.
  */
-LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,
                                          LLVMOrcJITDylibRef JD,
                                          LLVMOrcThreadSafeModuleRef TSM);
 
@@ -206,7 +206,7 @@ LLVMErrorRef LLVMOrcLLJITAddLLVMIRModule(LLVMOrcLLJITRef J,
  * Resources associated with the given Module will be tracked by ResourceTracker
  * RT.
  */
-LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J,
                                                LLVMOrcResourceTrackerRef JD,
                                                LLVMOrcThreadSafeModuleRef TSM);
 
@@ -215,25 +215,25 @@ LLVMErrorRef LLVMOrcLLJITAddLLVMIRModuleWithRT(LLVMOrcLLJITRef J,
  *
  * This operation does not take ownership of the Name argument.
  */
-LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcLLJITLookup(LLVMOrcLLJITRef J,
                                 LLVMOrcExecutorAddress *Result,
                                 const char *Name);
 
 /**
  * Returns a non-owning reference to the LLJIT instance's object linking layer.
  */
-LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J);
+LLVM_FUNC_ABI LLVMOrcObjectLayerRef LLVMOrcLLJITGetObjLinkingLayer(LLVMOrcLLJITRef J);
 
 /**
  * Returns a non-owning reference to the LLJIT instance's object linking layer.
  */
-LLVMOrcObjectTransformLayerRef
+LLVM_FUNC_ABI LLVMOrcObjectTransformLayerRef
 LLVMOrcLLJITGetObjTransformLayer(LLVMOrcLLJITRef J);
 
 /**
  * Returns a non-owning reference to the LLJIT instance's IR transform layer.
  */
-LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J);
+LLVM_FUNC_ABI LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J);
 
 /**
  * Get the LLJIT instance's default data layout string.
@@ -241,7 +241,7 @@ LLVMOrcIRTransformLayerRef LLVMOrcLLJITGetIRTransformLayer(LLVMOrcLLJITRef J);
  * This string is owned by the LLJIT instance and does not need to be freed
  * by the caller.
  */
-const char *LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J);
+LLVM_FUNC_ABI const char *LLVMOrcLLJITGetDataLayoutStr(LLVMOrcLLJITRef J);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/Linker.h b/llvm/include/llvm-c/Linker.h
index f13a5fbea67e16a..4b103bf83a5d3fc 100644
--- a/llvm/include/llvm-c/Linker.h
+++ b/llvm/include/llvm-c/Linker.h
@@ -39,7 +39,7 @@ typedef enum {
  * The return value is true if an error occurred, false otherwise.
  * Use the diagnostic handler to get any diagnostic message.
 */
-LLVMBool LLVMLinkModules2(LLVMModuleRef Dest, LLVMModuleRef Src);
+LLVM_FUNC_ABI LLVMBool LLVMLinkModules2(LLVMModuleRef Dest, LLVMModuleRef Src);
 
 LLVM_C_EXTERN_C_END
 
diff --git a/llvm/include/llvm-c/Object.h b/llvm/include/llvm-c/Object.h
index 709609df2460af8..55f6d2e40f149e4 100644
--- a/llvm/include/llvm-c/Object.h
+++ b/llvm/include/llvm-c/Object.h
@@ -74,7 +74,7 @@ typedef enum {
  *
  * @see llvm::object::createBinary
  */
-LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf,
+LLVM_FUNC_ABI LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf,
                                LLVMContextRef Context,
                                char **ErrorMessage);
 
@@ -84,7 +84,7 @@ LLVMBinaryRef LLVMCreateBinary(LLVMMemoryBufferRef MemBuf,
  * The binary file does not own its backing buffer.  It is the responsibilty
  * of the caller to free it with \c LLVMDisposeMemoryBuffer.
  */
-void LLVMDisposeBinary(LLVMBinaryRef BR);
+LLVM_FUNC_ABI void LLVMDisposeBinary(LLVMBinaryRef BR);
 
 /**
  * Retrieves a copy of the memory buffer associated with this object file.
@@ -95,14 +95,14 @@ void LLVMDisposeBinary(LLVMBinaryRef BR);
  *
  * @see llvm::object::getMemoryBufferRef
  */
-LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR);
+LLVM_FUNC_ABI LLVMMemoryBufferRef LLVMBinaryCopyMemoryBuffer(LLVMBinaryRef BR);
 
 /**
  * Retrieve the specific type of a binary.
  *
  * @see llvm::object::Binary::getType
  */
-LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR);
+LLVM_FUNC_ABI LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR);
 
 /*
  * For a Mach-O universal binary file, retrieves the object file corresponding
@@ -115,7 +115,7 @@ LLVMBinaryType LLVMBinaryGetType(LLVMBinaryRef BR);
  * It is the responsiblity of the caller to free the returned object file by
  * calling \c LLVMDisposeBinary.
  */
-LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR,
+LLVM_FUNC_ABI LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR,
                                                         const char *Arch,
                                                         size_t ArchLen,
                                                         char **ErrorMessage);
@@ -131,14 +131,14 @@ LLVMBinaryRef LLVMMachOUniversalBinaryCopyObjectForArch(LLVMBinaryRef BR,
  *
  * @see llvm::object::sections()
  */
-LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR);
+LLVM_FUNC_ABI LLVMSectionIteratorRef LLVMObjectFileCopySectionIterator(LLVMBinaryRef BR);
 
 /**
  * Returns whether the given section iterator is at the end.
  *
  * @see llvm::object::section_end
  */
-LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR,
+LLVM_FUNC_ABI LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR,
                                               LLVMSectionIteratorRef SI);
 
 /**
@@ -152,77 +152,77 @@ LLVMBool LLVMObjectFileIsSectionIteratorAtEnd(LLVMBinaryRef BR,
  *
  * @see llvm::object::symbols()
  */
-LLVMSymbolIteratorRef LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR);
+LLVM_FUNC_ABI LLVMSymbolIteratorRef LLVMObjectFileCopySymbolIterator(LLVMBinaryRef BR);
 
 /**
  * Returns whether the given symbol iterator is at the end.
  *
  * @see llvm::object::symbol_end
  */
-LLVMBool LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR,
+LLVM_FUNC_ABI LLVMBool LLVMObjectFileIsSymbolIteratorAtEnd(LLVMBinaryRef BR,
                                              LLVMSymbolIteratorRef SI);
 
-void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI);
+LLVM_FUNC_ABI void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI);
 
-void LLVMMoveToNextSection(LLVMSectionIteratorRef SI);
-void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
+LLVM_FUNC_ABI void LLVMMoveToNextSection(LLVMSectionIteratorRef SI);
+LLVM_FUNC_ABI void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
                                  LLVMSymbolIteratorRef Sym);
 
 // ObjectFile Symbol iterators
-void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI);
-void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI);
+LLVM_FUNC_ABI void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI);
+LLVM_FUNC_ABI void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI);
 
 // SectionRef accessors
-const char *LLVMGetSectionName(LLVMSectionIteratorRef SI);
-uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI);
-const char *LLVMGetSectionContents(LLVMSectionIteratorRef SI);
-uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI);
-LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI,
+LLVM_FUNC_ABI const char *LLVMGetSectionName(LLVMSectionIteratorRef SI);
+LLVM_FUNC_ABI uint64_t LLVMGetSectionSize(LLVMSectionIteratorRef SI);
+LLVM_FUNC_ABI const char *LLVMGetSectionContents(LLVMSectionIteratorRef SI);
+LLVM_FUNC_ABI uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI);
+LLVM_FUNC_ABI LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI,
                                  LLVMSymbolIteratorRef Sym);
 
 // Section Relocation iterators
-LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section);
-void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef RI);
-LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section,
+LLVM_FUNC_ABI LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section);
+LLVM_FUNC_ABI void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef RI);
+LLVM_FUNC_ABI LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section,
                                        LLVMRelocationIteratorRef RI);
-void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI);
+LLVM_FUNC_ABI void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI);
 
 
 // SymbolRef accessors
-const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI);
-uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI);
-uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI);
+LLVM_FUNC_ABI const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI);
+LLVM_FUNC_ABI uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI);
+LLVM_FUNC_ABI uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI);
 
 // RelocationRef accessors
-uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI);
-LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI);
-uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI);
+LLVM_FUNC_ABI uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI);
+LLVM_FUNC_ABI LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI);
+LLVM_FUNC_ABI uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI);
 // NOTE: Caller takes ownership of returned string of the two
 // following functions.
-const char *LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI);
-const char *LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI);
+LLVM_FUNC_ABI const char *LLVMGetRelocationTypeName(LLVMRelocationIteratorRef RI);
+LLVM_FUNC_ABI const char *LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI);
 
 /** Deprecated: Use LLVMBinaryRef instead. */
 typedef struct LLVMOpaqueObjectFile *LLVMObjectFileRef;
 
 /** Deprecated: Use LLVMCreateBinary instead. */
-LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf);
+LLVM_FUNC_ABI LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf);
 
 /** Deprecated: Use LLVMDisposeBinary instead. */
-void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile);
+LLVM_FUNC_ABI void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile);
 
 /** Deprecated: Use LLVMObjectFileCopySectionIterator instead. */
-LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile);
+LLVM_FUNC_ABI LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile);
 
 /** Deprecated: Use LLVMObjectFileIsSectionIteratorAtEnd instead. */
-LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
+LLVM_FUNC_ABI LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
                                     LLVMSectionIteratorRef SI);
 
 /** Deprecated: Use LLVMObjectFileCopySymbolIterator instead. */
-LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile);
+LLVM_FUNC_ABI LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile);
 
 /** Deprecated: Use LLVMObjectFileIsSymbolIteratorAtEnd instead. */
-LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile,
+LLVM_FUNC_ABI LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile,
                                    LLVMSymbolIteratorRef SI);
 /**
  * @}
diff --git a/llvm/include/llvm-c/Orc.h b/llvm/include/llvm-c/Orc.h
index 488394c060fabca..38235f48da2951a 100644
--- a/llvm/include/llvm-c/Orc.h
+++ b/llvm/include/llvm-c/Orc.h
@@ -70,7 +70,7 @@ typedef uint8_t LLVMJITSymbolTargetFlags;
 /**
  * Represents the linkage flags for a symbol definition.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   uint8_t GenericFlags;
   uint8_t TargetFlags;
 } LLVMJITSymbolFlags;
@@ -78,7 +78,7 @@ typedef struct {
 /**
  * Represents an evaluated symbol address and flags.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcExecutorAddress Address;
   LLVMJITSymbolFlags Flags;
 } LLVMJITEvaluatedSymbol;
@@ -107,7 +107,7 @@ typedef struct LLVMOrcOpaqueSymbolStringPoolEntry
 /**
  * Represents a pair of a symbol name and LLVMJITSymbolFlags.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcSymbolStringPoolEntryRef Name;
   LLVMJITSymbolFlags Flags;
 } LLVMOrcCSymbolFlagsMapPair;
@@ -121,7 +121,7 @@ typedef LLVMOrcCSymbolFlagsMapPair *LLVMOrcCSymbolFlagsMapPairs;
 /**
  * Represents a pair of a symbol name and an evaluated symbol.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcSymbolStringPoolEntryRef Name;
   LLVMJITEvaluatedSymbol Sym;
 } LLVMOrcCSymbolMapPair;
@@ -135,7 +135,7 @@ typedef LLVMOrcCSymbolMapPair *LLVMOrcCSymbolMapPairs;
 /**
  * Represents a SymbolAliasMapEntry
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcSymbolStringPoolEntryRef Name;
   LLVMJITSymbolFlags Flags;
 } LLVMOrcCSymbolAliasMapEntry;
@@ -143,7 +143,7 @@ typedef struct {
 /**
  * Represents a pair of a symbol name and SymbolAliasMapEntry.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcSymbolStringPoolEntryRef Name;
   LLVMOrcCSymbolAliasMapEntry Entry;
 } LLVMOrcCSymbolAliasMapPair;
@@ -163,7 +163,7 @@ typedef struct LLVMOrcOpaqueJITDylib *LLVMOrcJITDylibRef;
  * Represents a list of LLVMOrcSymbolStringPoolEntryRef and the associated
  * length.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcSymbolStringPoolEntryRef *Symbols;
   size_t Length;
 } LLVMOrcCSymbolsList;
@@ -171,7 +171,7 @@ typedef struct {
 /**
  * Represents a pair of a JITDylib and LLVMOrcCSymbolsList.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcJITDylibRef JD;
   LLVMOrcCSymbolsList Names;
 } LLVMOrcCDependenceMapPair;
@@ -207,7 +207,7 @@ typedef enum {
 /**
  * An element type for a JITDylib search order.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcJITDylibRef JD;
   LLVMOrcJITDylibLookupFlags JDLookupFlags;
 } LLVMOrcCJITDylibSearchOrderElement;
@@ -232,7 +232,7 @@ typedef enum {
 /**
  * An element type for a symbol lookup set.
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   LLVMOrcSymbolStringPoolEntryRef Name;
   LLVMOrcSymbolLookupFlags LookupFlags;
 } LLVMOrcCLookupSetElement;
@@ -480,7 +480,7 @@ typedef struct LLVMOrcOpaqueDumpObjects *LLVMOrcDumpObjectsRef;
  * requesting definitions from the JIT will typically be delivered a
  * FailureToMaterialize error instead).
  */
-void LLVMOrcExecutionSessionSetErrorReporter(
+LLVM_FUNC_ABI void LLVMOrcExecutionSessionSetErrorReporter(
     LLVMOrcExecutionSessionRef ES, LLVMOrcErrorReporterFunction ReportError,
     void *Ctx);
 
@@ -490,7 +490,7 @@ void LLVMOrcExecutionSessionSetErrorReporter(
  * Ownership of the pool remains with the ExecutionSession: The caller is
  * not required to free the pool.
  */
-LLVMOrcSymbolStringPoolRef
+LLVM_FUNC_ABI LLVMOrcSymbolStringPoolRef
 LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES);
 
 /**
@@ -503,7 +503,7 @@ LLVMOrcExecutionSessionGetSymbolStringPool(LLVMOrcExecutionSessionRef ES);
  * entries will have become unreferenced, e.g. after removing a module or
  * closing a JITDylib.
  */
-void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);
+LLVM_FUNC_ABI void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);
 
 /**
  * Intern a string in the ExecutionSession's SymbolStringPool and return a
@@ -517,7 +517,7 @@ void LLVMOrcSymbolStringPoolClearDeadEntries(LLVMOrcSymbolStringPoolRef SSP);
  *
  * Note that this function does not perform linker-mangling on the string.
  */
-LLVMOrcSymbolStringPoolEntryRef
+LLVM_FUNC_ABI LLVMOrcSymbolStringPoolEntryRef
 LLVMOrcExecutionSessionIntern(LLVMOrcExecutionSessionRef ES, const char *Name);
 
 /**
@@ -566,7 +566,7 @@ typedef void (*LLVMOrcExecutionSessionLookupHandleResultFunction)(
  *
  * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
  */
-void LLVMOrcExecutionSessionLookup(
+LLVM_FUNC_ABI void LLVMOrcExecutionSessionLookup(
     LLVMOrcExecutionSessionRef ES, LLVMOrcLookupKind K,
     LLVMOrcCJITDylibSearchOrder SearchOrder, size_t SearchOrderSize,
     LLVMOrcCLookupSet Symbols, size_t SymbolsSize,
@@ -575,49 +575,49 @@ void LLVMOrcExecutionSessionLookup(
 /**
  * Increments the ref-count for a SymbolStringPool entry.
  */
-void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
+LLVM_FUNC_ABI void LLVMOrcRetainSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
 
 /**
  * Reduces the ref-count for of a SymbolStringPool entry.
  */
-void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
+LLVM_FUNC_ABI void LLVMOrcReleaseSymbolStringPoolEntry(LLVMOrcSymbolStringPoolEntryRef S);
 
 /**
  * Return the c-string for the given symbol. This string will remain valid until
  * the entry is freed (once all LLVMOrcSymbolStringPoolEntryRefs have been
  * released).
  */
-const char *LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S);
+LLVM_FUNC_ABI const char *LLVMOrcSymbolStringPoolEntryStr(LLVMOrcSymbolStringPoolEntryRef S);
 
 /**
  * Reduces the ref-count of a ResourceTracker.
  */
-void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT);
+LLVM_FUNC_ABI void LLVMOrcReleaseResourceTracker(LLVMOrcResourceTrackerRef RT);
 
 /**
  * Transfers tracking of all resources associated with resource tracker SrcRT
  * to resource tracker DstRT.
  */
-void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT,
+LLVM_FUNC_ABI void LLVMOrcResourceTrackerTransferTo(LLVMOrcResourceTrackerRef SrcRT,
                                       LLVMOrcResourceTrackerRef DstRT);
 
 /**
  * Remove all resources associated with the given tracker. See
  * ResourceTracker::remove().
  */
-LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT);
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcResourceTrackerRemove(LLVMOrcResourceTrackerRef RT);
 
 /**
  * Dispose of a JITDylib::DefinitionGenerator. This should only be called if
  * ownership has not been passed to a JITDylib (e.g. because some error
  * prevented the client from calling LLVMOrcJITDylibAddGenerator).
  */
-void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG);
+LLVM_FUNC_ABI void LLVMOrcDisposeDefinitionGenerator(LLVMOrcDefinitionGeneratorRef DG);
 
 /**
  * Dispose of a MaterializationUnit.
  */
-void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU);
+LLVM_FUNC_ABI void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU);
 
 /**
  * Create a custom MaterializationUnit.
@@ -652,7 +652,7 @@ void LLVMOrcDisposeMaterializationUnit(LLVMOrcMaterializationUnitRef MU);
  * either passing it to a JITDylib (via LLVMOrcJITDylibDefine) or disposing
  * of it by calling LLVMOrcDisposeMaterializationUnit.
  */
-LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(
+LLVM_FUNC_ABI LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(
     const char *Name, void *Ctx, LLVMOrcCSymbolFlagsMapPairs Syms,
     size_t NumSyms, LLVMOrcSymbolStringPoolEntryRef InitSym,
     LLVMOrcMaterializationUnitMaterializeFunction Materialize,
@@ -680,7 +680,7 @@ LLVMOrcMaterializationUnitRef LLVMOrcCreateCustomMaterializationUnit(
  * If a client wishes to reuse elements of the Sym array after this call they
  * must explicitly retain each of the elements for themselves.
  */
-LLVMOrcMaterializationUnitRef
+LLVM_FUNC_ABI LLVMOrcMaterializationUnitRef
 LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);
 
 /**
@@ -704,7 +704,7 @@ LLVMOrcAbsoluteSymbols(LLVMOrcCSymbolMapPairs Syms, size_t NumPairs);
  * If a client wishes to reuse elements of the CallableAliases array after this call they
  * must explicitly retain each of the elements for themselves.
  */
-LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(
+LLVM_FUNC_ABI LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(
     LLVMOrcLazyCallThroughManagerRef LCTM, LLVMOrcIndirectStubsManagerRef ISM,
     LLVMOrcJITDylibRef SourceRef, LLVMOrcCSymbolAliasMapPairs CallableAliases,
     size_t NumPairs);
@@ -719,19 +719,19 @@ LLVMOrcMaterializationUnitRef LLVMOrcLazyReexports(
  * LLVMOrcMaterializationResponsibilityNotifyEmitted) or failed (via
  * LLVMOrcMaterializationResponsibilityFailMaterialization).
  */
-void LLVMOrcDisposeMaterializationResponsibility(
+LLVM_FUNC_ABI void LLVMOrcDisposeMaterializationResponsibility(
     LLVMOrcMaterializationResponsibilityRef MR);
 
 /**
  * Returns the target JITDylib that these symbols are being materialized into.
  */
-LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib(
+LLVM_FUNC_ABI LLVMOrcJITDylibRef LLVMOrcMaterializationResponsibilityGetTargetDylib(
     LLVMOrcMaterializationResponsibilityRef MR);
 
 /**
  * Returns the ExecutionSession for this MaterializationResponsibility.
  */
-LLVMOrcExecutionSessionRef
+LLVM_FUNC_ABI LLVMOrcExecutionSessionRef
 LLVMOrcMaterializationResponsibilityGetExecutionSession(
     LLVMOrcMaterializationResponsibilityRef MR);
 
@@ -745,7 +745,7 @@ LLVMOrcMaterializationResponsibilityGetExecutionSession(
  * MaterializationResponsibility requires the caller to retain the symbols
  * explicitly.
  */
-LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(
+LLVM_FUNC_ABI LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(
     LLVMOrcMaterializationResponsibilityRef MR, size_t *NumPairs);
 
 /**
@@ -753,7 +753,7 @@ LLVMOrcCSymbolFlagsMapPairs LLVMOrcMaterializationResponsibilityGetSymbols(
  *
  * Does not release the entries themselves.
  */
-void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs);
+LLVM_FUNC_ABI void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs);
 
 /**
  * Returns the initialization pseudo-symbol, if any. This symbol will also
@@ -763,7 +763,7 @@ void LLVMOrcDisposeCSymbolFlagsMap(LLVMOrcCSymbolFlagsMapPairs Pairs);
  * The returned symbol is not retained over any mutating operation of the
  * MaterializationResponsbility or beyond the lifetime thereof.
  */
-LLVMOrcSymbolStringPoolEntryRef
+LLVM_FUNC_ABI LLVMOrcSymbolStringPoolEntryRef
 LLVMOrcMaterializationResponsibilityGetInitializerSymbol(
     LLVMOrcMaterializationResponsibilityRef MR);
 
@@ -773,7 +773,7 @@ LLVMOrcMaterializationResponsibilityGetInitializerSymbol(
  * information can be used to return responsibility for unrequested symbols
  * back to the JITDylib via the delegate method.
  */
-LLVMOrcSymbolStringPoolEntryRef *
+LLVM_FUNC_ABI LLVMOrcSymbolStringPoolEntryRef *
 LLVMOrcMaterializationResponsibilityGetRequestedSymbols(
     LLVMOrcMaterializationResponsibilityRef MR, size_t *NumSymbols);
 
@@ -782,7 +782,7 @@ LLVMOrcMaterializationResponsibilityGetRequestedSymbols(
  *
  * Does not release the symbols themselves.
  */
-void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols);
+LLVM_FUNC_ABI void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols);
 
 /**
  * Notifies the target JITDylib that the given symbols have been resolved.
@@ -800,7 +800,7 @@ void LLVMOrcDisposeSymbols(LLVMOrcSymbolStringPoolEntryRef *Symbols);
  * MaterializationResponsibiility then this method is guaranteed to return
  * LLVMErrorSuccess.
  */
-LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(
     LLVMOrcMaterializationResponsibilityRef MR, LLVMOrcCSymbolMapPairs Symbols,
     size_t NumPairs);
 
@@ -817,7 +817,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyResolved(
  * MaterializationResponsibiility then this method is guaranteed to return
  * LLVMErrorSuccess.
  */
-LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(
     LLVMOrcMaterializationResponsibilityRef MR);
 
 /**
@@ -833,7 +833,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted(
  * additional symbols at materialization time (e.g. stubs, compile
  * callbacks, metadata)
  */
-LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(
     LLVMOrcMaterializationResponsibilityRef MR,
     LLVMOrcCSymbolFlagsMapPairs Pairs, size_t NumPairs);
 
@@ -844,7 +844,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityDefineMaterializing(
  * from the target JITDylib, and send an error to any queries waiting on
  * these symbols.
  */
-void LLVMOrcMaterializationResponsibilityFailMaterialization(
+LLVM_FUNC_ABI void LLVMOrcMaterializationResponsibilityFailMaterialization(
     LLVMOrcMaterializationResponsibilityRef MR);
 
 /**
@@ -854,7 +854,7 @@ void LLVMOrcMaterializationResponsibilityFailMaterialization(
  * by introspecting which symbols have actually been looked up and
  * materializing only those).
  */
-LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(
     LLVMOrcMaterializationResponsibilityRef MR,
     LLVMOrcMaterializationUnitRef MU);
 
@@ -866,7 +866,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityReplace(
  * The caller retains responsibility of the the passed
  * MaterializationResponsibility.
  */
-LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(
     LLVMOrcMaterializationResponsibilityRef MR,
     LLVMOrcSymbolStringPoolEntryRef *Symbols, size_t NumSymbols,
     LLVMOrcMaterializationResponsibilityRef *Result);
@@ -889,7 +889,7 @@ LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate(
  * The client is still responsible for deleting the Dependencies.Names array
  * itself.
  */
-void LLVMOrcMaterializationResponsibilityAddDependencies(
+LLVM_FUNC_ABI void LLVMOrcMaterializationResponsibilityAddDependencies(
     LLVMOrcMaterializationResponsibilityRef MR,
     LLVMOrcSymbolStringPoolEntryRef Name,
     LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs);
@@ -899,7 +899,7 @@ void LLVMOrcMaterializationResponsibilityAddDependencies(
  * responsible for. See LLVMOrcMaterializationResponsibilityAddDependencies for
  * notes about memory responsibility.
  */
-void LLVMOrcMaterializationResponsibilityAddDependenciesForAll(
+LLVM_FUNC_ABI void LLVMOrcMaterializationResponsibilityAddDependenciesForAll(
     LLVMOrcMaterializationResponsibilityRef MR,
     LLVMOrcCDependenceMapPairs Dependencies, size_t NumPairs);
 
@@ -912,7 +912,7 @@ void LLVMOrcMaterializationResponsibilityAddDependenciesForAll(
  * This call does not install any library code or symbols into the newly
  * created JITDylib. The client is responsible for all configuration.
  */
-LLVMOrcJITDylibRef
+LLVM_FUNC_ABI LLVMOrcJITDylibRef
 LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES,
                                           const char *Name);
 
@@ -928,7 +928,7 @@ LLVMOrcExecutionSessionCreateBareJITDylib(LLVMOrcExecutionSessionRef ES,
  * call is equivalent to LLVMExecutionSessionRefCreateBareJITDylib and will
  * always return success.
  */
-LLVMErrorRef
+LLVM_FUNC_ABI LLVMErrorRef
 LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES,
                                       LLVMOrcJITDylibRef *Result,
                                       const char *Name);
@@ -937,7 +937,7 @@ LLVMOrcExecutionSessionCreateJITDylib(LLVMOrcExecutionSessionRef ES,
  * Returns the JITDylib with the given name, or NULL if no such JITDylib
  * exists.
  */
-LLVMOrcJITDylibRef
+LLVM_FUNC_ABI LLVMOrcJITDylibRef
 LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES,
                                          const char *Name);
 
@@ -946,7 +946,7 @@ LLVMOrcExecutionSessionGetJITDylibByName(LLVMOrcExecutionSessionRef ES,
  * The tracker is returned with an initial ref-count of 1, and must be released
  * with LLVMOrcReleaseResourceTracker when no longer needed.
  */
-LLVMOrcResourceTrackerRef
+LLVM_FUNC_ABI LLVMOrcResourceTrackerRef
 LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD);
 
 /**
@@ -954,7 +954,7 @@ LLVMOrcJITDylibCreateResourceTracker(LLVMOrcJITDylibRef JD);
  * This operation will increase the retain count of the tracker: Clients should
  * call LLVMOrcReleaseResourceTracker when the result is no longer needed.
  */
-LLVMOrcResourceTrackerRef
+LLVM_FUNC_ABI LLVMOrcResourceTrackerRef
 LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD);
 
 /**
@@ -964,14 +964,14 @@ LLVMOrcJITDylibGetDefaultResourceTracker(LLVMOrcJITDylibRef JD);
  * If the operation fails then ownership remains with the caller who should
  * call LLVMOrcDisposeMaterializationUnit to destroy it.
  */
-LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcJITDylibDefine(LLVMOrcJITDylibRef JD,
                                    LLVMOrcMaterializationUnitRef MU);
 
 /**
  * Calls remove on all trackers associated with this JITDylib, see
  * JITDylib::clear().
  */
-LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD);
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD);
 
 /**
  * Add a DefinitionGenerator to the given JITDylib.
@@ -979,7 +979,7 @@ LLVMErrorRef LLVMOrcJITDylibClear(LLVMOrcJITDylibRef JD);
  * The JITDylib will take ownership of the given generator: The client is no
  * longer responsible for managing its memory.
  */
-void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD,
+LLVM_FUNC_ABI void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD,
                                  LLVMOrcDefinitionGeneratorRef DG);
 
 /**
@@ -995,7 +995,7 @@ void LLVMOrcJITDylibAddGenerator(LLVMOrcJITDylibRef JD,
  * Dispose is the disposal function for Ctx. This argument is permitted to be
  * null (in which case the client is responsible for the lifetime of Ctx).
  */
-LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(
+LLVM_FUNC_ABI LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(
     LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction F, void *Ctx,
     LLVMOrcDisposeCAPIDefinitionGeneratorFunction Dispose);
 
@@ -1003,7 +1003,7 @@ LLVMOrcDefinitionGeneratorRef LLVMOrcCreateCustomCAPIDefinitionGenerator(
  * Continue a lookup that was suspended in a generator (see
  * LLVMOrcCAPIDefinitionGeneratorTryToGenerateFunction).
  */
-void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S,
+LLVM_FUNC_ABI void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S,
                                       LLVMErrorRef Err);
 
 /**
@@ -1024,7 +1024,7 @@ void LLVMOrcLookupStateContinueLookup(LLVMOrcLookupStateRef S,
  * function is the full mangled symbol: The client is responsible for stripping
  * the global prefix if present.
  */
-LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
     LLVMOrcDefinitionGeneratorRef *Result, char GlobalPrefx,
     LLVMOrcSymbolPredicate Filter, void *FilterCtx);
 
@@ -1049,7 +1049,7 @@ LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForProcess(
  * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
  * 
  */
-LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(
     LLVMOrcDefinitionGeneratorRef *Result, const char *FileName,
     char GlobalPrefix, LLVMOrcSymbolPredicate Filter, void *FilterCtx);
 
@@ -1067,7 +1067,7 @@ LLVMErrorRef LLVMOrcCreateDynamicLibrarySearchGeneratorForPath(
  * THIS API IS EXPERIMENTAL AND LIKELY TO CHANGE IN THE NEAR FUTURE!
  * 
  */
-LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(
     LLVMOrcDefinitionGeneratorRef *Result, LLVMOrcObjectLayerRef ObjLayer,
     const char *FileName, const char *TargetTriple);
 
@@ -1079,18 +1079,18 @@ LLVMErrorRef LLVMOrcCreateStaticLibrarySearchGeneratorForPath(
  * need to refer to it directly. Other references (e.g. from ThreadSafeModules)
  * will keep the data alive as long as it is needed.
  */
-LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void);
+LLVM_FUNC_ABI LLVMOrcThreadSafeContextRef LLVMOrcCreateNewThreadSafeContext(void);
 
 /**
  * Get a reference to the wrapped LLVMContext.
  */
-LLVMContextRef
+LLVM_FUNC_ABI LLVMContextRef
 LLVMOrcThreadSafeContextGetContext(LLVMOrcThreadSafeContextRef TSCtx);
 
 /**
  * Dispose of a ThreadSafeContext.
  */
-void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx);
+LLVM_FUNC_ABI void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx);
 
 /**
  * Create a ThreadSafeModule wrapper around the given LLVM module. This takes
@@ -1102,7 +1102,7 @@ void LLVMOrcDisposeThreadSafeContext(LLVMOrcThreadSafeContextRef TSCtx);
  * responsible for it. If it is not transferred to the JIT then the client
  * should call LLVMOrcDisposeThreadSafeModule to dispose of it.
  */
-LLVMOrcThreadSafeModuleRef
+LLVM_FUNC_ABI LLVMOrcThreadSafeModuleRef
 LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M,
                                  LLVMOrcThreadSafeContextRef TSCtx);
 
@@ -1111,12 +1111,12 @@ LLVMOrcCreateNewThreadSafeModule(LLVMModuleRef M,
  * not been passed to LLJIT (e.g. because some error prevented the client from
  * adding this to the JIT).
  */
-void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM);
+LLVM_FUNC_ABI void LLVMOrcDisposeThreadSafeModule(LLVMOrcThreadSafeModuleRef TSM);
 
 /**
  * Apply the given function to the module contained in this ThreadSafeModule.
  */
-LLVMErrorRef
+LLVM_FUNC_ABI LLVMErrorRef
 LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM,
                                     LLVMOrcGenericIRModuleOperationFunction F,
                                     void *Ctx);
@@ -1129,7 +1129,7 @@ LLVMOrcThreadSafeModuleWithModuleDo(LLVMOrcThreadSafeModuleRef TSM,
  * LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling
  * LLVMOrcDisposeJITTargetMachineBuilder.
  */
-LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(
     LLVMOrcJITTargetMachineBuilderRef *Result);
 
 /**
@@ -1141,13 +1141,13 @@ LLVMErrorRef LLVMOrcJITTargetMachineBuilderDetectHost(
  * LLVMOrcLLJITBuilderSetJITTargetMachineBuilder) or disposed of by calling
  * LLVMOrcDisposeJITTargetMachineBuilder.
  */
-LLVMOrcJITTargetMachineBuilderRef
+LLVM_FUNC_ABI LLVMOrcJITTargetMachineBuilderRef
 LLVMOrcJITTargetMachineBuilderCreateFromTargetMachine(LLVMTargetMachineRef TM);
 
 /**
  * Dispose of a JITTargetMachineBuilder.
  */
-void LLVMOrcDisposeJITTargetMachineBuilder(
+LLVM_FUNC_ABI void LLVMOrcDisposeJITTargetMachineBuilder(
     LLVMOrcJITTargetMachineBuilderRef JTMB);
 
 /**
@@ -1156,14 +1156,14 @@ void LLVMOrcDisposeJITTargetMachineBuilder(
  * The caller owns the resulting string as must dispose of it by calling
  * LLVMDisposeMessage
  */
-char *LLVMOrcJITTargetMachineBuilderGetTargetTriple(
+LLVM_FUNC_ABI char *LLVMOrcJITTargetMachineBuilderGetTargetTriple(
     LLVMOrcJITTargetMachineBuilderRef JTMB);
 
 /**
  * Sets the target triple for the given JITTargetMachineBuilder to the given
  * string.
  */
-void LLVMOrcJITTargetMachineBuilderSetTargetTriple(
+LLVM_FUNC_ABI void LLVMOrcJITTargetMachineBuilderSetTargetTriple(
     LLVMOrcJITTargetMachineBuilderRef JTMB, const char *TargetTriple);
 
 /**
@@ -1177,7 +1177,7 @@ void LLVMOrcJITTargetMachineBuilderSetTargetTriple(
  * Resources associated with the given object will be tracked by the given
  * JITDylib's default ResourceTracker.
  */
-LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer,
                                              LLVMOrcJITDylibRef JD,
                                              LLVMMemoryBufferRef ObjBuffer);
 
@@ -1192,7 +1192,7 @@ LLVMErrorRef LLVMOrcObjectLayerAddObjectFile(LLVMOrcObjectLayerRef ObjLayer,
  * Resources associated with the given object will be tracked by
  * ResourceTracker RT.
  */
-LLVMErrorRef
+LLVM_FUNC_ABI LLVMErrorRef
 LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer,
                                       LLVMOrcResourceTrackerRef RT,
                                       LLVMMemoryBufferRef ObjBuffer);
@@ -1203,16 +1203,16 @@ LLVMOrcObjectLayerAddObjectFileWithRT(LLVMOrcObjectLayerRef ObjLayer,
  * Ownership of the responsibility object and object buffer pass to this
  * function. The client is not responsible for cleanup.
  */
-void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer,
+LLVM_FUNC_ABI void LLVMOrcObjectLayerEmit(LLVMOrcObjectLayerRef ObjLayer,
                             LLVMOrcMaterializationResponsibilityRef R,
                             LLVMMemoryBufferRef ObjBuffer);
 
 /**
  * Dispose of an ObjectLayer.
  */
-void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer);
+LLVM_FUNC_ABI void LLVMOrcDisposeObjectLayer(LLVMOrcObjectLayerRef ObjLayer);
 
-void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer,
+LLVM_FUNC_ABI void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer,
                                  LLVMOrcMaterializationResponsibilityRef MR,
                                  LLVMOrcThreadSafeModuleRef TSM);
 
@@ -1220,14 +1220,14 @@ void LLVMOrcIRTransformLayerEmit(LLVMOrcIRTransformLayerRef IRTransformLayer,
  * Set the transform function of the provided transform layer, passing through a
  * pointer to user provided context.
  */
-void LLVMOrcIRTransformLayerSetTransform(
+LLVM_FUNC_ABI void LLVMOrcIRTransformLayerSetTransform(
     LLVMOrcIRTransformLayerRef IRTransformLayer,
     LLVMOrcIRTransformLayerTransformFunction TransformFunction, void *Ctx);
 
 /**
  * Set the transform function on an LLVMOrcObjectTransformLayer.
  */
-void LLVMOrcObjectTransformLayerSetTransform(
+LLVM_FUNC_ABI void LLVMOrcObjectTransformLayerSetTransform(
     LLVMOrcObjectTransformLayerRef ObjTransformLayer,
     LLVMOrcObjectTransformLayerTransformFunction TransformFunction, void *Ctx);
 
@@ -1237,15 +1237,15 @@ void LLVMOrcObjectTransformLayerSetTransform(
  * The resulting IndirectStubsManager is owned by the client
  * and must be disposed of by calling LLVMOrcDisposeDisposeIndirectStubsManager.
  */
-LLVMOrcIndirectStubsManagerRef
+LLVM_FUNC_ABI LLVMOrcIndirectStubsManagerRef
 LLVMOrcCreateLocalIndirectStubsManager(const char *TargetTriple);
 
 /**
  * Dispose of an IndirectStubsManager.
  */
-void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM);
+LLVM_FUNC_ABI void LLVMOrcDisposeIndirectStubsManager(LLVMOrcIndirectStubsManagerRef ISM);
 
-LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(
     const char *TargetTriple, LLVMOrcExecutionSessionRef ES,
     LLVMOrcJITTargetAddress ErrorHandlerAddr,
     LLVMOrcLazyCallThroughManagerRef *LCTM);
@@ -1253,7 +1253,7 @@ LLVMErrorRef LLVMOrcCreateLocalLazyCallThroughManager(
 /**
  * Dispose of an LazyCallThroughManager.
  */
-void LLVMOrcDisposeLazyCallThroughManager(
+LLVM_FUNC_ABI void LLVMOrcDisposeLazyCallThroughManager(
     LLVMOrcLazyCallThroughManagerRef LCTM);
 
 /**
@@ -1270,18 +1270,18 @@ void LLVMOrcDisposeLazyCallThroughManager(
  * <ident>.2.o, <ident>.3.o, and so on). IdentifierOverride should not contain
  * an extension, as a .o suffix will be added by DumpObjects.
  */
-LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir,
+LLVM_FUNC_ABI LLVMOrcDumpObjectsRef LLVMOrcCreateDumpObjects(const char *DumpDir,
                                                const char *IdentifierOverride);
 
 /**
  * Dispose of a DumpObjects instance.
  */
-void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects);
+LLVM_FUNC_ABI void LLVMOrcDisposeDumpObjects(LLVMOrcDumpObjectsRef DumpObjects);
 
 /**
  * Dump the contents of the given MemoryBuffer.
  */
-LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects,
+LLVM_FUNC_ABI LLVMErrorRef LLVMOrcDumpObjects_CallOperator(LLVMOrcDumpObjectsRef DumpObjects,
                                              LLVMMemoryBufferRef *ObjBuffer);
 
 /**
diff --git a/llvm/include/llvm-c/OrcEE.h b/llvm/include/llvm-c/OrcEE.h
index 1b7a8dbe2bb16a1..830d71c1da0d760 100644
--- a/llvm/include/llvm-c/OrcEE.h
+++ b/llvm/include/llvm-c/OrcEE.h
@@ -47,7 +47,7 @@ typedef void (*LLVMMemoryManagerNotifyTerminatingCallback)(void *CtxCtx);
  * Create a RTDyldObjectLinkingLayer instance using the standard
  * SectionMemoryManager for memory management.
  */
-LLVMOrcObjectLayerRef
+LLVM_FUNC_ABI LLVMOrcObjectLayerRef
 LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(
     LLVMOrcExecutionSessionRef ES);
 
@@ -75,7 +75,7 @@ LLVMOrcCreateRTDyldObjectLinkingLayerWithSectionMemoryManager(
  * This scheme simply reuses the CreateContextCtx pointer as the one-and-only
  * allocation context.
  */
-LLVMOrcObjectLayerRef
+LLVM_FUNC_ABI LLVMOrcObjectLayerRef
 LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks(
     LLVMOrcExecutionSessionRef ES, void *CreateContextCtx,
     LLVMMemoryManagerCreateContextCallback CreateContext,
@@ -91,7 +91,7 @@ LLVMOrcCreateRTDyldObjectLinkingLayerWithMCJITMemoryManagerLikeCallbacks(
  * Note: Layer must be an RTDyldObjectLinkingLayer instance or
  * behavior is undefined.
  */
-void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(
+LLVM_FUNC_ABI void LLVMOrcRTDyldObjectLinkingLayerRegisterJITEventListener(
     LLVMOrcObjectLayerRef RTDyldObjLinkingLayer,
     LLVMJITEventListenerRef Listener);
 
diff --git a/llvm/include/llvm-c/Remarks.h b/llvm/include/llvm-c/Remarks.h
index e19b604829f2714..fb6365ebc86596f 100644
--- a/llvm/include/llvm-c/Remarks.h
+++ b/llvm/include/llvm-c/Remarks.h
@@ -62,14 +62,14 @@ typedef struct LLVMRemarkOpaqueString *LLVMRemarkStringRef;
  *
  * \since REMARKS_API_VERSION=0
  */
-extern const char *LLVMRemarkStringGetData(LLVMRemarkStringRef String);
+LLVM_FUNC_ABI extern const char *LLVMRemarkStringGetData(LLVMRemarkStringRef String);
 
 /**
  * Returns the size of the string.
  *
  * \since REMARKS_API_VERSION=0
  */
-extern uint32_t LLVMRemarkStringGetLen(LLVMRemarkStringRef String);
+LLVM_FUNC_ABI extern uint32_t LLVMRemarkStringGetLen(LLVMRemarkStringRef String);
 
 /**
  * DebugLoc containing File, Line and Column.
@@ -83,7 +83,7 @@ typedef struct LLVMRemarkOpaqueDebugLoc *LLVMRemarkDebugLocRef;
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkStringRef
+LLVM_FUNC_ABI extern LLVMRemarkStringRef
 LLVMRemarkDebugLocGetSourceFilePath(LLVMRemarkDebugLocRef DL);
 
 /**
@@ -91,14 +91,14 @@ LLVMRemarkDebugLocGetSourceFilePath(LLVMRemarkDebugLocRef DL);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern uint32_t LLVMRemarkDebugLocGetSourceLine(LLVMRemarkDebugLocRef DL);
+LLVM_FUNC_ABI extern uint32_t LLVMRemarkDebugLocGetSourceLine(LLVMRemarkDebugLocRef DL);
 
 /**
  * Return the column in the source file for a debug location.
  *
  * \since REMARKS_API_VERSION=0
  */
-extern uint32_t LLVMRemarkDebugLocGetSourceColumn(LLVMRemarkDebugLocRef DL);
+LLVM_FUNC_ABI extern uint32_t LLVMRemarkDebugLocGetSourceColumn(LLVMRemarkDebugLocRef DL);
 
 /**
  * Element of the "Args" list. The key might give more information about what
@@ -115,14 +115,14 @@ typedef struct LLVMRemarkOpaqueArg *LLVMRemarkArgRef;
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkStringRef LLVMRemarkArgGetKey(LLVMRemarkArgRef Arg);
+LLVM_FUNC_ABI extern LLVMRemarkStringRef LLVMRemarkArgGetKey(LLVMRemarkArgRef Arg);
 
 /**
  * Returns the value of an argument. This is a string that can contain newlines.
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkStringRef LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg);
+LLVM_FUNC_ABI extern LLVMRemarkStringRef LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg);
 
 /**
  * Returns the debug location that is attached to the value of this argument.
@@ -131,7 +131,7 @@ extern LLVMRemarkStringRef LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc(LLVMRemarkArgRef Arg);
+LLVM_FUNC_ABI extern LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc(LLVMRemarkArgRef Arg);
 
 /**
  * A remark emitted by the compiler.
@@ -145,7 +145,7 @@ typedef struct LLVMRemarkOpaqueEntry *LLVMRemarkEntryRef;
  *
  * \since REMARKS_API_VERSION=0
  */
-extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark);
+LLVM_FUNC_ABI extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark);
 
 /**
  * The type of the remark. For example, it can allow users to only keep the
@@ -153,14 +153,14 @@ extern void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern enum LLVMRemarkType LLVMRemarkEntryGetType(LLVMRemarkEntryRef Remark);
+LLVM_FUNC_ABI extern enum LLVMRemarkType LLVMRemarkEntryGetType(LLVMRemarkEntryRef Remark);
 
 /**
  * Get the name of the pass that emitted this remark.
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkStringRef
+LLVM_FUNC_ABI extern LLVMRemarkStringRef
 LLVMRemarkEntryGetPassName(LLVMRemarkEntryRef Remark);
 
 /**
@@ -168,7 +168,7 @@ LLVMRemarkEntryGetPassName(LLVMRemarkEntryRef Remark);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkStringRef
+LLVM_FUNC_ABI extern LLVMRemarkStringRef
 LLVMRemarkEntryGetRemarkName(LLVMRemarkEntryRef Remark);
 
 /**
@@ -176,7 +176,7 @@ LLVMRemarkEntryGetRemarkName(LLVMRemarkEntryRef Remark);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkStringRef
+LLVM_FUNC_ABI extern LLVMRemarkStringRef
 LLVMRemarkEntryGetFunctionName(LLVMRemarkEntryRef Remark);
 
 /**
@@ -186,7 +186,7 @@ LLVMRemarkEntryGetFunctionName(LLVMRemarkEntryRef Remark);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkDebugLocRef
+LLVM_FUNC_ABI extern LLVMRemarkDebugLocRef
 LLVMRemarkEntryGetDebugLoc(LLVMRemarkEntryRef Remark);
 
 /**
@@ -196,14 +196,14 @@ LLVMRemarkEntryGetDebugLoc(LLVMRemarkEntryRef Remark);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern uint64_t LLVMRemarkEntryGetHotness(LLVMRemarkEntryRef Remark);
+LLVM_FUNC_ABI extern uint64_t LLVMRemarkEntryGetHotness(LLVMRemarkEntryRef Remark);
 
 /**
  * The number of arguments the remark holds.
  *
  * \since REMARKS_API_VERSION=0
  */
-extern uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark);
+LLVM_FUNC_ABI extern uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark);
 
 /**
  * Get a new iterator to iterate over a remark's argument.
@@ -214,7 +214,7 @@ extern uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark);
+LLVM_FUNC_ABI extern LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark);
 
 /**
  * Get the next argument in \p Remark from the position of \p It.
@@ -225,7 +225,7 @@ extern LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkArgRef LLVMRemarkEntryGetNextArg(LLVMRemarkArgRef It,
+LLVM_FUNC_ABI extern LLVMRemarkArgRef LLVMRemarkEntryGetNextArg(LLVMRemarkArgRef It,
                                                   LLVMRemarkEntryRef Remark);
 
 typedef struct LLVMRemarkOpaqueParser *LLVMRemarkParserRef;
@@ -241,7 +241,7 @@ typedef struct LLVMRemarkOpaqueParser *LLVMRemarkParserRef;
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf,
+LLVM_FUNC_ABI extern LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf,
                                                       uint64_t Size);
 
 /**
@@ -255,7 +255,7 @@ extern LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf,
  *
  * \since REMARKS_API_VERSION=1
  */
-extern LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void *Buf,
+LLVM_FUNC_ABI extern LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void *Buf,
                                                            uint64_t Size);
 
 /**
@@ -300,14 +300,14 @@ extern LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void *Buf,
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMRemarkEntryRef LLVMRemarkParserGetNext(LLVMRemarkParserRef Parser);
+LLVM_FUNC_ABI extern LLVMRemarkEntryRef LLVMRemarkParserGetNext(LLVMRemarkParserRef Parser);
 
 /**
  * Returns `1` if the parser encountered an error while parsing the buffer.
  *
  * \since REMARKS_API_VERSION=0
  */
-extern LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser);
+LLVM_FUNC_ABI extern LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser);
 
 /**
  * Returns a null-terminated string containing an error message.
@@ -320,21 +320,21 @@ extern LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser);
  *
  * \since REMARKS_API_VERSION=0
  */
-extern const char *LLVMRemarkParserGetErrorMessage(LLVMRemarkParserRef Parser);
+LLVM_FUNC_ABI extern const char *LLVMRemarkParserGetErrorMessage(LLVMRemarkParserRef Parser);
 
 /**
  * Releases all the resources used by \p Parser.
  *
  * \since REMARKS_API_VERSION=0
  */
-extern void LLVMRemarkParserDispose(LLVMRemarkParserRef Parser);
+LLVM_FUNC_ABI extern void LLVMRemarkParserDispose(LLVMRemarkParserRef Parser);
 
 /**
  * Returns the version of the remarks library.
  *
  * \since REMARKS_API_VERSION=0
  */
-extern uint32_t LLVMRemarkVersion(void);
+LLVM_FUNC_ABI extern uint32_t LLVMRemarkVersion(void);
 
 /**
  * @} // endgoup LLVMCREMARKS
diff --git a/llvm/include/llvm-c/Support.h b/llvm/include/llvm-c/Support.h
index 41feb25f66b3115..6b81b61dbb92e6a 100644
--- a/llvm/include/llvm-c/Support.h
+++ b/llvm/include/llvm-c/Support.h
@@ -33,7 +33,7 @@ LLVM_C_EXTERN_C_BEGIN
  *
  * @see sys::DynamicLibrary::LoadLibraryPermanently()
   */
-LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
+LLVM_FUNC_ABI LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
 
 /**
  * This function parses the given arguments using the LLVM command line parser.
@@ -43,7 +43,7 @@ LLVMBool LLVMLoadLibraryPermanently(const char* Filename);
  *
  * @see llvm::cl::ParseCommandLineOptions()
  */
-void LLVMParseCommandLineOptions(int argc, const char *const *argv,
+LLVM_FUNC_ABI void LLVMParseCommandLineOptions(int argc, const char *const *argv,
                                  const char *Overview);
 
 /**
@@ -53,7 +53,7 @@ void LLVMParseCommandLineOptions(int argc, const char *const *argv,
  *
  * @see sys::DynamicLibrary::SearchForAddressOfSymbol()
  */
-void *LLVMSearchForAddressOfSymbol(const char *symbolName);
+LLVM_FUNC_ABI void *LLVMSearchForAddressOfSymbol(const char *symbolName);
 
 /**
  * This functions permanently adds the symbol \p symbolName with the
@@ -62,7 +62,7 @@ void *LLVMSearchForAddressOfSymbol(const char *symbolName);
  *
  * @see sys::DynamicLibrary::AddSymbol()
  */
-void LLVMAddSymbol(const char *symbolName, void *symbolValue);
+LLVM_FUNC_ABI void LLVMAddSymbol(const char *symbolName, void *symbolValue);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/Target.h b/llvm/include/llvm-c/Target.h
index 53baef1da485b65..e9b3fc432b84a68 100644
--- a/llvm/include/llvm-c/Target.h
+++ b/llvm/include/llvm-c/Target.h
@@ -184,104 +184,104 @@ static inline LLVMBool LLVMInitializeNativeDisassembler(void) {
  *
  * @see Module::getDataLayout()
  */
-LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M);
+LLVM_FUNC_ABI LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M);
 
 /**
  * Set the data layout for a module.
  *
  * @see Module::setDataLayout()
  */
-void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL);
+LLVM_FUNC_ABI void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL);
 
 /** Creates target data from a target layout string.
     See the constructor llvm::DataLayout::DataLayout. */
-LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep);
+LLVM_FUNC_ABI LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep);
 
 /** Deallocates a TargetData.
     See the destructor llvm::DataLayout::~DataLayout. */
-void LLVMDisposeTargetData(LLVMTargetDataRef TD);
+LLVM_FUNC_ABI void LLVMDisposeTargetData(LLVMTargetDataRef TD);
 
 /** Adds target library information to a pass manager. This does not take
     ownership of the target library info.
     See the method llvm::PassManagerBase::add. */
-void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI,
+LLVM_FUNC_ABI void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI,
                               LLVMPassManagerRef PM);
 
 /** Converts target data to a target layout string. The string must be disposed
     with LLVMDisposeMessage.
     See the constructor llvm::DataLayout::DataLayout. */
-char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD);
+LLVM_FUNC_ABI char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD);
 
 /** Returns the byte order of a target, either LLVMBigEndian or
     LLVMLittleEndian.
     See the method llvm::DataLayout::isLittleEndian. */
-enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD);
+LLVM_FUNC_ABI enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD);
 
 /** Returns the pointer size in bytes for a target.
     See the method llvm::DataLayout::getPointerSize. */
-unsigned LLVMPointerSize(LLVMTargetDataRef TD);
+LLVM_FUNC_ABI unsigned LLVMPointerSize(LLVMTargetDataRef TD);
 
 /** Returns the pointer size in bytes for a target for a specified
     address space.
     See the method llvm::DataLayout::getPointerSize. */
-unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS);
+LLVM_FUNC_ABI unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS);
 
 /** Returns the integer type that is the same size as a pointer on a target.
     See the method llvm::DataLayout::getIntPtrType. */
-LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD);
+LLVM_FUNC_ABI LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD);
 
 /** Returns the integer type that is the same size as a pointer on a target.
     This version allows the address space to be specified.
     See the method llvm::DataLayout::getIntPtrType. */
-LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS);
+LLVM_FUNC_ABI LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS);
 
 /** Returns the integer type that is the same size as a pointer on a target.
     See the method llvm::DataLayout::getIntPtrType. */
-LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD);
+LLVM_FUNC_ABI LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD);
 
 /** Returns the integer type that is the same size as a pointer on a target.
     This version allows the address space to be specified.
     See the method llvm::DataLayout::getIntPtrType. */
-LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD,
+LLVM_FUNC_ABI LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD,
                                          unsigned AS);
 
 /** Computes the size of a type in bytes for a target.
     See the method llvm::DataLayout::getTypeSizeInBits. */
-unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty);
+LLVM_FUNC_ABI unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty);
 
 /** Computes the storage size of a type in bytes for a target.
     See the method llvm::DataLayout::getTypeStoreSize. */
-unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
+LLVM_FUNC_ABI unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
 
 /** Computes the ABI size of a type in bytes for a target.
     See the method llvm::DataLayout::getTypeAllocSize. */
-unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
+LLVM_FUNC_ABI unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
 
 /** Computes the ABI alignment of a type in bytes for a target.
     See the method llvm::DataLayout::getTypeABISize. */
-unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
+LLVM_FUNC_ABI unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
 
 /** Computes the call frame alignment of a type in bytes for a target.
     See the method llvm::DataLayout::getTypeABISize. */
-unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
+LLVM_FUNC_ABI unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
 
 /** Computes the preferred alignment of a type in bytes for a target.
     See the method llvm::DataLayout::getTypeABISize. */
-unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
+LLVM_FUNC_ABI unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
 
 /** Computes the preferred alignment of a global variable in bytes for a target.
     See the method llvm::DataLayout::getPreferredAlignment. */
-unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD,
+LLVM_FUNC_ABI unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD,
                                         LLVMValueRef GlobalVar);
 
 /** Computes the structure element that contains the byte offset for a target.
     See the method llvm::StructLayout::getElementContainingOffset. */
-unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
+LLVM_FUNC_ABI unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
                              unsigned long long Offset);
 
 /** Computes the byte offset of the indexed struct element for a target.
     See the method llvm::StructLayout::getElementContainingOffset. */
-unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD,
+LLVM_FUNC_ABI unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD,
                                        LLVMTypeRef StructTy, unsigned Element);
 
 /**
diff --git a/llvm/include/llvm-c/TargetMachine.h b/llvm/include/llvm-c/TargetMachine.h
index e92b896327464d0..09ebe6fa130faaa 100644
--- a/llvm/include/llvm-c/TargetMachine.h
+++ b/llvm/include/llvm-c/TargetMachine.h
@@ -68,102 +68,102 @@ typedef enum {
 } LLVMCodeGenFileType;
 
 /** Returns the first llvm::Target in the registered targets list. */
-LLVMTargetRef LLVMGetFirstTarget(void);
+LLVM_FUNC_ABI LLVMTargetRef LLVMGetFirstTarget(void);
 /** Returns the next llvm::Target given a previous one (or null if there's none) */
-LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T);
+LLVM_FUNC_ABI LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T);
 
 /*===-- Target ------------------------------------------------------------===*/
 /** Finds the target corresponding to the given name and stores it in \p T.
   Returns 0 on success. */
-LLVMTargetRef LLVMGetTargetFromName(const char *Name);
+LLVM_FUNC_ABI LLVMTargetRef LLVMGetTargetFromName(const char *Name);
 
 /** Finds the target corresponding to the given triple and stores it in \p T.
   Returns 0 on success. Optionally returns any error in ErrorMessage.
   Use LLVMDisposeMessage to dispose the message. */
-LLVMBool LLVMGetTargetFromTriple(const char* Triple, LLVMTargetRef *T,
+LLVM_FUNC_ABI LLVMBool LLVMGetTargetFromTriple(const char* Triple, LLVMTargetRef *T,
                                  char **ErrorMessage);
 
 /** Returns the name of a target. See llvm::Target::getName */
-const char *LLVMGetTargetName(LLVMTargetRef T);
+LLVM_FUNC_ABI const char *LLVMGetTargetName(LLVMTargetRef T);
 
 /** Returns the description  of a target. See llvm::Target::getDescription */
-const char *LLVMGetTargetDescription(LLVMTargetRef T);
+LLVM_FUNC_ABI const char *LLVMGetTargetDescription(LLVMTargetRef T);
 
 /** Returns if the target has a JIT */
-LLVMBool LLVMTargetHasJIT(LLVMTargetRef T);
+LLVM_FUNC_ABI LLVMBool LLVMTargetHasJIT(LLVMTargetRef T);
 
 /** Returns if the target has a TargetMachine associated */
-LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T);
+LLVM_FUNC_ABI LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T);
 
 /** Returns if the target as an ASM backend (required for emitting output) */
-LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T);
+LLVM_FUNC_ABI LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T);
 
 /*===-- Target Machine ----------------------------------------------------===*/
 /** Creates a new llvm::TargetMachine. See llvm::Target::createTargetMachine */
-LLVMTargetMachineRef LLVMCreateTargetMachine(LLVMTargetRef T,
+LLVM_FUNC_ABI LLVMTargetMachineRef LLVMCreateTargetMachine(LLVMTargetRef T,
   const char *Triple, const char *CPU, const char *Features,
   LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, LLVMCodeModel CodeModel);
 
 /** Dispose the LLVMTargetMachineRef instance generated by
   LLVMCreateTargetMachine. */
-void LLVMDisposeTargetMachine(LLVMTargetMachineRef T);
+LLVM_FUNC_ABI void LLVMDisposeTargetMachine(LLVMTargetMachineRef T);
 
 /** Returns the Target used in a TargetMachine */
-LLVMTargetRef LLVMGetTargetMachineTarget(LLVMTargetMachineRef T);
+LLVM_FUNC_ABI LLVMTargetRef LLVMGetTargetMachineTarget(LLVMTargetMachineRef T);
 
 /** Returns the triple used creating this target machine. See
   llvm::TargetMachine::getTriple. The result needs to be disposed with
   LLVMDisposeMessage. */
-char *LLVMGetTargetMachineTriple(LLVMTargetMachineRef T);
+LLVM_FUNC_ABI char *LLVMGetTargetMachineTriple(LLVMTargetMachineRef T);
 
 /** Returns the cpu used creating this target machine. See
   llvm::TargetMachine::getCPU. The result needs to be disposed with
   LLVMDisposeMessage. */
-char *LLVMGetTargetMachineCPU(LLVMTargetMachineRef T);
+LLVM_FUNC_ABI char *LLVMGetTargetMachineCPU(LLVMTargetMachineRef T);
 
 /** Returns the feature string used creating this target machine. See
   llvm::TargetMachine::getFeatureString. The result needs to be disposed with
   LLVMDisposeMessage. */
-char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T);
+LLVM_FUNC_ABI char *LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T);
 
 /** Create a DataLayout based on the targetMachine. */
-LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T);
+LLVM_FUNC_ABI LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T);
 
 /** Set the target machine's ASM verbosity. */
-void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
+LLVM_FUNC_ABI void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T,
                                       LLVMBool VerboseAsm);
 
 /** Emits an asm or object file for the given module to the filename. This
   wraps several c++ only classes (among them a file stream). Returns any
   error in ErrorMessage. Use LLVMDisposeMessage to dispose the message. */
-LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M,
                                      const char *Filename,
                                      LLVMCodeGenFileType codegen,
                                      char **ErrorMessage);
 
 /** Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf. */
-LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M,
+LLVM_FUNC_ABI LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M,
   LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf);
 
 /*===-- Triple ------------------------------------------------------------===*/
 /** Get a triple for the host machine as a string. The result needs to be
   disposed with LLVMDisposeMessage. */
-char* LLVMGetDefaultTargetTriple(void);
+LLVM_FUNC_ABI char* LLVMGetDefaultTargetTriple(void);
 
 /** Normalize a target triple. The result needs to be disposed with
   LLVMDisposeMessage. */
-char* LLVMNormalizeTargetTriple(const char* triple);
+LLVM_FUNC_ABI char* LLVMNormalizeTargetTriple(const char* triple);
 
 /** Get the host CPU as a string. The result needs to be disposed with
   LLVMDisposeMessage. */
-char* LLVMGetHostCPUName(void);
+LLVM_FUNC_ABI char* LLVMGetHostCPUName(void);
 
 /** Get the host CPU's features as a string. The result needs to be disposed
   with LLVMDisposeMessage. */
-char* LLVMGetHostCPUFeatures(void);
+LLVM_FUNC_ABI char* LLVMGetHostCPUFeatures(void);
 
 /** Adds the target-specific analysis passes to the pass manager. */
-void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM);
+LLVM_FUNC_ABI void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/Transforms/PassBuilder.h b/llvm/include/llvm-c/Transforms/PassBuilder.h
index b6055c25c5f1151..407ea743521d9b6 100644
--- a/llvm/include/llvm-c/Transforms/PassBuilder.h
+++ b/llvm/include/llvm-c/Transforms/PassBuilder.h
@@ -47,7 +47,7 @@ typedef struct LLVMOpaquePassBuilderOptions *LLVMPassBuilderOptionsRef;
  * pipelines may also be invoked using `default<O3>` and friends. See opt for
  * full reference of the Passes format.
  */
-LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
+LLVM_FUNC_ABI LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
                            LLVMTargetMachineRef TM,
                            LLVMPassBuilderOptionsRef Options);
 
@@ -58,55 +58,55 @@ LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
  * responsible for it. The client should call LLVMDisposePassBuilderOptions
  * to free the pass builder options.
  */
-LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void);
+LLVM_FUNC_ABI LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void);
 
 /**
  * Toggle adding the VerifierPass for the PassBuilder, ensuring all functions
  * inside the module is valid.
  */
-void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options,
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options,
                                          LLVMBool VerifyEach);
 
 /**
  * Toggle debug logging when running the PassBuilder
  */
-void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options,
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options,
                                            LLVMBool DebugLogging);
 
-void LLVMPassBuilderOptionsSetLoopInterleaving(
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLoopInterleaving(
     LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving);
 
-void LLVMPassBuilderOptionsSetLoopVectorization(
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLoopVectorization(
     LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization);
 
-void LLVMPassBuilderOptionsSetSLPVectorization(
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetSLPVectorization(
     LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization);
 
-void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options,
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options,
                                             LLVMBool LoopUnrolling);
 
-void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(
     LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll);
 
-void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options,
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options,
                                              unsigned LicmMssaOptCap);
 
-void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(
     LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap);
 
-void LLVMPassBuilderOptionsSetCallGraphProfile(
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetCallGraphProfile(
     LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile);
 
-void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
                                              LLVMBool MergeFunctions);
 
-void LLVMPassBuilderOptionsSetInlinerThreshold(
+LLVM_FUNC_ABI void LLVMPassBuilderOptionsSetInlinerThreshold(
     LLVMPassBuilderOptionsRef Options, int Threshold);
 
 /**
  * Dispose of a heap-allocated PassBuilderOptions instance
  */
-void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options);
+LLVM_FUNC_ABI void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options);
 
 /**
  * @}
diff --git a/llvm/include/llvm-c/blake3.h b/llvm/include/llvm-c/blake3.h
index f4a98b4218f8855..f0686e359a0b9e1 100644
--- a/llvm/include/llvm-c/blake3.h
+++ b/llvm/include/llvm-c/blake3.h
@@ -34,7 +34,7 @@ extern "C" {
 
 // This struct is a private implementation detail. It has to be here because
 // it's part of llvm_blake3_hasher below.
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   uint32_t cv[8];
   uint64_t chunk_counter;
   uint8_t buf[LLVM_BLAKE3_BLOCK_LEN];
@@ -43,7 +43,7 @@ typedef struct {
   uint8_t flags;
 } llvm_blake3_chunk_state;
 
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   uint32_t key[8];
   llvm_blake3_chunk_state chunk;
   uint8_t cv_stack_len;
@@ -55,23 +55,23 @@ typedef struct {
   uint8_t cv_stack[(LLVM_BLAKE3_MAX_DEPTH + 1) * LLVM_BLAKE3_OUT_LEN];
 } llvm_blake3_hasher;
 
-const char *llvm_blake3_version(void);
-void llvm_blake3_hasher_init(llvm_blake3_hasher *self);
-void llvm_blake3_hasher_init_keyed(llvm_blake3_hasher *self,
+LLVM_FUNC_ABI const char *llvm_blake3_version(void);
+LLVM_FUNC_ABI void llvm_blake3_hasher_init(llvm_blake3_hasher *self);
+LLVM_FUNC_ABI void llvm_blake3_hasher_init_keyed(llvm_blake3_hasher *self,
                                    const uint8_t key[LLVM_BLAKE3_KEY_LEN]);
-void llvm_blake3_hasher_init_derive_key(llvm_blake3_hasher *self,
+LLVM_FUNC_ABI void llvm_blake3_hasher_init_derive_key(llvm_blake3_hasher *self,
                                         const char *context);
-void llvm_blake3_hasher_init_derive_key_raw(llvm_blake3_hasher *self,
+LLVM_FUNC_ABI void llvm_blake3_hasher_init_derive_key_raw(llvm_blake3_hasher *self,
                                             const void *context,
                                             size_t context_len);
-void llvm_blake3_hasher_update(llvm_blake3_hasher *self, const void *input,
+LLVM_FUNC_ABI void llvm_blake3_hasher_update(llvm_blake3_hasher *self, const void *input,
                                size_t input_len);
-void llvm_blake3_hasher_finalize(const llvm_blake3_hasher *self, uint8_t *out,
+LLVM_FUNC_ABI void llvm_blake3_hasher_finalize(const llvm_blake3_hasher *self, uint8_t *out,
                                  size_t out_len);
-void llvm_blake3_hasher_finalize_seek(const llvm_blake3_hasher *self,
+LLVM_FUNC_ABI void llvm_blake3_hasher_finalize_seek(const llvm_blake3_hasher *self,
                                       uint64_t seek, uint8_t *out,
                                       size_t out_len);
-void llvm_blake3_hasher_reset(llvm_blake3_hasher *self);
+LLVM_FUNC_ABI void llvm_blake3_hasher_reset(llvm_blake3_hasher *self);
 
 #ifdef __cplusplus
 }
diff --git a/llvm/include/llvm-c/lto.h b/llvm/include/llvm-c/lto.h
index 087a6bd09a80e2f..8cdf25aec7eeb1b 100644
--- a/llvm/include/llvm-c/lto.h
+++ b/llvm/include/llvm-c/lto.h
@@ -108,7 +108,7 @@ LLVM_C_EXTERN_C_BEGIN
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern const char*
+LLVM_FUNC_ABI extern const char*
 lto_get_version(void);
 
 /**
@@ -116,7 +116,7 @@ lto_get_version(void);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern const char*
+LLVM_FUNC_ABI extern const char*
 lto_get_error_message(void);
 
 /**
@@ -124,7 +124,7 @@ lto_get_error_message(void);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_module_is_object_file(const char* path);
 
 /**
@@ -132,7 +132,7 @@ lto_module_is_object_file(const char* path);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_module_is_object_file_for_target(const char* path,
                                      const char* target_triple_prefix);
 
@@ -142,7 +142,7 @@ lto_module_is_object_file_for_target(const char* path,
  *
  * \since LTO_API_VERSION=20
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_module_has_objc_category(const void *mem, size_t length);
 
 /**
@@ -150,7 +150,7 @@ lto_module_has_objc_category(const void *mem, size_t length);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_bool_t lto_module_is_object_file_in_memory(const void *mem,
+LLVM_FUNC_ABI extern lto_bool_t lto_module_is_object_file_in_memory(const void *mem,
                                                       size_t length);
 
 /**
@@ -158,7 +158,7 @@ extern lto_bool_t lto_module_is_object_file_in_memory(const void *mem,
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length,
                                               const char* target_triple_prefix);
 
@@ -168,7 +168,7 @@ lto_module_is_object_file_in_memory_for_target(const void* mem, size_t length,
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_module_t
+LLVM_FUNC_ABI extern lto_module_t
 lto_module_create(const char* path);
 
 /**
@@ -177,7 +177,7 @@ lto_module_create(const char* path);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_module_t
+LLVM_FUNC_ABI extern lto_module_t
 lto_module_create_from_memory(const void* mem, size_t length);
 
 /**
@@ -186,7 +186,7 @@ lto_module_create_from_memory(const void* mem, size_t length);
  *
  * \since LTO_API_VERSION=9
  */
-extern lto_module_t
+LLVM_FUNC_ABI extern lto_module_t
 lto_module_create_from_memory_with_path(const void* mem, size_t length,
                                         const char *path);
 
@@ -201,7 +201,7 @@ lto_module_create_from_memory_with_path(const void* mem, size_t length,
  *
  * \since LTO_API_VERSION=11
  */
-extern lto_module_t
+LLVM_FUNC_ABI extern lto_module_t
 lto_module_create_in_local_context(const void *mem, size_t length,
                                    const char *path);
 
@@ -215,7 +215,7 @@ lto_module_create_in_local_context(const void *mem, size_t length,
  *
  * \since LTO_API_VERSION=11
  */
-extern lto_module_t
+LLVM_FUNC_ABI extern lto_module_t
 lto_module_create_in_codegen_context(const void *mem, size_t length,
                                      const char *path, lto_code_gen_t cg);
 
@@ -225,7 +225,7 @@ lto_module_create_in_codegen_context(const void *mem, size_t length,
  *
  * \since LTO_API_VERSION=5
  */
-extern lto_module_t
+LLVM_FUNC_ABI extern lto_module_t
 lto_module_create_from_fd(int fd, const char *path, size_t file_size);
 
 /**
@@ -234,7 +234,7 @@ lto_module_create_from_fd(int fd, const char *path, size_t file_size);
  *
  * \since LTO_API_VERSION=5
  */
-extern lto_module_t
+LLVM_FUNC_ABI extern lto_module_t
 lto_module_create_from_fd_at_offset(int fd, const char *path, size_t file_size,
                                     size_t map_size, off_t offset);
 
@@ -244,7 +244,7 @@ lto_module_create_from_fd_at_offset(int fd, const char *path, size_t file_size,
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_module_dispose(lto_module_t mod);
 
 /**
@@ -252,7 +252,7 @@ lto_module_dispose(lto_module_t mod);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern const char*
+LLVM_FUNC_ABI extern const char*
 lto_module_get_target_triple(lto_module_t mod);
 
 /**
@@ -260,7 +260,7 @@ lto_module_get_target_triple(lto_module_t mod);
  *
  * \since LTO_API_VERSION=4
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_module_set_target_triple(lto_module_t mod, const char *triple);
 
 /**
@@ -268,7 +268,7 @@ lto_module_set_target_triple(lto_module_t mod, const char *triple);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern unsigned int
+LLVM_FUNC_ABI extern unsigned int
 lto_module_get_num_symbols(lto_module_t mod);
 
 /**
@@ -276,7 +276,7 @@ lto_module_get_num_symbols(lto_module_t mod);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern const char*
+LLVM_FUNC_ABI extern const char*
 lto_module_get_symbol_name(lto_module_t mod, unsigned int index);
 
 /**
@@ -284,7 +284,7 @@ lto_module_get_symbol_name(lto_module_t mod, unsigned int index);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_symbol_attributes
+LLVM_FUNC_ABI extern lto_symbol_attributes
 lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);
 
 /**
@@ -295,7 +295,7 @@ lto_module_get_symbol_attribute(lto_module_t mod, unsigned int index);
  *
  * \since LTO_API_VERSION=16
  */
-extern const char*
+LLVM_FUNC_ABI extern const char*
 lto_module_get_linkeropts(lto_module_t mod);
 
 /**
@@ -309,7 +309,7 @@ lto_module_get_linkeropts(lto_module_t mod);
  *
  * \since LTO_API_VERSION=27
  */
-extern lto_bool_t lto_module_get_macho_cputype(lto_module_t mod,
+LLVM_FUNC_ABI extern lto_bool_t lto_module_get_macho_cputype(lto_module_t mod,
                                                unsigned int *out_cputype,
                                                unsigned int *out_cpusubtype);
 
@@ -322,7 +322,7 @@ extern lto_bool_t lto_module_get_macho_cputype(lto_module_t mod,
  *
  * \since LTO_API_VERSION=29
  */
-extern lto_bool_t lto_module_has_ctor_dtor(lto_module_t mod);
+LLVM_FUNC_ABI extern lto_bool_t lto_module_has_ctor_dtor(lto_module_t mod);
 /**
  * Diagnostic severity.
  *
@@ -354,7 +354,7 @@ typedef void (*lto_diagnostic_handler_t)(
  *
  * \since LTO_API_VERSION=7
  */
-extern void lto_codegen_set_diagnostic_handler(lto_code_gen_t,
+LLVM_FUNC_ABI extern void lto_codegen_set_diagnostic_handler(lto_code_gen_t,
                                                lto_diagnostic_handler_t,
                                                void *);
 
@@ -367,7 +367,7 @@ extern void lto_codegen_set_diagnostic_handler(lto_code_gen_t,
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_code_gen_t
+LLVM_FUNC_ABI extern lto_code_gen_t
 lto_codegen_create(void);
 
 /**
@@ -379,7 +379,7 @@ lto_codegen_create(void);
  *
  * \since LTO_API_VERSION=11
  */
-extern lto_code_gen_t
+LLVM_FUNC_ABI extern lto_code_gen_t
 lto_codegen_create_in_local_context(void);
 
 /**
@@ -388,7 +388,7 @@ lto_codegen_create_in_local_context(void);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_dispose(lto_code_gen_t);
 
 /**
@@ -401,7 +401,7 @@ lto_codegen_dispose(lto_code_gen_t);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod);
 
 /**
@@ -412,7 +412,7 @@ lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod);
  *
  * \since LTO_API_VERSION=13
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod);
 
 /**
@@ -421,7 +421,7 @@ lto_codegen_set_module(lto_code_gen_t cg, lto_module_t mod);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model);
 
 /**
@@ -430,7 +430,7 @@ lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model);
 
 /**
@@ -438,7 +438,7 @@ lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model);
  *
  * \since LTO_API_VERSION=4
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu);
 
 /**
@@ -447,7 +447,7 @@ lto_codegen_set_cpu(lto_code_gen_t cg, const char *cpu);
  *
  * \since LTO_API_VERSION=3
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_set_assembler_path(lto_code_gen_t cg, const char* path);
 
 /**
@@ -455,7 +455,7 @@ lto_codegen_set_assembler_path(lto_code_gen_t cg, const char* path);
  *
  * \since LTO_API_VERSION=4
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args,
                                int nargs);
 
@@ -466,7 +466,7 @@ lto_codegen_set_assembler_args(lto_code_gen_t cg, const char **args,
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol);
 
 /**
@@ -476,7 +476,7 @@ lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol);
  *
  * \since LTO_API_VERSION=5
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path);
 
 /**
@@ -491,7 +491,7 @@ lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern const void*
+LLVM_FUNC_ABI extern const void*
 lto_codegen_compile(lto_code_gen_t cg, size_t* length);
 
 /**
@@ -503,7 +503,7 @@ lto_codegen_compile(lto_code_gen_t cg, size_t* length);
  *
  * \since LTO_API_VERSION=5
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_codegen_compile_to_file(lto_code_gen_t cg, const char** name);
 
 /**
@@ -511,7 +511,7 @@ lto_codegen_compile_to_file(lto_code_gen_t cg, const char** name);
  *
  * \since LTO_API_VERSION=12
  */
-extern lto_bool_t
+LLVM_FUNC_ABI extern lto_bool_t
 lto_codegen_optimize(lto_code_gen_t cg);
 
 /**
@@ -526,7 +526,7 @@ lto_codegen_optimize(lto_code_gen_t cg);
  *
  * \since LTO_API_VERSION=12
  */
-extern const void*
+LLVM_FUNC_ABI extern const void*
 lto_codegen_compile_optimized(lto_code_gen_t cg, size_t* length);
 
 /**
@@ -534,7 +534,7 @@ lto_codegen_compile_optimized(lto_code_gen_t cg, size_t* length);
  *
  * \since LTO_API_VERSION=12
  */
-extern unsigned int
+LLVM_FUNC_ABI extern unsigned int
 lto_api_version(void);
 
 /**
@@ -549,7 +549,7 @@ lto_api_version(void);
  *
  * \since LTO_API_VERSION=28
  */
-extern void lto_set_debug_options(const char *const *options, int number);
+LLVM_FUNC_ABI extern void lto_set_debug_options(const char *const *options, int number);
 
 /**
  * Sets options to help debug codegen bugs. Since parsing shud only happen once,
@@ -562,7 +562,7 @@ extern void lto_set_debug_options(const char *const *options, int number);
  *
  * \since prior to LTO_API_VERSION=3
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_debug_options(lto_code_gen_t cg, const char *);
 
 /**
@@ -571,7 +571,7 @@ lto_codegen_debug_options(lto_code_gen_t cg, const char *);
  *
  * \since prior to LTO_API_VERSION=26
  */
-extern void lto_codegen_debug_options_array(lto_code_gen_t cg,
+LLVM_FUNC_ABI extern void lto_codegen_debug_options_array(lto_code_gen_t cg,
                                             const char *const *, int number);
 
 /**
@@ -580,7 +580,7 @@ extern void lto_codegen_debug_options_array(lto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=5
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_initialize_disassembler(void);
 
 /**
@@ -589,7 +589,7 @@ lto_initialize_disassembler(void);
  *
  * \since LTO_API_VERSION=14
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_set_should_internalize(lto_code_gen_t cg,
                                    lto_bool_t ShouldInternalize);
 
@@ -601,7 +601,7 @@ lto_codegen_set_should_internalize(lto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=15
  */
-extern void
+LLVM_FUNC_ABI extern void
 lto_codegen_set_should_embed_uselists(lto_code_gen_t cg,
                                       lto_bool_t ShouldEmbedUselists);
 
@@ -616,7 +616,7 @@ typedef struct LLVMOpaqueLTOInput *lto_input_t;
   *
   * \since LTO_API_VERSION=24
   */
-extern lto_input_t lto_input_create(const void *buffer,
+LLVM_FUNC_ABI extern lto_input_t lto_input_create(const void *buffer,
                                     size_t buffer_size,
                                     const char *path);
 
@@ -626,7 +626,7 @@ extern lto_input_t lto_input_create(const void *buffer,
   *
   * \since LTO_API_VERSION=24
   */
-extern void lto_input_dispose(lto_input_t input);
+LLVM_FUNC_ABI extern void lto_input_dispose(lto_input_t input);
 
 /**
   * Returns the number of dependent library specifiers
@@ -634,7 +634,7 @@ extern void lto_input_dispose(lto_input_t input);
   *
   * \since LTO_API_VERSION=24
   */
-extern unsigned lto_input_get_num_dependent_libraries(lto_input_t input);
+LLVM_FUNC_ABI extern unsigned lto_input_get_num_dependent_libraries(lto_input_t input);
 
 /**
   * Returns the ith dependent library specifier
@@ -643,7 +643,7 @@ extern unsigned lto_input_get_num_dependent_libraries(lto_input_t input);
   *
   * \since LTO_API_VERSION=24
   */
-extern const char * lto_input_get_dependent_library(lto_input_t input,
+LLVM_FUNC_ABI extern const char * lto_input_get_dependent_library(lto_input_t input,
                                                     size_t index,
                                                     size_t *size);
 
@@ -653,7 +653,7 @@ extern const char * lto_input_get_dependent_library(lto_input_t input,
  *
  * \since prior to LTO_API_VERSION=25
  */
-extern const char *const *lto_runtime_lib_symbols_list(size_t *size);
+LLVM_FUNC_ABI extern const char *const *lto_runtime_lib_symbols_list(size_t *size);
 
 /**
  * @} // endgoup LLVMCLTO
@@ -668,7 +668,7 @@ extern const char *const *lto_runtime_lib_symbols_list(size_t *size);
  *
  * \since LTO_API_VERSION=18
  */
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   const char *Buffer;
   size_t Size;
 } LTOObjectBuffer;
@@ -685,7 +685,7 @@ typedef struct {
  *
  * \since LTO_API_VERSION=18
  */
-extern thinlto_code_gen_t thinlto_create_codegen(void);
+LLVM_FUNC_ABI extern thinlto_code_gen_t thinlto_create_codegen(void);
 
 /**
  * Frees the generator and all memory it internally allocated.
@@ -693,7 +693,7 @@ extern thinlto_code_gen_t thinlto_create_codegen(void);
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_dispose(thinlto_code_gen_t cg);
+LLVM_FUNC_ABI extern void thinlto_codegen_dispose(thinlto_code_gen_t cg);
 
 /**
  * Add a module to a ThinLTO code generator. Identifier has to be unique among
@@ -706,7 +706,7 @@ extern void thinlto_codegen_dispose(thinlto_code_gen_t cg);
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_add_module(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_add_module(thinlto_code_gen_t cg,
                                        const char *identifier, const char *data,
                                        int length);
 
@@ -716,7 +716,7 @@ extern void thinlto_codegen_add_module(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_process(thinlto_code_gen_t cg);
+LLVM_FUNC_ABI extern void thinlto_codegen_process(thinlto_code_gen_t cg);
 
 /**
  * Returns the number of object files produced by the ThinLTO CodeGenerator.
@@ -727,7 +727,7 @@ extern void thinlto_codegen_process(thinlto_code_gen_t cg);
  *
  * \since LTO_API_VERSION=18
  */
-extern unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg);
+LLVM_FUNC_ABI extern unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg);
 
 /**
  * Returns a reference to the ith object file produced by the ThinLTO
@@ -738,7 +738,7 @@ extern unsigned int thinlto_module_get_num_objects(thinlto_code_gen_t cg);
  *
  * \since LTO_API_VERSION=18
  */
-extern LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg,
                                                  unsigned int index);
 
 /**
@@ -750,7 +750,7 @@ extern LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=21
  */
-unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg);
+LLVM_FUNC_ABI unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg);
 
 /**
  * Returns the path to the ith object file produced by the ThinLTO
@@ -761,7 +761,7 @@ unsigned int thinlto_module_get_num_object_files(thinlto_code_gen_t cg);
  *
  * \since LTO_API_VERSION=21
  */
-const char *thinlto_module_get_object_file(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI const char *thinlto_module_get_object_file(thinlto_code_gen_t cg,
                                            unsigned int index);
 
 /**
@@ -770,7 +770,7 @@ const char *thinlto_module_get_object_file(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg,
                                                 lto_codegen_model);
 
 /**
@@ -780,7 +780,7 @@ extern lto_bool_t thinlto_codegen_set_pic_model(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg,
                                               const char *save_temps_dir);
 
 /**
@@ -791,7 +791,7 @@ extern void thinlto_codegen_set_savetemps_dir(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=21
  */
-void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg,
                                        const char *save_temps_dir);
 
 /**
@@ -799,7 +799,7 @@ void thinlto_set_generated_objects_dir(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu);
+LLVM_FUNC_ABI extern void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu);
 
 /**
  * Disable CodeGen, only run the stages till codegen and stop. The output will
@@ -807,7 +807,7 @@ extern void thinlto_codegen_set_cpu(thinlto_code_gen_t cg, const char *cpu);
  *
  * \since LTO_API_VERSION=19
  */
-extern void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg,
                                             lto_bool_t disable);
 
 /**
@@ -815,7 +815,7 @@ extern void thinlto_codegen_disable_codegen(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=19
  */
-extern void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg,
                                              lto_bool_t codegen_only);
 
 /**
@@ -823,14 +823,14 @@ extern void thinlto_codegen_set_codegen_only(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_debug_options(const char *const *options, int number);
+LLVM_FUNC_ABI extern void thinlto_debug_options(const char *const *options, int number);
 
 /**
  * Test if a module has support for ThinLTO linking.
  *
  * \since LTO_API_VERSION=18
  */
-extern lto_bool_t lto_module_is_thinlto(lto_module_t mod);
+LLVM_FUNC_ABI extern lto_bool_t lto_module_is_thinlto(lto_module_t mod);
 
 /**
  * Adds a symbol to the list of global symbols that must exist in the final
@@ -840,7 +840,7 @@ extern lto_bool_t lto_module_is_thinlto(lto_module_t mod);
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg,
                                                      const char *name,
                                                      int length);
 
@@ -852,7 +852,7 @@ extern void thinlto_codegen_add_must_preserve_symbol(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg,
                                                         const char *name,
                                                         int length);
 
@@ -883,7 +883,7 @@ extern void thinlto_codegen_add_cross_referenced_symbol(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg,
                                           const char *cache_dir);
 
 /**
@@ -893,7 +893,7 @@ extern void thinlto_codegen_set_cache_dir(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg,
                                                        int interval);
 
 /**
@@ -909,7 +909,7 @@ extern void thinlto_codegen_set_cache_pruning_interval(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_set_final_cache_size_relative_to_available_space(
+LLVM_FUNC_ABI extern void thinlto_codegen_set_final_cache_size_relative_to_available_space(
     thinlto_code_gen_t cg, unsigned percentage);
 
 /**
@@ -918,7 +918,7 @@ extern void thinlto_codegen_set_final_cache_size_relative_to_available_space(
  *
  * \since LTO_API_VERSION=18
  */
-extern void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg,
                                                        unsigned expiration);
 
 /**
@@ -929,7 +929,7 @@ extern void thinlto_codegen_set_cache_entry_expiration(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=22
  */
-extern void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg,
                                                  unsigned max_size_bytes);
 
 /**
@@ -938,7 +938,7 @@ extern void thinlto_codegen_set_cache_size_bytes(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=23
  */
-extern void
+LLVM_FUNC_ABI extern void
 thinlto_codegen_set_cache_size_megabytes(thinlto_code_gen_t cg,
                                          unsigned max_size_megabytes);
 
@@ -948,7 +948,7 @@ thinlto_codegen_set_cache_size_megabytes(thinlto_code_gen_t cg,
  *
  * \since LTO_API_VERSION=22
  */
-extern void thinlto_codegen_set_cache_size_files(thinlto_code_gen_t cg,
+LLVM_FUNC_ABI extern void thinlto_codegen_set_cache_size_files(thinlto_code_gen_t cg,
                                                  unsigned max_size_files);
 
 /**
diff --git a/llvm/include/llvm/ADT/APFixedPoint.h b/llvm/include/llvm/ADT/APFixedPoint.h
index 22a08633a856b5e..eb9c51e4b88b503 100644
--- a/llvm/include/llvm/ADT/APFixedPoint.h
+++ b/llvm/include/llvm/ADT/APFixedPoint.h
@@ -33,7 +33,7 @@ struct fltSemantics;
 /// 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_CLASS_ABI FixedPointSemantics {
 public:
   static constexpr unsigned WidthBitWidth = 16;
   static constexpr unsigned LsbWeightBitWidth = 13;
@@ -130,7 +130,7 @@ inline hash_code hash_value(const FixedPointSemantics &Val) {
   return hash_value(bit_cast<uint32_t>(Val));
 }
 
-template <> struct DenseMapInfo<FixedPointSemantics> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<FixedPointSemantics> {
   static inline FixedPointSemantics getEmptyKey() {
     return FixedPointSemantics(0, 0, false, false, false);
   }
@@ -152,7 +152,7 @@ template <> struct DenseMapInfo<FixedPointSemantics> {
 /// JTC1 SC22 WG14 N1169. The class carries the value and semantics of
 /// a fixed point, and provides different operations that would normally be
 /// performed on fixed point types.
-class APFixedPoint {
+class LLVM_CLASS_ABI APFixedPoint {
 public:
   APFixedPoint(const APInt &Val, const FixedPointSemantics &Sema)
       : Val(Val, !Sema.isSigned()), Sema(Sema) {
@@ -299,7 +299,7 @@ inline hash_code hash_value(const APFixedPoint &Val) {
   return hash_combine(Val.getSemantics(), Val.getValue());
 }
 
-template <> struct DenseMapInfo<APFixedPoint> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<APFixedPoint> {
   static inline APFixedPoint getEmptyKey() {
     return APFixedPoint(DenseMapInfo<FixedPointSemantics>::getEmptyKey());
   }
diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h
index f97cd5d050185b0..607822cdad0eca5 100644
--- a/llvm/include/llvm/ADT/APFloat.h
+++ b/llvm/include/llvm/ADT/APFloat.h
@@ -140,7 +140,7 @@ enum lostFraction { // Example of truncated bits:
 // 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_CLASS_ABI APFloatBase {
   typedef APInt::WordType integerPart;
   static constexpr unsigned integerPartWidth = APInt::APINT_BITS_PER_WORD;
 
@@ -291,7 +291,7 @@ struct APFloatBase {
 
 namespace detail {
 
-class IEEEFloat final : public APFloatBase {
+class LLVM_CLASS_ABI IEEEFloat final : public APFloatBase {
 public:
   /// \name Constructors
   /// @{
@@ -455,7 +455,7 @@ class IEEEFloat final : public APFloatBase {
   /// 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_FUNC_ABI hash_code hash_value(const IEEEFloat &Arg);
 
   /// Converts this value into a decimal string.
   ///
@@ -499,12 +499,12 @@ class IEEEFloat final : public APFloatBase {
   ///   0   -> \c IEK_Zero
   ///   Inf -> \c IEK_Inf
   ///
-  friend int ilogb(const IEEEFloat &Arg);
+  friend LLVM_FUNC_ABI int ilogb(const IEEEFloat &Arg);
 
   /// Returns: X * 2^Exp for integral exponents.
-  friend IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode);
+  friend LLVM_FUNC_ABI IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode);
 
-  friend IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode);
+  friend LLVM_FUNC_ABI IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode);
 
   /// \name Special value setters.
   /// @{
@@ -657,16 +657,16 @@ class IEEEFloat final : public APFloatBase {
   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_FUNC_ABI hash_code hash_value(const IEEEFloat &Arg);
+LLVM_FUNC_ABI int ilogb(const IEEEFloat &Arg);
+LLVM_FUNC_ABI IEEEFloat scalbn(IEEEFloat X, int Exp, IEEEFloat::roundingMode);
+LLVM_FUNC_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_CLASS_ABI DoubleAPFloat final : public APFloatBase {
   // Note: this must be the first data member.
   const fltSemantics *Semantics;
   std::unique_ptr<APFloat[]> Floats;
@@ -748,20 +748,20 @@ class DoubleAPFloat final : public APFloatBase {
 
   bool getExactInverse(APFloat *inv) const;
 
-  friend DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp, roundingMode);
-  friend DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode);
-  friend hash_code hash_value(const DoubleAPFloat &Arg);
+  friend LLVM_FUNC_ABI DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp, roundingMode);
+  friend LLVM_FUNC_ABI DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode);
+  friend LLVM_FUNC_ABI hash_code hash_value(const DoubleAPFloat &Arg);
 };
 
-hash_code hash_value(const DoubleAPFloat &Arg);
-DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp, IEEEFloat::roundingMode RM);
-DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, IEEEFloat::roundingMode);
+LLVM_FUNC_ABI hash_code hash_value(const DoubleAPFloat &Arg);
+LLVM_FUNC_ABI DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp, IEEEFloat::roundingMode RM);
+LLVM_FUNC_ABI DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, IEEEFloat::roundingMode);
 
 } // End detail namespace
 
 // This is a interface class that is currently forwarding functionalities from
 // detail::IEEEFloat.
-class APFloat : public APFloatBase {
+class LLVM_CLASS_ABI APFloat : public APFloatBase {
   typedef detail::IEEEFloat IEEEFloat;
   typedef detail::DoubleAPFloat DoubleAPFloat;
 
@@ -1319,10 +1319,10 @@ class APFloat : public APFloatBase {
     APFLOAT_DISPATCH_ON_SEMANTICS(getExactInverse(inv));
   }
 
-  friend hash_code hash_value(const APFloat &Arg);
+  friend LLVM_FUNC_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);
+  friend LLVM_FUNC_ABI APFloat scalbn(APFloat X, int Exp, roundingMode RM);
+  friend LLVM_FUNC_ABI APFloat frexp(const APFloat &X, int &Exp, roundingMode RM);
   friend IEEEFloat;
   friend DoubleAPFloat;
 };
@@ -1331,7 +1331,7 @@ class APFloat : public APFloatBase {
 ///
 /// These additional declarations are required in order to compile LLVM with IBM
 /// xlC compiler.
-hash_code hash_value(const APFloat &Arg);
+LLVM_FUNC_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/AddressRanges.h b/llvm/include/llvm/ADT/AddressRanges.h
index 3990870cc13a265..6972108e6c5f368 100644
--- a/llvm/include/llvm/ADT/AddressRanges.h
+++ b/llvm/include/llvm/ADT/AddressRanges.h
@@ -20,7 +20,7 @@ namespace llvm {
 
 /// A class that represents an address range. The range is specified using
 /// a start and an end address: [Start, End).
-class AddressRange {
+class LLVM_CLASS_ABI AddressRange {
 public:
   AddressRange() {}
   AddressRange(uint64_t S, uint64_t E) : Start(S), End(E) {
@@ -56,7 +56,7 @@ class AddressRange {
 /// The address ranges are always sorted and never contain any invalid,
 /// empty or intersected address ranges.
 
-template <typename T> class AddressRangesBase {
+template <typename T> class LLVM_CLASS_ABI AddressRangesBase {
 protected:
   using Collection = SmallVector<T>;
   Collection Ranges;
@@ -119,7 +119,7 @@ template <typename T> class AddressRangesBase {
 /// insertions and searches efficiently. Intersecting([100,200), [150,300))
 /// and adjacent([100,200), [200,300)) address ranges are combined during
 /// insertion.
-class AddressRanges : public AddressRangesBase<AddressRange> {
+class LLVM_CLASS_ABI AddressRanges : public AddressRangesBase<AddressRange> {
 public:
   Collection::const_iterator insert(AddressRange Range) {
     if (Range.empty())
@@ -143,7 +143,7 @@ class AddressRanges : public AddressRangesBase<AddressRange> {
   }
 };
 
-class AddressRangeValuePair {
+class LLVM_CLASS_ABI AddressRangeValuePair {
 public:
   operator AddressRange() const { return Range; }
 
@@ -163,7 +163,7 @@ inline bool operator==(const AddressRangeValuePair &LHS,
 /// Intersecting([100,200), [150,300)) ranges splitted into non-conflicting
 /// parts([100,200), [200,300)). Adjacent([100,200), [200,300)) address
 /// ranges are not combined during insertion.
-class AddressRangesMap : public AddressRangesBase<AddressRangeValuePair> {
+class LLVM_CLASS_ABI AddressRangesMap : public AddressRangesBase<AddressRangeValuePair> {
 public:
   void insert(AddressRange Range, int64_t Value) {
     if (Range.empty())
diff --git a/llvm/include/llvm/ADT/AllocatorList.h b/llvm/include/llvm/ADT/AllocatorList.h
index dee561a55b00470..e8ed556f05b22d9 100644
--- a/llvm/include/llvm/ADT/AllocatorList.h
+++ b/llvm/include/llvm/ADT/AllocatorList.h
@@ -31,7 +31,7 @@ namespace llvm {
 /// Because this list owns the allocator, calling \a splice() with a different
 /// list isn't generally safe.  As such, \a splice has been left out of the
 /// interface entirely.
-template <class T, class AllocatorT> class AllocatorList : AllocatorT {
+template <class T, class AllocatorT> class LLVM_CLASS_ABI AllocatorList : AllocatorT {
   struct Node : ilist_node<Node> {
     Node(Node &&) = delete;
     Node(const Node &) = delete;
diff --git a/llvm/include/llvm/ADT/BitVector.h b/llvm/include/llvm/ADT/BitVector.h
index dbe1847abacc2df..66b73934e76b7eb 100644
--- a/llvm/include/llvm/ADT/BitVector.h
+++ b/llvm/include/llvm/ADT/BitVector.h
@@ -32,7 +32,7 @@ namespace llvm {
 
 /// ForwardIterator for the bits that are set.
 /// Iterators get invalidated when resize / reserve is called.
-template <typename BitVectorT> class const_set_bits_iterator_impl {
+template <typename BitVectorT> class LLVM_CLASS_ABI const_set_bits_iterator_impl {
   const BitVectorT &Parent;
   int Current = 0;
 
@@ -80,7 +80,7 @@ template <typename BitVectorT> class const_set_bits_iterator_impl {
   }
 };
 
-class BitVector {
+class LLVM_CLASS_ABI BitVector {
   typedef uintptr_t BitWord;
 
   enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT };
@@ -837,7 +837,7 @@ inline BitVector::size_type capacity_in_bytes(const BitVector &X) {
   return X.getMemorySize();
 }
 
-template <> struct DenseMapInfo<BitVector> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<BitVector> {
   static inline BitVector getEmptyKey() { return {}; }
   static inline BitVector getTombstoneKey() {
     BitVector V;
diff --git a/llvm/include/llvm/ADT/Bitfields.h b/llvm/include/llvm/ADT/Bitfields.h
index 6e14208448f484b..3b089276f4b6c04 100644
--- a/llvm/include/llvm/ADT/Bitfields.h
+++ b/llvm/include/llvm/ADT/Bitfields.h
@@ -92,7 +92,7 @@ namespace llvm {
 namespace bitfields_details {
 
 /// A struct defining useful bit patterns for n-bits integer types.
-template <typename T, unsigned Bits> struct BitPatterns {
+template <typename T, unsigned Bits> struct LLVM_CLASS_ABI BitPatterns {
   /// Bit patterns are forged using the equivalent `Unsigned` type because of
   /// undefined operations over signed types (e.g. Bitwise shift operators).
   /// Moreover same size casting from unsigned to signed is well defined but not
@@ -119,7 +119,7 @@ template <typename T, unsigned Bits> struct BitPatterns {
 /// `Compressor` is specialized on signed-ness so no runtime cost is incurred.
 /// The `pack` method also checks that the passed in `UserValue` is valid.
 template <typename T, unsigned Bits, bool = std::is_unsigned<T>::value>
-struct Compressor {
+struct LLVM_CLASS_ABI Compressor {
   static_assert(std::is_unsigned<T>::value, "T must be unsigned");
   using BP = BitPatterns<T, Bits>;
 
@@ -132,7 +132,7 @@ struct Compressor {
   static T unpack(T StorageValue) { return StorageValue; }
 };
 
-template <typename T, unsigned Bits> struct Compressor<T, Bits, false> {
+template <typename T, unsigned Bits> struct LLVM_CLASS_ABI Compressor<T, Bits, false> {
   static_assert(std::is_signed<T>::value, "T must be signed");
   using BP = BitPatterns<T, Bits>;
 
@@ -154,7 +154,7 @@ template <typename T, unsigned Bits> struct Compressor<T, Bits, false> {
 
 /// Impl is where Bifield description and Storage are put together to interact
 /// with values.
-template <typename Bitfield, typename StorageType> struct Impl {
+template <typename Bitfield, typename StorageType> struct LLVM_CLASS_ABI Impl {
   static_assert(std::is_unsigned<StorageType>::value,
                 "Storage must be unsigned");
   using IntegerType = typename Bitfield::IntegerType;
@@ -195,13 +195,13 @@ template <typename Bitfield, typename StorageType> struct Impl {
 /// with their unsigned counterparts. The correct type is restored in the public
 /// API.
 template <typename T, bool = std::is_enum<T>::value>
-struct ResolveUnderlyingType {
+struct LLVM_CLASS_ABI ResolveUnderlyingType {
   using type = std::underlying_type_t<T>;
 };
-template <typename T> struct ResolveUnderlyingType<T, false> {
+template <typename T> struct LLVM_CLASS_ABI ResolveUnderlyingType<T, false> {
   using type = T;
 };
-template <> struct ResolveUnderlyingType<bool, false> {
+template <> struct LLVM_CLASS_ABI ResolveUnderlyingType<bool, false> {
   /// In case sizeof(bool) != 1, replace `void` by an additionnal
   /// std::conditional.
   using type = std::conditional_t<sizeof(bool) == 1, uint8_t, void>;
@@ -210,7 +210,7 @@ template <> struct ResolveUnderlyingType<bool, false> {
 } // namespace bitfields_details
 
 /// Holds functions to get, set or test bitfields.
-struct Bitfield {
+struct LLVM_CLASS_ABI Bitfield {
   /// Describes an element of a Bitfield. This type is then used with the
   /// Bitfield static member functions.
   /// \tparam T         The type of the field once in unpacked form.
diff --git a/llvm/include/llvm/ADT/BitmaskEnum.h b/llvm/include/llvm/ADT/BitmaskEnum.h
index 4080e67e05dcc51..398352d3bca13d2 100644
--- a/llvm/include/llvm/ADT/BitmaskEnum.h
+++ b/llvm/include/llvm/ADT/BitmaskEnum.h
@@ -95,10 +95,10 @@ namespace llvm {
 /// Traits class to determine whether an enum has a
 /// LLVM_BITMASK_LARGEST_ENUMERATOR enumerator.
 template <typename E, typename Enable = void>
-struct is_bitmask_enum : std::false_type {};
+struct LLVM_CLASS_ABI is_bitmask_enum : std::false_type {};
 
 template <typename E>
-struct is_bitmask_enum<
+struct LLVM_CLASS_ABI is_bitmask_enum<
     E, std::enable_if_t<sizeof(E::LLVM_BITMASK_LARGEST_ENUMERATOR) >= 0>>
     : std::true_type {};
 
@@ -106,7 +106,7 @@ struct is_bitmask_enum<
 template <typename E, typename Enable = void> struct largest_bitmask_enum_bit;
 
 template <typename E>
-struct largest_bitmask_enum_bit<
+struct LLVM_CLASS_ABI largest_bitmask_enum_bit<
     E, std::enable_if_t<sizeof(E::LLVM_BITMASK_LARGEST_ENUMERATOR) >= 0>> {
   using UnderlyingTy = std::underlying_type_t<E>;
   static constexpr UnderlyingTy value =
diff --git a/llvm/include/llvm/ADT/BreadthFirstIterator.h b/llvm/include/llvm/ADT/BreadthFirstIterator.h
index cebaf9eec709a7c..7664ce68ac2a85d 100644
--- a/llvm/include/llvm/ADT/BreadthFirstIterator.h
+++ b/llvm/include/llvm/ADT/BreadthFirstIterator.h
@@ -31,7 +31,7 @@ namespace llvm {
 
 // bf_iterator_storage - A private class which is used to figure out where to
 // store the visited set. We only provide a non-external variant for now.
-template <class SetType> class bf_iterator_storage {
+template <class SetType> class LLVM_CLASS_ABI bf_iterator_storage {
 public:
   SetType Visited;
 };
@@ -45,7 +45,7 @@ template <class GraphT,
           class SetType =
               bf_iterator_default_set<typename GraphTraits<GraphT>::NodeRef>,
           class GT = GraphTraits<GraphT>>
-class bf_iterator : public bf_iterator_storage<SetType> {
+class LLVM_CLASS_ABI bf_iterator : public bf_iterator_storage<SetType> {
 public:
   using iterator_category = std::forward_iterator_tag;
   using value_type = typename GT::NodeRef;
diff --git a/llvm/include/llvm/ADT/CachedHashString.h b/llvm/include/llvm/ADT/CachedHashString.h
index ea44cb0cb8784e1..efc4fd0dd33b9bf 100644
--- a/llvm/include/llvm/ADT/CachedHashString.h
+++ b/llvm/include/llvm/ADT/CachedHashString.h
@@ -27,7 +27,7 @@
 namespace llvm {
 
 /// A container which contains a StringRef plus a precomputed hash.
-class CachedHashStringRef {
+class LLVM_CLASS_ABI CachedHashStringRef {
   const char *P;
   uint32_t Size;
   uint32_t Hash;
@@ -48,7 +48,7 @@ class CachedHashStringRef {
   uint32_t hash() const { return Hash; }
 };
 
-template <> struct DenseMapInfo<CachedHashStringRef> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<CachedHashStringRef> {
   static CachedHashStringRef getEmptyKey() {
     return CachedHashStringRef(DenseMapInfo<StringRef>::getEmptyKey(), 0);
   }
@@ -70,7 +70,7 @@ template <> struct DenseMapInfo<CachedHashStringRef> {
 /// A container which contains a string, which it owns, plus a precomputed hash.
 ///
 /// We do not null-terminate the string.
-class CachedHashString {
+class LLVM_CLASS_ABI CachedHashString {
   friend struct DenseMapInfo<CachedHashString>;
 
   char *P;
@@ -151,7 +151,7 @@ class CachedHashString {
   }
 };
 
-template <> struct DenseMapInfo<CachedHashString> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<CachedHashString> {
   static CachedHashString getEmptyKey() {
     return CachedHashString(CachedHashString::ConstructEmptyOrTombstoneTy(),
                             CachedHashString::getEmptyKeyPtr());
diff --git a/llvm/include/llvm/ADT/CoalescingBitVector.h b/llvm/include/llvm/ADT/CoalescingBitVector.h
index 0cf1eda9a9259ae..f82d4fd7588ca0e 100644
--- a/llvm/include/llvm/ADT/CoalescingBitVector.h
+++ b/llvm/include/llvm/ADT/CoalescingBitVector.h
@@ -36,7 +36,7 @@ namespace llvm {
 /// performance for non-sequential find() operations.
 ///
 /// \tparam IndexT - The type of the index into the bitvector.
-template <typename IndexT> class CoalescingBitVector {
+template <typename IndexT> class LLVM_CLASS_ABI CoalescingBitVector {
   static_assert(std::is_unsigned<IndexT>::value,
                 "Index must be an unsigned integer.");
 
diff --git a/llvm/include/llvm/ADT/CombinationGenerator.h b/llvm/include/llvm/ADT/CombinationGenerator.h
index a0bec68eaad60df..7062f3cafb9b369 100644
--- a/llvm/include/llvm/ADT/CombinationGenerator.h
+++ b/llvm/include/llvm/ADT/CombinationGenerator.h
@@ -37,7 +37,7 @@ namespace llvm {
 
 template <typename choice_type, typename choices_storage_type,
           int variable_smallsize>
-class CombinationGenerator {
+class LLVM_CLASS_ABI CombinationGenerator {
   template <typename T> struct WrappingIterator {
     using value_type = T;
 
diff --git a/llvm/include/llvm/ADT/ConcurrentHashtable.h b/llvm/include/llvm/ADT/ConcurrentHashtable.h
index 858479ffe47486f..3139fa359398fc0 100644
--- a/llvm/include/llvm/ADT/ConcurrentHashtable.h
+++ b/llvm/include/llvm/ADT/ConcurrentHashtable.h
@@ -74,7 +74,7 @@ namespace llvm {
 /// KeyDataTy items.
 
 template <typename KeyTy, typename KeyDataTy, typename AllocatorTy>
-class ConcurrentHashTableInfoByPtr {
+class LLVM_CLASS_ABI ConcurrentHashTableInfoByPtr {
 public:
   /// \returns Hash value for the specified \p Key.
   static inline uint64_t getHashValue(const KeyTy &Key) {
@@ -100,7 +100,7 @@ class ConcurrentHashTableInfoByPtr {
 template <typename KeyTy, typename KeyDataTy, typename AllocatorTy,
           typename Info =
               ConcurrentHashTableInfoByPtr<KeyTy, KeyDataTy, AllocatorTy>>
-class ConcurrentHashTableByPtr {
+class LLVM_CLASS_ABI ConcurrentHashTableByPtr {
 public:
   ConcurrentHashTableByPtr(
       AllocatorTy &Allocator, uint64_t EstimatedSize = 100000,
diff --git a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
index 3d733c2a4a62f66..641caa6b4e2f108 100644
--- a/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
+++ b/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h
@@ -36,7 +36,7 @@ namespace llvm {
 /// 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_CLASS_ABI DAGDeltaAlgorithm {
   virtual void anchor();
 
 public:
diff --git a/llvm/include/llvm/ADT/DeltaAlgorithm.h b/llvm/include/llvm/ADT/DeltaAlgorithm.h
index a9843177662d467..e6647539ee907b7 100644
--- a/llvm/include/llvm/ADT/DeltaAlgorithm.h
+++ b/llvm/include/llvm/ADT/DeltaAlgorithm.h
@@ -33,7 +33,7 @@ namespace llvm {
 /// 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_CLASS_ABI DeltaAlgorithm {
 public:
   using change_ty = unsigned;
   // FIXME: Use a decent data structure.
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index 3ef6a7cd1b4b587..075240b3301cf4b 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -39,7 +39,7 @@ namespace detail {
 // We extend a pair to allow users to override the bucket type with their own
 // implementation without requiring two members.
 template <typename KeyT, typename ValueT>
-struct DenseMapPair : public std::pair<KeyT, ValueT> {
+struct LLVM_CLASS_ABI DenseMapPair : public std::pair<KeyT, ValueT> {
   using std::pair<KeyT, ValueT>::pair;
 
   KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; }
@@ -58,7 +58,7 @@ class DenseMapIterator;
 
 template <typename DerivedT, typename KeyT, typename ValueT, typename KeyInfoT,
           typename BucketT>
-class DenseMapBase : public DebugEpochBase {
+class LLVM_CLASS_ABI DenseMapBase : public DebugEpochBase {
   template <typename T>
   using const_arg_type_t = typename const_pointer_or_const_ref<T>::type;
 
@@ -738,7 +738,7 @@ bool operator!=(
 template <typename KeyT, typename ValueT,
           typename KeyInfoT = DenseMapInfo<KeyT>,
           typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
-class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
+class LLVM_CLASS_ABI DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
                                      KeyT, ValueT, KeyInfoT, BucketT> {
   friend class DenseMapBase<DenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
 
@@ -904,7 +904,7 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
 template <typename KeyT, typename ValueT, unsigned InlineBuckets = 4,
           typename KeyInfoT = DenseMapInfo<KeyT>,
           typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
-class SmallDenseMap
+class LLVM_CLASS_ABI SmallDenseMap
     : public DenseMapBase<
           SmallDenseMap<KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT>, KeyT,
           ValueT, KeyInfoT, BucketT> {
@@ -1218,7 +1218,7 @@ class SmallDenseMap
 
 template <typename KeyT, typename ValueT, typename KeyInfoT, typename Bucket,
           bool IsConst>
-class DenseMapIterator : DebugEpochBase::HandleBase {
+class LLVM_CLASS_ABI DenseMapIterator : DebugEpochBase::HandleBase {
   friend class DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, true>;
   friend class DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, false>;
 
diff --git a/llvm/include/llvm/ADT/DenseSet.h b/llvm/include/llvm/ADT/DenseSet.h
index bd08a419bb7323c..c43aa8840fcb415 100644
--- a/llvm/include/llvm/ADT/DenseSet.h
+++ b/llvm/include/llvm/ADT/DenseSet.h
@@ -28,11 +28,11 @@ namespace llvm {
 
 namespace detail {
 
-struct DenseSetEmpty {};
+struct LLVM_CLASS_ABI DenseSetEmpty {};
 
 // Use the empty base class trick so we can create a DenseMap where the buckets
 // contain only a single item.
-template <typename KeyT> class DenseSetPair : public DenseSetEmpty {
+template <typename KeyT> class LLVM_CLASS_ABI DenseSetPair : public DenseSetEmpty {
   KeyT key;
 
 public:
@@ -52,7 +52,7 @@ template <typename KeyT> class DenseSetPair : public DenseSetEmpty {
 /// or the equivalent SmallDenseMap type.  ValueInfoT must implement the
 /// DenseMapInfo "concept".
 template <typename ValueT, typename MapTy, typename ValueInfoT>
-class DenseSetImpl {
+class LLVM_CLASS_ABI DenseSetImpl {
   static_assert(sizeof(typename MapTy::value_type) == sizeof(ValueT),
                 "DenseMap buckets unexpectedly large!");
   MapTy TheMap;
@@ -266,7 +266,7 @@ bool operator!=(const DenseSetImpl<ValueT, MapTy, ValueInfoT> &LHS,
 
 /// Implements a dense probed hash-table based set.
 template <typename ValueT, typename ValueInfoT = DenseMapInfo<ValueT>>
-class DenseSet : public detail::DenseSetImpl<
+class LLVM_CLASS_ABI DenseSet : public detail::DenseSetImpl<
                      ValueT, DenseMap<ValueT, detail::DenseSetEmpty, ValueInfoT,
                                       detail::DenseSetPair<ValueT>>,
                      ValueInfoT> {
@@ -284,7 +284,7 @@ class DenseSet : public detail::DenseSetImpl<
 /// stored inline.
 template <typename ValueT, unsigned InlineBuckets = 4,
           typename ValueInfoT = DenseMapInfo<ValueT>>
-class SmallDenseSet
+class LLVM_CLASS_ABI SmallDenseSet
     : public detail::DenseSetImpl<
           ValueT, SmallDenseMap<ValueT, detail::DenseSetEmpty, InlineBuckets,
                                 ValueInfoT, detail::DenseSetPair<ValueT>>,
diff --git a/llvm/include/llvm/ADT/DepthFirstIterator.h b/llvm/include/llvm/ADT/DepthFirstIterator.h
index 4f93c91576d38d1..df5d5dac21611e0 100644
--- a/llvm/include/llvm/ADT/DepthFirstIterator.h
+++ b/llvm/include/llvm/ADT/DepthFirstIterator.h
@@ -48,13 +48,13 @@ namespace llvm {
 // df_iterator_storage - A private class which is used to figure out where to
 // store the visited set.
 template<class SetType, bool External>   // Non-external set
-class df_iterator_storage {
+class LLVM_CLASS_ABI df_iterator_storage {
 public:
   SetType Visited;
 };
 
 template<class SetType>
-class df_iterator_storage<SetType, true> {
+class LLVM_CLASS_ABI df_iterator_storage<SetType, true> {
 public:
   df_iterator_storage(SetType &VSet) : Visited(VSet) {}
   df_iterator_storage(const df_iterator_storage &S) : Visited(S.Visited) {}
@@ -67,7 +67,7 @@ class df_iterator_storage<SetType, true> {
 // node have been processed. It is intended to distinguish of back and
 // cross edges in the spanning tree but is not used in the common case.
 template <typename NodeRef, unsigned SmallSize=8>
-struct df_iterator_default_set : public SmallPtrSet<NodeRef, SmallSize> {
+struct LLVM_CLASS_ABI df_iterator_default_set : public SmallPtrSet<NodeRef, SmallSize> {
   using BaseSet = SmallPtrSet<NodeRef, SmallSize>;
   using iterator = typename BaseSet::iterator;
 
@@ -83,7 +83,7 @@ template <class GraphT,
           class SetType =
               df_iterator_default_set<typename GraphTraits<GraphT>::NodeRef>,
           bool ExtStorage = false, class GT = GraphTraits<GraphT>>
-class df_iterator : public df_iterator_storage<SetType, ExtStorage> {
+class LLVM_CLASS_ABI df_iterator : public df_iterator_storage<SetType, ExtStorage> {
 public:
   using iterator_category = std::forward_iterator_tag;
   using value_type = typename GT::NodeRef;
@@ -233,7 +233,7 @@ iterator_range<df_iterator<T>> depth_first(const T& G) {
 
 // Provide global definitions of external depth first iterators...
 template <class T, class SetTy = df_iterator_default_set<typename GraphTraits<T>::NodeRef>>
-struct df_ext_iterator : public df_iterator<T, SetTy, true> {
+struct LLVM_CLASS_ABI df_ext_iterator : public df_iterator<T, SetTy, true> {
   df_ext_iterator(const df_iterator<T, SetTy, true> &V)
     : df_iterator<T, SetTy, true>(V) {}
 };
@@ -259,7 +259,7 @@ template <class T,
           class SetTy =
               df_iterator_default_set<typename GraphTraits<T>::NodeRef>,
           bool External = false>
-struct idf_iterator : public df_iterator<Inverse<T>, SetTy, External> {
+struct LLVM_CLASS_ABI idf_iterator : public df_iterator<Inverse<T>, SetTy, External> {
   idf_iterator(const df_iterator<Inverse<T>, SetTy, External> &V)
     : df_iterator<Inverse<T>, SetTy, External>(V) {}
 };
@@ -282,7 +282,7 @@ iterator_range<idf_iterator<T>> inverse_depth_first(const T& G) {
 
 // Provide global definitions of external inverse depth first iterators...
 template <class T, class SetTy = df_iterator_default_set<typename GraphTraits<T>::NodeRef>>
-struct idf_ext_iterator : public idf_iterator<T, SetTy, true> {
+struct LLVM_CLASS_ABI idf_ext_iterator : public idf_iterator<T, SetTy, true> {
   idf_ext_iterator(const idf_iterator<T, SetTy, true> &V)
     : idf_iterator<T, SetTy, true>(V) {}
   idf_ext_iterator(const df_iterator<Inverse<T>, SetTy, true> &V)
diff --git a/llvm/include/llvm/ADT/DirectedGraph.h b/llvm/include/llvm/ADT/DirectedGraph.h
index dd012b8b5df8069..55c79f73338b678 100644
--- a/llvm/include/llvm/ADT/DirectedGraph.h
+++ b/llvm/include/llvm/ADT/DirectedGraph.h
@@ -26,7 +26,7 @@ namespace llvm {
 
 /// Represent an edge in the directed graph.
 /// The edge contains the target node it connects to.
-template <class NodeType, class EdgeType> class DGEdge {
+template <class NodeType, class EdgeType> class LLVM_CLASS_ABI DGEdge {
 public:
   DGEdge() = delete;
   /// Create an edge pointing to the given node \p N.
@@ -71,7 +71,7 @@ template <class NodeType, class EdgeType> class DGEdge {
 
 /// Represent a node in the directed graph.
 /// The node has a (possibly empty) list of outgoing edges.
-template <class NodeType, class EdgeType> class DGNode {
+template <class NodeType, class EdgeType> class LLVM_CLASS_ABI DGNode {
 public:
   using EdgeListTy = SetVector<EdgeType *>;
   using iterator = typename EdgeListTy::iterator;
@@ -171,7 +171,7 @@ template <class NodeType, class EdgeType> class DGNode {
 /// The graph is represented by a table of nodes.
 /// Each node contains a (possibly empty) list of outgoing edges.
 /// Each edge contains the target node it connects to.
-template <class NodeType, class EdgeType> class DirectedGraph {
+template <class NodeType, class EdgeType> class LLVM_CLASS_ABI DirectedGraph {
 protected:
   using NodeListTy = SmallVector<NodeType *, 10>;
   using EdgeListTy = SmallVector<EdgeType *, 10>;
diff --git a/llvm/include/llvm/ADT/EnumeratedArray.h b/llvm/include/llvm/ADT/EnumeratedArray.h
index 47921d079e29b6d..2249313addb8f93 100644
--- a/llvm/include/llvm/ADT/EnumeratedArray.h
+++ b/llvm/include/llvm/ADT/EnumeratedArray.h
@@ -24,7 +24,7 @@ namespace llvm {
 template <typename ValueType, typename Enumeration,
           Enumeration LargestEnum = Enumeration::Last, typename IndexType = int,
           IndexType Size = 1 + static_cast<IndexType>(LargestEnum)>
-class EnumeratedArray {
+class LLVM_CLASS_ABI EnumeratedArray {
 public:
   using iterator = ValueType *;
   using const_iterator = const ValueType *;
diff --git a/llvm/include/llvm/ADT/EpochTracker.h b/llvm/include/llvm/ADT/EpochTracker.h
index 5efb46f70339816..24e8af5490fa4a9 100644
--- a/llvm/include/llvm/ADT/EpochTracker.h
+++ b/llvm/include/llvm/ADT/EpochTracker.h
@@ -86,7 +86,7 @@ class DebugEpochBase {
 #define LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE
 #endif // _MSC_VER
 
-class DebugEpochBase {
+class LLVM_CLASS_ABI DebugEpochBase {
 public:
   void incrementEpoch() {}
 
diff --git a/llvm/include/llvm/ADT/EquivalenceClasses.h b/llvm/include/llvm/ADT/EquivalenceClasses.h
index 4feda9cb4784f72..060651f1bda0126 100644
--- a/llvm/include/llvm/ADT/EquivalenceClasses.h
+++ b/llvm/include/llvm/ADT/EquivalenceClasses.h
@@ -58,7 +58,7 @@ namespace llvm {
 ///   5 1 2
 ///
 template <class ElemTy, class Compare = std::less<ElemTy>>
-class EquivalenceClasses {
+class LLVM_CLASS_ABI EquivalenceClasses {
   /// ECValue - The EquivalenceClasses data structure is just a set of these.
   /// Each of these represents a relation for a value.  First it stores the
   /// value itself, which provides the ordering that the set queries.  Next, it
diff --git a/llvm/include/llvm/ADT/FloatingPointMode.h b/llvm/include/llvm/ADT/FloatingPointMode.h
index 3e94054daa663e8..252c42ad39f729d 100644
--- a/llvm/include/llvm/ADT/FloatingPointMode.h
+++ b/llvm/include/llvm/ADT/FloatingPointMode.h
@@ -68,7 +68,7 @@ inline raw_ostream &operator << (raw_ostream &OS, RoundingMode RM) {
 
 /// Represent subnormal handling kind for floating point instruction inputs and
 /// outputs.
-struct DenormalMode {
+struct LLVM_CLASS_ABI DenormalMode {
   /// Represent handled modes for denormal (aka subnormal) modes in the floating
   /// point environment.
   enum DenormalModeKind : int8_t {
@@ -266,13 +266,13 @@ enum FPClassTest : unsigned {
 LLVM_DECLARE_ENUM_AS_BITMASK(FPClassTest, /* LargestValue */ fcPosInf);
 
 /// Return the test mask which returns true if the value's sign bit is flipped.
-FPClassTest fneg(FPClassTest Mask);
+LLVM_FUNC_ABI FPClassTest fneg(FPClassTest Mask);
 
 /// Return the test mask which returns true if the value's sign bit is cleared.
-FPClassTest fabs(FPClassTest Mask);
+LLVM_FUNC_ABI FPClassTest fabs(FPClassTest Mask);
 
 /// Write a human readable form of \p Mask to \p OS
-raw_ostream &operator<<(raw_ostream &OS, FPClassTest Mask);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, FPClassTest Mask);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/ADT/FoldingSet.h b/llvm/include/llvm/ADT/FoldingSet.h
index 7a5dc8ca3e67f8d..d21d1bd0c15413c 100644
--- a/llvm/include/llvm/ADT/FoldingSet.h
+++ b/llvm/include/llvm/ADT/FoldingSet.h
@@ -113,7 +113,7 @@ class StringRef;
 /// 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_CLASS_ABI FoldingSetBase {
 protected:
   /// Buckets - Array of bucket chains.
   void **Buckets;
@@ -229,7 +229,7 @@ class FoldingSetBase {
 
 /// DefaultFoldingSetTrait - This class provides default implementations
 /// for FoldingSetTrait implementations.
-template<typename T> struct DefaultFoldingSetTrait {
+template<typename T> struct LLVM_CLASS_ABI DefaultFoldingSetTrait {
   static void Profile(const T &X, FoldingSetNodeID &ID) {
     X.Profile(ID);
   }
@@ -259,12 +259,12 @@ template<typename T> struct DefaultFoldingSetTrait {
 /// types.  Combined with the FoldingSetNodeWrapper class, one can add objects
 /// to FoldingSets that were not originally designed to have that behavior.
 template <typename T, typename Enable = void>
-struct FoldingSetTrait : public DefaultFoldingSetTrait<T> {};
+struct LLVM_CLASS_ABI FoldingSetTrait : public DefaultFoldingSetTrait<T> {};
 
 /// DefaultContextualFoldingSetTrait - Like DefaultFoldingSetTrait, but
 /// for ContextualFoldingSets.
 template<typename T, typename Ctx>
-struct DefaultContextualFoldingSetTrait {
+struct LLVM_CLASS_ABI DefaultContextualFoldingSetTrait {
   static void Profile(T &X, FoldingSetNodeID &ID, Ctx Context) {
     X.Profile(ID, Context);
   }
@@ -277,7 +277,7 @@ struct DefaultContextualFoldingSetTrait {
 
 /// ContextualFoldingSetTrait - Like FoldingSetTrait, but for
 /// ContextualFoldingSets.
-template<typename T, typename Ctx> struct ContextualFoldingSetTrait
+template<typename T, typename Ctx> struct LLVM_CLASS_ABI ContextualFoldingSetTrait
   : public DefaultContextualFoldingSetTrait<T, Ctx> {};
 
 //===--------------------------------------------------------------------===//
@@ -286,7 +286,7 @@ template<typename T, typename Ctx> struct ContextualFoldingSetTrait
 /// 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_CLASS_ABI FoldingSetNodeIDRef {
   const unsigned *Data = nullptr;
   size_t Size = 0;
 
@@ -316,7 +316,7 @@ class FoldingSetNodeIDRef {
 /// 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_CLASS_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;
@@ -433,7 +433,7 @@ DefaultContextualFoldingSetTrait<T, Ctx>::ComputeHash(T &X,
 //===----------------------------------------------------------------------===//
 /// FoldingSetImpl - An implementation detail that lets us share code between
 /// FoldingSet and ContextualFoldingSet.
-template <class Derived, class T> class FoldingSetImpl : public FoldingSetBase {
+template <class Derived, class T> class LLVM_CLASS_ABI FoldingSetImpl : public FoldingSetBase {
 protected:
   explicit FoldingSetImpl(unsigned Log2InitSize)
       : FoldingSetBase(Log2InitSize) {}
@@ -518,7 +518,7 @@ template <class Derived, class T> class FoldingSetImpl : public FoldingSetBase {
 /// move-assigning and destroying. This is primarily to enable movable APIs
 /// that incorporate these objects.
 template <class T>
-class FoldingSet : public FoldingSetImpl<FoldingSet<T>, T> {
+class LLVM_CLASS_ABI FoldingSet : public FoldingSetImpl<FoldingSet<T>, T> {
   using Super = FoldingSetImpl<FoldingSet, T>;
   using Node = typename Super::Node;
 
@@ -570,7 +570,7 @@ class FoldingSet : public FoldingSetImpl<FoldingSet<T>, T> {
 /// function with signature
 ///   void Profile(FoldingSetNodeID &, Ctx);
 template <class T, class Ctx>
-class ContextualFoldingSet
+class LLVM_CLASS_ABI ContextualFoldingSet
     : public FoldingSetImpl<ContextualFoldingSet<T, Ctx>, T> {
   // Unfortunately, this can't derive from FoldingSet<T> because the
   // construction of the vtable for FoldingSet<T> requires
@@ -629,7 +629,7 @@ class ContextualFoldingSet
 /// order based on the insertion order. T must be a subclass of FoldingSetNode
 /// and implement a Profile function.
 template <class T, class VectorT = SmallVector<T*, 8>>
-class FoldingSetVector {
+class LLVM_CLASS_ABI FoldingSetVector {
   FoldingSet<T> Set;
   VectorT Vector;
 
@@ -690,7 +690,7 @@ class FoldingSetVector {
 //===----------------------------------------------------------------------===//
 /// 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_CLASS_ABI FoldingSetIteratorImpl {
 protected:
   FoldingSetNode *NodePtr;
 
@@ -707,7 +707,7 @@ class FoldingSetIteratorImpl {
   }
 };
 
-template <class T> class FoldingSetIterator : public FoldingSetIteratorImpl {
+template <class T> class LLVM_CLASS_ABI FoldingSetIterator : public FoldingSetIteratorImpl {
 public:
   explicit FoldingSetIterator(void **Bucket) : FoldingSetIteratorImpl(Bucket) {}
 
@@ -732,7 +732,7 @@ template <class T> class FoldingSetIterator : public FoldingSetIteratorImpl {
 /// FoldingSetBucketIteratorImpl - This is the common bucket iterator support
 /// shared by all folding sets, which knows how to walk a particular bucket
 /// of a folding set hash table.
-class FoldingSetBucketIteratorImpl {
+class LLVM_CLASS_ABI FoldingSetBucketIteratorImpl {
 protected:
   void *Ptr;
 
@@ -756,7 +756,7 @@ class FoldingSetBucketIteratorImpl {
 };
 
 template <class T>
-class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
+class LLVM_CLASS_ABI FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
 public:
   explicit FoldingSetBucketIterator(void **Bucket) :
     FoldingSetBucketIteratorImpl(Bucket) {}
@@ -780,7 +780,7 @@ class FoldingSetBucketIterator : public FoldingSetBucketIteratorImpl {
 /// FoldingSetNodeWrapper - This template class is used to "wrap" arbitrary
 /// types in an enclosing object so that they can be inserted into FoldingSets.
 template <typename T>
-class FoldingSetNodeWrapper : public FoldingSetNode {
+class LLVM_CLASS_ABI FoldingSetNodeWrapper : public FoldingSetNode {
   T data;
 
 public:
@@ -803,7 +803,7 @@ class FoldingSetNodeWrapper : public FoldingSetNode {
 /// each time it is needed. This trades space for speed (which can be
 /// significant if the ID is long), and it also permits nodes to drop
 /// information that would otherwise only be required for recomputing an ID.
-class FastFoldingSetNode : public FoldingSetNode {
+class LLVM_CLASS_ABI FastFoldingSetNode : public FoldingSetNode {
   FoldingSetNodeID FastID;
 
 protected:
@@ -816,13 +816,13 @@ class FastFoldingSetNode : public FoldingSetNode {
 //===----------------------------------------------------------------------===//
 // Partial specializations of FoldingSetTrait.
 
-template<typename T> struct FoldingSetTrait<T*> {
+template<typename T> struct LLVM_CLASS_ABI FoldingSetTrait<T*> {
   static inline void Profile(T *X, FoldingSetNodeID &ID) {
     ID.AddPointer(X);
   }
 };
 template <typename T1, typename T2>
-struct FoldingSetTrait<std::pair<T1, T2>> {
+struct LLVM_CLASS_ABI FoldingSetTrait<std::pair<T1, T2>> {
   static inline void Profile(const std::pair<T1, T2> &P,
                              FoldingSetNodeID &ID) {
     ID.Add(P.first);
@@ -831,7 +831,7 @@ struct FoldingSetTrait<std::pair<T1, T2>> {
 };
 
 template <typename T>
-struct FoldingSetTrait<T, std::enable_if_t<std::is_enum<T>::value>> {
+struct LLVM_CLASS_ABI FoldingSetTrait<T, std::enable_if_t<std::is_enum<T>::value>> {
   static void Profile(const T &X, FoldingSetNodeID &ID) {
     ID.AddInteger(static_cast<std::underlying_type_t<T>>(X));
   }
diff --git a/llvm/include/llvm/ADT/FunctionExtras.h b/llvm/include/llvm/ADT/FunctionExtras.h
index 5635fcc7d61dc75..b53e11445646264 100644
--- a/llvm/include/llvm/ADT/FunctionExtras.h
+++ b/llvm/include/llvm/ADT/FunctionExtras.h
@@ -77,7 +77,7 @@ using EnableIfCallable = std::enable_if_t<std::disjunction<
                             std::declval<Params>()...)),
                         Ret>>::value>;
 
-template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
+template <typename ReturnT, typename... ParamTs> class LLVM_CLASS_ABI UniqueFunctionBase {
 protected:
   static constexpr size_t InlineStorageSize = sizeof(void *) * 3;
 
@@ -360,7 +360,7 @@ typename UniqueFunctionBase<R, P...>::TrivialCallback
 } // namespace detail
 
 template <typename R, typename... P>
-class unique_function<R(P...)> : public detail::UniqueFunctionBase<R, P...> {
+class LLVM_CLASS_ABI unique_function<R(P...)> : public detail::UniqueFunctionBase<R, P...> {
   using Base = detail::UniqueFunctionBase<R, P...>;
 
 public:
@@ -385,7 +385,7 @@ class unique_function<R(P...)> : public detail::UniqueFunctionBase<R, P...> {
 };
 
 template <typename R, typename... P>
-class unique_function<R(P...) const>
+class LLVM_CLASS_ABI unique_function<R(P...) const>
     : public detail::UniqueFunctionBase<R, P...> {
   using Base = detail::UniqueFunctionBase<R, P...>;
 
diff --git a/llvm/include/llvm/ADT/GenericCycleImpl.h b/llvm/include/llvm/ADT/GenericCycleImpl.h
index 8003ff7275b72a7..f7809e74ff528bc 100644
--- a/llvm/include/llvm/ADT/GenericCycleImpl.h
+++ b/llvm/include/llvm/ADT/GenericCycleImpl.h
@@ -106,7 +106,7 @@ auto GenericCycle<ContextT>::getCyclePredecessor() const -> BlockT * {
 }
 
 /// \brief Helper class for computing cycle information.
-template <typename ContextT> class GenericCycleInfoCompute {
+template <typename ContextT> class LLVM_CLASS_ABI GenericCycleInfoCompute {
   using BlockT = typename ContextT::BlockT;
   using CycleInfoT = GenericCycleInfo<ContextT>;
   using CycleT = typename CycleInfoT::CycleT;
diff --git a/llvm/include/llvm/ADT/GenericCycleInfo.h b/llvm/include/llvm/ADT/GenericCycleInfo.h
index 70185b5024766d8..420d3ca50f7e2b6 100644
--- a/llvm/include/llvm/ADT/GenericCycleInfo.h
+++ b/llvm/include/llvm/ADT/GenericCycleInfo.h
@@ -42,7 +42,7 @@ template <typename ContextT> class GenericCycleInfo;
 template <typename ContextT> class GenericCycleInfoCompute;
 
 /// A possibly irreducible generalization of a \ref Loop.
-template <typename ContextT> class GenericCycle {
+template <typename ContextT> class LLVM_CLASS_ABI GenericCycle {
 public:
   using BlockT = typename ContextT::BlockT;
   using FunctionT = typename ContextT::FunctionT;
@@ -220,7 +220,7 @@ template <typename ContextT> class GenericCycle {
 };
 
 /// \brief Cycle information for a function.
-template <typename ContextT> class GenericCycleInfo {
+template <typename ContextT> class LLVM_CLASS_ABI GenericCycleInfo {
 public:
   using BlockT = typename ContextT::BlockT;
   using CycleT = GenericCycle<ContextT>;
@@ -306,7 +306,7 @@ template <typename ContextT> class GenericCycleInfo {
 };
 
 /// \brief GraphTraits for iterating over a sub-tree of the CycleT tree.
-template <typename CycleRefT, typename ChildIteratorT> struct CycleGraphTraits {
+template <typename CycleRefT, typename ChildIteratorT> struct LLVM_CLASS_ABI CycleGraphTraits {
   using NodeRef = CycleRefT;
 
   using nodes_iterator = ChildIteratorT;
@@ -341,11 +341,11 @@ template <typename CycleRefT, typename ChildIteratorT> struct CycleGraphTraits {
 };
 
 template <typename BlockT>
-struct GraphTraits<const GenericCycle<BlockT> *>
+struct LLVM_CLASS_ABI GraphTraits<const GenericCycle<BlockT> *>
     : CycleGraphTraits<const GenericCycle<BlockT> *,
                        typename GenericCycle<BlockT>::const_child_iterator> {};
 template <typename BlockT>
-struct GraphTraits<GenericCycle<BlockT> *>
+struct LLVM_CLASS_ABI GraphTraits<GenericCycle<BlockT> *>
     : CycleGraphTraits<GenericCycle<BlockT> *,
                        typename GenericCycle<BlockT>::const_child_iterator> {};
 
diff --git a/llvm/include/llvm/ADT/GenericSSAContext.h b/llvm/include/llvm/ADT/GenericSSAContext.h
index 36565973b20ef87..769ee286694b046 100644
--- a/llvm/include/llvm/ADT/GenericSSAContext.h
+++ b/llvm/include/llvm/ADT/GenericSSAContext.h
@@ -22,7 +22,7 @@
 
 namespace llvm {
 
-template <typename _FunctionT> class GenericSSAContext {
+template <typename _FunctionT> class LLVM_CLASS_ABI GenericSSAContext {
 public:
   // Specializations should provide the following types that are similar to how
   // LLVM IR is structured:
diff --git a/llvm/include/llvm/ADT/GenericUniformityImpl.h b/llvm/include/llvm/ADT/GenericUniformityImpl.h
index ba15c38c1c18fc8..94b2d482a90a2f6 100644
--- a/llvm/include/llvm/ADT/GenericUniformityImpl.h
+++ b/llvm/include/llvm/ADT/GenericUniformityImpl.h
@@ -84,7 +84,7 @@ template <typename Range> auto unique(Range &&R) {
 ///    Each node is visited after all its predecessors, except if that
 ///    predecessor is the cycle header.
 ///
-template <typename ContextT> class ModifiedPostOrder {
+template <typename ContextT> class LLVM_CLASS_ABI ModifiedPostOrder {
 public:
   using BlockT = typename ContextT::BlockT;
   using FunctionT = typename ContextT::FunctionT;
@@ -257,7 +257,7 @@ template <typename> class DivergencePropagator;
 //     Matthew S. Hecht and Jeffrey D. Ullman.
 //     SIAM Journal on Computing, 4(4):519–532, December 1975.
 //
-template <typename ContextT> class GenericSyncDependenceAnalysis {
+template <typename ContextT> class LLVM_CLASS_ABI GenericSyncDependenceAnalysis {
 public:
   using BlockT = typename ContextT::BlockT;
   using DominatorTreeT = typename ContextT::DominatorTreeT;
@@ -325,7 +325,7 @@ template <typename ContextT> class GenericSyncDependenceAnalysis {
 /// This analysis propagates divergence in a data-parallel context
 /// from sources of divergence to all users. It can be instantiated
 /// for an IR that provides a suitable SSAContext.
-template <typename ContextT> class GenericUniformityAnalysisImpl {
+template <typename ContextT> class LLVM_CLASS_ABI GenericUniformityAnalysisImpl {
 public:
   using BlockT = typename ContextT::BlockT;
   using FunctionT = typename ContextT::FunctionT;
@@ -480,7 +480,7 @@ void GenericUniformityAnalysisImplDeleter<ImplT>::operator()(ImplT *Impl) {
 }
 
 /// Compute divergence starting with a divergent branch.
-template <typename ContextT> class DivergencePropagator {
+template <typename ContextT> class LLVM_CLASS_ABI DivergencePropagator {
 public:
   using BlockT = typename ContextT::BlockT;
   using DominatorTreeT = typename ContextT::DominatorTreeT;
diff --git a/llvm/include/llvm/ADT/GenericUniformityInfo.h b/llvm/include/llvm/ADT/GenericUniformityInfo.h
index 5b90fb78bb0bd2c..c51c7023d02cd5c 100644
--- a/llvm/include/llvm/ADT/GenericUniformityInfo.h
+++ b/llvm/include/llvm/ADT/GenericUniformityInfo.h
@@ -18,7 +18,7 @@ namespace llvm {
 class TargetTransformInfo;
 
 template <typename ContextT> class GenericUniformityAnalysisImpl;
-template <typename ImplT> struct GenericUniformityAnalysisImplDeleter {
+template <typename ImplT> struct LLVM_CLASS_ABI GenericUniformityAnalysisImplDeleter {
   // Ugly hack around the fact that recent (> 15.0) clang will run into an
   // is_invocable() check in some GNU libc++'s unique_ptr implementation
   // and reject this deleter if you just make it callable with an ImplT *,
@@ -27,7 +27,7 @@ template <typename ImplT> struct GenericUniformityAnalysisImplDeleter {
   void operator()(ImplT *Impl);
 };
 
-template <typename ContextT> class GenericUniformityInfo {
+template <typename ContextT> class LLVM_CLASS_ABI GenericUniformityInfo {
 public:
   using BlockT = typename ContextT::BlockT;
   using FunctionT = typename ContextT::FunctionT;
diff --git a/llvm/include/llvm/ADT/GraphTraits.h b/llvm/include/llvm/ADT/GraphTraits.h
index 8c131d60dde220a..8f5bed0c3cc4d85 100644
--- a/llvm/include/llvm/ADT/GraphTraits.h
+++ b/llvm/include/llvm/ADT/GraphTraits.h
@@ -35,7 +35,7 @@ namespace llvm {
 // be achieved by carrying more data in NodeRef. See LoopBodyTraits for one
 // example.
 template<class GraphType>
-struct GraphTraits {
+struct LLVM_CLASS_ABI GraphTraits {
   // Elements to provide:
 
   // typedef NodeRef           - Type of Node token in the graph, which should
@@ -95,7 +95,7 @@ struct GraphTraits {
 // for (; I != E; ++I) { ... }
 //
 template <class GraphType>
-struct Inverse {
+struct LLVM_CLASS_ABI Inverse {
   const GraphType &Graph;
 
   inline Inverse(const GraphType &G) : Graph(G) {}
@@ -103,7 +103,7 @@ struct Inverse {
 
 // Provide a partial specialization of GraphTraits so that the inverse of an
 // inverse falls back to the original graph.
-template <class T> struct GraphTraits<Inverse<Inverse<T>>> : GraphTraits<T> {};
+template <class T> struct LLVM_CLASS_ABI GraphTraits<Inverse<Inverse<T>>> : GraphTraits<T> {};
 
 // Provide iterator ranges for the graph traits nodes and children
 template <class GraphType>
diff --git a/llvm/include/llvm/ADT/IndexedMap.h b/llvm/include/llvm/ADT/IndexedMap.h
index cc09a1c5713bd77..8641067f9c7f71d 100644
--- a/llvm/include/llvm/ADT/IndexedMap.h
+++ b/llvm/include/llvm/ADT/IndexedMap.h
@@ -28,7 +28,7 @@
 namespace llvm {
 
 template <typename T, typename ToIndexT = identity<unsigned>>
-  class IndexedMap {
+  class LLVM_CLASS_ABI IndexedMap {
     using IndexT = typename ToIndexT::argument_type;
     // Prefer SmallVector with zero inline storage over std::vector. IndexedMaps
     // can grow very large and SmallVector grows more efficiently as long as T
diff --git a/llvm/include/llvm/ADT/IntEqClasses.h b/llvm/include/llvm/ADT/IntEqClasses.h
index 82faef8436b1b82..f2080fa0ddf81cb 100644
--- a/llvm/include/llvm/ADT/IntEqClasses.h
+++ b/llvm/include/llvm/ADT/IntEqClasses.h
@@ -26,7 +26,7 @@
 
 namespace llvm {
 
-class IntEqClasses {
+class LLVM_CLASS_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
index fb24b59e8f4d15d..c0b65ec2e0703f0 100644
--- a/llvm/include/llvm/ADT/IntervalMap.h
+++ b/llvm/include/llvm/ADT/IntervalMap.h
@@ -138,7 +138,7 @@ namespace llvm {
 //===----------------------------------------------------------------------===//
 
 template <typename T>
-struct IntervalMapInfo {
+struct LLVM_CLASS_ABI IntervalMapInfo {
   /// startLess - Return true if x is not in [a;b].
   /// This is x < a both for closed intervals and for [a;b) half-open intervals.
   static inline bool startLess(const T &x, const T &a) {
@@ -165,7 +165,7 @@ struct IntervalMapInfo {
 };
 
 template <typename T>
-struct IntervalMapHalfOpenInfo {
+struct LLVM_CLASS_ABI IntervalMapHalfOpenInfo {
   /// startLess - Return true if x is not in [a;b).
   static inline bool startLess(const T &x, const T &a) {
     return x < a;
@@ -221,7 +221,7 @@ using IdxPair = std::pair<unsigned,unsigned>;
 //===----------------------------------------------------------------------===//
 
 template <typename T1, typename T2, unsigned N>
-class NodeBase {
+class LLVM_CLASS_ABI NodeBase {
 public:
   enum { Capacity = N };
 
@@ -412,7 +412,7 @@ void adjustSiblingSizes(NodeT *Node[], unsigned Nodes,
 /// @param Position Insert position.
 /// @param Grow     Reserve space for a new element at Position.
 /// @return         (node, offset) for Position.
-IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity,
+LLVM_FUNC_ABI IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity,
                    const unsigned *CurSize, unsigned NewSize[],
                    unsigned Position, bool Grow);
 
@@ -437,7 +437,7 @@ enum {
 };
 
 template <typename KeyT, typename ValT>
-struct NodeSizer {
+struct LLVM_CLASS_ABI NodeSizer {
   enum {
     // Compute the leaf node branching factor that makes a node fit in three
     // cache lines. The branching factor must be at least 3, or some B+-tree
@@ -491,7 +491,7 @@ struct NodeSizer {
 //
 //===----------------------------------------------------------------------===//
 
-class NodeRef {
+class LLVM_CLASS_ABI NodeRef {
   struct CacheAlignedPointerTraits {
     static inline void *getAsVoidPointer(void *P) { return P; }
     static inline void *getFromVoidPointer(void *P) { return P; }
@@ -564,7 +564,7 @@ class NodeRef {
 //===----------------------------------------------------------------------===//
 
 template <typename KeyT, typename ValT, unsigned N, typename Traits>
-class LeafNode : public NodeBase<std::pair<KeyT, KeyT>, ValT, N> {
+class LLVM_CLASS_ABI LeafNode : public NodeBase<std::pair<KeyT, KeyT>, ValT, N> {
 public:
   const KeyT &start(unsigned i) const { return this->first[i].first; }
   const KeyT &stop(unsigned i) const { return this->first[i].second; }
@@ -701,7 +701,7 @@ insertFrom(unsigned &Pos, unsigned Size, KeyT a, KeyT b, ValT y) {
 //===----------------------------------------------------------------------===//
 
 template <typename KeyT, typename ValT, unsigned N, typename Traits>
-class BranchNode : public NodeBase<NodeRef, KeyT, N> {
+class LLVM_CLASS_ABI BranchNode : public NodeBase<NodeRef, KeyT, N> {
 public:
   const KeyT &stop(unsigned i) const { return this->second[i]; }
   const NodeRef &subtree(unsigned i) const { return this->first[i]; }
@@ -771,7 +771,7 @@ class BranchNode : public NodeBase<NodeRef, KeyT, N> {
 //
 //===----------------------------------------------------------------------===//
 
-class Path {
+class LLVM_CLASS_ABI Path {
   /// Entry - Each step in the path is a node pointer and an offset into that
   /// node.
   struct Entry {
@@ -934,7 +934,7 @@ class Path {
 template <typename KeyT, typename ValT,
           unsigned N = IntervalMapImpl::NodeSizer<KeyT, ValT>::LeafSize,
           typename Traits = IntervalMapInfo<KeyT>>
-class IntervalMap {
+class LLVM_CLASS_ABI IntervalMap {
   using Sizer = IntervalMapImpl::NodeSizer<KeyT, ValT>;
   using Leaf = IntervalMapImpl::LeafNode<KeyT, ValT, Sizer::LeafSize, Traits>;
   using Branch =
@@ -2108,7 +2108,7 @@ iterator::overflow(unsigned Level) {
 ///    for (IntervalMapOverlaps I(a, b); I.valid() ; ++I) { ... }
 ///
 template <typename MapA, typename MapB>
-class IntervalMapOverlaps {
+class LLVM_CLASS_ABI IntervalMapOverlaps {
   using KeyType = typename MapA::KeyType;
   using Traits = typename MapA::KeyTraits;
 
diff --git a/llvm/include/llvm/ADT/IntervalTree.h b/llvm/include/llvm/ADT/IntervalTree.h
index 5c040098a46abd2..3dbf50089fca9a1 100644
--- a/llvm/include/llvm/ADT/IntervalTree.h
+++ b/llvm/include/llvm/ADT/IntervalTree.h
@@ -197,7 +197,7 @@ namespace llvm {
 /// associated \a Value.
 /// \a PointT corresponds to the interval endpoints type.
 /// \a ValueT corresponds to the interval value type.
-template <typename PointT, typename ValueT> class IntervalData {
+template <typename PointT, typename ValueT> class LLVM_CLASS_ABI IntervalData {
 protected:
   using PointType = PointT;
   using ValueType = ValueT;
@@ -247,7 +247,7 @@ using ValueTypeIsValid = std::bool_constant<std::is_fundamental<T>::value ||
 
 template <typename PointT, typename ValueT,
           typename DataT = IntervalData<PointT, ValueT>>
-class IntervalTree {
+class LLVM_CLASS_ABI IntervalTree {
   static_assert(PointTypeIsValid<PointT>::value,
                 "PointT must be a fundamental type");
   static_assert(ValueTypeIsValid<ValueT>::value,
diff --git a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
index 50fdb27aff65280..ce142b5e07d6d91 100644
--- a/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
+++ b/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h
@@ -74,7 +74,7 @@ namespace llvm {
 /// calls to Release() and Retain(), which increment and decrement the object's
 /// refcount, respectively.  When a Release() call decrements the refcount to 0,
 /// the object deletes itself.
-template <class Derived> class RefCountedBase {
+template <class Derived> class LLVM_CLASS_ABI RefCountedBase {
   mutable unsigned RefCount = 0;
 
 protected:
@@ -104,7 +104,7 @@ template <class Derived> class RefCountedBase {
 };
 
 /// A thread-safe version of \c RefCountedBase.
-template <class Derived> class ThreadSafeRefCountedBase {
+template <class Derived> class LLVM_CLASS_ABI ThreadSafeRefCountedBase {
   mutable std::atomic<int> RefCount{0};
 
 protected:
@@ -155,7 +155,7 @@ template <class Derived> class ThreadSafeRefCountedBase {
 /// forward-declares Foo and specializes IntrusiveRefCntPtrInfo<Foo>.  Then
 /// Bar.h could use IntrusiveRefCntPtr<Foo>, although it still couldn't call any
 /// functions on Foo itself, because Foo would be an incomplete type.
-template <typename T> struct IntrusiveRefCntPtrInfo {
+template <typename T> struct LLVM_CLASS_ABI IntrusiveRefCntPtrInfo {
   static void retain(T *obj) { obj->Retain(); }
   static void release(T *obj) { obj->Release(); }
 };
@@ -166,7 +166,7 @@ template <typename T> struct IntrusiveRefCntPtrInfo {
 /// This class increments its pointee's reference count when it is created, and
 /// decrements its refcount when it's destroyed (or is changed to point to a
 /// different object).
-template <typename T> class IntrusiveRefCntPtr {
+template <typename T> class LLVM_CLASS_ABI IntrusiveRefCntPtr {
   T *Obj = nullptr;
 
 public:
@@ -284,7 +284,7 @@ bool operator!=(const IntrusiveRefCntPtr<T> &A, std::nullptr_t B) {
 // Casting.h.
 template <typename From> struct simplify_type;
 
-template <class T> struct simplify_type<IntrusiveRefCntPtr<T>> {
+template <class T> struct LLVM_CLASS_ABI simplify_type<IntrusiveRefCntPtr<T>> {
   using SimpleType = T *;
 
   static SimpleType getSimplifiedValue(IntrusiveRefCntPtr<T> &Val) {
@@ -292,7 +292,7 @@ template <class T> struct simplify_type<IntrusiveRefCntPtr<T>> {
   }
 };
 
-template <class T> struct simplify_type<const IntrusiveRefCntPtr<T>> {
+template <class T> struct LLVM_CLASS_ABI simplify_type<const IntrusiveRefCntPtr<T>> {
   using SimpleType = /*const*/ T *;
 
   static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr<T> &Val) {
diff --git a/llvm/include/llvm/ADT/MapVector.h b/llvm/include/llvm/ADT/MapVector.h
index 09f881341e3849c..b19afaae5fc9abc 100644
--- a/llvm/include/llvm/ADT/MapVector.h
+++ b/llvm/include/llvm/ADT/MapVector.h
@@ -35,7 +35,7 @@ namespace llvm {
 template<typename KeyT, typename ValueT,
          typename MapType = DenseMap<KeyT, unsigned>,
          typename VectorType = std::vector<std::pair<KeyT, ValueT>>>
-class MapVector {
+class LLVM_CLASS_ABI MapVector {
   MapType Map;
   VectorType Vector;
 
@@ -230,7 +230,7 @@ void MapVector<KeyT, ValueT, MapType, VectorType>::remove_if(Function Pred) {
 /// A MapVector that performs no allocations if smaller than a certain
 /// size.
 template <typename KeyT, typename ValueT, unsigned N>
-struct SmallMapVector
+struct LLVM_CLASS_ABI SmallMapVector
     : MapVector<KeyT, ValueT, SmallDenseMap<KeyT, unsigned, N>,
                 SmallVector<std::pair<KeyT, ValueT>, N>> {
 };
diff --git a/llvm/include/llvm/ADT/PackedVector.h b/llvm/include/llvm/ADT/PackedVector.h
index b448685ab6163bc..a92f3e6ab5f0d82 100644
--- a/llvm/include/llvm/ADT/PackedVector.h
+++ b/llvm/include/llvm/ADT/PackedVector.h
@@ -26,7 +26,7 @@ class PackedVectorBase;
 // This won't be necessary if we can specialize members without specializing
 // the parent template.
 template <typename T, unsigned BitNum, typename BitVectorTy>
-class PackedVectorBase<T, BitNum, BitVectorTy, false> {
+class LLVM_CLASS_ABI PackedVectorBase<T, BitNum, BitVectorTy, false> {
 protected:
   static T getValue(const BitVectorTy &Bits, unsigned Idx) {
     T val = T();
@@ -43,7 +43,7 @@ class PackedVectorBase<T, BitNum, BitVectorTy, false> {
 };
 
 template <typename T, unsigned BitNum, typename BitVectorTy>
-class PackedVectorBase<T, BitNum, BitVectorTy, true> {
+class LLVM_CLASS_ABI PackedVectorBase<T, BitNum, BitVectorTy, true> {
 protected:
   static T getValue(const BitVectorTy &Bits, unsigned Idx) {
     T val = T();
@@ -73,7 +73,7 @@ class PackedVectorBase<T, BitNum, BitVectorTy, true> {
 /// will create a vector accepting values -2, -1, 0, 1. Any other value will hit
 /// an assertion.
 template <typename T, unsigned BitNum, typename BitVectorTy = BitVector>
-class PackedVector : public PackedVectorBase<T, BitNum, BitVectorTy,
+class LLVM_CLASS_ABI PackedVector : public PackedVectorBase<T, BitNum, BitVectorTy,
                                             std::numeric_limits<T>::is_signed> {
   BitVectorTy Bits;
   using base = PackedVectorBase<T, BitNum, BitVectorTy,
diff --git a/llvm/include/llvm/ADT/PointerEmbeddedInt.h b/llvm/include/llvm/ADT/PointerEmbeddedInt.h
index 3bdefa24747567e..632bf8e21883112 100644
--- a/llvm/include/llvm/ADT/PointerEmbeddedInt.h
+++ b/llvm/include/llvm/ADT/PointerEmbeddedInt.h
@@ -31,7 +31,7 @@ namespace llvm {
 /// in the above abstractions without testing the particular active member.
 /// Also, the default constructed value zero initializes the integer.
 template <typename IntT, int Bits = sizeof(IntT) * CHAR_BIT>
-class PointerEmbeddedInt {
+class LLVM_CLASS_ABI PointerEmbeddedInt {
   uintptr_t Value = 0;
 
   // Note: This '<' is correct; using '<=' would result in some shifts
@@ -80,7 +80,7 @@ class PointerEmbeddedInt {
 // Provide pointer like traits to support use with pointer unions and sum
 // types.
 template <typename IntT, int Bits>
-struct PointerLikeTypeTraits<PointerEmbeddedInt<IntT, Bits>> {
+struct LLVM_CLASS_ABI PointerLikeTypeTraits<PointerEmbeddedInt<IntT, Bits>> {
   using T = PointerEmbeddedInt<IntT, Bits>;
 
   static inline void *getAsVoidPointer(const T &P) {
@@ -101,7 +101,7 @@ struct PointerLikeTypeTraits<PointerEmbeddedInt<IntT, Bits>> {
 // Teach DenseMap how to use PointerEmbeddedInt objects as keys if the Int type
 // itself can be a key.
 template <typename IntT, int Bits>
-struct DenseMapInfo<PointerEmbeddedInt<IntT, Bits>> {
+struct LLVM_CLASS_ABI DenseMapInfo<PointerEmbeddedInt<IntT, Bits>> {
   using T = PointerEmbeddedInt<IntT, Bits>;
   using IntInfo = DenseMapInfo<IntT>;
 
diff --git a/llvm/include/llvm/ADT/PointerIntPair.h b/llvm/include/llvm/ADT/PointerIntPair.h
index f73f5bcd6ce0c95..f6c9eb3366b7850 100644
--- a/llvm/include/llvm/ADT/PointerIntPair.h
+++ b/llvm/include/llvm/ADT/PointerIntPair.h
@@ -25,7 +25,7 @@
 namespace llvm {
 
 namespace detail {
-template <typename Ptr> struct PunnedPointer {
+template <typename Ptr> struct LLVM_CLASS_ABI PunnedPointer {
   static_assert(sizeof(Ptr) == sizeof(intptr_t), "");
 
   // Asserts that allow us to let the compiler implement the destructor and
@@ -77,7 +77,7 @@ struct PointerIntPairInfo;
 template <typename PointerTy, unsigned IntBits, typename IntType = unsigned,
           typename PtrTraits = PointerLikeTypeTraits<PointerTy>,
           typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
-class PointerIntPair {
+class LLVM_CLASS_ABI PointerIntPair {
   // Used by MSVC visualizer and generally helpful for debugging/visualizing.
   using InfoTy = Info;
   detail::PunnedPointer<PointerTy> Value;
@@ -165,7 +165,7 @@ class PointerIntPair {
 };
 
 template <typename PointerT, unsigned IntBits, typename PtrTraits>
-struct PointerIntPairInfo {
+struct LLVM_CLASS_ABI PointerIntPairInfo {
   static_assert(PtrTraits::NumLowBitsAvailable <
                     std::numeric_limits<uintptr_t>::digits,
                 "cannot use a pointer type that has all bits free");
@@ -216,7 +216,7 @@ struct PointerIntPairInfo {
 
 // Provide specialization of DenseMapInfo for PointerIntPair.
 template <typename PointerTy, unsigned IntBits, typename IntType>
-struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType>, void> {
+struct LLVM_CLASS_ABI DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType>, void> {
   using Ty = PointerIntPair<PointerTy, IntBits, IntType>;
 
   static Ty getEmptyKey() {
@@ -242,7 +242,7 @@ struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType>, void> {
 // Teach SmallPtrSet that PointerIntPair is "basically a pointer".
 template <typename PointerTy, unsigned IntBits, typename IntType,
           typename PtrTraits>
-struct PointerLikeTypeTraits<
+struct LLVM_CLASS_ABI PointerLikeTypeTraits<
     PointerIntPair<PointerTy, IntBits, IntType, PtrTraits>> {
   static inline void *
   getAsVoidPointer(const PointerIntPair<PointerTy, IntBits, IntType> &P) {
@@ -280,13 +280,13 @@ get(const PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info> &Pair) {
 namespace std {
 template <typename PointerTy, unsigned IntBits, typename IntType,
           typename PtrTraits, typename Info>
-struct tuple_size<
+struct LLVM_CLASS_ABI tuple_size<
     llvm::PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info>>
     : std::integral_constant<std::size_t, 2> {};
 
 template <std::size_t I, typename PointerTy, unsigned IntBits, typename IntType,
           typename PtrTraits, typename Info>
-struct tuple_element<
+struct LLVM_CLASS_ABI tuple_element<
     I, llvm::PointerIntPair<PointerTy, IntBits, IntType, PtrTraits, Info>>
     : std::conditional<I == 0, PointerTy, IntType> {};
 } // namespace std
diff --git a/llvm/include/llvm/ADT/PointerSumType.h b/llvm/include/llvm/ADT/PointerSumType.h
index 43226d41843b796..d6da023f9515c78 100644
--- a/llvm/include/llvm/ADT/PointerSumType.h
+++ b/llvm/include/llvm/ADT/PointerSumType.h
@@ -25,7 +25,7 @@ namespace llvm {
 /// allocation.
 template <uintptr_t N, typename PointerArgT,
           typename TraitsArgT = PointerLikeTypeTraits<PointerArgT>>
-struct PointerSumTypeMember {
+struct LLVM_CLASS_ABI PointerSumTypeMember {
   enum { Tag = N };
   using PointerT = PointerArgT;
   using TraitsT = TraitsArgT;
@@ -68,7 +68,7 @@ template <typename TagT, typename... MemberTs> struct PointerSumTypeHelper;
 ///
 /// There is no support for constructing or accessing with a dynamic tag as
 /// that would fundamentally violate the type safety provided by the sum type.
-template <typename TagT, typename... MemberTs> class PointerSumType {
+template <typename TagT, typename... MemberTs> class LLVM_CLASS_ABI PointerSumType {
   using HelperT = detail::PointerSumTypeHelper<TagT, MemberTs...>;
 
   // We keep both the raw value and the min tag value's pointer in a union. When
@@ -204,7 +204,7 @@ namespace detail {
 /// compile-time lookup of the member from a particular tag value, along with
 /// useful constants and compile time checking infrastructure..
 template <typename TagT, typename... MemberTs>
-struct PointerSumTypeHelper : MemberTs... {
+struct LLVM_CLASS_ABI PointerSumTypeHelper : MemberTs... {
   // First we use a trick to allow quickly looking up information about
   // a particular member of the sum type. This works because we arranged to
   // have this type derive from all of the member type templates. We can select
@@ -264,7 +264,7 @@ struct PointerSumTypeHelper : MemberTs... {
 
 // Teach DenseMap how to use PointerSumTypes as keys.
 template <typename TagT, typename... MemberTs>
-struct DenseMapInfo<PointerSumType<TagT, MemberTs...>> {
+struct LLVM_CLASS_ABI DenseMapInfo<PointerSumType<TagT, MemberTs...>> {
   using SumType = PointerSumType<TagT, MemberTs...>;
   using HelperT = detail::PointerSumTypeHelper<TagT, MemberTs...>;
   enum { SomeTag = HelperT::MinTag };
diff --git a/llvm/include/llvm/ADT/PointerUnion.h b/llvm/include/llvm/ADT/PointerUnion.h
index 63aa0e350387d83..df6532d1b3d142e 100644
--- a/llvm/include/llvm/ADT/PointerUnion.h
+++ b/llvm/include/llvm/ADT/PointerUnion.h
@@ -40,13 +40,13 @@ namespace pointer_union_detail {
   }
 
   /// Find the first type in a list of types.
-  template <typename T, typename...> struct GetFirstType {
+  template <typename T, typename...> struct LLVM_CLASS_ABI GetFirstType {
     using type = T;
   };
 
   /// Provide PointerLikeTypeTraits for void* that is used by PointerUnion
   /// for the template arguments.
-  template <typename ...PTs> class PointerUnionUIntTraits {
+  template <typename ...PTs> class LLVM_CLASS_ABI PointerUnionUIntTraits {
   public:
     static inline void *getAsVoidPointer(void *P) { return P; }
     static inline void *getFromVoidPointer(void *P) { return P; }
@@ -57,7 +57,7 @@ namespace pointer_union_detail {
   class PointerUnionMembers;
 
   template <typename Derived, typename ValTy, int I>
-  class PointerUnionMembers<Derived, ValTy, I> {
+  class LLVM_CLASS_ABI PointerUnionMembers<Derived, ValTy, I> {
   protected:
     ValTy Val;
     PointerUnionMembers() = default;
@@ -68,7 +68,7 @@ namespace pointer_union_detail {
 
   template <typename Derived, typename ValTy, int I, typename Type,
             typename ...Types>
-  class PointerUnionMembers<Derived, ValTy, I, Type, Types...>
+  class LLVM_CLASS_ABI PointerUnionMembers<Derived, ValTy, I, Type, Types...>
       : public PointerUnionMembers<Derived, ValTy, I + 1, Types...> {
     using Base = PointerUnionMembers<Derived, ValTy, I + 1, Types...>;
   public:
@@ -110,7 +110,7 @@ template <typename... PTs> struct CastInfoPointerUnionImpl;
 ///    X = P.get<int*>();     // runtime assertion failure.
 ///    PointerUnion<int*, int*> Q; // compile time failure.
 template <typename... PTs>
-class PointerUnion
+class LLVM_CLASS_ABI PointerUnion
     : public pointer_union_detail::PointerUnionMembers<
           PointerUnion<PTs...>,
           PointerIntPair<
@@ -224,7 +224,7 @@ bool operator<(PointerUnion<PTs...> lhs, PointerUnion<PTs...> rhs) {
 /// friend'.
 /// So we define this struct to be a bridge between CastInfo and
 /// PointerUnion.
-template <typename... PTs> struct CastInfoPointerUnionImpl {
+template <typename... PTs> struct LLVM_CLASS_ABI CastInfoPointerUnionImpl {
   using From = PointerUnion<PTs...>;
 
   template <typename To> static inline bool isPossible(From &F) {
@@ -239,7 +239,7 @@ template <typename... PTs> struct CastInfoPointerUnionImpl {
 
 // Specialization of CastInfo for PointerUnion
 template <typename To, typename... PTs>
-struct CastInfo<To, PointerUnion<PTs...>>
+struct LLVM_CLASS_ABI CastInfo<To, PointerUnion<PTs...>>
     : public DefaultDoCastIfPossible<To, PointerUnion<PTs...>,
                                      CastInfo<To, PointerUnion<PTs...>>> {
   using From = PointerUnion<PTs...>;
@@ -255,7 +255,7 @@ struct CastInfo<To, PointerUnion<PTs...>>
 };
 
 template <typename To, typename... PTs>
-struct CastInfo<To, const PointerUnion<PTs...>>
+struct LLVM_CLASS_ABI CastInfo<To, const PointerUnion<PTs...>>
     : public ConstStrippingForwardingCast<To, const PointerUnion<PTs...>,
                                           CastInfo<To, PointerUnion<PTs...>>> {
 };
@@ -263,7 +263,7 @@ struct CastInfo<To, const PointerUnion<PTs...>>
 // Teach SmallPtrSet that PointerUnion is "basically a pointer", that has
 // # low bits available = min(PT1bits,PT2bits)-1.
 template <typename ...PTs>
-struct PointerLikeTypeTraits<PointerUnion<PTs...>> {
+struct LLVM_CLASS_ABI PointerLikeTypeTraits<PointerUnion<PTs...>> {
   static inline void *getAsVoidPointer(const PointerUnion<PTs...> &P) {
     return P.getOpaqueValue();
   }
@@ -279,7 +279,7 @@ struct PointerLikeTypeTraits<PointerUnion<PTs...>> {
 };
 
 // Teach DenseMap how to use PointerUnions as keys.
-template <typename ...PTs> struct DenseMapInfo<PointerUnion<PTs...>> {
+template <typename ...PTs> struct LLVM_CLASS_ABI DenseMapInfo<PointerUnion<PTs...>> {
   using Union = PointerUnion<PTs...>;
   using FirstInfo =
       DenseMapInfo<typename pointer_union_detail::GetFirstType<PTs...>::type>;
diff --git a/llvm/include/llvm/ADT/PostOrderIterator.h b/llvm/include/llvm/ADT/PostOrderIterator.h
index abc0510b046c675..c377dbce5361340 100644
--- a/llvm/include/llvm/ADT/PostOrderIterator.h
+++ b/llvm/include/llvm/ADT/PostOrderIterator.h
@@ -57,7 +57,7 @@ namespace llvm {
 
 /// Default po_iterator_storage implementation with an internal set object.
 template<class SetType, bool External>
-class po_iterator_storage {
+class LLVM_CLASS_ABI po_iterator_storage {
   SetType Visited;
 
 public:
@@ -73,7 +73,7 @@ class po_iterator_storage {
 
 /// Specialization of po_iterator_storage that references an external set.
 template<class SetType>
-class po_iterator_storage<SetType, true> {
+class LLVM_CLASS_ABI po_iterator_storage<SetType, true> {
   SetType &Visited;
 
 public:
@@ -95,7 +95,7 @@ class po_iterator_storage<SetType, true> {
 template <class GraphT,
           class SetType = SmallPtrSet<typename GraphTraits<GraphT>::NodeRef, 8>,
           bool ExtStorage = false, class GT = GraphTraits<GraphT>>
-class po_iterator : public po_iterator_storage<SetType, ExtStorage> {
+class LLVM_CLASS_ABI po_iterator : public po_iterator_storage<SetType, ExtStorage> {
 public:
   using iterator_category = std::forward_iterator_tag;
   using value_type = typename GT::NodeRef;
@@ -198,7 +198,7 @@ template <class T> iterator_range<po_iterator<T>> post_order(const T &G) {
 
 // Provide global definitions of external postorder iterators...
 template <class T, class SetType = std::set<typename GraphTraits<T>::NodeRef>>
-struct po_ext_iterator : public po_iterator<T, SetType, true> {
+struct LLVM_CLASS_ABI po_ext_iterator : public po_iterator<T, SetType, true> {
   po_ext_iterator(const po_iterator<T, SetType, true> &V) :
   po_iterator<T, SetType, true>(V) {}
 };
@@ -221,7 +221,7 @@ iterator_range<po_ext_iterator<T, SetType>> post_order_ext(const T &G, SetType &
 // Provide global definitions of inverse post order iterators...
 template <class T, class SetType = std::set<typename GraphTraits<T>::NodeRef>,
           bool External = false>
-struct ipo_iterator : public po_iterator<Inverse<T>, SetType, External> {
+struct LLVM_CLASS_ABI ipo_iterator : public po_iterator<Inverse<T>, SetType, External> {
   ipo_iterator(const po_iterator<Inverse<T>, SetType, External> &V) :
      po_iterator<Inverse<T>, SetType, External> (V) {}
 };
@@ -243,7 +243,7 @@ iterator_range<ipo_iterator<T>> inverse_post_order(const T &G) {
 
 // Provide global definitions of external inverse postorder iterators...
 template <class T, class SetType = std::set<typename GraphTraits<T>::NodeRef>>
-struct ipo_ext_iterator : public ipo_iterator<T, SetType, true> {
+struct LLVM_CLASS_ABI ipo_ext_iterator : public ipo_iterator<T, SetType, true> {
   ipo_ext_iterator(const ipo_iterator<T, SetType, true> &V) :
     ipo_iterator<T, SetType, true>(V) {}
   ipo_ext_iterator(const po_iterator<Inverse<T>, SetType, true> &V) :
@@ -294,7 +294,7 @@ inverse_post_order_ext(const T &G, SetType &S) {
 //
 
 template<class GraphT, class GT = GraphTraits<GraphT>>
-class ReversePostOrderTraversal {
+class LLVM_CLASS_ABI ReversePostOrderTraversal {
   using NodeRef = typename GT::NodeRef;
 
   using VecTy = SmallVector<NodeRef, 8>;
diff --git a/llvm/include/llvm/ADT/PriorityQueue.h b/llvm/include/llvm/ADT/PriorityQueue.h
index 7738a48b8c55237..76b77be8ef3446c 100644
--- a/llvm/include/llvm/ADT/PriorityQueue.h
+++ b/llvm/include/llvm/ADT/PriorityQueue.h
@@ -26,7 +26,7 @@ namespace llvm {
 template<class T,
          class Sequence = std::vector<T>,
          class Compare = std::less<typename Sequence::value_type> >
-class PriorityQueue : public std::priority_queue<T, Sequence, Compare> {
+class LLVM_CLASS_ABI PriorityQueue : public std::priority_queue<T, Sequence, Compare> {
 public:
   explicit PriorityQueue(const Compare &compare = Compare(),
                          const Sequence &sequence = Sequence())
diff --git a/llvm/include/llvm/ADT/PriorityWorklist.h b/llvm/include/llvm/ADT/PriorityWorklist.h
index 2b6510f42d56969..9db8fc1d46284ed 100644
--- a/llvm/include/llvm/ADT/PriorityWorklist.h
+++ b/llvm/include/llvm/ADT/PriorityWorklist.h
@@ -52,7 +52,7 @@ namespace llvm {
 /// and a SmallDenseMap if custom data structures are not provided.
 template <typename T, typename VectorT = std::vector<T>,
           typename MapT = DenseMap<T, ptrdiff_t>>
-class PriorityWorklist {
+class LLVM_CLASS_ABI PriorityWorklist {
 public:
   using value_type = T;
   using key_type = T;
@@ -252,7 +252,7 @@ class PriorityWorklist {
 /// A version of \c PriorityWorklist that selects small size optimized data
 /// structures for the vector and map.
 template <typename T, unsigned N>
-class SmallPriorityWorklist
+class LLVM_CLASS_ABI SmallPriorityWorklist
     : public PriorityWorklist<T, SmallVector<T, N>,
                               SmallDenseMap<T, ptrdiff_t>> {
 public:
diff --git a/llvm/include/llvm/ADT/SCCIterator.h b/llvm/include/llvm/ADT/SCCIterator.h
index b3012448bda5a92..ee01dad0a6925e9 100644
--- a/llvm/include/llvm/ADT/SCCIterator.h
+++ b/llvm/include/llvm/ADT/SCCIterator.h
@@ -45,7 +45,7 @@ namespace llvm {
 /// build up a vector of nodes in a particular SCC. Note that it is a forward
 /// iterator and thus you cannot backtrack or re-visit nodes.
 template <class GraphT, class GT = GraphTraits<GraphT>>
-class scc_iterator : public iterator_facade_base<
+class LLVM_CLASS_ABI scc_iterator : public iterator_facade_base<
                          scc_iterator<GraphT, GT>, std::forward_iterator_tag,
                          const std::vector<typename GT::NodeRef>, ptrdiff_t> {
   using NodeRef = typename GT::NodeRef;
@@ -251,7 +251,7 @@ template <class T> scc_iterator<T> scc_end(const T &G) {
 /// have a predecessor and then applied to all nodes of the SCC. Such order
 /// ensures that high-weighted edges are visited first during the traversal.
 template <class GraphT, class GT = GraphTraits<GraphT>>
-class scc_member_iterator {
+class LLVM_CLASS_ABI scc_member_iterator {
   using NodeType = typename GT::NodeType;
   using EdgeType = typename GT::EdgeType;
   using NodesType = std::vector<NodeType *>;
@@ -321,7 +321,7 @@ scc_member_iterator<GraphT, GT>::scc_member_iterator(
   }
 
   // Sort edges by weights.
-  struct EdgeComparer {
+  struct LLVM_CLASS_ABI EdgeComparer {
     bool operator()(const EdgeType *L, const EdgeType *R) const {
       return L->Weight > R->Weight;
     }
diff --git a/llvm/include/llvm/ADT/STLForwardCompat.h b/llvm/include/llvm/ADT/STLForwardCompat.h
index 8944ac98a45049f..11171af0472b497 100644
--- a/llvm/include/llvm/ADT/STLForwardCompat.h
+++ b/llvm/include/llvm/ADT/STLForwardCompat.h
@@ -17,6 +17,7 @@
 #ifndef LLVM_ADT_STLFORWARDCOMPAT_H
 #define LLVM_ADT_STLFORWARDCOMPAT_H
 
+#include "llvm/Support/Compiler.h"
 #include <optional>
 #include <type_traits>
 
diff --git a/llvm/include/llvm/ADT/ScopeExit.h b/llvm/include/llvm/ADT/ScopeExit.h
index 2f13fb65d34d809..4ec5c80781d02b5 100644
--- a/llvm/include/llvm/ADT/ScopeExit.h
+++ b/llvm/include/llvm/ADT/ScopeExit.h
@@ -23,7 +23,7 @@
 namespace llvm {
 namespace detail {
 
-template <typename Callable> class scope_exit {
+template <typename Callable> class LLVM_CLASS_ABI scope_exit {
   Callable ExitFunction;
   bool Engaged = true; // False once moved-from or release()d.
 
diff --git a/llvm/include/llvm/ADT/ScopedHashTable.h b/llvm/include/llvm/ADT/ScopedHashTable.h
index 78fadaf629048a7..3ef27415501a388 100644
--- a/llvm/include/llvm/ADT/ScopedHashTable.h
+++ b/llvm/include/llvm/ADT/ScopedHashTable.h
@@ -44,7 +44,7 @@ template <typename K, typename V, typename KInfo = DenseMapInfo<K>,
 class ScopedHashTable;
 
 template <typename K, typename V>
-class ScopedHashTableVal {
+class LLVM_CLASS_ABI ScopedHashTableVal {
   ScopedHashTableVal *NextInScope;
   ScopedHashTableVal *NextForKey;
   K Key;
@@ -83,7 +83,7 @@ class ScopedHashTableVal {
 
 template <typename K, typename V, typename KInfo = DenseMapInfo<K>,
           typename AllocatorTy = MallocAllocator>
-class ScopedHashTableScope {
+class LLVM_CLASS_ABI ScopedHashTableScope {
   /// HT - The hashtable that we are active for.
   ScopedHashTable<K, V, KInfo, AllocatorTy> &HT;
 
@@ -116,7 +116,7 @@ class ScopedHashTableScope {
 };
 
 template <typename K, typename V, typename KInfo = DenseMapInfo<K>>
-class ScopedHashTableIterator {
+class LLVM_CLASS_ABI ScopedHashTableIterator {
   ScopedHashTableVal<K, V> *Node;
 
 public:
@@ -148,7 +148,7 @@ class ScopedHashTableIterator {
 };
 
 template <typename K, typename V, typename KInfo, typename AllocatorTy>
-class ScopedHashTable : detail::AllocatorHolder<AllocatorTy> {
+class LLVM_CLASS_ABI ScopedHashTable : detail::AllocatorHolder<AllocatorTy> {
   using AllocTy = detail::AllocatorHolder<AllocatorTy>;
 
 public:
diff --git a/llvm/include/llvm/ADT/Sequence.h b/llvm/include/llvm/ADT/Sequence.h
index fb9ef13d0d71160..bb834ba5e8e69c7 100644
--- a/llvm/include/llvm/ADT/Sequence.h
+++ b/llvm/include/llvm/ADT/Sequence.h
@@ -97,11 +97,11 @@ namespace llvm {
 // `is_iterable` set to `true` in the `llvm` namespace.
 // Alternatively, you can pass the `force_iteration_on_noniterable_enum` tag
 // to `enum_seq` or `enum_seq_inclusive`.
-template <typename EnumT> struct enum_iteration_traits {
+template <typename EnumT> struct LLVM_CLASS_ABI enum_iteration_traits {
   static constexpr bool is_iterable = false;
 };
 
-struct force_iteration_on_noniterable_enum_t {
+struct LLVM_CLASS_ABI force_iteration_on_noniterable_enum_t {
   explicit force_iteration_on_noniterable_enum_t() = default;
 };
 
@@ -124,7 +124,7 @@ template <typename T, typename U> bool canTypeFitValue(const U Value) {
 // - constructed from a value that doesn't fit into intmax_t,
 // - casted to a type that cannot hold the current value,
 // - its internal representation overflows.
-struct CheckedInt {
+struct LLVM_CLASS_ABI CheckedInt {
   // Integral constructor, asserts if Value cannot be represented as intmax_t.
   template <typename Integral,
             std::enable_if_t<std::is_integral<Integral>::value, bool> = 0>
@@ -186,7 +186,7 @@ struct CheckedInt {
   intmax_t Value;
 };
 
-template <typename T, bool IsReverse> struct SafeIntIterator {
+template <typename T, bool IsReverse> struct LLVM_CLASS_ABI SafeIntIterator {
   using iterator_category = std::random_access_iterator_tag;
   using value_type = T;
   using difference_type = intmax_t;
@@ -260,7 +260,7 @@ template <typename T, bool IsReverse> struct SafeIntIterator {
 
 } // namespace detail
 
-template <typename T> struct iota_range {
+template <typename T> struct LLVM_CLASS_ABI iota_range {
   using value_type = T;
   using reference = T &;
   using const_reference = const T &;
diff --git a/llvm/include/llvm/ADT/SetVector.h b/llvm/include/llvm/ADT/SetVector.h
index 781ca367b97e487..62d3e332c5f78c3 100644
--- a/llvm/include/llvm/ADT/SetVector.h
+++ b/llvm/include/llvm/ADT/SetVector.h
@@ -54,7 +54,7 @@ namespace llvm {
 /// and is the default value.
 template <typename T, typename Vector = std::vector<T>,
           typename Set = DenseSet<T>, unsigned N = 0>
-class SetVector {
+class LLVM_CLASS_ABI SetVector {
   // Much like in SmallPtrSet, this value should not be too high to prevent
   // excessively long linear scans from occuring.
   static_assert(N <= 32, "Small size should be less than or equal to 32!");
@@ -367,7 +367,7 @@ class SetVector {
 /// A SetVector that performs no allocations if smaller than
 /// a certain size.
 template <typename T, unsigned N>
-class SmallSetVector : public SetVector<T, SmallVector<T, N>, DenseSet<T>, N> {
+class LLVM_CLASS_ABI SmallSetVector : public SetVector<T, SmallVector<T, N>, DenseSet<T>, N> {
 public:
   SmallSetVector() = default;
 
diff --git a/llvm/include/llvm/ADT/SmallBitVector.h b/llvm/include/llvm/ADT/SmallBitVector.h
index 3bb300eaac27b38..205e0d392d270ab 100644
--- a/llvm/include/llvm/ADT/SmallBitVector.h
+++ b/llvm/include/llvm/ADT/SmallBitVector.h
@@ -33,7 +33,7 @@ namespace llvm {
 /// is directly used as a plain collection of bits when possible, or as a
 /// pointer to a larger heap-allocated array when necessary. This allows normal
 /// "small" cases to be fast without losing generality for large inputs.
-class SmallBitVector {
+class LLVM_CLASS_ABI SmallBitVector {
   // TODO: In "large" mode, a pointer to a BitVector is used, leading to an
   // unnecessary level of indirection. It would be more efficient to use a
   // pointer to memory containing size, allocation size, and the array of bits.
@@ -728,7 +728,7 @@ operator^(const SmallBitVector &LHS, const SmallBitVector &RHS) {
   return Result;
 }
 
-template <> struct DenseMapInfo<SmallBitVector> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<SmallBitVector> {
   static inline SmallBitVector getEmptyKey() { return SmallBitVector(); }
   static inline SmallBitVector getTombstoneKey() {
     SmallBitVector V;
diff --git a/llvm/include/llvm/ADT/SmallPtrSet.h b/llvm/include/llvm/ADT/SmallPtrSet.h
index 4c064397057d379..1b232a40b5695db 100644
--- a/llvm/include/llvm/ADT/SmallPtrSet.h
+++ b/llvm/include/llvm/ADT/SmallPtrSet.h
@@ -47,7 +47,7 @@ namespace llvm {
 /// (-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_CLASS_ABI SmallPtrSetImplBase : public DebugEpochBase {
   friend class SmallPtrSetIteratorImpl;
 
 protected:
@@ -219,7 +219,7 @@ class SmallPtrSetImplBase : public DebugEpochBase {
 
 /// SmallPtrSetIteratorImpl - This is the common base class shared between all
 /// instances of SmallPtrSetIterator.
-class SmallPtrSetIteratorImpl {
+class LLVM_CLASS_ABI SmallPtrSetIteratorImpl {
 protected:
   const void *const *Bucket;
   const void *const *End;
@@ -264,7 +264,7 @@ class SmallPtrSetIteratorImpl {
 
 /// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
 template <typename PtrTy>
-class LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE SmallPtrSetIterator
+class LLVM_CLASS_ABI LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE SmallPtrSetIterator
     : public SmallPtrSetIteratorImpl,
       DebugEpochBase::HandleBase {
   using PtrTraits = PointerLikeTypeTraits<PtrTy>;
@@ -319,11 +319,11 @@ struct RoundUpToPowerOfTwo;
 /// RoundUpToPowerOfTwoH - If N is not a power of two, increase it.  This is a
 /// helper template used to implement RoundUpToPowerOfTwo.
 template<unsigned N, bool isPowerTwo>
-struct RoundUpToPowerOfTwoH {
+struct LLVM_CLASS_ABI RoundUpToPowerOfTwoH {
   enum { Val = N };
 };
 template<unsigned N>
-struct RoundUpToPowerOfTwoH<N, false> {
+struct LLVM_CLASS_ABI RoundUpToPowerOfTwoH<N, false> {
   enum {
     // We could just use NextVal = N+1, but this converges faster.  N|(N-1) sets
     // the right-most zero bits to one all at once, e.g. 0b0011000 -> 0b0011111.
@@ -332,7 +332,7 @@ struct RoundUpToPowerOfTwoH<N, false> {
 };
 
 template<unsigned N>
-struct RoundUpToPowerOfTwo {
+struct LLVM_CLASS_ABI RoundUpToPowerOfTwo {
   enum { Val = RoundUpToPowerOfTwoH<N, (N&(N-1)) == 0>::Val };
 };
 
@@ -342,7 +342,7 @@ struct RoundUpToPowerOfTwo {
 /// This is particularly useful for passing around between interface boundaries
 /// to avoid encoding a particular small size in the interface boundary.
 template <typename PtrType>
-class SmallPtrSetImpl : public SmallPtrSetImplBase {
+class LLVM_CLASS_ABI SmallPtrSetImpl : public SmallPtrSetImplBase {
   using ConstPtrType = typename add_const_past_pointer<PtrType>::type;
   using PtrTraits = PointerLikeTypeTraits<PtrType>;
   using ConstPtrTraits = PointerLikeTypeTraits<ConstPtrType>;
@@ -448,7 +448,7 @@ bool operator!=(const SmallPtrSetImpl<PtrType> &LHS,
 /// power of two if it is not already a power of two.  See the comments above
 /// SmallPtrSetImplBase for details of the algorithm.
 template<class PtrType, unsigned SmallSize>
-class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
+class LLVM_CLASS_ABI SmallPtrSet : public SmallPtrSetImpl<PtrType> {
   // In small mode SmallPtrSet uses linear search for the elements, so it is
   // not a good idea to choose this value too high. You may consider using a
   // DenseSet<> instead if you expect many elements in the set.
diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h
index a16e8ac6f07552d..3b6ce3e1475fc65 100644
--- a/llvm/include/llvm/ADT/SmallSet.h
+++ b/llvm/include/llvm/ADT/SmallSet.h
@@ -31,7 +31,7 @@ namespace llvm {
 /// SmallSetIterator - This class implements a const_iterator for SmallSet by
 /// delegating to the underlying SmallVector or Set iterators.
 template <typename T, unsigned N, typename C>
-class SmallSetIterator
+class LLVM_CLASS_ABI SmallSetIterator
     : public iterator_facade_base<SmallSetIterator<T, N, C>,
                                   std::forward_iterator_tag, T> {
 private:
@@ -132,7 +132,7 @@ class SmallSetIterator
 /// maintained with no mallocs.  If the set gets large, we expand to using an
 /// std::set to maintain reasonable lookup times.
 template <typename T, unsigned N, typename C = std::less<T>>
-class SmallSet {
+class LLVM_CLASS_ABI SmallSet {
   /// Use a SmallVector to hold the elements here (even though it will never
   /// reach its 'large' stage) to avoid calling the default ctors of elements
   /// we will never use.
@@ -253,7 +253,7 @@ class SmallSet {
 /// If this set is of pointer values, transparently switch over to using
 /// SmallPtrSet for performance.
 template <typename PointeeType, unsigned N>
-class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
+class LLVM_CLASS_ABI SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
 
 /// Equality comparison for SmallSet.
 ///
diff --git a/llvm/include/llvm/ADT/SparseBitVector.h b/llvm/include/llvm/ADT/SparseBitVector.h
index 89aa64db20ac94e..e856b3ba274b1ac 100644
--- a/llvm/include/llvm/ADT/SparseBitVector.h
+++ b/llvm/include/llvm/ADT/SparseBitVector.h
@@ -40,7 +40,7 @@ namespace llvm {
 /// etc) do not perform as well in practice as a linked list with this iterator
 /// kept up to date.  They are also significantly more memory intensive.
 
-template <unsigned ElementSize = 128> struct SparseBitVectorElement {
+template <unsigned ElementSize = 128> struct LLVM_CLASS_ABI SparseBitVectorElement {
 public:
   using BitWord = unsigned long;
   using size_type = unsigned;
@@ -254,7 +254,7 @@ template <unsigned ElementSize = 128> struct SparseBitVectorElement {
 };
 
 template <unsigned ElementSize = 128>
-class SparseBitVector {
+class LLVM_CLASS_ABI SparseBitVector {
   using ElementList = std::list<SparseBitVectorElement<ElementSize>>;
   using ElementListIter = typename ElementList::iterator;
   using ElementListConstIter = typename ElementList::const_iterator;
diff --git a/llvm/include/llvm/ADT/SparseMultiSet.h b/llvm/include/llvm/ADT/SparseMultiSet.h
index 453697b5f1ac6e4..4429a9f334d7510 100644
--- a/llvm/include/llvm/ADT/SparseMultiSet.h
+++ b/llvm/include/llvm/ADT/SparseMultiSet.h
@@ -84,7 +84,7 @@ namespace llvm {
 template<typename ValueT,
          typename KeyFunctorT = identity<unsigned>,
          typename SparseT = uint8_t>
-class SparseMultiSet {
+class LLVM_CLASS_ABI SparseMultiSet {
   static_assert(std::is_unsigned_v<SparseT>,
                 "SparseT must be an unsigned integer type");
 
diff --git a/llvm/include/llvm/ADT/SparseSet.h b/llvm/include/llvm/ADT/SparseSet.h
index 591525c05551c13..586f06b6575a294 100644
--- a/llvm/include/llvm/ADT/SparseSet.h
+++ b/llvm/include/llvm/ADT/SparseSet.h
@@ -55,7 +55,7 @@ namespace llvm {
 /// For best results, ValueT should not require a destructor.
 ///
 template<typename ValueT>
-struct SparseSetValTraits {
+struct LLVM_CLASS_ABI SparseSetValTraits {
   static unsigned getValIndex(const ValueT &Val) {
     return Val.getSparseSetIndex();
   }
@@ -66,7 +66,7 @@ struct SparseSetValTraits {
 /// getSparseSetIndex() or specialize SparseSetValTraits<>.
 ///
 template<typename KeyT, typename ValueT, typename KeyFunctorT>
-struct SparseSetValFunctor {
+struct LLVM_CLASS_ABI SparseSetValFunctor {
   unsigned operator()(const ValueT &Val) const {
     return SparseSetValTraits<ValueT>::getValIndex(Val);
   }
@@ -75,7 +75,7 @@ struct SparseSetValFunctor {
 /// SparseSetValFunctor<KeyT, KeyT> - Helper class for the common case of
 /// identity key/value sets.
 template<typename KeyT, typename KeyFunctorT>
-struct SparseSetValFunctor<KeyT, KeyT, KeyFunctorT> {
+struct LLVM_CLASS_ABI SparseSetValFunctor<KeyT, KeyT, KeyFunctorT> {
   unsigned operator()(const KeyT &Key) const {
     return KeyFunctorT()(Key);
   }
@@ -122,7 +122,7 @@ struct SparseSetValFunctor<KeyT, KeyT, KeyFunctorT> {
 template<typename ValueT,
          typename KeyFunctorT = identity<unsigned>,
          typename SparseT = uint8_t>
-class SparseSet {
+class LLVM_CLASS_ABI SparseSet {
   static_assert(std::is_unsigned_v<SparseT>,
                 "SparseT must be an unsigned integer type");
 
diff --git a/llvm/include/llvm/ADT/Statistic.h b/llvm/include/llvm/ADT/Statistic.h
index 9475b6697031a46..c060a9c26c598bd 100644
--- a/llvm/include/llvm/ADT/Statistic.h
+++ b/llvm/include/llvm/ADT/Statistic.h
@@ -47,7 +47,7 @@ class raw_ostream;
 class raw_fd_ostream;
 class StringRef;
 
-class TrackingStatistic {
+class LLVM_CLASS_ABI TrackingStatistic {
 public:
   const char *const DebugType;
   const char *const Name;
@@ -129,7 +129,7 @@ class TrackingStatistic {
   void RegisterStatistic();
 };
 
-class NoopStatistic {
+class LLVM_CLASS_ABI NoopStatistic {
 public:
   NoopStatistic(const char * /*DebugType*/, const char * /*Name*/,
                 const char * /*Desc*/) {}
@@ -173,25 +173,25 @@ using Statistic = NoopStatistic;
   static llvm::TrackingStatistic VARNAME = {DEBUG_TYPE, #VARNAME, DESC}
 
 /// Enable the collection and printing of statistics.
-void EnableStatistics(bool DoPrintOnExit = true);
+LLVM_FUNC_ABI void EnableStatistics(bool DoPrintOnExit = true);
 
 /// Check if statistics are enabled.
-bool AreStatisticsEnabled();
+LLVM_FUNC_ABI bool AreStatisticsEnabled();
 
 /// Return a file stream to print our output on.
-std::unique_ptr<raw_fd_ostream> CreateInfoOutputFile();
+LLVM_FUNC_ABI std::unique_ptr<raw_fd_ostream> CreateInfoOutputFile();
 
 /// Print statistics to the file returned by CreateInfoOutputFile().
-void PrintStatistics();
+LLVM_FUNC_ABI void PrintStatistics();
 
 /// Print statistics to the given output stream.
-void PrintStatistics(raw_ostream &OS);
+LLVM_FUNC_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_FUNC_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.
@@ -200,7 +200,7 @@ void PrintStatisticsJSON(raw_ostream &OS);
 /// 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.
-std::vector<std::pair<StringRef, uint64_t>> GetStatistics();
+LLVM_FUNC_ABI std::vector<std::pair<StringRef, uint64_t>> GetStatistics();
 
 /// Reset the statistics. This can be used to zero and de-register the
 /// statistics in order to measure a compilation.
@@ -215,7 +215,7 @@ std::vector<std::pair<StringRef, uint64_t>> GetStatistics();
 /// 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_FUNC_ABI void ResetStatistics();
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
index caa37792a1271d9..c6e9bcc230ad055 100644
--- a/llvm/include/llvm/ADT/StringMap.h
+++ b/llvm/include/llvm/ADT/StringMap.h
@@ -30,7 +30,7 @@ template <typename ValueTy> class StringMapKeyIterator;
 
 /// StringMapImpl - This is the base class of StringMap that is shared among
 /// all of its instantiations.
-class StringMapImpl {
+class LLVM_CLASS_ABI StringMapImpl {
 protected:
   // Array of NumBuckets pointers to entries, null pointers are holes.
   // TheTable[NumBuckets] contains a sentinel value for easy iteration. Followed
@@ -108,7 +108,7 @@ class StringMapImpl {
 /// funky memory allocation and hashing things to make it extremely efficient,
 /// storing the string data *after* the value in the map.
 template <typename ValueTy, typename AllocatorTy = MallocAllocator>
-class LLVM_ALLOCATORHOLDER_EMPTYBASE StringMap
+class LLVM_CLASS_ABI LLVM_ALLOCATORHOLDER_EMPTYBASE StringMap
     : public StringMapImpl,
       private detail::AllocatorHolder<AllocatorTy> {
   using AllocTy = detail::AllocatorHolder<AllocatorTy>;
@@ -396,7 +396,7 @@ class LLVM_ALLOCATORHOLDER_EMPTYBASE StringMap
 };
 
 template <typename DerivedTy, typename ValueTy>
-class StringMapIterBase
+class LLVM_CLASS_ABI StringMapIterBase
     : public iterator_facade_base<DerivedTy, std::forward_iterator_tag,
                                   ValueTy> {
 protected:
@@ -441,7 +441,7 @@ class StringMapIterBase
 };
 
 template <typename ValueTy>
-class StringMapConstIterator
+class LLVM_CLASS_ABI StringMapConstIterator
     : public StringMapIterBase<StringMapConstIterator<ValueTy>,
                                const StringMapEntry<ValueTy>> {
   using base = StringMapIterBase<StringMapConstIterator<ValueTy>,
@@ -459,7 +459,7 @@ class StringMapConstIterator
 };
 
 template <typename ValueTy>
-class StringMapIterator : public StringMapIterBase<StringMapIterator<ValueTy>,
+class LLVM_CLASS_ABI StringMapIterator : public StringMapIterBase<StringMapIterator<ValueTy>,
                                                    StringMapEntry<ValueTy>> {
   using base =
       StringMapIterBase<StringMapIterator<ValueTy>, StringMapEntry<ValueTy>>;
@@ -480,7 +480,7 @@ class StringMapIterator : public StringMapIterBase<StringMapIterator<ValueTy>,
 };
 
 template <typename ValueTy>
-class StringMapKeyIterator
+class LLVM_CLASS_ABI StringMapKeyIterator
     : public iterator_adaptor_base<StringMapKeyIterator<ValueTy>,
                                    StringMapConstIterator<ValueTy>,
                                    std::forward_iterator_tag, StringRef> {
diff --git a/llvm/include/llvm/ADT/StringMapEntry.h b/llvm/include/llvm/ADT/StringMapEntry.h
index 393beceeca7da75..36966f49d5e3738 100644
--- a/llvm/include/llvm/ADT/StringMapEntry.h
+++ b/llvm/include/llvm/ADT/StringMapEntry.h
@@ -23,7 +23,7 @@
 namespace llvm {
 
 /// StringMapEntryBase - Shared base class of StringMapEntry instances.
-class StringMapEntryBase {
+class LLVM_CLASS_ABI StringMapEntryBase {
   size_t keyLength;
 
 public:
@@ -67,7 +67,7 @@ void *StringMapEntryBase::allocateWithKey(size_t EntrySize, size_t EntryAlign,
 /// This is primarily intended to support StringSet, which doesn't need a value
 /// stored at all.
 template <typename ValueTy>
-class StringMapEntryStorage : public StringMapEntryBase {
+class LLVM_CLASS_ABI StringMapEntryStorage : public StringMapEntryBase {
 public:
   ValueTy second;
 
@@ -86,7 +86,7 @@ class StringMapEntryStorage : public StringMapEntryBase {
 };
 
 template <>
-class StringMapEntryStorage<std::nullopt_t> : public StringMapEntryBase {
+class LLVM_CLASS_ABI StringMapEntryStorage<std::nullopt_t> : public StringMapEntryBase {
 public:
   explicit StringMapEntryStorage(size_t keyLength,
                                  std::nullopt_t = std::nullopt)
@@ -100,7 +100,7 @@ class StringMapEntryStorage<std::nullopt_t> : public StringMapEntryBase {
 /// a StringMap.  It contains the Value itself and the key: the string length
 /// and data.
 template <typename ValueTy>
-class StringMapEntry final : public StringMapEntryStorage<ValueTy> {
+class LLVM_CLASS_ABI StringMapEntry final : public StringMapEntryStorage<ValueTy> {
 public:
   using StringMapEntryStorage<ValueTy>::StringMapEntryStorage;
 
@@ -163,11 +163,11 @@ decltype(auto) get(const StringMapEntry<ValueTy> &E) {
 
 namespace std {
 template <typename ValueTy>
-struct tuple_size<llvm::StringMapEntry<ValueTy>>
+struct LLVM_CLASS_ABI tuple_size<llvm::StringMapEntry<ValueTy>>
     : std::integral_constant<std::size_t, 2> {};
 
 template <std::size_t I, typename ValueTy>
-struct tuple_element<I, llvm::StringMapEntry<ValueTy>>
+struct LLVM_CLASS_ABI tuple_element<I, llvm::StringMapEntry<ValueTy>>
     : std::conditional<I == 0, llvm::StringRef, ValueTy> {};
 } // namespace std
 
diff --git a/llvm/include/llvm/ADT/StringSet.h b/llvm/include/llvm/ADT/StringSet.h
index 0dc9c2358bdd606..2648e04cb22bced 100644
--- a/llvm/include/llvm/ADT/StringSet.h
+++ b/llvm/include/llvm/ADT/StringSet.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 /// StringSet - A wrapper for StringMap that provides set-like functionality.
 template <class AllocatorTy = MallocAllocator>
-class StringSet : public StringMap<std::nullopt_t, AllocatorTy> {
+class LLVM_CLASS_ABI StringSet : public StringMap<std::nullopt_t, AllocatorTy> {
   using Base = StringMap<std::nullopt_t, AllocatorTy>;
 
 public:
diff --git a/llvm/include/llvm/ADT/StringSwitch.h b/llvm/include/llvm/ADT/StringSwitch.h
index 519f7c4f2125a79..034548254400522 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -41,7 +41,7 @@ namespace llvm {
 ///   .Default(UnknownColor);
 /// \endcode
 template<typename T, typename R = T>
-class StringSwitch {
+class LLVM_CLASS_ABI StringSwitch {
   /// The string we are matching.
   const StringRef Str;
 
diff --git a/llvm/include/llvm/ADT/TinyPtrVector.h b/llvm/include/llvm/ADT/TinyPtrVector.h
index 8309a06ab0a0d4d..6731026e11d8c4c 100644
--- a/llvm/include/llvm/ADT/TinyPtrVector.h
+++ b/llvm/include/llvm/ADT/TinyPtrVector.h
@@ -27,7 +27,7 @@ namespace llvm {
 /// NOTE: This container doesn't allow you to store a null pointer into it.
 ///
 template <typename EltTy>
-class TinyPtrVector {
+class LLVM_CLASS_ABI TinyPtrVector {
 public:
   using VecTy = SmallVector<EltTy, 4>;
   using value_type = typename VecTy::value_type;
diff --git a/llvm/include/llvm/ADT/UniqueVector.h b/llvm/include/llvm/ADT/UniqueVector.h
index d1f36d6fde06256..e91fda6e43776da 100644
--- a/llvm/include/llvm/ADT/UniqueVector.h
+++ b/llvm/include/llvm/ADT/UniqueVector.h
@@ -22,7 +22,7 @@ namespace llvm {
 /// unique entry that is added.  T is the type of entries in the vector. This
 /// class should have an implementation of operator== and of operator<.
 /// Entries can be fetched using operator[] with the entry ID.
-template<class T> class UniqueVector {
+template<class T> class LLVM_CLASS_ABI UniqueVector {
 public:
   using VectorType = typename std::vector<T>;
   using iterator = typename VectorType::iterator;
diff --git a/llvm/include/llvm/ADT/fallible_iterator.h b/llvm/include/llvm/ADT/fallible_iterator.h
index d24b8644ae26bfd..5fbb0ea0ed39d9c 100644
--- a/llvm/include/llvm/ADT/fallible_iterator.h
+++ b/llvm/include/llvm/ADT/fallible_iterator.h
@@ -66,7 +66,7 @@ namespace llvm {
 /// an end value proves that there was no error, and is equivalent to checking
 /// that the Error is success). This allows early exits from the loop body
 /// without requiring redundant error checks.
-template <typename Underlying> class fallible_iterator {
+template <typename Underlying> class LLVM_CLASS_ABI fallible_iterator {
 private:
   template <typename T>
   using enable_if_struct_deref_supported = std::enable_if_t<
diff --git a/llvm/include/llvm/ADT/ilist.h b/llvm/include/llvm/ADT/ilist.h
index d9adae6038a13ed..97ec6df7d710c96 100644
--- a/llvm/include/llvm/ADT/ilist.h
+++ b/llvm/include/llvm/ADT/ilist.h
@@ -39,7 +39,7 @@ namespace llvm {
 /// something like \a BumpPtrList.)
 ///
 /// \see ilist_noalloc_traits
-template <typename NodeTy> struct ilist_alloc_traits {
+template <typename NodeTy> struct LLVM_CLASS_ABI ilist_alloc_traits {
   static void deleteNode(NodeTy *V) { delete V; }
 };
 
@@ -55,7 +55,7 @@ template <typename NodeTy> struct ilist_alloc_traits {
 /// template <>
 /// struct ilist_alloc_traits<MyType> : ilist_noalloc_traits<MyType> {};
 /// \endcode
-template <typename NodeTy> struct ilist_noalloc_traits {
+template <typename NodeTy> struct LLVM_CLASS_ABI ilist_noalloc_traits {
   static void deleteNode(NodeTy *V) {}
 };
 
@@ -63,7 +63,7 @@ template <typename NodeTy> struct ilist_noalloc_traits {
 ///
 /// Specialize this for to use callbacks for when nodes change their list
 /// membership.
-template <typename NodeTy> struct ilist_callback_traits {
+template <typename NodeTy> struct LLVM_CLASS_ABI ilist_callback_traits {
   void addNodeToList(NodeTy *) {}
   void removeNodeFromList(NodeTy *) {}
 
@@ -81,17 +81,17 @@ template <typename NodeTy> struct ilist_callback_traits {
 ///
 /// TODO: Remove this layer of indirection.  It's not necessary.
 template <typename NodeTy>
-struct ilist_node_traits : ilist_alloc_traits<NodeTy>,
+struct LLVM_CLASS_ABI ilist_node_traits : ilist_alloc_traits<NodeTy>,
                            ilist_callback_traits<NodeTy> {};
 
 /// Template traits for intrusive list.
 ///
 /// Customize callbacks and allocation semantics.
 template <typename NodeTy>
-struct ilist_traits : public ilist_node_traits<NodeTy> {};
+struct LLVM_CLASS_ABI ilist_traits : public ilist_node_traits<NodeTy> {};
 
 /// Const traits should never be instantiated.
-template <typename Ty> struct ilist_traits<const Ty> {};
+template <typename Ty> struct LLVM_CLASS_ABI ilist_traits<const Ty> {};
 
 //===----------------------------------------------------------------------===//
 //
@@ -108,7 +108,7 @@ template <typename Ty> struct ilist_traits<const Ty> {};
 /// ilist_sentinel, which holds pointers to the first and last nodes in the
 /// list.
 template <class IntrusiveListT, class TraitsT>
-class iplist_impl : public TraitsT, IntrusiveListT {
+class LLVM_CLASS_ABI iplist_impl : public TraitsT, IntrusiveListT {
   typedef IntrusiveListT base_list_type;
 
 public:
@@ -325,7 +325,7 @@ class iplist_impl : public TraitsT, IntrusiveListT {
 /// The \p Options parameters are the same as those for \a simple_ilist.  See
 /// there for a description of what's available.
 template <class T, class... Options>
-class iplist
+class LLVM_CLASS_ABI iplist
     : public iplist_impl<simple_ilist<T, Options...>, ilist_traits<T>> {
   using iplist_impl_type = typename iplist::iplist_impl;
 
diff --git a/llvm/include/llvm/ADT/ilist_base.h b/llvm/include/llvm/ADT/ilist_base.h
index 32e676b2779a897..343ae7f9b8430e3 100644
--- a/llvm/include/llvm/ADT/ilist_base.h
+++ b/llvm/include/llvm/ADT/ilist_base.h
@@ -16,7 +16,7 @@
 namespace llvm {
 
 /// Implementations of list algorithms using ilist_node_base.
-template <bool EnableSentinelTracking> class ilist_base {
+template <bool EnableSentinelTracking> class LLVM_CLASS_ABI ilist_base {
 public:
   using node_base_type = ilist_node_base<EnableSentinelTracking>;
 
diff --git a/llvm/include/llvm/ADT/ilist_iterator.h b/llvm/include/llvm/ADT/ilist_iterator.h
index ad428241e4aa214..e03f2beefa98dd5 100644
--- a/llvm/include/llvm/ADT/ilist_iterator.h
+++ b/llvm/include/llvm/ADT/ilist_iterator.h
@@ -22,14 +22,14 @@ namespace ilist_detail {
 
 /// Find const-correct node types.
 template <class OptionsT, bool IsConst> struct IteratorTraits;
-template <class OptionsT> struct IteratorTraits<OptionsT, false> {
+template <class OptionsT> struct LLVM_CLASS_ABI IteratorTraits<OptionsT, false> {
   using value_type = typename OptionsT::value_type;
   using pointer = typename OptionsT::pointer;
   using reference = typename OptionsT::reference;
   using node_pointer = ilist_node_impl<OptionsT> *;
   using node_reference = ilist_node_impl<OptionsT> &;
 };
-template <class OptionsT> struct IteratorTraits<OptionsT, true> {
+template <class OptionsT> struct LLVM_CLASS_ABI IteratorTraits<OptionsT, true> {
   using value_type = const typename OptionsT::value_type;
   using pointer = typename OptionsT::const_pointer;
   using reference = typename OptionsT::const_reference;
@@ -38,13 +38,13 @@ template <class OptionsT> struct IteratorTraits<OptionsT, true> {
 };
 
 template <bool IsReverse> struct IteratorHelper;
-template <> struct IteratorHelper<false> : ilist_detail::NodeAccess {
+template <> struct LLVM_CLASS_ABI IteratorHelper<false> : ilist_detail::NodeAccess {
   using Access = ilist_detail::NodeAccess;
 
   template <class T> static void increment(T *&I) { I = Access::getNext(*I); }
   template <class T> static void decrement(T *&I) { I = Access::getPrev(*I); }
 };
-template <> struct IteratorHelper<true> : ilist_detail::NodeAccess {
+template <> struct LLVM_CLASS_ABI IteratorHelper<true> : ilist_detail::NodeAccess {
   using Access = ilist_detail::NodeAccess;
 
   template <class T> static void increment(T *&I) { I = Access::getPrev(*I); }
@@ -55,7 +55,7 @@ template <> struct IteratorHelper<true> : ilist_detail::NodeAccess {
 
 /// Iterator for intrusive lists  based on ilist_node.
 template <class OptionsT, bool IsReverse, bool IsConst>
-class ilist_iterator : ilist_detail::SpecificNodeAccess<OptionsT> {
+class LLVM_CLASS_ABI ilist_iterator : ilist_detail::SpecificNodeAccess<OptionsT> {
   friend ilist_iterator<OptionsT, IsReverse, !IsConst>;
   friend ilist_iterator<OptionsT, !IsReverse, IsConst>;
   friend ilist_iterator<OptionsT, !IsReverse, !IsConst>;
@@ -183,14 +183,14 @@ template <typename From> struct simplify_type;
 ///
 /// FIXME: remove this, since there is no implicit conversion to NodeTy.
 template <class OptionsT, bool IsConst>
-struct simplify_type<ilist_iterator<OptionsT, false, IsConst>> {
+struct LLVM_CLASS_ABI simplify_type<ilist_iterator<OptionsT, false, IsConst>> {
   using iterator = ilist_iterator<OptionsT, false, IsConst>;
   using SimpleType = typename iterator::pointer;
 
   static SimpleType getSimplifiedValue(const iterator &Node) { return &*Node; }
 };
 template <class OptionsT, bool IsConst>
-struct simplify_type<const ilist_iterator<OptionsT, false, IsConst>>
+struct LLVM_CLASS_ABI simplify_type<const ilist_iterator<OptionsT, false, IsConst>>
     : simplify_type<ilist_iterator<OptionsT, false, IsConst>> {};
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/ADT/ilist_node.h b/llvm/include/llvm/ADT/ilist_node.h
index f8af8fca6e7ef98..d54c8e19b9ab34a 100644
--- a/llvm/include/llvm/ADT/ilist_node.h
+++ b/llvm/include/llvm/ADT/ilist_node.h
@@ -38,7 +38,7 @@ template <class OptionsT> class ilist_sentinel;
 /// This is a wrapper around \a ilist_node_base whose main purpose is to
 /// provide type safety: you can't insert nodes of \a ilist_node_impl into the
 /// wrong \a simple_ilist or \a iplist.
-template <class OptionsT> class ilist_node_impl : OptionsT::node_base_type {
+template <class OptionsT> class LLVM_CLASS_ABI ilist_node_impl : OptionsT::node_base_type {
   using value_type = typename OptionsT::value_type;
   using node_base_type = typename OptionsT::node_base_type;
   using list_base_type = typename OptionsT::list_base_type;
@@ -147,7 +147,7 @@ template <class OptionsT> class ilist_node_impl : OptionsT::node_base_type {
 ///
 /// See \a is_valid_option for steps on adding a new option.
 template <class T, class... Options>
-class ilist_node
+class LLVM_CLASS_ABI ilist_node
     : public ilist_node_impl<
           typename ilist_detail::compute_node_options<T, Options...>::type> {
   static_assert(ilist_detail::check_options<Options...>::value,
@@ -162,7 +162,7 @@ namespace ilist_detail {
 /// should friend this class if they inherit privately from ilist_node.
 ///
 /// Using this class outside of the ilist implementation is unsupported.
-struct NodeAccess {
+struct LLVM_CLASS_ABI NodeAccess {
 protected:
   template <class OptionsT>
   static ilist_node_impl<OptionsT> *getNodePtr(typename OptionsT::pointer N) {
@@ -209,7 +209,7 @@ struct NodeAccess {
   }
 };
 
-template <class OptionsT> struct SpecificNodeAccess : NodeAccess {
+template <class OptionsT> struct LLVM_CLASS_ABI SpecificNodeAccess : NodeAccess {
 protected:
   using pointer = typename OptionsT::pointer;
   using const_pointer = typename OptionsT::const_pointer;
@@ -235,7 +235,7 @@ template <class OptionsT> struct SpecificNodeAccess : NodeAccess {
 } // end namespace ilist_detail
 
 template <class OptionsT>
-class ilist_sentinel : public ilist_node_impl<OptionsT> {
+class LLVM_CLASS_ABI ilist_sentinel : public ilist_node_impl<OptionsT> {
 public:
   ilist_sentinel() {
     this->initializeSentinel();
@@ -255,7 +255,7 @@ class ilist_sentinel : public ilist_node_impl<OptionsT> {
 /// Requires \c NodeTy to have \a getParent() to find the parent node, and the
 /// \c ParentTy to have \a getSublistAccess() to get a reference to the list.
 template <typename NodeTy, typename ParentTy, class... Options>
-class ilist_node_with_parent : public ilist_node<NodeTy, Options...> {
+class LLVM_CLASS_ABI ilist_node_with_parent : public ilist_node<NodeTy, Options...> {
 protected:
   ilist_node_with_parent() = default;
 
diff --git a/llvm/include/llvm/ADT/ilist_node_base.h b/llvm/include/llvm/ADT/ilist_node_base.h
index 04d6ede9c6a69a4..1c20ab14af89d7c 100644
--- a/llvm/include/llvm/ADT/ilist_node_base.h
+++ b/llvm/include/llvm/ADT/ilist_node_base.h
@@ -19,7 +19,7 @@ namespace llvm {
 /// Optionally tracks whether this node is the sentinel.
 template <bool EnableSentinelTracking> class ilist_node_base;
 
-template <> class ilist_node_base<false> {
+template <> class LLVM_CLASS_ABI ilist_node_base<false> {
   ilist_node_base *Prev = nullptr;
   ilist_node_base *Next = nullptr;
 
@@ -33,7 +33,7 @@ template <> class ilist_node_base<false> {
   void initializeSentinel() {}
 };
 
-template <> class ilist_node_base<true> {
+template <> class LLVM_CLASS_ABI ilist_node_base<true> {
   PointerIntPair<ilist_node_base *, 1> PrevAndSentinel;
   ilist_node_base *Next = nullptr;
 
diff --git a/llvm/include/llvm/ADT/ilist_node_options.h b/llvm/include/llvm/ADT/ilist_node_options.h
index e07cbcfd7bb83e0..3e9925cd62cffa2 100644
--- a/llvm/include/llvm/ADT/ilist_node_options.h
+++ b/llvm/include/llvm/ADT/ilist_node_options.h
@@ -24,18 +24,18 @@ template <bool EnableSentinelTracking> class ilist_base;
 /// This option affects the ABI for the nodes.  When not specified explicitly,
 /// the ABI depends on LLVM_ENABLE_ABI_BREAKING_CHECKS.  Specify explicitly to
 /// enable \a ilist_node::isSentinel().
-template <bool EnableSentinelTracking> struct ilist_sentinel_tracking {};
+template <bool EnableSentinelTracking> struct LLVM_CLASS_ABI ilist_sentinel_tracking {};
 
 /// Option to specify a tag for the node type.
 ///
 /// This option allows a single value type to be inserted in multiple lists
 /// simultaneously.  See \a ilist_node for usage examples.
-template <class Tag> struct ilist_tag {};
+template <class Tag> struct LLVM_CLASS_ABI ilist_tag {};
 
 namespace ilist_detail {
 
 /// Helper trait for recording whether an option is specified explicitly.
-template <bool IsExplicit> struct explicitness {
+template <bool IsExplicit> struct LLVM_CLASS_ABI explicitness {
   static const bool is_explicit = IsExplicit;
 };
 typedef explicitness<true> is_explicit;
@@ -52,7 +52,7 @@ typedef explicitness<false> is_implicit;
 /// \li specialize \c is_valid_option<ilist_foo<Bar>> to inherit from \c
 /// std::true_type to get static assertions passing in \a simple_ilist and \a
 /// ilist_node.
-template <class Option> struct is_valid_option : std::false_type {};
+template <class Option> struct LLVM_CLASS_ABI is_valid_option : std::false_type {};
 
 /// Extract sentinel tracking option.
 ///
@@ -60,20 +60,20 @@ template <class Option> struct is_valid_option : std::false_type {};
 /// default depending on LLVM_ENABLE_ABI_BREAKING_CHECKS.
 template <class... Options> struct extract_sentinel_tracking;
 template <bool EnableSentinelTracking, class... Options>
-struct extract_sentinel_tracking<
+struct LLVM_CLASS_ABI extract_sentinel_tracking<
     ilist_sentinel_tracking<EnableSentinelTracking>, Options...>
     : std::integral_constant<bool, EnableSentinelTracking>, is_explicit {};
 template <class Option1, class... Options>
-struct extract_sentinel_tracking<Option1, Options...>
+struct LLVM_CLASS_ABI extract_sentinel_tracking<Option1, Options...>
     : extract_sentinel_tracking<Options...> {};
 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
 template <> struct extract_sentinel_tracking<> : std::true_type, is_implicit {};
 #else
 template <>
-struct extract_sentinel_tracking<> : std::false_type, is_implicit {};
+struct LLVM_CLASS_ABI extract_sentinel_tracking<> : std::false_type, is_implicit {};
 #endif
 template <bool EnableSentinelTracking>
-struct is_valid_option<ilist_sentinel_tracking<EnableSentinelTracking>>
+struct LLVM_CLASS_ABI is_valid_option<ilist_sentinel_tracking<EnableSentinelTracking>>
     : std::true_type {};
 
 /// Extract custom tag option.
@@ -82,23 +82,23 @@ struct is_valid_option<ilist_sentinel_tracking<EnableSentinelTracking>>
 /// custom tag type, using void as a default.
 template <class... Options> struct extract_tag;
 template <class Tag, class... Options>
-struct extract_tag<ilist_tag<Tag>, Options...> {
+struct LLVM_CLASS_ABI extract_tag<ilist_tag<Tag>, Options...> {
   typedef Tag type;
 };
 template <class Option1, class... Options>
-struct extract_tag<Option1, Options...> : extract_tag<Options...> {};
-template <> struct extract_tag<> {
+struct LLVM_CLASS_ABI extract_tag<Option1, Options...> : extract_tag<Options...> {};
+template <> struct LLVM_CLASS_ABI extract_tag<> {
   typedef void type;
 };
-template <class Tag> struct is_valid_option<ilist_tag<Tag>> : std::true_type {};
+template <class Tag> struct LLVM_CLASS_ABI is_valid_option<ilist_tag<Tag>> : std::true_type {};
 
 /// Check whether options are valid.
 ///
 /// The conjunction of \a is_valid_option on each individual option.
 template <class... Options> struct check_options;
-template <> struct check_options<> : std::true_type {};
+template <> struct LLVM_CLASS_ABI check_options<> : std::true_type {};
 template <class Option1, class... Options>
-struct check_options<Option1, Options...>
+struct LLVM_CLASS_ABI check_options<Option1, Options...>
     : std::integral_constant<bool, is_valid_option<Option1>::value &&
                                        check_options<Options...>::value> {};
 
@@ -107,7 +107,7 @@ struct check_options<Option1, Options...>
 /// This is usually computed via \a compute_node_options.
 template <class T, bool EnableSentinelTracking, bool IsSentinelTrackingExplicit,
           class TagT>
-struct node_options {
+struct LLVM_CLASS_ABI node_options {
   typedef T value_type;
   typedef T *pointer;
   typedef T &reference;
@@ -121,7 +121,7 @@ struct node_options {
   typedef ilist_base<enable_sentinel_tracking> list_base_type;
 };
 
-template <class T, class... Options> struct compute_node_options {
+template <class T, class... Options> struct LLVM_CLASS_ABI compute_node_options {
   typedef node_options<T, extract_sentinel_tracking<Options...>::value,
                        extract_sentinel_tracking<Options...>::is_explicit,
                        typename extract_tag<Options...>::type>
diff --git a/llvm/include/llvm/ADT/iterator_range.h b/llvm/include/llvm/ADT/iterator_range.h
index dd8cfd5e6ab5617..463e40996de7b42 100644
--- a/llvm/include/llvm/ADT/iterator_range.h
+++ b/llvm/include/llvm/ADT/iterator_range.h
@@ -19,6 +19,7 @@
 #define LLVM_ADT_ITERATOR_RANGE_H
 
 #include "llvm/ADT/ADL.h"
+#include "llvm/Support/Compiler.h"
 #include <type_traits>
 #include <utility>
 
diff --git a/llvm/include/llvm/ADT/simple_ilist.h b/llvm/include/llvm/ADT/simple_ilist.h
index 3a96e1ba56575d6..68da8e8ea07c670 100644
--- a/llvm/include/llvm/ADT/simple_ilist.h
+++ b/llvm/include/llvm/ADT/simple_ilist.h
@@ -75,7 +75,7 @@ namespace llvm {
 ///
 /// See \a is_valid_option for steps on adding a new option.
 template <typename T, class... Options>
-class simple_ilist
+class LLVM_CLASS_ABI simple_ilist
     : ilist_detail::compute_node_options<T, Options...>::type::list_base_type,
       ilist_detail::SpecificNodeAccess<
           typename ilist_detail::compute_node_options<T, Options...>::type> {
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index bf57e200cae7d2a..56cb2ffa989ecf8 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -80,7 +80,7 @@ template <typename> class SmallPtrSetImpl;
 ///
 /// See docs/AliasAnalysis.html for more information on the specific meanings
 /// of these values.
-class AliasResult {
+class LLVM_CLASS_ABI AliasResult {
 private:
   static const int OffsetBits = 23;
   static const int AliasBits = 8;
@@ -148,10 +148,10 @@ static_assert(sizeof(AliasResult) == 4,
               "AliasResult size is intended to be 4 bytes!");
 
 /// << operator for AliasResult.
-raw_ostream &operator<<(raw_ostream &OS, AliasResult AR);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, AliasResult AR);
 
 /// Virtual base class for providers of capture information.
-struct CaptureInfo {
+struct LLVM_CLASS_ABI CaptureInfo {
   virtual ~CaptureInfo() = 0;
   virtual bool isNotCapturedBeforeOrAt(const Value *Object,
                                        const Instruction *I) = 0;
@@ -160,7 +160,7 @@ struct CaptureInfo {
 /// Context-free CaptureInfo provider, which computes and caches whether an
 /// object is captured in the function at all, but does not distinguish whether
 /// it was captured before or after the context instruction.
-class SimpleCaptureInfo final : public CaptureInfo {
+class LLVM_CLASS_ABI SimpleCaptureInfo final : public CaptureInfo {
   SmallDenseMap<const Value *, bool, 8> IsCapturedCache;
 
 public:
@@ -171,7 +171,7 @@ class SimpleCaptureInfo final : public CaptureInfo {
 /// Context-sensitive CaptureInfo provider, which computes and caches the
 /// earliest common dominator closure of all captures. It provides a good
 /// approximation to a precise "captures before" analysis.
-class EarliestEscapeInfo final : public CaptureInfo {
+class LLVM_CLASS_ABI EarliestEscapeInfo final : public CaptureInfo {
   DominatorTree &DT;
   const LoopInfo &LI;
 
@@ -201,7 +201,7 @@ class EarliestEscapeInfo final : public CaptureInfo {
 /// Cache key for BasicAA results. It only includes the pointer and size from
 /// MemoryLocation, as BasicAA is AATags independent. Additionally, it includes
 /// the value of MayBeCrossIteration, which may affect BasicAA results.
-struct AACacheLoc {
+struct LLVM_CLASS_ABI AACacheLoc {
   using PtrTy = PointerIntPair<const Value *, 1, bool>;
   PtrTy Ptr;
   LocationSize Size;
@@ -211,7 +211,7 @@ struct AACacheLoc {
       : Ptr(Ptr, MayBeCrossIteration), Size(Size) {}
 };
 
-template <> struct DenseMapInfo<AACacheLoc> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<AACacheLoc> {
   static inline AACacheLoc getEmptyKey() {
     return {DenseMapInfo<AACacheLoc::PtrTy>::getEmptyKey(),
             DenseMapInfo<LocationSize>::getEmptyKey()};
@@ -239,7 +239,7 @@ class AAResults;
 /// where safe (due to the IR not changing), use a `BatchAAResults` wrapper.
 /// The information stored in an `AAQueryInfo` is currently limitted to the
 /// caches used by BasicAA, but can further be extended to fit other AA needs.
-class AAQueryInfo {
+class LLVM_CLASS_ABI AAQueryInfo {
 public:
   using LocPair = std::pair<AACacheLoc, AACacheLoc>;
   struct CacheEntry {
@@ -291,7 +291,7 @@ class AAQueryInfo {
 };
 
 /// AAQueryInfo that uses SimpleCaptureInfo.
-class SimpleAAQueryInfo : public AAQueryInfo {
+class LLVM_CLASS_ABI SimpleAAQueryInfo : public AAQueryInfo {
   SimpleCaptureInfo CI;
 
 public:
@@ -300,7 +300,7 @@ class SimpleAAQueryInfo : public AAQueryInfo {
 
 class BatchAAResults;
 
-class AAResults {
+class LLVM_CLASS_ABI AAResults {
 public:
   // Make these results default constructable and movable. We have to spell
   // these out because MSVC won't synthesize them.
@@ -618,7 +618,7 @@ class AAResults {
 /// esentially making AA work in "batch mode". The internal state cannot be
 /// cleared, so to go "out-of-batch-mode", the user must either use AAResults,
 /// or create a new BatchAAResults.
-class BatchAAResults {
+class LLVM_CLASS_ABI BatchAAResults {
   AAResults &AA;
   AAQueryInfo AAQI;
   SimpleCaptureInfo SimpleCI;
@@ -800,7 +800,7 @@ template <typename AAResultT> class AAResults::Model final : public Concept {
 /// Implementors of an alias analysis should derive from this class, and then
 /// override specific methods that they wish to customize. There is no need to
 /// use virtual anywhere.
-class AAResultBase {
+class LLVM_CLASS_ABI AAResultBase {
 protected:
   explicit AAResultBase() = default;
 
@@ -844,7 +844,7 @@ class AAResultBase {
 };
 
 /// Return true if this pointer is returned by a noalias function.
-bool isNoAliasCall(const Value *V);
+LLVM_FUNC_ABI bool isNoAliasCall(const Value *V);
 
 /// Return true if this pointer refers to a distinct and identifiable object.
 /// This returns true for:
@@ -853,25 +853,25 @@ bool isNoAliasCall(const Value *V);
 ///    ByVal and NoAlias Arguments
 ///    NoAlias returns (e.g. calls to malloc)
 ///
-bool isIdentifiedObject(const Value *V);
+LLVM_FUNC_ABI bool isIdentifiedObject(const Value *V);
 
 /// Return true if V is umabigously identified at the function-level.
 /// Different IdentifiedFunctionLocals can't alias.
 /// Further, an IdentifiedFunctionLocal can not alias with any function
 /// arguments other than itself, which is not necessarily true for
 /// IdentifiedObjects.
-bool isIdentifiedFunctionLocal(const Value *V);
+LLVM_FUNC_ABI bool isIdentifiedFunctionLocal(const Value *V);
 
 /// Returns true if the pointer is one which would have been considered an
 /// escape by isNonEscapingLocalObject.
-bool isEscapeSource(const Value *V);
+LLVM_FUNC_ABI bool isEscapeSource(const Value *V);
 
 /// Return true if Object memory is not visible after an unwind, in the sense
 /// that program semantics cannot depend on Object containing any particular
 /// value on unwind. If the RequiresNoCaptureBeforeUnwind out parameter is set
 /// to true, then the memory is only not visible if the object has not been
 /// captured prior to the unwind. Otherwise it is not visible even if captured.
-bool isNotVisibleOnUnwind(const Value *Object,
+LLVM_FUNC_ABI bool isNotVisibleOnUnwind(const Value *Object,
                           bool &RequiresNoCaptureBeforeUnwind);
 
 /// A manager for alias analyses.
@@ -891,7 +891,7 @@ bool isNotVisibleOnUnwind(const Value *Object,
 /// aggregated AA results end up being invalidated. This removes the need to
 /// explicitly preserve the results of `AAManager`. Note that analyses should no
 /// longer be registered once the `AAManager` is run.
-class AAManager : public AnalysisInfoMixin<AAManager> {
+class LLVM_CLASS_ABI AAManager : public AnalysisInfoMixin<AAManager> {
 public:
   using Result = AAResults;
 
@@ -939,7 +939,7 @@ class AAManager : public AnalysisInfoMixin<AAManager> {
 
 /// A wrapper pass to provide the legacy pass manager access to a suitably
 /// prepared AAResults object.
-class AAResultsWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI AAResultsWrapperPass : public FunctionPass {
   std::unique_ptr<AAResults> AAR;
 
 public:
@@ -957,7 +957,7 @@ class AAResultsWrapperPass : public FunctionPass {
 
 /// A wrapper pass for external alias analyses. This just squirrels away the
 /// callback used to run any analyses and register their results.
-struct ExternalAAWrapperPass : ImmutablePass {
+struct LLVM_CLASS_ABI ExternalAAWrapperPass : ImmutablePass {
   using CallbackT = std::function<void(Pass &, Function &, AAResults &)>;
 
   CallbackT CB;
@@ -980,7 +980,7 @@ struct ExternalAAWrapperPass : ImmutablePass {
 /// object, and will receive a reference to the function wrapper pass, the
 /// function, and the AAResults object to populate. This should be used when
 /// setting up a custom pass pipeline to inject a hook into the AA results.
-ImmutablePass *createExternalAAWrapperPass(
+LLVM_FUNC_ABI ImmutablePass *createExternalAAWrapperPass(
     std::function<void(Pass &, Function &, AAResults &)> Callback);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
index e12f90a66631efa..66363f19b1b65a6 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h
@@ -32,7 +32,7 @@ class AAResults;
 class Function;
 class FunctionPass;
 
-class AAEvaluator : public PassInfoMixin<AAEvaluator> {
+class LLVM_CLASS_ABI AAEvaluator : public PassInfoMixin<AAEvaluator> {
   int64_t FunctionCount = 0;
   int64_t NoAliasCount = 0, MayAliasCount = 0, PartialAliasCount = 0;
   int64_t MustAliasCount = 0;
@@ -62,7 +62,7 @@ class AAEvaluator : public PassInfoMixin<AAEvaluator> {
 };
 
 /// Create a wrapper of the above for the legacy pass manager.
-FunctionPass *createAAEvalPass();
+LLVM_FUNC_ABI FunctionPass *createAAEvalPass();
 
 }
 
diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h
index 400c573634e0086..d769a45f171cd5a 100644
--- a/llvm/include/llvm/Analysis/AliasSetTracker.h
+++ b/llvm/include/llvm/Analysis/AliasSetTracker.h
@@ -47,7 +47,7 @@ class StoreInst;
 class VAArgInst;
 class Value;
 
-class AliasSet : public ilist_node<AliasSet> {
+class LLVM_CLASS_ABI AliasSet : public ilist_node<AliasSet> {
   friend class AliasSetTracker;
 
   class PointerRec {
@@ -304,7 +304,7 @@ inline raw_ostream& operator<<(raw_ostream &OS, const AliasSet &AS) {
   return OS;
 }
 
-class AliasSetTracker {
+class LLVM_CLASS_ABI AliasSetTracker {
   BatchAAResults &AA;
   ilist<AliasSet> AliasSets;
 
@@ -406,7 +406,7 @@ inline raw_ostream& operator<<(raw_ostream &OS, const AliasSetTracker &AST) {
   return OS;
 }
 
-class AliasSetsPrinterPass : public PassInfoMixin<AliasSetsPrinterPass> {
+class LLVM_CLASS_ABI AliasSetsPrinterPass : public PassInfoMixin<AliasSetsPrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Analysis/AssumeBundleQueries.h b/llvm/include/llvm/Analysis/AssumeBundleQueries.h
index a7cc4c72605ae55..87e76dc8f193c3a 100644
--- a/llvm/include/llvm/Analysis/AssumeBundleQueries.h
+++ b/llvm/include/llvm/Analysis/AssumeBundleQueries.h
@@ -40,7 +40,7 @@ enum AssumeBundleArg {
 ///
 /// Return true iff the queried attribute was found.
 /// If ArgVal is set. the argument will be stored to ArgVal.
-bool hasAttributeInAssume(AssumeInst &Assume, Value *IsOn, StringRef AttrName,
+LLVM_FUNC_ABI bool hasAttributeInAssume(AssumeInst &Assume, Value *IsOn, StringRef AttrName,
                           uint64_t *ArgVal = nullptr);
 inline bool hasAttributeInAssume(AssumeInst &Assume, Value *IsOn,
                                  Attribute::AttrKind Kind,
@@ -49,7 +49,7 @@ inline bool hasAttributeInAssume(AssumeInst &Assume, Value *IsOn,
                               Attribute::getNameFromAttrKind(Kind), ArgVal);
 }
 
-template<> struct DenseMapInfo<Attribute::AttrKind> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<Attribute::AttrKind> {
   static Attribute::AttrKind getEmptyKey() {
     return Attribute::EmptyKey;
   }
@@ -69,7 +69,7 @@ template<> struct DenseMapInfo<Attribute::AttrKind> {
 /// If the Attribute is not on any value, the Value is nullptr.
 using RetainedKnowledgeKey = std::pair<Value *, Attribute::AttrKind>;
 
-struct MinMax {
+struct LLVM_CLASS_ABI MinMax {
   uint64_t Min;
   uint64_t Max;
 };
@@ -88,7 +88,7 @@ using RetainedKnowledgeMap =
 /// many queries are going to be made on the same llvm.assume.
 /// String attributes are not inserted in the map.
 /// If the IR changes the map will be outdated.
-void fillMapFromAssume(AssumeInst &Assume, RetainedKnowledgeMap &Result);
+LLVM_FUNC_ABI void fillMapFromAssume(AssumeInst &Assume, RetainedKnowledgeMap &Result);
 
 /// Represent one information held inside an operand bundle of an llvm.assume.
 /// AttrKind is the property that holds.
@@ -98,7 +98,7 @@ void fillMapFromAssume(AssumeInst &Assume, RetainedKnowledgeMap &Result);
 ///  - AttrKind will be Attribute::Alignment.
 ///  - WasOn will be %P.
 ///  - ArgValue will be 4.
-struct RetainedKnowledge {
+struct LLVM_CLASS_ABI RetainedKnowledge {
   Attribute::AttrKind AttrKind = Attribute::None;
   uint64_t ArgValue = 0;
   Value *WasOn = nullptr;
@@ -122,7 +122,7 @@ struct RetainedKnowledge {
 
 /// Retreive the information help by Assume on the operand at index Idx.
 /// Assume should be an llvm.assume and Idx should be in the operand bundle.
-RetainedKnowledge getKnowledgeFromOperandInAssume(AssumeInst &Assume,
+LLVM_FUNC_ABI RetainedKnowledge getKnowledgeFromOperandInAssume(AssumeInst &Assume,
                                                   unsigned Idx);
 
 /// Retreive the information help by the Use U of an llvm.assume. the use should
@@ -143,16 +143,16 @@ constexpr StringRef IgnoreBundleTag = "ignore";
 ///
 /// the argument to the call of llvm.assume may still be useful even if the
 /// function returned true.
-bool isAssumeWithEmptyBundle(AssumeInst &Assume);
+LLVM_FUNC_ABI bool isAssumeWithEmptyBundle(AssumeInst &Assume);
 
 /// Return a valid Knowledge associated to the Use U if its Attribute kind is
 /// in AttrKinds.
-RetainedKnowledge getKnowledgeFromUse(const Use *U,
+LLVM_FUNC_ABI RetainedKnowledge getKnowledgeFromUse(const Use *U,
                                       ArrayRef<Attribute::AttrKind> AttrKinds);
 
 /// Return a valid Knowledge associated to the Value V if its Attribute kind is
 /// in AttrKinds and it matches the Filter.
-RetainedKnowledge getKnowledgeForValue(
+LLVM_FUNC_ABI RetainedKnowledge getKnowledgeForValue(
     const Value *V, ArrayRef<Attribute::AttrKind> AttrKinds,
     AssumptionCache *AC = nullptr,
     function_ref<bool(RetainedKnowledge, Instruction *,
@@ -162,14 +162,14 @@ RetainedKnowledge getKnowledgeForValue(
 /// Return a valid Knowledge associated to the Value V if its Attribute kind is
 /// in AttrKinds and the knowledge is suitable to be used in the context of
 /// CtxI.
-RetainedKnowledge getKnowledgeValidInContext(
+LLVM_FUNC_ABI RetainedKnowledge getKnowledgeValidInContext(
     const Value *V, ArrayRef<Attribute::AttrKind> AttrKinds,
     const Instruction *CtxI, const DominatorTree *DT = nullptr,
     AssumptionCache *AC = nullptr);
 
 /// This extracts the Knowledge from an element of an operand bundle.
 /// This is mostly for use in the assume builder.
-RetainedKnowledge getKnowledgeFromBundle(AssumeInst &Assume,
+LLVM_FUNC_ABI RetainedKnowledge getKnowledgeFromBundle(AssumeInst &Assume,
                                          const CallBase::BundleOpInfo &BOI);
 
 } // namespace llvm
diff --git a/llvm/include/llvm/Analysis/AssumptionCache.h b/llvm/include/llvm/Analysis/AssumptionCache.h
index 982b2927a5b7e8b..c18dfeb0b00fb62 100644
--- a/llvm/include/llvm/Analysis/AssumptionCache.h
+++ b/llvm/include/llvm/Analysis/AssumptionCache.h
@@ -40,7 +40,7 @@ class Value;
 /// that create new assumptions are required to call registerAssumption() to
 /// register any new \@llvm.assume calls that they create. Deletions of
 /// \@llvm.assume calls do not require special handling.
-class AssumptionCache {
+class LLVM_CLASS_ABI AssumptionCache {
 public:
   /// Value of ResultElem::Index indicating that the argument to the call of the
   /// llvm.assume.
@@ -171,7 +171,7 @@ class AssumptionCache {
 ///
 /// This analysis is intended for use with the new pass manager and will vend
 /// assumption caches for a given function.
-class AssumptionAnalysis : public AnalysisInfoMixin<AssumptionAnalysis> {
+class LLVM_CLASS_ABI AssumptionAnalysis : public AnalysisInfoMixin<AssumptionAnalysis> {
   friend AnalysisInfoMixin<AssumptionAnalysis>;
 
   static AnalysisKey Key;
@@ -183,7 +183,7 @@ class AssumptionAnalysis : public AnalysisInfoMixin<AssumptionAnalysis> {
 };
 
 /// Printer pass for the \c AssumptionAnalysis results.
-class AssumptionPrinterPass : public PassInfoMixin<AssumptionPrinterPass> {
+class LLVM_CLASS_ABI AssumptionPrinterPass : public PassInfoMixin<AssumptionPrinterPass> {
   raw_ostream &OS;
 
 public:
@@ -200,7 +200,7 @@ class AssumptionPrinterPass : public PassInfoMixin<AssumptionPrinterPass> {
 /// function is deleted. The nature of the AssumptionCache is that it is not
 /// invalidated by any changes to the function body and so this is sufficient
 /// to be conservatively correct.
-class AssumptionCacheTracker : public ImmutablePass {
+class LLVM_CLASS_ABI AssumptionCacheTracker : public ImmutablePass {
   /// A callback value handle applied to function objects, which we use to
   /// delete our cache of intrinsics for a function when it is deleted.
   class FunctionCallbackVH final : public CallbackVH {
@@ -252,14 +252,14 @@ class AssumptionCacheTracker : public ImmutablePass {
   static char ID; // Pass identification, replacement for typeid
 };
 
-template<> struct simplify_type<AssumptionCache::ResultElem> {
+template<> struct LLVM_CLASS_ABI simplify_type<AssumptionCache::ResultElem> {
   using SimpleType = Value *;
 
   static SimpleType getSimplifiedValue(AssumptionCache::ResultElem &Val) {
     return Val;
   }
 };
-template<> struct simplify_type<const AssumptionCache::ResultElem> {
+template<> struct LLVM_CLASS_ABI simplify_type<const AssumptionCache::ResultElem> {
   using SimpleType = /*const*/ Value *;
 
   static SimpleType getSimplifiedValue(const AssumptionCache::ResultElem &Val) {
diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
index df4b5e533734de7..482907a636a0060 100644
--- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
@@ -40,7 +40,7 @@ class Value;
 /// While it does retain some storage, that is used as an optimization and not
 /// to preserve information from query to query. However it does retain handles
 /// to various other analyses and must be recomputed when those analyses are.
-class BasicAAResult : public AAResultBase {
+class LLVM_CLASS_ABI BasicAAResult : public AAResultBase {
   const DataLayout &DL;
   const Function &F;
   const TargetLibraryInfo &TLI;
@@ -145,7 +145,7 @@ class BasicAAResult : public AAResultBase {
 };
 
 /// Analysis pass providing a never-invalidated alias analysis result.
-class BasicAA : public AnalysisInfoMixin<BasicAA> {
+class LLVM_CLASS_ABI BasicAA : public AnalysisInfoMixin<BasicAA> {
   friend AnalysisInfoMixin<BasicAA>;
 
   static AnalysisKey Key;
@@ -157,7 +157,7 @@ class BasicAA : public AnalysisInfoMixin<BasicAA> {
 };
 
 /// Legacy wrapper pass to provide the BasicAAResult object.
-class BasicAAWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI BasicAAWrapperPass : public FunctionPass {
   std::unique_ptr<BasicAAResult> Result;
 
   virtual void anchor();
@@ -174,7 +174,7 @@ class BasicAAWrapperPass : public FunctionPass {
   void getAnalysisUsage(AnalysisUsage &AU) const override;
 };
 
-FunctionPass *createBasicAAWrapperPass();
+LLVM_FUNC_ABI FunctionPass *createBasicAAWrapperPass();
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
index 1ce36da169ff697..ddbe480274bdbfb 100644
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h
@@ -35,7 +35,7 @@ enum PGOViewCountsType { PGOVCT_None, PGOVCT_Graph, PGOVCT_Text };
 
 /// BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to
 /// estimate IR basic block frequencies.
-class BlockFrequencyInfo {
+class LLVM_CLASS_ABI BlockFrequencyInfo {
   using ImplType = BlockFrequencyInfoImpl<BasicBlock>;
 
   std::unique_ptr<ImplType> BFI;
@@ -110,7 +110,7 @@ class BlockFrequencyInfo {
 };
 
 /// Analysis pass which computes \c BlockFrequencyInfo.
-class BlockFrequencyAnalysis
+class LLVM_CLASS_ABI BlockFrequencyAnalysis
     : public AnalysisInfoMixin<BlockFrequencyAnalysis> {
   friend AnalysisInfoMixin<BlockFrequencyAnalysis>;
 
@@ -125,7 +125,7 @@ class BlockFrequencyAnalysis
 };
 
 /// Printer pass for the \c BlockFrequencyInfo results.
-class BlockFrequencyPrinterPass
+class LLVM_CLASS_ABI BlockFrequencyPrinterPass
     : public PassInfoMixin<BlockFrequencyPrinterPass> {
   raw_ostream &OS;
 
@@ -136,7 +136,7 @@ class BlockFrequencyPrinterPass
 };
 
 /// Legacy analysis pass which computes \c BlockFrequencyInfo.
-class BlockFrequencyInfoWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI BlockFrequencyInfoWrapperPass : public FunctionPass {
   BlockFrequencyInfo BFI;
 
 public:
diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
index 6517c0c5d2e23fc..dac44843ee26410 100644
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
@@ -53,11 +53,11 @@
 #define DEBUG_TYPE "block-freq"
 
 namespace llvm {
-extern llvm::cl::opt<bool> CheckBFIUnknownBlockQueries;
+LLVM_FUNC_ABI extern llvm::cl::opt<bool> CheckBFIUnknownBlockQueries;
 
-extern llvm::cl::opt<bool> UseIterativeBFIInference;
-extern llvm::cl::opt<unsigned> IterativeBFIMaxIterationsPerBlock;
-extern llvm::cl::opt<double> IterativeBFIPrecision;
+LLVM_FUNC_ABI extern llvm::cl::opt<bool> UseIterativeBFIInference;
+LLVM_FUNC_ABI extern llvm::cl::opt<unsigned> IterativeBFIMaxIterationsPerBlock;
+LLVM_FUNC_ABI extern llvm::cl::opt<double> IterativeBFIPrecision;
 
 class BranchProbabilityInfo;
 class Function;
@@ -90,7 +90,7 @@ template <class BT> struct BlockEdgesAdder;
 /// quite, maximum precision).
 ///
 /// Masses can be scaled by \a BranchProbability at maximum precision.
-class BlockMass {
+class LLVM_CLASS_ABI BlockMass {
   uint64_t Mass = 0;
 
 public:
@@ -178,7 +178,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, BlockMass X) {
 ///
 /// Nevertheless, the majority of the overall algorithm documentation lives with
 /// BlockFrequencyInfoImpl.  See there for details.
-class BlockFrequencyInfoImplBase {
+class LLVM_CLASS_ABI BlockFrequencyInfoImplBase {
 public:
   using Scaled64 = ScaledNumber<uint64_t>;
   using BlockMass = bfi_detail::BlockMass;
@@ -546,8 +546,8 @@ class BlockFrequencyInfoImplBase {
 
 namespace bfi_detail {
 
-template <class BlockT> struct TypeMap {};
-template <> struct TypeMap<BasicBlock> {
+template <class BlockT> struct LLVM_CLASS_ABI TypeMap {};
+template <> struct LLVM_CLASS_ABI TypeMap<BasicBlock> {
   using BlockT = BasicBlock;
   using BlockKeyT = AssertingVH<const BasicBlock>;
   using FunctionT = Function;
@@ -555,7 +555,7 @@ template <> struct TypeMap<BasicBlock> {
   using LoopT = Loop;
   using LoopInfoT = LoopInfo;
 };
-template <> struct TypeMap<MachineBasicBlock> {
+template <> struct LLVM_CLASS_ABI TypeMap<MachineBasicBlock> {
   using BlockT = MachineBasicBlock;
   using BlockKeyT = const MachineBasicBlock *;
   using FunctionT = MachineFunction;
@@ -601,7 +601,7 @@ template <> inline std::string getBlockName(const BasicBlock *BB) {
 /// \a GraphTraits (so that \a analyzeIrreducible() can use \a scc_iterator),
 /// and it explicitly lists predecessors and successors.  The initialization
 /// that relies on \c MachineBasicBlock is defined in the header.
-struct IrreducibleGraph {
+struct LLVM_CLASS_ABI IrreducibleGraph {
   using BFIBase = BlockFrequencyInfoImplBase;
 
   BFIBase &BFI;
@@ -847,7 +847,7 @@ void IrreducibleGraph::addEdges(const BlockNode &Node,
 ///         used for computing loop scale) is the sum of all iterations.
 ///         (Running this until fixed point would "solve" the geometric
 ///         series by simulation.)
-template <class BT> class BlockFrequencyInfoImpl : BlockFrequencyInfoImplBase {
+template <class BT> class LLVM_CLASS_ABI BlockFrequencyInfoImpl : BlockFrequencyInfoImplBase {
   // This is part of a workaround for a GCC 4.7 crash on lambdas.
   friend struct bfi_detail::BlockEdgesAdder<BT>;
 
@@ -1081,7 +1081,7 @@ template <class BT> class BlockFrequencyInfoImpl : BlockFrequencyInfoImplBase {
 namespace bfi_detail {
 
 template <class BFIImplT>
-class BFICallbackVH<BasicBlock, BFIImplT> : public CallbackVH {
+class LLVM_CLASS_ABI BFICallbackVH<BasicBlock, BFIImplT> : public CallbackVH {
   BFIImplT *BFIImpl;
 
 public:
@@ -1100,7 +1100,7 @@ class BFICallbackVH<BasicBlock, BFIImplT> : public CallbackVH {
 /// Dummy implementation since MachineBasicBlocks aren't Values, so ValueHandles
 /// don't apply to them.
 template <class BFIImplT>
-class BFICallbackVH<MachineBasicBlock, BFIImplT> {
+class LLVM_CLASS_ABI BFICallbackVH<MachineBasicBlock, BFIImplT> {
 public:
   BFICallbackVH() = default;
   BFICallbackVH(const MachineBasicBlock *, BFIImplT *) {}
@@ -1644,7 +1644,7 @@ BlockFrequencyInfoImplBase::Scaled64 BlockFrequencyInfoImpl<BT>::discrepancy(
 /// \note This should be a lambda, but that crashes GCC 4.7.
 namespace bfi_detail {
 
-template <class BT> struct BlockEdgesAdder {
+template <class BT> struct LLVM_CLASS_ABI BlockEdgesAdder {
   using BlockT = BT;
   using LoopData = BlockFrequencyInfoImplBase::LoopData;
   using Successor = GraphTraits<const BlockT *>;
@@ -1807,7 +1807,7 @@ void BlockFrequencyInfoImpl<BT>::verifyMatch(
 enum GVDAGType { GVDT_None, GVDT_Fraction, GVDT_Integer, GVDT_Count };
 
 template <class BlockFrequencyInfoT, class BranchProbabilityInfoT>
-struct BFIDOTGraphTraitsBase : public DefaultDOTGraphTraits {
+struct LLVM_CLASS_ABI BFIDOTGraphTraitsBase : public DefaultDOTGraphTraits {
   using GTraits = GraphTraits<BlockFrequencyInfoT *>;
   using NodeRef = typename GTraits::NodeRef;
   using EdgeIter = typename GTraits::ChildIteratorType;
diff --git a/llvm/include/llvm/Analysis/BranchProbabilityInfo.h b/llvm/include/llvm/Analysis/BranchProbabilityInfo.h
index a47fa7411558448..ee6e1d72fc793ea 100644
--- a/llvm/include/llvm/Analysis/BranchProbabilityInfo.h
+++ b/llvm/include/llvm/Analysis/BranchProbabilityInfo.h
@@ -111,7 +111,7 @@ class Value;
 /// estimated as PH_TAKEN_WEIGHT/(PH_TAKEN_WEIGHT + PH_NONTAKEN_WEIGHT). If
 /// no local heuristic has been matched then branch is left with no explicit
 /// probability set and assumed to have default probability.
-class BranchProbabilityInfo {
+class LLVM_CLASS_ABI BranchProbabilityInfo {
 public:
   BranchProbabilityInfo() = default;
 
@@ -414,7 +414,7 @@ class BranchProbabilityInfo {
 };
 
 /// Analysis pass which computes \c BranchProbabilityInfo.
-class BranchProbabilityAnalysis
+class LLVM_CLASS_ABI BranchProbabilityAnalysis
     : public AnalysisInfoMixin<BranchProbabilityAnalysis> {
   friend AnalysisInfoMixin<BranchProbabilityAnalysis>;
 
@@ -429,7 +429,7 @@ class BranchProbabilityAnalysis
 };
 
 /// Printer pass for the \c BranchProbabilityAnalysis results.
-class BranchProbabilityPrinterPass
+class LLVM_CLASS_ABI BranchProbabilityPrinterPass
     : public PassInfoMixin<BranchProbabilityPrinterPass> {
   raw_ostream &OS;
 
@@ -440,7 +440,7 @@ class BranchProbabilityPrinterPass
 };
 
 /// Legacy analysis pass which computes \c BranchProbabilityInfo.
-class BranchProbabilityInfoWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI BranchProbabilityInfoWrapperPass : public FunctionPass {
   BranchProbabilityInfo BPI;
 
 public:
diff --git a/llvm/include/llvm/Analysis/CFG.h b/llvm/include/llvm/Analysis/CFG.h
index 3974abaadb8cb1e..f2ac2dcf79b47f0 100644
--- a/llvm/include/llvm/Analysis/CFG.h
+++ b/llvm/include/llvm/Analysis/CFG.h
@@ -33,7 +33,7 @@ template <typename T> class SmallVectorImpl;
 /// computing dominators and loop info) analysis.
 ///
 /// The output is added to Result, as pairs of <from,to> edge info.
-void FindFunctionBackedges(
+LLVM_FUNC_ABI void FindFunctionBackedges(
     const Function &F,
     SmallVectorImpl<std::pair<const BasicBlock *, const BasicBlock *> > &
         Result);
@@ -41,15 +41,15 @@ void FindFunctionBackedges(
 /// Search for the specified successor of basic block BB and return its position
 /// in the terminator instruction's list of successors.  It is an error to call
 /// this with a block that is not a successor.
-unsigned GetSuccessorNumber(const BasicBlock *BB, const BasicBlock *Succ);
+LLVM_FUNC_ABI unsigned GetSuccessorNumber(const BasicBlock *BB, const BasicBlock *Succ);
 
 /// Return true if the specified edge is a critical edge. Critical edges are
 /// edges from a block with multiple successors to a block with multiple
 /// predecessors.
 ///
-bool isCriticalEdge(const Instruction *TI, unsigned SuccNum,
+LLVM_FUNC_ABI bool isCriticalEdge(const Instruction *TI, unsigned SuccNum,
                     bool AllowIdenticalEdges = false);
-bool isCriticalEdge(const Instruction *TI, const BasicBlock *Succ,
+LLVM_FUNC_ABI bool isCriticalEdge(const Instruction *TI, const BasicBlock *Succ,
                     bool AllowIdenticalEdges = false);
 
 /// Determine whether instruction 'To' is reachable from 'From', without passing
@@ -67,7 +67,7 @@ bool isCriticalEdge(const Instruction *TI, const BasicBlock *Succ,
 /// we find a block that dominates the block containing 'To'. DT is most useful
 /// on branchy code but not loops, and LI is most useful on code with loops but
 /// does not help on branchy code outside loops.
-bool isPotentiallyReachable(
+LLVM_FUNC_ABI bool isPotentiallyReachable(
     const Instruction *From, const Instruction *To,
     const SmallPtrSetImpl<BasicBlock *> *ExclusionSet = nullptr,
     const DominatorTree *DT = nullptr, const LoopInfo *LI = nullptr);
@@ -78,7 +78,7 @@ bool isPotentiallyReachable(
 /// Determine whether there is a path from From to To within a single function.
 /// Returns false only if we can prove that once 'From' has been reached then
 /// 'To' can not be executed. Conservatively returns true.
-bool isPotentiallyReachable(
+LLVM_FUNC_ABI bool isPotentiallyReachable(
     const BasicBlock *From, const BasicBlock *To,
     const SmallPtrSetImpl<BasicBlock *> *ExclusionSet = nullptr,
     const DominatorTree *DT = nullptr, const LoopInfo *LI = nullptr);
@@ -92,7 +92,7 @@ bool isPotentiallyReachable(
 /// in 'ExclusionSet'. Returns false only if we can prove that once any block
 /// in 'Worklist' has been reached then 'StopBB' can not be executed.
 /// Conservatively returns true.
-bool isPotentiallyReachableFromMany(
+LLVM_FUNC_ABI bool isPotentiallyReachableFromMany(
     SmallVectorImpl<BasicBlock *> &Worklist, const BasicBlock *StopBB,
     const SmallPtrSetImpl<BasicBlock *> *ExclusionSet,
     const DominatorTree *DT = nullptr, const LoopInfo *LI = nullptr);
diff --git a/llvm/include/llvm/Analysis/CFGPrinter.h b/llvm/include/llvm/Analysis/CFGPrinter.h
index 7eded147e4201b7..f9e4f08263118bd 100644
--- a/llvm/include/llvm/Analysis/CFGPrinter.h
+++ b/llvm/include/llvm/Analysis/CFGPrinter.h
@@ -33,31 +33,31 @@
 
 namespace llvm {
 template <class GraphType> struct GraphTraits;
-class CFGViewerPass : public PassInfoMixin<CFGViewerPass> {
+class LLVM_CLASS_ABI CFGViewerPass : public PassInfoMixin<CFGViewerPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
 
-class CFGOnlyViewerPass : public PassInfoMixin<CFGOnlyViewerPass> {
+class LLVM_CLASS_ABI CFGOnlyViewerPass : public PassInfoMixin<CFGOnlyViewerPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
 
-class CFGPrinterPass : public PassInfoMixin<CFGPrinterPass> {
+class LLVM_CLASS_ABI CFGPrinterPass : public PassInfoMixin<CFGPrinterPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
 
-class CFGOnlyPrinterPass : public PassInfoMixin<CFGOnlyPrinterPass> {
+class LLVM_CLASS_ABI CFGOnlyPrinterPass : public PassInfoMixin<CFGOnlyPrinterPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
 
-class DOTFuncInfo {
+class LLVM_CLASS_ABI DOTFuncInfo {
 private:
   const Function *F;
   const BlockFrequencyInfo *BFI;
@@ -104,7 +104,7 @@ class DOTFuncInfo {
 };
 
 template <>
-struct GraphTraits<DOTFuncInfo *> : public GraphTraits<const BasicBlock *> {
+struct LLVM_CLASS_ABI GraphTraits<DOTFuncInfo *> : public GraphTraits<const BasicBlock *> {
   static NodeRef getEntryNode(DOTFuncInfo *CFGInfo) {
     return &(CFGInfo->getFunction()->getEntryBlock());
   }
@@ -187,7 +187,7 @@ std::string CompleteNodeLabelString(
 }
 
 template <>
-struct DOTGraphTraits<DOTFuncInfo *> : public DefaultDOTGraphTraits {
+struct LLVM_CLASS_ABI DOTGraphTraits<DOTFuncInfo *> : public DefaultDOTGraphTraits {
 
   // Cache for is hidden property
   DenseMap<const BasicBlock *, bool> isOnDeoptOrUnreachablePath;
@@ -319,8 +319,8 @@ struct DOTGraphTraits<DOTFuncInfo *> : public DefaultDOTGraphTraits {
 
 namespace llvm {
 class FunctionPass;
-FunctionPass *createCFGPrinterLegacyPassPass();
-FunctionPass *createCFGOnlyPrinterLegacyPassPass();
+LLVM_FUNC_ABI FunctionPass *createCFGPrinterLegacyPassPass();
+LLVM_FUNC_ABI FunctionPass *createCFGOnlyPrinterLegacyPassPass();
 } // End llvm namespace
 
 #endif
diff --git a/llvm/include/llvm/Analysis/CFGSCCPrinter.h b/llvm/include/llvm/Analysis/CFGSCCPrinter.h
index 58fe717b58b9711..c412f98dd43709e 100644
--- a/llvm/include/llvm/Analysis/CFGSCCPrinter.h
+++ b/llvm/include/llvm/Analysis/CFGSCCPrinter.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class CFGSCCPrinterPass : public PassInfoMixin<CFGSCCPrinterPass> {
+class LLVM_CLASS_ABI CFGSCCPrinterPass : public PassInfoMixin<CFGSCCPrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h
index 026d48d0130e650..e68631935e53ba7 100644
--- a/llvm/include/llvm/Analysis/CGSCCPassManager.h
+++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h
@@ -146,7 +146,7 @@ using CGSCCPassManager =
 
 /// An explicit specialization of the require analysis template pass.
 template <typename AnalysisT>
-struct RequireAnalysisPass<AnalysisT, LazyCallGraph::SCC, CGSCCAnalysisManager,
+struct LLVM_CLASS_ABI RequireAnalysisPass<AnalysisT, LazyCallGraph::SCC, CGSCCAnalysisManager,
                            LazyCallGraph &, CGSCCUpdateResult &>
     : PassInfoMixin<RequireAnalysisPass<AnalysisT, LazyCallGraph::SCC,
                                         CGSCCAnalysisManager, LazyCallGraph &,
@@ -230,7 +230,7 @@ using ModuleAnalysisManagerCGSCCProxy =
 ///
 /// Passes which do not change the call graph structure in any way can just
 /// ignore this argument to their run method.
-struct CGSCCUpdateResult {
+struct LLVM_CLASS_ABI CGSCCUpdateResult {
   /// Worklist of the RefSCCs queued for processing.
   ///
   /// When a pass refines the graph and creates new RefSCCs or causes them to
@@ -327,7 +327,7 @@ struct CGSCCUpdateResult {
 /// \c CGSCCAnalysisManagerModuleProxy analysis prior to running the CGSCC
 /// pass over the module to enable a \c FunctionAnalysisManager to be used
 /// within this run safely.
-class ModuleToPostOrderCGSCCPassAdaptor
+class LLVM_CLASS_ABI ModuleToPostOrderCGSCCPassAdaptor
     : public PassInfoMixin<ModuleToPostOrderCGSCCPassAdaptor> {
 public:
   using PassConceptT =
@@ -390,7 +390,7 @@ createModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT &&Pass) {
 /// invalidation logic. Instead, this layer is only responsible for SCC-local
 /// invalidation events. We work with the module's FunctionAnalysisManager to
 /// invalidate function analyses.
-class FunctionAnalysisManagerCGSCCProxy
+class LLVM_CLASS_ABI FunctionAnalysisManagerCGSCCProxy
     : public AnalysisInfoMixin<FunctionAnalysisManagerCGSCCProxy> {
 public:
   class Result {
@@ -433,7 +433,7 @@ using CGSCCAnalysisManagerFunctionProxy =
 /// routine provides a helper that updates the call graph in those ways
 /// including returning whether any changes were made and populating a CG
 /// update result struct for the overall CGSCC walk.
-LazyCallGraph::SCC &updateCGAndAnalysisManagerForFunctionPass(
+LLVM_FUNC_ABI LazyCallGraph::SCC &updateCGAndAnalysisManagerForFunctionPass(
     LazyCallGraph &G, LazyCallGraph::SCC &C, LazyCallGraph::Node &N,
     CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR,
     FunctionAnalysisManager &FAM);
@@ -444,7 +444,7 @@ LazyCallGraph::SCC &updateCGAndAnalysisManagerForFunctionPass(
 /// routine provides a helper that updates the call graph in those ways
 /// including returning whether any changes were made and populating a CG
 /// update result struct for the overall CGSCC walk.
-LazyCallGraph::SCC &updateCGAndAnalysisManagerForCGSCCPass(
+LLVM_FUNC_ABI LazyCallGraph::SCC &updateCGAndAnalysisManagerForCGSCCPass(
     LazyCallGraph &G, LazyCallGraph::SCC &C, LazyCallGraph::Node &N,
     CGSCCAnalysisManager &AM, CGSCCUpdateResult &UR,
     FunctionAnalysisManager &FAM);
@@ -457,7 +457,7 @@ LazyCallGraph::SCC &updateCGAndAnalysisManagerForCGSCCPass(
 /// \c FunctionAnalysisManagerCGSCCProxy analysis prior to running the function
 /// pass over the SCC to enable a \c FunctionAnalysisManager to be used
 /// within this run safely.
-class CGSCCToFunctionPassAdaptor
+class LLVM_CLASS_ABI CGSCCToFunctionPassAdaptor
     : public PassInfoMixin<CGSCCToFunctionPassAdaptor> {
 public:
   using PassConceptT = detail::PassConcept<Function, FunctionAnalysisManager>;
@@ -534,7 +534,7 @@ createCGSCCToFunctionPassAdaptor(FunctionPassT &&Pass,
 // function pass (manager) on a function multiple times if SCC mutations cause a
 // function to be visited multiple times and the function is not modified by
 // other SCC passes.
-class ShouldNotRunFunctionPassesAnalysis
+class LLVM_CLASS_ABI ShouldNotRunFunctionPassesAnalysis
     : public AnalysisInfoMixin<ShouldNotRunFunctionPassesAnalysis> {
 public:
   static AnalysisKey Key;
@@ -557,7 +557,7 @@ class ShouldNotRunFunctionPassesAnalysis
 /// This repetition has the potential to be very large however, as each one
 /// might refine a single call site. As a consequence, in practice we use an
 /// upper bound on the number of repetitions to limit things.
-class DevirtSCCRepeatedPass : public PassInfoMixin<DevirtSCCRepeatedPass> {
+class LLVM_CLASS_ABI DevirtSCCRepeatedPass : public PassInfoMixin<DevirtSCCRepeatedPass> {
 public:
   using PassConceptT =
       detail::PassConcept<LazyCallGraph::SCC, CGSCCAnalysisManager,
diff --git a/llvm/include/llvm/Analysis/CallGraph.h b/llvm/include/llvm/Analysis/CallGraph.h
index 542df9c7fda98a6..07085a0294b3d8f 100644
--- a/llvm/include/llvm/Analysis/CallGraph.h
+++ b/llvm/include/llvm/Analysis/CallGraph.h
@@ -70,7 +70,7 @@ class raw_ostream;
 /// This class exposes both the interface to the call graph for a module of IR.
 ///
 /// The core call graph itself can also be updated to reflect changes to the IR.
-class CallGraph {
+class LLVM_CLASS_ABI CallGraph {
   Module &M;
 
   using FunctionMapTy =
@@ -164,7 +164,7 @@ class CallGraph {
 ///
 /// Typically represents a function in the call graph. There are also special
 /// "null" nodes used to represent theoretical entries in the call graph.
-class CallGraphNode {
+class LLVM_CLASS_ABI CallGraphNode {
 public:
   /// A pair of the calling instruction (a call or invoke)
   /// and the call graph node being called.
@@ -300,7 +300,7 @@ class CallGraphNode {
 /// This class implements the concept of an analysis pass used by the \c
 /// ModuleAnalysisManager to run an analysis over a module and cache the
 /// resulting data.
-class CallGraphAnalysis : public AnalysisInfoMixin<CallGraphAnalysis> {
+class LLVM_CLASS_ABI CallGraphAnalysis : public AnalysisInfoMixin<CallGraphAnalysis> {
   friend AnalysisInfoMixin<CallGraphAnalysis>;
 
   static AnalysisKey Key;
@@ -316,7 +316,7 @@ class CallGraphAnalysis : public AnalysisInfoMixin<CallGraphAnalysis> {
 };
 
 /// Printer pass for the \c CallGraphAnalysis results.
-class CallGraphPrinterPass : public PassInfoMixin<CallGraphPrinterPass> {
+class LLVM_CLASS_ABI CallGraphPrinterPass : public PassInfoMixin<CallGraphPrinterPass> {
   raw_ostream &OS;
 
 public:
@@ -326,7 +326,7 @@ class CallGraphPrinterPass : public PassInfoMixin<CallGraphPrinterPass> {
 };
 
 /// Printer pass for the summarized \c CallGraphAnalysis results.
-class CallGraphSCCsPrinterPass
+class LLVM_CLASS_ABI CallGraphSCCsPrinterPass
     : public PassInfoMixin<CallGraphSCCsPrinterPass> {
   raw_ostream &OS;
 
@@ -343,7 +343,7 @@ class CallGraphSCCsPrinterPass
 /// module pass which runs over a module of IR and produces the call graph. The
 /// call graph interface is entirelly a wrapper around a \c CallGraph object
 /// which is stored internally for each module.
-class CallGraphWrapperPass : public ModulePass {
+class LLVM_CLASS_ABI CallGraphWrapperPass : public ModulePass {
   std::unique_ptr<CallGraph> G;
 
 public:
@@ -426,7 +426,7 @@ class CallGraphWrapperPass : public ModulePass {
 
 // Provide graph traits for traversing call graphs using standard graph
 // traversals.
-template <> struct GraphTraits<CallGraphNode *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<CallGraphNode *> {
   using NodeRef = CallGraphNode *;
   using CGNPairTy = CallGraphNode::CallRecord;
 
@@ -445,7 +445,7 @@ template <> struct GraphTraits<CallGraphNode *> {
   }
 };
 
-template <> struct GraphTraits<const CallGraphNode *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<const CallGraphNode *> {
   using NodeRef = const CallGraphNode *;
   using CGNPairTy = CallGraphNode::CallRecord;
   using EdgeRef = const CallGraphNode::CallRecord &;
@@ -474,7 +474,7 @@ template <> struct GraphTraits<const CallGraphNode *> {
 };
 
 template <>
-struct GraphTraits<CallGraph *> : public GraphTraits<CallGraphNode *> {
+struct LLVM_CLASS_ABI GraphTraits<CallGraph *> : public GraphTraits<CallGraphNode *> {
   using PairTy =
       std::pair<const Function *const, std::unique_ptr<CallGraphNode>>;
 
@@ -500,7 +500,7 @@ struct GraphTraits<CallGraph *> : public GraphTraits<CallGraphNode *> {
 };
 
 template <>
-struct GraphTraits<const CallGraph *> : public GraphTraits<
+struct LLVM_CLASS_ABI GraphTraits<const CallGraph *> : public GraphTraits<
                                             const CallGraphNode *> {
   using PairTy =
       std::pair<const Function *const, std::unique_ptr<CallGraphNode>>;
diff --git a/llvm/include/llvm/Analysis/CallGraphSCCPass.h b/llvm/include/llvm/Analysis/CallGraphSCCPass.h
index 962ff4526afd1ae..97526368667ec36 100644
--- a/llvm/include/llvm/Analysis/CallGraphSCCPass.h
+++ b/llvm/include/llvm/Analysis/CallGraphSCCPass.h
@@ -32,7 +32,7 @@ class CallGraphNode;
 class CallGraphSCC;
 class PMStack;
 
-class CallGraphSCCPass : public Pass {
+class LLVM_CLASS_ABI CallGraphSCCPass : public Pass {
 public:
   explicit CallGraphSCCPass(char &pid) : Pass(PT_CallGraphSCC, pid) {}
 
@@ -85,7 +85,7 @@ class CallGraphSCCPass : public Pass {
 };
 
 /// CallGraphSCC - This is a single SCC that a CallGraphSCCPass is run on.
-class CallGraphSCC {
+class LLVM_CLASS_ABI CallGraphSCC {
   const CallGraph &CG; // The call graph for this SCC.
   void *Context; // The CGPassManager object that is vending this.
   std::vector<CallGraphNode *> Nodes;
@@ -116,11 +116,11 @@ class CallGraphSCC {
   const CallGraph &getCallGraph() { return CG; }
 };
 
-void initializeDummyCGSCCPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeDummyCGSCCPassPass(PassRegistry &);
 
 /// This pass is required by interprocedural register allocation. It forces
 /// codegen to follow bottom up order on call graph.
-class DummyCGSCCPass : public CallGraphSCCPass {
+class LLVM_CLASS_ABI DummyCGSCCPass : public CallGraphSCCPass {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/Analysis/CallPrinter.h b/llvm/include/llvm/Analysis/CallPrinter.h
index d8211fd6d182b43..7fa397ff5b88392 100644
--- a/llvm/include/llvm/Analysis/CallPrinter.h
+++ b/llvm/include/llvm/Analysis/CallPrinter.h
@@ -22,19 +22,19 @@ namespace llvm {
 class ModulePass;
 
 /// Pass for printing the call graph to a dot file
-class CallGraphDOTPrinterPass : public PassInfoMixin<CallGraphDOTPrinterPass> {
+class LLVM_CLASS_ABI CallGraphDOTPrinterPass : public PassInfoMixin<CallGraphDOTPrinterPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
 /// Pass for viewing the call graph
-class CallGraphViewerPass : public PassInfoMixin<CallGraphViewerPass> {
+class LLVM_CLASS_ABI CallGraphViewerPass : public PassInfoMixin<CallGraphViewerPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
-ModulePass *createCallGraphViewerPass();
-ModulePass *createCallGraphDOTPrinterPass();
+LLVM_FUNC_ABI ModulePass *createCallGraphViewerPass();
+LLVM_FUNC_ABI ModulePass *createCallGraphDOTPrinterPass();
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/CaptureTracking.h b/llvm/include/llvm/Analysis/CaptureTracking.h
index 4dd952219020986..f9ee8c744640dcf 100644
--- a/llvm/include/llvm/Analysis/CaptureTracking.h
+++ b/llvm/include/llvm/Analysis/CaptureTracking.h
@@ -31,7 +31,7 @@ namespace llvm {
   /// getDefaultMaxUsesToExploreForCaptureTracking - Return default value of
   /// the maximal number of uses to explore before giving up. It is used by
   /// PointerMayBeCaptured family analysis.
-  unsigned getDefaultMaxUsesToExploreForCaptureTracking();
+  LLVM_FUNC_ABI unsigned getDefaultMaxUsesToExploreForCaptureTracking();
 
   /// PointerMayBeCaptured - Return true if this pointer value may be captured
   /// by the enclosing function (which is required to exist).  This routine can
@@ -43,12 +43,12 @@ namespace llvm {
   /// MaxUsesToExplore specifies how many uses the analysis should explore for
   /// one value before giving up due too "too many uses". If MaxUsesToExplore
   /// is zero, a default value is assumed.
-  bool PointerMayBeCaptured(const Value *V, bool ReturnCaptures,
+  LLVM_FUNC_ABI bool PointerMayBeCaptured(const Value *V, bool ReturnCaptures,
                             bool StoreCaptures, unsigned MaxUsesToExplore = 0);
 
   /// Variant of the above function which accepts a set of Values that are
   /// ephemeral and cannot cause pointers to escape.
-  bool PointerMayBeCaptured(const Value *V, bool ReturnCaptures,
+  LLVM_FUNC_ABI bool PointerMayBeCaptured(const Value *V, bool ReturnCaptures,
                             bool StoreCaptures,
                             const SmallPtrSetImpl<const Value *> &EphValues,
                             unsigned MaxUsesToExplore = 0);
@@ -66,7 +66,7 @@ namespace llvm {
   /// MaxUsesToExplore specifies how many uses the analysis should explore for
   /// one value before giving up due too "too many uses". If MaxUsesToExplore
   /// is zero, a default value is assumed.
-  bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures,
+  LLVM_FUNC_ABI bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures,
                                   bool StoreCaptures, const Instruction *I,
                                   const DominatorTree *DT,
                                   bool IncludeI = false,
@@ -81,7 +81,7 @@ namespace llvm {
   // nullptr is returned. Note that the caller of the function has to ensure
   // that the instruction the result value is compared against is not in a
   // cycle.
-  Instruction *
+  LLVM_FUNC_ABI Instruction *
   FindEarliestCapture(const Value *V, Function &F, bool ReturnCaptures,
                       bool StoreCaptures, const DominatorTree &DT,
                       const SmallPtrSetImpl<const Value *> &EphValues,
@@ -90,7 +90,7 @@ namespace llvm {
   /// This callback is used in conjunction with PointerMayBeCaptured. In
   /// addition to the interface here, you'll need to provide your own getters
   /// to see whether anything was captured.
-  struct CaptureTracker {
+  struct LLVM_CLASS_ABI CaptureTracker {
     virtual ~CaptureTracker();
 
     /// tooManyUses - The depth of traversal has breached a limit. There may be
@@ -128,7 +128,7 @@ namespace llvm {
   /// passthrough such that the uses of the user or \p U should be inspected.
   /// The \p IsDereferenceableOrNull callback is used to rule out capturing for
   /// certain comparisons.
-  UseCaptureKind
+  LLVM_FUNC_ABI UseCaptureKind
   DetermineUseCaptureKind(const Use &U,
                           llvm::function_ref<bool(Value *, const DataLayout &)>
                               IsDereferenceableOrNull);
@@ -139,12 +139,12 @@ namespace llvm {
   /// MaxUsesToExplore specifies how many uses the analysis should explore for
   /// one value before giving up due too "too many uses". If MaxUsesToExplore
   /// is zero, a default value is assumed.
-  void PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker,
+  LLVM_FUNC_ABI void PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker,
                             unsigned MaxUsesToExplore = 0);
 
   /// Returns true if the pointer is to a function-local object that never
   /// escapes from the function.
-  bool isNonEscapingLocalObject(
+  LLVM_FUNC_ABI bool isNonEscapingLocalObject(
       const Value *V,
       SmallDenseMap<const Value *, bool, 8> *IsCapturedCache = nullptr);
 } // end namespace llvm
diff --git a/llvm/include/llvm/Analysis/CmpInstAnalysis.h b/llvm/include/llvm/Analysis/CmpInstAnalysis.h
index 7ed53cd1ef61284..721cb12cca0fa62 100644
--- a/llvm/include/llvm/Analysis/CmpInstAnalysis.h
+++ b/llvm/include/llvm/Analysis/CmpInstAnalysis.h
@@ -44,7 +44,7 @@ namespace llvm {
   /// 110     6   A <= B
   /// 111     7   Always true
   ///
-  unsigned getICmpCode(CmpInst::Predicate Pred);
+  LLVM_FUNC_ABI unsigned getICmpCode(CmpInst::Predicate Pred);
 
   /// This is the complement of getICmpCode. It turns a predicate code into
   /// either a constant true or false or the predicate for a new ICmp.
@@ -52,12 +52,12 @@ namespace llvm {
   /// new ICmp instruction.
   /// Non-NULL return value will be a true or false constant.
   /// NULL return means a new ICmp is needed. The predicate is output in Pred.
-  Constant *getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy,
+  LLVM_FUNC_ABI Constant *getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy,
                                CmpInst::Predicate &Pred);
 
   /// Return true if both predicates match sign or if at least one of them is an
   /// equality comparison (which is signless).
-  bool predicatesFoldable(CmpInst::Predicate P1, CmpInst::Predicate P2);
+  LLVM_FUNC_ABI bool predicatesFoldable(CmpInst::Predicate P1, CmpInst::Predicate P2);
 
   /// Similar to getICmpCode but for FCmpInst. This encodes a fcmp predicate
   /// into a four bit mask.
@@ -89,13 +89,13 @@ namespace llvm {
   /// either a constant true or false or the predicate for a new FCmp.
   /// Non-NULL return value will be a true or false constant.
   /// NULL return means a new ICmp is needed. The predicate is output in Pred.
-  Constant *getPredForFCmpCode(unsigned Code, Type *OpTy,
+  LLVM_FUNC_ABI Constant *getPredForFCmpCode(unsigned Code, Type *OpTy,
                                CmpInst::Predicate &Pred);
 
   /// Decompose an icmp into the form ((X & Mask) pred 0) if possible. The
   /// returned predicate is either == or !=. Returns false if decomposition
   /// fails.
-  bool decomposeBitTestICmp(Value *LHS, Value *RHS, CmpInst::Predicate &Pred,
+  LLVM_FUNC_ABI bool decomposeBitTestICmp(Value *LHS, Value *RHS, CmpInst::Predicate &Pred,
                             Value *&X, APInt &Mask,
                             bool LookThroughTrunc = true);
 
diff --git a/llvm/include/llvm/Analysis/CodeMetrics.h b/llvm/include/llvm/Analysis/CodeMetrics.h
index c078fee4c523b5f..a146bb298f14d82 100644
--- a/llvm/include/llvm/Analysis/CodeMetrics.h
+++ b/llvm/include/llvm/Analysis/CodeMetrics.h
@@ -29,7 +29,7 @@ class Value;
 
 /// Utility to calculate the size and a few similar metrics for a set
 /// of basic blocks.
-struct CodeMetrics {
+struct LLVM_CLASS_ABI CodeMetrics {
   /// True if this function contains a call to setjmp or other functions
   /// with attribute "returns twice" without having the attribute itself.
   bool exposesReturnsTwice = false;
diff --git a/llvm/include/llvm/Analysis/ConstantFolding.h b/llvm/include/llvm/Analysis/ConstantFolding.h
index 3a105ce925faa88..2bb78a8e2695947 100644
--- a/llvm/include/llvm/Analysis/ConstantFolding.h
+++ b/llvm/include/llvm/Analysis/ConstantFolding.h
@@ -40,7 +40,7 @@ class Type;
 /// the constant. Because of constantexprs, this function is recursive.
 /// If the global is part of a dso_local_equivalent constant, return it through
 /// `Equiv` if it is provided.
-bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, APInt &Offset,
+LLVM_FUNC_ABI bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, APInt &Offset,
                                 const DataLayout &DL,
                                 DSOLocalEquivalent **DSOEquiv = nullptr);
 
@@ -49,13 +49,13 @@ bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV, APInt &Offset,
 /// Note that this fails if not all of the operands are constant.  Otherwise,
 /// this function can only fail when attempting to fold instructions like loads
 /// and stores, which have no constant expression form.
-Constant *ConstantFoldInstruction(Instruction *I, const DataLayout &DL,
+LLVM_FUNC_ABI Constant *ConstantFoldInstruction(Instruction *I, const DataLayout &DL,
                                   const TargetLibraryInfo *TLI = nullptr);
 
 /// ConstantFoldConstant - Fold the constant using the specified DataLayout.
 /// This function always returns a non-null constant: Either the folding result,
 /// or the original constant if further folding is not possible.
-Constant *ConstantFoldConstant(const Constant *C, const DataLayout &DL,
+LLVM_FUNC_ABI Constant *ConstantFoldConstant(const Constant *C, const DataLayout &DL,
                                const TargetLibraryInfo *TLI = nullptr);
 
 /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
@@ -64,7 +64,7 @@ Constant *ConstantFoldConstant(const Constant *C, const DataLayout &DL,
 /// fold instructions like loads and stores, which have no constant expression
 /// form.
 ///
-Constant *ConstantFoldInstOperands(Instruction *I, ArrayRef<Constant *> Ops,
+LLVM_FUNC_ABI Constant *ConstantFoldInstOperands(Instruction *I, ArrayRef<Constant *> Ops,
                                    const DataLayout &DL,
                                    const TargetLibraryInfo *TLI = nullptr);
 
@@ -72,26 +72,26 @@ Constant *ConstantFoldInstOperands(Instruction *I, ArrayRef<Constant *> Ops,
 /// specified operands.  If it fails, it returns a constant expression of the
 /// specified operands.
 /// Denormal inputs may be flushed based on the denormal handling mode.
-Constant *ConstantFoldCompareInstOperands(
+LLVM_FUNC_ABI Constant *ConstantFoldCompareInstOperands(
     unsigned Predicate, Constant *LHS, Constant *RHS, const DataLayout &DL,
     const TargetLibraryInfo *TLI = nullptr, const Instruction *I = nullptr);
 
 /// Attempt to constant fold a unary operation with the specified
 /// operand. If it fails, it returns a constant expression of the specified
 /// operands.
-Constant *ConstantFoldUnaryOpOperand(unsigned Opcode, Constant *Op,
+LLVM_FUNC_ABI Constant *ConstantFoldUnaryOpOperand(unsigned Opcode, Constant *Op,
                                      const DataLayout &DL);
 
 /// Attempt to constant fold a binary operation with the specified
 /// operands.  If it fails, it returns a constant expression of the specified
 /// operands.
-Constant *ConstantFoldBinaryOpOperands(unsigned Opcode, Constant *LHS,
+LLVM_FUNC_ABI Constant *ConstantFoldBinaryOpOperands(unsigned Opcode, Constant *LHS,
                                        Constant *RHS, const DataLayout &DL);
 
 /// Attempt to constant fold a floating point binary operation with the
 /// specified operands, applying the denormal handling mod to the operands.  If
 /// it fails, it returns a constant expression of the specified operands.
-Constant *ConstantFoldFPInstOperands(unsigned Opcode, Constant *LHS,
+LLVM_FUNC_ABI Constant *ConstantFoldFPInstOperands(unsigned Opcode, Constant *LHS,
                                      Constant *RHS, const DataLayout &DL,
                                      const Instruction *I);
 
@@ -103,98 +103,98 @@ Constant *ConstantFoldFPInstOperands(unsigned Opcode, Constant *LHS,
 ///
 /// If the calling function's "denormal-fp-math" input mode is "dynamic" for the
 /// floating-point type, returns nullptr for denormal inputs.
-Constant *FlushFPConstant(Constant *Operand, const Instruction *I,
+LLVM_FUNC_ABI Constant *FlushFPConstant(Constant *Operand, const Instruction *I,
                           bool IsOutput);
 
 /// Attempt to constant fold a select instruction with the specified
 /// operands. The constant result is returned if successful; if not, null is
 /// returned.
-Constant *ConstantFoldSelectInstruction(Constant *Cond, Constant *V1,
+LLVM_FUNC_ABI Constant *ConstantFoldSelectInstruction(Constant *Cond, Constant *V1,
                                         Constant *V2);
 
 /// Attempt to constant fold a cast with the specified operand.  If it
 /// fails, it returns a constant expression of the specified operand.
-Constant *ConstantFoldCastOperand(unsigned Opcode, Constant *C, Type *DestTy,
+LLVM_FUNC_ABI Constant *ConstantFoldCastOperand(unsigned Opcode, Constant *C, Type *DestTy,
                                   const DataLayout &DL);
 
 /// ConstantFoldInsertValueInstruction - Attempt to constant fold an insertvalue
 /// instruction with the specified operands and indices.  The constant result is
 /// returned if successful; if not, null is returned.
-Constant *ConstantFoldInsertValueInstruction(Constant *Agg, Constant *Val,
+LLVM_FUNC_ABI Constant *ConstantFoldInsertValueInstruction(Constant *Agg, Constant *Val,
                                              ArrayRef<unsigned> Idxs);
 
 /// Attempt to constant fold an extractvalue instruction with the
 /// specified operands and indices.  The constant result is returned if
 /// successful; if not, null is returned.
-Constant *ConstantFoldExtractValueInstruction(Constant *Agg,
+LLVM_FUNC_ABI Constant *ConstantFoldExtractValueInstruction(Constant *Agg,
                                               ArrayRef<unsigned> Idxs);
 
 /// Attempt to constant fold an insertelement instruction with the
 /// specified operands and indices.  The constant result is returned if
 /// successful; if not, null is returned.
-Constant *ConstantFoldInsertElementInstruction(Constant *Val,
+LLVM_FUNC_ABI Constant *ConstantFoldInsertElementInstruction(Constant *Val,
                                                Constant *Elt,
                                                Constant *Idx);
 
 /// Attempt to constant fold an extractelement instruction with the
 /// specified operands and indices.  The constant result is returned if
 /// successful; if not, null is returned.
-Constant *ConstantFoldExtractElementInstruction(Constant *Val, Constant *Idx);
+LLVM_FUNC_ABI Constant *ConstantFoldExtractElementInstruction(Constant *Val, Constant *Idx);
 
 /// Attempt to constant fold a shufflevector instruction with the
 /// specified operands and mask.  See class ShuffleVectorInst for a description
 /// of the mask representation. The constant result is returned if successful;
 /// if not, null is returned.
-Constant *ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
+LLVM_FUNC_ABI Constant *ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
                                                ArrayRef<int> Mask);
 
 /// Extract value of C at the given Offset reinterpreted as Ty. If bits past
 /// the end of C are accessed, they are assumed to be poison.
-Constant *ConstantFoldLoadFromConst(Constant *C, Type *Ty, const APInt &Offset,
+LLVM_FUNC_ABI Constant *ConstantFoldLoadFromConst(Constant *C, Type *Ty, const APInt &Offset,
                                     const DataLayout &DL);
 
 /// Extract value of C reinterpreted as Ty. Same as previous API with zero
 /// offset.
-Constant *ConstantFoldLoadFromConst(Constant *C, Type *Ty,
+LLVM_FUNC_ABI Constant *ConstantFoldLoadFromConst(Constant *C, Type *Ty,
                                     const DataLayout &DL);
 
 /// Return the value that a load from C with offset Offset would produce if it
 /// is constant and determinable. If this is not determinable, return null.
-Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty, APInt Offset,
+LLVM_FUNC_ABI Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty, APInt Offset,
                                        const DataLayout &DL);
 
 /// Return the value that a load from C would produce if it is constant and
 /// determinable. If this is not determinable, return null.
-Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
+LLVM_FUNC_ABI Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
                                        const DataLayout &DL);
 
 /// If C is a uniform value where all bits are the same (either all zero, all
 /// ones, all undef or all poison), return the corresponding uniform value in
 /// the new type. If the value is not uniform or the result cannot be
 /// represented, return null.
-Constant *ConstantFoldLoadFromUniformValue(Constant *C, Type *Ty);
+LLVM_FUNC_ABI Constant *ConstantFoldLoadFromUniformValue(Constant *C, Type *Ty);
 
 /// canConstantFoldCallTo - Return true if its even possible to fold a call to
 /// the specified function.
-bool canConstantFoldCallTo(const CallBase *Call, const Function *F);
+LLVM_FUNC_ABI bool canConstantFoldCallTo(const CallBase *Call, const Function *F);
 
 /// ConstantFoldCall - Attempt to constant fold a call to the specified function
 /// with the specified arguments, returning null if unsuccessful.
-Constant *ConstantFoldCall(const CallBase *Call, Function *F,
+LLVM_FUNC_ABI Constant *ConstantFoldCall(const CallBase *Call, Function *F,
                            ArrayRef<Constant *> Operands,
                            const TargetLibraryInfo *TLI = nullptr);
 
 /// ConstantFoldLoadThroughBitcast - try to cast constant to destination type
 /// returning null if unsuccessful. Can cast pointer to pointer or pointer to
 /// integer and vice versa if their sizes are equal.
-Constant *ConstantFoldLoadThroughBitcast(Constant *C, Type *DestTy,
+LLVM_FUNC_ABI Constant *ConstantFoldLoadThroughBitcast(Constant *C, Type *DestTy,
                                          const DataLayout &DL);
 
 /// Check whether the given call has no side-effects.
 /// Specifically checks for math routimes which sometimes set errno.
-bool isMathLibCallNoop(const CallBase *Call, const TargetLibraryInfo *TLI);
+LLVM_FUNC_ABI bool isMathLibCallNoop(const CallBase *Call, const TargetLibraryInfo *TLI);
 
-Constant *ReadByteArrayFromGlobal(const GlobalVariable *GV, uint64_t Offset);
+LLVM_FUNC_ABI Constant *ReadByteArrayFromGlobal(const GlobalVariable *GV, uint64_t Offset);
 }
 
 #endif
diff --git a/llvm/include/llvm/Analysis/ConstraintSystem.h b/llvm/include/llvm/Analysis/ConstraintSystem.h
index 8d7101b29f9f28d..9f757cca20501d6 100644
--- a/llvm/include/llvm/Analysis/ConstraintSystem.h
+++ b/llvm/include/llvm/Analysis/ConstraintSystem.h
@@ -21,7 +21,7 @@
 namespace llvm {
 
 class Value;
-class ConstraintSystem {
+class LLVM_CLASS_ABI ConstraintSystem {
   struct Entry {
     int64_t Coefficient;
     uint16_t Id;
diff --git a/llvm/include/llvm/Analysis/CostModel.h b/llvm/include/llvm/Analysis/CostModel.h
index 063a0337a6c2295..2d6cbaba8c6759e 100644
--- a/llvm/include/llvm/Analysis/CostModel.h
+++ b/llvm/include/llvm/Analysis/CostModel.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 /// Printer pass for cost modeling results.
-class CostModelPrinterPass : public PassInfoMixin<CostModelPrinterPass> {
+class LLVM_CLASS_ABI CostModelPrinterPass : public PassInfoMixin<CostModelPrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Analysis/CycleAnalysis.h b/llvm/include/llvm/Analysis/CycleAnalysis.h
index f84861ceec87877..46937dad43bac2a 100644
--- a/llvm/include/llvm/Analysis/CycleAnalysis.h
+++ b/llvm/include/llvm/Analysis/CycleAnalysis.h
@@ -29,7 +29,7 @@ using CycleInfo = GenericCycleInfo<SSAContext>;
 using Cycle = CycleInfo::CycleT;
 
 /// Legacy analysis pass which computes a \ref CycleInfo.
-class CycleInfoWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI CycleInfoWrapperPass : public FunctionPass {
   Function *F = nullptr;
   CycleInfo CI;
 
@@ -50,7 +50,7 @@ class CycleInfoWrapperPass : public FunctionPass {
 };
 
 /// Analysis pass which computes a \ref CycleInfo.
-class CycleAnalysis : public AnalysisInfoMixin<CycleAnalysis> {
+class LLVM_CLASS_ABI CycleAnalysis : public AnalysisInfoMixin<CycleAnalysis> {
   friend AnalysisInfoMixin<CycleAnalysis>;
   static AnalysisKey Key;
 
@@ -67,7 +67,7 @@ class CycleAnalysis : public AnalysisInfoMixin<CycleAnalysis> {
 };
 
 /// Printer pass for the \c DominatorTree.
-class CycleInfoPrinterPass : public PassInfoMixin<CycleInfoPrinterPass> {
+class LLVM_CLASS_ABI CycleInfoPrinterPass : public PassInfoMixin<CycleInfoPrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Analysis/DDG.h b/llvm/include/llvm/Analysis/DDG.h
index 45eae9363789556..18a6136dd7848b2 100644
--- a/llvm/include/llvm/Analysis/DDG.h
+++ b/llvm/include/llvm/Analysis/DDG.h
@@ -42,7 +42,7 @@ class LPMUpdater;
 ///    nodes. The root node cannot be part of a pi-block.
 /// 4. Root node is a special node that connects to all components such that
 ///    there is always a path from it to any node in the graph.
-class DDGNode : public DDGNodeBase {
+class LLVM_CLASS_ABI DDGNode : public DDGNodeBase {
 public:
   using InstructionListType = SmallVectorImpl<Instruction *>;
 
@@ -91,7 +91,7 @@ class DDGNode : public DDGNodeBase {
 
 /// Subclass of DDGNode representing the root node of the graph.
 /// There should only be one such node in a given graph.
-class RootDDGNode : public DDGNode {
+class LLVM_CLASS_ABI RootDDGNode : public DDGNode {
 public:
   RootDDGNode() : DDGNode(NodeKind::Root) {}
   RootDDGNode(const RootDDGNode &N) = delete;
@@ -106,7 +106,7 @@ class RootDDGNode : public DDGNode {
 };
 
 /// Subclass of DDGNode representing single or multi-instruction nodes.
-class SimpleDDGNode : public DDGNode {
+class LLVM_CLASS_ABI SimpleDDGNode : public DDGNode {
   friend class DDGBuilder;
 
 public:
@@ -168,7 +168,7 @@ class SimpleDDGNode : public DDGNode {
 /// {a -> b}, {b -> c, d}, {c -> a}
 /// the cycle a -> b -> c -> a is abstracted into a pi-block "p" as follows:
 /// {p -> d} with "p" containing: {a -> b}, {b -> c}, {c -> a}
-class PiBlockDDGNode : public DDGNode {
+class LLVM_CLASS_ABI PiBlockDDGNode : public DDGNode {
 public:
   using PiNodeList = SmallVector<DDGNode *, 4>;
 
@@ -211,7 +211,7 @@ class PiBlockDDGNode : public DDGNode {
 /// a memory dependence based on the result of DependenceAnalysis.
 /// A rooted edge connects the root node to one of the components
 /// of the graph.
-class DDGEdge : public DDGEdgeBase {
+class LLVM_CLASS_ABI DDGEdge : public DDGEdgeBase {
 public:
   /// The kind of edge in the DDG
   enum class EdgeKind {
@@ -253,7 +253,7 @@ class DDGEdge : public DDGEdgeBase {
 
 /// Encapsulate some common data and functionality needed for different
 /// variations of data dependence graphs.
-template <typename NodeType> class DependenceGraphInfo {
+template <typename NodeType> class LLVM_CLASS_ABI DependenceGraphInfo {
 public:
   using DependenceList = SmallVector<std::unique_ptr<Dependence>, 1>;
 
@@ -304,7 +304,7 @@ template <typename NodeType> class DependenceGraphInfo {
 using DDGInfo = DependenceGraphInfo<DDGNode>;
 
 /// Data Dependency Graph
-class DataDependenceGraph : public DDGBase, public DDGInfo {
+class LLVM_CLASS_ABI DataDependenceGraph : public DDGBase, public DDGInfo {
   friend AbstractDependenceGraphBuilder<DataDependenceGraph>;
   friend class DDGBuilder;
 
@@ -344,7 +344,7 @@ class DataDependenceGraph : public DDGBase, public DDGInfo {
 ///
 /// For information about time complexity of the build algorithm see the
 /// comments near the declaration of AbstractDependenceGraphBuilder.
-class DDGBuilder : public AbstractDependenceGraphBuilder<DataDependenceGraph> {
+class LLVM_CLASS_ABI DDGBuilder : public AbstractDependenceGraphBuilder<DataDependenceGraph> {
 public:
   DDGBuilder(DataDependenceGraph &G, DependenceInfo &D,
              const BasicBlockListType &BBs)
@@ -401,18 +401,18 @@ class DDGBuilder : public AbstractDependenceGraphBuilder<DataDependenceGraph> {
   bool shouldCreatePiBlocks() const final;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const DDGNode &N);
-raw_ostream &operator<<(raw_ostream &OS, const DDGNode::NodeKind K);
-raw_ostream &operator<<(raw_ostream &OS, const DDGEdge &E);
-raw_ostream &operator<<(raw_ostream &OS, const DDGEdge::EdgeKind K);
-raw_ostream &operator<<(raw_ostream &OS, const DataDependenceGraph &G);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const DDGNode &N);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const DDGNode::NodeKind K);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const DDGEdge &E);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const DDGEdge::EdgeKind K);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const DataDependenceGraph &G);
 
 //===--------------------------------------------------------------------===//
 // DDG Analysis Passes
 //===--------------------------------------------------------------------===//
 
 /// Analysis pass that builds the DDG for a loop.
-class DDGAnalysis : public AnalysisInfoMixin<DDGAnalysis> {
+class LLVM_CLASS_ABI DDGAnalysis : public AnalysisInfoMixin<DDGAnalysis> {
 public:
   using Result = std::unique_ptr<DataDependenceGraph>;
   Result run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR);
@@ -423,7 +423,7 @@ class DDGAnalysis : public AnalysisInfoMixin<DDGAnalysis> {
 };
 
 /// Textual printer pass for the DDG of a loop.
-class DDGAnalysisPrinterPass : public PassInfoMixin<DDGAnalysisPrinterPass> {
+class LLVM_CLASS_ABI DDGAnalysisPrinterPass : public PassInfoMixin<DDGAnalysisPrinterPass> {
 public:
   explicit DDGAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {}
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
@@ -484,7 +484,7 @@ DependenceGraphInfo<NodeType>::getDependenceString(const NodeType &Src,
 //===--------------------------------------------------------------------===//
 
 /// non-const versions of the grapth trait specializations for DDG
-template <> struct GraphTraits<DDGNode *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<DDGNode *> {
   using NodeRef = DDGNode *;
 
   static DDGNode *DDGGetTargetNode(DGEdge<DDGNode, DDGEdge> *P) {
@@ -512,7 +512,7 @@ template <> struct GraphTraits<DDGNode *> {
 };
 
 template <>
-struct GraphTraits<DataDependenceGraph *> : public GraphTraits<DDGNode *> {
+struct LLVM_CLASS_ABI GraphTraits<DataDependenceGraph *> : public GraphTraits<DDGNode *> {
   using nodes_iterator = DataDependenceGraph::iterator;
   static NodeRef getEntryNode(DataDependenceGraph *DG) {
     return &DG->getRoot();
@@ -524,7 +524,7 @@ struct GraphTraits<DataDependenceGraph *> : public GraphTraits<DDGNode *> {
 };
 
 /// const versions of the grapth trait specializations for DDG
-template <> struct GraphTraits<const DDGNode *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<const DDGNode *> {
   using NodeRef = const DDGNode *;
 
   static const DDGNode *DDGGetTargetNode(const DGEdge<DDGNode, DDGEdge> *P) {
@@ -552,7 +552,7 @@ template <> struct GraphTraits<const DDGNode *> {
 };
 
 template <>
-struct GraphTraits<const DataDependenceGraph *>
+struct LLVM_CLASS_ABI GraphTraits<const DataDependenceGraph *>
     : public GraphTraits<const DDGNode *> {
   using nodes_iterator = DataDependenceGraph::const_iterator;
   static NodeRef getEntryNode(const DataDependenceGraph *DG) {
diff --git a/llvm/include/llvm/Analysis/DDGPrinter.h b/llvm/include/llvm/Analysis/DDGPrinter.h
index 6fd11d0570d7a2b..cb4cf0eebca3681 100644
--- a/llvm/include/llvm/Analysis/DDGPrinter.h
+++ b/llvm/include/llvm/Analysis/DDGPrinter.h
@@ -26,7 +26,7 @@ class Loop;
 //===--------------------------------------------------------------------===//
 // Implementation of DDG DOT Printer for a loop.
 //===--------------------------------------------------------------------===//
-class DDGDotPrinterPass : public PassInfoMixin<DDGDotPrinterPass> {
+class LLVM_CLASS_ABI DDGDotPrinterPass : public PassInfoMixin<DDGDotPrinterPass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
@@ -36,7 +36,7 @@ class DDGDotPrinterPass : public PassInfoMixin<DDGDotPrinterPass> {
 // Specialization of DOTGraphTraits.
 //===--------------------------------------------------------------------===//
 template <>
-struct DOTGraphTraits<const DataDependenceGraph *>
+struct LLVM_CLASS_ABI DOTGraphTraits<const DataDependenceGraph *>
     : public DefaultDOTGraphTraits {
 
   DOTGraphTraits(bool IsSimple = false) : DefaultDOTGraphTraits(IsSimple) {}
diff --git a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
index cae56e6685872e3..e1e152ca4738337 100644
--- a/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
+++ b/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h
@@ -24,7 +24,7 @@ namespace llvm {
 ///
 /// This assumes that 'GraphT' is 'AnalysisT::Result *', and pass it through
 template <typename Result, typename GraphT = Result *>
-struct DefaultAnalysisGraphTraits {
+struct LLVM_CLASS_ABI DefaultAnalysisGraphTraits {
   static GraphT getGraph(Result R) { return &R; }
 };
 
@@ -41,7 +41,7 @@ template <typename AnalysisT, bool IsSimple,
           typename GraphT = typename AnalysisT::Result *,
           typename AnalysisGraphTraitsT =
               DefaultAnalysisGraphTraits<typename AnalysisT::Result &, GraphT>>
-struct DOTGraphTraitsViewer
+struct LLVM_CLASS_ABI DOTGraphTraitsViewer
     : PassInfoMixin<DOTGraphTraitsViewer<AnalysisT, IsSimple, GraphT,
                                          AnalysisGraphTraitsT>> {
   DOTGraphTraitsViewer(StringRef GraphName) : Name(GraphName) {}
@@ -107,7 +107,7 @@ template <typename AnalysisT, bool IsSimple,
           typename GraphT = typename AnalysisT::Result *,
           typename AnalysisGraphTraitsT =
               DefaultAnalysisGraphTraits<typename AnalysisT::Result &, GraphT>>
-struct DOTGraphTraitsPrinter
+struct LLVM_CLASS_ABI DOTGraphTraitsPrinter
     : PassInfoMixin<DOTGraphTraitsPrinter<AnalysisT, IsSimple, GraphT,
                                           AnalysisGraphTraitsT>> {
   DOTGraphTraitsPrinter(StringRef GraphName) : Name(GraphName) {}
@@ -155,14 +155,14 @@ struct DOTGraphTraitsPrinter
 ///
 /// This assumes that 'GraphT' is 'AnalysisT *' and so just passes it through.
 template <typename AnalysisT, typename GraphT = AnalysisT *>
-struct LegacyDefaultAnalysisGraphTraits {
+struct LLVM_CLASS_ABI LegacyDefaultAnalysisGraphTraits {
   static GraphT getGraph(AnalysisT *A) { return A; }
 };
 
 template <typename AnalysisT, bool IsSimple, typename GraphT = AnalysisT *,
           typename AnalysisGraphTraitsT =
               LegacyDefaultAnalysisGraphTraits<AnalysisT, GraphT>>
-class DOTGraphTraitsViewerWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI DOTGraphTraitsViewerWrapperPass : public FunctionPass {
 public:
   DOTGraphTraitsViewerWrapperPass(StringRef GraphName, char &ID)
       : FunctionPass(ID), Name(GraphName) {}
@@ -201,7 +201,7 @@ class DOTGraphTraitsViewerWrapperPass : public FunctionPass {
 template <typename AnalysisT, bool IsSimple, typename GraphT = AnalysisT *,
           typename AnalysisGraphTraitsT =
               LegacyDefaultAnalysisGraphTraits<AnalysisT, GraphT>>
-class DOTGraphTraitsPrinterWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI DOTGraphTraitsPrinterWrapperPass : public FunctionPass {
 public:
   DOTGraphTraitsPrinterWrapperPass(StringRef GraphName, char &ID)
       : FunctionPass(ID), Name(GraphName) {}
@@ -240,7 +240,7 @@ class DOTGraphTraitsPrinterWrapperPass : public FunctionPass {
 template <typename AnalysisT, bool IsSimple, typename GraphT = AnalysisT *,
           typename AnalysisGraphTraitsT =
               LegacyDefaultAnalysisGraphTraits<AnalysisT, GraphT>>
-class DOTGraphTraitsModuleViewerWrapperPass : public ModulePass {
+class LLVM_CLASS_ABI DOTGraphTraitsModuleViewerWrapperPass : public ModulePass {
 public:
   DOTGraphTraitsModuleViewerWrapperPass(StringRef GraphName, char &ID)
       : ModulePass(ID), Name(GraphName) {}
@@ -266,7 +266,7 @@ class DOTGraphTraitsModuleViewerWrapperPass : public ModulePass {
 template <typename AnalysisT, bool IsSimple, typename GraphT = AnalysisT *,
           typename AnalysisGraphTraitsT =
               LegacyDefaultAnalysisGraphTraits<AnalysisT, GraphT>>
-class DOTGraphTraitsModulePrinterWrapperPass : public ModulePass {
+class LLVM_CLASS_ABI DOTGraphTraitsModulePrinterWrapperPass : public ModulePass {
 public:
   DOTGraphTraitsModulePrinterWrapperPass(StringRef GraphName, char &ID)
       : ModulePass(ID), Name(GraphName) {}
diff --git a/llvm/include/llvm/Analysis/Delinearization.h b/llvm/include/llvm/Analysis/Delinearization.h
index a20a4742097bfeb..8ec0c26bddceec3 100644
--- a/llvm/include/llvm/Analysis/Delinearization.h
+++ b/llvm/include/llvm/Analysis/Delinearization.h
@@ -29,19 +29,19 @@ class SCEV;
 /// Compute the array dimensions Sizes from the set of Terms extracted from
 /// the memory access function of this SCEVAddRecExpr (second step of
 /// delinearization).
-void findArrayDimensions(ScalarEvolution &SE,
+LLVM_FUNC_ABI void findArrayDimensions(ScalarEvolution &SE,
                          SmallVectorImpl<const SCEV *> &Terms,
                          SmallVectorImpl<const SCEV *> &Sizes,
                          const SCEV *ElementSize);
 
 /// Collect parametric terms occurring in step expressions (first step of
 /// delinearization).
-void collectParametricTerms(ScalarEvolution &SE, const SCEV *Expr,
+LLVM_FUNC_ABI void collectParametricTerms(ScalarEvolution &SE, const SCEV *Expr,
                             SmallVectorImpl<const SCEV *> &Terms);
 
 /// Return in Subscripts the access functions for each dimension in Sizes
 /// (third step of delinearization).
-void computeAccessFunctions(ScalarEvolution &SE, const SCEV *Expr,
+LLVM_FUNC_ABI void computeAccessFunctions(ScalarEvolution &SE, const SCEV *Expr,
                             SmallVectorImpl<const SCEV *> &Subscripts,
                             SmallVectorImpl<const SCEV *> &Sizes);
 /// Split this SCEVAddRecExpr into two vectors of SCEVs representing the
@@ -108,7 +108,7 @@ void computeAccessFunctions(ScalarEvolution &SE, const SCEV *Expr,
 /// The subscript of the outermost dimension is the Quotient: [j+k].
 ///
 /// Overall, we have: A[][n][m], and the access function: A[j+k][2i][5i].
-void delinearize(ScalarEvolution &SE, const SCEV *Expr,
+LLVM_FUNC_ABI void delinearize(ScalarEvolution &SE, const SCEV *Expr,
                  SmallVectorImpl<const SCEV *> &Subscripts,
                  SmallVectorImpl<const SCEV *> &Sizes, const SCEV *ElementSize);
 
@@ -121,7 +121,7 @@ void delinearize(ScalarEvolution &SE, const SCEV *Expr,
 /// either equal length or the size list is one element shorter in case there
 /// is no known size available for the outermost array dimension. Returns true
 /// if successful and false otherwise.
-bool getIndexExpressionsFromGEP(ScalarEvolution &SE,
+LLVM_FUNC_ABI bool getIndexExpressionsFromGEP(ScalarEvolution &SE,
                                 const GetElementPtrInst *GEP,
                                 SmallVectorImpl<const SCEV *> &Subscripts,
                                 SmallVectorImpl<int> &Sizes);
@@ -132,12 +132,12 @@ bool getIndexExpressionsFromGEP(ScalarEvolution &SE,
 /// otherwise. \p Inst is the load/store instruction whose pointer operand is
 /// the one we want to delinearize. \p AccessFn is its corresponding SCEV
 /// expression w.r.t. the surrounding loop.
-bool tryDelinearizeFixedSizeImpl(ScalarEvolution *SE, Instruction *Inst,
+LLVM_FUNC_ABI bool tryDelinearizeFixedSizeImpl(ScalarEvolution *SE, Instruction *Inst,
                                  const SCEV *AccessFn,
                                  SmallVectorImpl<const SCEV *> &Subscripts,
                                  SmallVectorImpl<int> &Sizes);
 
-struct DelinearizationPrinterPass
+struct LLVM_CLASS_ABI DelinearizationPrinterPass
     : public PassInfoMixin<DelinearizationPrinterPass> {
   explicit DelinearizationPrinterPass(raw_ostream &OS);
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/Analysis/DemandedBits.h b/llvm/include/llvm/Analysis/DemandedBits.h
index 133aed5bf4aa08d..43ac20a8e335c85 100644
--- a/llvm/include/llvm/Analysis/DemandedBits.h
+++ b/llvm/include/llvm/Analysis/DemandedBits.h
@@ -37,7 +37,7 @@ class Instruction;
 struct KnownBits;
 class raw_ostream;
 
-class DemandedBits {
+class LLVM_CLASS_ABI DemandedBits {
 public:
   DemandedBits(Function &F, AssumptionCache &AC, DominatorTree &DT) :
     F(F), AC(AC), DT(DT) {}
@@ -100,7 +100,7 @@ class DemandedBits {
 };
 
 /// An analysis that produces \c DemandedBits for a function.
-class DemandedBitsAnalysis : public AnalysisInfoMixin<DemandedBitsAnalysis> {
+class LLVM_CLASS_ABI DemandedBitsAnalysis : public AnalysisInfoMixin<DemandedBitsAnalysis> {
   friend AnalysisInfoMixin<DemandedBitsAnalysis>;
 
   static AnalysisKey Key;
@@ -115,7 +115,7 @@ class DemandedBitsAnalysis : public AnalysisInfoMixin<DemandedBitsAnalysis> {
 };
 
 /// Printer pass for DemandedBits
-class DemandedBitsPrinterPass : public PassInfoMixin<DemandedBitsPrinterPass> {
+class LLVM_CLASS_ABI DemandedBitsPrinterPass : public PassInfoMixin<DemandedBitsPrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Analysis/DependenceAnalysis.h b/llvm/include/llvm/Analysis/DependenceAnalysis.h
index d06b19ab64542b2..906069be5eb920f 100644
--- a/llvm/include/llvm/Analysis/DependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/DependenceAnalysis.h
@@ -69,7 +69,7 @@ namespace llvm {
   /// if successor edges for its source instruction. These sets are represented
   /// as singly-linked lists, with the "next" fields stored in the dependence
   /// itelf.
-  class Dependence {
+  class LLVM_CLASS_ABI Dependence {
   protected:
     Dependence(Dependence &&) = default;
     Dependence &operator=(Dependence &&) = default;
@@ -224,7 +224,7 @@ namespace llvm {
   /// (for output, flow, and anti dependences), the dependence implies an
   /// ordering, where the source must precede the destination; in contrast,
   /// input dependences are unordered.
-  class FullDependence final : public Dependence {
+  class LLVM_CLASS_ABI FullDependence final : public Dependence {
   public:
     FullDependence(Instruction *Src, Instruction *Dst, bool LoopIndependent,
                    unsigned Levels);
@@ -291,7 +291,7 @@ namespace llvm {
 
   /// DependenceInfo - This class is the main dependence-analysis driver.
   ///
-  class DependenceInfo {
+  class LLVM_CLASS_ABI DependenceInfo {
   public:
     DependenceInfo(Function *F, AAResults *AA, ScalarEvolution *SE,
                    LoopInfo *LI)
@@ -976,7 +976,7 @@ namespace llvm {
   }; // class DependenceInfo
 
   /// AnalysisPass to compute dependence information in a function
-  class DependenceAnalysis : public AnalysisInfoMixin<DependenceAnalysis> {
+  class LLVM_CLASS_ABI DependenceAnalysis : public AnalysisInfoMixin<DependenceAnalysis> {
   public:
     typedef DependenceInfo Result;
     Result run(Function &F, FunctionAnalysisManager &FAM);
@@ -987,7 +987,7 @@ namespace llvm {
   }; // class DependenceAnalysis
 
   /// Printer pass to dump DA results.
-  struct DependenceAnalysisPrinterPass
+  struct LLVM_CLASS_ABI DependenceAnalysisPrinterPass
       : public PassInfoMixin<DependenceAnalysisPrinterPass> {
     DependenceAnalysisPrinterPass(raw_ostream &OS,
                                   bool NormalizeResults = false)
@@ -1001,7 +1001,7 @@ namespace llvm {
   }; // class DependenceAnalysisPrinterPass
 
   /// Legacy pass manager pass to access dependence information
-  class DependenceAnalysisWrapperPass : public FunctionPass {
+  class LLVM_CLASS_ABI DependenceAnalysisWrapperPass : public FunctionPass {
   public:
     static char ID; // Class identification, replacement for typeinfo
     DependenceAnalysisWrapperPass();
@@ -1018,7 +1018,7 @@ namespace llvm {
 
   /// createDependenceAnalysisPass - This creates an instance of the
   /// DependenceAnalysis wrapper pass.
-  FunctionPass *createDependenceAnalysisWrapperPass();
+  LLVM_FUNC_ABI FunctionPass *createDependenceAnalysisWrapperPass();
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/DependenceGraphBuilder.h b/llvm/include/llvm/Analysis/DependenceGraphBuilder.h
index 5f9657aa63caef9..2e37a153eee85ae 100644
--- a/llvm/include/llvm/Analysis/DependenceGraphBuilder.h
+++ b/llvm/include/llvm/Analysis/DependenceGraphBuilder.h
@@ -29,7 +29,7 @@ class Instruction;
 /// DDG-like graphs. The client code is expected to inherit from this class and
 /// define concrete implementation for each of the pure virtual functions used
 /// in the high-level algorithm.
-template <class GraphType> class AbstractDependenceGraphBuilder {
+template <class GraphType> class LLVM_CLASS_ABI AbstractDependenceGraphBuilder {
 protected:
   using BasicBlockListType = SmallVectorImpl<BasicBlock *>;
 
diff --git a/llvm/include/llvm/Analysis/DomPrinter.h b/llvm/include/llvm/Analysis/DomPrinter.h
index 7d44da544e8b429..458babff6e8b755 100644
--- a/llvm/include/llvm/Analysis/DomPrinter.h
+++ b/llvm/include/llvm/Analysis/DomPrinter.h
@@ -23,7 +23,7 @@
 namespace llvm {
 
 template <>
-struct DOTGraphTraits<DomTreeNode *> : public DefaultDOTGraphTraits {
+struct LLVM_CLASS_ABI DOTGraphTraits<DomTreeNode *> : public DefaultDOTGraphTraits {
 
   DOTGraphTraits(bool isSimple = false) : DefaultDOTGraphTraits(isSimple) {}
 
@@ -42,7 +42,7 @@ struct DOTGraphTraits<DomTreeNode *> : public DefaultDOTGraphTraits {
 };
 
 template <>
-struct DOTGraphTraits<DominatorTree *>
+struct LLVM_CLASS_ABI DOTGraphTraits<DominatorTree *>
     : public DOTGraphTraits<DomTreeNode *> {
 
   DOTGraphTraits(bool isSimple = false)
@@ -59,7 +59,7 @@ struct DOTGraphTraits<DominatorTree *>
 };
 
 template<>
-struct DOTGraphTraits<PostDominatorTree *>
+struct LLVM_CLASS_ABI DOTGraphTraits<PostDominatorTree *>
   : public DOTGraphTraits<DomTreeNode*> {
 
   DOTGraphTraits (bool isSimple=false)
@@ -75,44 +75,44 @@ struct DOTGraphTraits<PostDominatorTree *>
   }
 };
 
-struct DomViewer final : DOTGraphTraitsViewer<DominatorTreeAnalysis, false> {
+struct LLVM_CLASS_ABI DomViewer final : DOTGraphTraitsViewer<DominatorTreeAnalysis, false> {
   DomViewer() : DOTGraphTraitsViewer<DominatorTreeAnalysis, false>("dom") {}
 };
 
-struct DomOnlyViewer final : DOTGraphTraitsViewer<DominatorTreeAnalysis, true> {
+struct LLVM_CLASS_ABI DomOnlyViewer final : DOTGraphTraitsViewer<DominatorTreeAnalysis, true> {
   DomOnlyViewer()
       : DOTGraphTraitsViewer<DominatorTreeAnalysis, true>("domonly") {}
 };
 
-struct PostDomViewer final
+struct LLVM_CLASS_ABI PostDomViewer final
     : DOTGraphTraitsViewer<PostDominatorTreeAnalysis, false> {
   PostDomViewer()
       : DOTGraphTraitsViewer<PostDominatorTreeAnalysis, false>("postdom") {}
 };
 
-struct PostDomOnlyViewer final
+struct LLVM_CLASS_ABI PostDomOnlyViewer final
     : DOTGraphTraitsViewer<PostDominatorTreeAnalysis, true> {
   PostDomOnlyViewer()
       : DOTGraphTraitsViewer<PostDominatorTreeAnalysis, true>("postdomonly") {}
 };
 
-struct DomPrinter final : DOTGraphTraitsPrinter<DominatorTreeAnalysis, false> {
+struct LLVM_CLASS_ABI DomPrinter final : DOTGraphTraitsPrinter<DominatorTreeAnalysis, false> {
   DomPrinter() : DOTGraphTraitsPrinter<DominatorTreeAnalysis, false>("dom") {}
 };
 
-struct DomOnlyPrinter final
+struct LLVM_CLASS_ABI DomOnlyPrinter final
     : DOTGraphTraitsPrinter<DominatorTreeAnalysis, true> {
   DomOnlyPrinter()
       : DOTGraphTraitsPrinter<DominatorTreeAnalysis, true>("domonly") {}
 };
 
-struct PostDomPrinter final
+struct LLVM_CLASS_ABI PostDomPrinter final
     : DOTGraphTraitsPrinter<PostDominatorTreeAnalysis, false> {
   PostDomPrinter()
       : DOTGraphTraitsPrinter<PostDominatorTreeAnalysis, false>("postdom") {}
 };
 
-struct PostDomOnlyPrinter final
+struct LLVM_CLASS_ABI PostDomOnlyPrinter final
     : DOTGraphTraitsPrinter<PostDominatorTreeAnalysis, true> {
   PostDomOnlyPrinter()
       : DOTGraphTraitsPrinter<PostDominatorTreeAnalysis, true>("postdomonly") {}
@@ -121,14 +121,14 @@ struct PostDomOnlyPrinter final
 
 namespace llvm {
   class FunctionPass;
-  FunctionPass *createDomPrinterWrapperPassPass();
-  FunctionPass *createDomOnlyPrinterWrapperPassPass();
-  FunctionPass *createDomViewerWrapperPassPass();
-  FunctionPass *createDomOnlyViewerWrapperPassPass();
-  FunctionPass *createPostDomPrinterWrapperPassPass();
-  FunctionPass *createPostDomOnlyPrinterWrapperPassPass();
-  FunctionPass *createPostDomViewerWrapperPassPass();
-  FunctionPass *createPostDomOnlyViewerWrapperPassPass();
+  LLVM_FUNC_ABI FunctionPass *createDomPrinterWrapperPassPass();
+  LLVM_FUNC_ABI FunctionPass *createDomOnlyPrinterWrapperPassPass();
+  LLVM_FUNC_ABI FunctionPass *createDomViewerWrapperPassPass();
+  LLVM_FUNC_ABI FunctionPass *createDomOnlyViewerWrapperPassPass();
+  LLVM_FUNC_ABI FunctionPass *createPostDomPrinterWrapperPassPass();
+  LLVM_FUNC_ABI FunctionPass *createPostDomOnlyPrinterWrapperPassPass();
+  LLVM_FUNC_ABI FunctionPass *createPostDomViewerWrapperPassPass();
+  LLVM_FUNC_ABI FunctionPass *createPostDomOnlyViewerWrapperPassPass();
 } // End llvm namespace
 
 #endif
diff --git a/llvm/include/llvm/Analysis/DomTreeUpdater.h b/llvm/include/llvm/Analysis/DomTreeUpdater.h
index ddb958455ccd794..b90880eb8a74805 100644
--- a/llvm/include/llvm/Analysis/DomTreeUpdater.h
+++ b/llvm/include/llvm/Analysis/DomTreeUpdater.h
@@ -25,7 +25,7 @@
 namespace llvm {
 class PostDominatorTree;
 
-class DomTreeUpdater {
+class LLVM_CLASS_ABI DomTreeUpdater {
 public:
   enum class UpdateStrategy : unsigned char { Eager = 0, Lazy = 1 };
 
diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h
index ea7a367deaa5db2..5c89991175d6404 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontier.h
@@ -38,7 +38,7 @@ class raw_ostream;
 /// dominance frontiers for a function.
 ///
 template <class BlockT, bool IsPostDom>
-class DominanceFrontierBase {
+class LLVM_CLASS_ABI DominanceFrontierBase {
 public:
   using DomSetType = std::set<BlockT *>;                // Dom set for a bb
   using DomSetMapType = std::map<BlockT *, DomSetType>; // Dom set map
@@ -119,7 +119,7 @@ class DominanceFrontierBase {
 /// used to compute a forward dominator frontiers.
 ///
 template <class BlockT>
-class ForwardDominanceFrontierBase
+class LLVM_CLASS_ABI ForwardDominanceFrontierBase
     : public DominanceFrontierBase<BlockT, false> {
 private:
   using BlockTraits = GraphTraits<BlockT *>;
@@ -139,7 +139,7 @@ class ForwardDominanceFrontierBase
   const DomSetType &calculate(const DomTreeT &DT, const DomTreeNodeT *Node);
 };
 
-class DominanceFrontier : public ForwardDominanceFrontierBase<BasicBlock> {
+class LLVM_CLASS_ABI DominanceFrontier : public ForwardDominanceFrontierBase<BasicBlock> {
 public:
   using DomTreeT = DomTreeBase<BasicBlock>;
   using DomTreeNodeT = DomTreeNodeBase<BasicBlock>;
@@ -153,7 +153,7 @@ class DominanceFrontier : public ForwardDominanceFrontierBase<BasicBlock> {
                   FunctionAnalysisManager::Invalidator &);
 };
 
-class DominanceFrontierWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI DominanceFrontierWrapperPass : public FunctionPass {
   DominanceFrontier DF;
 
 public:
@@ -180,7 +180,7 @@ extern template class DominanceFrontierBase<BasicBlock, true>;
 extern template class ForwardDominanceFrontierBase<BasicBlock>;
 
 /// Analysis pass which computes a \c DominanceFrontier.
-class DominanceFrontierAnalysis
+class LLVM_CLASS_ABI DominanceFrontierAnalysis
     : public AnalysisInfoMixin<DominanceFrontierAnalysis> {
   friend AnalysisInfoMixin<DominanceFrontierAnalysis>;
 
@@ -195,7 +195,7 @@ class DominanceFrontierAnalysis
 };
 
 /// Printer pass for the \c DominanceFrontier.
-class DominanceFrontierPrinterPass
+class LLVM_CLASS_ABI DominanceFrontierPrinterPass
     : public PassInfoMixin<DominanceFrontierPrinterPass> {
   raw_ostream &OS;
 
diff --git a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
index 95ce0736eca952c..224dc87e8aa3fac 100644
--- a/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
+++ b/llvm/include/llvm/Analysis/DominanceFrontierImpl.h
@@ -32,7 +32,7 @@
 namespace llvm {
 
 template <class BlockT>
-class DFCalculateWorkObject {
+class LLVM_CLASS_ABI DFCalculateWorkObject {
 public:
   using DomTreeNodeT = DomTreeNodeBase<BlockT>;
 
diff --git a/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h b/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
index fa2dd51e1c84284..ceeffe7ecd7b63b 100644
--- a/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
+++ b/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h
@@ -25,7 +25,7 @@ class DominatorTree;
 class Function;
 class LoopInfo;
 
-class FunctionPropertiesInfo {
+class LLVM_CLASS_ABI FunctionPropertiesInfo {
   friend class FunctionPropertiesUpdater;
   void updateForBB(const BasicBlock &BB, int64_t Direction);
   void updateAggregateStats(const Function &F, const LoopInfo &LI);
@@ -85,7 +85,7 @@ class FunctionPropertiesInfo {
 };
 
 // Analysis pass
-class FunctionPropertiesAnalysis
+class LLVM_CLASS_ABI FunctionPropertiesAnalysis
     : public AnalysisInfoMixin<FunctionPropertiesAnalysis> {
 
 public:
@@ -97,7 +97,7 @@ class FunctionPropertiesAnalysis
 };
 
 /// Printer pass for the FunctionPropertiesAnalysis results.
-class FunctionPropertiesPrinterPass
+class LLVM_CLASS_ABI FunctionPropertiesPrinterPass
     : public PassInfoMixin<FunctionPropertiesPrinterPass> {
   raw_ostream &OS;
 
@@ -113,7 +113,7 @@ class FunctionPropertiesPrinterPass
 /// a few BBs of the Caller (maybe the entry BB and definitely the callsite BB)
 /// and potentially affect exception handling BBs in the case of invoke
 /// inlining.
-class FunctionPropertiesUpdater {
+class LLVM_CLASS_ABI FunctionPropertiesUpdater {
 public:
   FunctionPropertiesUpdater(FunctionPropertiesInfo &FPI, CallBase &CB);
 
diff --git a/llvm/include/llvm/Analysis/GlobalsModRef.h b/llvm/include/llvm/Analysis/GlobalsModRef.h
index 865fd2f9ebeedf5..97f13a0dd2353ba 100644
--- a/llvm/include/llvm/Analysis/GlobalsModRef.h
+++ b/llvm/include/llvm/Analysis/GlobalsModRef.h
@@ -28,7 +28,7 @@ class Function;
 ///
 /// This focuses on handling aliasing properties of globals and interprocedural
 /// function call mod/ref information.
-class GlobalsAAResult : public AAResultBase {
+class LLVM_CLASS_ABI GlobalsAAResult : public AAResultBase {
   class FunctionInfo;
 
   const DataLayout &DL;
@@ -125,7 +125,7 @@ class GlobalsAAResult : public AAResultBase {
 };
 
 /// Analysis pass providing a never-invalidated alias analysis result.
-class GlobalsAA : public AnalysisInfoMixin<GlobalsAA> {
+class LLVM_CLASS_ABI GlobalsAA : public AnalysisInfoMixin<GlobalsAA> {
   friend AnalysisInfoMixin<GlobalsAA>;
   static AnalysisKey Key;
 
@@ -135,12 +135,12 @@ class GlobalsAA : public AnalysisInfoMixin<GlobalsAA> {
   GlobalsAAResult run(Module &M, ModuleAnalysisManager &AM);
 };
 
-struct RecomputeGlobalsAAPass : PassInfoMixin<RecomputeGlobalsAAPass> {
+struct LLVM_CLASS_ABI RecomputeGlobalsAAPass : PassInfoMixin<RecomputeGlobalsAAPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
 /// Legacy wrapper pass to provide the GlobalsAAResult object.
-class GlobalsAAWrapperPass : public ModulePass {
+class LLVM_CLASS_ABI GlobalsAAWrapperPass : public ModulePass {
   std::unique_ptr<GlobalsAAResult> Result;
 
 public:
@@ -161,7 +161,7 @@ class GlobalsAAWrapperPass : public ModulePass {
 // createGlobalsAAWrapperPass - This pass provides alias and mod/ref info for
 // global values that do not have their addresses taken.
 //
-ModulePass *createGlobalsAAWrapperPass();
+LLVM_FUNC_ABI ModulePass *createGlobalsAAWrapperPass();
 }
 
 #endif
diff --git a/llvm/include/llvm/Analysis/GuardUtils.h b/llvm/include/llvm/Analysis/GuardUtils.h
index 589cc5f3082bb00..9116ba9036cbe05 100644
--- a/llvm/include/llvm/Analysis/GuardUtils.h
+++ b/llvm/include/llvm/Analysis/GuardUtils.h
@@ -23,15 +23,15 @@ class Value;
 
 /// Returns true iff \p U has semantics of a guard expressed in a form of call
 /// of llvm.experimental.guard intrinsic.
-bool isGuard(const User *U);
+LLVM_FUNC_ABI bool isGuard(const User *U);
 
 /// Returns true iff \p U is a widenable branch (that is, parseWidenableBranch
 /// returns true).
-bool isWidenableBranch(const User *U);
+LLVM_FUNC_ABI bool isWidenableBranch(const User *U);
 
 /// Returns true iff \p U has semantics of a guard expressed in a form of a
 /// widenable conditional branch to deopt block.
-bool isGuardAsWidenableBranch(const User *U);
+LLVM_FUNC_ABI bool isGuardAsWidenableBranch(const User *U);
 
 /// If U is widenable branch looking like:
 ///   %cond = ...
@@ -42,13 +42,13 @@ bool isGuardAsWidenableBranch(const User *U);
 /// %if_true_bb, if_false_bb are returned in
 /// the parameters (Condition, WidenableCondition, IfTrueBB and IfFalseFF)
 /// respectively. If \p U does not match this pattern, return false.
-bool parseWidenableBranch(const User *U, Value *&Condition,
+LLVM_FUNC_ABI bool parseWidenableBranch(const User *U, Value *&Condition,
                           Value *&WidenableCondition, BasicBlock *&IfTrueBB,
                           BasicBlock *&IfFalseBB);
 
 /// Analgous to the above, but return the Uses so that that they can be
 /// modified. Unlike previous version, Condition is optional and may be null.
-bool parseWidenableBranch(User *U, Use *&Cond, Use *&WC, BasicBlock *&IfTrueBB,
+LLVM_FUNC_ABI bool parseWidenableBranch(User *U, Use *&Cond, Use *&WC, BasicBlock *&IfTrueBB,
                           BasicBlock *&IfFalseBB);
   
 } // llvm
diff --git a/llvm/include/llvm/Analysis/HeatUtils.h b/llvm/include/llvm/Analysis/HeatUtils.h
index 2fbc99d4f01ba46..04f00a430a21ae2 100644
--- a/llvm/include/llvm/Analysis/HeatUtils.h
+++ b/llvm/include/llvm/Analysis/HeatUtils.h
@@ -23,17 +23,17 @@ class BlockFrequencyInfo;
 class Function;
 
 // Returns number of calls of calledFunction by callerFunction.
-uint64_t
+LLVM_FUNC_ABI uint64_t
 getNumOfCalls(Function &callerFunction, Function &calledFunction);
 
 // Returns the maximum frequency of a BB in a function.
-uint64_t getMaxFreq(const Function &F, const BlockFrequencyInfo *BFI);
+LLVM_FUNC_ABI uint64_t getMaxFreq(const Function &F, const BlockFrequencyInfo *BFI);
 
 // Calculates heat color based on current and maximum frequencies.
-std::string getHeatColor(uint64_t freq, uint64_t maxFreq);
+LLVM_FUNC_ABI std::string getHeatColor(uint64_t freq, uint64_t maxFreq);
 
 // Calculates heat color based on percent of "hotness".
-std::string getHeatColor(double percent);
+LLVM_FUNC_ABI std::string getHeatColor(double percent);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
index bef9da329fe1947..daed5284bd257a8 100644
--- a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
+++ b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h
@@ -113,7 +113,7 @@ enum InstrType { Legal, Illegal, Invisible };
 /// by \ref isSameOperationAs.
 /// TODO: Handle GetElementPtrInsts, as some of the operands have to be the
 /// exact same, and some do not.
-struct IRInstructionData
+struct LLVM_CLASS_ABI IRInstructionData
     : ilist_node<IRInstructionData, ilist_sentinel_tracking<true>> {
 
   /// The source Instruction that is being wrapped.
@@ -301,7 +301,7 @@ struct IRInstructionData
   IRInstructionDataList *IDL = nullptr;
 };
 
-struct IRInstructionDataList
+struct LLVM_CLASS_ABI IRInstructionDataList
     : simple_ilist<IRInstructionData, ilist_sentinel_tracking<true>> {};
 
 /// Compare one IRInstructionData class to another IRInstructionData class for
@@ -313,9 +313,9 @@ struct IRInstructionDataList
 /// \param B - The second IRInstructionData class to compare
 /// \returns true if \p A and \p B are similar enough to be mapped to the same
 /// value.
-bool isClose(const IRInstructionData &A, const IRInstructionData &B);
+LLVM_FUNC_ABI bool isClose(const IRInstructionData &A, const IRInstructionData &B);
 
-struct IRInstructionDataTraits : DenseMapInfo<IRInstructionData *> {
+struct LLVM_CLASS_ABI IRInstructionDataTraits : DenseMapInfo<IRInstructionData *> {
   static inline IRInstructionData *getEmptyKey() { return nullptr; }
   static inline IRInstructionData *getTombstoneKey() {
     return reinterpret_cast<IRInstructionData *>(-1);
@@ -379,7 +379,7 @@ struct IRInstructionDataTraits : DenseMapInfo<IRInstructionData *> {
 ///
 /// TODO: This is very similar to the MachineOutliner, and should be
 /// consolidated into the same interface.
-struct IRInstructionMapper {
+struct LLVM_CLASS_ABI IRInstructionMapper {
   /// The starting illegal instruction number to map to.
   ///
   /// Set to -3 for compatibility with DenseMapInfo<unsigned>.
@@ -652,7 +652,7 @@ struct IRInstructionMapper {
 ///
 /// We cannot create the same mapping since the use of c4 is not used in the
 /// same way as %b or c2.
-class IRSimilarityCandidate {
+class LLVM_CLASS_ABI IRSimilarityCandidate {
 private:
   /// The start index of this IRSimilarityCandidate in the instruction list.
   unsigned StartIdx = 0;
@@ -1043,7 +1043,7 @@ typedef std::vector<SimilarityGroup> SimilarityGroupList;
 ///
 /// A list of the different similarity groups is then returned after
 /// analyzing the module.
-class IRSimilarityIdentifier {
+class LLVM_CLASS_ABI IRSimilarityIdentifier {
 public:
   IRSimilarityIdentifier(bool MatchBranches = true,
                          bool MatchIndirectCalls = true,
@@ -1160,7 +1160,7 @@ class IRSimilarityIdentifier {
 
 /// An analysis pass based on legacy pass manager that runs and returns
 /// IRSimilarityIdentifier run on the Module.
-class IRSimilarityIdentifierWrapperPass : public ModulePass {
+class LLVM_CLASS_ABI IRSimilarityIdentifierWrapperPass : public ModulePass {
   std::unique_ptr<IRSimilarity::IRSimilarityIdentifier> IRSI;
 
 public:
@@ -1180,7 +1180,7 @@ class IRSimilarityIdentifierWrapperPass : public ModulePass {
 
 /// An analysis pass that runs and returns the IRSimilarityIdentifier run on the
 /// Module.
-class IRSimilarityAnalysis : public AnalysisInfoMixin<IRSimilarityAnalysis> {
+class LLVM_CLASS_ABI IRSimilarityAnalysis : public AnalysisInfoMixin<IRSimilarityAnalysis> {
 public:
   typedef IRSimilarity::IRSimilarityIdentifier Result;
 
@@ -1192,7 +1192,7 @@ class IRSimilarityAnalysis : public AnalysisInfoMixin<IRSimilarityAnalysis> {
 };
 
 /// Printer pass that uses \c IRSimilarityAnalysis.
-class IRSimilarityAnalysisPrinterPass
+class LLVM_CLASS_ABI IRSimilarityAnalysisPrinterPass
     : public PassInfoMixin<IRSimilarityAnalysisPrinterPass> {
   raw_ostream &OS;
 
diff --git a/llvm/include/llvm/Analysis/IVDescriptors.h b/llvm/include/llvm/Analysis/IVDescriptors.h
index 4324f413e8b00af..13edad8c0fefae7 100644
--- a/llvm/include/llvm/Analysis/IVDescriptors.h
+++ b/llvm/include/llvm/Analysis/IVDescriptors.h
@@ -69,7 +69,7 @@ enum class RecurKind {
 /// references.
 
 /// This struct holds information about recurrence variables.
-class RecurrenceDescriptor {
+class LLVM_CLASS_ABI RecurrenceDescriptor {
 public:
   RecurrenceDescriptor() = default;
 
@@ -304,7 +304,7 @@ class RecurrenceDescriptor {
 };
 
 /// A struct for saving information about induction variables.
-class InductionDescriptor {
+class LLVM_CLASS_ABI InductionDescriptor {
 public:
   /// This enum represents the kinds of inductions that we support.
   enum InductionKind {
diff --git a/llvm/include/llvm/Analysis/IVUsers.h b/llvm/include/llvm/Analysis/IVUsers.h
index e7098b74094b326..dfdaa48c4ecd531 100644
--- a/llvm/include/llvm/Analysis/IVUsers.h
+++ b/llvm/include/llvm/Analysis/IVUsers.h
@@ -32,7 +32,7 @@ class IVUsers;
 /// The Expr member keeps track of the expression, User is the actual user
 /// instruction of the operand, and 'OperandValToReplace' is the operand of
 /// the User that is the use.
-class IVStrideUse final : public CallbackVH, public ilist_node<IVStrideUse> {
+class LLVM_CLASS_ABI IVStrideUse final : public CallbackVH, public ilist_node<IVStrideUse> {
   friend class IVUsers;
 public:
   IVStrideUse(IVUsers *P, Instruction* U, Value *O)
@@ -88,7 +88,7 @@ class IVStrideUse final : public CallbackVH, public ilist_node<IVStrideUse> {
   void deleted() override;
 };
 
-class IVUsers {
+class LLVM_CLASS_ABI IVUsers {
   friend class IVStrideUse;
   Loop *L;
   AssumptionCache *AC;
@@ -158,9 +158,9 @@ class IVUsers {
   void dump() const;
 };
 
-Pass *createIVUsersPass();
+LLVM_FUNC_ABI Pass *createIVUsersPass();
 
-class IVUsersWrapperPass : public LoopPass {
+class LLVM_CLASS_ABI IVUsersWrapperPass : public LoopPass {
   std::unique_ptr<IVUsers> IU;
 
 public:
@@ -181,7 +181,7 @@ class IVUsersWrapperPass : public LoopPass {
 };
 
 /// Analysis pass that exposes the \c IVUsers for a loop.
-class IVUsersAnalysis : public AnalysisInfoMixin<IVUsersAnalysis> {
+class LLVM_CLASS_ABI IVUsersAnalysis : public AnalysisInfoMixin<IVUsersAnalysis> {
   friend AnalysisInfoMixin<IVUsersAnalysis>;
   static AnalysisKey Key;
 
diff --git a/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h b/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h
index 3124d3872a53fda..ac632375377c8c7 100644
--- a/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h
+++ b/llvm/include/llvm/Analysis/IndirectCallPromotionAnalysis.h
@@ -22,7 +22,7 @@ class Instruction;
 
 // Class for identifying profitable indirect call promotion candidates when
 // the indirect-call value profile metadata is available.
-class ICallPromotionAnalysis {
+class LLVM_CLASS_ABI ICallPromotionAnalysis {
 private:
   // Allocate space to read the profile annotation.
   std::unique_ptr<InstrProfValueData[]> ValueDataArray;
diff --git a/llvm/include/llvm/Analysis/IndirectCallVisitor.h b/llvm/include/llvm/Analysis/IndirectCallVisitor.h
index d23d95f7dc69b9f..deeffd24c82cda1 100644
--- a/llvm/include/llvm/Analysis/IndirectCallVisitor.h
+++ b/llvm/include/llvm/Analysis/IndirectCallVisitor.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 // Visitor class that finds all indirect call.
-struct PGOIndirectCallVisitor : public InstVisitor<PGOIndirectCallVisitor> {
+struct LLVM_CLASS_ABI PGOIndirectCallVisitor : public InstVisitor<PGOIndirectCallVisitor> {
   std::vector<CallBase *> IndirectCalls;
   PGOIndirectCallVisitor() = default;
 
diff --git a/llvm/include/llvm/Analysis/InlineAdvisor.h b/llvm/include/llvm/Analysis/InlineAdvisor.h
index c705d7afb2219bf..e04929c872d8c58 100644
--- a/llvm/include/llvm/Analysis/InlineAdvisor.h
+++ b/llvm/include/llvm/Analysis/InlineAdvisor.h
@@ -58,13 +58,13 @@ enum class InlinePass : int {
 
 /// Provides context on when an inline advisor is constructed in the pipeline
 /// (e.g., link phase, inline driver).
-struct InlineContext {
+struct LLVM_CLASS_ABI InlineContext {
   ThinOrFullLTOPhase LTOPhase;
 
   InlinePass Pass;
 };
 
-std::string AnnotateInlinePassName(InlineContext IC);
+LLVM_FUNC_ABI std::string AnnotateInlinePassName(InlineContext IC);
 
 class InlineAdvisor;
 /// Capture state between an inlining decision having had been made, and
@@ -74,7 +74,7 @@ class InlineAdvisor;
 /// Derivations of this type are expected to be tightly coupled with their
 /// InliningAdvisors. The base type implements the minimal contractual
 /// obligations.
-class InlineAdvice {
+class LLVM_CLASS_ABI InlineAdvice {
 public:
   InlineAdvice(InlineAdvisor *Advisor, CallBase &CB,
                OptimizationRemarkEmitter &ORE, bool IsInliningRecommended);
@@ -143,7 +143,7 @@ class InlineAdvice {
   bool Recorded = false;
 };
 
-class DefaultInlineAdvice : public InlineAdvice {
+class LLVM_CLASS_ABI DefaultInlineAdvice : public InlineAdvice {
 public:
   DefaultInlineAdvice(InlineAdvisor *Advisor, CallBase &CB,
                       std::optional<InlineCost> OIC,
@@ -163,7 +163,7 @@ class DefaultInlineAdvice : public InlineAdvice {
 };
 
 /// Interface for deciding whether to inline a call site or not.
-class InlineAdvisor {
+class LLVM_CLASS_ABI InlineAdvisor {
 public:
   InlineAdvisor(InlineAdvisor &&) = delete;
   virtual ~InlineAdvisor();
@@ -229,7 +229,7 @@ class InlineAdvisor {
 /// The default (manual heuristics) implementation of the InlineAdvisor. This
 /// implementation does not need to keep state between inliner pass runs, and is
 /// reusable as-is for inliner pass test scenarios, as well as for regular use.
-class DefaultInlineAdvisor : public InlineAdvisor {
+class LLVM_CLASS_ABI DefaultInlineAdvisor : public InlineAdvisor {
 public:
   DefaultInlineAdvisor(Module &M, FunctionAnalysisManager &FAM,
                        InlineParams Params, InlineContext IC)
@@ -286,7 +286,7 @@ class DefaultInlineAdvisor : public InlineAdvisor {
 /// InlineAdvisorAnalysis::Result::tryCreate will return the dynamically loaded
 /// advisor.
 ///
-class PluginInlineAdvisorAnalysis
+class LLVM_CLASS_ABI PluginInlineAdvisorAnalysis
     : public AnalysisInfoMixin<PluginInlineAdvisorAnalysis> {
 public:
   static AnalysisKey Key;
@@ -316,7 +316,7 @@ class PluginInlineAdvisorAnalysis
 
 /// The InlineAdvisorAnalysis is a module pass because the InlineAdvisor
 /// needs to capture state right before inlining commences over a module.
-class InlineAdvisorAnalysis : public AnalysisInfoMixin<InlineAdvisorAnalysis> {
+class LLVM_CLASS_ABI InlineAdvisorAnalysis : public AnalysisInfoMixin<InlineAdvisorAnalysis> {
 public:
   static AnalysisKey Key;
   InlineAdvisorAnalysis() = default;
@@ -344,7 +344,7 @@ class InlineAdvisorAnalysis : public AnalysisInfoMixin<InlineAdvisorAnalysis> {
 };
 
 /// Printer pass for the FunctionPropertiesAnalysis results.
-class InlineAdvisorAnalysisPrinterPass
+class LLVM_CLASS_ABI InlineAdvisorAnalysisPrinterPass
     : public PassInfoMixin<InlineAdvisorAnalysisPrinterPass> {
   raw_ostream &OS;
 
@@ -357,11 +357,11 @@ class InlineAdvisorAnalysisPrinterPass
                         LazyCallGraph &CG, CGSCCUpdateResult &UR);
 };
 
-std::unique_ptr<InlineAdvisor>
+LLVM_FUNC_ABI std::unique_ptr<InlineAdvisor>
 getReleaseModeAdvisor(Module &M, ModuleAnalysisManager &MAM,
                       std::function<bool(CallBase &)> GetDefaultAdvice);
 
-std::unique_ptr<InlineAdvisor>
+LLVM_FUNC_ABI std::unique_ptr<InlineAdvisor>
 getDevelopmentModeAdvisor(Module &M, ModuleAnalysisManager &MAM,
                           std::function<bool(CallBase &)> GetDefaultAdvice);
 
@@ -372,31 +372,31 @@ getDevelopmentModeAdvisor(Module &M, ModuleAnalysisManager &MAM,
 /// CallSite. If we return the cost, we will emit an optimisation remark later
 /// using that cost, so we won't do so from this function. Return std::nullopt
 /// if inlining should not be attempted.
-std::optional<InlineCost>
+LLVM_FUNC_ABI std::optional<InlineCost>
 shouldInline(CallBase &CB, function_ref<InlineCost(CallBase &CB)> GetInlineCost,
              OptimizationRemarkEmitter &ORE, bool EnableDeferral = true);
 
 /// Emit ORE message.
-void emitInlinedInto(OptimizationRemarkEmitter &ORE, DebugLoc DLoc,
+LLVM_FUNC_ABI void emitInlinedInto(OptimizationRemarkEmitter &ORE, DebugLoc DLoc,
                      const BasicBlock *Block, const Function &Callee,
                      const Function &Caller, bool IsMandatory,
                      function_ref<void(OptimizationRemark &)> ExtraContext = {},
                      const char *PassName = nullptr);
 
 /// Emit ORE message based in cost (default heuristic).
-void emitInlinedIntoBasedOnCost(OptimizationRemarkEmitter &ORE, DebugLoc DLoc,
+LLVM_FUNC_ABI void emitInlinedIntoBasedOnCost(OptimizationRemarkEmitter &ORE, DebugLoc DLoc,
                                 const BasicBlock *Block, const Function &Callee,
                                 const Function &Caller, const InlineCost &IC,
                                 bool ForProfileContext = false,
                                 const char *PassName = nullptr);
 
 /// Add location info to ORE message.
-void addLocationToRemarks(OptimizationRemark &Remark, DebugLoc DLoc);
+LLVM_FUNC_ABI void addLocationToRemarks(OptimizationRemark &Remark, DebugLoc DLoc);
 
 /// Set the inline-remark attribute.
-void setInlineRemark(CallBase &CB, StringRef Message);
+LLVM_FUNC_ABI void setInlineRemark(CallBase &CB, StringRef Message);
 
 /// Utility for extracting the inline cost message to a string.
-std::string inlineCostStr(const InlineCost &IC);
+LLVM_FUNC_ABI std::string inlineCostStr(const InlineCost &IC);
 } // namespace llvm
 #endif // LLVM_ANALYSIS_INLINEADVISOR_H
diff --git a/llvm/include/llvm/Analysis/InlineCost.h b/llvm/include/llvm/Analysis/InlineCost.h
index d309a58b2a6fa1d..0eabf675a86716f 100644
--- a/llvm/include/llvm/Analysis/InlineCost.h
+++ b/llvm/include/llvm/Analysis/InlineCost.h
@@ -45,7 +45,7 @@ const int OptMinSizeThreshold = 5;
 const int OptAggressiveThreshold = 250;
 
 // Various magic constants used to adjust heuristics.
-int getInstrCost();
+LLVM_FUNC_ABI int getInstrCost();
 const int IndirectCallThreshold = 100;
 const int LoopPenalty = 25;
 const int LastCallToStaticBonus = 15000;
@@ -64,7 +64,7 @@ const char MaxInlineStackSizeAttributeName[] = "inline-max-stacksize";
 } // namespace InlineConstants
 
 // The cost-benefit pair computed by cost-benefit analysis.
-class CostBenefitPair {
+class LLVM_CLASS_ABI CostBenefitPair {
 public:
   CostBenefitPair(APInt Cost, APInt Benefit) : Cost(Cost), Benefit(Benefit) {}
 
@@ -87,7 +87,7 @@ class CostBenefitPair {
 /// based on the information available for a particular callsite. They can be
 /// directly tested to determine if inlining should occur given the cost and
 /// threshold for this cost metric.
-class InlineCost {
+class LLVM_CLASS_ABI InlineCost {
   enum SentinelValues { AlwaysInlineCost = INT_MIN, NeverInlineCost = INT_MAX };
 
   /// The estimated cost of inlining this callsite.
@@ -177,7 +177,7 @@ class InlineCost {
 
 /// InlineResult is basically true or false. For false results the message
 /// describes a reason.
-class InlineResult {
+class LLVM_CLASS_ABI InlineResult {
   const char *Message = nullptr;
   InlineResult(const char *Message = nullptr) : Message(Message) {}
 
@@ -203,7 +203,7 @@ class InlineResult {
 /// (such as the pre-inliner) might have custom logic to compute \c InlineParams
 /// object.
 
-struct InlineParams {
+struct LLVM_CLASS_ABI InlineParams {
   /// The default threshold to start with for a callee.
   int DefaultThreshold = -1;
 
@@ -239,16 +239,16 @@ struct InlineParams {
   std::optional<bool> AllowRecursiveCall = false;
 };
 
-std::optional<int> getStringFnAttrAsInt(CallBase &CB, StringRef AttrKind);
+LLVM_FUNC_ABI std::optional<int> getStringFnAttrAsInt(CallBase &CB, StringRef AttrKind);
 
 /// Generate the parameters to tune the inline cost analysis based only on the
 /// commandline options.
-InlineParams getInlineParams();
+LLVM_FUNC_ABI InlineParams getInlineParams();
 
 /// Generate the parameters to tune the inline cost analysis based on command
 /// line options. If -inline-threshold option is not explicitly passed,
 /// \p Threshold is used as the default threshold.
-InlineParams getInlineParams(int Threshold);
+LLVM_FUNC_ABI InlineParams getInlineParams(int Threshold);
 
 /// Generate the parameters to tune the inline cost analysis based on command
 /// line options. If -inline-threshold option is not explicitly passed,
@@ -256,11 +256,11 @@ InlineParams getInlineParams(int Threshold);
 /// An \p OptLevel value above 3 is considered an aggressive optimization mode.
 /// \p SizeOptLevel of 1 corresponds to the -Os flag and 2 corresponds to
 /// the -Oz flag.
-InlineParams getInlineParams(unsigned OptLevel, unsigned SizeOptLevel);
+LLVM_FUNC_ABI InlineParams getInlineParams(unsigned OptLevel, unsigned SizeOptLevel);
 
 /// Return the cost associated with a callsite, including parameter passing
 /// and the call/return instruction.
-int getCallsiteCost(const CallBase &Call, const DataLayout &DL);
+LLVM_FUNC_ABI int getCallsiteCost(const CallBase &Call, const DataLayout &DL);
 
 /// Get an InlineCost object representing the cost of inlining this
 /// callsite.
@@ -273,7 +273,7 @@ int getCallsiteCost(const CallBase &Call, const DataLayout &DL);
 ///
 /// Also note that calling this function *dynamically* computes the cost of
 /// inlining the callsite. It is an expensive, heavyweight call.
-InlineCost
+LLVM_FUNC_ABI InlineCost
 getInlineCost(CallBase &Call, const InlineParams &Params,
               TargetTransformInfo &CalleeTTI,
               function_ref<AssumptionCache &(Function &)> GetAssumptionCache,
@@ -287,7 +287,7 @@ getInlineCost(CallBase &Call, const InlineParams &Params,
 /// pointer. This behaves exactly as the version with no explicit callee
 /// parameter in all other respects.
 //
-InlineCost
+LLVM_FUNC_ABI InlineCost
 getInlineCost(CallBase &Call, Function *Callee, const InlineParams &Params,
               TargetTransformInfo &CalleeTTI,
               function_ref<AssumptionCache &(Function &)> GetAssumptionCache,
@@ -302,7 +302,7 @@ getInlineCost(CallBase &Call, Function *Callee, const InlineParams &Params,
 /// directives or incompatibilities detectable without needing callee traversal.
 /// Otherwise returns std::nullopt, meaning that inlining should be decided
 /// based on other criteria (e.g. cost modeling).
-std::optional<InlineResult> getAttributeBasedInliningDecision(
+LLVM_FUNC_ABI std::optional<InlineResult> getAttributeBasedInliningDecision(
     CallBase &Call, Function *Callee, TargetTransformInfo &CalleeTTI,
     function_ref<const TargetLibraryInfo &(Function &)> GetTLI);
 
@@ -314,7 +314,7 @@ std::optional<InlineResult> getAttributeBasedInliningDecision(
 /// returns:
 /// - std::nullopt, if the inlining cannot happen (is illegal)
 /// - an integer, representing the cost.
-std::optional<int> getInliningCostEstimate(
+LLVM_FUNC_ABI std::optional<int> getInliningCostEstimate(
     CallBase &Call, TargetTransformInfo &CalleeTTI,
     function_ref<AssumptionCache &(Function &)> GetAssumptionCache,
     function_ref<BlockFrequencyInfo &(Function &)> GetBFI = nullptr,
@@ -323,7 +323,7 @@ std::optional<int> getInliningCostEstimate(
 
 /// Get the expanded cost features. The features are returned unconditionally,
 /// even if inlining is impossible.
-std::optional<InlineCostFeatures> getInliningCostFeatures(
+LLVM_FUNC_ABI std::optional<InlineCostFeatures> getInliningCostFeatures(
     CallBase &Call, TargetTransformInfo &CalleeTTI,
     function_ref<AssumptionCache &(Function &)> GetAssumptionCache,
     function_ref<BlockFrequencyInfo &(Function &)> GetBFI = nullptr,
@@ -331,12 +331,12 @@ std::optional<InlineCostFeatures> getInliningCostFeatures(
     OptimizationRemarkEmitter *ORE = nullptr);
 
 /// Minimal filter to detect invalid constructs for inlining.
-InlineResult isInlineViable(Function &Callee);
+LLVM_FUNC_ABI InlineResult isInlineViable(Function &Callee);
 
 // This pass is used to annotate instructions during the inline process for
 // debugging and analysis. The main purpose of the pass is to see and test
 // inliner's decisions when creating new optimizations to InlineCost.
-struct InlineCostAnnotationPrinterPass
+struct LLVM_CLASS_ABI InlineCostAnnotationPrinterPass
     : PassInfoMixin<InlineCostAnnotationPrinterPass> {
   raw_ostream &OS;
 
diff --git a/llvm/include/llvm/Analysis/InlineModelFeatureMaps.h b/llvm/include/llvm/Analysis/InlineModelFeatureMaps.h
index 77ae60059ce9ebd..88af0db19f2a856 100644
--- a/llvm/include/llvm/Analysis/InlineModelFeatureMaps.h
+++ b/llvm/include/llvm/Analysis/InlineModelFeatureMaps.h
@@ -144,13 +144,13 @@ inlineCostFeatureToMlFeature(InlineCostFeatureIndex Feature) {
 constexpr size_t NumberOfFeatures =
     static_cast<size_t>(FeatureIndex::NumberOfFeatures);
 
-extern const std::vector<TensorSpec> FeatureMap;
+LLVM_FUNC_ABI extern const std::vector<TensorSpec> FeatureMap;
 
-extern const char *const DecisionName;
-extern const TensorSpec InlineDecisionSpec;
-extern const char *const DefaultDecisionName;
-extern const TensorSpec DefaultDecisionSpec;
-extern const char *const RewardName;
+LLVM_FUNC_ABI extern const char *const DecisionName;
+LLVM_FUNC_ABI extern const TensorSpec InlineDecisionSpec;
+LLVM_FUNC_ABI extern const char *const DefaultDecisionName;
+LLVM_FUNC_ABI extern const TensorSpec DefaultDecisionSpec;
+LLVM_FUNC_ABI extern const char *const RewardName;
 
 using InlineFeatures = std::vector<int64_t>;
 
diff --git a/llvm/include/llvm/Analysis/InlineOrder.h b/llvm/include/llvm/Analysis/InlineOrder.h
index ed3971b5013b76c..b416fd79dad19ae 100644
--- a/llvm/include/llvm/Analysis/InlineOrder.h
+++ b/llvm/include/llvm/Analysis/InlineOrder.h
@@ -17,7 +17,7 @@
 namespace llvm {
 class CallBase;
 
-template <typename T> class InlineOrder {
+template <typename T> class LLVM_CLASS_ABI InlineOrder {
 public:
   virtual ~InlineOrder() = default;
 
@@ -32,11 +32,11 @@ template <typename T> class InlineOrder {
   bool empty() { return !size(); }
 };
 
-std::unique_ptr<InlineOrder<std::pair<CallBase *, int>>>
+LLVM_FUNC_ABI std::unique_ptr<InlineOrder<std::pair<CallBase *, int>>>
 getDefaultInlineOrder(FunctionAnalysisManager &FAM, const InlineParams &Params,
                       ModuleAnalysisManager &MAM, Module &M);
 
-std::unique_ptr<InlineOrder<std::pair<CallBase *, int>>>
+LLVM_FUNC_ABI std::unique_ptr<InlineOrder<std::pair<CallBase *, int>>>
 getInlineOrder(FunctionAnalysisManager &FAM, const InlineParams &Params,
                ModuleAnalysisManager &MAM, Module &M);
 
@@ -49,7 +49,7 @@ getInlineOrder(FunctionAnalysisManager &FAM, const InlineParams &Params,
 /// current ModuleAnalysisManager, llvm::getInlineOrder returns an
 /// InlineOrder created by the PluginInlineOrderAnalysis' Factory.
 ///
-class PluginInlineOrderAnalysis
+class LLVM_CLASS_ABI PluginInlineOrderAnalysis
     : public AnalysisInfoMixin<PluginInlineOrderAnalysis> {
 public:
   static AnalysisKey Key;
diff --git a/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h b/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h
index 4981ae646bfc5f3..4da61ae954db1a5 100644
--- a/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h
+++ b/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h
@@ -17,7 +17,7 @@ namespace llvm {
 class Function;
 
 class TFModelEvaluator;
-class InlineSizeEstimatorAnalysis
+class LLVM_CLASS_ABI InlineSizeEstimatorAnalysis
     : public AnalysisInfoMixin<InlineSizeEstimatorAnalysis> {
 public:
   InlineSizeEstimatorAnalysis();
@@ -33,7 +33,7 @@ class InlineSizeEstimatorAnalysis
   std::unique_ptr<TFModelEvaluator> Evaluator;
 };
 
-class InlineSizeEstimatorAnalysisPrinterPass
+class LLVM_CLASS_ABI InlineSizeEstimatorAnalysisPrinterPass
     : public PassInfoMixin<InlineSizeEstimatorAnalysisPrinterPass> {
   raw_ostream &OS;
 
diff --git a/llvm/include/llvm/Analysis/InstCount.h b/llvm/include/llvm/Analysis/InstCount.h
index 44cb9228f4be7fe..a31cae8cad9f989 100644
--- a/llvm/include/llvm/Analysis/InstCount.h
+++ b/llvm/include/llvm/Analysis/InstCount.h
@@ -20,7 +20,7 @@ namespace llvm {
 
 class Function;
 
-struct InstCountPass : PassInfoMixin<InstCountPass> {
+struct LLVM_CLASS_ABI InstCountPass : PassInfoMixin<InstCountPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
 };
 
diff --git a/llvm/include/llvm/Analysis/InstSimplifyFolder.h b/llvm/include/llvm/Analysis/InstSimplifyFolder.h
index f3d9d3cc13d33dd..0d9aceea73108cc 100644
--- a/llvm/include/llvm/Analysis/InstSimplifyFolder.h
+++ b/llvm/include/llvm/Analysis/InstSimplifyFolder.h
@@ -32,7 +32,7 @@ class Constant;
 /// InstSimplifyFolder - Use InstructionSimplify to fold operations to existing
 /// values. Also applies target-specific constant folding when not using
 /// InstructionSimplify.
-class InstSimplifyFolder final : public IRBuilderFolder {
+class LLVM_CLASS_ABI InstSimplifyFolder final : public IRBuilderFolder {
   TargetFolder ConstFolder;
   SimplifyQuery SQ;
 
diff --git a/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h b/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h
index f42e8799eba6c36..706ba1ce4719d6e 100644
--- a/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h
+++ b/llvm/include/llvm/Analysis/InstructionPrecedenceTracking.h
@@ -28,7 +28,7 @@ namespace llvm {
 class BasicBlock;
 class Instruction;
 
-class InstructionPrecedenceTracking {
+class LLVM_CLASS_ABI InstructionPrecedenceTracking {
   // Maps a block to the topmost special instruction in it. If the value is
   // nullptr, it means that it is known that this block does not contain any
   // special instructions.
@@ -97,7 +97,7 @@ class InstructionPrecedenceTracking {
 /// is reached, then we need to make sure that there is no implicit control flow
 /// instruction (ICFI) preceding it. For example, this check is required if we
 /// perform PRE moving non-speculable instruction to other place.
-class ImplicitControlFlowTracking : public InstructionPrecedenceTracking {
+class LLVM_CLASS_ABI ImplicitControlFlowTracking : public InstructionPrecedenceTracking {
 public:
   /// Returns the topmost instruction with implicit control flow from the given
   /// basic block. Returns nullptr if there is no such instructions in the block.
@@ -119,7 +119,7 @@ class ImplicitControlFlowTracking : public InstructionPrecedenceTracking {
   bool isSpecialInstruction(const Instruction *Insn) const override;
 };
 
-class MemoryWriteTracking : public InstructionPrecedenceTracking {
+class LLVM_CLASS_ABI MemoryWriteTracking : public InstructionPrecedenceTracking {
 public:
   /// Returns the topmost instruction that may write memory from the given
   /// basic block. Returns nullptr if there is no such instructions in the block.
diff --git a/llvm/include/llvm/Analysis/InstructionSimplify.h b/llvm/include/llvm/Analysis/InstructionSimplify.h
index aa33fb1a6e2de3e..f092a987613b4b6 100644
--- a/llvm/include/llvm/Analysis/InstructionSimplify.h
+++ b/llvm/include/llvm/Analysis/InstructionSimplify.h
@@ -56,7 +56,7 @@ class Value;
 /// InstrInfoQuery provides an interface to query additional information for
 /// instructions like metadata or keywords like nsw, which provides conservative
 /// results if the users specified it is safe to use.
-struct InstrInfoQuery {
+struct LLVM_CLASS_ABI InstrInfoQuery {
   InstrInfoQuery(bool UMD) : UseInstrInfo(UMD) {}
   InstrInfoQuery() = default;
   bool UseInstrInfo = true;
@@ -92,7 +92,7 @@ struct InstrInfoQuery {
   }
 };
 
-struct SimplifyQuery {
+struct LLVM_CLASS_ABI SimplifyQuery {
   const DataLayout &DL;
   const TargetLibraryInfo *TLI = nullptr;
   const DominatorTree *DT = nullptr;
@@ -146,51 +146,51 @@ struct SimplifyQuery {
 // Please use the SimplifyQuery versions in new code.
 
 /// Given operands for an Add, fold the result or return null.
-Value *simplifyAddInst(Value *LHS, Value *RHS, bool IsNSW, bool IsNUW,
+LLVM_FUNC_ABI Value *simplifyAddInst(Value *LHS, Value *RHS, bool IsNSW, bool IsNUW,
                        const SimplifyQuery &Q);
 
 /// Given operands for a Sub, fold the result or return null.
-Value *simplifySubInst(Value *LHS, Value *RHS, bool IsNSW, bool IsNUW,
+LLVM_FUNC_ABI Value *simplifySubInst(Value *LHS, Value *RHS, bool IsNSW, bool IsNUW,
                        const SimplifyQuery &Q);
 
 /// Given operands for a Mul, fold the result or return null.
-Value *simplifyMulInst(Value *LHS, Value *RHS, bool IsNSW, bool IsNUW,
+LLVM_FUNC_ABI Value *simplifyMulInst(Value *LHS, Value *RHS, bool IsNSW, bool IsNUW,
                        const SimplifyQuery &Q);
 
 /// Given operands for an SDiv, fold the result or return null.
-Value *simplifySDivInst(Value *LHS, Value *RHS, bool IsExact,
+LLVM_FUNC_ABI Value *simplifySDivInst(Value *LHS, Value *RHS, bool IsExact,
                         const SimplifyQuery &Q);
 
 /// Given operands for a UDiv, fold the result or return null.
-Value *simplifyUDivInst(Value *LHS, Value *RHS, bool IsExact,
+LLVM_FUNC_ABI Value *simplifyUDivInst(Value *LHS, Value *RHS, bool IsExact,
                         const SimplifyQuery &Q);
 
 /// Given operands for an SRem, fold the result or return null.
-Value *simplifySRemInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifySRemInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
 
 /// Given operands for a URem, fold the result or return null.
-Value *simplifyURemInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyURemInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
 
 /// Given operand for an FNeg, fold the result or return null.
-Value *simplifyFNegInst(Value *Op, FastMathFlags FMF, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyFNegInst(Value *Op, FastMathFlags FMF, const SimplifyQuery &Q);
 
 
 /// Given operands for an FAdd, fold the result or return null.
-Value *
+LLVM_FUNC_ABI Value *
 simplifyFAddInst(Value *LHS, Value *RHS, FastMathFlags FMF,
                  const SimplifyQuery &Q,
                  fp::ExceptionBehavior ExBehavior = fp::ebIgnore,
                  RoundingMode Rounding = RoundingMode::NearestTiesToEven);
 
 /// Given operands for an FSub, fold the result or return null.
-Value *
+LLVM_FUNC_ABI Value *
 simplifyFSubInst(Value *LHS, Value *RHS, FastMathFlags FMF,
                  const SimplifyQuery &Q,
                  fp::ExceptionBehavior ExBehavior = fp::ebIgnore,
                  RoundingMode Rounding = RoundingMode::NearestTiesToEven);
 
 /// Given operands for an FMul, fold the result or return null.
-Value *
+LLVM_FUNC_ABI Value *
 simplifyFMulInst(Value *LHS, Value *RHS, FastMathFlags FMF,
                  const SimplifyQuery &Q,
                  fp::ExceptionBehavior ExBehavior = fp::ebIgnore,
@@ -200,112 +200,112 @@ simplifyFMulInst(Value *LHS, Value *RHS, FastMathFlags FMF,
 /// null. In contrast to simplifyFMulInst, this function will not perform
 /// simplifications whose unrounded results differ when rounded to the argument
 /// type.
-Value *simplifyFMAFMul(Value *LHS, Value *RHS, FastMathFlags FMF,
+LLVM_FUNC_ABI Value *simplifyFMAFMul(Value *LHS, Value *RHS, FastMathFlags FMF,
                        const SimplifyQuery &Q,
                        fp::ExceptionBehavior ExBehavior = fp::ebIgnore,
                        RoundingMode Rounding = RoundingMode::NearestTiesToEven);
 
 /// Given operands for an FDiv, fold the result or return null.
-Value *
+LLVM_FUNC_ABI Value *
 simplifyFDivInst(Value *LHS, Value *RHS, FastMathFlags FMF,
                  const SimplifyQuery &Q,
                  fp::ExceptionBehavior ExBehavior = fp::ebIgnore,
                  RoundingMode Rounding = RoundingMode::NearestTiesToEven);
 
 /// Given operands for an FRem, fold the result or return null.
-Value *
+LLVM_FUNC_ABI Value *
 simplifyFRemInst(Value *LHS, Value *RHS, FastMathFlags FMF,
                  const SimplifyQuery &Q,
                  fp::ExceptionBehavior ExBehavior = fp::ebIgnore,
                  RoundingMode Rounding = RoundingMode::NearestTiesToEven);
 
 /// Given operands for a Shl, fold the result or return null.
-Value *simplifyShlInst(Value *Op0, Value *Op1, bool IsNSW, bool IsNUW,
+LLVM_FUNC_ABI Value *simplifyShlInst(Value *Op0, Value *Op1, bool IsNSW, bool IsNUW,
                        const SimplifyQuery &Q);
 
 /// Given operands for a LShr, fold the result or return null.
-Value *simplifyLShrInst(Value *Op0, Value *Op1, bool IsExact,
+LLVM_FUNC_ABI Value *simplifyLShrInst(Value *Op0, Value *Op1, bool IsExact,
                         const SimplifyQuery &Q);
 
 /// Given operands for a AShr, fold the result or return nulll.
-Value *simplifyAShrInst(Value *Op0, Value *Op1, bool IsExact,
+LLVM_FUNC_ABI Value *simplifyAShrInst(Value *Op0, Value *Op1, bool IsExact,
                         const SimplifyQuery &Q);
 
 /// Given operands for an And, fold the result or return null.
-Value *simplifyAndInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyAndInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
 
 /// Given operands for an Or, fold the result or return null.
-Value *simplifyOrInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyOrInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
 
 /// Given operands for an Xor, fold the result or return null.
-Value *simplifyXorInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyXorInst(Value *LHS, Value *RHS, const SimplifyQuery &Q);
 
 /// Given operands for an ICmpInst, fold the result or return null.
-Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
+LLVM_FUNC_ABI Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
                         const SimplifyQuery &Q);
 
 /// Given operands for an FCmpInst, fold the result or return null.
-Value *simplifyFCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
+LLVM_FUNC_ABI Value *simplifyFCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
                         FastMathFlags FMF, const SimplifyQuery &Q);
 
 /// Given operands for a SelectInst, fold the result or return null.
-Value *simplifySelectInst(Value *Cond, Value *TrueVal, Value *FalseVal,
+LLVM_FUNC_ABI Value *simplifySelectInst(Value *Cond, Value *TrueVal, Value *FalseVal,
                           const SimplifyQuery &Q);
 
 /// Given operands for a GetElementPtrInst, fold the result or return null.
-Value *simplifyGEPInst(Type *SrcTy, Value *Ptr, ArrayRef<Value *> Indices,
+LLVM_FUNC_ABI Value *simplifyGEPInst(Type *SrcTy, Value *Ptr, ArrayRef<Value *> Indices,
                        bool InBounds, const SimplifyQuery &Q);
 
 /// Given operands for an InsertValueInst, fold the result or return null.
-Value *simplifyInsertValueInst(Value *Agg, Value *Val, ArrayRef<unsigned> Idxs,
+LLVM_FUNC_ABI Value *simplifyInsertValueInst(Value *Agg, Value *Val, ArrayRef<unsigned> Idxs,
                                const SimplifyQuery &Q);
 
 /// Given operands for an InsertElement, fold the result or return null.
-Value *simplifyInsertElementInst(Value *Vec, Value *Elt, Value *Idx,
+LLVM_FUNC_ABI Value *simplifyInsertElementInst(Value *Vec, Value *Elt, Value *Idx,
                                  const SimplifyQuery &Q);
 
 /// Given operands for an ExtractValueInst, fold the result or return null.
-Value *simplifyExtractValueInst(Value *Agg, ArrayRef<unsigned> Idxs,
+LLVM_FUNC_ABI Value *simplifyExtractValueInst(Value *Agg, ArrayRef<unsigned> Idxs,
                                 const SimplifyQuery &Q);
 
 /// Given operands for an ExtractElementInst, fold the result or return null.
-Value *simplifyExtractElementInst(Value *Vec, Value *Idx,
+LLVM_FUNC_ABI Value *simplifyExtractElementInst(Value *Vec, Value *Idx,
                                   const SimplifyQuery &Q);
 
 /// Given operands for a CastInst, fold the result or return null.
-Value *simplifyCastInst(unsigned CastOpc, Value *Op, Type *Ty,
+LLVM_FUNC_ABI Value *simplifyCastInst(unsigned CastOpc, Value *Op, Type *Ty,
                         const SimplifyQuery &Q);
 
 /// Given operands for a ShuffleVectorInst, fold the result or return null.
 /// See class ShuffleVectorInst for a description of the mask representation.
-Value *simplifyShuffleVectorInst(Value *Op0, Value *Op1, ArrayRef<int> Mask,
+LLVM_FUNC_ABI Value *simplifyShuffleVectorInst(Value *Op0, Value *Op1, ArrayRef<int> Mask,
                                  Type *RetTy, const SimplifyQuery &Q);
 
 //=== Helper functions for higher up the class hierarchy.
 
 /// Given operands for a CmpInst, fold the result or return null.
-Value *simplifyCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
+LLVM_FUNC_ABI Value *simplifyCmpInst(unsigned Predicate, Value *LHS, Value *RHS,
                        const SimplifyQuery &Q);
 
 /// Given operand for a UnaryOperator, fold the result or return null.
-Value *simplifyUnOp(unsigned Opcode, Value *Op, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyUnOp(unsigned Opcode, Value *Op, const SimplifyQuery &Q);
 
 /// Given operand for a UnaryOperator, fold the result or return null.
 /// Try to use FastMathFlags when folding the result.
-Value *simplifyUnOp(unsigned Opcode, Value *Op, FastMathFlags FMF,
+LLVM_FUNC_ABI Value *simplifyUnOp(unsigned Opcode, Value *Op, FastMathFlags FMF,
                     const SimplifyQuery &Q);
 
 /// Given operands for a BinaryOperator, fold the result or return null.
-Value *simplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS,
+LLVM_FUNC_ABI Value *simplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS,
                      const SimplifyQuery &Q);
 
 /// Given operands for a BinaryOperator, fold the result or return null.
 /// Try to use FastMathFlags when folding the result.
-Value *simplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS, FastMathFlags FMF,
+LLVM_FUNC_ABI Value *simplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS, FastMathFlags FMF,
                      const SimplifyQuery &Q);
 
 /// Given a callsite, callee, and arguments, fold the result or return null.
-Value *simplifyCall(CallBase *Call, Value *Callee, ArrayRef<Value *> Args,
+LLVM_FUNC_ABI Value *simplifyCall(CallBase *Call, Value *Callee, ArrayRef<Value *> Args,
                     const SimplifyQuery &Q);
 
 /// Given a constrained FP intrinsic call, tries to compute its simplified
@@ -315,23 +315,23 @@ Value *simplifyCall(CallBase *Call, Value *Callee, ArrayRef<Value *> Args,
 /// simplification succeeds that the intrinsic is side effect free. As a result,
 /// successful simplification can be used to delete the intrinsic not just
 /// replace its result.
-Value *simplifyConstrainedFPCall(CallBase *Call, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyConstrainedFPCall(CallBase *Call, const SimplifyQuery &Q);
 
 /// Given an operand for a Freeze, see if we can fold the result.
 /// If not, this returns null.
-Value *simplifyFreezeInst(Value *Op, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyFreezeInst(Value *Op, const SimplifyQuery &Q);
 
 /// Given a load instruction and its pointer operand, fold the result or return
 /// null.
-Value *simplifyLoadInst(LoadInst *LI, Value *PtrOp, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyLoadInst(LoadInst *LI, Value *PtrOp, const SimplifyQuery &Q);
 
 /// See if we can compute a simplified version of this instruction. If not,
 /// return null.
-Value *simplifyInstruction(Instruction *I, const SimplifyQuery &Q);
+LLVM_FUNC_ABI Value *simplifyInstruction(Instruction *I, const SimplifyQuery &Q);
 
 /// Like \p simplifyInstruction but the operands of \p I are replaced with
 /// \p NewOps. Returns a simplified value, or null if none was found.
-Value *
+LLVM_FUNC_ABI Value *
 simplifyInstructionWithOperands(Instruction *I, ArrayRef<Value *> NewOps,
                                 const SimplifyQuery &Q);
 
@@ -340,7 +340,7 @@ simplifyInstructionWithOperands(Instruction *I, ArrayRef<Value *> NewOps,
 /// AllowRefinement specifies whether the simplification can be a refinement
 /// (e.g. 0 instead of poison), or whether it needs to be strictly identical.
 /// Op and RepOp can be assumed to not be poison when determining refinement.
-Value *simplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
+LLVM_FUNC_ABI Value *simplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
                               const SimplifyQuery &Q, bool AllowRefinement);
 
 /// Replace all uses of 'I' with 'SimpleV' and simplify the uses recursively.
@@ -352,7 +352,7 @@ Value *simplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
 /// are added to it.
 ///
 /// The function returns true if any simplifications were performed.
-bool replaceAndRecursivelySimplify(
+LLVM_FUNC_ABI bool replaceAndRecursivelySimplify(
     Instruction *I, Value *SimpleV, const TargetLibraryInfo *TLI = nullptr,
     const DominatorTree *DT = nullptr, AssumptionCache *AC = nullptr,
     SmallSetVector<Instruction *, 8> *UnsimplifiedUsers = nullptr);
@@ -360,11 +360,11 @@ bool replaceAndRecursivelySimplify(
 // These helper functions return a SimplifyQuery structure that contains as
 // many of the optional analysis we use as are currently valid.  This is the
 // strongly preferred way of constructing SimplifyQuery in passes.
-const SimplifyQuery getBestSimplifyQuery(Pass &, Function &);
+LLVM_FUNC_ABI const SimplifyQuery getBestSimplifyQuery(Pass &, Function &);
 template <class T, class... TArgs>
 const SimplifyQuery getBestSimplifyQuery(AnalysisManager<T, TArgs...> &,
                                          Function &);
-const SimplifyQuery getBestSimplifyQuery(LoopStandardAnalysisResults &,
+LLVM_FUNC_ABI const SimplifyQuery getBestSimplifyQuery(LoopStandardAnalysisResults &,
                                          const DataLayout &);
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/InteractiveModelRunner.h b/llvm/include/llvm/Analysis/InteractiveModelRunner.h
index 71346d188fd126c..178da48a12d7424 100644
--- a/llvm/include/llvm/Analysis/InteractiveModelRunner.h
+++ b/llvm/include/llvm/Analysis/InteractiveModelRunner.h
@@ -39,7 +39,7 @@ namespace llvm {
 /// the compiler - i.e. the "Inbound" - and then the "Outbound", to avoid
 /// deadlock. This is because the compiler first tries to open the inbound
 /// (which will hang until there's a writer on the other end).
-class InteractiveModelRunner : public MLModelRunner {
+class LLVM_CLASS_ABI InteractiveModelRunner : public MLModelRunner {
 public:
   InteractiveModelRunner(LLVMContext &Ctx,
                          const std::vector<TensorSpec> &Inputs,
diff --git a/llvm/include/llvm/Analysis/Interval.h b/llvm/include/llvm/Analysis/Interval.h
index 9cfcd32f949fdc8..9108117b7b14380 100644
--- a/llvm/include/llvm/Analysis/Interval.h
+++ b/llvm/include/llvm/Analysis/Interval.h
@@ -34,7 +34,7 @@ class raw_ostream;
 /// in the interval has all of its predecessors in the interval (except for the
 /// header)
 ///
-class Interval {
+class LLVM_CLASS_ABI Interval {
   /// HeaderNode - The header BasicBlock, which dominates all BasicBlocks in this
   /// interval.  Also, any loops in this interval must go through the HeaderNode.
   ///
@@ -114,7 +114,7 @@ inline Interval::pred_iterator pred_end(Interval *I)   {
   return I->Predecessors.end();
 }
 
-template <> struct GraphTraits<Interval*> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Interval*> {
   using NodeRef = Interval *;
   using ChildIteratorType = Interval::succ_iterator;
 
@@ -125,7 +125,7 @@ template <> struct GraphTraits<Interval*> {
   static ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
 };
 
-template <> struct GraphTraits<Inverse<Interval*>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<Interval*>> {
   using NodeRef = Interval *;
   using ChildIteratorType = Interval::pred_iterator;
 
diff --git a/llvm/include/llvm/Analysis/IntervalIterator.h b/llvm/include/llvm/Analysis/IntervalIterator.h
index 4ce3c28f4fa6c55..83b557957a6bb52 100644
--- a/llvm/include/llvm/Analysis/IntervalIterator.h
+++ b/llvm/include/llvm/Analysis/IntervalIterator.h
@@ -86,7 +86,7 @@ inline void addNodeToInterval(Interval *Int, Interval *I) {
 
 template<class NodeTy, class OrigContainer_t, class GT = GraphTraits<NodeTy *>,
          class IGT = GraphTraits<Inverse<NodeTy *>>>
-class IntervalIterator {
+class LLVM_CLASS_ABI IntervalIterator {
   std::vector<std::pair<Interval *, typename Interval::succ_iterator>> IntStack;
   std::set<BasicBlock *> Visited;
   OrigContainer_t *OrigContainer;
diff --git a/llvm/include/llvm/Analysis/IntervalPartition.h b/llvm/include/llvm/Analysis/IntervalPartition.h
index 16bdfb945dc6f9d..5cdf2061ef1644f 100644
--- a/llvm/include/llvm/Analysis/IntervalPartition.h
+++ b/llvm/include/llvm/Analysis/IntervalPartition.h
@@ -40,7 +40,7 @@ class Interval;
 // interval is a (possibly nonexistent) loop with a "tail" of non-looping
 // nodes following it.
 //
-class IntervalPartition : public FunctionPass {
+class LLVM_CLASS_ABI IntervalPartition : public FunctionPass {
   using IntervalMapTy = std::map<BasicBlock *, Interval *>;
   IntervalMapTy IntervalMap;
 
diff --git a/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h b/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h
index a313bdf87654eba..e26d563138a107e 100644
--- a/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h
+++ b/llvm/include/llvm/Analysis/IteratedDominanceFrontier.h
@@ -20,7 +20,7 @@ class BasicBlock;
 namespace IDFCalculatorDetail {
 
 /// Specialization for BasicBlock for the optional use of GraphDiff.
-template <bool IsPostDom> struct ChildrenGetterTy<BasicBlock, IsPostDom> {
+template <bool IsPostDom> struct LLVM_CLASS_ABI ChildrenGetterTy<BasicBlock, IsPostDom> {
   using NodeRef = BasicBlock *;
   using ChildrenTy = SmallVector<BasicBlock *, 8>;
 
@@ -37,7 +37,7 @@ template <bool IsPostDom> struct ChildrenGetterTy<BasicBlock, IsPostDom> {
 } // end of namespace IDFCalculatorDetail
 
 template <bool IsPostDom>
-class IDFCalculator final : public IDFCalculatorBase<BasicBlock, IsPostDom> {
+class LLVM_CLASS_ABI IDFCalculator final : public IDFCalculatorBase<BasicBlock, IsPostDom> {
 public:
   using IDFCalculatorBase =
       typename llvm::IDFCalculatorBase<BasicBlock, IsPostDom>;
diff --git a/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h b/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h
index 86cba8a54bea7b9..bbfd610aa8cc3a8 100644
--- a/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h
+++ b/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h
@@ -32,7 +32,7 @@ class LoopInfo;
 /// analysis without paying for the overhead if BFI doesn't end up being used.
 template <typename FunctionT, typename BranchProbabilityInfoPassT,
           typename LoopInfoT, typename BlockFrequencyInfoT>
-class LazyBlockFrequencyInfo {
+class LLVM_CLASS_ABI LazyBlockFrequencyInfo {
 public:
   LazyBlockFrequencyInfo() = default;
 
@@ -96,7 +96,7 @@ class LazyBlockFrequencyInfo {
 /// Note that it is expected that we wouldn't need this functionality for the
 /// new PM since with the new PM, analyses are executed on demand.
 
-class LazyBlockFrequencyInfoPass : public FunctionPass {
+class LLVM_CLASS_ABI LazyBlockFrequencyInfoPass : public FunctionPass {
 private:
   LazyBlockFrequencyInfo<Function, LazyBranchProbabilityInfoPass, LoopInfo,
                          BlockFrequencyInfo>
@@ -125,6 +125,6 @@ class LazyBlockFrequencyInfoPass : public FunctionPass {
 };
 
 /// Helper for client passes to initialize dependent passes for LBFI.
-void initializeLazyBFIPassPass(PassRegistry &Registry);
+LLVM_FUNC_ABI void initializeLazyBFIPassPass(PassRegistry &Registry);
 }
 #endif
diff --git a/llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h b/llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h
index 4083389dbcf6cd1..64f8033824105f0 100644
--- a/llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h
+++ b/llvm/include/llvm/Analysis/LazyBranchProbabilityInfo.h
@@ -48,7 +48,7 @@ class TargetLibraryInfo;
 ///
 /// Note that it is expected that we wouldn't need this functionality for the
 /// new PM since with the new PM, analyses are executed on demand.
-class LazyBranchProbabilityInfoPass : public FunctionPass {
+class LLVM_CLASS_ABI LazyBranchProbabilityInfoPass : public FunctionPass {
 
   /// Wraps a BPI to allow lazy computation of the branch probabilities.
   ///
@@ -107,15 +107,15 @@ class LazyBranchProbabilityInfoPass : public FunctionPass {
 };
 
 /// Helper for client passes to initialize dependent passes for LBPI.
-void initializeLazyBPIPassPass(PassRegistry &Registry);
+LLVM_FUNC_ABI void initializeLazyBPIPassPass(PassRegistry &Registry);
 
 /// Simple trait class that provides a mapping between BPI passes and the
 /// corresponding BPInfo.
-template <typename PassT> struct BPIPassTrait {
+template <typename PassT> struct LLVM_CLASS_ABI BPIPassTrait {
   static PassT &getBPI(PassT *P) { return *P; }
 };
 
-template <> struct BPIPassTrait<LazyBranchProbabilityInfoPass> {
+template <> struct LLVM_CLASS_ABI BPIPassTrait<LazyBranchProbabilityInfoPass> {
   static BranchProbabilityInfo &getBPI(LazyBranchProbabilityInfoPass *P) {
     return P->getBPI();
   }
diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h
index a51b169547d057c..78d35a6b2b673e5 100644
--- a/llvm/include/llvm/Analysis/LazyCallGraph.h
+++ b/llvm/include/llvm/Analysis/LazyCallGraph.h
@@ -108,7 +108,7 @@ class Value;
 /// FIXME: This class is named LazyCallGraph in a lame attempt to distinguish
 /// it from the existing CallGraph. At some point, it is expected that this
 /// will be the only call graph and it will be renamed accordingly.
-class LazyCallGraph {
+class LLVM_CLASS_ABI LazyCallGraph {
 public:
   class Node;
   class EdgeSequence;
@@ -1237,7 +1237,7 @@ inline Function &LazyCallGraph::Edge::getFunction() const {
 }
 
 // Provide GraphTraits specializations for call graphs.
-template <> struct GraphTraits<LazyCallGraph::Node *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<LazyCallGraph::Node *> {
   using NodeRef = LazyCallGraph::Node *;
   using ChildIteratorType = LazyCallGraph::EdgeSequence::iterator;
 
@@ -1245,7 +1245,7 @@ template <> struct GraphTraits<LazyCallGraph::Node *> {
   static ChildIteratorType child_begin(NodeRef N) { return (*N)->begin(); }
   static ChildIteratorType child_end(NodeRef N) { return (*N)->end(); }
 };
-template <> struct GraphTraits<LazyCallGraph *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<LazyCallGraph *> {
   using NodeRef = LazyCallGraph::Node *;
   using ChildIteratorType = LazyCallGraph::EdgeSequence::iterator;
 
@@ -1255,7 +1255,7 @@ template <> struct GraphTraits<LazyCallGraph *> {
 };
 
 /// An analysis pass which computes the call graph for a module.
-class LazyCallGraphAnalysis : public AnalysisInfoMixin<LazyCallGraphAnalysis> {
+class LLVM_CLASS_ABI LazyCallGraphAnalysis : public AnalysisInfoMixin<LazyCallGraphAnalysis> {
   friend AnalysisInfoMixin<LazyCallGraphAnalysis>;
 
   static AnalysisKey Key;
@@ -1281,7 +1281,7 @@ class LazyCallGraphAnalysis : public AnalysisInfoMixin<LazyCallGraphAnalysis> {
 /// A pass which prints the call graph to a \c raw_ostream.
 ///
 /// This is primarily useful for testing the analysis.
-class LazyCallGraphPrinterPass
+class LLVM_CLASS_ABI LazyCallGraphPrinterPass
     : public PassInfoMixin<LazyCallGraphPrinterPass> {
   raw_ostream &OS;
 
@@ -1294,7 +1294,7 @@ class LazyCallGraphPrinterPass
 /// A pass which prints the call graph as a DOT file to a \c raw_ostream.
 ///
 /// This is primarily useful for visualization purposes.
-class LazyCallGraphDOTPrinterPass
+class LLVM_CLASS_ABI LazyCallGraphDOTPrinterPass
     : public PassInfoMixin<LazyCallGraphDOTPrinterPass> {
   raw_ostream &OS;
 
diff --git a/llvm/include/llvm/Analysis/LazyValueInfo.h b/llvm/include/llvm/Analysis/LazyValueInfo.h
index 6125b26f8be0728..e9b36cc5cbdbeb3 100644
--- a/llvm/include/llvm/Analysis/LazyValueInfo.h
+++ b/llvm/include/llvm/Analysis/LazyValueInfo.h
@@ -29,7 +29,7 @@ namespace llvm {
   class Value;
 
 /// This pass computes, caches, and vends lazy value constraint information.
-class LazyValueInfo {
+class LLVM_CLASS_ABI LazyValueInfo {
   friend class LazyValueInfoWrapperPass;
   AssumptionCache *AC = nullptr;
   const DataLayout *DL = nullptr;
@@ -136,7 +136,7 @@ class LazyValueInfo {
 };
 
 /// Analysis to compute lazy value information.
-class LazyValueAnalysis : public AnalysisInfoMixin<LazyValueAnalysis> {
+class LLVM_CLASS_ABI LazyValueAnalysis : public AnalysisInfoMixin<LazyValueAnalysis> {
 public:
   typedef LazyValueInfo Result;
   Result run(Function &F, FunctionAnalysisManager &FAM);
@@ -147,7 +147,7 @@ class LazyValueAnalysis : public AnalysisInfoMixin<LazyValueAnalysis> {
 };
 
 /// Wrapper around LazyValueInfo.
-class LazyValueInfoWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI LazyValueInfoWrapperPass : public FunctionPass {
   LazyValueInfoWrapperPass(const LazyValueInfoWrapperPass&) = delete;
   void operator=(const LazyValueInfoWrapperPass&) = delete;
 public:
diff --git a/llvm/include/llvm/Analysis/Lint.h b/llvm/include/llvm/Analysis/Lint.h
index bd26851ed9a77c3..996db64117b72df 100644
--- a/llvm/include/llvm/Analysis/Lint.h
+++ b/llvm/include/llvm/Analysis/Lint.h
@@ -30,12 +30,12 @@ class Function;
 ///
 /// This should only be used for debugging, because it plays games with
 /// PassManagers and stuff.
-void lintModule(const Module &M);
+LLVM_FUNC_ABI void lintModule(const Module &M);
 
 // Lint a function.
-void lintFunction(const Function &F);
+LLVM_FUNC_ABI void lintFunction(const Function &F);
 
-class LintPass : public PassInfoMixin<LintPass> {
+class LLVM_CLASS_ABI LintPass : public PassInfoMixin<LintPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Analysis/Loads.h b/llvm/include/llvm/Analysis/Loads.h
index 8520ca0afc3a76d..bbccba6a4a63cbc 100644
--- a/llvm/include/llvm/Analysis/Loads.h
+++ b/llvm/include/llvm/Analysis/Loads.h
@@ -33,7 +33,7 @@ class TargetLibraryInfo;
 /// Return true if this is always a dereferenceable pointer. If the context
 /// instruction is specified perform context-sensitive analysis and return true
 /// if the pointer is dereferenceable at the specified instruction.
-bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL,
+LLVM_FUNC_ABI bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL,
                               const Instruction *CtxI = nullptr,
                               AssumptionCache *AC = nullptr,
                               const DominatorTree *DT = nullptr,
@@ -43,7 +43,7 @@ bool isDereferenceablePointer(const Value *V, Type *Ty, const DataLayout &DL,
 /// greater or equal than requested. If the context instruction is specified
 /// performs context-sensitive analysis and returns true if the pointer is
 /// dereferenceable at the specified instruction.
-bool isDereferenceableAndAlignedPointer(const Value *V, Type *Ty,
+LLVM_FUNC_ABI bool isDereferenceableAndAlignedPointer(const Value *V, Type *Ty,
                                         Align Alignment, const DataLayout &DL,
                                         const Instruction *CtxI = nullptr,
                                         AssumptionCache *AC = nullptr,
@@ -54,7 +54,7 @@ bool isDereferenceableAndAlignedPointer(const Value *V, Type *Ty,
 /// greater or equal than requested. If the context instruction is specified
 /// performs context-sensitive analysis and returns true if the pointer is
 /// dereferenceable at the specified instruction.
-bool isDereferenceableAndAlignedPointer(const Value *V, Align Alignment,
+LLVM_FUNC_ABI bool isDereferenceableAndAlignedPointer(const Value *V, Align Alignment,
                                         const APInt &Size, const DataLayout &DL,
                                         const Instruction *CtxI = nullptr,
                                         AssumptionCache *AC = nullptr,
@@ -69,7 +69,7 @@ bool isDereferenceableAndAlignedPointer(const Value *V, Align Alignment,
 /// If it is not obviously safe to load from the specified pointer, we do a
 /// quick local scan of the basic block containing ScanFrom, to determine if
 /// the address is already accessed.
-bool isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size,
+LLVM_FUNC_ABI bool isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size,
                                  const DataLayout &DL,
                                  Instruction *ScanFrom = nullptr,
                                  AssumptionCache *AC = nullptr,
@@ -83,7 +83,7 @@ bool isSafeToLoadUnconditionally(Value *V, Align Alignment, APInt &Size,
 /// that required by the header itself and could be hoisted into the header
 /// if desired.)  This is more powerful than the variants above when the
 /// address loaded from is analyzeable by SCEV.
-bool isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L,
+LLVM_FUNC_ABI bool isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L,
                                        ScalarEvolution &SE, DominatorTree &DT,
                                        AssumptionCache *AC = nullptr);
 
@@ -95,7 +95,7 @@ bool isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L,
 /// If it is not obviously safe to load from the specified pointer, we do a
 /// quick local scan of the basic block containing ScanFrom, to determine if
 /// the address is already accessed.
-bool isSafeToLoadUnconditionally(Value *V, Type *Ty, Align Alignment,
+LLVM_FUNC_ABI bool isSafeToLoadUnconditionally(Value *V, Type *Ty, Align Alignment,
                                  const DataLayout &DL,
                                  Instruction *ScanFrom = nullptr,
                                  AssumptionCache *AC = nullptr,
@@ -104,7 +104,7 @@ bool isSafeToLoadUnconditionally(Value *V, Type *Ty, Align Alignment,
 
 /// The default number of maximum instructions to scan in the block, used by
 /// FindAvailableLoadedValue().
-extern cl::opt<unsigned> DefMaxInstsToScan;
+LLVM_FUNC_ABI extern cl::opt<unsigned> DefMaxInstsToScan;
 
 /// Scan backwards to see if we have the value of the given load available
 /// locally within a small number of instructions.
@@ -130,7 +130,7 @@ extern cl::opt<unsigned> DefMaxInstsToScan;
 /// location in memory, as opposed to the value operand of a store.
 ///
 /// \returns The found value, or nullptr if no value is found.
-Value *FindAvailableLoadedValue(LoadInst *Load,
+LLVM_FUNC_ABI Value *FindAvailableLoadedValue(LoadInst *Load,
                                 BasicBlock *ScanBB,
                                 BasicBlock::iterator &ScanFrom,
                                 unsigned MaxInstsToScan = DefMaxInstsToScan,
@@ -142,7 +142,7 @@ Value *FindAvailableLoadedValue(LoadInst *Load,
 /// FindAvailableLoadedValue() for the case where we are not interested in
 /// finding the closest clobbering instruction if no available load is found.
 /// This overload cannot be used to scan across multiple blocks.
-Value *FindAvailableLoadedValue(LoadInst *Load, AAResults &AA, bool *IsLoadCSE,
+LLVM_FUNC_ABI Value *FindAvailableLoadedValue(LoadInst *Load, AAResults &AA, bool *IsLoadCSE,
                                 unsigned MaxInstsToScan = DefMaxInstsToScan);
 
 /// Scan backwards to see if we have the value of the given pointer available
@@ -168,7 +168,7 @@ Value *FindAvailableLoadedValue(LoadInst *Load, AAResults &AA, bool *IsLoadCSE,
 /// location in memory, as opposed to the value operand of a store.
 ///
 /// \returns The found value, or nullptr if no value is found.
-Value *findAvailablePtrLoadStore(const MemoryLocation &Loc, Type *AccessTy,
+LLVM_FUNC_ABI Value *findAvailablePtrLoadStore(const MemoryLocation &Loc, Type *AccessTy,
                                  bool AtLeastAtomic, BasicBlock *ScanBB,
                                  BasicBlock::iterator &ScanFrom,
                                  unsigned MaxInstsToScan, AAResults *AA,
@@ -180,7 +180,7 @@ Value *findAvailablePtrLoadStore(const MemoryLocation &Loc, Type *AccessTy,
 /// NOTE: the current implementations is incomplete and unsound. It does not
 /// reject all invalid cases yet, but will be made stricter in the future. In
 /// particular this means returning true means unknown if replacement is safe.
-bool canReplacePointersIfEqual(Value *A, Value *B, const DataLayout &DL,
+LLVM_FUNC_ABI bool canReplacePointersIfEqual(Value *A, Value *B, const DataLayout &DL,
                                Instruction *CtxI);
 }
 
diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
index 6694724273e18f5..b3c62f8f90d7dc0 100644
--- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
@@ -35,7 +35,7 @@ class Value;
 
 /// Collection of parameters shared beetween the Loop Vectorizer and the
 /// Loop Access Analysis.
-struct VectorizerParams {
+struct LLVM_CLASS_ABI VectorizerParams {
   /// Maximum SIMD width.
   static const unsigned MaxVectorWidth;
 
@@ -85,7 +85,7 @@ struct VectorizerParams {
 ///
 ///  * Zero distances and all accesses have the same size.
 ///
-class MemoryDepChecker {
+class LLVM_CLASS_ABI MemoryDepChecker {
 public:
   typedef PointerIntPair<Value *, 1, bool> MemAccessInfo;
   typedef SmallVector<MemAccessInfo, 8> MemAccessInfoList;
@@ -335,7 +335,7 @@ class MemoryDepChecker {
 class RuntimePointerChecking;
 /// A grouping of pointers. A single memcheck is required between
 /// two groups.
-struct RuntimeCheckingPtrGroup {
+struct LLVM_CLASS_ABI RuntimeCheckingPtrGroup {
   /// Create a new pointer checking group containing a single
   /// pointer, with index \p Index in RtCheck.
   RuntimeCheckingPtrGroup(unsigned Index, RuntimePointerChecking &RtCheck);
@@ -369,7 +369,7 @@ typedef std::pair<const RuntimeCheckingPtrGroup *,
                   const RuntimeCheckingPtrGroup *>
     RuntimePointerCheck;
 
-struct PointerDiffInfo {
+struct LLVM_CLASS_ABI PointerDiffInfo {
   const SCEV *SrcStart;
   const SCEV *SinkStart;
   unsigned AccessSize;
@@ -383,7 +383,7 @@ struct PointerDiffInfo {
 
 /// Holds information about the memory runtime legality checks to verify
 /// that a group of pointers do not overlap.
-class RuntimePointerChecking {
+class LLVM_CLASS_ABI RuntimePointerChecking {
   friend struct RuntimeCheckingPtrGroup;
 
 public:
@@ -560,7 +560,7 @@ class RuntimePointerChecking {
 ///
 /// Checks for both memory dependences and the SCEV predicates contained in the
 /// PSE must be emitted in order for the results of this analysis to be valid.
-class LoopAccessInfo {
+class LLVM_CLASS_ABI LoopAccessInfo {
 public:
   LoopAccessInfo(Loop *L, ScalarEvolution *SE, const TargetLibraryInfo *TLI,
                  AAResults *AA, DominatorTree *DT, LoopInfo *LI);
@@ -711,7 +711,7 @@ class LoopAccessInfo {
 ///
 /// \p PtrToStride provides the mapping between the pointer value and its
 /// stride as collected by LoopVectorizationLegality::collectStridedAccess.
-const SCEV *
+LLVM_FUNC_ABI const SCEV *
 replaceSymbolicStrideSCEV(PredicatedScalarEvolution &PSE,
                           const DenseMap<Value *, const SCEV *> &PtrToStride,
                           Value *Ptr);
@@ -730,7 +730,7 @@ replaceSymbolicStrideSCEV(PredicatedScalarEvolution &PSE,
 /// Note that the analysis results are defined if-and-only-if the original
 /// memory access was defined.  If that access was dead, or UB, then the
 /// result of this function is undefined.
-std::optional<int64_t>
+LLVM_FUNC_ABI std::optional<int64_t>
 getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, Value *Ptr,
              const Loop *Lp,
              const DenseMap<Value *, const SCEV *> &StridesMap = DenseMap<Value *, const SCEV *>(),
@@ -741,7 +741,7 @@ getPtrStride(PredicatedScalarEvolution &PSE, Type *AccessTy, Value *Ptr,
 /// is a simple API that does not depend on the analysis pass.
 /// \param StrictCheck Ensure that the calculated distance matches the
 /// type-based one after all the bitcasts removal in the provided pointers.
-std::optional<int> getPointersDiff(Type *ElemTyA, Value *PtrA, Type *ElemTyB,
+LLVM_FUNC_ABI std::optional<int> getPointersDiff(Type *ElemTyA, Value *PtrA, Type *ElemTyB,
                                    Value *PtrB, const DataLayout &DL,
                                    ScalarEvolution &SE,
                                    bool StrictCheck = false,
@@ -757,16 +757,16 @@ std::optional<int> getPointersDiff(Type *ElemTyA, Value *PtrA, Type *ElemTyB,
 /// sorted indices in \p SortedIndices as a[i+0], a[i+1], a[i+4], a[i+7] and
 /// saves the mask for actual memory accesses in program order in
 /// \p SortedIndices as <1,2,0,3>
-bool sortPtrAccesses(ArrayRef<Value *> VL, Type *ElemTy, const DataLayout &DL,
+LLVM_FUNC_ABI bool sortPtrAccesses(ArrayRef<Value *> VL, Type *ElemTy, const DataLayout &DL,
                      ScalarEvolution &SE,
                      SmallVectorImpl<unsigned> &SortedIndices);
 
 /// Returns true if the memory operations \p A and \p B are consecutive.
 /// This is a simple API that does not depend on the analysis pass.
-bool isConsecutiveAccess(Value *A, Value *B, const DataLayout &DL,
+LLVM_FUNC_ABI bool isConsecutiveAccess(Value *A, Value *B, const DataLayout &DL,
                          ScalarEvolution &SE, bool CheckType = true);
 
-class LoopAccessInfoManager {
+class LLVM_CLASS_ABI LoopAccessInfoManager {
   /// The cache.
   DenseMap<Loop *, std::unique_ptr<LoopAccessInfo>> LoopAccessInfoMap;
 
@@ -797,7 +797,7 @@ class LoopAccessInfoManager {
 /// querying the loop access info via AM.getResult<LoopAccessAnalysis>.
 /// getResult return a LoopAccessInfo object.  See this class for the
 /// specifics of what information is provided.
-class LoopAccessAnalysis
+class LLVM_CLASS_ABI LoopAccessAnalysis
     : public AnalysisInfoMixin<LoopAccessAnalysis> {
   friend AnalysisInfoMixin<LoopAccessAnalysis>;
   static AnalysisKey Key;
diff --git a/llvm/include/llvm/Analysis/LoopAnalysisManager.h b/llvm/include/llvm/Analysis/LoopAnalysisManager.h
index a039e9143a2510c..220d9895549f656 100644
--- a/llvm/include/llvm/Analysis/LoopAnalysisManager.h
+++ b/llvm/include/llvm/Analysis/LoopAnalysisManager.h
@@ -49,7 +49,7 @@ class TargetTransformInfo;
 /// makes them available to the loop passes "for free". Each loop pass is
 /// expected to update these analyses if necessary to ensure they're
 /// valid after it runs.
-struct LoopStandardAnalysisResults {
+struct LLVM_CLASS_ABI LoopStandardAnalysisResults {
   AAResults &AA;
   AssumptionCache &AC;
   DominatorTree &DT;
@@ -157,7 +157,7 @@ typedef OuterAnalysisManagerProxy<FunctionAnalysisManager, Loop,
     FunctionAnalysisManagerLoopProxy;
 
 /// Returns the minimum set of Analyses that all loop passes must preserve.
-PreservedAnalyses getLoopPassPreservedAnalyses();
+LLVM_FUNC_ABI PreservedAnalyses getLoopPassPreservedAnalyses();
 }
 
 #endif // LLVM_ANALYSIS_LOOPANALYSISMANAGER_H
diff --git a/llvm/include/llvm/Analysis/LoopCacheAnalysis.h b/llvm/include/llvm/Analysis/LoopCacheAnalysis.h
index b2a7c6808f98d9c..fdee939508f42d7 100644
--- a/llvm/include/llvm/Analysis/LoopCacheAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopCacheAnalysis.h
@@ -46,8 +46,8 @@ using LoopVectorTy = SmallVector<Loop *, 8>;
 ///   BasePointer -> A
 ///   Subscripts -> [{0,+,1}<%for.i>][{1,+,2}<%for.j>][{2,+,3}<%for.k>]
 ///   Sizes -> [m][o][4]
-class IndexedReference {
-  friend raw_ostream &operator<<(raw_ostream &OS, const IndexedReference &R);
+class LLVM_CLASS_ABI IndexedReference {
+  friend LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const IndexedReference &R);
 
 public:
   /// Construct an indexed reference given a \p StoreOrLoadInst instruction.
@@ -187,8 +187,8 @@ using ReferenceGroupsTy = SmallVector<ReferenceGroupTy, 8>;
 ///    other subscripts is zero (e.g. RefCost = TripCount/(CLS/RefStride))
 ///  - equal to the innermost loop trip count if the reference stride is greater
 ///    or equal to the cache line size CLS.
-class CacheCost {
-  friend raw_ostream &operator<<(raw_ostream &OS, const CacheCost &CC);
+class LLVM_CLASS_ABI CacheCost {
+  friend LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const CacheCost &CC);
   using LoopTripCountTy = std::pair<const Loop *, unsigned>;
   using LoopCacheCostTy = std::pair<const Loop *, CacheCostTy>;
 
@@ -280,11 +280,11 @@ class CacheCost {
   DependenceInfo &DI;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const IndexedReference &R);
-raw_ostream &operator<<(raw_ostream &OS, const CacheCost &CC);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const IndexedReference &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const CacheCost &CC);
 
 /// Printer pass for the \c CacheCost results.
-class LoopCachePrinterPass : public PassInfoMixin<LoopCachePrinterPass> {
+class LLVM_CLASS_ABI LoopCachePrinterPass : public PassInfoMixin<LoopCachePrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h
index 52ed6bea3ea40ba..38e17315585d5ac 100644
--- a/llvm/include/llvm/Analysis/LoopInfo.h
+++ b/llvm/include/llvm/Analysis/LoopInfo.h
@@ -408,7 +408,7 @@ class LLVM_EXTERNAL_VISIBILITY Loop : public LoopBase<BasicBlock, Loop> {
 // Implementation in Support/GenericLoopInfoImpl.h
 extern template class LoopInfoBase<BasicBlock, Loop>;
 
-class LoopInfo : public LoopInfoBase<BasicBlock, Loop> {
+class LLVM_CLASS_ABI LoopInfo : public LoopInfoBase<BasicBlock, Loop> {
   typedef LoopInfoBase<BasicBlock, Loop> BaseT;
 
   friend class LoopBase<BasicBlock, Loop>;
@@ -545,10 +545,10 @@ class LoopInfo : public LoopInfoBase<BasicBlock, Loop> {
 /// The flag enables checks which are expensive and are disabled by default
 /// unless the `EXPENSIVE_CHECKS` macro is defined.  The `-verify-loop-info`
 /// flag allows the checks to be enabled selectively without re-compilation.
-extern bool VerifyLoopInfo;
+LLVM_FUNC_ABI extern bool VerifyLoopInfo;
 
 // Allow clients to walk the list of nested loops...
-template <> struct GraphTraits<const Loop *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<const Loop *> {
   typedef const Loop *NodeRef;
   typedef LoopInfo::iterator ChildIteratorType;
 
@@ -557,7 +557,7 @@ template <> struct GraphTraits<const Loop *> {
   static ChildIteratorType child_end(NodeRef N) { return N->end(); }
 };
 
-template <> struct GraphTraits<Loop *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Loop *> {
   typedef Loop *NodeRef;
   typedef LoopInfo::iterator ChildIteratorType;
 
@@ -567,7 +567,7 @@ template <> struct GraphTraits<Loop *> {
 };
 
 /// Analysis pass that exposes the \c LoopInfo for a function.
-class LoopAnalysis : public AnalysisInfoMixin<LoopAnalysis> {
+class LLVM_CLASS_ABI LoopAnalysis : public AnalysisInfoMixin<LoopAnalysis> {
   friend AnalysisInfoMixin<LoopAnalysis>;
   static AnalysisKey Key;
 
@@ -578,7 +578,7 @@ class LoopAnalysis : public AnalysisInfoMixin<LoopAnalysis> {
 };
 
 /// Printer pass for the \c LoopAnalysis results.
-class LoopPrinterPass : public PassInfoMixin<LoopPrinterPass> {
+class LLVM_CLASS_ABI LoopPrinterPass : public PassInfoMixin<LoopPrinterPass> {
   raw_ostream &OS;
 
 public:
@@ -587,12 +587,12 @@ class LoopPrinterPass : public PassInfoMixin<LoopPrinterPass> {
 };
 
 /// Verifier pass for the \c LoopAnalysis results.
-struct LoopVerifierPass : public PassInfoMixin<LoopVerifierPass> {
+struct LLVM_CLASS_ABI LoopVerifierPass : public PassInfoMixin<LoopVerifierPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
 /// The legacy pass manager's analysis pass to compute loop information.
-class LoopInfoWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI LoopInfoWrapperPass : public FunctionPass {
   LoopInfo LI;
 
 public:
@@ -616,53 +616,53 @@ class LoopInfoWrapperPass : public FunctionPass {
 };
 
 /// Function to print a loop's contents as LLVM's text IR assembly.
-void printLoop(Loop &L, raw_ostream &OS, const std::string &Banner = "");
+LLVM_FUNC_ABI void printLoop(Loop &L, raw_ostream &OS, const std::string &Banner = "");
 
 /// Find and return the loop attribute node for the attribute @p Name in
 /// @p LoopID. Return nullptr if there is no such attribute.
-MDNode *findOptionMDForLoopID(MDNode *LoopID, StringRef Name);
+LLVM_FUNC_ABI MDNode *findOptionMDForLoopID(MDNode *LoopID, StringRef Name);
 
 /// Find string metadata for a loop.
 ///
 /// Returns the MDNode where the first operand is the metadata's name. The
 /// following operands are the metadata's values. If no metadata with @p Name is
 /// found, return nullptr.
-MDNode *findOptionMDForLoop(const Loop *TheLoop, StringRef Name);
+LLVM_FUNC_ABI MDNode *findOptionMDForLoop(const Loop *TheLoop, StringRef Name);
 
-std::optional<bool> getOptionalBoolLoopAttribute(const Loop *TheLoop,
+LLVM_FUNC_ABI std::optional<bool> getOptionalBoolLoopAttribute(const Loop *TheLoop,
                                                  StringRef Name);
 
 /// Returns true if Name is applied to TheLoop and enabled.
-bool getBooleanLoopAttribute(const Loop *TheLoop, StringRef Name);
+LLVM_FUNC_ABI bool getBooleanLoopAttribute(const Loop *TheLoop, StringRef Name);
 
 /// Find named metadata for a loop with an integer value.
-std::optional<int> getOptionalIntLoopAttribute(const Loop *TheLoop,
+LLVM_FUNC_ABI std::optional<int> getOptionalIntLoopAttribute(const Loop *TheLoop,
                                                StringRef Name);
 
 /// Find named metadata for a loop with an integer value. Return \p Default if
 /// not set.
-int getIntLoopAttribute(const Loop *TheLoop, StringRef Name, int Default = 0);
+LLVM_FUNC_ABI int getIntLoopAttribute(const Loop *TheLoop, StringRef Name, int Default = 0);
 
 /// Find string metadata for loop
 ///
 /// If it has a value (e.g. {"llvm.distribute", 1} return the value as an
 /// operand or null otherwise.  If the string metadata is not found return
 /// Optional's not-a-value.
-std::optional<const MDOperand *> findStringMetadataForLoop(const Loop *TheLoop,
+LLVM_FUNC_ABI std::optional<const MDOperand *> findStringMetadataForLoop(const Loop *TheLoop,
                                                            StringRef Name);
 
 /// Look for the loop attribute that requires progress within the loop.
 /// Note: Most consumers probably want "isMustProgress" which checks
 /// the containing function attribute too.
-bool hasMustProgress(const Loop *L);
+LLVM_FUNC_ABI bool hasMustProgress(const Loop *L);
 
 /// Return true if this loop can be assumed to make progress.  (i.e. can't
 /// be infinite without side effects without also being undefined)
-bool isMustProgress(const Loop *L);
+LLVM_FUNC_ABI bool isMustProgress(const Loop *L);
 
 /// Return true if this loop can be assumed to run for a finite number of
 /// iterations.
-bool isFinite(const Loop *L);
+LLVM_FUNC_ABI bool isFinite(const Loop *L);
 
 /// Return whether an MDNode might represent an access group.
 ///
@@ -671,7 +671,7 @@ bool isFinite(const Loop *L);
 /// MDNodes are designed immutable -- would require creating a new MDNode). Note
 /// that this is not a sufficient condition: not every distinct and empty NDNode
 /// is representing an access group.
-bool isValidAsAccessGroup(MDNode *AccGroup);
+LLVM_FUNC_ABI bool isValidAsAccessGroup(MDNode *AccGroup);
 
 /// Create a new LoopID after the loop has been transformed.
 ///
@@ -688,7 +688,7 @@ bool isValidAsAccessGroup(MDNode *AccGroup);
 /// @param AddAttrs       Add these loop attributes to the new LoopID.
 ///
 /// @return A new LoopID that can be applied using Loop::setLoopID().
-llvm::MDNode *
+LLVM_FUNC_ABI llvm::MDNode *
 makePostTransformationMetadata(llvm::LLVMContext &Context, MDNode *OrigLoopID,
                                llvm::ArrayRef<llvm::StringRef> RemovePrefixes,
                                llvm::ArrayRef<llvm::MDNode *> AddAttrs);
diff --git a/llvm/include/llvm/Analysis/LoopIterator.h b/llvm/include/llvm/Analysis/LoopIterator.h
index 9d16479484d7886..eaefa013aca7d17 100644
--- a/llvm/include/llvm/Analysis/LoopIterator.h
+++ b/llvm/include/llvm/Analysis/LoopIterator.h
@@ -38,7 +38,7 @@ class LoopBlocksTraversal;
 //
 // TODO: Explore the possibility to implement LoopBlocksTraversal in terms of
 //       LoopBodyTraits, so that insertEdge doesn't have to be specialized.
-struct LoopBodyTraits {
+struct LLVM_CLASS_ABI LoopBodyTraits {
   using NodeRef = std::pair<const Loop *, BasicBlock *>;
 
   // This wraps a const Loop * into the iterator, so we know which edges to
@@ -95,7 +95,7 @@ struct LoopBodyTraits {
 /// single loop.
 ///
 /// TODO: This could be generalized for any CFG region, or the entire CFG.
-class LoopBlocksDFS {
+class LLVM_CLASS_ABI LoopBlocksDFS {
 public:
   /// Postorder list iterators.
   typedef std::vector<BasicBlock*>::const_iterator POIterator;
@@ -170,7 +170,7 @@ class LoopBlocksDFS {
 
 /// Wrapper class to LoopBlocksDFS that provides a standard begin()/end()
 /// interface for the DFS reverse post-order traversal of blocks in a loop body.
-class LoopBlocksRPO {
+class LLVM_CLASS_ABI LoopBlocksRPO {
 private:
   LoopBlocksDFS DFS;
 
@@ -188,7 +188,7 @@ class LoopBlocksRPO {
 };
 
 /// Specialize po_iterator_storage to record postorder numbers.
-template<> class po_iterator_storage<LoopBlocksTraversal, true> {
+template<> class LLVM_CLASS_ABI po_iterator_storage<LoopBlocksTraversal, true> {
   LoopBlocksTraversal &LBT;
 public:
   po_iterator_storage(LoopBlocksTraversal &lbs) : LBT(lbs) {}
@@ -198,7 +198,7 @@ template<> class po_iterator_storage<LoopBlocksTraversal, true> {
 };
 
 /// Traverse the blocks in a loop using a depth-first search.
-class LoopBlocksTraversal {
+class LLVM_CLASS_ABI LoopBlocksTraversal {
 public:
   /// Graph traversal iterator.
   typedef po_iterator<BasicBlock*, LoopBlocksTraversal, true> POTIterator;
diff --git a/llvm/include/llvm/Analysis/LoopNestAnalysis.h b/llvm/include/llvm/Analysis/LoopNestAnalysis.h
index 7751dae96c7cc3f..529d220e472e295 100644
--- a/llvm/include/llvm/Analysis/LoopNestAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopNestAnalysis.h
@@ -196,11 +196,11 @@ class LLVM_EXTERNAL_VISIBILITY LoopNest {
                                                     ScalarEvolution &SE);
 };
 
-raw_ostream &operator<<(raw_ostream &, const LoopNest &);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &, const LoopNest &);
 
 /// This analysis provides information for a loop nest. The analysis runs on
 /// demand and can be initiated via AM.getResult<LoopNestAnalysis>.
-class LoopNestAnalysis : public AnalysisInfoMixin<LoopNestAnalysis> {
+class LLVM_CLASS_ABI LoopNestAnalysis : public AnalysisInfoMixin<LoopNestAnalysis> {
   friend AnalysisInfoMixin<LoopNestAnalysis>;
   static AnalysisKey Key;
 
@@ -210,7 +210,7 @@ class LoopNestAnalysis : public AnalysisInfoMixin<LoopNestAnalysis> {
 };
 
 /// Printer pass for the \c LoopNest results.
-class LoopNestPrinterPass : public PassInfoMixin<LoopNestPrinterPass> {
+class LLVM_CLASS_ABI LoopNestPrinterPass : public PassInfoMixin<LoopNestPrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Analysis/LoopPass.h b/llvm/include/llvm/Analysis/LoopPass.h
index 608712ba7f6dd79..998d5f916e10569 100644
--- a/llvm/include/llvm/Analysis/LoopPass.h
+++ b/llvm/include/llvm/Analysis/LoopPass.h
@@ -26,7 +26,7 @@ class LoopInfo;
 class LPPassManager;
 class Function;
 
-class LoopPass : public Pass {
+class LLVM_CLASS_ABI LoopPass : public Pass {
 public:
   explicit LoopPass(char &pid) : Pass(PT_Loop, pid) {}
 
@@ -74,7 +74,7 @@ class LoopPass : public Pass {
   bool skipLoop(const Loop *L) const;
 };
 
-class LPPassManager : public FunctionPass, public PMDataManager {
+class LLVM_CLASS_ABI LPPassManager : public FunctionPass, public PMDataManager {
 public:
   static char ID;
   explicit LPPassManager();
@@ -122,7 +122,7 @@ class LPPassManager : public FunctionPass, public PMDataManager {
 // This pass is required by the LCSSA transformation. It is used inside
 // LPPassManager to check if current pass preserves LCSSA form, and if it does
 // pass manager calls lcssa verification for the current loop.
-struct LCSSAVerificationPass : public FunctionPass {
+struct LLVM_CLASS_ABI LCSSAVerificationPass : public FunctionPass {
   static char ID;
   LCSSAVerificationPass();
 
diff --git a/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h b/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
index 6014942558e71c7..b6b5974eb3b7a8a 100644
--- a/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
+++ b/llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h
@@ -40,7 +40,7 @@
 namespace llvm {
 class Instruction;
 
-class UnrolledInstAnalyzer : private InstVisitor<UnrolledInstAnalyzer, bool> {
+class LLVM_CLASS_ABI UnrolledInstAnalyzer : private InstVisitor<UnrolledInstAnalyzer, bool> {
   typedef InstVisitor<UnrolledInstAnalyzer, bool> Base;
   friend class InstVisitor<UnrolledInstAnalyzer, bool>;
   struct SimplifiedAddress {
diff --git a/llvm/include/llvm/Analysis/MLInlineAdvisor.h b/llvm/include/llvm/Analysis/MLInlineAdvisor.h
index 8ece7f5343da21c..04bf69ac45db625 100644
--- a/llvm/include/llvm/Analysis/MLInlineAdvisor.h
+++ b/llvm/include/llvm/Analysis/MLInlineAdvisor.h
@@ -26,7 +26,7 @@ class DiagnosticInfoOptimizationBase;
 class Module;
 class MLInlineAdvice;
 
-class MLInlineAdvisor : public InlineAdvisor {
+class LLVM_CLASS_ABI MLInlineAdvisor : public InlineAdvisor {
 public:
   MLInlineAdvisor(Module &M, ModuleAnalysisManager &MAM,
                   std::unique_ptr<MLModelRunner> ModelRunner,
@@ -94,7 +94,7 @@ class MLInlineAdvisor : public InlineAdvisor {
 
 /// InlineAdvice that tracks changes post inlining. For that reason, it only
 /// overrides the "successful inlining" extension points.
-class MLInlineAdvice : public InlineAdvice {
+class LLVM_CLASS_ABI MLInlineAdvice : public InlineAdvice {
 public:
   MLInlineAdvice(MLInlineAdvisor *Advisor, CallBase &CB,
                  OptimizationRemarkEmitter &ORE, bool Recommendation);
diff --git a/llvm/include/llvm/Analysis/MLModelRunner.h b/llvm/include/llvm/Analysis/MLModelRunner.h
index b8c64ac1ee92d1f..9962c83e743c52d 100644
--- a/llvm/include/llvm/Analysis/MLModelRunner.h
+++ b/llvm/include/llvm/Analysis/MLModelRunner.h
@@ -22,7 +22,7 @@ class LLVMContext;
 /// NOTE: feature indices are expected to be consistent all accross
 /// MLModelRunners (pertaining to the same model), and also Loggers (see
 /// TFUtils.h)
-class MLModelRunner {
+class LLVM_CLASS_ABI MLModelRunner {
 public:
   // Disallows copy and assign.
   MLModelRunner(const MLModelRunner &) = delete;
diff --git a/llvm/include/llvm/Analysis/MemDerefPrinter.h b/llvm/include/llvm/Analysis/MemDerefPrinter.h
index 0166c15b6f4222c..fc7161604c4b4de 100644
--- a/llvm/include/llvm/Analysis/MemDerefPrinter.h
+++ b/llvm/include/llvm/Analysis/MemDerefPrinter.h
@@ -13,7 +13,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class MemDerefPrinterPass : public PassInfoMixin<MemDerefPrinterPass> {
+class LLVM_CLASS_ABI MemDerefPrinterPass : public PassInfoMixin<MemDerefPrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Analysis/MemoryBuiltins.h b/llvm/include/llvm/Analysis/MemoryBuiltins.h
index f1d62ddd3ef9941..67b52281a4321de 100644
--- a/llvm/include/llvm/Analysis/MemoryBuiltins.h
+++ b/llvm/include/llvm/Analysis/MemoryBuiltins.h
@@ -54,38 +54,38 @@ class Value;
 /// Tests if a value is a call or invoke to a library function that
 /// allocates or reallocates memory (either malloc, calloc, realloc, or strdup
 /// like).
-bool isAllocationFn(const Value *V, const TargetLibraryInfo *TLI);
-bool isAllocationFn(const Value *V,
+LLVM_FUNC_ABI bool isAllocationFn(const Value *V, const TargetLibraryInfo *TLI);
+LLVM_FUNC_ABI bool isAllocationFn(const Value *V,
                     function_ref<const TargetLibraryInfo &(Function &)> GetTLI);
 
 /// Tests if a value is a call or invoke to a library function that
 /// allocates memory via new.
-bool isNewLikeFn(const Value *V, const TargetLibraryInfo *TLI);
+LLVM_FUNC_ABI bool isNewLikeFn(const Value *V, const TargetLibraryInfo *TLI);
 
 /// Tests if a value is a call or invoke to a library function that
 /// allocates memory similar to malloc or calloc.
-bool isMallocOrCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
+LLVM_FUNC_ABI bool isMallocOrCallocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
 
 /// Tests if a value is a call or invoke to a library function that
 /// allocates memory (either malloc, calloc, or strdup like).
-bool isAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
+LLVM_FUNC_ABI bool isAllocLikeFn(const Value *V, const TargetLibraryInfo *TLI);
 
 /// Tests if a function is a call or invoke to a library function that
 /// reallocates memory (e.g., realloc).
-bool isReallocLikeFn(const Function *F);
+LLVM_FUNC_ABI bool isReallocLikeFn(const Function *F);
 
 /// If this is a call to a realloc function, return the reallocated operand.
-Value *getReallocatedOperand(const CallBase *CB);
+LLVM_FUNC_ABI Value *getReallocatedOperand(const CallBase *CB);
 
 //===----------------------------------------------------------------------===//
 //  free Call Utility Functions.
 //
 
 /// isLibFreeFunction - Returns true if the function is a builtin free()
-bool isLibFreeFunction(const Function *F, const LibFunc TLIFn);
+LLVM_FUNC_ABI bool isLibFreeFunction(const Function *F, const LibFunc TLIFn);
 
 /// If this if a call to a free function, return the freed operand.
-Value *getFreedOperand(const CallBase *CB, const TargetLibraryInfo *TLI);
+LLVM_FUNC_ABI Value *getFreedOperand(const CallBase *CB, const TargetLibraryInfo *TLI);
 
 //===----------------------------------------------------------------------===//
 //  Properties of allocation functions
@@ -100,20 +100,20 @@ Value *getFreedOperand(const CallBase *CB, const TargetLibraryInfo *TLI);
 /// Note: *Removable* really does mean removable; it does not mean observable.
 /// A language (e.g. C++) can allow removing allocations without allowing
 /// insertion or speculative execution of allocation routines.
-bool isRemovableAlloc(const CallBase *V, const TargetLibraryInfo *TLI);
+LLVM_FUNC_ABI bool isRemovableAlloc(const CallBase *V, const TargetLibraryInfo *TLI);
 
 /// Gets the alignment argument for an aligned_alloc-like function, using either
 /// built-in knowledge based on fuction names/signatures or allocalign
 /// attributes. Note: the Value returned may not indicate a valid alignment, per
 /// the definition of the allocalign attribute.
-Value *getAllocAlignment(const CallBase *V, const TargetLibraryInfo *TLI);
+LLVM_FUNC_ABI Value *getAllocAlignment(const CallBase *V, const TargetLibraryInfo *TLI);
 
 /// Return the size of the requested allocation. With a trivial mapper, this is
 /// similar to calling getObjectSize(..., Exact), but without looking through
 /// calls that return their argument. A mapper function can be used to replace
 /// one Value* (operand to the allocation) with another. This is useful when
 /// doing abstract interpretation.
-std::optional<APInt> getAllocSize(
+LLVM_FUNC_ABI std::optional<APInt> getAllocSize(
     const CallBase *CB, const TargetLibraryInfo *TLI,
     function_ref<const Value *(const Value *)> Mapper = [](const Value *V) {
       return V;
@@ -122,14 +122,14 @@ std::optional<APInt> getAllocSize(
 /// If this is a call to an allocation function that initializes memory to a
 /// fixed value, return said value in the requested type.  Otherwise, return
 /// nullptr.
-Constant *getInitialValueOfAllocation(const Value *V,
+LLVM_FUNC_ABI Constant *getInitialValueOfAllocation(const Value *V,
                                       const TargetLibraryInfo *TLI,
                                       Type *Ty);
 
 /// If a function is part of an allocation family (e.g.
 /// malloc/realloc/calloc/free), return the identifier for its family
 /// of functions.
-std::optional<StringRef> getAllocationFamily(const Value *I,
+LLVM_FUNC_ABI std::optional<StringRef> getAllocationFamily(const Value *I,
                                              const TargetLibraryInfo *TLI);
 
 //===----------------------------------------------------------------------===//
@@ -137,7 +137,7 @@ std::optional<StringRef> getAllocationFamily(const Value *I,
 //
 
 /// Various options to control the behavior of getObjectSize.
-struct ObjectSizeOpts {
+struct LLVM_CLASS_ABI ObjectSizeOpts {
   /// Controls how we handle conditional statements with unknown conditions.
   enum class Mode : uint8_t {
     /// All branches must be known and have the same size, starting from the
@@ -174,16 +174,16 @@ struct ObjectSizeOpts {
 /// WARNING: The object size returned is the allocation size.  This does not
 /// imply dereferenceability at site of use since the object may be freeed in
 /// between.
-bool getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout &DL,
+LLVM_FUNC_ABI bool getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout &DL,
                    const TargetLibraryInfo *TLI, ObjectSizeOpts Opts = {});
 
 /// Try to turn a call to \@llvm.objectsize into an integer value of the given
 /// Type. Returns null on failure. If MustSucceed is true, this function will
 /// not return null, and may return conservative values governed by the second
 /// argument of the call to objectsize.
-Value *lowerObjectSizeCall(IntrinsicInst *ObjectSize, const DataLayout &DL,
+LLVM_FUNC_ABI Value *lowerObjectSizeCall(IntrinsicInst *ObjectSize, const DataLayout &DL,
                            const TargetLibraryInfo *TLI, bool MustSucceed);
-Value *lowerObjectSizeCall(
+LLVM_FUNC_ABI Value *lowerObjectSizeCall(
     IntrinsicInst *ObjectSize, const DataLayout &DL,
     const TargetLibraryInfo *TLI, AAResults *AA, bool MustSucceed,
     SmallVectorImpl<Instruction *> *InsertedInstructions = nullptr);
@@ -192,7 +192,7 @@ using SizeOffsetType = std::pair<APInt, APInt>;
 
 /// Evaluate the size and offset of an object pointed to by a Value*
 /// statically. Fails if size or offset are not known at compile time.
-class ObjectSizeOffsetVisitor
+class LLVM_CLASS_ABI ObjectSizeOffsetVisitor
   : public InstVisitor<ObjectSizeOffsetVisitor, SizeOffsetType> {
   const DataLayout &DL;
   const TargetLibraryInfo *TLI;
@@ -256,7 +256,7 @@ using SizeOffsetEvalType = std::pair<Value *, Value *>;
 
 /// Evaluate the size and offset of an object pointed to by a Value*.
 /// May create code to compute the result at run-time.
-class ObjectSizeOffsetEvaluator
+class LLVM_CLASS_ABI ObjectSizeOffsetEvaluator
   : public InstVisitor<ObjectSizeOffsetEvaluator, SizeOffsetEvalType> {
   using BuilderTy = IRBuilder<TargetFolder, IRBuilderCallbackInserter>;
   using WeakEvalType = std::pair<WeakTrackingVH, WeakTrackingVH>;
diff --git a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
index dcedd8c76f387a7..c95184de3aeed28 100644
--- a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
@@ -35,7 +35,7 @@ class DominatorTree;
 class PHITransAddr;
 
 /// A memory dependence query can return one of three different answers.
-class MemDepResult {
+class LLVM_CLASS_ABI MemDepResult {
   enum DepType {
     /// Clients of MemDep never see this.
     ///
@@ -204,7 +204,7 @@ class MemDepResult {
 /// This is an entry in the NonLocalDepInfo cache.
 ///
 /// For each BasicBlock (the BB entry) it keeps a MemDepResult.
-class NonLocalDepEntry {
+class LLVM_CLASS_ABI NonLocalDepEntry {
   BasicBlock *BB;
   MemDepResult Result;
 
@@ -229,7 +229,7 @@ class NonLocalDepEntry {
 ///
 /// For each BasicBlock (the BB entry) it keeps a MemDepResult and the
 /// (potentially phi translated) address that was live in the block.
-class NonLocalDepResult {
+class LLVM_CLASS_ABI NonLocalDepResult {
   NonLocalDepEntry Entry;
   Value *Address;
 
@@ -270,7 +270,7 @@ class NonLocalDepResult {
 /// b) they load from *must-aliased* pointers.  Returning a dependence on
 /// must-alias'd pointers instead of all pointers interacts well with the
 /// internal caching mechanism.
-class MemoryDependenceResults {
+class LLVM_CLASS_ABI MemoryDependenceResults {
   // A map from instructions to their dependency.
   using LocalDepMapType = DenseMap<Instruction *, MemDepResult>;
   LocalDepMapType LocalDeps;
@@ -511,7 +511,7 @@ class MemoryDependenceResults {
 ///
 /// This is essentially a no-op because the results are computed entirely
 /// lazily.
-class MemoryDependenceAnalysis
+class LLVM_CLASS_ABI MemoryDependenceAnalysis
     : public AnalysisInfoMixin<MemoryDependenceAnalysis> {
   friend AnalysisInfoMixin<MemoryDependenceAnalysis>;
 
@@ -530,7 +530,7 @@ class MemoryDependenceAnalysis
 
 /// A wrapper analysis pass for the legacy pass manager that exposes a \c
 /// MemoryDepnedenceResults instance.
-class MemoryDependenceWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI MemoryDependenceWrapperPass : public FunctionPass {
   std::optional<MemoryDependenceResults> MemDep;
 
 public:
diff --git a/llvm/include/llvm/Analysis/MemoryLocation.h b/llvm/include/llvm/Analysis/MemoryLocation.h
index fbf739315dc468c..15aadef079d8a46 100644
--- a/llvm/include/llvm/Analysis/MemoryLocation.h
+++ b/llvm/include/llvm/Analysis/MemoryLocation.h
@@ -65,7 +65,7 @@ class Value;
 //
 // If asked to represent a pathologically large value, this will degrade to
 // std::nullopt.
-class LocationSize {
+class LLVM_CLASS_ABI LocationSize {
   enum : uint64_t {
     BeforeOrAfterPointer = ~uint64_t(0),
     AfterPointer = BeforeOrAfterPointer - 1,
@@ -209,7 +209,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, LocationSize Size) {
 ///
 /// The primary user of this interface is LLVM's Alias Analysis, but other
 /// memory analyses such as MemoryDependence can use it as well.
-class MemoryLocation {
+class LLVM_CLASS_ABI MemoryLocation {
 public:
   /// UnknownSize - This is a special value which can be used with the
   /// size arguments in alias queries to indicate that the caller does not
@@ -317,7 +317,7 @@ class MemoryLocation {
 };
 
 // Specialize DenseMapInfo.
-template <> struct DenseMapInfo<LocationSize> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<LocationSize> {
   static inline LocationSize getEmptyKey() {
     return LocationSize::mapEmpty();
   }
@@ -332,7 +332,7 @@ template <> struct DenseMapInfo<LocationSize> {
   }
 };
 
-template <> struct DenseMapInfo<MemoryLocation> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<MemoryLocation> {
   static inline MemoryLocation getEmptyKey() {
     return MemoryLocation(DenseMapInfo<const Value *>::getEmptyKey(),
                           DenseMapInfo<LocationSize>::getEmptyKey());
diff --git a/llvm/include/llvm/Analysis/MemoryProfileInfo.h b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
index baf1cbca64fac57..06bd5b6d3e89329 100644
--- a/llvm/include/llvm/Analysis/MemoryProfileInfo.h
+++ b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
@@ -25,31 +25,31 @@ namespace llvm {
 namespace memprof {
 
 /// Return the allocation type for a given set of memory profile values.
-AllocationType getAllocType(uint64_t TotalLifetimeAccessDensity,
+LLVM_FUNC_ABI AllocationType getAllocType(uint64_t TotalLifetimeAccessDensity,
                             uint64_t AllocCount, uint64_t TotalLifetime);
 
 /// Build callstack metadata from the provided list of call stack ids. Returns
 /// the resulting metadata node.
-MDNode *buildCallstackMetadata(ArrayRef<uint64_t> CallStack, LLVMContext &Ctx);
+LLVM_FUNC_ABI MDNode *buildCallstackMetadata(ArrayRef<uint64_t> CallStack, LLVMContext &Ctx);
 
 /// Returns the stack node from an MIB metadata node.
-MDNode *getMIBStackNode(const MDNode *MIB);
+LLVM_FUNC_ABI MDNode *getMIBStackNode(const MDNode *MIB);
 
 /// Returns the allocation type from an MIB metadata node.
-AllocationType getMIBAllocType(const MDNode *MIB);
+LLVM_FUNC_ABI AllocationType getMIBAllocType(const MDNode *MIB);
 
 /// Returns the string to use in attributes with the given type.
-std::string getAllocTypeAttributeString(AllocationType Type);
+LLVM_FUNC_ABI std::string getAllocTypeAttributeString(AllocationType Type);
 
 /// True if the AllocTypes bitmask contains just a single type.
-bool hasSingleAllocType(uint8_t AllocTypes);
+LLVM_FUNC_ABI bool hasSingleAllocType(uint8_t AllocTypes);
 
 /// Class to build a trie of call stack contexts for a particular profiled
 /// allocation call, along with their associated allocation types.
 /// The allocation will be at the root of the trie, which is then used to
 /// compute the minimum lists of context ids needed to associate a call context
 /// with a single allocation type.
-class CallStackTrie {
+class LLVM_CLASS_ABI CallStackTrie {
 private:
   struct CallStackTrieNode {
     // Allocation types for call context sharing the context prefix at this
@@ -112,7 +112,7 @@ class CallStackTrie {
 /// (CallsiteInfo and MIBInfo). This simplifies implementation of client code
 /// which doesn't need to worry about whether we are operating with IR (Regular
 /// LTO), or summary (ThinLTO).
-template <class NodeT, class IteratorT> class CallStack {
+template <class NodeT, class IteratorT> class LLVM_CLASS_ABI CallStack {
 public:
   CallStack(const NodeT *N = nullptr) : N(N) {}
 
diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index 40b83fb9569abcf..5856e554c2d3d59 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -122,8 +122,8 @@ class raw_ostream;
 
 namespace MSSAHelpers {
 
-struct AllAccessTag {};
-struct DefsOnlyTag {};
+struct LLVM_CLASS_ABI AllAccessTag {};
+struct LLVM_CLASS_ABI DefsOnlyTag {};
 
 } // end namespace MSSAHelpers
 
@@ -140,7 +140,7 @@ using const_memoryaccess_def_iterator =
 
 // The base for all memory accesses. All memory accesses in a block are
 // linked together using an intrusive list.
-class MemoryAccess
+class LLVM_CLASS_ABI MemoryAccess
     : public DerivedUser,
       public ilist_node<MemoryAccess, ilist_tag<MSSAHelpers::AllAccessTag>>,
       public ilist_node<MemoryAccess, ilist_tag<MSSAHelpers::DefsOnlyTag>> {
@@ -234,7 +234,7 @@ class MemoryAccess
 };
 
 template <>
-struct ilist_alloc_traits<MemoryAccess> {
+struct LLVM_CLASS_ABI ilist_alloc_traits<MemoryAccess> {
   static void deleteNode(MemoryAccess *MA) { MA->deleteValue(); }
 };
 
@@ -250,7 +250,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MemoryAccess &MA) {
 ///
 /// This class should never be instantiated directly; make a MemoryUse or
 /// MemoryDef instead.
-class MemoryUseOrDef : public MemoryAccess {
+class LLVM_CLASS_ABI MemoryUseOrDef : public MemoryAccess {
 public:
   void *operator new(size_t) = delete;
 
@@ -310,7 +310,7 @@ class MemoryUseOrDef : public MemoryAccess {
 /// In particular, the set of Instructions that will be represented by
 /// MemoryUse's is exactly the set of Instructions for which
 /// AliasAnalysis::getModRefInfo returns "Ref".
-class MemoryUse final : public MemoryUseOrDef {
+class LLVM_CLASS_ABI MemoryUse final : public MemoryUseOrDef {
 public:
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(MemoryAccess);
 
@@ -358,7 +358,7 @@ class MemoryUse final : public MemoryUseOrDef {
 };
 
 template <>
-struct OperandTraits<MemoryUse> : public FixedNumOperandTraits<MemoryUse, 1> {};
+struct LLVM_CLASS_ABI OperandTraits<MemoryUse> : public FixedNumOperandTraits<MemoryUse, 1> {};
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(MemoryUse, MemoryAccess)
 
 /// Represents a read-write access to memory, whether it is a must-alias,
@@ -370,7 +370,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(MemoryUse, MemoryAccess)
 /// Note that, in order to provide def-def chains, all defs also have a use
 /// associated with them. This use points to the nearest reaching
 /// MemoryDef/MemoryPhi.
-class MemoryDef final : public MemoryUseOrDef {
+class LLVM_CLASS_ABI MemoryDef final : public MemoryUseOrDef {
 public:
   friend class MemorySSA;
 
@@ -420,11 +420,11 @@ class MemoryDef final : public MemoryUseOrDef {
 };
 
 template <>
-struct OperandTraits<MemoryDef> : public FixedNumOperandTraits<MemoryDef, 2> {};
+struct LLVM_CLASS_ABI OperandTraits<MemoryDef> : public FixedNumOperandTraits<MemoryDef, 2> {};
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(MemoryDef, MemoryAccess)
 
 template <>
-struct OperandTraits<MemoryUseOrDef> {
+struct LLVM_CLASS_ABI OperandTraits<MemoryUseOrDef> {
   static Use *op_begin(MemoryUseOrDef *MUD) {
     if (auto *MU = dyn_cast<MemoryUse>(MUD))
       return OperandTraits<MemoryUse>::op_begin(MU);
@@ -477,7 +477,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(MemoryUseOrDef, MemoryAccess)
 /// disconnected completely from the SSA graph below that point.
 /// Because MemoryUse's do not generate new definitions, they do not have this
 /// issue.
-class MemoryPhi final : public MemoryAccess {
+class LLVM_CLASS_ABI MemoryPhi final : public MemoryAccess {
   // allocate space for exactly zero operands
   void *operator new(size_t S) { return User::operator new(S); }
 
@@ -693,12 +693,12 @@ inline void MemoryUseOrDef::resetOptimized() {
     cast<MemoryUse>(this)->resetOptimized();
 }
 
-template <> struct OperandTraits<MemoryPhi> : public HungoffOperandTraits<2> {};
+template <> struct LLVM_CLASS_ABI OperandTraits<MemoryPhi> : public HungoffOperandTraits<2> {};
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(MemoryPhi, MemoryAccess)
 
 /// Encapsulates MemorySSA, including all data associated with memory
 /// accesses.
-class MemorySSA {
+class LLVM_CLASS_ABI MemorySSA {
 public:
   MemorySSA(Function &, AliasAnalysis *, DominatorTree *);
 
@@ -906,10 +906,10 @@ class MemorySSA {
 /// The checks which this flag enables is exensive and disabled by default
 /// unless `EXPENSIVE_CHECKS` is defined.  The flag `-verify-memoryssa` can be
 /// used to selectively enable the verification without re-compilation.
-extern bool VerifyMemorySSA;
+LLVM_FUNC_ABI extern bool VerifyMemorySSA;
 
 // Internal MemorySSA utils, for use by MemorySSA classes and walkers
-class MemorySSAUtil {
+class LLVM_CLASS_ABI MemorySSAUtil {
 protected:
   friend class GVNHoist;
   friend class MemorySSAWalker;
@@ -921,7 +921,7 @@ class MemorySSAUtil {
 
 /// An analysis that produces \c MemorySSA for a function.
 ///
-class MemorySSAAnalysis : public AnalysisInfoMixin<MemorySSAAnalysis> {
+class LLVM_CLASS_ABI MemorySSAAnalysis : public AnalysisInfoMixin<MemorySSAAnalysis> {
   friend AnalysisInfoMixin<MemorySSAAnalysis>;
 
   static AnalysisKey Key;
@@ -945,7 +945,7 @@ class MemorySSAAnalysis : public AnalysisInfoMixin<MemorySSAAnalysis> {
 };
 
 /// Printer pass for \c MemorySSA.
-class MemorySSAPrinterPass : public PassInfoMixin<MemorySSAPrinterPass> {
+class LLVM_CLASS_ABI MemorySSAPrinterPass : public PassInfoMixin<MemorySSAPrinterPass> {
   raw_ostream &OS;
   bool EnsureOptimizedUses;
 
@@ -957,7 +957,7 @@ class MemorySSAPrinterPass : public PassInfoMixin<MemorySSAPrinterPass> {
 };
 
 /// Printer pass for \c MemorySSA via the walker.
-class MemorySSAWalkerPrinterPass
+class LLVM_CLASS_ABI MemorySSAWalkerPrinterPass
     : public PassInfoMixin<MemorySSAWalkerPrinterPass> {
   raw_ostream &OS;
 
@@ -968,12 +968,12 @@ class MemorySSAWalkerPrinterPass
 };
 
 /// Verifier pass for \c MemorySSA.
-struct MemorySSAVerifierPass : PassInfoMixin<MemorySSAVerifierPass> {
+struct LLVM_CLASS_ABI MemorySSAVerifierPass : PassInfoMixin<MemorySSAVerifierPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
 /// Legacy analysis pass which computes \c MemorySSA.
-class MemorySSAWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI MemorySSAWrapperPass : public FunctionPass {
 public:
   MemorySSAWrapperPass();
 
@@ -1004,7 +1004,7 @@ class MemorySSAWrapperPass : public FunctionPass {
 /// disambiguate memory accesses, or they may want the nearest dominating
 /// may-aliasing MemoryDef for a call or a store. This API enables a
 /// standardized interface to getting and using that info.
-class MemorySSAWalker {
+class LLVM_CLASS_ABI MemorySSAWalker {
 public:
   MemorySSAWalker(MemorySSA *);
   virtual ~MemorySSAWalker() = default;
@@ -1091,7 +1091,7 @@ class MemorySSAWalker {
 
 /// A MemorySSAWalker that does no alias queries, or anything else. It
 /// simply returns the links as they were constructed by the builder.
-class DoNothingMemorySSAWalker final : public MemorySSAWalker {
+class LLVM_CLASS_ABI DoNothingMemorySSAWalker final : public MemorySSAWalker {
 public:
   // Keep the overrides below from hiding the Instruction overload of
   // getClobberingMemoryAccess.
@@ -1110,7 +1110,7 @@ using ConstMemoryAccessPair = std::pair<const MemoryAccess *, MemoryLocation>;
 /// Iterator base class used to implement const and non-const iterators
 /// over the defining accesses of a MemoryAccess.
 template <class T>
-class memoryaccess_def_iterator_base
+class LLVM_CLASS_ABI memoryaccess_def_iterator_base
     : public iterator_facade_base<memoryaccess_def_iterator_base<T>,
                                   std::forward_iterator_tag, T, ptrdiff_t, T *,
                                   T *> {
@@ -1182,7 +1182,7 @@ inline const_memoryaccess_def_iterator MemoryAccess::defs_end() const {
 
 /// GraphTraits for a MemoryAccess, which walks defs in the normal case,
 /// and uses in the inverse case.
-template <> struct GraphTraits<MemoryAccess *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<MemoryAccess *> {
   using NodeRef = MemoryAccess *;
   using ChildIteratorType = memoryaccess_def_iterator;
 
@@ -1191,7 +1191,7 @@ template <> struct GraphTraits<MemoryAccess *> {
   static ChildIteratorType child_end(NodeRef N) { return N->defs_end(); }
 };
 
-template <> struct GraphTraits<Inverse<MemoryAccess *>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<MemoryAccess *>> {
   using NodeRef = MemoryAccess *;
   using ChildIteratorType = MemoryAccess::iterator;
 
@@ -1208,7 +1208,7 @@ template <> struct GraphTraits<Inverse<MemoryAccess *>> {
 /// want when walking upwards through MemorySSA def chains. It takes a pair of
 /// <MemoryAccess,MemoryLocation>, and walks defs, properly translating the
 /// memory location through phi nodes for the user.
-class upward_defs_iterator
+class LLVM_CLASS_ABI upward_defs_iterator
     : public iterator_facade_base<upward_defs_iterator,
                                   std::forward_iterator_tag,
                                   const MemoryAccessPair> {
@@ -1313,7 +1313,7 @@ upward_defs(const MemoryAccessPair &Pair, DominatorTree &DT) {
 /// So if you are just trying to find, given a store, what the next
 /// thing that would clobber the same memory is, you want the optimized chain.
 template <class T, bool UseOptimizedChain = false>
-struct def_chain_iterator
+struct LLVM_CLASS_ABI def_chain_iterator
     : public iterator_facade_base<def_chain_iterator<T, UseOptimizedChain>,
                                   std::forward_iterator_tag, MemoryAccess *> {
   def_chain_iterator() : MA(nullptr) {}
diff --git a/llvm/include/llvm/Analysis/MemorySSAUpdater.h b/llvm/include/llvm/Analysis/MemorySSAUpdater.h
index e1455e4c8a306b8..790999a4c00c539 100644
--- a/llvm/include/llvm/Analysis/MemorySSAUpdater.h
+++ b/llvm/include/llvm/Analysis/MemorySSAUpdater.h
@@ -52,7 +52,7 @@ using ValueToValueMapTy = ValueMap<const Value *, WeakTrackingVH>;
 using PhiToDefMap = SmallDenseMap<MemoryPhi *, MemoryAccess *>;
 using CFGUpdate = cfg::Update<BasicBlock *>;
 
-class MemorySSAUpdater {
+class LLVM_CLASS_ABI MemorySSAUpdater {
 private:
   MemorySSA *MSSA;
 
diff --git a/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h b/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h
index 9e9fc1d59320d78..6f6e3fe9928e4cb 100644
--- a/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h
+++ b/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h
@@ -16,7 +16,7 @@
 namespace llvm {
 class raw_ostream;
 
-class ModuleDebugInfoPrinterPass
+class LLVM_CLASS_ABI ModuleDebugInfoPrinterPass
     : public PassInfoMixin<ModuleDebugInfoPrinterPass> {
   DebugInfoFinder Finder;
   raw_ostream &OS;
diff --git a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
index f89b396b500e236..2d6562cada08579 100644
--- a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
+++ b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
@@ -34,7 +34,7 @@ class StackSafetyInfo;
 /// BlockFrequencyInfo for a given function, that can be provided via
 /// a std::function callback. Otherwise, this routine will manually construct
 /// that information.
-ModuleSummaryIndex buildModuleSummaryIndex(
+LLVM_FUNC_ABI ModuleSummaryIndex buildModuleSummaryIndex(
     const Module &M,
     std::function<BlockFrequencyInfo *(const Function &F)> GetBFICallback,
     ProfileSummaryInfo *PSI,
@@ -42,7 +42,7 @@ ModuleSummaryIndex buildModuleSummaryIndex(
         [](const Function &F) -> const StackSafetyInfo * { return nullptr; });
 
 /// Analysis pass to provide the ModuleSummaryIndex object.
-class ModuleSummaryIndexAnalysis
+class LLVM_CLASS_ABI ModuleSummaryIndexAnalysis
     : public AnalysisInfoMixin<ModuleSummaryIndexAnalysis> {
   friend AnalysisInfoMixin<ModuleSummaryIndexAnalysis>;
 
@@ -55,7 +55,7 @@ class ModuleSummaryIndexAnalysis
 };
 
 /// Legacy wrapper pass to provide the ModuleSummaryIndex object.
-class ModuleSummaryIndexWrapperPass : public ModulePass {
+class LLVM_CLASS_ABI ModuleSummaryIndexWrapperPass : public ModulePass {
   std::optional<ModuleSummaryIndex> Index;
 
 public:
@@ -77,10 +77,10 @@ class ModuleSummaryIndexWrapperPass : public ModulePass {
 // createModuleSummaryIndexWrapperPass - This pass builds a ModuleSummaryIndex
 // object for the module, to be written to bitcode or LLVM assembly.
 //
-ModulePass *createModuleSummaryIndexWrapperPass();
+LLVM_FUNC_ABI ModulePass *createModuleSummaryIndexWrapperPass();
 
 /// Legacy wrapper pass to provide the ModuleSummaryIndex object.
-class ImmutableModuleSummaryIndexWrapperPass : public ImmutablePass {
+class LLVM_CLASS_ABI ImmutableModuleSummaryIndexWrapperPass : public ImmutablePass {
   const ModuleSummaryIndex *Index;
 
 public:
@@ -97,12 +97,12 @@ class ImmutableModuleSummaryIndexWrapperPass : public ImmutablePass {
 // ImmutableModuleSummaryIndexWrapperPass - This pass wrap provided
 // ModuleSummaryIndex object for the module, to be used by other passes.
 //
-ImmutablePass *
+LLVM_FUNC_ABI ImmutablePass *
 createImmutableModuleSummaryIndexWrapperPass(const ModuleSummaryIndex *Index);
 
 /// Returns true if the instruction could have memprof metadata, used to ensure
 /// consistency between summary analysis and the ThinLTO backend processing.
-bool mayHaveMemprofSummary(const CallBase *CB);
+LLVM_FUNC_ABI bool mayHaveMemprofSummary(const CallBase *CB);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/MustExecute.h b/llvm/include/llvm/Analysis/MustExecute.h
index e2cd7349b5dba55..c9373cdcd3a4c66 100644
--- a/llvm/include/llvm/Analysis/MustExecute.h
+++ b/llvm/include/llvm/Analysis/MustExecute.h
@@ -58,7 +58,7 @@ class raw_ostream;
 /// LoopSafetyInfo needs to be recomputed. If a meaningful modifications to the
 /// loop were made and the info wasn't recomputed properly, the behavior of all
 /// methods except for computeLoopSafetyInfo is undefined.
-class LoopSafetyInfo {
+class LLVM_CLASS_ABI LoopSafetyInfo {
   // Used to update funclet bundle operands.
   DenseMap<BasicBlock *, ColorVector> BlockColors;
 
@@ -108,7 +108,7 @@ class LoopSafetyInfo {
 /// Simple and conservative implementation of LoopSafetyInfo that can give
 /// false-positive answers to its queries in order to avoid complicated
 /// analysis.
-class SimpleLoopSafetyInfo: public LoopSafetyInfo {
+class LLVM_CLASS_ABI SimpleLoopSafetyInfo: public LoopSafetyInfo {
   bool MayThrow = false;       // The current loop contains an instruction which
                                // may throw.
   bool HeaderMayThrow = false; // Same as previous, but specific to loop header
@@ -130,7 +130,7 @@ class SimpleLoopSafetyInfo: public LoopSafetyInfo {
 /// that should be invalidated by calling the methods insertInstructionTo and
 /// removeInstruction whenever we modify a basic block's contents by adding or
 /// removing instructions.
-class ICFLoopSafetyInfo: public LoopSafetyInfo {
+class LLVM_CLASS_ABI ICFLoopSafetyInfo: public LoopSafetyInfo {
   bool MayThrow = false;       // The current loop contains an instruction which
                                // may throw.
   // Contains information about implicit control flow in this loop's blocks.
@@ -170,7 +170,7 @@ class ICFLoopSafetyInfo: public LoopSafetyInfo {
   void removeInstruction(const Instruction *Inst);
 };
 
-bool mayContainIrreducibleControl(const Function &F, const LoopInfo *LI);
+LLVM_FUNC_ABI bool mayContainIrreducibleControl(const Function &F, const LoopInfo *LI);
 
 struct MustBeExecutedContextExplorer;
 
@@ -270,7 +270,7 @@ enum class ExplorationDirection {
 /// derived by the explorer depending on the available CFG analyses (see
 /// MustBeExecutedContextExplorer). Also note that we, depending on the options,
 /// the visit set can contain instructions from other functions.
-struct MustBeExecutedIterator {
+struct LLVM_CLASS_ABI MustBeExecutedIterator {
   /// Type declarations that make his class an input iterator.
   ///{
   typedef const Instruction *value_type;
@@ -384,7 +384,7 @@ struct MustBeExecutedIterator {
 /// executed context. There is little information sharing between iterators as
 /// the expected use case involves few iterators for "far apart" instructions.
 /// If that changes, we should consider caching more intermediate results.
-struct MustBeExecutedContextExplorer {
+struct LLVM_CLASS_ABI MustBeExecutedContextExplorer {
 
   /// In the description of the parameters we use PP to denote a program point
   /// for which the must be executed context is explored, or put differently,
@@ -542,7 +542,7 @@ struct MustBeExecutedContextExplorer {
   MustBeExecutedIterator EndIterator;
 };
 
-class MustExecutePrinterPass : public PassInfoMixin<MustExecutePrinterPass> {
+class LLVM_CLASS_ABI MustExecutePrinterPass : public PassInfoMixin<MustExecutePrinterPass> {
   raw_ostream &OS;
 
 public:
@@ -550,7 +550,7 @@ class MustExecutePrinterPass : public PassInfoMixin<MustExecutePrinterPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
-class MustBeExecutedContextPrinterPass
+class LLVM_CLASS_ABI MustBeExecutedContextPrinterPass
     : public PassInfoMixin<MustBeExecutedContextPrinterPass> {
   raw_ostream &OS;
 
diff --git a/llvm/include/llvm/Analysis/NoInferenceModelRunner.h b/llvm/include/llvm/Analysis/NoInferenceModelRunner.h
index 4a6f0f57f329525..7917201f709bafa 100644
--- a/llvm/include/llvm/Analysis/NoInferenceModelRunner.h
+++ b/llvm/include/llvm/Analysis/NoInferenceModelRunner.h
@@ -18,7 +18,7 @@ namespace llvm {
 /// A pseudo model runner. We use it to store feature values when collecting
 /// logs for the default policy, in 'development' mode, but never ask it to
 /// 'run'.
-class NoInferenceModelRunner : public MLModelRunner {
+class LLVM_CLASS_ABI NoInferenceModelRunner : public MLModelRunner {
 public:
   NoInferenceModelRunner(LLVMContext &Ctx,
                          const std::vector<TensorSpec> &Inputs);
diff --git a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
index b56651e84b59630..5fdde617ad0d297 100644
--- a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h
@@ -35,7 +35,7 @@ namespace objcarc {
 /// TODO: This class could be generalized to know about other ObjC-specific
 /// tricks. Such as knowing that ivars in the non-fragile ABI are non-aliasing
 /// even though their offsets are dynamic.
-class ObjCARCAAResult : public AAResultBase {
+class LLVM_CLASS_ABI ObjCARCAAResult : public AAResultBase {
   const DataLayout &DL;
 
 public:
@@ -65,7 +65,7 @@ class ObjCARCAAResult : public AAResultBase {
 };
 
 /// Analysis pass providing a never-invalidated alias analysis result.
-class ObjCARCAA : public AnalysisInfoMixin<ObjCARCAA> {
+class LLVM_CLASS_ABI ObjCARCAA : public AnalysisInfoMixin<ObjCARCAA> {
   friend AnalysisInfoMixin<ObjCARCAA>;
   static AnalysisKey Key;
 
diff --git a/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h b/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h
index c191132ebff7a0a..3e57b4f4e733211 100644
--- a/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h
+++ b/llvm/include/llvm/Analysis/ObjCARCAnalysisUtils.h
@@ -37,7 +37,7 @@ class AAResults;
 namespace objcarc {
 
 /// A handy option to enable/disable all ARC Optimizations.
-extern bool EnableARCOpts;
+LLVM_FUNC_ABI extern bool EnableARCOpts;
 
 /// Test if the given module looks interesting to run ARC optimization
 /// on.
@@ -167,7 +167,7 @@ inline bool IsPotentialRetainableObjPtr(const Value *Op) {
   return true;
 }
 
-bool IsPotentialRetainableObjPtr(const Value *Op, AAResults &AA);
+LLVM_FUNC_ABI bool IsPotentialRetainableObjPtr(const Value *Op, AAResults &AA);
 
 /// Helper for GetARCInstKind. Determines what kind of construct CS
 /// is.
@@ -226,7 +226,7 @@ enum class ARCMDKindID {
 };
 
 /// A cache of MDKinds used by various ARC optimizations.
-class ARCMDKindCache {
+class LLVM_CLASS_ABI ARCMDKindCache {
   Module *M;
 
   /// The Metadata Kind for clang.imprecise_release metadata.
diff --git a/llvm/include/llvm/Analysis/ObjCARCInstKind.h b/llvm/include/llvm/Analysis/ObjCARCInstKind.h
index da27ee752df4a39..553e8a1652c02fa 100644
--- a/llvm/include/llvm/Analysis/ObjCARCInstKind.h
+++ b/llvm/include/llvm/Analysis/ObjCARCInstKind.h
@@ -54,48 +54,48 @@ enum class ARCInstKind {
   None                      ///< anything that is inert from an ARC perspective.
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const ARCInstKind Class);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const ARCInstKind Class);
 
 /// Test if the given class is a kind of user.
-bool IsUser(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsUser(ARCInstKind Class);
 
 /// Test if the given class is objc_retain or equivalent.
-bool IsRetain(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsRetain(ARCInstKind Class);
 
 /// Test if the given class is objc_autorelease or equivalent.
-bool IsAutorelease(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsAutorelease(ARCInstKind Class);
 
 /// Test if the given class represents instructions which return their
 /// argument verbatim.
-bool IsForwarding(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsForwarding(ARCInstKind Class);
 
 /// Test if the given class represents instructions which do nothing if
 /// passed a null pointer.
-bool IsNoopOnNull(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsNoopOnNull(ARCInstKind Class);
 
 /// Test if the given class represents instructions which do nothing if
 /// passed a global variable.
-bool IsNoopOnGlobal(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsNoopOnGlobal(ARCInstKind Class);
 
 /// Test if the given class represents instructions which are always safe
 /// to mark with the "tail" keyword.
-bool IsAlwaysTail(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsAlwaysTail(ARCInstKind Class);
 
 /// Test if the given class represents instructions which are never safe
 /// to mark with the "tail" keyword.
-bool IsNeverTail(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsNeverTail(ARCInstKind Class);
 
 /// Test if the given class represents instructions which are always safe
 /// to mark with the nounwind attribute.
-bool IsNoThrow(ARCInstKind Class);
+LLVM_FUNC_ABI bool IsNoThrow(ARCInstKind Class);
 
 /// Test whether the given instruction can autorelease any pointer or cause an
 /// autoreleasepool pop.
-bool CanInterruptRV(ARCInstKind Class);
+LLVM_FUNC_ABI bool CanInterruptRV(ARCInstKind Class);
 
 /// Determine if F is one of the special known Functions.  If it isn't,
 /// return ARCInstKind::CallOrUser.
-ARCInstKind GetFunctionClass(const Function *F);
+LLVM_FUNC_ABI ARCInstKind GetFunctionClass(const Function *F);
 
 /// Determine which objc runtime call instruction class V belongs to.
 ///
@@ -115,11 +115,11 @@ inline ARCInstKind GetBasicARCInstKind(const Value *V) {
 }
 
 /// Map V to its ARCInstKind equivalence class.
-ARCInstKind GetARCInstKind(const Value *V);
+LLVM_FUNC_ABI ARCInstKind GetARCInstKind(const Value *V);
 
 /// Returns false if conservatively we can prove that any instruction mapped to
 /// this kind can not decrement ref counts. Returns true otherwise.
-bool CanDecrementRefCount(ARCInstKind Kind);
+LLVM_FUNC_ABI bool CanDecrementRefCount(ARCInstKind Kind);
 
 } // end namespace objcarc
 } // end namespace llvm
diff --git a/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h b/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h
index 64a022fcd317cb8..680c8c3c4bc29d3 100644
--- a/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h
+++ b/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h
@@ -31,7 +31,7 @@ class Value;
 /// along with the reasons for it.  Hotness information of the corresponding
 /// code region can be included in the remark if DiagnosticsHotnessRequested is
 /// enabled in the LLVM context.
-class OptimizationRemarkEmitter {
+class LLVM_CLASS_ABI OptimizationRemarkEmitter {
 public:
   OptimizationRemarkEmitter(const Function *F, BlockFrequencyInfo *BFI)
       : F(F), BFI(BFI) {}
@@ -144,7 +144,7 @@ using setExtraArgs = DiagnosticInfoOptimizationBase::setExtraArgs;
 /// Note that this pass shouldn't generally be marked as preserved by other
 /// passes.  It's holding onto BFI, so if the pass does not preserve BFI, BFI
 /// could be freed.
-class OptimizationRemarkEmitterWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI OptimizationRemarkEmitterWrapperPass : public FunctionPass {
   std::unique_ptr<OptimizationRemarkEmitter> ORE;
 
 public:
@@ -162,7 +162,7 @@ class OptimizationRemarkEmitterWrapperPass : public FunctionPass {
   static char ID;
 };
 
-class OptimizationRemarkEmitterAnalysis
+class LLVM_CLASS_ABI OptimizationRemarkEmitterAnalysis
     : public AnalysisInfoMixin<OptimizationRemarkEmitterAnalysis> {
   friend AnalysisInfoMixin<OptimizationRemarkEmitterAnalysis>;
   static AnalysisKey Key;
diff --git a/llvm/include/llvm/Analysis/OverflowInstAnalysis.h b/llvm/include/llvm/Analysis/OverflowInstAnalysis.h
index 49e0207038cdcd6..25ec808fce8e90f 100644
--- a/llvm/include/llvm/Analysis/OverflowInstAnalysis.h
+++ b/llvm/include/llvm/Analysis/OverflowInstAnalysis.h
@@ -37,9 +37,9 @@ class Value;
 /// If Op0 and Op1 match one of the patterns above, return true and fill Y's
 /// use.
 
-bool isCheckForZeroAndMulWithOverflow(Value *Op0, Value *Op1, bool IsAnd,
+LLVM_FUNC_ABI bool isCheckForZeroAndMulWithOverflow(Value *Op0, Value *Op1, bool IsAnd,
                                       Use *&Y);
-bool isCheckForZeroAndMulWithOverflow(Value *Op0, Value *Op1, bool IsAnd);
+LLVM_FUNC_ABI bool isCheckForZeroAndMulWithOverflow(Value *Op0, Value *Op1, bool IsAnd);
 } // end namespace llvm
 
 #endif
diff --git a/llvm/include/llvm/Analysis/PHITransAddr.h b/llvm/include/llvm/Analysis/PHITransAddr.h
index 364fcd82710cb38..c737d75a1e04348 100644
--- a/llvm/include/llvm/Analysis/PHITransAddr.h
+++ b/llvm/include/llvm/Analysis/PHITransAddr.h
@@ -33,7 +33,7 @@ class TargetLibraryInfo;
 /// This is designed to be a relatively small object that lives on the stack and
 /// is copyable.
 ///
-class PHITransAddr {
+class LLVM_CLASS_ABI PHITransAddr {
   /// Addr - The actual address we're analyzing.
   Value *Addr;
 
diff --git a/llvm/include/llvm/Analysis/Passes.h b/llvm/include/llvm/Analysis/Passes.h
index 63df72c33f8b798..a8bd14d22877d26 100644
--- a/llvm/include/llvm/Analysis/Passes.h
+++ b/llvm/include/llvm/Analysis/Passes.h
@@ -25,41 +25,41 @@ namespace llvm {
   //
   /// createLazyValueInfoPass - This creates an instance of the LazyValueInfo
   /// pass.
-  FunctionPass *createLazyValueInfoPass();
+  LLVM_FUNC_ABI FunctionPass *createLazyValueInfoPass();
 
   //===--------------------------------------------------------------------===//
   //
   // createDependenceAnalysisWrapperPass - This creates an instance of the
   // DependenceAnalysisWrapper pass.
   //
-  FunctionPass *createDependenceAnalysisWrapperPass();
+  LLVM_FUNC_ABI FunctionPass *createDependenceAnalysisWrapperPass();
 
   //===--------------------------------------------------------------------===//
   //
   // createCostModelAnalysisPass - This creates an instance of the
   // CostModelAnalysis pass.
   //
-  FunctionPass *createCostModelAnalysisPass();
+  LLVM_FUNC_ABI FunctionPass *createCostModelAnalysisPass();
 
   //===--------------------------------------------------------------------===//
   //
   // createDelinearizationPass - This pass implements attempts to restore
   // multidimensional array indices from linearized expressions.
   //
-  FunctionPass *createDelinearizationPass();
+  LLVM_FUNC_ABI FunctionPass *createDelinearizationPass();
 
   //===--------------------------------------------------------------------===//
   //
   // Minor pass prototypes, allowing us to expose them through bugpoint and
   // analyze.
-  FunctionPass *createInstCountPass();
+  LLVM_FUNC_ABI FunctionPass *createInstCountPass();
 
   //===--------------------------------------------------------------------===//
   //
   // createRegionInfoPass - This pass finds all single entry single exit regions
   // in a function and builds the region hierarchy.
   //
-  FunctionPass *createRegionInfoPass();
+  LLVM_FUNC_ABI FunctionPass *createRegionInfoPass();
 }
 
 #endif
diff --git a/llvm/include/llvm/Analysis/PhiValues.h b/llvm/include/llvm/Analysis/PhiValues.h
index 7ee5dc05bae480d..43f8ca775e3e912 100644
--- a/llvm/include/llvm/Analysis/PhiValues.h
+++ b/llvm/include/llvm/Analysis/PhiValues.h
@@ -38,7 +38,7 @@ class Function;
 ///
 /// Initially the PhiValues is empty, and gets incrementally populated whenever
 /// it is queried.
-class PhiValues {
+class LLVM_CLASS_ABI PhiValues {
 public:
   using ValueSet = SmallSetVector<Value *, 4>;
 
@@ -113,7 +113,7 @@ class PhiValues {
 ///
 /// The analysis does nothing by itself, and just returns an empty PhiValues
 /// which will get filled in as it's used.
-class PhiValuesAnalysis : public AnalysisInfoMixin<PhiValuesAnalysis> {
+class LLVM_CLASS_ABI PhiValuesAnalysis : public AnalysisInfoMixin<PhiValuesAnalysis> {
   friend AnalysisInfoMixin<PhiValuesAnalysis>;
   static AnalysisKey Key;
 
@@ -127,7 +127,7 @@ class PhiValuesAnalysis : public AnalysisInfoMixin<PhiValuesAnalysis> {
 /// This pass doesn't print whatever information the PhiValues happens to hold,
 /// but instead first uses the PhiValues to analyze all the phis in the function
 /// so the complete information is printed.
-class PhiValuesPrinterPass : public PassInfoMixin<PhiValuesPrinterPass> {
+class LLVM_CLASS_ABI PhiValuesPrinterPass : public PassInfoMixin<PhiValuesPrinterPass> {
   raw_ostream &OS;
 
 public:
@@ -136,7 +136,7 @@ class PhiValuesPrinterPass : public PassInfoMixin<PhiValuesPrinterPass> {
 };
 
 /// Wrapper pass for the legacy pass manager
-class PhiValuesWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI PhiValuesWrapperPass : public FunctionPass {
   std::unique_ptr<PhiValues> Result;
 
 public:
diff --git a/llvm/include/llvm/Analysis/PostDominators.h b/llvm/include/llvm/Analysis/PostDominators.h
index e2a0e37b1a91f16..6bfe782fc0553db 100644
--- a/llvm/include/llvm/Analysis/PostDominators.h
+++ b/llvm/include/llvm/Analysis/PostDominators.h
@@ -26,7 +26,7 @@ class raw_ostream;
 
 /// PostDominatorTree Class - Concrete subclass of DominatorTree that is used to
 /// compute the post-dominator tree.
-class PostDominatorTree : public PostDomTreeBase<BasicBlock> {
+class LLVM_CLASS_ABI PostDominatorTree : public PostDomTreeBase<BasicBlock> {
 public:
   using Base = PostDomTreeBase<BasicBlock>;
 
@@ -45,7 +45,7 @@ class PostDominatorTree : public PostDomTreeBase<BasicBlock> {
 };
 
 /// Analysis pass which computes a \c PostDominatorTree.
-class PostDominatorTreeAnalysis
+class LLVM_CLASS_ABI PostDominatorTreeAnalysis
     : public AnalysisInfoMixin<PostDominatorTreeAnalysis> {
   friend AnalysisInfoMixin<PostDominatorTreeAnalysis>;
 
@@ -61,7 +61,7 @@ class PostDominatorTreeAnalysis
 };
 
 /// Printer pass for the \c PostDominatorTree.
-class PostDominatorTreePrinterPass
+class LLVM_CLASS_ABI PostDominatorTreePrinterPass
     : public PassInfoMixin<PostDominatorTreePrinterPass> {
   raw_ostream &OS;
 
@@ -71,7 +71,7 @@ class PostDominatorTreePrinterPass
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
-struct PostDominatorTreeWrapperPass : public FunctionPass {
+struct LLVM_CLASS_ABI PostDominatorTreeWrapperPass : public FunctionPass {
   static char ID; // Pass identification, replacement for typeid
 
   PostDominatorTree DT;
@@ -94,9 +94,9 @@ struct PostDominatorTreeWrapperPass : public FunctionPass {
   void print(raw_ostream &OS, const Module*) const override;
 };
 
-FunctionPass* createPostDomTree();
+LLVM_FUNC_ABI FunctionPass* createPostDomTree();
 
-template <> struct GraphTraits<PostDominatorTree*>
+template <> struct LLVM_CLASS_ABI GraphTraits<PostDominatorTree*>
   : public GraphTraits<DomTreeNode*> {
   static NodeRef getEntryNode(PostDominatorTree *DT) {
     return DT->getRootNode();
diff --git a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
index ae771016767a342..b6260fe4b80f572 100644
--- a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
+++ b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
@@ -40,7 +40,7 @@ class MachineFunction;
 
 // FIXME: Provide convenience methods to determine hotness/coldness of other IR
 // units. This would require making this depend on BFI.
-class ProfileSummaryInfo {
+class LLVM_CLASS_ABI ProfileSummaryInfo {
 private:
   const Module *M;
   std::unique_ptr<ProfileSummary> Summary;
@@ -352,7 +352,7 @@ ProfileSummaryInfo::getEntryCount<MachineFunction>(
     const MachineFunction *F) const;
 
 /// An analysis pass based on legacy pass manager to deliver ProfileSummaryInfo.
-class ProfileSummaryInfoWrapperPass : public ImmutablePass {
+class LLVM_CLASS_ABI ProfileSummaryInfoWrapperPass : public ImmutablePass {
   std::unique_ptr<ProfileSummaryInfo> PSI;
 
 public:
@@ -370,7 +370,7 @@ class ProfileSummaryInfoWrapperPass : public ImmutablePass {
 };
 
 /// An analysis pass based on the new PM to deliver ProfileSummaryInfo.
-class ProfileSummaryAnalysis
+class LLVM_CLASS_ABI ProfileSummaryAnalysis
     : public AnalysisInfoMixin<ProfileSummaryAnalysis> {
 public:
   typedef ProfileSummaryInfo Result;
@@ -383,7 +383,7 @@ class ProfileSummaryAnalysis
 };
 
 /// Printer pass that uses \c ProfileSummaryAnalysis.
-class ProfileSummaryPrinterPass
+class LLVM_CLASS_ABI ProfileSummaryPrinterPass
     : public PassInfoMixin<ProfileSummaryPrinterPass> {
   raw_ostream &OS;
 
diff --git a/llvm/include/llvm/Analysis/PtrUseVisitor.h b/llvm/include/llvm/Analysis/PtrUseVisitor.h
index fbac51f1d12aaa2..43de79906565444 100644
--- a/llvm/include/llvm/Analysis/PtrUseVisitor.h
+++ b/llvm/include/llvm/Analysis/PtrUseVisitor.h
@@ -45,7 +45,7 @@ namespace detail {
 /// usage. This class is just a helper base class which is not templated and
 /// contains all common code to be shared between different instantiations of
 /// PtrUseVisitor.
-class PtrUseVisitorBase {
+class LLVM_CLASS_ABI PtrUseVisitorBase {
 public:
   /// This class provides information about the result of a visit.
   ///
@@ -196,7 +196,7 @@ class PtrUseVisitorBase {
 ///
 /// FIXME: Generalize this for all values rather than just instructions.
 template <typename DerivedT>
-class PtrUseVisitor : protected InstVisitor<DerivedT>,
+class LLVM_CLASS_ABI PtrUseVisitor : protected InstVisitor<DerivedT>,
                       public detail::PtrUseVisitorBase {
   friend class InstVisitor<DerivedT>;
 
diff --git a/llvm/include/llvm/Analysis/RegionInfo.h b/llvm/include/llvm/Analysis/RegionInfo.h
index 7bbc35a1e65d858..2e7640441d37987 100644
--- a/llvm/include/llvm/Analysis/RegionInfo.h
+++ b/llvm/include/llvm/Analysis/RegionInfo.h
@@ -73,7 +73,7 @@ class raw_ostream;
 // (i.e. BasicBlocks or MachineBasicBlocks). This is only to avoid needing to
 // pass around an unreasonable number of template parameters.
 template <class FuncT_>
-struct RegionTraits {
+struct LLVM_CLASS_ABI RegionTraits {
   // FuncT
   // BlockT
   // RegionT
@@ -83,7 +83,7 @@ struct RegionTraits {
 };
 
 template <>
-struct RegionTraits<Function> {
+struct LLVM_CLASS_ABI RegionTraits<Function> {
   using FuncT = Function;
   using BlockT = BasicBlock;
   using RegionT = Region;
@@ -110,12 +110,12 @@ struct RegionTraits<Function> {
 /// selected for SubRegions just one RegionNode containing the subregion is
 /// returned.
 template <class GraphType>
-class FlatIt {};
+class LLVM_CLASS_ABI FlatIt {};
 
 /// A RegionNode represents a subregion or a BasicBlock that is part of a
 /// Region.
 template <class Tr>
-class RegionNodeBase {
+class LLVM_CLASS_ABI RegionNodeBase {
   friend class RegionBase<Tr>;
 
 public:
@@ -252,7 +252,7 @@ class RegionNodeBase {
 /// The first call returns a textual representation of the program structure
 /// tree, the second one creates a graphical representation using graphviz.
 template <class Tr>
-class RegionBase : public RegionNodeBase<Tr> {
+class LLVM_CLASS_ABI RegionBase : public RegionNodeBase<Tr> {
   friend class RegionInfoBase<Tr>;
 
   using FuncT = typename Tr::FuncT;
@@ -672,7 +672,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const RegionNodeBase<Tr> &Node);
 /// are connected using the parent relation. This builds a Program Structure
 /// Tree.
 template <class Tr>
-class RegionInfoBase {
+class LLVM_CLASS_ABI RegionInfoBase {
   friend class RegionInfo;
   friend class MachineRegionInfo;
 
@@ -877,7 +877,7 @@ class RegionInfoBase {
   void verifyAnalysis() const;
 };
 
-class RegionNode : public RegionNodeBase<RegionTraits<Function>> {
+class LLVM_CLASS_ABI RegionNode : public RegionNodeBase<RegionTraits<Function>> {
 public:
   inline RegionNode(Region *Parent, BasicBlock *Entry, bool isSubRegion = false)
       : RegionNodeBase<RegionTraits<Function>>(Parent, Entry, isSubRegion) {}
@@ -887,7 +887,7 @@ class RegionNode : public RegionNodeBase<RegionTraits<Function>> {
   }
 };
 
-class Region : public RegionBase<RegionTraits<Function>> {
+class LLVM_CLASS_ABI Region : public RegionBase<RegionTraits<Function>> {
 public:
   Region(BasicBlock *Entry, BasicBlock *Exit, RegionInfo *RI, DominatorTree *DT,
          Region *Parent = nullptr);
@@ -898,7 +898,7 @@ class Region : public RegionBase<RegionTraits<Function>> {
   }
 };
 
-class RegionInfo : public RegionInfoBase<RegionTraits<Function>> {
+class LLVM_CLASS_ABI RegionInfo : public RegionInfoBase<RegionTraits<Function>> {
 public:
   using Base = RegionInfoBase<RegionTraits<Function>>;
 
@@ -940,7 +940,7 @@ class RegionInfo : public RegionInfoBase<RegionTraits<Function>> {
 #endif
 };
 
-class RegionInfoPass : public FunctionPass {
+class LLVM_CLASS_ABI RegionInfoPass : public FunctionPass {
   RegionInfo RI;
 
 public:
@@ -965,7 +965,7 @@ class RegionInfoPass : public FunctionPass {
 };
 
 /// Analysis pass that exposes the \c RegionInfo for a function.
-class RegionInfoAnalysis : public AnalysisInfoMixin<RegionInfoAnalysis> {
+class LLVM_CLASS_ABI RegionInfoAnalysis : public AnalysisInfoMixin<RegionInfoAnalysis> {
   friend AnalysisInfoMixin<RegionInfoAnalysis>;
 
   static AnalysisKey Key;
@@ -977,7 +977,7 @@ class RegionInfoAnalysis : public AnalysisInfoMixin<RegionInfoAnalysis> {
 };
 
 /// Printer pass for the \c RegionInfo.
-class RegionInfoPrinterPass : public PassInfoMixin<RegionInfoPrinterPass> {
+class LLVM_CLASS_ABI RegionInfoPrinterPass : public PassInfoMixin<RegionInfoPrinterPass> {
   raw_ostream &OS;
 
 public:
@@ -987,7 +987,7 @@ class RegionInfoPrinterPass : public PassInfoMixin<RegionInfoPrinterPass> {
 };
 
 /// Verifier pass for the \c RegionInfo.
-struct RegionInfoVerifierPass : PassInfoMixin<RegionInfoVerifierPass> {
+struct LLVM_CLASS_ABI RegionInfoVerifierPass : PassInfoMixin<RegionInfoVerifierPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Analysis/RegionIterator.h b/llvm/include/llvm/Analysis/RegionIterator.h
index ee0d857a44b935b..c5aafb486597b38 100644
--- a/llvm/include/llvm/Analysis/RegionIterator.h
+++ b/llvm/include/llvm/Analysis/RegionIterator.h
@@ -36,7 +36,7 @@ class RegionInfo;
 ///
 /// For a subregion RegionNode there is just one successor. The RegionNode
 /// representing the exit of the subregion.
-template <class NodeRef, class BlockT, class RegionT> class RNSuccIterator {
+template <class NodeRef, class BlockT, class RegionT> class LLVM_CLASS_ABI RNSuccIterator {
 public:
   using iterator_category = std::forward_iterator_tag;
   using value_type = NodeRef;
@@ -168,7 +168,7 @@ template <class NodeRef, class BlockT, class RegionT> class RNSuccIterator {
 /// are contained in the Region and its subregions. This is close to a virtual
 /// control flow graph of the Region.
 template <class NodeRef, class BlockT, class RegionT>
-class RNSuccIterator<FlatIt<NodeRef>, BlockT, RegionT> {
+class LLVM_CLASS_ABI RNSuccIterator<FlatIt<NodeRef>, BlockT, RegionT> {
   using BlockTraits = GraphTraits<BlockT *>;
   using SuccIterTy = typename BlockTraits::ChildIteratorType;
 
@@ -324,7 +324,7 @@ RegionNodeGraphTraits(const RegionNode, BasicBlock, Region);
 RegionGraphTraits(Region, RegionNode);
 RegionGraphTraits(const Region, const RegionNode);
 
-template <> struct GraphTraits<RegionInfo*>
+template <> struct LLVM_CLASS_ABI GraphTraits<RegionInfo*>
   : public GraphTraits<FlatIt<RegionNode*>> {
   using nodes_iterator =
       df_iterator<NodeRef, df_iterator_default_set<NodeRef>, false,
@@ -343,7 +343,7 @@ template <> struct GraphTraits<RegionInfo*>
   }
 };
 
-template <> struct GraphTraits<RegionInfoPass*>
+template <> struct LLVM_CLASS_ABI GraphTraits<RegionInfoPass*>
   : public GraphTraits<RegionInfo *> {
   using nodes_iterator =
       df_iterator<NodeRef, df_iterator_default_set<NodeRef>, false,
diff --git a/llvm/include/llvm/Analysis/RegionPass.h b/llvm/include/llvm/Analysis/RegionPass.h
index 2b23a20752504a6..382770800e42ab3 100644
--- a/llvm/include/llvm/Analysis/RegionPass.h
+++ b/llvm/include/llvm/Analysis/RegionPass.h
@@ -30,7 +30,7 @@ class RegionInfo;
 /// A pass that runs on each Region in a function.
 ///
 /// RegionPass is managed by RGPassManager.
-class RegionPass : public Pass {
+class LLVM_CLASS_ABI RegionPass : public Pass {
 public:
   explicit RegionPass(char &pid) : Pass(PT_Region, pid) {}
 
@@ -85,7 +85,7 @@ class RegionPass : public Pass {
 };
 
 /// The pass manager to schedule RegionPasses.
-class RGPassManager : public FunctionPass, public PMDataManager {
+class LLVM_CLASS_ABI RGPassManager : public FunctionPass, public PMDataManager {
   std::deque<Region*> RQ;
   RegionInfo *RI;
   Region *CurrentRegion;
diff --git a/llvm/include/llvm/Analysis/RegionPrinter.h b/llvm/include/llvm/Analysis/RegionPrinter.h
index 3c38e58b41c56e6..baefa36b107c736 100644
--- a/llvm/include/llvm/Analysis/RegionPrinter.h
+++ b/llvm/include/llvm/Analysis/RegionPrinter.h
@@ -23,13 +23,13 @@ namespace llvm {
   class Function;
   class RegionInfo;
 
-  FunctionPass *createRegionViewerPass();
-  FunctionPass *createRegionOnlyViewerPass();
-  FunctionPass *createRegionPrinterPass();
-  FunctionPass *createRegionOnlyPrinterPass();
+  LLVM_FUNC_ABI FunctionPass *createRegionViewerPass();
+  LLVM_FUNC_ABI FunctionPass *createRegionOnlyViewerPass();
+  LLVM_FUNC_ABI FunctionPass *createRegionPrinterPass();
+  LLVM_FUNC_ABI FunctionPass *createRegionOnlyPrinterPass();
 
   template <>
-  struct DOTGraphTraits<RegionNode *> : public DefaultDOTGraphTraits {
+  struct LLVM_CLASS_ABI DOTGraphTraits<RegionNode *> : public DefaultDOTGraphTraits {
     DOTGraphTraits(bool isSimple = false) : DefaultDOTGraphTraits(isSimple) {}
 
     std::string getNodeLabel(RegionNode *Node, RegionNode *Graph);
diff --git a/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h b/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h
index c0ce5dfadf6e416..279691bb6b96054 100644
--- a/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h
+++ b/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h
@@ -27,7 +27,7 @@ namespace llvm {
 /// ReleaseModeModelRunner - production mode implementation of the
 /// MLModelRunner. It uses an AOT-compiled SavedModel for efficient execution.
 template <class TGen>
-class ReleaseModeModelRunner final : public MLModelRunner {
+class LLVM_CLASS_ABI ReleaseModeModelRunner final : public MLModelRunner {
 public:
   /// FeatureNames' type should be an indexed collection of std::string, like
   /// std::array or std::vector, that has a size() method.
@@ -72,7 +72,7 @@ class ReleaseModeModelRunner final : public MLModelRunner {
 /// A mock class satisfying the interface expected by ReleaseModeModelRunner for
 /// its `TGen` parameter. Useful to avoid conditional compilation complexity, as
 /// a compile-time replacement for a real AOT-ed model.
-class NoopSavedModelImpl final {
+class LLVM_CLASS_ABI NoopSavedModelImpl final {
 #define NOOP_MODEL_ERRMSG                                                      \
   "The mock AOT-ed saved model is a compile-time stub and should not be "      \
   "called."
diff --git a/llvm/include/llvm/Analysis/ReplayInlineAdvisor.h b/llvm/include/llvm/Analysis/ReplayInlineAdvisor.h
index 71abd958ee6bd3a..cadf94e2eec7b2f 100644
--- a/llvm/include/llvm/Analysis/ReplayInlineAdvisor.h
+++ b/llvm/include/llvm/Analysis/ReplayInlineAdvisor.h
@@ -19,7 +19,7 @@ class Function;
 class LLVMContext;
 class Module;
 
-struct CallSiteFormat {
+struct LLVM_CLASS_ABI CallSiteFormat {
   enum class Format : int {
     Line,
     LineColumn,
@@ -41,7 +41,7 @@ struct CallSiteFormat {
 };
 
 /// Replay Inliner Setup
-struct ReplayInlinerSettings {
+struct LLVM_CLASS_ABI ReplayInlinerSettings {
   enum class Scope : int { Function, Module };
   enum class Fallback : int { Original, AlwaysInline, NeverInline };
 
@@ -52,9 +52,9 @@ struct ReplayInlinerSettings {
 };
 
 /// Get call site location as a string with the given format
-std::string formatCallSiteLocation(DebugLoc DLoc, const CallSiteFormat &Format);
+LLVM_FUNC_ABI std::string formatCallSiteLocation(DebugLoc DLoc, const CallSiteFormat &Format);
 
-std::unique_ptr<InlineAdvisor>
+LLVM_FUNC_ABI std::unique_ptr<InlineAdvisor>
 getReplayInlineAdvisor(Module &M, FunctionAnalysisManager &FAM,
                        LLVMContext &Context,
                        std::unique_ptr<InlineAdvisor> OriginalAdvisor,
@@ -63,7 +63,7 @@ getReplayInlineAdvisor(Module &M, FunctionAnalysisManager &FAM,
 
 /// Replay inline advisor that uses optimization remarks from inlining of
 /// previous build to guide current inlining. This is useful for inliner tuning.
-class ReplayInlineAdvisor : public InlineAdvisor {
+class LLVM_CLASS_ABI ReplayInlineAdvisor : public InlineAdvisor {
 public:
   ReplayInlineAdvisor(Module &M, FunctionAnalysisManager &FAM,
                       LLVMContext &Context,
diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h
index 3bdc15f47397f3c..ae21363db543fb9 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolution.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolution.h
@@ -68,12 +68,12 @@ class Type;
 class Value;
 enum SCEVTypes : unsigned short;
 
-extern bool VerifySCEV;
+LLVM_FUNC_ABI extern bool VerifySCEV;
 
 /// This class represents an analyzed expression in the program.  These are
 /// opaque objects that the client is not allowed to do much with directly.
 ///
-class SCEV : public FoldingSetNode {
+class LLVM_CLASS_ABI SCEV : public FoldingSetNode {
   friend struct FoldingSetTrait<SCEV>;
 
   /// A reference to an Interned FoldingSetNodeID for this node.  The
@@ -185,7 +185,7 @@ class SCEV : public FoldingSetNode {
 
 // Specialize FoldingSetTrait for SCEV to avoid needing to compute
 // temporary FoldingSetNodeID values.
-template <> struct FoldingSetTrait<SCEV> : DefaultFoldingSetTrait<SCEV> {
+template <> struct LLVM_CLASS_ABI FoldingSetTrait<SCEV> : DefaultFoldingSetTrait<SCEV> {
   static void Profile(const SCEV &X, FoldingSetNodeID &ID) { ID = X.FastID; }
 
   static bool Equals(const SCEV &X, const FoldingSetNodeID &ID, unsigned IDHash,
@@ -207,7 +207,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const SCEV &S) {
 /// For example, if you ask for the number of iterations of a linked-list
 /// traversal loop, you will get one of these.  None of the standard SCEV
 /// operations are valid on this class, it is just a marker.
-struct SCEVCouldNotCompute : public SCEV {
+struct LLVM_CLASS_ABI SCEVCouldNotCompute : public SCEV {
   SCEVCouldNotCompute();
 
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -216,7 +216,7 @@ struct SCEVCouldNotCompute : public SCEV {
 
 /// This class represents an assumption made using SCEV expressions which can
 /// be checked at run-time.
-class SCEVPredicate : public FoldingSetNode {
+class LLVM_CLASS_ABI SCEVPredicate : public FoldingSetNode {
   friend struct FoldingSetTrait<SCEVPredicate>;
 
   /// A reference to an Interned FoldingSetNodeID for this node.  The
@@ -261,7 +261,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const SCEVPredicate &P) {
 // Specialize FoldingSetTrait for SCEVPredicate to avoid needing to compute
 // temporary FoldingSetNodeID values.
 template <>
-struct FoldingSetTrait<SCEVPredicate> : DefaultFoldingSetTrait<SCEVPredicate> {
+struct LLVM_CLASS_ABI FoldingSetTrait<SCEVPredicate> : DefaultFoldingSetTrait<SCEVPredicate> {
   static void Profile(const SCEVPredicate &X, FoldingSetNodeID &ID) {
     ID = X.FastID;
   }
@@ -279,7 +279,7 @@ struct FoldingSetTrait<SCEVPredicate> : DefaultFoldingSetTrait<SCEVPredicate> {
 
 /// This class represents an assumption that the expression LHS Pred RHS
 /// evaluates to true, and this can be checked at run-time.
-class SCEVComparePredicate final : public SCEVPredicate {
+class LLVM_CLASS_ABI SCEVComparePredicate final : public SCEVPredicate {
   /// We assume that LHS Pred RHS is true.
   const ICmpInst::Predicate Pred;
   const SCEV *LHS;
@@ -319,7 +319,7 @@ class SCEVComparePredicate final : public SCEVPredicate {
 /// predicated backedge taken count of X, we only guarantee that {0,+,1} has
 /// nusw in the first X iterations. {0,+,1} may still wrap in the loop if we
 /// have more than X iterations.
-class SCEVWrapPredicate final : public SCEVPredicate {
+class LLVM_CLASS_ABI SCEVWrapPredicate final : public SCEVPredicate {
 public:
   /// Similar to SCEV::NoWrapFlags, but with slightly different semantics
   /// for FlagNUSW. The increment is considered to be signed, and a + b
@@ -414,7 +414,7 @@ class SCEVWrapPredicate final : public SCEVPredicate {
 ///
 /// NB! Unlike other SCEVPredicate sub-classes this class does not live in the
 /// ScalarEvolution::Preds folding set.  This is why the \c add function is sound.
-class SCEVUnionPredicate final : public SCEVPredicate {
+class LLVM_CLASS_ABI SCEVUnionPredicate final : public SCEVPredicate {
 private:
   using PredicateMap =
       DenseMap<const SCEV *, SmallVector<const SCEVPredicate *, 4>>;
@@ -450,7 +450,7 @@ class SCEVUnionPredicate final : public SCEVPredicate {
 /// The main scalar evolution driver. Because client code (intentionally)
 /// can't do much with the SCEV objects directly, they must ask this class
 /// for services.
-class ScalarEvolution {
+class LLVM_CLASS_ABI ScalarEvolution {
   friend class ScalarEvolutionsTest;
 
 public:
@@ -2218,7 +2218,7 @@ class ScalarEvolution {
 };
 
 /// Analysis pass that exposes the \c ScalarEvolution for a function.
-class ScalarEvolutionAnalysis
+class LLVM_CLASS_ABI ScalarEvolutionAnalysis
     : public AnalysisInfoMixin<ScalarEvolutionAnalysis> {
   friend AnalysisInfoMixin<ScalarEvolutionAnalysis>;
 
@@ -2231,14 +2231,14 @@ class ScalarEvolutionAnalysis
 };
 
 /// Verifier pass for the \c ScalarEvolutionAnalysis results.
-class ScalarEvolutionVerifierPass
+class LLVM_CLASS_ABI ScalarEvolutionVerifierPass
     : public PassInfoMixin<ScalarEvolutionVerifierPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
 /// Printer pass for the \c ScalarEvolutionAnalysis results.
-class ScalarEvolutionPrinterPass
+class LLVM_CLASS_ABI ScalarEvolutionPrinterPass
     : public PassInfoMixin<ScalarEvolutionPrinterPass> {
   raw_ostream &OS;
 
@@ -2248,7 +2248,7 @@ class ScalarEvolutionPrinterPass
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
-class ScalarEvolutionWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI ScalarEvolutionWrapperPass : public FunctionPass {
   std::unique_ptr<ScalarEvolution> SE;
 
 public:
@@ -2279,7 +2279,7 @@ class ScalarEvolutionWrapperPass : public FunctionPass {
 ///     rewriting, we will continue to get an AddRec expression for that
 ///     Value.
 ///   - lowers the number of expression rewrites.
-class PredicatedScalarEvolution {
+class LLVM_CLASS_ABI PredicatedScalarEvolution {
 public:
   PredicatedScalarEvolution(ScalarEvolution &SE, Loop &L);
 
@@ -2364,7 +2364,7 @@ class PredicatedScalarEvolution {
   const SCEV *BackedgeCount = nullptr;
 };
 
-template <> struct DenseMapInfo<ScalarEvolution::FoldID> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<ScalarEvolution::FoldID> {
   static inline ScalarEvolution::FoldID getEmptyKey() {
     ScalarEvolution::FoldID ID(0);
     return ID;
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
index 4182091f84f59e3..e65b8ad679a77e9 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
@@ -25,7 +25,7 @@ class SCEV;
 
 /// A simple alias analysis implementation that uses ScalarEvolution to answer
 /// queries.
-class SCEVAAResult : public AAResultBase {
+class LLVM_CLASS_ABI SCEVAAResult : public AAResultBase {
   ScalarEvolution &SE;
 
 public:
@@ -43,7 +43,7 @@ class SCEVAAResult : public AAResultBase {
 };
 
 /// Analysis pass providing a never-invalidated alias analysis result.
-class SCEVAA : public AnalysisInfoMixin<SCEVAA> {
+class LLVM_CLASS_ABI SCEVAA : public AnalysisInfoMixin<SCEVAA> {
   friend AnalysisInfoMixin<SCEVAA>;
   static AnalysisKey Key;
 
@@ -54,7 +54,7 @@ class SCEVAA : public AnalysisInfoMixin<SCEVAA> {
 };
 
 /// Legacy wrapper pass to provide the SCEVAAResult object.
-class SCEVAAWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI SCEVAAWrapperPass : public FunctionPass {
   std::unique_ptr<SCEVAAResult> Result;
 
 public:
@@ -70,7 +70,7 @@ class SCEVAAWrapperPass : public FunctionPass {
 };
 
 /// Creates an instance of \c SCEVAAWrapperPass.
-FunctionPass *createSCEVAAWrapperPass();
+LLVM_FUNC_ABI FunctionPass *createSCEVAAWrapperPass();
 
 }
 
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionDivision.h b/llvm/include/llvm/Analysis/ScalarEvolutionDivision.h
index 055e50c415c296b..82323469e2c4740 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionDivision.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionDivision.h
@@ -24,7 +24,7 @@ class ScalarEvolution;
 
 struct SCEVCouldNotCompute;
 
-struct SCEVDivision : public SCEVVisitor<SCEVDivision, void> {
+struct LLVM_CLASS_ABI SCEVDivision : public SCEVVisitor<SCEVDivision, void> {
 public:
   // Computes the Quotient and Remainder of the division of Numerator by
   // Denominator.
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
index 1a53dd54796fc6f..087c354a4d9ed19 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -59,7 +59,7 @@ enum SCEVTypes : unsigned short {
 };
 
 /// This class represents a constant integer value.
-class SCEVConstant : public SCEV {
+class LLVM_CLASS_ABI SCEVConstant : public SCEV {
   friend class ScalarEvolution;
 
   ConstantInt *V;
@@ -79,7 +79,7 @@ class SCEVConstant : public SCEV {
 
 /// This class represents the value of vscale, as used when defining the length
 /// of a scalable vector or returned by the llvm.vscale() intrinsic.
-class SCEVVScale : public SCEV {
+class LLVM_CLASS_ABI SCEVVScale : public SCEV {
   friend class ScalarEvolution;
 
   SCEVVScale(const FoldingSetNodeIDRef ID, Type *ty)
@@ -102,7 +102,7 @@ inline unsigned short computeExpressionSize(ArrayRef<const SCEV *> Args) {
 }
 
 /// This is the base class for unary cast operator classes.
-class SCEVCastExpr : public SCEV {
+class LLVM_CLASS_ABI SCEVCastExpr : public SCEV {
 protected:
   const SCEV *Op;
   Type *Ty;
@@ -129,7 +129,7 @@ class SCEVCastExpr : public SCEV {
 
 /// This class represents a cast from a pointer to a pointer-sized integer
 /// value.
-class SCEVPtrToIntExpr : public SCEVCastExpr {
+class LLVM_CLASS_ABI SCEVPtrToIntExpr : public SCEVCastExpr {
   friend class ScalarEvolution;
 
   SCEVPtrToIntExpr(const FoldingSetNodeIDRef ID, const SCEV *Op, Type *ITy);
@@ -140,7 +140,7 @@ class SCEVPtrToIntExpr : public SCEVCastExpr {
 };
 
 /// This is the base class for unary integral cast operator classes.
-class SCEVIntegralCastExpr : public SCEVCastExpr {
+class LLVM_CLASS_ABI SCEVIntegralCastExpr : public SCEVCastExpr {
 protected:
   SCEVIntegralCastExpr(const FoldingSetNodeIDRef ID, SCEVTypes SCEVTy,
                        const SCEV *op, Type *ty);
@@ -155,7 +155,7 @@ class SCEVIntegralCastExpr : public SCEVCastExpr {
 
 /// This class represents a truncation of an integer value to a
 /// smaller integer value.
-class SCEVTruncateExpr : public SCEVIntegralCastExpr {
+class LLVM_CLASS_ABI SCEVTruncateExpr : public SCEVIntegralCastExpr {
   friend class ScalarEvolution;
 
   SCEVTruncateExpr(const FoldingSetNodeIDRef ID, const SCEV *op, Type *ty);
@@ -167,7 +167,7 @@ class SCEVTruncateExpr : public SCEVIntegralCastExpr {
 
 /// This class represents a zero extension of a small integer value
 /// to a larger integer value.
-class SCEVZeroExtendExpr : public SCEVIntegralCastExpr {
+class LLVM_CLASS_ABI SCEVZeroExtendExpr : public SCEVIntegralCastExpr {
   friend class ScalarEvolution;
 
   SCEVZeroExtendExpr(const FoldingSetNodeIDRef ID, const SCEV *op, Type *ty);
@@ -181,7 +181,7 @@ class SCEVZeroExtendExpr : public SCEVIntegralCastExpr {
 
 /// This class represents a sign extension of a small integer value
 /// to a larger integer value.
-class SCEVSignExtendExpr : public SCEVIntegralCastExpr {
+class LLVM_CLASS_ABI SCEVSignExtendExpr : public SCEVIntegralCastExpr {
   friend class ScalarEvolution;
 
   SCEVSignExtendExpr(const FoldingSetNodeIDRef ID, const SCEV *op, Type *ty);
@@ -195,7 +195,7 @@ class SCEVSignExtendExpr : public SCEVIntegralCastExpr {
 
 /// This node is a base class providing common functionality for
 /// n'ary operators.
-class SCEVNAryExpr : public SCEV {
+class LLVM_CLASS_ABI SCEVNAryExpr : public SCEV {
 protected:
   // Since SCEVs are immutable, ScalarEvolution allocates operand
   // arrays with its SCEVAllocator, so this class just needs a simple
@@ -246,7 +246,7 @@ class SCEVNAryExpr : public SCEV {
 };
 
 /// This node is the base class for n'ary commutative operators.
-class SCEVCommutativeExpr : public SCEVNAryExpr {
+class LLVM_CLASS_ABI SCEVCommutativeExpr : public SCEVNAryExpr {
 protected:
   SCEVCommutativeExpr(const FoldingSetNodeIDRef ID, enum SCEVTypes T,
                       const SCEV *const *O, size_t N)
@@ -265,7 +265,7 @@ class SCEVCommutativeExpr : public SCEVNAryExpr {
 };
 
 /// This node represents an addition of some number of SCEVs.
-class SCEVAddExpr : public SCEVCommutativeExpr {
+class LLVM_CLASS_ABI SCEVAddExpr : public SCEVCommutativeExpr {
   friend class ScalarEvolution;
 
   Type *Ty;
@@ -289,7 +289,7 @@ class SCEVAddExpr : public SCEVCommutativeExpr {
 };
 
 /// This node represents multiplication of some number of SCEVs.
-class SCEVMulExpr : public SCEVCommutativeExpr {
+class LLVM_CLASS_ABI SCEVMulExpr : public SCEVCommutativeExpr {
   friend class ScalarEvolution;
 
   SCEVMulExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N)
@@ -303,7 +303,7 @@ class SCEVMulExpr : public SCEVCommutativeExpr {
 };
 
 /// This class represents a binary unsigned division operation.
-class SCEVUDivExpr : public SCEV {
+class LLVM_CLASS_ABI SCEVUDivExpr : public SCEV {
   friend class ScalarEvolution;
 
   std::array<const SCEV *, 2> Operands;
@@ -346,7 +346,7 @@ class SCEVUDivExpr : public SCEV {
 ///
 /// All operands of an AddRec are required to be loop invariant.
 ///
-class SCEVAddRecExpr : public SCEVNAryExpr {
+class LLVM_CLASS_ABI SCEVAddRecExpr : public SCEVNAryExpr {
   friend class ScalarEvolution;
 
   const Loop *L;
@@ -423,7 +423,7 @@ class SCEVAddRecExpr : public SCEVNAryExpr {
 };
 
 /// This node is the base class min/max selections.
-class SCEVMinMaxExpr : public SCEVCommutativeExpr {
+class LLVM_CLASS_ABI SCEVMinMaxExpr : public SCEVCommutativeExpr {
   friend class ScalarEvolution;
 
   static bool isMinMaxType(enum SCEVTypes T) {
@@ -463,7 +463,7 @@ class SCEVMinMaxExpr : public SCEVCommutativeExpr {
 };
 
 /// This class represents a signed maximum selection.
-class SCEVSMaxExpr : public SCEVMinMaxExpr {
+class LLVM_CLASS_ABI SCEVSMaxExpr : public SCEVMinMaxExpr {
   friend class ScalarEvolution;
 
   SCEVSMaxExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N)
@@ -475,7 +475,7 @@ class SCEVSMaxExpr : public SCEVMinMaxExpr {
 };
 
 /// This class represents an unsigned maximum selection.
-class SCEVUMaxExpr : public SCEVMinMaxExpr {
+class LLVM_CLASS_ABI SCEVUMaxExpr : public SCEVMinMaxExpr {
   friend class ScalarEvolution;
 
   SCEVUMaxExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N)
@@ -487,7 +487,7 @@ class SCEVUMaxExpr : public SCEVMinMaxExpr {
 };
 
 /// This class represents a signed minimum selection.
-class SCEVSMinExpr : public SCEVMinMaxExpr {
+class LLVM_CLASS_ABI SCEVSMinExpr : public SCEVMinMaxExpr {
   friend class ScalarEvolution;
 
   SCEVSMinExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N)
@@ -499,7 +499,7 @@ class SCEVSMinExpr : public SCEVMinMaxExpr {
 };
 
 /// This class represents an unsigned minimum selection.
-class SCEVUMinExpr : public SCEVMinMaxExpr {
+class LLVM_CLASS_ABI SCEVUMinExpr : public SCEVMinMaxExpr {
   friend class ScalarEvolution;
 
   SCEVUMinExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O, size_t N)
@@ -515,7 +515,7 @@ class SCEVUMinExpr : public SCEVMinMaxExpr {
 /// are early-returning upon reaching saturation point.
 /// I.e. given `0 umin_seq poison`, the result will be `0`,
 /// while the result of `0 umin poison` is `poison`.
-class SCEVSequentialMinMaxExpr : public SCEVNAryExpr {
+class LLVM_CLASS_ABI SCEVSequentialMinMaxExpr : public SCEVNAryExpr {
   friend class ScalarEvolution;
 
   static bool isSequentialMinMaxType(enum SCEVTypes T) {
@@ -558,7 +558,7 @@ class SCEVSequentialMinMaxExpr : public SCEVNAryExpr {
 };
 
 /// This class represents a sequential/in-order unsigned minimum selection.
-class SCEVSequentialUMinExpr : public SCEVSequentialMinMaxExpr {
+class LLVM_CLASS_ABI SCEVSequentialUMinExpr : public SCEVSequentialMinMaxExpr {
   friend class ScalarEvolution;
 
   SCEVSequentialUMinExpr(const FoldingSetNodeIDRef ID, const SCEV *const *O,
@@ -575,7 +575,7 @@ class SCEVSequentialUMinExpr : public SCEVSequentialMinMaxExpr {
 /// This means that we are dealing with an entirely unknown SCEV
 /// value, and only represent it as its LLVM Value.  This is the
 /// "bottom" value for the analysis.
-class SCEVUnknown final : public SCEV, private CallbackVH {
+class LLVM_CLASS_ABI SCEVUnknown final : public SCEV, private CallbackVH {
   friend class ScalarEvolution;
 
   /// The parent ScalarEvolution value. This is used to update the
@@ -606,7 +606,7 @@ class SCEVUnknown final : public SCEV, private CallbackVH {
 
 /// This class defines a simple visitor class that may be used for
 /// various SCEV analysis purposes.
-template <typename SC, typename RetVal = void> struct SCEVVisitor {
+template <typename SC, typename RetVal = void> struct LLVM_CLASS_ABI SCEVVisitor {
   RetVal visit(const SCEV *S) {
     switch (S->getSCEVType()) {
     case scConstant:
@@ -660,7 +660,7 @@ template <typename SC, typename RetVal = void> struct SCEVVisitor {
 ///   bool follow(const SCEV *S);
 ///   // return true to terminate the search.
 ///   bool isDone();
-template <typename SV> class SCEVTraversal {
+template <typename SV> class LLVM_CLASS_ABI SCEVTraversal {
   SV &Visitor;
   SmallVector<const SCEV *, 8> Worklist;
   SmallPtrSet<const SCEV *, 8> Visited;
@@ -719,7 +719,7 @@ template <typename SV> void visitAll(const SCEV *Root, SV &Visitor) {
 /// Return true if any node in \p Root satisfies the predicate \p Pred.
 template <typename PredTy>
 bool SCEVExprContains(const SCEV *Root, PredTy Pred) {
-  struct FindClosure {
+  struct LLVM_CLASS_ABI FindClosure {
     bool Found = false;
     PredTy Pred;
 
@@ -745,7 +745,7 @@ bool SCEVExprContains(const SCEV *Root, PredTy Pred) {
 /// The result from each visit is cached, so it will return the same
 /// SCEV for the same input.
 template <typename SC>
-class SCEVRewriteVisitor : public SCEVVisitor<SC, const SCEV *> {
+class LLVM_CLASS_ABI SCEVRewriteVisitor : public SCEVVisitor<SC, const SCEV *> {
 protected:
   ScalarEvolution &SE;
   // Memoize the result of each visit so that we only compute once for
@@ -901,7 +901,7 @@ using ValueToSCEVMapTy = DenseMap<const Value *, const SCEV *>;
 
 /// The SCEVParameterRewriter takes a scalar evolution expression and updates
 /// the SCEVUnknown components following the Map (Value -> SCEV).
-class SCEVParameterRewriter : public SCEVRewriteVisitor<SCEVParameterRewriter> {
+class LLVM_CLASS_ABI SCEVParameterRewriter : public SCEVRewriteVisitor<SCEVParameterRewriter> {
 public:
   static const SCEV *rewrite(const SCEV *Scev, ScalarEvolution &SE,
                              ValueToSCEVMapTy &Map) {
@@ -927,7 +927,7 @@ using LoopToScevMapT = DenseMap<const Loop *, const SCEV *>;
 
 /// The SCEVLoopAddRecRewriter takes a scalar evolution expression and applies
 /// the Map (Loop -> SCEV) to all AddRecExprs.
-class SCEVLoopAddRecRewriter
+class LLVM_CLASS_ABI SCEVLoopAddRecRewriter
     : public SCEVRewriteVisitor<SCEVLoopAddRecRewriter> {
 public:
   SCEVLoopAddRecRewriter(ScalarEvolution &SE, LoopToScevMapT &M)
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h b/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h
index 8899e72133b9aeb..4b7f650644c6f1a 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h
@@ -53,18 +53,18 @@ typedef function_ref<bool(const SCEVAddRecExpr *)> NormalizePredTy;
 /// Normalize \p S to be post-increment for all loops present in \p
 /// Loops. Returns nullptr if the result is not invertible and \p
 /// CheckInvertible is true.
-const SCEV *normalizeForPostIncUse(const SCEV *S, const PostIncLoopSet &Loops,
+LLVM_FUNC_ABI const SCEV *normalizeForPostIncUse(const SCEV *S, const PostIncLoopSet &Loops,
                                    ScalarEvolution &SE,
                                    bool CheckInvertible = true);
 
 /// Normalize \p S for all add recurrence sub-expressions for which \p
 /// Pred returns true.
-const SCEV *normalizeForPostIncUseIf(const SCEV *S, NormalizePredTy Pred,
+LLVM_FUNC_ABI const SCEV *normalizeForPostIncUseIf(const SCEV *S, NormalizePredTy Pred,
                                      ScalarEvolution &SE);
 
 /// Denormalize \p S to be post-increment for all loops present in \p
 /// Loops.
-const SCEV *denormalizeForPostIncUse(const SCEV *S, const PostIncLoopSet &Loops,
+LLVM_FUNC_ABI const SCEV *denormalizeForPostIncUse(const SCEV *S, const PostIncLoopSet &Loops,
                                      ScalarEvolution &SE);
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
index 87b41c4ce101867..b59f18de6539a2a 100644
--- a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
+++ b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h
@@ -27,7 +27,7 @@ class MDNode;
 class MemoryLocation;
 
 /// A simple AA result which uses scoped-noalias metadata to answer queries.
-class ScopedNoAliasAAResult : public AAResultBase {
+class LLVM_CLASS_ABI ScopedNoAliasAAResult : public AAResultBase {
 public:
   /// Handle invalidation events from the new pass manager.
   ///
@@ -49,7 +49,7 @@ class ScopedNoAliasAAResult : public AAResultBase {
 };
 
 /// Analysis pass providing a never-invalidated alias analysis result.
-class ScopedNoAliasAA : public AnalysisInfoMixin<ScopedNoAliasAA> {
+class LLVM_CLASS_ABI ScopedNoAliasAA : public AnalysisInfoMixin<ScopedNoAliasAA> {
   friend AnalysisInfoMixin<ScopedNoAliasAA>;
 
   static AnalysisKey Key;
@@ -61,7 +61,7 @@ class ScopedNoAliasAA : public AnalysisInfoMixin<ScopedNoAliasAA> {
 };
 
 /// Legacy wrapper pass to provide the ScopedNoAliasAAResult object.
-class ScopedNoAliasAAWrapperPass : public ImmutablePass {
+class LLVM_CLASS_ABI ScopedNoAliasAAWrapperPass : public ImmutablePass {
   std::unique_ptr<ScopedNoAliasAAResult> Result;
 
 public:
@@ -82,7 +82,7 @@ class ScopedNoAliasAAWrapperPass : public ImmutablePass {
 // createScopedNoAliasAAWrapperPass - This pass implements metadata-based
 // scoped noalias analysis.
 //
-ImmutablePass *createScopedNoAliasAAWrapperPass();
+LLVM_FUNC_ABI ImmutablePass *createScopedNoAliasAAWrapperPass();
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/SparsePropagation.h b/llvm/include/llvm/Analysis/SparsePropagation.h
index daacd91fb58b2e6..471450cfb97441f 100644
--- a/llvm/include/llvm/Analysis/SparsePropagation.h
+++ b/llvm/include/llvm/Analysis/SparsePropagation.h
@@ -27,7 +27,7 @@ namespace llvm {
 
 /// A template for translating between LLVM Values and LatticeKeys. Clients must
 /// provide a specialization of LatticeKeyInfo for their LatticeKey type.
-template <class LatticeKey> struct LatticeKeyInfo {
+template <class LatticeKey> struct LLVM_CLASS_ABI LatticeKeyInfo {
   // static inline Value *getValueFromLatticeKey(LatticeKey Key);
   // static inline LatticeKey getLatticeKeyFromValue(Value *V);
 };
@@ -45,7 +45,7 @@ class SparseSolver;
 /// Internally, the generic solver currently uses a DenseMap to map lattice keys
 /// to lattice values.  If the lattice key is a non-standard type, a
 /// specialization of DenseMapInfo must be provided.
-template <class LatticeKey, class LatticeVal> class AbstractLatticeFunction {
+template <class LatticeKey, class LatticeVal> class LLVM_CLASS_ABI AbstractLatticeFunction {
 private:
   LatticeVal UndefVal, OverdefinedVal, UntrackedVal;
 
@@ -111,7 +111,7 @@ template <class LatticeKey, class LatticeVal> class AbstractLatticeFunction {
 /// SparseSolver - This class is a general purpose solver for Sparse Conditional
 /// Propagation with a programmable lattice function.
 template <class LatticeKey, class LatticeVal, class KeyInfo>
-class SparseSolver {
+class LLVM_CLASS_ABI SparseSolver {
 
   /// LatticeFunc - This is the object that knows the lattice and how to
   /// compute transfer functions.
diff --git a/llvm/include/llvm/Analysis/StackLifetime.h b/llvm/include/llvm/Analysis/StackLifetime.h
index c95277baf2343ab..cf776a3ba1bdb32 100644
--- a/llvm/include/llvm/Analysis/StackLifetime.h
+++ b/llvm/include/llvm/Analysis/StackLifetime.h
@@ -35,7 +35,7 @@ class IntrinsicInst;
 /// * first instruction of any basic block
 /// Interesting instructions are numbered in the depth-first walk of the CFG,
 /// and in the program order inside each basic block.
-class StackLifetime {
+class LLVM_CLASS_ABI StackLifetime {
   /// A class representing liveness information for a single basic block.
   /// Each bit in the BitVector represents the liveness property
   /// for a different stack slot.
@@ -63,7 +63,7 @@ class StackLifetime {
   /// live.
   class LiveRange {
     BitVector Bits;
-    friend raw_ostream &operator<<(raw_ostream &OS,
+    friend LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                                    const StackLifetime::LiveRange &R);
 
   public:
@@ -182,7 +182,7 @@ inline raw_ostream &operator<<(raw_ostream &OS,
 }
 
 /// Printer pass for testing.
-class StackLifetimePrinterPass
+class LLVM_CLASS_ABI StackLifetimePrinterPass
     : public PassInfoMixin<StackLifetimePrinterPass> {
   StackLifetime::LivenessType Type;
   raw_ostream &OS;
diff --git a/llvm/include/llvm/Analysis/StackSafetyAnalysis.h b/llvm/include/llvm/Analysis/StackSafetyAnalysis.h
index f8611da024c519b..859971d420bf420 100644
--- a/llvm/include/llvm/Analysis/StackSafetyAnalysis.h
+++ b/llvm/include/llvm/Analysis/StackSafetyAnalysis.h
@@ -24,7 +24,7 @@ class AllocaInst;
 class ScalarEvolution;
 
 /// Interface to access stack safety analysis results for single function.
-class StackSafetyInfo {
+class LLVM_CLASS_ABI StackSafetyInfo {
 public:
   struct InfoTy;
 
@@ -56,7 +56,7 @@ class StackSafetyInfo {
   getParamAccesses(ModuleSummaryIndex &Index) const;
 };
 
-class StackSafetyGlobalInfo {
+class LLVM_CLASS_ABI StackSafetyGlobalInfo {
 public:
   struct InfoTy;
 
@@ -90,7 +90,7 @@ class StackSafetyGlobalInfo {
 };
 
 /// StackSafetyInfo wrapper for the new pass manager.
-class StackSafetyAnalysis : public AnalysisInfoMixin<StackSafetyAnalysis> {
+class LLVM_CLASS_ABI StackSafetyAnalysis : public AnalysisInfoMixin<StackSafetyAnalysis> {
   friend AnalysisInfoMixin<StackSafetyAnalysis>;
   static AnalysisKey Key;
 
@@ -100,7 +100,7 @@ class StackSafetyAnalysis : public AnalysisInfoMixin<StackSafetyAnalysis> {
 };
 
 /// Printer pass for the \c StackSafetyAnalysis results.
-class StackSafetyPrinterPass : public PassInfoMixin<StackSafetyPrinterPass> {
+class LLVM_CLASS_ABI StackSafetyPrinterPass : public PassInfoMixin<StackSafetyPrinterPass> {
   raw_ostream &OS;
 
 public:
@@ -109,7 +109,7 @@ class StackSafetyPrinterPass : public PassInfoMixin<StackSafetyPrinterPass> {
 };
 
 /// StackSafetyInfo wrapper for the legacy pass manager
-class StackSafetyInfoWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI StackSafetyInfoWrapperPass : public FunctionPass {
   StackSafetyInfo SSI;
 
 public:
@@ -126,7 +126,7 @@ class StackSafetyInfoWrapperPass : public FunctionPass {
 
 /// This pass performs the global (interprocedural) stack safety analysis (new
 /// pass manager).
-class StackSafetyGlobalAnalysis
+class LLVM_CLASS_ABI StackSafetyGlobalAnalysis
     : public AnalysisInfoMixin<StackSafetyGlobalAnalysis> {
   friend AnalysisInfoMixin<StackSafetyGlobalAnalysis>;
   static AnalysisKey Key;
@@ -137,7 +137,7 @@ class StackSafetyGlobalAnalysis
 };
 
 /// Printer pass for the \c StackSafetyGlobalAnalysis results.
-class StackSafetyGlobalPrinterPass
+class LLVM_CLASS_ABI StackSafetyGlobalPrinterPass
     : public PassInfoMixin<StackSafetyGlobalPrinterPass> {
   raw_ostream &OS;
 
@@ -148,7 +148,7 @@ class StackSafetyGlobalPrinterPass
 
 /// This pass performs the global (interprocedural) stack safety analysis
 /// (legacy pass manager).
-class StackSafetyGlobalInfoWrapperPass : public ModulePass {
+class LLVM_CLASS_ABI StackSafetyGlobalInfoWrapperPass : public ModulePass {
   StackSafetyGlobalInfo SSGI;
 
 public:
@@ -165,9 +165,9 @@ class StackSafetyGlobalInfoWrapperPass : public ModulePass {
   bool runOnModule(Module &M) override;
 };
 
-bool needsParamAccessSummary(const Module &M);
+LLVM_FUNC_ABI bool needsParamAccessSummary(const Module &M);
 
-void generateParamAccessSummary(ModuleSummaryIndex &Index);
+LLVM_FUNC_ABI void generateParamAccessSummary(ModuleSummaryIndex &Index);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/SyntheticCountsUtils.h b/llvm/include/llvm/Analysis/SyntheticCountsUtils.h
index 2b630bbd3d4b929..76ab3a58ff54c8e 100644
--- a/llvm/include/llvm/Analysis/SyntheticCountsUtils.h
+++ b/llvm/include/llvm/Analysis/SyntheticCountsUtils.h
@@ -25,7 +25,7 @@ namespace llvm {
 /// This class is templated on the type of the call graph and designed to work
 /// with the traditional per-module callgraph and the summary callgraphs used in
 /// ThinLTO. This contains only static methods and alias templates.
-template <typename CallGraphType> class SyntheticCountsUtils {
+template <typename CallGraphType> class LLVM_CLASS_ABI SyntheticCountsUtils {
 public:
   using Scaled64 = ScaledNumber<uint64_t>;
   using CGT = GraphTraits<CallGraphType>;
diff --git a/llvm/include/llvm/Analysis/TargetFolder.h b/llvm/include/llvm/Analysis/TargetFolder.h
index 58fe1ec4ee11759..6a6bcdbb4cde5f0 100644
--- a/llvm/include/llvm/Analysis/TargetFolder.h
+++ b/llvm/include/llvm/Analysis/TargetFolder.h
@@ -32,7 +32,7 @@ class DataLayout;
 class Type;
 
 /// TargetFolder - Create constants with target dependent folding.
-class TargetFolder final : public IRBuilderFolder {
+class LLVM_CLASS_ABI TargetFolder final : public IRBuilderFolder {
   const DataLayout &DL;
 
   /// Fold - Fold the constant using target specific information.
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
index c29c38cf5504854..4e0ef1af0096d3d 100644
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
@@ -28,7 +28,7 @@ class Triple;
 /// Describes a possible vectorization of a function.
 /// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized
 /// by a factor 'VectorizationFactor'.
-struct VecDesc {
+struct LLVM_CLASS_ABI VecDesc {
   StringRef ScalarFnName;
   StringRef VectorFnName;
   ElementCount VectorizationFactor;
@@ -49,7 +49,7 @@ struct VecDesc {
 /// make it available. However, it is somewhat expensive to compute and only
 /// depends on the triple. So users typically interact with the \c
 /// TargetLibraryInfo wrapper below.
-class TargetLibraryInfoImpl {
+class LLVM_CLASS_ABI TargetLibraryInfoImpl {
   friend class TargetLibraryInfo;
 
   unsigned char AvailableArray[(NumLibFuncs+3)/4];
@@ -235,7 +235,7 @@ class TargetLibraryInfoImpl {
 ///
 /// This both allows optimizations to handle them specially and frontends to
 /// disable such optimizations through -fno-builtin etc.
-class TargetLibraryInfo {
+class LLVM_CLASS_ABI TargetLibraryInfo {
   friend class TargetLibraryAnalysis;
   friend class TargetLibraryInfoWrapperPass;
 
@@ -543,7 +543,7 @@ class TargetLibraryInfo {
 ///
 /// Note that this pass's result cannot be invalidated, it is immutable for the
 /// life of the module.
-class TargetLibraryAnalysis : public AnalysisInfoMixin<TargetLibraryAnalysis> {
+class LLVM_CLASS_ABI TargetLibraryAnalysis : public AnalysisInfoMixin<TargetLibraryAnalysis> {
 public:
   typedef TargetLibraryInfo Result;
 
@@ -568,7 +568,7 @@ class TargetLibraryAnalysis : public AnalysisInfoMixin<TargetLibraryAnalysis> {
   std::optional<TargetLibraryInfoImpl> BaselineInfoImpl;
 };
 
-class TargetLibraryInfoWrapperPass : public ImmutablePass {
+class LLVM_CLASS_ABI TargetLibraryInfoWrapperPass : public ImmutablePass {
   TargetLibraryAnalysis TLA;
   std::optional<TargetLibraryInfo> TLI;
 
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index 4d48826e95b9742..ebebf09d30dd136 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -70,7 +70,7 @@ class VPIntrinsic;
 struct KnownBits;
 
 /// Information about a load/store intrinsic defined by the target.
-struct MemIntrinsicInfo {
+struct LLVM_CLASS_ABI MemIntrinsicInfo {
   /// This is the pointer that the intrinsic is loading from or storing to.
   /// If this is non-null, then analysis/optimization passes can assume that
   /// this intrinsic is functionally equivalent to a load/store from this
@@ -95,7 +95,7 @@ struct MemIntrinsicInfo {
 };
 
 /// Attributes of a target dependent hardware loop.
-struct HardwareLoopInfo {
+struct LLVM_CLASS_ABI HardwareLoopInfo {
   HardwareLoopInfo() = delete;
   HardwareLoopInfo(Loop *L);
   Loop *L = nullptr;
@@ -118,7 +118,7 @@ struct HardwareLoopInfo {
   bool canAnalyze(LoopInfo &LI);
 };
 
-class IntrinsicCostAttributes {
+class LLVM_CLASS_ABI IntrinsicCostAttributes {
   const IntrinsicInst *II = nullptr;
   Type *RetTy = nullptr;
   Intrinsic::ID IID;
@@ -194,7 +194,7 @@ enum class TailFoldingStyle {
   DataAndControlFlowWithoutRuntimeCheck
 };
 
-struct TailFoldingInfo {
+struct LLVM_CLASS_ABI TailFoldingInfo {
   TargetLibraryInfo *TLI;
   LoopVectorizationLegality *LVL;
   InterleavedAccessInfo *IAI;
@@ -208,7 +208,7 @@ typedef TargetTransformInfo TTI;
 
 /// This pass provides access to the codegen interfaces that are needed
 /// for IR-level transformations.
-class TargetTransformInfo {
+class LLVM_CLASS_ABI TargetTransformInfo {
 public:
   /// Construct a TTI object using a type implementing the \c Concept
   /// API below.
@@ -2763,7 +2763,7 @@ TargetTransformInfo::TargetTransformInfo(T Impl)
 /// is done in a subtarget specific way and LLVM supports compiling different
 /// functions targeting different subtargets in order to support runtime
 /// dispatch according to the observed subtarget.
-class TargetIRAnalysis : public AnalysisInfoMixin<TargetIRAnalysis> {
+class LLVM_CLASS_ABI TargetIRAnalysis : public AnalysisInfoMixin<TargetIRAnalysis> {
 public:
   typedef TargetTransformInfo Result;
 
@@ -2819,7 +2819,7 @@ class TargetIRAnalysis : public AnalysisInfoMixin<TargetIRAnalysis> {
 ///
 /// This pass can be constructed from a TTI object which it stores internally
 /// and is queried by passes.
-class TargetTransformInfoWrapperPass : public ImmutablePass {
+class LLVM_CLASS_ABI TargetTransformInfoWrapperPass : public ImmutablePass {
   TargetIRAnalysis TIRA;
   std::optional<TargetTransformInfo> TTI;
 
@@ -2843,7 +2843,7 @@ class TargetTransformInfoWrapperPass : public ImmutablePass {
 ///
 /// This analysis pass just holds the TTI instance and makes it available to
 /// clients.
-ImmutablePass *createTargetTransformInfoWrapperPass(TargetIRAnalysis TIRA);
+LLVM_FUNC_ABI ImmutablePass *createTargetTransformInfoWrapperPass(TargetIRAnalysis TIRA);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index a2e3d41ee4a740d..66ea98ec92fbd2a 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -32,7 +32,7 @@ class Function;
 
 /// Base class for use as a mix-in that aids implementing
 /// a TargetTransformInfo-compatible class.
-class TargetTransformInfoImplBase {
+class LLVM_CLASS_ABI TargetTransformInfoImplBase {
 protected:
   typedef TargetTransformInfo TTI;
 
@@ -977,7 +977,7 @@ class TargetTransformInfoImplBase {
 /// CRTP base class for use as a mix-in that aids implementing
 /// a TargetTransformInfo-compatible class.
 template <typename T>
-class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
+class LLVM_CLASS_ABI TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
 private:
   typedef TargetTransformInfoImplBase BaseT;
 
diff --git a/llvm/include/llvm/Analysis/TensorSpec.h b/llvm/include/llvm/Analysis/TensorSpec.h
index 599db5c1c0a865d..c32c85daec9ae8f 100644
--- a/llvm/include/llvm/Analysis/TensorSpec.h
+++ b/llvm/include/llvm/Analysis/TensorSpec.h
@@ -52,7 +52,7 @@ enum class TensorType {
       Total
 };
 
-class TensorSpec final {
+class LLVM_CLASS_ABI TensorSpec final {
 public:
   template <typename T>
   static TensorSpec createSpec(const std::string &Name,
@@ -105,7 +105,7 @@ class TensorSpec final {
 };
 
 /// For debugging.
-std::string tensorValueToString(const char *Buffer, const TensorSpec &Spec);
+LLVM_FUNC_ABI std::string tensorValueToString(const char *Buffer, const TensorSpec &Spec);
 
 /// Construct a TensorSpec from a JSON dictionary of the form:
 /// { "name": <string>,
@@ -114,7 +114,7 @@ std::string tensorValueToString(const char *Buffer, const TensorSpec &Spec);
 ///   "shape": <array of ints> }
 /// For the "type" field, see the C++ primitive types used in
 /// TFUTILS_SUPPORTED_TYPES.
-std::optional<TensorSpec> getTensorSpecFromJSON(LLVMContext &Ctx,
+LLVM_FUNC_ABI std::optional<TensorSpec> getTensorSpecFromJSON(LLVMContext &Ctx,
                                                 const json::Value &Value);
 
 #define TFUTILS_GETDATATYPE_DEF(T, Name)                                       \
diff --git a/llvm/include/llvm/Analysis/Trace.h b/llvm/include/llvm/Analysis/Trace.h
index acc72812eadbef4..7d403751cd7bbd6 100644
--- a/llvm/include/llvm/Analysis/Trace.h
+++ b/llvm/include/llvm/Analysis/Trace.h
@@ -28,7 +28,7 @@ class Function;
 class Module;
 class raw_ostream;
 
-class Trace {
+class LLVM_CLASS_ABI Trace {
   using BasicBlockListType = std::vector<BasicBlock *>;
 
   BasicBlockListType BasicBlocks;
diff --git a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
index 10f7526518e4ab0..858ed9bd90760bf 100644
--- a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h
@@ -29,7 +29,7 @@ class MDNode;
 class MemoryLocation;
 
 /// A simple AA result that uses TBAA metadata to answer queries.
-class TypeBasedAAResult : public AAResultBase {
+class LLVM_CLASS_ABI TypeBasedAAResult : public AAResultBase {
 public:
   /// Handle invalidation events from the new pass manager.
   ///
@@ -56,7 +56,7 @@ class TypeBasedAAResult : public AAResultBase {
 };
 
 /// Analysis pass providing a never-invalidated alias analysis result.
-class TypeBasedAA : public AnalysisInfoMixin<TypeBasedAA> {
+class LLVM_CLASS_ABI TypeBasedAA : public AnalysisInfoMixin<TypeBasedAA> {
   friend AnalysisInfoMixin<TypeBasedAA>;
 
   static AnalysisKey Key;
@@ -68,7 +68,7 @@ class TypeBasedAA : public AnalysisInfoMixin<TypeBasedAA> {
 };
 
 /// Legacy wrapper pass to provide the TypeBasedAAResult object.
-class TypeBasedAAWrapperPass : public ImmutablePass {
+class LLVM_CLASS_ABI TypeBasedAAWrapperPass : public ImmutablePass {
   std::unique_ptr<TypeBasedAAResult> Result;
 
 public:
@@ -89,7 +89,7 @@ class TypeBasedAAWrapperPass : public ImmutablePass {
 // createTypeBasedAAWrapperPass - This pass implements metadata-based
 // type-based alias analysis.
 //
-ImmutablePass *createTypeBasedAAWrapperPass();
+LLVM_FUNC_ABI ImmutablePass *createTypeBasedAAWrapperPass();
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/TypeMetadataUtils.h b/llvm/include/llvm/Analysis/TypeMetadataUtils.h
index c334c540e935cfe..6a49594464c6816 100644
--- a/llvm/include/llvm/Analysis/TypeMetadataUtils.h
+++ b/llvm/include/llvm/Analysis/TypeMetadataUtils.h
@@ -36,7 +36,7 @@ enum CfiFunctionLinkage {
 };
 
 /// A call site that could be devirtualized.
-struct DevirtCallSite {
+struct LLVM_CLASS_ABI DevirtCallSite {
   /// The offset from the address point to the virtual function.
   uint64_t Offset;
   /// The call site itself.
@@ -45,14 +45,14 @@ struct DevirtCallSite {
 
 /// Given a call to the intrinsic \@llvm.type.test, find all devirtualizable
 /// call sites based on the call and return them in DevirtCalls.
-void findDevirtualizableCallsForTypeTest(
+LLVM_FUNC_ABI void findDevirtualizableCallsForTypeTest(
     SmallVectorImpl<DevirtCallSite> &DevirtCalls,
     SmallVectorImpl<CallInst *> &Assumes, const CallInst *CI,
     DominatorTree &DT);
 
 /// Given a call to the intrinsic \@llvm.type.checked.load, find all
 /// devirtualizable call sites based on the call and return them in DevirtCalls.
-void findDevirtualizableCallsForTypeCheckedLoad(
+LLVM_FUNC_ABI void findDevirtualizableCallsForTypeCheckedLoad(
     SmallVectorImpl<DevirtCallSite> &DevirtCalls,
     SmallVectorImpl<Instruction *> &LoadedPtrs,
     SmallVectorImpl<Instruction *> &Preds, bool &HasNonCallUses,
@@ -75,12 +75,12 @@ void findDevirtualizableCallsForTypeCheckedLoad(
 /// }
 ///
 /// For such (sub-)expressions, getPointerAtOffset returns the @target pointer.
-Constant *getPointerAtOffset(Constant *I, uint64_t Offset, Module &M,
+LLVM_FUNC_ABI Constant *getPointerAtOffset(Constant *I, uint64_t Offset, Module &M,
                              Constant *TopLevelGlobal = nullptr);
 
 /// Finds the same "relative pointer" pattern as described above, where the
 /// target is `F`, and replaces the entire pattern with a constant zero.
-void replaceRelativePointerUsersWithZero(Function *F);
+LLVM_FUNC_ABI void replaceRelativePointerUsersWithZero(Function *F);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/UniformityAnalysis.h b/llvm/include/llvm/Analysis/UniformityAnalysis.h
index 04ba816430b674e..22774a354a9fc66 100644
--- a/llvm/include/llvm/Analysis/UniformityAnalysis.h
+++ b/llvm/include/llvm/Analysis/UniformityAnalysis.h
@@ -24,7 +24,7 @@ extern template class GenericUniformityInfo<SSAContext>;
 using UniformityInfo = GenericUniformityInfo<SSAContext>;
 
 /// Analysis pass which computes \ref UniformityInfo.
-class UniformityInfoAnalysis
+class LLVM_CLASS_ABI UniformityInfoAnalysis
     : public AnalysisInfoMixin<UniformityInfoAnalysis> {
   friend AnalysisInfoMixin<UniformityInfoAnalysis>;
   static AnalysisKey Key;
@@ -40,7 +40,7 @@ class UniformityInfoAnalysis
 };
 
 /// Printer pass for the \c UniformityInfo.
-class UniformityInfoPrinterPass
+class LLVM_CLASS_ABI UniformityInfoPrinterPass
     : public PassInfoMixin<UniformityInfoPrinterPass> {
   raw_ostream &OS;
 
@@ -51,7 +51,7 @@ class UniformityInfoPrinterPass
 };
 
 /// Legacy analysis pass which computes a \ref CycleInfo.
-class UniformityInfoWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI UniformityInfoWrapperPass : public FunctionPass {
   Function *m_function = nullptr;
   UniformityInfo m_uniformityInfo;
 
diff --git a/llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h b/llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h
index 48497f5543d6ef1..cb7a1ca2dab39ff 100644
--- a/llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h
+++ b/llvm/include/llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h
@@ -42,7 +42,7 @@ class Function;
 /// per each inlined function, sorted by the greatest inlines count like
 /// - number of performed inlines
 /// - number of performed inlines to importing module
-class ImportedFunctionsInliningStatistics {
+class LLVM_CLASS_ABI ImportedFunctionsInliningStatistics {
 private:
   /// InlineGraphNode represents node in graph of inlined functions.
   struct InlineGraphNode {
diff --git a/llvm/include/llvm/Analysis/Utils/Local.h b/llvm/include/llvm/Analysis/Utils/Local.h
index 68cbd8907da9397..7209a62227e22ff 100644
--- a/llvm/include/llvm/Analysis/Utils/Local.h
+++ b/llvm/include/llvm/Analysis/Utils/Local.h
@@ -28,7 +28,7 @@ class Value;
 /// pointer). Return the result as a signed integer of intptr size.
 /// When NoAssumptions is true, no assumptions about index computation not
 /// overflowing is made.
-Value *emitGEPOffset(IRBuilderBase *Builder, const DataLayout &DL, User *GEP,
+LLVM_FUNC_ABI Value *emitGEPOffset(IRBuilderBase *Builder, const DataLayout &DL, User *GEP,
                      bool NoAssumptions = false);
 
 } // namespace llvm
diff --git a/llvm/include/llvm/Analysis/Utils/TrainingLogger.h b/llvm/include/llvm/Analysis/Utils/TrainingLogger.h
index d59a3dbe53c9e9f..7abb4be21b191bc 100644
--- a/llvm/include/llvm/Analysis/Utils/TrainingLogger.h
+++ b/llvm/include/llvm/Analysis/Utils/TrainingLogger.h
@@ -89,7 +89,7 @@ namespace llvm {
 /// At the end, call print to generate the log.
 /// Alternatively, don't call logReward at the end of each event, just
 /// log{Float|Int32|Int64}FinalReward at the end.
-class Logger final {
+class LLVM_CLASS_ABI Logger final {
   std::unique_ptr<raw_ostream> OS;
   const std::vector<TensorSpec> FeatureSpecs;
   const TensorSpec RewardSpec;
diff --git a/llvm/include/llvm/Analysis/ValueLattice.h b/llvm/include/llvm/Analysis/ValueLattice.h
index 1da5eb3c61efbd0..e207ae383ddfbcc 100644
--- a/llvm/include/llvm/Analysis/ValueLattice.h
+++ b/llvm/include/llvm/Analysis/ValueLattice.h
@@ -27,7 +27,7 @@ class Constant;
 /// FIXME: This is basically just for bringup, this can be made a lot more rich
 /// in the future.
 ///
-class ValueLatticeElement {
+class LLVM_CLASS_ABI ValueLatticeElement {
   enum ValueLatticeElementTy {
     /// This Value has no known value yet.  As a result, this implies the
     /// producing instruction is dead.  Caution: We use this as the starting
@@ -463,6 +463,6 @@ class ValueLatticeElement {
 static_assert(sizeof(ValueLatticeElement) <= 40,
               "size of ValueLatticeElement changed unexpectedly");
 
-raw_ostream &operator<<(raw_ostream &OS, const ValueLatticeElement &Val);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const ValueLatticeElement &Val);
 } // end namespace llvm
 #endif
diff --git a/llvm/include/llvm/Analysis/ValueLatticeUtils.h b/llvm/include/llvm/Analysis/ValueLatticeUtils.h
index 6a1db715b854e59..0a42b825c297315 100644
--- a/llvm/include/llvm/Analysis/ValueLatticeUtils.h
+++ b/llvm/include/llvm/Analysis/ValueLatticeUtils.h
@@ -24,18 +24,18 @@ class GlobalVariable;
 /// Determine if the values of the given function's arguments can be tracked
 /// interprocedurally. The value of an argument can be tracked if the function
 /// has local linkage and its address is not taken.
-bool canTrackArgumentsInterprocedurally(Function *F);
+LLVM_FUNC_ABI bool canTrackArgumentsInterprocedurally(Function *F);
 
 /// Determine if the values of the given function's returns can be tracked
 /// interprocedurally. Return values can be tracked if the function has an
 /// exact definition and it doesn't have the "naked" attribute. Naked functions
 /// may contain assembly code that returns untrackable values.
-bool canTrackReturnsInterprocedurally(Function *F);
+LLVM_FUNC_ABI bool canTrackReturnsInterprocedurally(Function *F);
 
 /// Determine if the value maintained in the given global variable can be
 /// tracked interprocedurally. A value can be tracked if the global variable
 /// has local linkage and is only used by non-volatile loads and stores.
-bool canTrackGlobalVariableInterprocedurally(GlobalVariable *GV);
+LLVM_FUNC_ABI bool canTrackGlobalVariableInterprocedurally(GlobalVariable *GV);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Analysis/ValueTracking.h b/llvm/include/llvm/Analysis/ValueTracking.h
index ca792b679653fa1..fbb1841a3982be6 100644
--- a/llvm/include/llvm/Analysis/ValueTracking.h
+++ b/llvm/include/llvm/Analysis/ValueTracking.h
@@ -54,7 +54,7 @@ constexpr unsigned MaxAnalysisRecursionDepth = 6;
 /// where V is a vector, the known zero and known one values are the
 /// same width as the vector element, and the bit is set only if it is true
 /// for all of the elements in the vector.
-void computeKnownBits(const Value *V, KnownBits &Known, const DataLayout &DL,
+LLVM_FUNC_ABI void computeKnownBits(const Value *V, KnownBits &Known, const DataLayout &DL,
                       unsigned Depth = 0, AssumptionCache *AC = nullptr,
                       const Instruction *CxtI = nullptr,
                       const DominatorTree *DT = nullptr,
@@ -68,7 +68,7 @@ void computeKnownBits(const Value *V, KnownBits &Known, const DataLayout &DL,
 /// where V is a vector, the known zero and known one values are the
 /// same width as the vector element, and the bit is set only if it is true
 /// for all of the demanded elements in the vector.
-void computeKnownBits(const Value *V, const APInt &DemandedElts,
+LLVM_FUNC_ABI void computeKnownBits(const Value *V, const APInt &DemandedElts,
                       KnownBits &Known, const DataLayout &DL,
                       unsigned Depth = 0, AssumptionCache *AC = nullptr,
                       const Instruction *CxtI = nullptr,
@@ -76,14 +76,14 @@ void computeKnownBits(const Value *V, const APInt &DemandedElts,
                       bool UseInstrInfo = true);
 
 /// Returns the known bits rather than passing by reference.
-KnownBits computeKnownBits(const Value *V, const DataLayout &DL,
+LLVM_FUNC_ABI KnownBits computeKnownBits(const Value *V, const DataLayout &DL,
                            unsigned Depth = 0, AssumptionCache *AC = nullptr,
                            const Instruction *CxtI = nullptr,
                            const DominatorTree *DT = nullptr,
                            bool UseInstrInfo = true);
 
 /// Returns the known bits rather than passing by reference.
-KnownBits computeKnownBits(const Value *V, const APInt &DemandedElts,
+LLVM_FUNC_ABI KnownBits computeKnownBits(const Value *V, const APInt &DemandedElts,
                            const DataLayout &DL, unsigned Depth = 0,
                            AssumptionCache *AC = nullptr,
                            const Instruction *CxtI = nullptr,
@@ -93,21 +93,21 @@ KnownBits computeKnownBits(const Value *V, const APInt &DemandedElts,
 /// Compute known bits from the range metadata.
 /// \p KnownZero the set of bits that are known to be zero
 /// \p KnownOne the set of bits that are known to be one
-void computeKnownBitsFromRangeMetadata(const MDNode &Ranges, KnownBits &Known);
+LLVM_FUNC_ABI void computeKnownBitsFromRangeMetadata(const MDNode &Ranges, KnownBits &Known);
 
 /// Merge bits known from assumes into Known.
-void computeKnownBitsFromAssume(const Value *V, KnownBits &Known,
+LLVM_FUNC_ABI void computeKnownBitsFromAssume(const Value *V, KnownBits &Known,
                                 unsigned Depth, const SimplifyQuery &Q);
 
 /// Using KnownBits LHS/RHS produce the known bits for logic op (and/xor/or).
-KnownBits analyzeKnownBitsFromAndXorOr(
+LLVM_FUNC_ABI KnownBits analyzeKnownBitsFromAndXorOr(
     const Operator *I, const KnownBits &KnownLHS, const KnownBits &KnownRHS,
     unsigned Depth, const DataLayout &DL, AssumptionCache *AC = nullptr,
     const Instruction *CxtI = nullptr, const DominatorTree *DT = nullptr,
     bool UseInstrInfo = true);
 
 /// Return true if LHS and RHS have no common bits set.
-bool haveNoCommonBitsSet(const Value *LHS, const Value *RHS,
+LLVM_FUNC_ABI bool haveNoCommonBitsSet(const Value *LHS, const Value *RHS,
                          const DataLayout &DL, AssumptionCache *AC = nullptr,
                          const Instruction *CxtI = nullptr,
                          const DominatorTree *DT = nullptr,
@@ -118,14 +118,14 @@ bool haveNoCommonBitsSet(const Value *LHS, const Value *RHS,
 /// of two when defined. Supports values with integer or pointer type and
 /// vectors of integers. If 'OrZero' is set, then return true if the given
 /// value is either a power of two or zero.
-bool isKnownToBeAPowerOfTwo(const Value *V, const DataLayout &DL,
+LLVM_FUNC_ABI bool isKnownToBeAPowerOfTwo(const Value *V, const DataLayout &DL,
                             bool OrZero = false, unsigned Depth = 0,
                             AssumptionCache *AC = nullptr,
                             const Instruction *CxtI = nullptr,
                             const DominatorTree *DT = nullptr,
                             bool UseInstrInfo = true);
 
-bool isOnlyUsedInZeroEqualityComparison(const Instruction *CxtI);
+LLVM_FUNC_ABI bool isOnlyUsedInZeroEqualityComparison(const Instruction *CxtI);
 
 /// Return true if the given value is known to be non-zero when defined. For
 /// vectors, return true if every element is known to be non-zero when
@@ -133,7 +133,7 @@ bool isOnlyUsedInZeroEqualityComparison(const Instruction *CxtI);
 /// specified, perform context-sensitive analysis and return true if the
 /// pointer couldn't possibly be null at the specified instruction.
 /// Supports values with integer or pointer type and vectors of integers.
-bool isKnownNonZero(const Value *V, const DataLayout &DL, unsigned Depth = 0,
+LLVM_FUNC_ABI bool isKnownNonZero(const Value *V, const DataLayout &DL, unsigned Depth = 0,
                     AssumptionCache *AC = nullptr,
                     const Instruction *CxtI = nullptr,
                     const DominatorTree *DT = nullptr,
@@ -143,10 +143,10 @@ bool isKnownNonZero(const Value *V, const DataLayout &DL, unsigned Depth = 0,
 /// Currently can recoginze Value pair:
 /// 1: <X, Y> if X = sub (0, Y) or Y = sub (0, X)
 /// 2: <X, Y> if X = sub (A, B) and Y = sub (B, A)
-bool isKnownNegation(const Value *X, const Value *Y, bool NeedNSW = false);
+LLVM_FUNC_ABI bool isKnownNegation(const Value *X, const Value *Y, bool NeedNSW = false);
 
 /// Returns true if the give value is known to be non-negative.
-bool isKnownNonNegative(const Value *V, const DataLayout &DL,
+LLVM_FUNC_ABI bool isKnownNonNegative(const Value *V, const DataLayout &DL,
                         unsigned Depth = 0, AssumptionCache *AC = nullptr,
                         const Instruction *CxtI = nullptr,
                         const DominatorTree *DT = nullptr,
@@ -154,7 +154,7 @@ bool isKnownNonNegative(const Value *V, const DataLayout &DL,
 
 /// Returns true if the given value is known be positive (i.e. non-negative
 /// and non-zero).
-bool isKnownPositive(const Value *V, const DataLayout &DL, unsigned Depth = 0,
+LLVM_FUNC_ABI bool isKnownPositive(const Value *V, const DataLayout &DL, unsigned Depth = 0,
                      AssumptionCache *AC = nullptr,
                      const Instruction *CxtI = nullptr,
                      const DominatorTree *DT = nullptr,
@@ -162,7 +162,7 @@ bool isKnownPositive(const Value *V, const DataLayout &DL, unsigned Depth = 0,
 
 /// Returns true if the given value is known be negative (i.e. non-positive
 /// and non-zero).
-bool isKnownNegative(const Value *V, const DataLayout &DL, unsigned Depth = 0,
+LLVM_FUNC_ABI bool isKnownNegative(const Value *V, const DataLayout &DL, unsigned Depth = 0,
                      AssumptionCache *AC = nullptr,
                      const Instruction *CxtI = nullptr,
                      const DominatorTree *DT = nullptr,
@@ -170,7 +170,7 @@ bool isKnownNegative(const Value *V, const DataLayout &DL, unsigned Depth = 0,
 
 /// Return true if the given values are known to be non-equal when defined.
 /// Supports scalar integer types only.
-bool isKnownNonEqual(const Value *V1, const Value *V2, const DataLayout &DL,
+LLVM_FUNC_ABI bool isKnownNonEqual(const Value *V1, const Value *V2, const DataLayout &DL,
                      AssumptionCache *AC = nullptr,
                      const Instruction *CxtI = nullptr,
                      const DominatorTree *DT = nullptr,
@@ -185,7 +185,7 @@ bool isKnownNonEqual(const Value *V1, const Value *V2, const DataLayout &DL,
 /// where V is a vector, the mask, known zero, and known one values are the
 /// same width as the vector element, and the bit is set only if it is true
 /// for all of the elements in the vector.
-bool MaskedValueIsZero(const Value *V, const APInt &Mask, const DataLayout &DL,
+LLVM_FUNC_ABI bool MaskedValueIsZero(const Value *V, const APInt &Mask, const DataLayout &DL,
                        unsigned Depth = 0, AssumptionCache *AC = nullptr,
                        const Instruction *CxtI = nullptr,
                        const DominatorTree *DT = nullptr,
@@ -198,7 +198,7 @@ bool MaskedValueIsZero(const Value *V, const APInt &Mask, const DataLayout &DL,
 /// equal to each other, so we return 3. For vectors, return the number of
 /// sign bits for the vector element with the mininum number of known sign
 /// bits.
-unsigned ComputeNumSignBits(const Value *Op, const DataLayout &DL,
+LLVM_FUNC_ABI unsigned ComputeNumSignBits(const Value *Op, const DataLayout &DL,
                             unsigned Depth = 0, AssumptionCache *AC = nullptr,
                             const Instruction *CxtI = nullptr,
                             const DominatorTree *DT = nullptr,
@@ -207,7 +207,7 @@ unsigned ComputeNumSignBits(const Value *Op, const DataLayout &DL,
 /// Get the upper bound on bit size for this Value \p Op as a signed integer.
 /// i.e.  x == sext(trunc(x to MaxSignificantBits) to bitwidth(x)).
 /// Similar to the APInt::getSignificantBits function.
-unsigned ComputeMaxSignificantBits(const Value *Op, const DataLayout &DL,
+LLVM_FUNC_ABI unsigned ComputeMaxSignificantBits(const Value *Op, const DataLayout &DL,
                                    unsigned Depth = 0,
                                    AssumptionCache *AC = nullptr,
                                    const Instruction *CxtI = nullptr,
@@ -215,7 +215,7 @@ unsigned ComputeMaxSignificantBits(const Value *Op, const DataLayout &DL,
 
 /// Map a call instruction to an intrinsic ID.  Libcalls which have equivalent
 /// intrinsics are treated as-if they were intrinsics.
-Intrinsic::ID getIntrinsicForCallSite(const CallBase &CB,
+LLVM_FUNC_ABI Intrinsic::ID getIntrinsicForCallSite(const CallBase &CB,
                                       const TargetLibraryInfo *TLI);
 
 /// Returns a pair of values, which if passed to llvm.is.fpclass, returns the
@@ -226,12 +226,12 @@ Intrinsic::ID getIntrinsicForCallSite(const CallBase &CB,
 ///
 /// If \p LookThroughSrc is false, ignore the source value (i.e. the first pair
 /// element will always be LHS.
-std::pair<Value *, FPClassTest> fcmpToClassTest(CmpInst::Predicate Pred,
+LLVM_FUNC_ABI std::pair<Value *, FPClassTest> fcmpToClassTest(CmpInst::Predicate Pred,
                                                 const Function &F, Value *LHS,
                                                 Value *RHS,
                                                 bool LookThroughSrc = true);
 
-struct KnownFPClass {
+struct LLVM_CLASS_ABI KnownFPClass {
   /// Floating-point classes the value could be one of.
   FPClassTest KnownFPClasses = fcAllFlags;
 
@@ -457,14 +457,14 @@ inline KnownFPClass operator|(const KnownFPClass &LHS, KnownFPClass &&RHS) {
 /// point classes should be queried. Queries not specified in \p
 /// InterestedClasses should be reliable if they are determined during the
 /// query.
-KnownFPClass computeKnownFPClass(
+LLVM_FUNC_ABI KnownFPClass computeKnownFPClass(
     const Value *V, const APInt &DemandedElts, const DataLayout &DL,
     FPClassTest InterestedClasses = fcAllFlags, unsigned Depth = 0,
     const TargetLibraryInfo *TLI = nullptr, AssumptionCache *AC = nullptr,
     const Instruction *CxtI = nullptr, const DominatorTree *DT = nullptr,
     bool UseInstrInfo = true);
 
-KnownFPClass computeKnownFPClass(
+LLVM_FUNC_ABI KnownFPClass computeKnownFPClass(
     const Value *V, const DataLayout &DL,
     FPClassTest InterestedClasses = fcAllFlags, unsigned Depth = 0,
     const TargetLibraryInfo *TLI = nullptr, AssumptionCache *AC = nullptr,
@@ -473,11 +473,11 @@ KnownFPClass computeKnownFPClass(
 
 /// Return true if we can prove that the specified FP value is never equal to
 /// -0.0.
-bool CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,
+LLVM_FUNC_ABI bool CannotBeNegativeZero(const Value *V, const TargetLibraryInfo *TLI,
                           unsigned Depth = 0);
 
 
-bool CannotBeOrderedLessThanZero(const Value *V, const DataLayout &DL,
+LLVM_FUNC_ABI bool CannotBeOrderedLessThanZero(const Value *V, const DataLayout &DL,
                                  const TargetLibraryInfo *TLI);
 
 /// Return true if we can prove that the specified FP value is either NaN or
@@ -548,7 +548,7 @@ inline bool isKnownNeverNaN(const Value *V, const DataLayout &DL,
 ///       -0 --> false
 ///   x > +0 --> true
 ///   x < -0 --> false
-bool SignBitMustBeZero(const Value *V, const DataLayout &DL,
+LLVM_FUNC_ABI bool SignBitMustBeZero(const Value *V, const DataLayout &DL,
                        const TargetLibraryInfo *TLI);
 
 /// If the specified value can be set by repeating the same byte in memory,
@@ -557,7 +557,7 @@ bool SignBitMustBeZero(const Value *V, const DataLayout &DL,
 /// 0.0 etc. If the value can't be handled with a repeated byte store (e.g.
 /// i16 0x1234), return null. If the value is entirely undef and padding,
 /// return undef.
-Value *isBytewiseValue(Value *V, const DataLayout &DL);
+LLVM_FUNC_ABI Value *isBytewiseValue(Value *V, const DataLayout &DL);
 
 /// Given an aggregate and an sequence of indices, see if the scalar value
 /// indexed is already around as a register, for example if it were inserted
@@ -565,7 +565,7 @@ Value *isBytewiseValue(Value *V, const DataLayout &DL);
 ///
 /// If InsertBefore is not null, this function will duplicate (modified)
 /// insertvalues when a part of a nested struct is extracted.
-Value *FindInsertedValue(Value *V, ArrayRef<unsigned> idx_range,
+LLVM_FUNC_ABI Value *FindInsertedValue(Value *V, ArrayRef<unsigned> idx_range,
                          Instruction *InsertBefore = nullptr);
 
 /// Analyze the specified pointer to see if it can be expressed as a base
@@ -593,10 +593,10 @@ GetPointerBaseWithConstantOffset(const Value *Ptr, int64_t &Offset,
 
 /// Returns true if the GEP is based on a pointer to a string (array of
 // \p CharSize integers) and is indexing into this string.
-bool isGEPBasedOnPointerToString(const GEPOperator *GEP, unsigned CharSize = 8);
+LLVM_FUNC_ABI bool isGEPBasedOnPointerToString(const GEPOperator *GEP, unsigned CharSize = 8);
 
 /// Represents offset+length into a ConstantDataArray.
-struct ConstantDataArraySlice {
+struct LLVM_CLASS_ABI ConstantDataArraySlice {
   /// ConstantDataArray pointer. nullptr indicates a zeroinitializer (a valid
   /// initializer, it just doesn't fit the ConstantDataArray interface).
   const ConstantDataArray *Array;
@@ -623,7 +623,7 @@ struct ConstantDataArraySlice {
 /// Returns true if the value \p V is a pointer into a ConstantDataArray.
 /// If successful \p Slice will point to a ConstantDataArray info object
 /// with an appropriate offset.
-bool getConstantDataArrayInfo(const Value *V, ConstantDataArraySlice &Slice,
+LLVM_FUNC_ABI bool getConstantDataArrayInfo(const Value *V, ConstantDataArraySlice &Slice,
                               unsigned ElementSize, uint64_t Offset = 0);
 
 /// This function computes the length of a null-terminated C string pointed to
@@ -632,18 +632,18 @@ bool getConstantDataArrayInfo(const Value *V, ConstantDataArraySlice &Slice,
 /// character by default. If TrimAtNul is set to false, then this returns any
 /// trailing null characters as well as any other characters that come after
 /// it.
-bool getConstantStringInfo(const Value *V, StringRef &Str,
+LLVM_FUNC_ABI bool getConstantStringInfo(const Value *V, StringRef &Str,
                            bool TrimAtNul = true);
 
 /// If we can compute the length of the string pointed to by the specified
 /// pointer, return 'len+1'.  If we can't, return 0.
-uint64_t GetStringLength(const Value *V, unsigned CharSize = 8);
+LLVM_FUNC_ABI uint64_t GetStringLength(const Value *V, unsigned CharSize = 8);
 
 /// This function returns call pointer argument that is considered the same by
 /// aliasing rules. You CAN'T use it to replace one value with another. If
 /// \p MustPreserveNullness is true, the call must preserve the nullness of
 /// the pointer.
-const Value *getArgumentAliasingToReturnedPointer(const CallBase *Call,
+LLVM_FUNC_ABI const Value *getArgumentAliasingToReturnedPointer(const CallBase *Call,
                                                   bool MustPreserveNullness);
 inline Value *getArgumentAliasingToReturnedPointer(CallBase *Call,
                                                    bool MustPreserveNullness) {
@@ -657,7 +657,7 @@ inline Value *getArgumentAliasingToReturnedPointer(CallBase *Call,
 /// considered as capture. The arguments are not marked as returned neither,
 /// because it would make it useless. If \p MustPreserveNullness is true,
 /// the intrinsic must preserve the nullness of the pointer.
-bool isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(
+LLVM_FUNC_ABI bool isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(
     const CallBase *Call, bool MustPreserveNullness);
 
 /// This method strips off any GEP address adjustments and pointer casts from
@@ -665,7 +665,7 @@ bool isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(
 /// that the returned value has pointer type if the specified value does. If
 /// the MaxLookup value is non-zero, it limits the number of instructions to
 /// be stripped off.
-const Value *getUnderlyingObject(const Value *V, unsigned MaxLookup = 6);
+LLVM_FUNC_ABI const Value *getUnderlyingObject(const Value *V, unsigned MaxLookup = 6);
 inline Value *getUnderlyingObject(Value *V, unsigned MaxLookup = 6) {
   // Force const to avoid infinite recursion.
   const Value *VConst = V;
@@ -700,36 +700,36 @@ inline Value *getUnderlyingObject(Value *V, unsigned MaxLookup = 6) {
 /// Since A[i] and A[i-1] are independent pointers, getUnderlyingObjects
 /// should not assume that Curr and Prev share the same underlying object thus
 /// it shouldn't look through the phi above.
-void getUnderlyingObjects(const Value *V,
+LLVM_FUNC_ABI void getUnderlyingObjects(const Value *V,
                           SmallVectorImpl<const Value *> &Objects,
                           LoopInfo *LI = nullptr, unsigned MaxLookup = 6);
 
 /// This is a wrapper around getUnderlyingObjects and adds support for basic
 /// ptrtoint+arithmetic+inttoptr sequences.
-bool getUnderlyingObjectsForCodeGen(const Value *V,
+LLVM_FUNC_ABI bool getUnderlyingObjectsForCodeGen(const Value *V,
                                     SmallVectorImpl<Value *> &Objects);
 
 /// Returns unique alloca where the value comes from, or nullptr.
 /// If OffsetZero is true check that V points to the begining of the alloca.
-AllocaInst *findAllocaForValue(Value *V, bool OffsetZero = false);
+LLVM_FUNC_ABI AllocaInst *findAllocaForValue(Value *V, bool OffsetZero = false);
 inline const AllocaInst *findAllocaForValue(const Value *V,
                                             bool OffsetZero = false) {
   return findAllocaForValue(const_cast<Value *>(V), OffsetZero);
 }
 
 /// Return true if the only users of this pointer are lifetime markers.
-bool onlyUsedByLifetimeMarkers(const Value *V);
+LLVM_FUNC_ABI bool onlyUsedByLifetimeMarkers(const Value *V);
 
 /// Return true if the only users of this pointer are lifetime markers or
 /// droppable instructions.
-bool onlyUsedByLifetimeMarkersOrDroppableInsts(const Value *V);
+LLVM_FUNC_ABI bool onlyUsedByLifetimeMarkersOrDroppableInsts(const Value *V);
 
 /// Return true if speculation of the given load must be suppressed to avoid
 /// ordering or interfering with an active sanitizer.  If not suppressed,
 /// dereferenceability and alignment must be proven separately.  Note: This
 /// is only needed for raw reasoning; if you use the interface below
 /// (isSafeToSpeculativelyExecute), this is handled internally.
-bool mustSuppressSpeculation(const LoadInst &LI);
+LLVM_FUNC_ABI bool mustSuppressSpeculation(const LoadInst &LI);
 
 /// Return true if the instruction does not have any effects besides
 /// calculating the result and does not have undefined behavior.
@@ -754,7 +754,7 @@ bool mustSuppressSpeculation(const LoadInst &LI);
 ///
 /// This method can return true for instructions that read memory;
 /// for such instructions, moving them may change the resulting value.
-bool isSafeToSpeculativelyExecute(const Instruction *I,
+LLVM_FUNC_ABI bool isSafeToSpeculativelyExecute(const Instruction *I,
                                   const Instruction *CtxI = nullptr,
                                   AssumptionCache *AC = nullptr,
                                   const DominatorTree *DT = nullptr,
@@ -777,7 +777,7 @@ bool isSafeToSpeculativelyExecute(const Instruction *I,
 ///   function may have said that the instruction wouldn't be speculatable.
 ///   This behavior is a shortcoming in the current implementation and not
 ///   intentional.
-bool isSafeToSpeculativelyExecuteWithOpcode(
+LLVM_FUNC_ABI bool isSafeToSpeculativelyExecuteWithOpcode(
     unsigned Opcode, const Instruction *Inst, const Instruction *CtxI = nullptr,
     AssumptionCache *AC = nullptr, const DominatorTree *DT = nullptr,
     const TargetLibraryInfo *TLI = nullptr);
@@ -790,16 +790,16 @@ bool isSafeToSpeculativelyExecuteWithOpcode(
 ///   dependent instructions.
 /// * Control dependence arises for example if the instruction may fault
 ///   if lifted above a throwing call or infinite loop.
-bool mayHaveNonDefUseDependency(const Instruction &I);
+LLVM_FUNC_ABI bool mayHaveNonDefUseDependency(const Instruction &I);
 
 /// Return true if it is an intrinsic that cannot be speculated but also
 /// cannot trap.
-bool isAssumeLikeIntrinsic(const Instruction *I);
+LLVM_FUNC_ABI bool isAssumeLikeIntrinsic(const Instruction *I);
 
 /// Return true if it is valid to use the assumptions provided by an
 /// assume intrinsic, I, at the point in the control-flow identified by the
 /// context instruction, CxtI.
-bool isValidAssumeForContext(const Instruction *I, const Instruction *CxtI,
+LLVM_FUNC_ABI bool isValidAssumeForContext(const Instruction *I, const Instruction *CxtI,
                              const DominatorTree *DT = nullptr);
 
 enum class OverflowResult {
@@ -813,41 +813,41 @@ enum class OverflowResult {
   NeverOverflows,
 };
 
-OverflowResult computeOverflowForUnsignedMul(const Value *LHS, const Value *RHS,
+LLVM_FUNC_ABI OverflowResult computeOverflowForUnsignedMul(const Value *LHS, const Value *RHS,
                                              const DataLayout &DL,
                                              AssumptionCache *AC,
                                              const Instruction *CxtI,
                                              const DominatorTree *DT,
                                              bool UseInstrInfo = true);
-OverflowResult computeOverflowForSignedMul(const Value *LHS, const Value *RHS,
+LLVM_FUNC_ABI OverflowResult computeOverflowForSignedMul(const Value *LHS, const Value *RHS,
                                            const DataLayout &DL,
                                            AssumptionCache *AC,
                                            const Instruction *CxtI,
                                            const DominatorTree *DT,
                                            bool UseInstrInfo = true);
-OverflowResult computeOverflowForUnsignedAdd(const Value *LHS, const Value *RHS,
+LLVM_FUNC_ABI OverflowResult computeOverflowForUnsignedAdd(const Value *LHS, const Value *RHS,
                                              const DataLayout &DL,
                                              AssumptionCache *AC,
                                              const Instruction *CxtI,
                                              const DominatorTree *DT,
                                              bool UseInstrInfo = true);
-OverflowResult computeOverflowForSignedAdd(const Value *LHS, const Value *RHS,
+LLVM_FUNC_ABI OverflowResult computeOverflowForSignedAdd(const Value *LHS, const Value *RHS,
                                            const DataLayout &DL,
                                            AssumptionCache *AC = nullptr,
                                            const Instruction *CxtI = nullptr,
                                            const DominatorTree *DT = nullptr);
 /// This version also leverages the sign bit of Add if known.
-OverflowResult computeOverflowForSignedAdd(const AddOperator *Add,
+LLVM_FUNC_ABI OverflowResult computeOverflowForSignedAdd(const AddOperator *Add,
                                            const DataLayout &DL,
                                            AssumptionCache *AC = nullptr,
                                            const Instruction *CxtI = nullptr,
                                            const DominatorTree *DT = nullptr);
-OverflowResult computeOverflowForUnsignedSub(const Value *LHS, const Value *RHS,
+LLVM_FUNC_ABI OverflowResult computeOverflowForUnsignedSub(const Value *LHS, const Value *RHS,
                                              const DataLayout &DL,
                                              AssumptionCache *AC,
                                              const Instruction *CxtI,
                                              const DominatorTree *DT);
-OverflowResult computeOverflowForSignedSub(const Value *LHS, const Value *RHS,
+LLVM_FUNC_ABI OverflowResult computeOverflowForSignedSub(const Value *LHS, const Value *RHS,
                                            const DataLayout &DL,
                                            AssumptionCache *AC,
                                            const Instruction *CxtI,
@@ -856,16 +856,16 @@ OverflowResult computeOverflowForSignedSub(const Value *LHS, const Value *RHS,
 /// Returns true if the arithmetic part of the \p WO 's result is
 /// used only along the paths control dependent on the computation
 /// not overflowing, \p WO being an <op>.with.overflow intrinsic.
-bool isOverflowIntrinsicNoWrap(const WithOverflowInst *WO,
+LLVM_FUNC_ABI bool isOverflowIntrinsicNoWrap(const WithOverflowInst *WO,
                                const DominatorTree &DT);
 
 /// Determine the possible constant range of vscale with the given bit width,
 /// based on the vscale_range function attribute.
-ConstantRange getVScaleRange(const Function *F, unsigned BitWidth);
+LLVM_FUNC_ABI ConstantRange getVScaleRange(const Function *F, unsigned BitWidth);
 
 /// Determine the possible constant range of an integer or vector of integer
 /// value. This is intended as a cheap, non-recursive check.
-ConstantRange computeConstantRange(const Value *V, bool ForSigned,
+LLVM_FUNC_ABI ConstantRange computeConstantRange(const Value *V, bool ForSigned,
                                    bool UseInstrInfo = true,
                                    AssumptionCache *AC = nullptr,
                                    const Instruction *CtxI = nullptr,
@@ -885,31 +885,31 @@ ConstantRange computeConstantRange(const Value *V, bool ForSigned,
 /// Undefined behavior is assumed not to happen, so e.g. division is
 /// guaranteed to transfer execution to the following instruction even
 /// though division by zero might cause undefined behavior.
-bool isGuaranteedToTransferExecutionToSuccessor(const Instruction *I);
+LLVM_FUNC_ABI bool isGuaranteedToTransferExecutionToSuccessor(const Instruction *I);
 
 /// Returns true if this block does not contain a potential implicit exit.
 /// This is equivelent to saying that all instructions within the basic block
 /// are guaranteed to transfer execution to their successor within the basic
 /// block. This has the same assumptions w.r.t. undefined behavior as the
 /// instruction variant of this function.
-bool isGuaranteedToTransferExecutionToSuccessor(const BasicBlock *BB);
+LLVM_FUNC_ABI bool isGuaranteedToTransferExecutionToSuccessor(const BasicBlock *BB);
 
 /// Return true if every instruction in the range (Begin, End) is
 /// guaranteed to transfer execution to its static successor. \p ScanLimit
 /// bounds the search to avoid scanning huge blocks.
-bool isGuaranteedToTransferExecutionToSuccessor(
+LLVM_FUNC_ABI bool isGuaranteedToTransferExecutionToSuccessor(
     BasicBlock::const_iterator Begin, BasicBlock::const_iterator End,
     unsigned ScanLimit = 32);
 
 /// Same as previous, but with range expressed via iterator_range.
-bool isGuaranteedToTransferExecutionToSuccessor(
+LLVM_FUNC_ABI bool isGuaranteedToTransferExecutionToSuccessor(
     iterator_range<BasicBlock::const_iterator> Range, unsigned ScanLimit = 32);
 
 /// Return true if this function can prove that the instruction I
 /// is executed for every iteration of the loop L.
 ///
 /// Note that this currently only considers the loop header.
-bool isGuaranteedToExecuteForEveryIteration(const Instruction *I,
+LLVM_FUNC_ABI bool isGuaranteedToExecuteForEveryIteration(const Instruction *I,
                                             const Loop *L);
 
 /// Return true if \p PoisonOp's user yields poison or raises UB if its
@@ -921,23 +921,23 @@ bool isGuaranteedToExecuteForEveryIteration(const Instruction *I,
 ///
 /// To filter out operands that raise UB on poison, you can use
 /// getGuaranteedNonPoisonOp.
-bool propagatesPoison(const Use &PoisonOp);
+LLVM_FUNC_ABI bool propagatesPoison(const Use &PoisonOp);
 
 /// Insert operands of I into Ops such that I will trigger undefined behavior
 /// if I is executed and that operand has a poison value.
-void getGuaranteedNonPoisonOps(const Instruction *I,
+LLVM_FUNC_ABI void getGuaranteedNonPoisonOps(const Instruction *I,
                                SmallVectorImpl<const Value *> &Ops);
 
 /// Insert operands of I into Ops such that I will trigger undefined behavior
 /// if I is executed and that operand is not a well-defined value
 /// (i.e. has undef bits or poison).
-void getGuaranteedWellDefinedOps(const Instruction *I,
+LLVM_FUNC_ABI void getGuaranteedWellDefinedOps(const Instruction *I,
                                  SmallVectorImpl<const Value *> &Ops);
 
 /// Return true if the given instruction must trigger undefined behavior
 /// when I is executed with any operands which appear in KnownPoison holding
 /// a poison value at the point of execution.
-bool mustTriggerUB(const Instruction *I,
+LLVM_FUNC_ABI bool mustTriggerUB(const Instruction *I,
                    const SmallPtrSetImpl<const Value *> &KnownPoison);
 
 /// Return true if this function can prove that if Inst is executed
@@ -946,8 +946,8 @@ bool mustTriggerUB(const Instruction *I,
 ///
 /// Note that this currently only considers the basic block that is
 /// the parent of Inst.
-bool programUndefinedIfUndefOrPoison(const Instruction *Inst);
-bool programUndefinedIfPoison(const Instruction *Inst);
+LLVM_FUNC_ABI bool programUndefinedIfUndefOrPoison(const Instruction *Inst);
+LLVM_FUNC_ABI bool programUndefinedIfPoison(const Instruction *Inst);
 
 /// canCreateUndefOrPoison returns true if Op can create undef or poison from
 /// non-undef & non-poison operands.
@@ -967,14 +967,14 @@ bool programUndefinedIfPoison(const Instruction *Inst);
 ///
 /// canCreatePoison returns true if Op can create poison from non-poison
 /// operands.
-bool canCreateUndefOrPoison(const Operator *Op,
+LLVM_FUNC_ABI bool canCreateUndefOrPoison(const Operator *Op,
                             bool ConsiderFlagsAndMetadata = true);
-bool canCreatePoison(const Operator *Op, bool ConsiderFlagsAndMetadata = true);
+LLVM_FUNC_ABI bool canCreatePoison(const Operator *Op, bool ConsiderFlagsAndMetadata = true);
 
 /// Return true if V is poison given that ValAssumedPoison is already poison.
 /// For example, if ValAssumedPoison is `icmp X, 10` and V is `icmp X, 5`,
 /// impliesPoison returns true.
-bool impliesPoison(const Value *ValAssumedPoison, const Value *V);
+LLVM_FUNC_ABI bool impliesPoison(const Value *ValAssumedPoison, const Value *V);
 
 /// Return true if this function can prove that V does not have undef bits
 /// and is never poison. If V is an aggregate value or vector, check whether
@@ -985,12 +985,12 @@ bool impliesPoison(const Value *ValAssumedPoison, const Value *V);
 /// If CtxI and DT are specified this method performs flow-sensitive analysis
 /// and returns true if it is guaranteed to be never undef or poison
 /// immediately before the CtxI.
-bool isGuaranteedNotToBeUndefOrPoison(const Value *V,
+LLVM_FUNC_ABI bool isGuaranteedNotToBeUndefOrPoison(const Value *V,
                                       AssumptionCache *AC = nullptr,
                                       const Instruction *CtxI = nullptr,
                                       const DominatorTree *DT = nullptr,
                                       unsigned Depth = 0);
-bool isGuaranteedNotToBePoison(const Value *V, AssumptionCache *AC = nullptr,
+LLVM_FUNC_ABI bool isGuaranteedNotToBePoison(const Value *V, AssumptionCache *AC = nullptr,
                                const Instruction *CtxI = nullptr,
                                const DominatorTree *DT = nullptr,
                                unsigned Depth = 0);
@@ -1002,7 +1002,7 @@ bool isGuaranteedNotToBePoison(const Value *V, AssumptionCache *AC = nullptr,
 /// be added at a location which is control equivalent with OnPathTo (such as
 /// immediately before it) without introducing UB which didn't previously
 /// exist.  Note that a false result conveys no information.
-bool mustExecuteUBIfPoisonOnPathTo(Instruction *Root,
+LLVM_FUNC_ABI bool mustExecuteUBIfPoisonOnPathTo(Instruction *Root,
                                    Instruction *OnPathTo,
                                    DominatorTree *DT);
 
@@ -1030,7 +1030,7 @@ enum SelectPatternNaNBehavior {
                       /// be NaN).
 };
 
-struct SelectPatternResult {
+struct LLVM_CLASS_ABI SelectPatternResult {
   SelectPatternFlavor Flavor;
   SelectPatternNaNBehavior NaNBehavior; /// Only applicable if Flavor is
                                         /// SPF_FMINNUM or SPF_FMAXNUM.
@@ -1062,7 +1062,7 @@ struct SelectPatternResult {
 ///
 /// -> LHS = %a, RHS = i32 4, *CastOp = Instruction::SExt
 ///
-SelectPatternResult matchSelectPattern(Value *V, Value *&LHS, Value *&RHS,
+LLVM_FUNC_ABI SelectPatternResult matchSelectPattern(Value *V, Value *&LHS, Value *&RHS,
                                        Instruction::CastOps *CastOp = nullptr,
                                        unsigned Depth = 0);
 
@@ -1078,30 +1078,30 @@ inline SelectPatternResult matchSelectPattern(const Value *V, const Value *&LHS,
 
 /// Determine the pattern that a select with the given compare as its
 /// predicate and given values as its true/false operands would match.
-SelectPatternResult matchDecomposedSelectPattern(
+LLVM_FUNC_ABI SelectPatternResult matchDecomposedSelectPattern(
     CmpInst *CmpI, Value *TrueVal, Value *FalseVal, Value *&LHS, Value *&RHS,
     Instruction::CastOps *CastOp = nullptr, unsigned Depth = 0);
 
 /// Return the canonical comparison predicate for the specified
 /// minimum/maximum flavor.
-CmpInst::Predicate getMinMaxPred(SelectPatternFlavor SPF, bool Ordered = false);
+LLVM_FUNC_ABI CmpInst::Predicate getMinMaxPred(SelectPatternFlavor SPF, bool Ordered = false);
 
 /// Return the inverse minimum/maximum flavor of the specified flavor.
 /// For example, signed minimum is the inverse of signed maximum.
-SelectPatternFlavor getInverseMinMaxFlavor(SelectPatternFlavor SPF);
+LLVM_FUNC_ABI SelectPatternFlavor getInverseMinMaxFlavor(SelectPatternFlavor SPF);
 
-Intrinsic::ID getInverseMinMaxIntrinsic(Intrinsic::ID MinMaxID);
+LLVM_FUNC_ABI Intrinsic::ID getInverseMinMaxIntrinsic(Intrinsic::ID MinMaxID);
 
 /// Return the minimum or maximum constant value for the specified integer
 /// min/max flavor and type.
-APInt getMinMaxLimit(SelectPatternFlavor SPF, unsigned BitWidth);
+LLVM_FUNC_ABI APInt getMinMaxLimit(SelectPatternFlavor SPF, unsigned BitWidth);
 
 /// Check if the values in \p VL are select instructions that can be converted
 /// to a min or max (vector) intrinsic. Returns the intrinsic ID, if such a
 /// conversion is possible, together with a bool indicating whether all select
 /// conditions are only used by the selects. Otherwise return
 /// Intrinsic::not_intrinsic.
-std::pair<Intrinsic::ID, bool>
+LLVM_FUNC_ABI std::pair<Intrinsic::ID, bool>
 canConvertToMinOrMaxIntrinsic(ArrayRef<Value *> VL);
 
 /// Attempt to match a simple first order recurrence cycle of the form:
@@ -1128,11 +1128,11 @@ canConvertToMinOrMaxIntrinsic(ArrayRef<Value *> VL);
 ///
 /// NOTE: This is intentional simple.  If you want the ability to analyze
 /// non-trivial loop conditons, see ScalarEvolution instead.
-bool matchSimpleRecurrence(const PHINode *P, BinaryOperator *&BO, Value *&Start,
+LLVM_FUNC_ABI bool matchSimpleRecurrence(const PHINode *P, BinaryOperator *&BO, Value *&Start,
                            Value *&Step);
 
 /// Analogous to the above, but starting from the binary operator
-bool matchSimpleRecurrence(const BinaryOperator *I, PHINode *&P, Value *&Start,
+LLVM_FUNC_ABI bool matchSimpleRecurrence(const BinaryOperator *I, PHINode *&P, Value *&Start,
                            Value *&Step);
 
 /// Return true if RHS is known to be implied true by LHS.  Return false if
@@ -1145,11 +1145,11 @@ bool matchSimpleRecurrence(const BinaryOperator *I, PHINode *&P, Value *&Start,
 ///  T | T | F
 ///  F | T | T
 /// (A)
-std::optional<bool> isImpliedCondition(const Value *LHS, const Value *RHS,
+LLVM_FUNC_ABI std::optional<bool> isImpliedCondition(const Value *LHS, const Value *RHS,
                                        const DataLayout &DL,
                                        bool LHSIsTrue = true,
                                        unsigned Depth = 0);
-std::optional<bool> isImpliedCondition(const Value *LHS,
+LLVM_FUNC_ABI std::optional<bool> isImpliedCondition(const Value *LHS,
                                        CmpInst::Predicate RHSPred,
                                        const Value *RHSOp0, const Value *RHSOp1,
                                        const DataLayout &DL,
@@ -1158,10 +1158,10 @@ std::optional<bool> isImpliedCondition(const Value *LHS,
 
 /// Return the boolean condition value in the context of the given instruction
 /// if it is known based on dominating conditions.
-std::optional<bool> isImpliedByDomCondition(const Value *Cond,
+LLVM_FUNC_ABI std::optional<bool> isImpliedByDomCondition(const Value *Cond,
                                             const Instruction *ContextI,
                                             const DataLayout &DL);
-std::optional<bool> isImpliedByDomCondition(CmpInst::Predicate Pred,
+LLVM_FUNC_ABI std::optional<bool> isImpliedByDomCondition(CmpInst::Predicate Pred,
                                             const Value *LHS, const Value *RHS,
                                             const Instruction *ContextI,
                                             const DataLayout &DL);
diff --git a/llvm/include/llvm/Analysis/VectorUtils.h b/llvm/include/llvm/Analysis/VectorUtils.h
index 6cc39ed9b194dad..d5a28b5b0ddab3b 100644
--- a/llvm/include/llvm/Analysis/VectorUtils.h
+++ b/llvm/include/llvm/Analysis/VectorUtils.h
@@ -60,7 +60,7 @@ enum class VFISAKind {
 /// OpenMP or any other vector function description. This structure
 /// is extendible to handle other paradigms that describe vector
 /// functions and their parameters.
-struct VFParameter {
+struct LLVM_CLASS_ABI VFParameter {
   unsigned ParamPos;         // Parameter Position in Scalar Function.
   VFParamKind ParamKind;     // Kind of Parameter.
   int LinearStepOrPos = 0;   // Step or Position of the Parameter.
@@ -80,7 +80,7 @@ struct VFParameter {
 /// This object in independent on the paradigm used to
 /// represent vector functions. in particular, it is not attached to
 /// any target-specific ABI.
-struct VFShape {
+struct LLVM_CLASS_ABI VFShape {
   ElementCount VF;                        // Vectorization factor.
   SmallVector<VFParameter, 8> Parameters; // List of parameter information.
   // Comparison operator.
@@ -121,7 +121,7 @@ struct VFShape {
 };
 
 /// Holds the VFShape for a specific scalar to vector function mapping.
-struct VFInfo {
+struct LLVM_CLASS_ABI VFInfo {
   VFShape Shape;          /// Classification of the vector function.
   std::string ScalarName; /// Scalar Function Name.
   std::string VectorName; /// Vector Function Name associated to this VFInfo.
@@ -180,7 +180,7 @@ static constexpr char const *_LLVM_Scalarize_ = "_LLVM_Scalarize_";
 /// name. At the moment, this parameter is needed only to retrieve the
 /// Vectorization Factor of scalable vector functions from their
 /// respective IR declarations.
-std::optional<VFInfo> tryDemangleForVFABI(StringRef MangledName,
+LLVM_FUNC_ABI std::optional<VFInfo> tryDemangleForVFABI(StringRef MangledName,
                                           const Module &M);
 
 /// This routine mangles the given VectorName according to the LangRef
@@ -200,12 +200,12 @@ std::optional<VFInfo> tryDemangleForVFABI(StringRef MangledName,
 /// <vparams> = "v", as many as are the numArgs.
 /// <scalarname> = the name of the scalar function.
 /// <vectorname> = the name of the vector function.
-std::string mangleTLIVectorName(StringRef VectorName, StringRef ScalarName,
+LLVM_FUNC_ABI std::string mangleTLIVectorName(StringRef VectorName, StringRef ScalarName,
                                 unsigned numArgs, ElementCount VF,
                                 bool Masked = false);
 
 /// Retrieve the `VFParamKind` from a string token.
-VFParamKind getVFParamKindFromString(const StringRef Token);
+LLVM_FUNC_ABI VFParamKind getVFParamKindFromString(const StringRef Token);
 
 // Name of the attribute where the variant mappings are stored.
 static constexpr char const *MappingsAttrName = "vector-function-abi-variant";
@@ -215,7 +215,7 @@ static constexpr char const *MappingsAttrName = "vector-function-abi-variant";
 /// vector-function-abi-variant attribute, we return without populating
 /// VariantMappings, i.e. callers of getVectorVariantNames need not check for
 /// the presence of the attribute (see InjectTLIMappings).
-void getVectorVariantNames(const CallInst &CI,
+LLVM_FUNC_ABI void getVectorVariantNames(const CallInst &CI,
                            SmallVectorImpl<std::string> &VariantMappings);
 } // end namespace VFABI
 
@@ -223,7 +223,7 @@ void getVectorVariantNames(const CallInst &CI,
 ///
 /// Helper class used to find the vector functions associated to a
 /// scalar CallInst.
-class VFDatabase {
+class LLVM_CLASS_ABI VFDatabase {
   /// The Module of the CallInst CI.
   const Module *M;
   /// The CallInst instance being queried for scalar to vector mappings.
@@ -341,36 +341,36 @@ inline Type *ToVectorTy(Type *Scalar, unsigned VF) {
 /// This method returns true if the intrinsic's argument types are all scalars
 /// for the scalar form of the intrinsic and all vectors (or scalars handled by
 /// isVectorIntrinsicWithScalarOpAtArg) for the vector form of the intrinsic.
-bool isTriviallyVectorizable(Intrinsic::ID ID);
+LLVM_FUNC_ABI bool isTriviallyVectorizable(Intrinsic::ID ID);
 
 /// Identifies if the vector form of the intrinsic has a scalar operand.
-bool isVectorIntrinsicWithScalarOpAtArg(Intrinsic::ID ID,
+LLVM_FUNC_ABI bool isVectorIntrinsicWithScalarOpAtArg(Intrinsic::ID ID,
                                         unsigned ScalarOpdIdx);
 
 /// Identifies if the vector form of the intrinsic is overloaded on the type of
 /// the operand at index \p OpdIdx, or on the return type if \p OpdIdx is -1.
-bool isVectorIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID, int OpdIdx);
+LLVM_FUNC_ABI bool isVectorIntrinsicWithOverloadTypeAtArg(Intrinsic::ID ID, int OpdIdx);
 
 /// Returns intrinsic ID for call.
 /// For the input call instruction it finds mapping intrinsic and returns
 /// its intrinsic ID, in case it does not found it return not_intrinsic.
-Intrinsic::ID getVectorIntrinsicIDForCall(const CallInst *CI,
+LLVM_FUNC_ABI Intrinsic::ID getVectorIntrinsicIDForCall(const CallInst *CI,
                                           const TargetLibraryInfo *TLI);
 
 /// Given a vector and an element number, see if the scalar value is
 /// already around as a register, for example if it were inserted then extracted
 /// from the vector.
-Value *findScalarElement(Value *V, unsigned EltNo);
+LLVM_FUNC_ABI Value *findScalarElement(Value *V, unsigned EltNo);
 
 /// If all non-negative \p Mask elements are the same value, return that value.
 /// If all elements are negative (undefined) or \p Mask contains different
 /// non-negative values, return -1.
-int getSplatIndex(ArrayRef<int> Mask);
+LLVM_FUNC_ABI int getSplatIndex(ArrayRef<int> Mask);
 
 /// Get splat value if the input is a splat vector or return nullptr.
 /// The value may be extracted from a splat constants vector or from
 /// a sequence of instructions that broadcast a single value into a vector.
-Value *getSplatValue(const Value *V);
+LLVM_FUNC_ABI Value *getSplatValue(const Value *V);
 
 /// Return true if each element of the vector value \p V is poisoned or equal to
 /// every other non-poisoned element. If an index element is specified, either
@@ -378,13 +378,13 @@ Value *getSplatValue(const Value *V);
 /// poisoned and equal to every other non-poisoned element.
 /// This may be more powerful than the related getSplatValue() because it is
 /// not limited by finding a scalar source value to a splatted vector.
-bool isSplatValue(const Value *V, int Index = -1, unsigned Depth = 0);
+LLVM_FUNC_ABI bool isSplatValue(const Value *V, int Index = -1, unsigned Depth = 0);
 
 /// Transform a shuffle mask's output demanded element mask into demanded
 /// element masks for the 2 operands, returns false if the mask isn't valid.
 /// Both \p DemandedLHS and \p DemandedRHS are initialised to [SrcWidth].
 /// \p AllowUndefElts permits "-1" indices to be treated as undef.
-bool getShuffleDemandedElts(int SrcWidth, ArrayRef<int> Mask,
+LLVM_FUNC_ABI bool getShuffleDemandedElts(int SrcWidth, ArrayRef<int> Mask,
                             const APInt &DemandedElts, APInt &DemandedLHS,
                             APInt &DemandedRHS, bool AllowUndefElts = false);
 
@@ -399,7 +399,7 @@ bool getShuffleDemandedElts(int SrcWidth, ArrayRef<int> Mask,
 /// This is the reverse process of widening shuffle mask elements, but it always
 /// succeeds because the indexes can always be multiplied (scaled up) to map to
 /// narrower vector elements.
-void narrowShuffleMaskElts(int Scale, ArrayRef<int> Mask,
+LLVM_FUNC_ABI void narrowShuffleMaskElts(int Scale, ArrayRef<int> Mask,
                            SmallVectorImpl<int> &ScaledMask);
 
 /// Try to transform a shuffle mask by replacing elements with the scaled index
@@ -417,12 +417,12 @@ void narrowShuffleMaskElts(int Scale, ArrayRef<int> Mask,
 /// This is the reverse process of narrowing shuffle mask elements if it
 /// succeeds. This transform is not always possible because indexes may not
 /// divide evenly (scale down) to map to wider vector elements.
-bool widenShuffleMaskElts(int Scale, ArrayRef<int> Mask,
+LLVM_FUNC_ABI bool widenShuffleMaskElts(int Scale, ArrayRef<int> Mask,
                           SmallVectorImpl<int> &ScaledMask);
 
 /// Repetitively apply `widenShuffleMaskElts()` for as long as it succeeds,
 /// to get the shuffle mask with widest possible elements.
-void getShuffleMaskWithWidestElts(ArrayRef<int> Mask,
+LLVM_FUNC_ABI void getShuffleMaskWithWidestElts(ArrayRef<int> Mask,
                                   SmallVectorImpl<int> &ScaledMask);
 
 /// Splits and processes shuffle mask depending on the number of input and
@@ -437,7 +437,7 @@ void getShuffleMaskWithWidestElts(ArrayRef<int> Mask,
 /// \param NumOfSrcRegs Number of source registers.
 /// \param NumOfDestRegs Number of destination registers.
 /// \param NumOfUsedRegs Number of actually used destination registers.
-void processShuffleMasks(
+LLVM_FUNC_ABI void processShuffleMasks(
     ArrayRef<int> Mask, unsigned NumOfSrcRegs, unsigned NumOfDestRegs,
     unsigned NumOfUsedRegs, function_ref<void()> NoInputAction,
     function_ref<void(ArrayRef<int>, unsigned, unsigned)> SingleInputAction,
@@ -477,7 +477,7 @@ void processShuffleMasks(
 ///
 /// If the optional TargetTransformInfo is provided, this function tries harder
 /// to do less work by only looking at illegal types.
-MapVector<Instruction*, uint64_t>
+LLVM_FUNC_ABI MapVector<Instruction*, uint64_t>
 computeMinimumValueSizes(ArrayRef<BasicBlock*> Blocks,
                          DemandedBits &DB,
                          const TargetTransformInfo *TTI=nullptr);
@@ -486,7 +486,7 @@ computeMinimumValueSizes(ArrayRef<BasicBlock*> Blocks,
 ///
 /// If the list contains just one access group, it is returned directly. If the
 /// list is empty, returns nullptr.
-MDNode *uniteAccessGroups(MDNode *AccGroups1, MDNode *AccGroups2);
+LLVM_FUNC_ABI MDNode *uniteAccessGroups(MDNode *AccGroups1, MDNode *AccGroups2);
 
 /// Compute the access-group list of access groups that @p Inst1 and @p Inst2
 /// are both in. If either instruction does not access memory at all, it is
@@ -494,7 +494,7 @@ MDNode *uniteAccessGroups(MDNode *AccGroups1, MDNode *AccGroups2);
 ///
 /// If the list contains just one access group, it is returned directly. If the
 /// list is empty, returns nullptr.
-MDNode *intersectAccessGroups(const Instruction *Inst1,
+LLVM_FUNC_ABI MDNode *intersectAccessGroups(const Instruction *Inst1,
                               const Instruction *Inst2);
 
 /// Specifically, let Kinds = [MD_tbaa, MD_alias_scope, MD_noalias, MD_fpmath,
@@ -505,7 +505,7 @@ MDNode *intersectAccessGroups(const Instruction *Inst1,
 /// metadata for M equal to the intersection value.
 ///
 /// This function always sets a (possibly null) value for each K in Kinds.
-Instruction *propagateMetadata(Instruction *I, ArrayRef<Value *> VL);
+LLVM_FUNC_ABI Instruction *propagateMetadata(Instruction *I, ArrayRef<Value *> VL);
 
 /// Create a mask that filters the members of an interleave group where there
 /// are gaps.
@@ -518,7 +518,7 @@ Instruction *propagateMetadata(Instruction *I, ArrayRef<Value *> VL);
 /// Note: The result is a mask of 0's and 1's, as opposed to the other
 /// create[*]Mask() utilities which create a shuffle mask (mask that
 /// consists of indices).
-Constant *createBitMaskForGaps(IRBuilderBase &Builder, unsigned VF,
+LLVM_FUNC_ABI Constant *createBitMaskForGaps(IRBuilderBase &Builder, unsigned VF,
                                const InterleaveGroup<Instruction> &Group);
 
 /// Create a mask with replicated elements.
@@ -533,7 +533,7 @@ Constant *createBitMaskForGaps(IRBuilderBase &Builder, unsigned VF,
 /// For example, the mask for \p ReplicationFactor=3 and \p VF=4 is:
 ///
 ///   <0,0,0,1,1,1,2,2,2,3,3,3>
-llvm::SmallVector<int, 16> createReplicatedMask(unsigned ReplicationFactor,
+LLVM_FUNC_ABI llvm::SmallVector<int, 16> createReplicatedMask(unsigned ReplicationFactor,
                                                 unsigned VF);
 
 /// Create an interleave shuffle mask.
@@ -547,7 +547,7 @@ llvm::SmallVector<int, 16> createReplicatedMask(unsigned ReplicationFactor,
 /// For example, the mask for VF = 4 and NumVecs = 2 is:
 ///
 ///   <0, 4, 1, 5, 2, 6, 3, 7>.
-llvm::SmallVector<int, 16> createInterleaveMask(unsigned VF, unsigned NumVecs);
+LLVM_FUNC_ABI llvm::SmallVector<int, 16> createInterleaveMask(unsigned VF, unsigned NumVecs);
 
 /// Create a stride shuffle mask.
 ///
@@ -561,7 +561,7 @@ llvm::SmallVector<int, 16> createInterleaveMask(unsigned VF, unsigned NumVecs);
 /// For example, the mask for Start = 0, Stride = 2, and VF = 4 is:
 ///
 ///   <0, 2, 4, 6>
-llvm::SmallVector<int, 16> createStrideMask(unsigned Start, unsigned Stride,
+LLVM_FUNC_ABI llvm::SmallVector<int, 16> createStrideMask(unsigned Start, unsigned Stride,
                                             unsigned VF);
 
 /// Create a sequential shuffle mask.
@@ -575,13 +575,13 @@ llvm::SmallVector<int, 16> createStrideMask(unsigned Start, unsigned Stride,
 /// For example, the mask for Start = 0, NumInsts = 4, and NumUndefs = 4 is:
 ///
 ///   <0, 1, 2, 3, undef, undef, undef, undef>
-llvm::SmallVector<int, 16>
+LLVM_FUNC_ABI llvm::SmallVector<int, 16>
 createSequentialMask(unsigned Start, unsigned NumInts, unsigned NumUndefs);
 
 /// Given a shuffle mask for a binary shuffle, create the equivalent shuffle
 /// mask assuming both operands are identical. This assumes that the unary
 /// shuffle will use elements from operand 0 (operand 1 will be unused).
-llvm::SmallVector<int, 16> createUnaryMask(ArrayRef<int> Mask,
+LLVM_FUNC_ABI llvm::SmallVector<int, 16> createUnaryMask(ArrayRef<int> Mask,
                                            unsigned NumElts);
 
 /// Concatenate a list of vectors.
@@ -591,21 +591,21 @@ llvm::SmallVector<int, 16> createUnaryMask(ArrayRef<int> Mask,
 /// their element types should be the same. The number of elements in the
 /// vectors should also be the same; however, if the last vector has fewer
 /// elements, it will be padded with undefs.
-Value *concatenateVectors(IRBuilderBase &Builder, ArrayRef<Value *> Vecs);
+LLVM_FUNC_ABI Value *concatenateVectors(IRBuilderBase &Builder, ArrayRef<Value *> Vecs);
 
 /// Given a mask vector of i1, Return true if all of the elements of this
 /// predicate mask are known to be false or undef.  That is, return true if all
 /// lanes can be assumed inactive.
-bool maskIsAllZeroOrUndef(Value *Mask);
+LLVM_FUNC_ABI bool maskIsAllZeroOrUndef(Value *Mask);
 
 /// Given a mask vector of i1, Return true if all of the elements of this
 /// predicate mask are known to be true or undef.  That is, return true if all
 /// lanes can be assumed active.
-bool maskIsAllOneOrUndef(Value *Mask);
+LLVM_FUNC_ABI bool maskIsAllOneOrUndef(Value *Mask);
 
 /// Given a mask vector of the form <Y x i1>, return an APInt (of bitwidth Y)
 /// for each lane which may be active.
-APInt possiblyDemandedEltsInMask(Value *Mask);
+LLVM_FUNC_ABI APInt possiblyDemandedEltsInMask(Value *Mask);
 
 /// The group of interleaved loads/stores sharing the same stride and
 /// close to each other.
@@ -633,7 +633,7 @@ APInt possiblyDemandedEltsInMask(Value *Mask);
 ///
 /// Note: the interleaved load group could have gaps (missing members), but
 /// the interleaved store group doesn't allow gaps.
-template <typename InstTy> class InterleaveGroup {
+template <typename InstTy> class LLVM_CLASS_ABI InterleaveGroup {
 public:
   InterleaveGroup(uint32_t Factor, bool Reverse, Align Alignment)
       : Factor(Factor), Reverse(Reverse), Alignment(Alignment),
@@ -775,7 +775,7 @@ template <typename InstTy> class InterleaveGroup {
 ///
 /// The analysis collects interleave groups and records the relationships
 /// between the member and the group in a map.
-class InterleavedAccessInfo {
+class LLVM_CLASS_ABI InterleavedAccessInfo {
 public:
   InterleavedAccessInfo(PredicatedScalarEvolution &PSE, Loop *L,
                         DominatorTree *DT, LoopInfo *LI,
diff --git a/llvm/include/llvm/AsmParser/LLLexer.h b/llvm/include/llvm/AsmParser/LLLexer.h
index a45d1cb885d008b..dd46d695131d6ab 100644
--- a/llvm/include/llvm/AsmParser/LLLexer.h
+++ b/llvm/include/llvm/AsmParser/LLLexer.h
@@ -26,7 +26,7 @@ namespace llvm {
   class SourceMgr;
   class LLVMContext;
 
-  class LLLexer {
+  class LLVM_CLASS_ABI LLLexer {
     const char *CurPtr;
     StringRef CurBuf;
     SMDiagnostic &ErrorInfo;
diff --git a/llvm/include/llvm/AsmParser/LLParser.h b/llvm/include/llvm/AsmParser/LLParser.h
index bb16097caf2cf23..65326530c77e31f 100644
--- a/llvm/include/llvm/AsmParser/LLParser.h
+++ b/llvm/include/llvm/AsmParser/LLParser.h
@@ -50,7 +50,7 @@ namespace llvm {
   /// There are several cases where we have to parse the value but where the
   /// type can depend on later context.  This may either be a numeric reference
   /// or a symbolic (%var) reference.  This is just a discriminated union.
-  struct ValID {
+  struct LLVM_CLASS_ABI ValID {
     enum {
       t_LocalID, t_GlobalID,           // ID in UIntVal.
       t_LocalName, t_GlobalName,       // Name in StrVal.
@@ -93,7 +93,7 @@ namespace llvm {
     }
   };
 
-  class LLParser {
+  class LLVM_CLASS_ABI LLParser {
   public:
     typedef LLLexer::LocTy LocTy;
   private:
diff --git a/llvm/include/llvm/AsmParser/Parser.h b/llvm/include/llvm/AsmParser/Parser.h
index 397b2206be2a954..c5740db0a8631ba 100644
--- a/llvm/include/llvm/AsmParser/Parser.h
+++ b/llvm/include/llvm/AsmParser/Parser.h
@@ -44,7 +44,7 @@ typedef llvm::function_ref<std::optional<std::string>(StringRef, StringRef)>
 /// \param Context Context in which to allocate globals info.
 /// \param Slots The optional slot mapping that will be initialized during
 ///              parsing.
-std::unique_ptr<Module> parseAssemblyFile(StringRef Filename, SMDiagnostic &Err,
+LLVM_FUNC_ABI std::unique_ptr<Module> parseAssemblyFile(StringRef Filename, SMDiagnostic &Err,
                                           LLVMContext &Context,
                                           SlotMapping *Slots = nullptr);
 
@@ -59,14 +59,14 @@ std::unique_ptr<Module> parseAssemblyFile(StringRef Filename, SMDiagnostic &Err,
 /// \param Context Context in which to allocate globals info.
 /// \param Slots The optional slot mapping that will be initialized during
 ///              parsing.
-std::unique_ptr<Module> parseAssemblyString(StringRef AsmString,
+LLVM_FUNC_ABI std::unique_ptr<Module> parseAssemblyString(StringRef AsmString,
                                             SMDiagnostic &Err,
                                             LLVMContext &Context,
                                             SlotMapping *Slots = nullptr);
 
 /// Holds the Module and ModuleSummaryIndex returned by the interfaces
 /// that parse both.
-struct ParsedModuleAndIndex {
+struct LLVM_CLASS_ABI ParsedModuleAndIndex {
   std::unique_ptr<Module> Mod;
   std::unique_ptr<ModuleSummaryIndex> Index;
 };
@@ -84,7 +84,7 @@ struct ParsedModuleAndIndex {
 /// \param Slots The optional slot mapping that will be initialized during
 ///              parsing.
 /// \param DataLayoutCallback Override datalayout in the llvm assembly.
-ParsedModuleAndIndex parseAssemblyFileWithIndex(
+LLVM_FUNC_ABI ParsedModuleAndIndex parseAssemblyFileWithIndex(
     StringRef Filename, SMDiagnostic &Err, LLVMContext &Context,
     SlotMapping *Slots = nullptr,
     DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) {
@@ -92,7 +92,7 @@ ParsedModuleAndIndex parseAssemblyFileWithIndex(
     });
 
 /// Only for use in llvm-as for testing; this does not produce a valid module.
-ParsedModuleAndIndex parseAssemblyFileWithIndexNoUpgradeDebugInfo(
+LLVM_FUNC_ABI ParsedModuleAndIndex parseAssemblyFileWithIndexNoUpgradeDebugInfo(
     StringRef Filename, SMDiagnostic &Err, LLVMContext &Context,
     SlotMapping *Slots, DataLayoutCallbackTy DataLayoutCallback);
 
@@ -104,7 +104,7 @@ ParsedModuleAndIndex parseAssemblyFileWithIndexNoUpgradeDebugInfo(
 /// Parse LLVM Assembly Index from a file
 /// \param Filename The name of the file to parse
 /// \param Err Error result info.
-std::unique_ptr<ModuleSummaryIndex>
+LLVM_FUNC_ABI std::unique_ptr<ModuleSummaryIndex>
 parseSummaryIndexAssemblyFile(StringRef Filename, SMDiagnostic &Err);
 
 /// The function is a secondary interface to the LLVM Assembly Parser. It parses
@@ -115,7 +115,7 @@ parseSummaryIndexAssemblyFile(StringRef Filename, SMDiagnostic &Err);
 /// Parse LLVM Assembly from a string
 /// \param AsmString The string containing assembly
 /// \param Err Error result info.
-std::unique_ptr<ModuleSummaryIndex>
+LLVM_FUNC_ABI std::unique_ptr<ModuleSummaryIndex>
 parseSummaryIndexAssemblyString(StringRef AsmString, SMDiagnostic &Err);
 
 /// parseAssemblyFile and parseAssemblyString are wrappers around this function.
@@ -125,7 +125,7 @@ parseSummaryIndexAssemblyString(StringRef AsmString, SMDiagnostic &Err);
 /// \param Slots The optional slot mapping that will be initialized during
 ///              parsing.
 /// \param DataLayoutCallback Override datalayout in the llvm assembly.
-std::unique_ptr<Module> parseAssembly(
+LLVM_FUNC_ABI std::unique_ptr<Module> parseAssembly(
     MemoryBufferRef F, SMDiagnostic &Err, LLVMContext &Context,
     SlotMapping *Slots = nullptr,
     DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) {
@@ -140,7 +140,7 @@ std::unique_ptr<Module> parseAssembly(
 ///              parsing.
 ///
 /// parseAssemblyFileWithIndex is a wrapper around this function.
-ParsedModuleAndIndex parseAssemblyWithIndex(MemoryBufferRef F,
+LLVM_FUNC_ABI ParsedModuleAndIndex parseAssemblyWithIndex(MemoryBufferRef F,
                                             SMDiagnostic &Err,
                                             LLVMContext &Context,
                                             SlotMapping *Slots = nullptr);
@@ -151,7 +151,7 @@ ParsedModuleAndIndex parseAssemblyWithIndex(MemoryBufferRef F,
 /// \param Err Error result info.
 ///
 /// parseSummaryIndexAssemblyFile is a wrapper around this function.
-std::unique_ptr<ModuleSummaryIndex>
+LLVM_FUNC_ABI std::unique_ptr<ModuleSummaryIndex>
 parseSummaryIndexAssembly(MemoryBufferRef F, SMDiagnostic &Err);
 
 /// This function is the low-level interface to the LLVM Assembly Parser.
@@ -167,7 +167,7 @@ parseSummaryIndexAssembly(MemoryBufferRef F, SMDiagnostic &Err);
 ///              parsing.
 /// \return true on error.
 /// \param DataLayoutCallback Override datalayout in the llvm assembly.
-bool parseAssemblyInto(
+LLVM_FUNC_ABI bool parseAssemblyInto(
     MemoryBufferRef F, Module *M, ModuleSummaryIndex *Index, SMDiagnostic &Err,
     SlotMapping *Slots = nullptr,
     DataLayoutCallbackTy DataLayoutCallback = [](StringRef, StringRef) {
@@ -182,7 +182,7 @@ bool parseAssemblyInto(
 /// \param Slots The optional slot mapping that will restore the parsing state
 /// of the module.
 /// \return null on error.
-Constant *parseConstantValue(StringRef Asm, SMDiagnostic &Err, const Module &M,
+LLVM_FUNC_ABI Constant *parseConstantValue(StringRef Asm, SMDiagnostic &Err, const Module &M,
                              const SlotMapping *Slots = nullptr);
 
 /// Parse a type in the given string.
@@ -190,7 +190,7 @@ Constant *parseConstantValue(StringRef Asm, SMDiagnostic &Err, const Module &M,
 /// \param Slots The optional slot mapping that will restore the parsing state
 /// of the module.
 /// \return null on error.
-Type *parseType(StringRef Asm, SMDiagnostic &Err, const Module &M,
+LLVM_FUNC_ABI Type *parseType(StringRef Asm, SMDiagnostic &Err, const Module &M,
                 const SlotMapping *Slots = nullptr);
 
 /// Parse a string \p Asm that starts with a type.
@@ -200,7 +200,7 @@ Type *parseType(StringRef Asm, SMDiagnostic &Err, const Module &M,
 /// \param Slots The optional slot mapping that will restore the parsing state
 /// of the module.
 /// \return null on error.
-Type *parseTypeAtBeginning(StringRef Asm, unsigned &Read, SMDiagnostic &Err,
+LLVM_FUNC_ABI Type *parseTypeAtBeginning(StringRef Asm, unsigned &Read, SMDiagnostic &Err,
                            const Module &M, const SlotMapping *Slots = nullptr);
 
 } // End llvm namespace
diff --git a/llvm/include/llvm/AsmParser/SlotMapping.h b/llvm/include/llvm/AsmParser/SlotMapping.h
index 78208313d97d05b..28441bc30e1370c 100644
--- a/llvm/include/llvm/AsmParser/SlotMapping.h
+++ b/llvm/include/llvm/AsmParser/SlotMapping.h
@@ -30,7 +30,7 @@ class Type;
 /// It can be used to save the parsing state of an LLVM IR module so that the
 /// textual references to the values in the module can be parsed outside of the
 /// module's source.
-struct SlotMapping {
+struct LLVM_CLASS_ABI SlotMapping {
   std::vector<GlobalValue *> GlobalValues;
   std::map<unsigned, TrackingMDNodeRef> MetadataNodes;
   StringMap<Type *> NamedTypes;
diff --git a/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h b/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
index ca93b57b94e4771..1f810aec6c66590 100644
--- a/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
+++ b/llvm/include/llvm/BinaryFormat/AMDGPUMetadataVerifier.h
@@ -42,7 +42,7 @@ namespace V3 {
 /// In strict mode, metadata must already be well-typed.
 ///
 /// In non-strict mode, metadata is coerced into expected types when possible.
-class MetadataVerifier {
+class LLVM_CLASS_ABI MetadataVerifier {
   bool Strict;
 
   bool verifyScalar(msgpack::DocNode &Node, msgpack::Type SKind,
diff --git a/llvm/include/llvm/BinaryFormat/COFF.h b/llvm/include/llvm/BinaryFormat/COFF.h
index 278094681849ace..a5b7da24cd8bef6 100644
--- a/llvm/include/llvm/BinaryFormat/COFF.h
+++ b/llvm/include/llvm/BinaryFormat/COFF.h
@@ -62,7 +62,7 @@ enum {
   RelocationSize = 10
 };
 
-struct header {
+struct LLVM_CLASS_ABI header {
   uint16_t Machine;
   int32_t NumberOfSections;
   uint32_t TimeDateStamp;
@@ -72,7 +72,7 @@ struct header {
   uint16_t Characteristics;
 };
 
-struct BigObjHeader {
+struct LLVM_CLASS_ABI BigObjHeader {
   enum : uint16_t { MinBigObjectVersion = 2 };
 
   uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
@@ -195,7 +195,7 @@ enum ResourceTypeID : unsigned {
   RID_Manifest = 24,
 };
 
-struct symbol {
+struct LLVM_CLASS_ABI symbol {
   char Name[NameSize];
   uint32_t Value;
   int32_t SectionNumber;
@@ -278,7 +278,7 @@ enum SymbolComplexType : unsigned {
 
 enum AuxSymbolType { IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1 };
 
-struct section {
+struct LLVM_CLASS_ABI section {
   char Name[NameSize];
   uint32_t VirtualSize;
   uint32_t VirtualAddress;
@@ -333,7 +333,7 @@ enum SectionCharacteristics : uint32_t {
   IMAGE_SCN_MEM_WRITE = 0x80000000
 };
 
-struct relocation {
+struct LLVM_CLASS_ABI relocation {
   uint32_t VirtualAddress;
   uint32_t SymbolTableIndex;
   uint16_t Type;
@@ -425,7 +425,7 @@ enum COMDATType : uint8_t {
 };
 
 // Auxiliary Symbol Formats
-struct AuxiliaryFunctionDefinition {
+struct LLVM_CLASS_ABI AuxiliaryFunctionDefinition {
   uint32_t TagIndex;
   uint32_t TotalSize;
   uint32_t PointerToLinenumber;
@@ -433,7 +433,7 @@ struct AuxiliaryFunctionDefinition {
   char unused[2];
 };
 
-struct AuxiliarybfAndefSymbol {
+struct LLVM_CLASS_ABI AuxiliarybfAndefSymbol {
   uint8_t unused1[4];
   uint16_t Linenumber;
   uint8_t unused2[6];
@@ -441,7 +441,7 @@ struct AuxiliarybfAndefSymbol {
   uint8_t unused3[2];
 };
 
-struct AuxiliaryWeakExternal {
+struct LLVM_CLASS_ABI AuxiliaryWeakExternal {
   uint32_t TagIndex;
   uint32_t Characteristics;
   uint8_t unused[10];
@@ -454,7 +454,7 @@ enum WeakExternalCharacteristics : unsigned {
   IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY = 4
 };
 
-struct AuxiliarySectionDefinition {
+struct LLVM_CLASS_ABI AuxiliarySectionDefinition {
   uint32_t Length;
   uint16_t NumberOfRelocations;
   uint16_t NumberOfLinenumbers;
@@ -464,7 +464,7 @@ struct AuxiliarySectionDefinition {
   char unused;
 };
 
-struct AuxiliaryCLRToken {
+struct LLVM_CLASS_ABI AuxiliaryCLRToken {
   uint8_t AuxType;
   uint8_t unused1;
   uint32_t SymbolTableIndex;
@@ -481,7 +481,7 @@ union Auxiliary {
 /// The Import Directory Table.
 ///
 /// There is a single array of these and one entry per imported DLL.
-struct ImportDirectoryTableEntry {
+struct LLVM_CLASS_ABI ImportDirectoryTableEntry {
   uint32_t ImportLookupTableRVA;
   uint32_t TimeDateStamp;
   uint32_t ForwarderChain;
@@ -497,7 +497,7 @@ struct ImportDirectoryTableEntry {
 ///
 /// This also happens to be the same format used by the Import Address Table
 /// when it is initially written out to the image.
-struct ImportLookupTableEntry32 {
+struct LLVM_CLASS_ABI ImportLookupTableEntry32 {
   uint32_t data;
 
   /// Is this entry specified by ordinal, or name?
@@ -526,7 +526,7 @@ struct ImportLookupTableEntry32 {
 };
 
 /// The DOS compatible header at the front of all PEs.
-struct DOSHeader {
+struct LLVM_CLASS_ABI DOSHeader {
   uint16_t Magic;
   uint16_t UsedBytesInTheLastPage;
   uint16_t FileSizeInPages;
@@ -548,7 +548,7 @@ struct DOSHeader {
   uint32_t AddressOfNewExeHeader;
 };
 
-struct PE32Header {
+struct LLVM_CLASS_ABI PE32Header {
   enum { PE32 = 0x10b, PE32_PLUS = 0x20b };
 
   uint16_t Magic;
@@ -585,7 +585,7 @@ struct PE32Header {
   uint32_t NumberOfRvaAndSize;
 };
 
-struct DataDirectory {
+struct LLVM_CLASS_ABI DataDirectory {
   uint32_t RelativeVirtualAddress;
   uint32_t Size;
 };
@@ -761,7 +761,7 @@ enum class GuardFlags : uint32_t {
   CF_FUNCTION_TABLE_SIZE_19BYTES = 0xF0000000,
 };
 
-struct ImportHeader {
+struct LLVM_CLASS_ABI ImportHeader {
   uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
   uint16_t Sig2; ///< Must be 0xFFFF.
   uint16_t Version;
@@ -806,7 +806,7 @@ inline bool isReservedSectionNumber(int32_t SectionNumber) {
 
 /// Encode section name based on string table offset.
 /// The size of Out must be at least COFF::NameSize.
-bool encodeSectionName(char *Out, uint64_t Offset);
+LLVM_FUNC_ABI bool encodeSectionName(char *Out, uint64_t Offset);
 
 } // End namespace COFF.
 } // End namespace llvm.
diff --git a/llvm/include/llvm/BinaryFormat/DXContainer.h b/llvm/include/llvm/BinaryFormat/DXContainer.h
index dd4c89b18246c40..e70108a4f1eab6f 100644
--- a/llvm/include/llvm/BinaryFormat/DXContainer.h
+++ b/llvm/include/llvm/BinaryFormat/DXContainer.h
@@ -44,7 +44,7 @@ inline Triple::EnvironmentType getShaderStage(uint32_t Kind) {
   return static_cast<Triple::EnvironmentType>(Triple::Pixel + Kind);
 }
 
-struct Hash {
+struct LLVM_CLASS_ABI Hash {
   uint8_t Digest[16];
 };
 
@@ -54,7 +54,7 @@ enum class HashFlags : uint32_t {
                       // taking into account source information (-Zss)
 };
 
-struct ShaderHash {
+struct LLVM_CLASS_ABI ShaderHash {
   uint32_t Flags; // dxbc::HashFlags
   uint8_t Digest[16];
 
@@ -63,7 +63,7 @@ struct ShaderHash {
   void swapBytes() { sys::swapByteOrder(Flags); }
 };
 
-struct ContainerVersion {
+struct LLVM_CLASS_ABI ContainerVersion {
   uint16_t Major;
   uint16_t Minor;
 
@@ -73,7 +73,7 @@ struct ContainerVersion {
   }
 };
 
-struct Header {
+struct LLVM_CLASS_ABI Header {
   uint8_t Magic[4]; // "DXBC"
   Hash FileHash;
   ContainerVersion Version;
@@ -90,7 +90,7 @@ struct Header {
 };
 
 /// Use this type to describe the size and type of a DXIL container part.
-struct PartHeader {
+struct LLVM_CLASS_ABI PartHeader {
   uint8_t Name[4];
   uint32_t Size;
 
@@ -101,7 +101,7 @@ struct PartHeader {
   // Structure is followed directly by part data: uint8_t PartData[PartSize].
 };
 
-struct BitcodeHeader {
+struct LLVM_CLASS_ABI BitcodeHeader {
   uint8_t Magic[4];     // ACSII "DXIL".
   uint8_t MajorVersion; // DXIL version.
   uint8_t MinorVersion; // DXIL version.
@@ -118,7 +118,7 @@ struct BitcodeHeader {
   }
 };
 
-struct ProgramHeader {
+struct LLVM_CLASS_ABI ProgramHeader {
   uint8_t MinorVersion : 4;
   uint8_t MajorVersion : 4;
   uint8_t Unused;
@@ -148,9 +148,9 @@ enum class FeatureFlags : uint64_t {
 static_assert((uint64_t)FeatureFlags::NextUnusedBit <= 1ull << 63,
               "Shader flag bits exceed enum size.");
 
-PartType parsePartType(StringRef S);
+LLVM_FUNC_ABI PartType parsePartType(StringRef S);
 
-struct VertexPSVInfo {
+struct LLVM_CLASS_ABI VertexPSVInfo {
   uint8_t OutputPositionPresent;
   uint8_t Unused[3];
 
@@ -159,7 +159,7 @@ struct VertexPSVInfo {
   }
 };
 
-struct HullPSVInfo {
+struct LLVM_CLASS_ABI HullPSVInfo {
   uint32_t InputControlPointCount;
   uint32_t OutputControlPointCount;
   uint32_t TessellatorDomain;
@@ -173,7 +173,7 @@ struct HullPSVInfo {
   }
 };
 
-struct DomainPSVInfo {
+struct LLVM_CLASS_ABI DomainPSVInfo {
   uint32_t InputControlPointCount;
   uint8_t OutputPositionPresent;
   uint8_t Unused[3];
@@ -185,7 +185,7 @@ struct DomainPSVInfo {
   }
 };
 
-struct GeometryPSVInfo {
+struct LLVM_CLASS_ABI GeometryPSVInfo {
   uint32_t InputPrimitive;
   uint32_t OutputTopology;
   uint32_t OutputStreamMask;
@@ -199,7 +199,7 @@ struct GeometryPSVInfo {
   }
 };
 
-struct PixelPSVInfo {
+struct LLVM_CLASS_ABI PixelPSVInfo {
   uint8_t DepthOutput;
   uint8_t SampleFrequency;
   uint8_t Unused[2];
@@ -209,7 +209,7 @@ struct PixelPSVInfo {
   }
 };
 
-struct MeshPSVInfo {
+struct LLVM_CLASS_ABI MeshPSVInfo {
   uint32_t GroupSharedBytesUsed;
   uint32_t GroupSharedBytesDependentOnViewID;
   uint32_t PayloadSizeInBytes;
@@ -225,7 +225,7 @@ struct MeshPSVInfo {
   }
 };
 
-struct AmplificationPSVInfo {
+struct LLVM_CLASS_ABI AmplificationPSVInfo {
   uint32_t PayloadSizeInBytes;
 
   void swapBytes() { sys::swapByteOrder(PayloadSizeInBytes); }
@@ -275,7 +275,7 @@ static_assert(sizeof(PipelinePSVInfo) == 4 * sizeof(uint32_t),
 namespace PSV {
 
 namespace v0 {
-struct RuntimeInfo {
+struct LLVM_CLASS_ABI RuntimeInfo {
   PipelinePSVInfo StageInfo;
   uint32_t MinimumWaveLaneCount; // minimum lane count required, 0 if unused
   uint32_t MaximumWaveLaneCount; // maximum lane count required,
@@ -289,7 +289,7 @@ struct RuntimeInfo {
   void swapBytes(Triple::EnvironmentType Stage) { StageInfo.swapBytes(Stage); }
 };
 
-struct ResourceBindInfo {
+struct LLVM_CLASS_ABI ResourceBindInfo {
   uint32_t Type;
   uint32_t Space;
   uint32_t LowerBound;
@@ -307,7 +307,7 @@ struct ResourceBindInfo {
 
 namespace v1 {
 
-struct MeshRuntimeInfo {
+struct LLVM_CLASS_ABI MeshRuntimeInfo {
   uint8_t SigPrimVectors; // Primitive output for MS
   uint8_t MeshOutputTopology;
 };
@@ -319,7 +319,7 @@ union GeometryExtraInfo {
                                       // MeshInfo::SigPrimVectors)
   MeshRuntimeInfo MeshInfo;
 };
-struct RuntimeInfo : public v0::RuntimeInfo {
+struct LLVM_CLASS_ABI RuntimeInfo : public v0::RuntimeInfo {
   uint8_t ShaderStage; // PSVShaderKind
   uint8_t UsesViewID;
   GeometryExtraInfo GeomData;
@@ -347,7 +347,7 @@ struct RuntimeInfo : public v0::RuntimeInfo {
 } // namespace v1
 
 namespace v2 {
-struct RuntimeInfo : public v1::RuntimeInfo {
+struct LLVM_CLASS_ABI RuntimeInfo : public v1::RuntimeInfo {
   uint32_t NumThreadsX;
   uint32_t NumThreadsY;
   uint32_t NumThreadsZ;
@@ -363,7 +363,7 @@ struct RuntimeInfo : public v1::RuntimeInfo {
   }
 };
 
-struct ResourceBindInfo : public v0::ResourceBindInfo {
+struct LLVM_CLASS_ABI ResourceBindInfo : public v0::ResourceBindInfo {
   uint32_t Kind;
   uint32_t Flags;
 
diff --git a/llvm/include/llvm/BinaryFormat/Dwarf.h b/llvm/include/llvm/BinaryFormat/Dwarf.h
index 869352b35e32356..0410a58683619c4 100644
--- a/llvm/include/llvm/BinaryFormat/Dwarf.h
+++ b/llvm/include/llvm/BinaryFormat/Dwarf.h
@@ -634,42 +634,42 @@ enum GDBIndexEntryLinkage { GIEL_EXTERNAL, GIEL_STATIC };
 /// isn't known.
 ///
 /// @{
-StringRef TagString(unsigned Tag);
-StringRef ChildrenString(unsigned Children);
-StringRef AttributeString(unsigned Attribute);
-StringRef FormEncodingString(unsigned Encoding);
-StringRef OperationEncodingString(unsigned Encoding);
-StringRef SubOperationEncodingString(unsigned OpEncoding,
+LLVM_FUNC_ABI StringRef TagString(unsigned Tag);
+LLVM_FUNC_ABI StringRef ChildrenString(unsigned Children);
+LLVM_FUNC_ABI StringRef AttributeString(unsigned Attribute);
+LLVM_FUNC_ABI StringRef FormEncodingString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef OperationEncodingString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef SubOperationEncodingString(unsigned OpEncoding,
                                      unsigned SubOpEncoding);
-StringRef AttributeEncodingString(unsigned Encoding);
-StringRef DecimalSignString(unsigned Sign);
-StringRef EndianityString(unsigned Endian);
-StringRef AccessibilityString(unsigned Access);
-StringRef DefaultedMemberString(unsigned DefaultedEncodings);
-StringRef VisibilityString(unsigned Visibility);
-StringRef VirtualityString(unsigned Virtuality);
-StringRef LanguageString(unsigned Language);
-StringRef CaseString(unsigned Case);
-StringRef ConventionString(unsigned Convention);
-StringRef InlineCodeString(unsigned Code);
-StringRef ArrayOrderString(unsigned Order);
-StringRef LNStandardString(unsigned Standard);
-StringRef LNExtendedString(unsigned Encoding);
-StringRef MacinfoString(unsigned Encoding);
-StringRef MacroString(unsigned Encoding);
-StringRef GnuMacroString(unsigned Encoding);
-StringRef RangeListEncodingString(unsigned Encoding);
-StringRef LocListEncodingString(unsigned Encoding);
-StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch);
-StringRef ApplePropertyString(unsigned);
-StringRef UnitTypeString(unsigned);
-StringRef AtomTypeString(unsigned Atom);
-StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind);
-StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
-StringRef IndexString(unsigned Idx);
-StringRef FormatString(DwarfFormat Format);
-StringRef FormatString(bool IsDWARF64);
-StringRef RLEString(unsigned RLE);
+LLVM_FUNC_ABI StringRef AttributeEncodingString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef DecimalSignString(unsigned Sign);
+LLVM_FUNC_ABI StringRef EndianityString(unsigned Endian);
+LLVM_FUNC_ABI StringRef AccessibilityString(unsigned Access);
+LLVM_FUNC_ABI StringRef DefaultedMemberString(unsigned DefaultedEncodings);
+LLVM_FUNC_ABI StringRef VisibilityString(unsigned Visibility);
+LLVM_FUNC_ABI StringRef VirtualityString(unsigned Virtuality);
+LLVM_FUNC_ABI StringRef LanguageString(unsigned Language);
+LLVM_FUNC_ABI StringRef CaseString(unsigned Case);
+LLVM_FUNC_ABI StringRef ConventionString(unsigned Convention);
+LLVM_FUNC_ABI StringRef InlineCodeString(unsigned Code);
+LLVM_FUNC_ABI StringRef ArrayOrderString(unsigned Order);
+LLVM_FUNC_ABI StringRef LNStandardString(unsigned Standard);
+LLVM_FUNC_ABI StringRef LNExtendedString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef MacinfoString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef MacroString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef GnuMacroString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef RangeListEncodingString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef LocListEncodingString(unsigned Encoding);
+LLVM_FUNC_ABI StringRef CallFrameString(unsigned Encoding, Triple::ArchType Arch);
+LLVM_FUNC_ABI StringRef ApplePropertyString(unsigned);
+LLVM_FUNC_ABI StringRef UnitTypeString(unsigned);
+LLVM_FUNC_ABI StringRef AtomTypeString(unsigned Atom);
+LLVM_FUNC_ABI StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind);
+LLVM_FUNC_ABI StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
+LLVM_FUNC_ABI StringRef IndexString(unsigned Idx);
+LLVM_FUNC_ABI StringRef FormatString(DwarfFormat Format);
+LLVM_FUNC_ABI StringRef FormatString(bool IsDWARF64);
+LLVM_FUNC_ABI StringRef RLEString(unsigned RLE);
 /// @}
 
 /// \defgroup DwarfConstantsParsing Dwarf constants parsing functions
@@ -682,16 +682,16 @@ StringRef RLEString(unsigned RLE);
 /// \li \a getMacinfo() returns \a DW_MACINFO_invalid on invalid input.
 ///
 /// @{
-unsigned getTag(StringRef TagString);
-unsigned getOperationEncoding(StringRef OperationEncodingString);
-unsigned getSubOperationEncoding(unsigned OpEncoding,
+LLVM_FUNC_ABI unsigned getTag(StringRef TagString);
+LLVM_FUNC_ABI unsigned getOperationEncoding(StringRef OperationEncodingString);
+LLVM_FUNC_ABI unsigned getSubOperationEncoding(unsigned OpEncoding,
                                  StringRef SubOperationEncodingString);
-unsigned getVirtuality(StringRef VirtualityString);
-unsigned getLanguage(StringRef LanguageString);
-unsigned getCallingConvention(StringRef LanguageString);
-unsigned getAttributeEncoding(StringRef EncodingString);
-unsigned getMacinfo(StringRef MacinfoString);
-unsigned getMacro(StringRef MacroString);
+LLVM_FUNC_ABI unsigned getVirtuality(StringRef VirtualityString);
+LLVM_FUNC_ABI unsigned getLanguage(StringRef LanguageString);
+LLVM_FUNC_ABI unsigned getCallingConvention(StringRef LanguageString);
+LLVM_FUNC_ABI unsigned getAttributeEncoding(StringRef EncodingString);
+LLVM_FUNC_ABI unsigned getMacinfo(StringRef MacinfoString);
+LLVM_FUNC_ABI unsigned getMacro(StringRef MacroString);
 /// @}
 
 /// \defgroup DwarfConstantsVersioning Dwarf version for constants
@@ -702,12 +702,12 @@ unsigned getMacro(StringRef MacroString);
 /// Otherwise returns 0.
 ///
 /// @{
-unsigned TagVersion(Tag T);
-unsigned AttributeVersion(Attribute A);
-unsigned FormVersion(Form F);
-unsigned OperationVersion(LocationAtom O);
-unsigned AttributeEncodingVersion(TypeKind E);
-unsigned LanguageVersion(SourceLanguage L);
+LLVM_FUNC_ABI unsigned TagVersion(Tag T);
+LLVM_FUNC_ABI unsigned AttributeVersion(Attribute A);
+LLVM_FUNC_ABI unsigned FormVersion(Form F);
+LLVM_FUNC_ABI unsigned OperationVersion(LocationAtom O);
+LLVM_FUNC_ABI unsigned AttributeEncodingVersion(TypeKind E);
+LLVM_FUNC_ABI unsigned LanguageVersion(SourceLanguage L);
 /// @}
 
 /// \defgroup DwarfConstantsVendor Dwarf "vendor" for constants
@@ -716,15 +716,15 @@ unsigned LanguageVersion(SourceLanguage L);
 /// either the DWARF standard itself or the vendor who defined the extension.
 ///
 /// @{
-unsigned TagVendor(Tag T);
-unsigned AttributeVendor(Attribute A);
-unsigned FormVendor(Form F);
-unsigned OperationVendor(LocationAtom O);
-unsigned AttributeEncodingVendor(TypeKind E);
-unsigned LanguageVendor(SourceLanguage L);
+LLVM_FUNC_ABI unsigned TagVendor(Tag T);
+LLVM_FUNC_ABI unsigned AttributeVendor(Attribute A);
+LLVM_FUNC_ABI unsigned FormVendor(Form F);
+LLVM_FUNC_ABI unsigned OperationVendor(LocationAtom O);
+LLVM_FUNC_ABI unsigned AttributeEncodingVendor(TypeKind E);
+LLVM_FUNC_ABI unsigned LanguageVendor(SourceLanguage L);
 /// @}
 
-std::optional<unsigned> LanguageLowerBound(SourceLanguage L);
+LLVM_FUNC_ABI std::optional<unsigned> LanguageLowerBound(SourceLanguage L);
 
 /// The size of a reference determined by the DWARF 32/64-bit format.
 inline uint8_t getDwarfOffsetByteSize(DwarfFormat Format) {
@@ -740,7 +740,7 @@ inline uint8_t getDwarfOffsetByteSize(DwarfFormat Format) {
 /// A helper struct providing information about the byte size of DW_FORM
 /// values that vary in size depending on the DWARF version, address byte
 /// size, or DWARF32/DWARF64.
-struct FormParams {
+struct LLVM_CLASS_ABI FormParams {
   uint16_t Version;
   uint8_t AddrSize;
   DwarfFormat Format;
@@ -786,20 +786,20 @@ inline uint8_t getUnitLengthFieldByteSize(DwarfFormat Format) {
 /// \param Params DWARF parameters to help interpret forms.
 /// \returns std::optional<uint8_t> value with the fixed byte size or
 /// std::nullopt if \p Form doesn't have a fixed byte size.
-std::optional<uint8_t> getFixedFormByteSize(dwarf::Form Form,
+LLVM_FUNC_ABI std::optional<uint8_t> getFixedFormByteSize(dwarf::Form Form,
                                             FormParams Params);
 
 /// Tells whether the specified form is defined in the specified version,
 /// or is an extension if extensions are allowed.
-bool isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk = true);
+LLVM_FUNC_ABI bool isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk = true);
 
 /// Returns the symbolic string representing Val when used as a value
 /// for attribute Attr.
-StringRef AttributeValueString(uint16_t Attr, unsigned Val);
+LLVM_FUNC_ABI StringRef AttributeValueString(uint16_t Attr, unsigned Val);
 
 /// Returns the symbolic string representing Val when used as a value
 /// for atom Atom.
-StringRef AtomValueString(uint16_t Atom, unsigned Val);
+LLVM_FUNC_ABI StringRef AtomValueString(uint16_t Atom, unsigned Val);
 
 /// Describes an entry of the various gnu_pub* debug sections.
 ///
@@ -811,7 +811,7 @@ StringRef AtomValueString(uint16_t Atom, unsigned Val);
 ///
 /// A gdb_index descriptor includes the above kind, shifted 24 bits up with the
 /// offset of the cu within the debug_info section stored in those 24 bits.
-struct PubIndexEntryDescriptor {
+struct LLVM_CLASS_ABI PubIndexEntryDescriptor {
   GDBIndexEntryKind Kind;
   GDBIndexEntryLinkage Linkage;
   PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)
@@ -836,34 +836,34 @@ struct PubIndexEntryDescriptor {
   };
 };
 
-template <typename Enum> struct EnumTraits : public std::false_type {};
+template <typename Enum> struct LLVM_CLASS_ABI EnumTraits : public std::false_type {};
 
-template <> struct EnumTraits<Attribute> : public std::true_type {
+template <> struct LLVM_CLASS_ABI EnumTraits<Attribute> : public std::true_type {
   static constexpr char Type[3] = "AT";
   static constexpr StringRef (*StringFn)(unsigned) = &AttributeString;
 };
 
-template <> struct EnumTraits<Form> : public std::true_type {
+template <> struct LLVM_CLASS_ABI EnumTraits<Form> : public std::true_type {
   static constexpr char Type[5] = "FORM";
   static constexpr StringRef (*StringFn)(unsigned) = &FormEncodingString;
 };
 
-template <> struct EnumTraits<Index> : public std::true_type {
+template <> struct LLVM_CLASS_ABI EnumTraits<Index> : public std::true_type {
   static constexpr char Type[4] = "IDX";
   static constexpr StringRef (*StringFn)(unsigned) = &IndexString;
 };
 
-template <> struct EnumTraits<Tag> : public std::true_type {
+template <> struct LLVM_CLASS_ABI EnumTraits<Tag> : public std::true_type {
   static constexpr char Type[4] = "TAG";
   static constexpr StringRef (*StringFn)(unsigned) = &TagString;
 };
 
-template <> struct EnumTraits<LineNumberOps> : public std::true_type {
+template <> struct LLVM_CLASS_ABI EnumTraits<LineNumberOps> : public std::true_type {
   static constexpr char Type[4] = "LNS";
   static constexpr StringRef (*StringFn)(unsigned) = &LNStandardString;
 };
 
-template <> struct EnumTraits<LocationAtom> : public std::true_type {
+template <> struct LLVM_CLASS_ABI EnumTraits<LocationAtom> : public std::true_type {
   static constexpr char Type[3] = "OP";
   static constexpr StringRef (*StringFn)(unsigned) = &OperationEncodingString;
 };
@@ -880,7 +880,7 @@ inline uint64_t computeTombstoneAddress(uint8_t AddressByteSize) {
 /// dumping functions above, these format unknown enumerator values as
 /// DW_TYPE_unknown_1234 (e.g. DW_TAG_unknown_ffff).
 template <typename Enum>
-struct format_provider<Enum, std::enable_if_t<dwarf::EnumTraits<Enum>::value>> {
+struct LLVM_CLASS_ABI format_provider<Enum, std::enable_if_t<dwarf::EnumTraits<Enum>::value>> {
   static void format(const Enum &E, raw_ostream &OS, StringRef Style) {
     StringRef Str = dwarf::EnumTraits<Enum>::StringFn(E);
     if (Str.empty()) {
diff --git a/llvm/include/llvm/BinaryFormat/ELF.h b/llvm/include/llvm/BinaryFormat/ELF.h
index e16bf6c72929b0f..869165d0edc4b9c 100644
--- a/llvm/include/llvm/BinaryFormat/ELF.h
+++ b/llvm/include/llvm/BinaryFormat/ELF.h
@@ -59,7 +59,7 @@ enum {
   EI_NIDENT = 16     // Number of bytes in e_ident.
 };
 
-struct Elf32_Ehdr {
+struct LLVM_CLASS_ABI Elf32_Ehdr {
   unsigned char e_ident[EI_NIDENT]; // ELF Identification bytes
   Elf32_Half e_type;                // Type of file (see ET_* below)
   Elf32_Half e_machine;   // Required architecture for this file (see EM_*)
@@ -85,7 +85,7 @@ struct Elf32_Ehdr {
 
 // 64-bit ELF header. Fields are the same as for ELF32, but with different
 // types (see above).
-struct Elf64_Ehdr {
+struct LLVM_CLASS_ABI Elf64_Ehdr {
   unsigned char e_ident[EI_NIDENT];
   Elf64_Half e_type;
   Elf64_Half e_machine;
@@ -954,7 +954,7 @@ enum {
 #undef ELF_RELOC
 
 // Section header.
-struct Elf32_Shdr {
+struct LLVM_CLASS_ABI Elf32_Shdr {
   Elf32_Word sh_name;      // Section name (index into string table)
   Elf32_Word sh_type;      // Section type (SHT_*)
   Elf32_Word sh_flags;     // Section flags (SHF_*)
@@ -968,7 +968,7 @@ struct Elf32_Shdr {
 };
 
 // Section header for ELF64 - same fields as ELF32, different types.
-struct Elf64_Shdr {
+struct LLVM_CLASS_ABI Elf64_Shdr {
   Elf64_Word sh_name;
   Elf64_Word sh_type;
   Elf64_Xword sh_flags;
@@ -1193,7 +1193,7 @@ enum : unsigned {
 };
 
 // Symbol table entries for ELF32.
-struct Elf32_Sym {
+struct LLVM_CLASS_ABI Elf32_Sym {
   Elf32_Word st_name;     // Symbol name (index into string table)
   Elf32_Addr st_value;    // Value or address associated with the symbol
   Elf32_Word st_size;     // Size of the symbol
@@ -1213,7 +1213,7 @@ struct Elf32_Sym {
 };
 
 // Symbol table entries for ELF64.
-struct Elf64_Sym {
+struct LLVM_CLASS_ABI Elf64_Sym {
   Elf64_Word st_name;     // Symbol name (index into string table)
   unsigned char st_info;  // Symbol's type and binding attributes
   unsigned char st_other; // Must be zero; reserved
@@ -1288,7 +1288,7 @@ enum {
 };
 
 // Relocation entry, without explicit addend.
-struct Elf32_Rel {
+struct LLVM_CLASS_ABI Elf32_Rel {
   Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
   Elf32_Word r_info;   // Symbol table index and type of relocation to apply
 
@@ -1304,7 +1304,7 @@ struct Elf32_Rel {
 };
 
 // Relocation entry with explicit addend.
-struct Elf32_Rela {
+struct LLVM_CLASS_ABI Elf32_Rela {
   Elf32_Addr r_offset;  // Location (file byte offset, or program virtual addr)
   Elf32_Word r_info;    // Symbol table index and type of relocation to apply
   Elf32_Sword r_addend; // Compute value for relocatable field by adding this
@@ -1324,7 +1324,7 @@ struct Elf32_Rela {
 typedef Elf32_Word Elf32_Relr; // offset/bitmap for relative relocations
 
 // Relocation entry, without explicit addend.
-struct Elf64_Rel {
+struct LLVM_CLASS_ABI Elf64_Rel {
   Elf64_Addr r_offset; // Location (file byte offset, or program virtual addr).
   Elf64_Xword r_info;  // Symbol table index and type of relocation to apply.
 
@@ -1340,7 +1340,7 @@ struct Elf64_Rel {
 };
 
 // Relocation entry with explicit addend.
-struct Elf64_Rela {
+struct LLVM_CLASS_ABI Elf64_Rela {
   Elf64_Addr r_offset; // Location (file byte offset, or program virtual addr).
   Elf64_Xword r_info;  // Symbol table index and type of relocation to apply.
   Elf64_Sxword r_addend; // Compute value for relocatable field by adding this.
@@ -1360,7 +1360,7 @@ struct Elf64_Rela {
 typedef Elf64_Xword Elf64_Relr; // offset/bitmap for relative relocations
 
 // Program header for ELF32.
-struct Elf32_Phdr {
+struct LLVM_CLASS_ABI Elf32_Phdr {
   Elf32_Word p_type;   // Type of segment
   Elf32_Off p_offset;  // File offset where segment is located, in bytes
   Elf32_Addr p_vaddr;  // Virtual address of beginning of segment
@@ -1372,7 +1372,7 @@ struct Elf32_Phdr {
 };
 
 // Program header for ELF64.
-struct Elf64_Phdr {
+struct LLVM_CLASS_ABI Elf64_Phdr {
   Elf64_Word p_type;    // Type of segment
   Elf64_Word p_flags;   // Segment flags
   Elf64_Off p_offset;   // File offset where segment is located, in bytes
@@ -1442,7 +1442,7 @@ enum : unsigned {
 };
 
 // Dynamic table entry for ELF32.
-struct Elf32_Dyn {
+struct LLVM_CLASS_ABI Elf32_Dyn {
   Elf32_Sword d_tag; // Type of dynamic table entry.
   union {
     Elf32_Word d_val; // Integer value of entry.
@@ -1451,7 +1451,7 @@ struct Elf32_Dyn {
 };
 
 // Dynamic table entry for ELF64.
-struct Elf64_Dyn {
+struct LLVM_CLASS_ABI Elf64_Dyn {
   Elf64_Sxword d_tag; // Type of dynamic table entry.
   union {
     Elf64_Xword d_val; // Integer value of entry.
@@ -1804,14 +1804,14 @@ enum {
 };
 
 // Compressed section header for ELF32.
-struct Elf32_Chdr {
+struct LLVM_CLASS_ABI Elf32_Chdr {
   Elf32_Word ch_type;
   Elf32_Word ch_size;
   Elf32_Word ch_addralign;
 };
 
 // Compressed section header for ELF64.
-struct Elf64_Chdr {
+struct LLVM_CLASS_ABI Elf64_Chdr {
   Elf64_Word ch_type;
   Elf64_Word ch_reserved;
   Elf64_Xword ch_size;
@@ -1819,14 +1819,14 @@ struct Elf64_Chdr {
 };
 
 // Note header for ELF32.
-struct Elf32_Nhdr {
+struct LLVM_CLASS_ABI Elf32_Nhdr {
   Elf32_Word n_namesz;
   Elf32_Word n_descsz;
   Elf32_Word n_type;
 };
 
 // Note header for ELF64.
-struct Elf64_Nhdr {
+struct LLVM_CLASS_ABI Elf64_Nhdr {
   Elf64_Word n_namesz;
   Elf64_Word n_descsz;
   Elf64_Word n_type;
@@ -1843,10 +1843,10 @@ enum {
 };
 
 /// Convert an architecture name into ELF's e_machine value.
-uint16_t convertArchNameToEMachine(StringRef Arch);
+LLVM_FUNC_ABI uint16_t convertArchNameToEMachine(StringRef Arch);
 
 /// Convert an ELF's e_machine value into an architecture name.
-StringRef convertEMachineToArchName(uint16_t EMachine);
+LLVM_FUNC_ABI StringRef convertEMachineToArchName(uint16_t EMachine);
 
 } // end namespace ELF
 } // end namespace llvm
diff --git a/llvm/include/llvm/BinaryFormat/MachO.h b/llvm/include/llvm/BinaryFormat/MachO.h
index a6d64b4c04eee79..822261aae6fc6ff 100644
--- a/llvm/include/llvm/BinaryFormat/MachO.h
+++ b/llvm/include/llvm/BinaryFormat/MachO.h
@@ -515,7 +515,7 @@ enum { TOOL_CLANG = 1, TOOL_SWIFT = 2, TOOL_LD = 3, TOOL_LLD = 4 };
 
 // Structs from <mach-o/loader.h>
 
-struct mach_header {
+struct LLVM_CLASS_ABI mach_header {
   uint32_t magic;
   uint32_t cputype;
   uint32_t cpusubtype;
@@ -525,7 +525,7 @@ struct mach_header {
   uint32_t flags;
 };
 
-struct mach_header_64 {
+struct LLVM_CLASS_ABI mach_header_64 {
   uint32_t magic;
   uint32_t cputype;
   uint32_t cpusubtype;
@@ -536,12 +536,12 @@ struct mach_header_64 {
   uint32_t reserved;
 };
 
-struct load_command {
+struct LLVM_CLASS_ABI load_command {
   uint32_t cmd;
   uint32_t cmdsize;
 };
 
-struct segment_command {
+struct LLVM_CLASS_ABI segment_command {
   uint32_t cmd;
   uint32_t cmdsize;
   char segname[16];
@@ -555,7 +555,7 @@ struct segment_command {
   uint32_t flags;
 };
 
-struct segment_command_64 {
+struct LLVM_CLASS_ABI segment_command_64 {
   uint32_t cmd;
   uint32_t cmdsize;
   char segname[16];
@@ -569,7 +569,7 @@ struct segment_command_64 {
   uint32_t flags;
 };
 
-struct section {
+struct LLVM_CLASS_ABI section {
   char sectname[16];
   char segname[16];
   uint32_t addr;
@@ -583,7 +583,7 @@ struct section {
   uint32_t reserved2;
 };
 
-struct section_64 {
+struct LLVM_CLASS_ABI section_64 {
   char sectname[16];
   char segname[16];
   uint64_t addr;
@@ -603,58 +603,58 @@ inline bool isVirtualSection(uint8_t type) {
           type == MachO::S_THREAD_LOCAL_ZEROFILL);
 }
 
-struct fvmlib {
+struct LLVM_CLASS_ABI fvmlib {
   uint32_t name;
   uint32_t minor_version;
   uint32_t header_addr;
 };
 
 // The fvmlib_command is obsolete and no longer supported.
-struct fvmlib_command {
+struct LLVM_CLASS_ABI fvmlib_command {
   uint32_t cmd;
   uint32_t cmdsize;
   struct fvmlib fvmlib;
 };
 
-struct dylib {
+struct LLVM_CLASS_ABI dylib {
   uint32_t name;
   uint32_t timestamp;
   uint32_t current_version;
   uint32_t compatibility_version;
 };
 
-struct dylib_command {
+struct LLVM_CLASS_ABI dylib_command {
   uint32_t cmd;
   uint32_t cmdsize;
   struct dylib dylib;
 };
 
-struct sub_framework_command {
+struct LLVM_CLASS_ABI sub_framework_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t umbrella;
 };
 
-struct sub_client_command {
+struct LLVM_CLASS_ABI sub_client_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t client;
 };
 
-struct sub_umbrella_command {
+struct LLVM_CLASS_ABI sub_umbrella_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t sub_umbrella;
 };
 
-struct sub_library_command {
+struct LLVM_CLASS_ABI sub_library_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t sub_library;
 };
 
 // The prebound_dylib_command is obsolete and no longer supported.
-struct prebound_dylib_command {
+struct LLVM_CLASS_ABI prebound_dylib_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t name;
@@ -662,18 +662,18 @@ struct prebound_dylib_command {
   uint32_t linked_modules;
 };
 
-struct dylinker_command {
+struct LLVM_CLASS_ABI dylinker_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t name;
 };
 
-struct thread_command {
+struct LLVM_CLASS_ABI thread_command {
   uint32_t cmd;
   uint32_t cmdsize;
 };
 
-struct routines_command {
+struct LLVM_CLASS_ABI routines_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t init_address;
@@ -686,7 +686,7 @@ struct routines_command {
   uint32_t reserved6;
 };
 
-struct routines_command_64 {
+struct LLVM_CLASS_ABI routines_command_64 {
   uint32_t cmd;
   uint32_t cmdsize;
   uint64_t init_address;
@@ -699,7 +699,7 @@ struct routines_command_64 {
   uint64_t reserved6;
 };
 
-struct symtab_command {
+struct LLVM_CLASS_ABI symtab_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t symoff;
@@ -708,7 +708,7 @@ struct symtab_command {
   uint32_t strsize;
 };
 
-struct dysymtab_command {
+struct LLVM_CLASS_ABI dysymtab_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t ilocalsym;
@@ -731,12 +731,12 @@ struct dysymtab_command {
   uint32_t nlocrel;
 };
 
-struct dylib_table_of_contents {
+struct LLVM_CLASS_ABI dylib_table_of_contents {
   uint32_t symbol_index;
   uint32_t module_index;
 };
 
-struct dylib_module {
+struct LLVM_CLASS_ABI dylib_module {
   uint32_t module_name;
   uint32_t iextdefsym;
   uint32_t nextdefsym;
@@ -752,7 +752,7 @@ struct dylib_module {
   uint32_t objc_module_info_size;
 };
 
-struct dylib_module_64 {
+struct LLVM_CLASS_ABI dylib_module_64 {
   uint32_t module_name;
   uint32_t iextdefsym;
   uint32_t nextdefsym;
@@ -768,12 +768,12 @@ struct dylib_module_64 {
   uint64_t objc_module_info_addr;
 };
 
-struct dylib_reference {
+struct LLVM_CLASS_ABI dylib_reference {
   uint32_t isym : 24, flags : 8;
 };
 
 // The twolevel_hints_command is obsolete and no longer supported.
-struct twolevel_hints_command {
+struct LLVM_CLASS_ABI twolevel_hints_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t offset;
@@ -781,49 +781,49 @@ struct twolevel_hints_command {
 };
 
 // The twolevel_hints_command is obsolete and no longer supported.
-struct twolevel_hint {
+struct LLVM_CLASS_ABI twolevel_hint {
   uint32_t isub_image : 8, itoc : 24;
 };
 
 // The prebind_cksum_command is obsolete and no longer supported.
-struct prebind_cksum_command {
+struct LLVM_CLASS_ABI prebind_cksum_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t cksum;
 };
 
-struct uuid_command {
+struct LLVM_CLASS_ABI uuid_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint8_t uuid[16];
 };
 
-struct rpath_command {
+struct LLVM_CLASS_ABI rpath_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t path;
 };
 
-struct linkedit_data_command {
+struct LLVM_CLASS_ABI linkedit_data_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t dataoff;
   uint32_t datasize;
 };
 
-struct data_in_code_entry {
+struct LLVM_CLASS_ABI data_in_code_entry {
   uint32_t offset;
   uint16_t length;
   uint16_t kind;
 };
 
-struct source_version_command {
+struct LLVM_CLASS_ABI source_version_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint64_t version;
 };
 
-struct encryption_info_command {
+struct LLVM_CLASS_ABI encryption_info_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t cryptoff;
@@ -831,7 +831,7 @@ struct encryption_info_command {
   uint32_t cryptid;
 };
 
-struct encryption_info_command_64 {
+struct LLVM_CLASS_ABI encryption_info_command_64 {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t cryptoff;
@@ -840,7 +840,7 @@ struct encryption_info_command_64 {
   uint32_t pad;
 };
 
-struct version_min_command {
+struct LLVM_CLASS_ABI version_min_command {
   uint32_t cmd;     // LC_VERSION_MIN_MACOSX or
                     // LC_VERSION_MIN_IPHONEOS
   uint32_t cmdsize; // sizeof(struct version_min_command)
@@ -848,7 +848,7 @@ struct version_min_command {
   uint32_t sdk;     // X.Y.Z is encoded in nibbles xxxx.yy.zz
 };
 
-struct note_command {
+struct LLVM_CLASS_ABI note_command {
   uint32_t cmd;        // LC_NOTE
   uint32_t cmdsize;    // sizeof(struct note_command)
   char data_owner[16]; // owner name for this LC_NOTE
@@ -856,12 +856,12 @@ struct note_command {
   uint64_t size;       // length of data region
 };
 
-struct build_tool_version {
+struct LLVM_CLASS_ABI build_tool_version {
   uint32_t tool;    // enum for the tool
   uint32_t version; // version of the tool
 };
 
-struct build_version_command {
+struct LLVM_CLASS_ABI build_version_command {
   uint32_t cmd;      // LC_BUILD_VERSION
   uint32_t cmdsize;  // sizeof(struct build_version_command) +
                      // ntools * sizeof(struct build_tool_version)
@@ -871,13 +871,13 @@ struct build_version_command {
   uint32_t ntools;   // number of tool entries following this
 };
 
-struct dyld_env_command {
+struct LLVM_CLASS_ABI dyld_env_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t name;
 };
 
-struct dyld_info_command {
+struct LLVM_CLASS_ABI dyld_info_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t rebase_off;
@@ -892,13 +892,13 @@ struct dyld_info_command {
   uint32_t export_size;
 };
 
-struct linker_option_command {
+struct LLVM_CLASS_ABI linker_option_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t count;
 };
 
-struct fileset_entry_command {
+struct LLVM_CLASS_ABI fileset_entry_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint64_t vmaddr;
@@ -907,7 +907,7 @@ struct fileset_entry_command {
 };
 
 // The symseg_command is obsolete and no longer supported.
-struct symseg_command {
+struct LLVM_CLASS_ABI symseg_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t offset;
@@ -915,38 +915,38 @@ struct symseg_command {
 };
 
 // The ident_command is obsolete and no longer supported.
-struct ident_command {
+struct LLVM_CLASS_ABI ident_command {
   uint32_t cmd;
   uint32_t cmdsize;
 };
 
 // The fvmfile_command is obsolete and no longer supported.
-struct fvmfile_command {
+struct LLVM_CLASS_ABI fvmfile_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint32_t name;
   uint32_t header_addr;
 };
 
-struct tlv_descriptor_32 {
+struct LLVM_CLASS_ABI tlv_descriptor_32 {
   uint32_t thunk;
   uint32_t key;
   uint32_t offset;
 };
 
-struct tlv_descriptor_64 {
+struct LLVM_CLASS_ABI tlv_descriptor_64 {
   uint64_t thunk;
   uint64_t key;
   uint64_t offset;
 };
 
-struct tlv_descriptor {
+struct LLVM_CLASS_ABI tlv_descriptor {
   uintptr_t thunk;
   uintptr_t key;
   uintptr_t offset;
 };
 
-struct entry_point_command {
+struct LLVM_CLASS_ABI entry_point_command {
   uint32_t cmd;
   uint32_t cmdsize;
   uint64_t entryoff;
@@ -954,12 +954,12 @@ struct entry_point_command {
 };
 
 // Structs from <mach-o/fat.h>
-struct fat_header {
+struct LLVM_CLASS_ABI fat_header {
   uint32_t magic;
   uint32_t nfat_arch;
 };
 
-struct fat_arch {
+struct LLVM_CLASS_ABI fat_arch {
   uint32_t cputype;
   uint32_t cpusubtype;
   uint32_t offset;
@@ -967,7 +967,7 @@ struct fat_arch {
   uint32_t align;
 };
 
-struct fat_arch_64 {
+struct LLVM_CLASS_ABI fat_arch_64 {
   uint32_t cputype;
   uint32_t cpusubtype;
   uint64_t offset;
@@ -977,13 +977,13 @@ struct fat_arch_64 {
 };
 
 // Structs from <mach-o/reloc.h>
-struct relocation_info {
+struct LLVM_CLASS_ABI relocation_info {
   int32_t r_address;
   uint32_t r_symbolnum : 24, r_pcrel : 1, r_length : 2, r_extern : 1,
       r_type : 4;
 };
 
-struct scattered_relocation_info {
+struct LLVM_CLASS_ABI scattered_relocation_info {
 #if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)
   uint32_t r_scattered : 1, r_pcrel : 1, r_length : 2, r_type : 4,
       r_address : 24;
@@ -995,19 +995,19 @@ struct scattered_relocation_info {
 };
 
 // Structs NOT from <mach-o/reloc.h>, but that make LLVM's life easier
-struct any_relocation_info {
+struct LLVM_CLASS_ABI any_relocation_info {
   uint32_t r_word0, r_word1;
 };
 
 // Structs from <mach-o/nlist.h>
-struct nlist_base {
+struct LLVM_CLASS_ABI nlist_base {
   uint32_t n_strx;
   uint8_t n_type;
   uint8_t n_sect;
   uint16_t n_desc;
 };
 
-struct nlist {
+struct LLVM_CLASS_ABI nlist {
   uint32_t n_strx;
   uint8_t n_type;
   uint8_t n_sect;
@@ -1015,7 +1015,7 @@ struct nlist {
   uint32_t n_value;
 };
 
-struct nlist_64 {
+struct LLVM_CLASS_ABI nlist_64 {
   uint32_t n_strx;
   uint8_t n_type;
   uint8_t n_sect;
@@ -1062,7 +1062,7 @@ enum {
 /// Structs for dyld chained fixups.
 /// dyld_chained_fixups_header is the data pointed to by LC_DYLD_CHAINED_FIXUPS
 /// load command.
-struct dyld_chained_fixups_header {
+struct LLVM_CLASS_ABI dyld_chained_fixups_header {
   uint32_t fixups_version; ///< 0
   uint32_t starts_offset;  ///< Offset of dyld_chained_starts_in_image.
   uint32_t imports_offset; ///< Offset of imports table in chain_data.
@@ -1075,12 +1075,12 @@ struct dyld_chained_fixups_header {
 /// dyld_chained_starts_in_image is embedded in LC_DYLD_CHAINED_FIXUPS payload.
 /// Each each seg_info_offset entry is the offset into this struct for that
 /// segment followed by pool of dyld_chain_starts_in_segment data.
-struct dyld_chained_starts_in_image {
+struct LLVM_CLASS_ABI dyld_chained_starts_in_image {
   uint32_t seg_count;
   uint32_t seg_info_offset[1];
 };
 
-struct dyld_chained_starts_in_segment {
+struct LLVM_CLASS_ABI dyld_chained_starts_in_segment {
   uint32_t size;              ///< Size of this, including chain_starts entries
   uint16_t page_size;         ///< Page size in bytes (0x1000 or 0x4000)
   uint16_t pointer_format;    ///< DYLD_CHAINED_PTR*
@@ -1092,14 +1092,14 @@ struct dyld_chained_starts_in_segment {
 };
 
 // DYLD_CHAINED_IMPORT
-struct dyld_chained_import {
+struct LLVM_CLASS_ABI dyld_chained_import {
   uint32_t lib_ordinal : 8;
   uint32_t weak_import : 1;
   uint32_t name_offset : 23;
 };
 
 // DYLD_CHAINED_IMPORT_ADDEND
-struct dyld_chained_import_addend {
+struct LLVM_CLASS_ABI dyld_chained_import_addend {
   uint32_t lib_ordinal : 8;
   uint32_t weak_import : 1;
   uint32_t name_offset : 23;
@@ -1107,7 +1107,7 @@ struct dyld_chained_import_addend {
 };
 
 // DYLD_CHAINED_IMPORT_ADDEND64
-struct dyld_chained_import_addend64 {
+struct LLVM_CLASS_ABI dyld_chained_import_addend64 {
   uint64_t lib_ordinal : 16;
   uint64_t weak_import : 1;
   uint64_t reserved : 15;
@@ -1119,7 +1119,7 @@ struct dyld_chained_import_addend64 {
 // whether it is dyld_chained_ptr_64_bind or dyld_chained_ptr_64_rebase.
 
 // DYLD_CHAINED_PTR_64/DYLD_CHAINED_PTR_64_OFFSET
-struct dyld_chained_ptr_64_bind {
+struct LLVM_CLASS_ABI dyld_chained_ptr_64_bind {
   uint64_t ordinal : 24;
   uint64_t addend : 8;
   uint64_t reserved : 19;
@@ -1128,7 +1128,7 @@ struct dyld_chained_ptr_64_bind {
 };
 
 // DYLD_CHAINED_PTR_64/DYLD_CHAINED_PTR_64_OFFSET
-struct dyld_chained_ptr_64_rebase {
+struct LLVM_CLASS_ABI dyld_chained_ptr_64_rebase {
   uint64_t target : 36;
   uint64_t high8 : 8;
   uint64_t reserved : 7;
@@ -1666,10 +1666,10 @@ enum CPUSubTypePowerPC {
   CPU_SUBTYPE_MC98601 = CPU_SUBTYPE_POWERPC_601
 };
 
-Expected<uint32_t> getCPUType(const Triple &T);
-Expected<uint32_t> getCPUSubType(const Triple &T);
+LLVM_FUNC_ABI Expected<uint32_t> getCPUType(const Triple &T);
+LLVM_FUNC_ABI Expected<uint32_t> getCPUSubType(const Triple &T);
 
-struct x86_thread_state32_t {
+struct LLVM_CLASS_ABI x86_thread_state32_t {
   uint32_t eax;
   uint32_t ebx;
   uint32_t ecx;
@@ -1688,7 +1688,7 @@ struct x86_thread_state32_t {
   uint32_t gs;
 };
 
-struct x86_thread_state64_t {
+struct LLVM_CLASS_ABI x86_thread_state64_t {
   uint64_t rax;
   uint64_t rbx;
   uint64_t rcx;
@@ -1725,27 +1725,27 @@ enum x86_fp_control_rc {
   x86_FP_CHOP = 3
 };
 
-struct fp_control_t {
+struct LLVM_CLASS_ABI fp_control_t {
   unsigned short invalid : 1, denorm : 1, zdiv : 1, ovrfl : 1, undfl : 1,
       precis : 1, : 2, pc : 2, rc : 2, : 1, : 3;
 };
 
-struct fp_status_t {
+struct LLVM_CLASS_ABI fp_status_t {
   unsigned short invalid : 1, denorm : 1, zdiv : 1, ovrfl : 1, undfl : 1,
       precis : 1, stkflt : 1, errsumm : 1, c0 : 1, c1 : 1, c2 : 1, tos : 3,
       c3 : 1, busy : 1;
 };
 
-struct mmst_reg_t {
+struct LLVM_CLASS_ABI mmst_reg_t {
   char mmst_reg[10];
   char mmst_rsrv[6];
 };
 
-struct xmm_reg_t {
+struct LLVM_CLASS_ABI xmm_reg_t {
   char xmm_reg[16];
 };
 
-struct x86_float_state64_t {
+struct LLVM_CLASS_ABI x86_float_state64_t {
   int32_t fpu_reserved[2];
   fp_control_t fpu_fcw;
   fp_status_t fpu_fsw;
@@ -1788,7 +1788,7 @@ struct x86_float_state64_t {
   uint32_t fpu_reserved1;
 };
 
-struct x86_exception_state64_t {
+struct LLVM_CLASS_ABI x86_exception_state64_t {
   uint16_t trapno;
   uint16_t cpu;
   uint32_t err;
@@ -1862,12 +1862,12 @@ inline void swapStruct(x86_exception_state64_t &x) {
   sys::swapByteOrder(x.faultvaddr);
 }
 
-struct x86_state_hdr_t {
+struct LLVM_CLASS_ABI x86_state_hdr_t {
   uint32_t flavor;
   uint32_t count;
 };
 
-struct x86_thread_state_t {
+struct LLVM_CLASS_ABI x86_thread_state_t {
   x86_state_hdr_t tsh;
   union {
     x86_thread_state64_t ts64;
@@ -1875,14 +1875,14 @@ struct x86_thread_state_t {
   } uts;
 };
 
-struct x86_float_state_t {
+struct LLVM_CLASS_ABI x86_float_state_t {
   x86_state_hdr_t fsh;
   union {
     x86_float_state64_t fs64;
   } ufs;
 };
 
-struct x86_exception_state_t {
+struct LLVM_CLASS_ABI x86_exception_state_t {
   x86_state_hdr_t esh;
   union {
     x86_exception_state64_t es64;
@@ -1944,7 +1944,7 @@ const uint32_t x86_FLOAT_STATE_COUNT =
 const uint32_t x86_EXCEPTION_STATE_COUNT =
     sizeof(x86_exception_state_t) / sizeof(uint32_t);
 
-struct arm_thread_state32_t {
+struct LLVM_CLASS_ABI arm_thread_state32_t {
   uint32_t r[13];
   uint32_t sp;
   uint32_t lr;
@@ -1961,7 +1961,7 @@ inline void swapStruct(arm_thread_state32_t &x) {
   sys::swapByteOrder(x.cpsr);
 }
 
-struct arm_thread_state64_t {
+struct LLVM_CLASS_ABI arm_thread_state64_t {
   uint64_t x[29];
   uint64_t fp;
   uint64_t lr;
@@ -1981,12 +1981,12 @@ inline void swapStruct(arm_thread_state64_t &x) {
   sys::swapByteOrder(x.cpsr);
 }
 
-struct arm_state_hdr_t {
+struct LLVM_CLASS_ABI arm_state_hdr_t {
   uint32_t flavor;
   uint32_t count;
 };
 
-struct arm_thread_state_t {
+struct LLVM_CLASS_ABI arm_thread_state_t {
   arm_state_hdr_t tsh;
   union {
     arm_thread_state32_t ts32;
@@ -2020,7 +2020,7 @@ const uint32_t ARM_THREAD_STATE_COUNT =
 const uint32_t ARM_THREAD_STATE64_COUNT =
     sizeof(arm_thread_state64_t) / sizeof(uint32_t);
 
-struct ppc_thread_state32_t {
+struct LLVM_CLASS_ABI ppc_thread_state32_t {
   uint32_t srr0;
   uint32_t srr1;
   uint32_t r0;
@@ -2106,12 +2106,12 @@ inline void swapStruct(ppc_thread_state32_t &x) {
   sys::swapByteOrder(x.vrsave);
 }
 
-struct ppc_state_hdr_t {
+struct LLVM_CLASS_ABI ppc_state_hdr_t {
   uint32_t flavor;
   uint32_t count;
 };
 
-struct ppc_thread_state_t {
+struct LLVM_CLASS_ABI ppc_thread_state_t {
   ppc_state_hdr_t tsh;
   union {
     ppc_thread_state32_t ts32;
@@ -2318,7 +2318,7 @@ enum CodeSignMagic {
   CS_SUPPL_SIGNER_TYPE_LOCAL = 8,
 };
 
-struct CS_CodeDirectory {
+struct LLVM_CLASS_ABI CS_CodeDirectory {
   uint32_t magic;         /* magic number (CSMAGIC_CODEDIRECTORY) */
   uint32_t length;        /* total length of CodeDirectory blob */
   uint32_t version;       /* compatibility version */
@@ -2352,12 +2352,12 @@ struct CS_CodeDirectory {
 
 static_assert(sizeof(CS_CodeDirectory) == 88);
 
-struct CS_BlobIndex {
+struct LLVM_CLASS_ABI CS_BlobIndex {
   uint32_t type;   /* type of entry */
   uint32_t offset; /* offset of entry */
 };
 
-struct CS_SuperBlob {
+struct LLVM_CLASS_ABI CS_SuperBlob {
   uint32_t magic;  /* magic number */
   uint32_t length; /* total length of SuperBlob */
   uint32_t count;  /* number of index entries following */
diff --git a/llvm/include/llvm/BinaryFormat/Magic.h b/llvm/include/llvm/BinaryFormat/Magic.h
index eaf70f32ac15045..a142923c1211c08 100644
--- a/llvm/include/llvm/BinaryFormat/Magic.h
+++ b/llvm/include/llvm/BinaryFormat/Magic.h
@@ -18,7 +18,7 @@ class Twine;
 
 /// file_magic - An "enum class" enumeration of file types based on magic (the
 /// first N bytes of the file).
-struct file_magic {
+struct LLVM_CLASS_ABI file_magic {
   enum Impl {
     unknown = 0,       ///< Unrecognized file
     bitcode,           ///< Bitcode file
@@ -69,7 +69,7 @@ struct file_magic {
 };
 
 /// Identify the type of a binary file based on how magical it is.
-file_magic identify_magic(StringRef magic);
+LLVM_FUNC_ABI file_magic identify_magic(StringRef magic);
 
 /// Get and identify \a path's type based on its content.
 ///
@@ -77,7 +77,7 @@ file_magic identify_magic(StringRef magic);
 /// @param result Set to the type of file, or file_magic::unknown.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform-specific error_code.
-std::error_code identify_magic(const Twine &path, file_magic &result);
+LLVM_FUNC_ABI std::error_code identify_magic(const Twine &path, file_magic &result);
 } // namespace llvm
 
 #endif
diff --git a/llvm/include/llvm/BinaryFormat/Minidump.h b/llvm/include/llvm/BinaryFormat/Minidump.h
index c1bfe9d5b5b89e6..75c16b6186c585d 100644
--- a/llvm/include/llvm/BinaryFormat/Minidump.h
+++ b/llvm/include/llvm/BinaryFormat/Minidump.h
@@ -30,7 +30,7 @@ LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();
 
 /// The minidump header is the first part of a minidump file. It identifies the
 /// file as a minidump file, and gives the location of the stream directory.
-struct Header {
+struct LLVM_CLASS_ABI Header {
   static constexpr uint32_t MagicSignature = 0x504d444d; // PMDM
   static constexpr uint16_t MagicVersion = 0xa793;
 
@@ -57,7 +57,7 @@ enum class StreamType : uint32_t {
 
 /// Specifies the location (and size) of various objects in the minidump file.
 /// The location is relative to the start of the file.
-struct LocationDescriptor {
+struct LLVM_CLASS_ABI LocationDescriptor {
   support::ulittle32_t DataSize;
   support::ulittle32_t RVA;
 };
@@ -65,13 +65,13 @@ static_assert(sizeof(LocationDescriptor) == 8);
 
 /// Describes a single memory range (both its VM address and where to find it in
 /// the file) of the process from which this minidump file was generated.
-struct MemoryDescriptor {
+struct LLVM_CLASS_ABI MemoryDescriptor {
   support::ulittle64_t StartOfMemoryRange;
   LocationDescriptor Memory;
 };
 static_assert(sizeof(MemoryDescriptor) == 16);
 
-struct MemoryInfoListHeader {
+struct LLVM_CLASS_ABI MemoryInfoListHeader {
   support::ulittle32_t SizeOfHeader;
   support::ulittle32_t SizeOfEntry;
   support::ulittle64_t NumberOfEntries;
@@ -102,7 +102,7 @@ enum class MemoryType : uint32_t {
   LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/0xffffffffu),
 };
 
-struct MemoryInfo {
+struct LLVM_CLASS_ABI MemoryInfo {
   support::ulittle64_t BaseAddress;
   support::ulittle64_t AllocationBase;
   support::little_t<MemoryProtection> AllocationProtect;
@@ -118,7 +118,7 @@ static_assert(sizeof(MemoryInfo) == 48);
 /// Specifies the location and type of a single stream in the minidump file. The
 /// minidump stream directory is an array of entries of this type, with its size
 /// given by Header.NumberOfStreams.
-struct Directory {
+struct LLVM_CLASS_ABI Directory {
   support::little_t<StreamType> Type;
   LocationDescriptor Location;
 };
@@ -159,7 +159,7 @@ static_assert(sizeof(CPUInfo) == 24);
 
 /// The SystemInfo stream, containing various information about the system where
 /// this minidump was generated.
-struct SystemInfo {
+struct LLVM_CLASS_ABI SystemInfo {
   support::little_t<ProcessorArchitecture> ProcessorArch;
   support::ulittle16_t ProcessorLevel;
   support::ulittle16_t ProcessorRevision;
@@ -180,7 +180,7 @@ struct SystemInfo {
 };
 static_assert(sizeof(SystemInfo) == 56);
 
-struct VSFixedFileInfo {
+struct LLVM_CLASS_ABI VSFixedFileInfo {
   support::ulittle32_t Signature;
   support::ulittle32_t StructVersion;
   support::ulittle32_t FileVersionHigh;
@@ -201,7 +201,7 @@ inline bool operator==(const VSFixedFileInfo &LHS, const VSFixedFileInfo &RHS) {
   return memcmp(&LHS, &RHS, sizeof(VSFixedFileInfo)) == 0;
 }
 
-struct Module {
+struct LLVM_CLASS_ABI Module {
   support::ulittle64_t BaseOfImage;
   support::ulittle32_t SizeOfImage;
   support::ulittle32_t Checksum;
@@ -217,7 +217,7 @@ static_assert(sizeof(Module) == 108);
 
 /// Describes a single thread in the minidump file. Part of the ThreadList
 /// stream.
-struct Thread {
+struct LLVM_CLASS_ABI Thread {
   support::ulittle32_t ThreadId;
   support::ulittle32_t SuspendCount;
   support::ulittle32_t PriorityClass;
@@ -228,7 +228,7 @@ struct Thread {
 };
 static_assert(sizeof(Thread) == 48);
 
-struct Exception {
+struct LLVM_CLASS_ABI Exception {
   static constexpr size_t MaxParameters = 15;
 
   support::ulittle32_t ExceptionCode;
@@ -241,7 +241,7 @@ struct Exception {
 };
 static_assert(sizeof(Exception) == 152);
 
-struct ExceptionStream {
+struct LLVM_CLASS_ABI ExceptionStream {
   support::ulittle32_t ThreadId;
   support::ulittle32_t UnusedAlignment;
   Exception ExceptionRecord;
@@ -251,7 +251,7 @@ static_assert(sizeof(ExceptionStream) == 168);
 
 } // namespace minidump
 
-template <> struct DenseMapInfo<minidump::StreamType> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<minidump::StreamType> {
   static minidump::StreamType getEmptyKey() { return minidump::StreamType(-1); }
 
   static minidump::StreamType getTombstoneKey() {
diff --git a/llvm/include/llvm/BinaryFormat/MsgPackDocument.h b/llvm/include/llvm/BinaryFormat/MsgPackDocument.h
index 15c2e7e2e57000c..a12618902b13197 100644
--- a/llvm/include/llvm/BinaryFormat/MsgPackDocument.h
+++ b/llvm/include/llvm/BinaryFormat/MsgPackDocument.h
@@ -29,14 +29,14 @@ class Document;
 class MapDocNode;
 
 /// The kind of a DocNode and its owning Document.
-struct KindAndDocument {
+struct LLVM_CLASS_ABI KindAndDocument {
   Document *Doc;
   Type Kind;
 };
 
 /// A node in a MsgPack Document. This is a simple copyable and
 /// passable-by-value type that does not own any memory.
-class DocNode {
+class LLVM_CLASS_ABI DocNode {
   friend Document;
 
 public:
@@ -223,7 +223,7 @@ class DocNode {
 };
 
 /// A DocNode that is a map.
-class MapDocNode : public DocNode {
+class LLVM_CLASS_ABI MapDocNode : public DocNode {
 public:
   MapDocNode() = default;
   MapDocNode(DocNode &N) : DocNode(N) { assert(getKind() == Type::Map); }
@@ -253,7 +253,7 @@ class MapDocNode : public DocNode {
 };
 
 /// A DocNode that is an array.
-class ArrayDocNode : public DocNode {
+class LLVM_CLASS_ABI ArrayDocNode : public DocNode {
 public:
   ArrayDocNode() = default;
   ArrayDocNode(DocNode &N) : DocNode(N) { assert(getKind() == Type::Array); }
@@ -276,7 +276,7 @@ class ArrayDocNode : public DocNode {
 /// Simple in-memory representation of a document of msgpack objects with
 /// ability to find and create array and map elements.  Does not currently cope
 /// with any extension types.
-class Document {
+class LLVM_CLASS_ABI Document {
   // Maps, arrays and strings used by nodes in the document. No attempt is made
   // to free unused ones.
   std::vector<std::unique_ptr<DocNode::MapTy>> Maps;
diff --git a/llvm/include/llvm/BinaryFormat/MsgPackReader.h b/llvm/include/llvm/BinaryFormat/MsgPackReader.h
index ccb4da9d4ed20e5..19755fdf8a9ab18 100644
--- a/llvm/include/llvm/BinaryFormat/MsgPackReader.h
+++ b/llvm/include/llvm/BinaryFormat/MsgPackReader.h
@@ -62,7 +62,7 @@ enum class Type : uint8_t {
 
 /// Extension types are composed of a user-defined type ID and an uninterpreted
 /// sequence of bytes.
-struct ExtensionType {
+struct LLVM_CLASS_ABI ExtensionType {
   /// User-defined extension type.
   int8_t Type;
   /// Raw bytes of the extension object.
@@ -74,7 +74,7 @@ struct ExtensionType {
 /// All types except \c Type::Nil (which has only one value, and so is
 /// completely represented by the \c Kind itself) map to a exactly one union
 /// member.
-struct Object {
+struct LLVM_CLASS_ABI Object {
   Type Kind;
   union {
     /// Value for \c Type::Int.
@@ -97,7 +97,7 @@ struct Object {
 };
 
 /// Reads MessagePack objects from memory, one at a time.
-class Reader {
+class LLVM_CLASS_ABI Reader {
 public:
   /// Construct a reader, keeping a reference to the \p InputBuffer.
   Reader(MemoryBufferRef InputBuffer);
diff --git a/llvm/include/llvm/BinaryFormat/MsgPackWriter.h b/llvm/include/llvm/BinaryFormat/MsgPackWriter.h
index 70b4e2ddf298d65..7770252ace8034a 100644
--- a/llvm/include/llvm/BinaryFormat/MsgPackWriter.h
+++ b/llvm/include/llvm/BinaryFormat/MsgPackWriter.h
@@ -39,7 +39,7 @@ class raw_ostream;
 namespace msgpack {
 
 /// Writes MessagePack objects to an output stream, one at a time.
-class Writer {
+class LLVM_CLASS_ABI Writer {
 public:
   /// Construct a writer, optionally enabling "Compatibility Mode" as defined
   /// in the MessagePack specification.
diff --git a/llvm/include/llvm/BinaryFormat/Wasm.h b/llvm/include/llvm/BinaryFormat/Wasm.h
index 6e06a66897bb3e4..da1946bca77e25c 100644
--- a/llvm/include/llvm/BinaryFormat/Wasm.h
+++ b/llvm/include/llvm/BinaryFormat/Wasm.h
@@ -32,23 +32,23 @@ const uint32_t WasmMetadataVersion = 0x2;
 // Wasm uses a 64k page size
 const uint32_t WasmPageSize = 65536;
 
-struct WasmObjectHeader {
+struct LLVM_CLASS_ABI WasmObjectHeader {
   StringRef Magic;
   uint32_t Version;
 };
 
-struct WasmDylinkImportInfo {
+struct LLVM_CLASS_ABI WasmDylinkImportInfo {
   StringRef Module;
   StringRef Field;
   uint32_t Flags;
 };
 
-struct WasmDylinkExportInfo {
+struct LLVM_CLASS_ABI WasmDylinkExportInfo {
   StringRef Name;
   uint32_t Flags;
 };
 
-struct WasmDylinkInfo {
+struct LLVM_CLASS_ABI WasmDylinkInfo {
   uint32_t MemorySize; // Memory size in bytes
   uint32_t MemoryAlignment;  // P2 alignment of memory
   uint32_t TableSize;  // Table size in elements
@@ -58,41 +58,41 @@ struct WasmDylinkInfo {
   std::vector<WasmDylinkExportInfo> ExportInfo;
 };
 
-struct WasmProducerInfo {
+struct LLVM_CLASS_ABI WasmProducerInfo {
   std::vector<std::pair<std::string, std::string>> Languages;
   std::vector<std::pair<std::string, std::string>> Tools;
   std::vector<std::pair<std::string, std::string>> SDKs;
 };
 
-struct WasmFeatureEntry {
+struct LLVM_CLASS_ABI WasmFeatureEntry {
   uint8_t Prefix;
   std::string Name;
 };
 
-struct WasmExport {
+struct LLVM_CLASS_ABI WasmExport {
   StringRef Name;
   uint8_t Kind;
   uint32_t Index;
 };
 
-struct WasmLimits {
+struct LLVM_CLASS_ABI WasmLimits {
   uint8_t Flags;
   uint64_t Minimum;
   uint64_t Maximum;
 };
 
-struct WasmTableType {
+struct LLVM_CLASS_ABI WasmTableType {
   uint8_t ElemType;
   WasmLimits Limits;
 };
 
-struct WasmTable {
+struct LLVM_CLASS_ABI WasmTable {
   uint32_t Index;
   WasmTableType Type;
   StringRef SymbolName; // from the "linking" section
 };
 
-struct WasmInitExprMVP {
+struct LLVM_CLASS_ABI WasmInitExprMVP {
   uint8_t Opcode;
   union {
     int32_t Int32;
@@ -103,32 +103,32 @@ struct WasmInitExprMVP {
   } Value;
 };
 
-struct WasmInitExpr {
+struct LLVM_CLASS_ABI WasmInitExpr {
   uint8_t Extended; // Set to non-zero if extended const is used (i.e. more than
                     // one instruction)
   WasmInitExprMVP Inst;
   ArrayRef<uint8_t> Body;
 };
 
-struct WasmGlobalType {
+struct LLVM_CLASS_ABI WasmGlobalType {
   uint8_t Type;
   bool Mutable;
 };
 
-struct WasmGlobal {
+struct LLVM_CLASS_ABI WasmGlobal {
   uint32_t Index;
   WasmGlobalType Type;
   WasmInitExpr InitExpr;
   StringRef SymbolName; // from the "linking" section
 };
 
-struct WasmTag {
+struct LLVM_CLASS_ABI WasmTag {
   uint32_t Index;
   uint32_t SigIndex;
   StringRef SymbolName; // from the "linking" section
 };
 
-struct WasmImport {
+struct LLVM_CLASS_ABI WasmImport {
   StringRef Module;
   StringRef Field;
   uint8_t Kind;
@@ -140,12 +140,12 @@ struct WasmImport {
   };
 };
 
-struct WasmLocalDecl {
+struct LLVM_CLASS_ABI WasmLocalDecl {
   uint8_t Type;
   uint32_t Count;
 };
 
-struct WasmFunction {
+struct LLVM_CLASS_ABI WasmFunction {
   uint32_t Index;
   uint32_t SigIndex;
   std::vector<WasmLocalDecl> Locals;
@@ -159,7 +159,7 @@ struct WasmFunction {
   uint32_t Comdat;      // from the "comdat info" section
 };
 
-struct WasmDataSegment {
+struct LLVM_CLASS_ABI WasmDataSegment {
   uint32_t InitFlags;
   // Present if InitFlags & WASM_DATA_SEGMENT_HAS_MEMINDEX.
   uint32_t MemoryIndex;
@@ -173,7 +173,7 @@ struct WasmDataSegment {
   uint32_t Comdat; // from the "comdat info" section
 };
 
-struct WasmElemSegment {
+struct LLVM_CLASS_ABI WasmElemSegment {
   uint32_t Flags;
   uint32_t TableNumber;
   uint8_t ElemKind;
@@ -183,25 +183,25 @@ struct WasmElemSegment {
 
 // Represents the location of a Wasm data symbol within a WasmDataSegment, as
 // the index of the segment, and the offset and size within the segment.
-struct WasmDataReference {
+struct LLVM_CLASS_ABI WasmDataReference {
   uint32_t Segment;
   uint64_t Offset;
   uint64_t Size;
 };
 
-struct WasmRelocation {
+struct LLVM_CLASS_ABI WasmRelocation {
   uint8_t Type;    // The type of the relocation.
   uint32_t Index;  // Index into either symbol or type index space.
   uint64_t Offset; // Offset from the start of the section.
   int64_t Addend;  // A value to add to the symbol.
 };
 
-struct WasmInitFunc {
+struct LLVM_CLASS_ABI WasmInitFunc {
   uint32_t Priority;
   uint32_t Symbol;
 };
 
-struct WasmSymbolInfo {
+struct LLVM_CLASS_ABI WasmSymbolInfo {
   StringRef Name;
   uint8_t Kind;
   uint32_t Flags;
@@ -226,13 +226,13 @@ enum class NameType {
   DATA_SEGMENT,
 };
 
-struct WasmDebugName {
+struct LLVM_CLASS_ABI WasmDebugName {
   NameType Type;
   uint32_t Index;
   StringRef Name;
 };
 
-struct WasmLinkingData {
+struct LLVM_CLASS_ABI WasmLinkingData {
   uint32_t Version;
   std::vector<WasmInitFunc> InitFunctions;
   std::vector<StringRef> Comdats;
@@ -432,7 +432,7 @@ enum class ValType {
   EXTERNREF = WASM_TYPE_EXTERNREF,
 };
 
-struct WasmSignature {
+struct LLVM_CLASS_ABI WasmSignature {
   SmallVector<ValType, 1> Returns;
   SmallVector<ValType, 4> Params;
   // Support empty and tombstone instances, needed by DenseMap.
@@ -472,10 +472,10 @@ inline bool operator==(const WasmTableType &LHS, const WasmTableType &RHS) {
   return LHS.ElemType == RHS.ElemType && LHS.Limits == RHS.Limits;
 }
 
-llvm::StringRef toString(WasmSymbolType type);
-llvm::StringRef relocTypetoString(uint32_t type);
-llvm::StringRef sectionTypeToString(uint32_t type);
-bool relocTypeHasAddend(uint32_t type);
+LLVM_FUNC_ABI llvm::StringRef toString(WasmSymbolType type);
+LLVM_FUNC_ABI llvm::StringRef relocTypetoString(uint32_t type);
+LLVM_FUNC_ABI llvm::StringRef sectionTypeToString(uint32_t type);
+LLVM_FUNC_ABI bool relocTypeHasAddend(uint32_t type);
 
 } // end namespace wasm
 } // end namespace llvm
diff --git a/llvm/include/llvm/BinaryFormat/WasmTraits.h b/llvm/include/llvm/BinaryFormat/WasmTraits.h
index e39488c213ea905..ecb3a0b1196e1a4 100644
--- a/llvm/include/llvm/BinaryFormat/WasmTraits.h
+++ b/llvm/include/llvm/BinaryFormat/WasmTraits.h
@@ -20,7 +20,7 @@
 namespace llvm {
 
 // Traits for using WasmSignature in a DenseMap.
-template <> struct DenseMapInfo<wasm::WasmSignature, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<wasm::WasmSignature, void> {
   static wasm::WasmSignature getEmptyKey() {
     wasm::WasmSignature Sig;
     Sig.State = wasm::WasmSignature::Empty;
@@ -46,7 +46,7 @@ template <> struct DenseMapInfo<wasm::WasmSignature, void> {
 };
 
 // Traits for using WasmGlobalType in a DenseMap
-template <> struct DenseMapInfo<wasm::WasmGlobalType, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<wasm::WasmGlobalType, void> {
   static wasm::WasmGlobalType getEmptyKey() {
     return wasm::WasmGlobalType{1, true};
   }
@@ -63,7 +63,7 @@ template <> struct DenseMapInfo<wasm::WasmGlobalType, void> {
 };
 
 // Traits for using WasmLimits in a DenseMap
-template <> struct DenseMapInfo<wasm::WasmLimits, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<wasm::WasmLimits, void> {
   static wasm::WasmLimits getEmptyKey() {
     return wasm::WasmLimits{0xff, 0xff, 0xff};
   }
@@ -85,7 +85,7 @@ template <> struct DenseMapInfo<wasm::WasmLimits, void> {
 };
 
 // Traits for using WasmTableType in a DenseMap
-template <> struct DenseMapInfo<wasm::WasmTableType, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<wasm::WasmTableType, void> {
   static wasm::WasmTableType getEmptyKey() {
     return wasm::WasmTableType{
         0, DenseMapInfo<wasm::WasmLimits, void>::getEmptyKey()};
diff --git a/llvm/include/llvm/BinaryFormat/XCOFF.h b/llvm/include/llvm/BinaryFormat/XCOFF.h
index 966890eca0b3892..0fac415ac17f9cc 100644
--- a/llvm/include/llvm/BinaryFormat/XCOFF.h
+++ b/llvm/include/llvm/BinaryFormat/XCOFF.h
@@ -347,18 +347,18 @@ enum SymbolAuxType : uint8_t {
   AUX_SECT = 250    ///< Identifies a SECT auxiliary entry.
 };                  // 64-bit XCOFF file only.
 
-StringRef getMappingClassString(XCOFF::StorageMappingClass SMC);
-StringRef getRelocationTypeString(XCOFF::RelocationType Type);
-Expected<SmallString<32>> parseParmsType(uint32_t Value, unsigned FixedParmsNum,
+LLVM_FUNC_ABI StringRef getMappingClassString(XCOFF::StorageMappingClass SMC);
+LLVM_FUNC_ABI StringRef getRelocationTypeString(XCOFF::RelocationType Type);
+LLVM_FUNC_ABI Expected<SmallString<32>> parseParmsType(uint32_t Value, unsigned FixedParmsNum,
                                          unsigned FloatingParmsNum);
-Expected<SmallString<32>> parseParmsTypeWithVecInfo(uint32_t Value,
+LLVM_FUNC_ABI Expected<SmallString<32>> parseParmsTypeWithVecInfo(uint32_t Value,
                                                     unsigned FixedParmsNum,
                                                     unsigned FloatingParmsNum,
                                                     unsigned VectorParmsNum);
-Expected<SmallString<32>> parseVectorParmsType(uint32_t Value,
+LLVM_FUNC_ABI Expected<SmallString<32>> parseVectorParmsType(uint32_t Value,
                                                unsigned ParmsNum);
 
-struct TracebackTable {
+struct LLVM_CLASS_ABI TracebackTable {
   enum LanguageID : uint8_t {
     C,
     Fortran,
@@ -465,10 +465,10 @@ enum ExtendedTBTableFlag : uint8_t {
   TB_LONGTBTABLE2 = 0x01 ///< Additional tbtable extension exists.
 };
 
-StringRef getNameForTracebackTableLanguageId(TracebackTable::LanguageID LangId);
-SmallString<32> getExtendedTBTableFlagString(uint8_t Flag);
+LLVM_FUNC_ABI StringRef getNameForTracebackTableLanguageId(TracebackTable::LanguageID LangId);
+LLVM_FUNC_ABI SmallString<32> getExtendedTBTableFlagString(uint8_t Flag);
 
-struct CsectProperties {
+struct LLVM_CLASS_ABI CsectProperties {
   CsectProperties(StorageMappingClass SMC, SymbolType ST)
       : MappingClass(SMC), Type(ST) {}
   StorageMappingClass MappingClass;
diff --git a/llvm/include/llvm/Bitcode/BitcodeAnalyzer.h b/llvm/include/llvm/Bitcode/BitcodeAnalyzer.h
index a4a8c4d27ac19ff..7d839c96cc96210 100644
--- a/llvm/include/llvm/Bitcode/BitcodeAnalyzer.h
+++ b/llvm/include/llvm/Bitcode/BitcodeAnalyzer.h
@@ -35,7 +35,7 @@ enum CurStreamTypeType {
   LLVMBitstreamRemarks
 };
 
-struct BCDumpOptions {
+struct LLVM_CLASS_ABI BCDumpOptions {
   /// The stream.
   raw_ostream &OS;
   /// Print per-code histogram.
@@ -50,7 +50,7 @@ struct BCDumpOptions {
   BCDumpOptions(raw_ostream &OS) : OS(OS) {}
 };
 
-class BitcodeAnalyzer {
+class LLVM_CLASS_ABI BitcodeAnalyzer {
   BitstreamCursor Stream;
   BitstreamBlockInfo BlockInfo;
   CurStreamTypeType CurStreamType;
diff --git a/llvm/include/llvm/Bitcode/BitcodeCommon.h b/llvm/include/llvm/Bitcode/BitcodeCommon.h
index 59c70818df3302f..f5a114d56a7abb1 100644
--- a/llvm/include/llvm/Bitcode/BitcodeCommon.h
+++ b/llvm/include/llvm/Bitcode/BitcodeCommon.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-struct AllocaPackedValues {
+struct LLVM_CLASS_ABI AllocaPackedValues {
   // We increased the number of bits needed to represent alignment to be more
   // than 5, but to preserve backward compatibility we store the upper bits
   // separately.
diff --git a/llvm/include/llvm/Bitcode/BitcodeReader.h b/llvm/include/llvm/Bitcode/BitcodeReader.h
index 4b6d94d48a1c173..9c26ade11158963 100644
--- a/llvm/include/llvm/Bitcode/BitcodeReader.h
+++ b/llvm/include/llvm/Bitcode/BitcodeReader.h
@@ -61,7 +61,7 @@ typedef std::function<void(Metadata **, unsigned, GetTypeByIDTy,
 // ErrorOr/std::error_code for compatibility with legacy clients. FIXME:
 // Remove these functions once no longer needed by the C and libLTO APIs.
 
-std::error_code errorToErrorCodeAndEmitErrors(LLVMContext &Ctx, Error Err);
+LLVM_FUNC_ABI std::error_code errorToErrorCodeAndEmitErrors(LLVMContext &Ctx, Error Err);
 
 template <typename T>
 ErrorOr<T> expectedToErrorOrAndEmitErrors(LLVMContext &Ctx, Expected<T> Val) {
@@ -70,7 +70,7 @@ ErrorOr<T> expectedToErrorOrAndEmitErrors(LLVMContext &Ctx, Expected<T> Val) {
   return std::move(*Val);
 }
 
-struct ParserCallbacks {
+struct LLVM_CLASS_ABI ParserCallbacks {
   std::optional<DataLayoutCallbackFuncTy> DataLayout;
   /// The ValueType callback is called for every function definition or
   /// declaration and allows accessing the type information, also behind
@@ -91,7 +91,7 @@ struct ParserCallbacks {
   struct BitcodeFileContents;
 
   /// Basic information extracted from a bitcode module to be used for LTO.
-  struct BitcodeLTOInfo {
+  struct LLVM_CLASS_ABI BitcodeLTOInfo {
     bool IsThinLTO;
     bool HasSummary;
     bool EnableSplitLTOUnit;
@@ -99,7 +99,7 @@ struct ParserCallbacks {
   };
 
   /// Represents a module in a bitcode file.
-  class BitcodeModule {
+  class LLVM_CLASS_ABI BitcodeModule {
     // This covers the identification (if present) and module blocks.
     ArrayRef<uint8_t> Buffer;
     StringRef ModuleIdentifier;
@@ -119,7 +119,7 @@ struct ParserCallbacks {
           IdentificationBit(IdentificationBit), ModuleBit(ModuleBit) {}
 
     // Calls the ctor.
-    friend Expected<BitcodeFileContents>
+    friend LLVM_FUNC_ABI Expected<BitcodeFileContents>
     getBitcodeFileContents(MemoryBufferRef Buffer);
 
     Expected<std::unique_ptr<Module>>
@@ -163,7 +163,7 @@ struct ParserCallbacks {
                 std::function<bool(GlobalValue::GUID)> IsPrevailing = nullptr);
   };
 
-  struct BitcodeFileContents {
+  struct LLVM_CLASS_ABI BitcodeFileContents {
     std::vector<BitcodeModule> Mods;
     StringRef Symtab, StrtabForSymtab;
   };
@@ -173,17 +173,17 @@ struct ParserCallbacks {
   /// symbol table should prefer to use irsymtab::read instead of this function
   /// because it creates a reader for the irsymtab and handles upgrading bitcode
   /// files without a symbol table or with an old symbol table.
-  Expected<BitcodeFileContents> getBitcodeFileContents(MemoryBufferRef Buffer);
+  LLVM_FUNC_ABI Expected<BitcodeFileContents> getBitcodeFileContents(MemoryBufferRef Buffer);
 
   /// Returns a list of modules in the specified bitcode buffer.
-  Expected<std::vector<BitcodeModule>>
+  LLVM_FUNC_ABI Expected<std::vector<BitcodeModule>>
   getBitcodeModuleList(MemoryBufferRef Buffer);
 
   /// Read the header of the specified bitcode buffer and prepare for lazy
   /// deserialization of function bodies. If ShouldLazyLoadMetadata is true,
   /// lazily load metadata as well. If IsImporting is true, this module is
   /// being parsed for ThinLTO importing into another module.
-  Expected<std::unique_ptr<Module>>
+  LLVM_FUNC_ABI Expected<std::unique_ptr<Module>>
   getLazyBitcodeModule(MemoryBufferRef Buffer, LLVMContext &Context,
                        bool ShouldLazyLoadMetadata = false,
                        bool IsImporting = false,
@@ -193,7 +193,7 @@ struct ParserCallbacks {
   /// the memory buffer if successful. If successful, this moves Buffer. On
   /// error, this *does not* move Buffer. If IsImporting is true, this module is
   /// being parsed for ThinLTO importing into another module.
-  Expected<std::unique_ptr<Module>> getOwningLazyBitcodeModule(
+  LLVM_FUNC_ABI Expected<std::unique_ptr<Module>> getOwningLazyBitcodeModule(
       std::unique_ptr<MemoryBuffer> &&Buffer, LLVMContext &Context,
       bool ShouldLazyLoadMetadata = false, bool IsImporting = false,
       ParserCallbacks Callbacks = {});
@@ -201,31 +201,31 @@ struct ParserCallbacks {
   /// Read the header of the specified bitcode buffer and extract just the
   /// triple information. If successful, this returns a string. On error, this
   /// returns "".
-  Expected<std::string> getBitcodeTargetTriple(MemoryBufferRef Buffer);
+  LLVM_FUNC_ABI Expected<std::string> getBitcodeTargetTriple(MemoryBufferRef Buffer);
 
   /// Return true if \p Buffer contains a bitcode file with ObjC code (category
   /// or class) in it.
-  Expected<bool> isBitcodeContainingObjCCategory(MemoryBufferRef Buffer);
+  LLVM_FUNC_ABI Expected<bool> isBitcodeContainingObjCCategory(MemoryBufferRef Buffer);
 
   /// Read the header of the specified bitcode buffer and extract just the
   /// producer string information. If successful, this returns a string. On
   /// error, this returns "".
-  Expected<std::string> getBitcodeProducerString(MemoryBufferRef Buffer);
+  LLVM_FUNC_ABI Expected<std::string> getBitcodeProducerString(MemoryBufferRef Buffer);
 
   /// Read the specified bitcode file, returning the module.
-  Expected<std::unique_ptr<Module>>
+  LLVM_FUNC_ABI Expected<std::unique_ptr<Module>>
   parseBitcodeFile(MemoryBufferRef Buffer, LLVMContext &Context,
                    ParserCallbacks Callbacks = {});
 
   /// Returns LTO information for the specified bitcode file.
-  Expected<BitcodeLTOInfo> getBitcodeLTOInfo(MemoryBufferRef Buffer);
+  LLVM_FUNC_ABI Expected<BitcodeLTOInfo> getBitcodeLTOInfo(MemoryBufferRef Buffer);
 
   /// Parse the specified bitcode buffer, returning the module summary index.
-  Expected<std::unique_ptr<ModuleSummaryIndex>>
+  LLVM_FUNC_ABI Expected<std::unique_ptr<ModuleSummaryIndex>>
   getModuleSummaryIndex(MemoryBufferRef Buffer);
 
   /// Parse the specified bitcode buffer and merge the index into CombinedIndex.
-  Error readModuleSummaryIndex(MemoryBufferRef Buffer,
+  LLVM_FUNC_ABI Error readModuleSummaryIndex(MemoryBufferRef Buffer,
                                ModuleSummaryIndex &CombinedIndex,
                                uint64_t ModuleId);
 
@@ -233,7 +233,7 @@ struct ParserCallbacks {
   /// summary index object if found, or an empty summary if not. If Path refers
   /// to an empty file and IgnoreEmptyThinLTOIndexFile is true, then
   /// this function will return nullptr.
-  Expected<std::unique_ptr<ModuleSummaryIndex>>
+  LLVM_FUNC_ABI Expected<std::unique_ptr<ModuleSummaryIndex>>
   getModuleSummaryIndexForFile(StringRef Path,
                                bool IgnoreEmptyThinLTOIndexFile = false);
 
@@ -306,9 +306,9 @@ struct ParserCallbacks {
     return false;
   }
 
-  APInt readWideAPInt(ArrayRef<uint64_t> Vals, unsigned TypeBits);
+  LLVM_FUNC_ABI APInt readWideAPInt(ArrayRef<uint64_t> Vals, unsigned TypeBits);
 
-  const std::error_category &BitcodeErrorCategory();
+  LLVM_FUNC_ABI const std::error_category &BitcodeErrorCategory();
   enum class BitcodeError { CorruptedBitcode = 1 };
   inline std::error_code make_error_code(BitcodeError E) {
     return std::error_code(static_cast<int>(E), BitcodeErrorCategory());
@@ -318,7 +318,7 @@ struct ParserCallbacks {
 
 namespace std {
 
-template <> struct is_error_code_enum<llvm::BitcodeError> : std::true_type {};
+template <> struct LLVM_CLASS_ABI is_error_code_enum<llvm::BitcodeError> : std::true_type {};
 
 } // end namespace std
 
diff --git a/llvm/include/llvm/Bitcode/BitcodeWriter.h b/llvm/include/llvm/Bitcode/BitcodeWriter.h
index 0420621256b6cf3..da3f7e53c6e6dd2 100644
--- a/llvm/include/llvm/Bitcode/BitcodeWriter.h
+++ b/llvm/include/llvm/Bitcode/BitcodeWriter.h
@@ -30,7 +30,7 @@ class BitstreamWriter;
 class Module;
 class raw_ostream;
 
-  class BitcodeWriter {
+  class LLVM_CLASS_ABI BitcodeWriter {
     SmallVectorImpl<char> &Buffer;
     std::unique_ptr<BitstreamWriter> Stream;
 
@@ -127,7 +127,7 @@ class raw_ostream;
   /// Can be used to produce the same module hash for a minimized bitcode
   /// used just for the thin link as in the regular full bitcode that will
   /// be used in the backend.
-  void WriteBitcodeToFile(const Module &M, raw_ostream &Out,
+  LLVM_FUNC_ABI void WriteBitcodeToFile(const Module &M, raw_ostream &Out,
                           bool ShouldPreserveUseListOrder = false,
                           const ModuleSummaryIndex *Index = nullptr,
                           bool GenerateHash = false,
@@ -140,7 +140,7 @@ class raw_ostream;
   ///
   /// ModHash is for use in ThinLTO incremental build, generated while the IR
   /// bitcode file writing.
-  void writeThinLinkBitcodeToFile(const Module &M, raw_ostream &Out,
+  LLVM_FUNC_ABI void writeThinLinkBitcodeToFile(const Module &M, raw_ostream &Out,
                                   const ModuleSummaryIndex &Index,
                                   const ModuleHash &ModHash);
 
@@ -149,7 +149,7 @@ class raw_ostream;
   /// writing the combined index file for ThinLTO. When writing a subset of the
   /// index for a distributed backend, provide the \p ModuleToSummariesForIndex
   /// map.
-  void writeIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out,
+  LLVM_FUNC_ABI void writeIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out,
                         const std::map<std::string, GVSummaryMapTy>
                             *ModuleToSummariesForIndex = nullptr);
 
@@ -162,7 +162,7 @@ class raw_ostream;
   /// If EmbedCmdline is set, the command line is also exported in
   /// the corresponding section (__LLVM,_cmdline / .llvmcmd) - even if CmdArgs
   /// were empty.
-  void embedBitcodeInModule(Module &M, MemoryBufferRef Buf, bool EmbedBitcode,
+  LLVM_FUNC_ABI void embedBitcodeInModule(Module &M, MemoryBufferRef Buf, bool EmbedBitcode,
                             bool EmbedCmdline,
                             const std::vector<uint8_t> &CmdArgs);
 
diff --git a/llvm/include/llvm/Bitcode/BitcodeWriterPass.h b/llvm/include/llvm/Bitcode/BitcodeWriterPass.h
index c9b5e4f4603f199..99aa99ad9541a24 100644
--- a/llvm/include/llvm/Bitcode/BitcodeWriterPass.h
+++ b/llvm/include/llvm/Bitcode/BitcodeWriterPass.h
@@ -35,19 +35,19 @@ class raw_ostream;
 ///
 /// If \c EmitModuleHash, compute and emit the module hash in the bitcode
 /// (currently for use in ThinLTO incremental build).
-ModulePass *createBitcodeWriterPass(raw_ostream &Str,
+LLVM_FUNC_ABI ModulePass *createBitcodeWriterPass(raw_ostream &Str,
                                     bool ShouldPreserveUseListOrder = false,
                                     bool EmitSummaryIndex = false,
                                     bool EmitModuleHash = false);
 
 /// Check whether a pass is a BitcodeWriterPass.
-bool isBitcodeWriterPass(Pass *P);
+LLVM_FUNC_ABI bool isBitcodeWriterPass(Pass *P);
 
 /// Pass for writing a module of IR out to a bitcode file.
 ///
 /// Note that this is intended for use with the new pass manager. To construct
 /// a pass for the legacy pass manager, use the function above.
-class BitcodeWriterPass : public PassInfoMixin<BitcodeWriterPass> {
+class LLVM_CLASS_ABI BitcodeWriterPass : public PassInfoMixin<BitcodeWriterPass> {
   raw_ostream &OS;
   bool ShouldPreserveUseListOrder;
   bool EmitSummaryIndex;
diff --git a/llvm/include/llvm/Bitstream/BitCodes.h b/llvm/include/llvm/Bitstream/BitCodes.h
index 2367112e004af1a..df8d8505c3f26e0 100644
--- a/llvm/include/llvm/Bitstream/BitCodes.h
+++ b/llvm/include/llvm/Bitstream/BitCodes.h
@@ -31,7 +31,7 @@ namespace llvm {
 ///   1. It could be a literal integer value ("the operand is always 17").
 ///   2. It could be an encoding specification ("this operand encoded like so").
 ///
-class BitCodeAbbrevOp {
+class LLVM_CLASS_ABI BitCodeAbbrevOp {
   uint64_t Val;           // A literal value or data for an encoding.
   bool IsLiteral : 1;     // Indicate whether this is a literal value or not.
   unsigned Enc   : 3;     // The encoding to use.
@@ -101,7 +101,7 @@ class BitCodeAbbrevOp {
 /// BitCodeAbbrev - This class represents an abbreviation record.  An
 /// abbreviation allows a complex record that has redundancy to be stored in a
 /// specialized format instead of the fully-general, fully-vbr, format.
-class BitCodeAbbrev {
+class LLVM_CLASS_ABI BitCodeAbbrev {
   SmallVector<BitCodeAbbrevOp, 32> OperandList;
 
 public:
diff --git a/llvm/include/llvm/Bitstream/BitstreamReader.h b/llvm/include/llvm/Bitstream/BitstreamReader.h
index f252b9126ef3cf6..8fb75cf2d831d9b 100644
--- a/llvm/include/llvm/Bitstream/BitstreamReader.h
+++ b/llvm/include/llvm/Bitstream/BitstreamReader.h
@@ -35,7 +35,7 @@
 namespace llvm {
 
 /// This class maintains the abbreviations read from a block info block.
-class BitstreamBlockInfo {
+class LLVM_CLASS_ABI BitstreamBlockInfo {
 public:
   /// This contains information emitted to BLOCKINFO_BLOCK blocks. These
   /// describe abbreviations that all blocks of the specified ID inherit.
@@ -77,7 +77,7 @@ class BitstreamBlockInfo {
 /// This represents a position within a bitstream. There may be multiple
 /// independent cursors reading within one bitstream, each maintaining their
 /// own local state.
-class SimpleBitstreamCursor {
+class LLVM_CLASS_ABI SimpleBitstreamCursor {
   ArrayRef<uint8_t> BitcodeBytes;
   size_t NextChar = 0;
 
@@ -323,7 +323,7 @@ class SimpleBitstreamCursor {
 
 /// When advancing through a bitstream cursor, each advance can discover a few
 /// different kinds of entries:
-struct BitstreamEntry {
+struct LLVM_CLASS_ABI BitstreamEntry {
   enum {
     Error,    // Malformed bitcode was found.
     EndBlock, // We've reached the end of the current block, (or the end of the
@@ -356,7 +356,7 @@ struct BitstreamEntry {
 ///
 /// Unlike iterators, BitstreamCursors are heavy-weight objects that should not
 /// be passed by value.
-class BitstreamCursor : SimpleBitstreamCursor {
+class LLVM_CLASS_ABI BitstreamCursor : SimpleBitstreamCursor {
   // This is the declared size of code values used for the current block, in
   // bits.
   unsigned CurCodeSize = 2;
diff --git a/llvm/include/llvm/Bitstream/BitstreamWriter.h b/llvm/include/llvm/Bitstream/BitstreamWriter.h
index a485d1270b9477f..6b8414f8fd1477c 100644
--- a/llvm/include/llvm/Bitstream/BitstreamWriter.h
+++ b/llvm/include/llvm/Bitstream/BitstreamWriter.h
@@ -28,7 +28,7 @@
 
 namespace llvm {
 
-class BitstreamWriter {
+class LLVM_CLASS_ABI BitstreamWriter {
   /// Out - The buffer that keeps unflushed bytes.
   SmallVectorImpl<char> &Out;
 
diff --git a/llvm/include/llvm/CodeGen/AccelTable.h b/llvm/include/llvm/CodeGen/AccelTable.h
index 14c2da430c7bfc2..a0b0471aa9da766 100644
--- a/llvm/include/llvm/CodeGen/AccelTable.h
+++ b/llvm/include/llvm/CodeGen/AccelTable.h
@@ -111,7 +111,7 @@ class raw_ostream;
 /// Interface which the different types of accelerator table data have to
 /// conform. It serves as a base class for different values of the template
 /// argument of the AccelTable class template.
-class AccelTableData {
+class LLVM_CLASS_ABI AccelTableData {
 public:
   virtual ~AccelTableData() = default;
 
@@ -132,7 +132,7 @@ class AccelTableData {
 /// A base class holding non-template-dependant functionality of the AccelTable
 /// class. Clients should not use this class directly but rather instantiate
 /// AccelTable with a type derived from AccelTableData.
-class AccelTableBase {
+class LLVM_CLASS_ABI AccelTableBase {
 public:
   using HashFn = uint32_t(StringRef);
 
@@ -193,7 +193,7 @@ class AccelTableBase {
 /// HashData entries. The class is parameterized by the type of entries it
 /// holds. The type template parameter also defines the hash function to use for
 /// hashing names.
-template <typename DataT> class AccelTable : public AccelTableBase {
+template <typename DataT> class LLVM_CLASS_ABI AccelTable : public AccelTableBase {
 public:
   AccelTable() : AccelTableBase(DataT::hash) {}
 
@@ -217,7 +217,7 @@ void AccelTable<AccelTableDataT>::addName(DwarfStringPoolEntryRef Name,
 /// A base class for different implementations of Data classes for Apple
 /// Accelerator Tables. The columns in the table are defined by the static Atoms
 /// variable defined on the subclasses.
-class AppleAccelTableData : public AccelTableData {
+class LLVM_CLASS_ABI AppleAccelTableData : public AccelTableData {
 public:
   /// An Atom defines the form of the data in an Apple accelerator table.
   /// Conceptually it is a column in the accelerator consisting of a type and a
@@ -247,7 +247,7 @@ class AppleAccelTableData : public AccelTableData {
 /// Apple Data classes, this class is just a DIE wrapper, and does not know to
 /// serialize itself. The complete serialization logic is in the
 /// emitDWARF5AccelTable function.
-class DWARF5AccelTableData : public AccelTableData {
+class LLVM_CLASS_ABI DWARF5AccelTableData : public AccelTableData {
 public:
   static uint32_t hash(StringRef Name) { return caseFoldingDjbHash(Name); }
 
@@ -267,7 +267,7 @@ class DWARF5AccelTableData : public AccelTableData {
   uint64_t order() const override { return Die.getOffset(); }
 };
 
-class DWARF5AccelTableStaticData : public AccelTableData {
+class LLVM_CLASS_ABI DWARF5AccelTableStaticData : public AccelTableData {
 public:
   static uint32_t hash(StringRef Name) { return caseFoldingDjbHash(Name); }
 
@@ -291,7 +291,7 @@ class DWARF5AccelTableStaticData : public AccelTableData {
   uint64_t order() const override { return DieOffset; }
 };
 
-void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
+LLVM_FUNC_ABI void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
                              StringRef Prefix, const MCSymbol *SecBegin,
                              ArrayRef<AppleAccelTableData::Atom> Atoms);
 
@@ -305,12 +305,12 @@ void emitAppleAccelTable(AsmPrinter *Asm, AccelTable<DataT> &Contents,
   emitAppleAccelTableImpl(Asm, Contents, Prefix, SecBegin, DataT::Atoms);
 }
 
-void emitDWARF5AccelTable(AsmPrinter *Asm,
+LLVM_FUNC_ABI void emitDWARF5AccelTable(AsmPrinter *Asm,
                           AccelTable<DWARF5AccelTableData> &Contents,
                           const DwarfDebug &DD,
                           ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
 
-void emitDWARF5AccelTable(
+LLVM_FUNC_ABI void emitDWARF5AccelTable(
     AsmPrinter *Asm, AccelTable<DWARF5AccelTableStaticData> &Contents,
     ArrayRef<MCSymbol *> CUs,
     llvm::function_ref<unsigned(const DWARF5AccelTableStaticData &)>
@@ -318,7 +318,7 @@ void emitDWARF5AccelTable(
 
 /// Accelerator table data implementation for simple Apple accelerator tables
 /// with just a DIE reference.
-class AppleAccelTableOffsetData : public AppleAccelTableData {
+class LLVM_CLASS_ABI AppleAccelTableOffsetData : public AppleAccelTableData {
 public:
   AppleAccelTableOffsetData(const DIE &D) : Die(D) {}
 
@@ -337,7 +337,7 @@ class AppleAccelTableOffsetData : public AppleAccelTableData {
 };
 
 /// Accelerator table data implementation for Apple type accelerator tables.
-class AppleAccelTableTypeData : public AppleAccelTableOffsetData {
+class LLVM_CLASS_ABI AppleAccelTableTypeData : public AppleAccelTableOffsetData {
 public:
   AppleAccelTableTypeData(const DIE &D) : AppleAccelTableOffsetData(D) {}
 
@@ -355,7 +355,7 @@ class AppleAccelTableTypeData : public AppleAccelTableOffsetData {
 
 /// Accelerator table data implementation for simple Apple accelerator tables
 /// with a DIE offset but no actual DIE pointer.
-class AppleAccelTableStaticOffsetData : public AppleAccelTableData {
+class LLVM_CLASS_ABI AppleAccelTableStaticOffsetData : public AppleAccelTableData {
 public:
   AppleAccelTableStaticOffsetData(uint32_t Offset) : Offset(Offset) {}
 
@@ -375,7 +375,7 @@ class AppleAccelTableStaticOffsetData : public AppleAccelTableData {
 
 /// Accelerator table data implementation for type accelerator tables with
 /// a DIE offset but no actual DIE pointer.
-class AppleAccelTableStaticTypeData : public AppleAccelTableStaticOffsetData {
+class LLVM_CLASS_ABI AppleAccelTableStaticTypeData : public AppleAccelTableStaticOffsetData {
 public:
   AppleAccelTableStaticTypeData(uint32_t Offset, uint16_t Tag,
                                 bool ObjCClassIsImplementation,
diff --git a/llvm/include/llvm/CodeGen/Analysis.h b/llvm/include/llvm/CodeGen/Analysis.h
index 9b96620d808d009..569e33aa62fd9c9 100644
--- a/llvm/include/llvm/CodeGen/Analysis.h
+++ b/llvm/include/llvm/CodeGen/Analysis.h
@@ -45,7 +45,7 @@ struct EVT;
 /// \param CurIndex is the current index in the recursion.
 ///
 /// \returns \p CurIndex plus the linear index in \p Ty  the indices list.
-unsigned ComputeLinearIndex(Type *Ty,
+LLVM_FUNC_ABI unsigned ComputeLinearIndex(Type *Ty,
                             const unsigned *Indices,
                             const unsigned *IndicesEnd,
                             unsigned CurIndex = 0);
@@ -63,31 +63,31 @@ inline unsigned ComputeLinearIndex(Type *Ty,
 /// If Offsets is non-null, it points to a vector to be filled in
 /// with the in-memory offsets of each of the individual values.
 ///
-void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
+LLVM_FUNC_ABI void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
                      SmallVectorImpl<EVT> &ValueVTs,
                      SmallVectorImpl<TypeSize> *Offsets,
                      TypeSize StartingOffset);
-void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
+LLVM_FUNC_ABI void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
                      SmallVectorImpl<EVT> &ValueVTs,
                      SmallVectorImpl<TypeSize> *Offsets = nullptr,
                      uint64_t StartingOffset = 0);
-void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
+LLVM_FUNC_ABI void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
                      SmallVectorImpl<EVT> &ValueVTs,
                      SmallVectorImpl<uint64_t> *FixedOffsets,
                      uint64_t StartingOffset);
 
 /// Variant of ComputeValueVTs that also produces the memory VTs.
-void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
+LLVM_FUNC_ABI void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
                      SmallVectorImpl<EVT> &ValueVTs,
                      SmallVectorImpl<EVT> *MemVTs,
                      SmallVectorImpl<TypeSize> *Offsets,
                      TypeSize StartingOffset);
-void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
+LLVM_FUNC_ABI void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
                      SmallVectorImpl<EVT> &ValueVTs,
                      SmallVectorImpl<EVT> *MemVTs,
                      SmallVectorImpl<TypeSize> *Offsets = nullptr,
                      uint64_t StartingOffset = 0);
-void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
+LLVM_FUNC_ABI void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
                      SmallVectorImpl<EVT> &ValueVTs,
                      SmallVectorImpl<EVT> *MemVTs,
                      SmallVectorImpl<uint64_t> *FixedOffsets,
@@ -100,31 +100,31 @@ void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty,
 /// If Offsets is non-null, it points to a vector to be filled in
 /// with the in-memory offsets of each of the individual values.
 ///
-void computeValueLLTs(const DataLayout &DL, Type &Ty,
+LLVM_FUNC_ABI void computeValueLLTs(const DataLayout &DL, Type &Ty,
                       SmallVectorImpl<LLT> &ValueTys,
                       SmallVectorImpl<uint64_t> *Offsets = nullptr,
                       uint64_t StartingOffset = 0);
 
 /// ExtractTypeInfo - Returns the type info, possibly bitcast, encoded in V.
-GlobalValue *ExtractTypeInfo(Value *V);
+LLVM_FUNC_ABI GlobalValue *ExtractTypeInfo(Value *V);
 
 /// getFCmpCondCode - Return the ISD condition code corresponding to
 /// the given LLVM IR floating-point condition code.  This includes
 /// consideration of global floating-point math flags.
 ///
-ISD::CondCode getFCmpCondCode(FCmpInst::Predicate Pred);
+LLVM_FUNC_ABI ISD::CondCode getFCmpCondCode(FCmpInst::Predicate Pred);
 
 /// getFCmpCodeWithoutNaN - Given an ISD condition code comparing floats,
 /// return the equivalent code if we're allowed to assume that NaNs won't occur.
-ISD::CondCode getFCmpCodeWithoutNaN(ISD::CondCode CC);
+LLVM_FUNC_ABI ISD::CondCode getFCmpCodeWithoutNaN(ISD::CondCode CC);
 
 /// getICmpCondCode - Return the ISD condition code corresponding to
 /// the given LLVM IR integer condition code.
-ISD::CondCode getICmpCondCode(ICmpInst::Predicate Pred);
+LLVM_FUNC_ABI ISD::CondCode getICmpCondCode(ICmpInst::Predicate Pred);
 
 /// getICmpCondCode - Return the LLVM IR integer condition code
 /// corresponding to the given ISD integer condition code.
-ICmpInst::Predicate getICmpCondCode(ISD::CondCode Pred);
+LLVM_FUNC_ABI ICmpInst::Predicate getICmpCondCode(ISD::CondCode Pred);
 
 /// Test if the given instruction is in a position to be optimized
 /// with a tail-call. This roughly means that it's in a block with
@@ -132,7 +132,7 @@ ICmpInst::Predicate getICmpCondCode(ISD::CondCode Pred);
 /// between it and the return.
 ///
 /// This function only tests target-independent requirements.
-bool isInTailCallPosition(const CallBase &Call, const TargetMachine &TM);
+LLVM_FUNC_ABI bool isInTailCallPosition(const CallBase &Call, const TargetMachine &TM);
 
 /// Test if given that the input instruction is in the tail call position, if
 /// there is an attribute mismatch between the caller and the callee that will
@@ -140,7 +140,7 @@ bool isInTailCallPosition(const CallBase &Call, const TargetMachine &TM);
 /// \p AllowDifferingSizes is an output parameter which, if forming a tail call
 /// is permitted, determines whether it's permitted only if the size of the
 /// caller's and callee's return types match exactly.
-bool attributesPermitTailCall(const Function *F, const Instruction *I,
+LLVM_FUNC_ABI bool attributesPermitTailCall(const Function *F, const Instruction *I,
                               const ReturnInst *Ret,
                               const TargetLoweringBase &TLI,
                               bool *AllowDifferingSizes = nullptr);
@@ -148,11 +148,11 @@ bool attributesPermitTailCall(const Function *F, const Instruction *I,
 /// Test if given that the input instruction is in the tail call position if the
 /// return type or any attributes of the function will inhibit tail call
 /// optimization.
-bool returnTypeIsEligibleForTailCall(const Function *F, const Instruction *I,
+LLVM_FUNC_ABI bool returnTypeIsEligibleForTailCall(const Function *F, const Instruction *I,
                                      const ReturnInst *Ret,
                                      const TargetLoweringBase &TLI);
 
-DenseMap<const MachineBasicBlock *, int>
+LLVM_FUNC_ABI DenseMap<const MachineBasicBlock *, int>
 getEHScopeMembership(const MachineFunction &MF);
 
 } // End llvm namespace
diff --git a/llvm/include/llvm/CodeGen/AntiDepBreaker.h b/llvm/include/llvm/CodeGen/AntiDepBreaker.h
index c5c2b5748613708..35aea048ef6ae91 100644
--- a/llvm/include/llvm/CodeGen/AntiDepBreaker.h
+++ b/llvm/include/llvm/CodeGen/AntiDepBreaker.h
@@ -29,7 +29,7 @@ class RegisterClassInfo;
 
 /// This class works in conjunction with the post-RA scheduler to rename
 /// registers to break register anti-dependencies (WAR hazards).
-class AntiDepBreaker {
+class LLVM_CLASS_ABI AntiDepBreaker {
 public:
   using DbgValueVector =
       std::vector<std::pair<MachineInstr *, MachineInstr *>>;
@@ -91,11 +91,11 @@ class AntiDepBreaker {
   }
 };
 
-AntiDepBreaker *createAggressiveAntiDepBreaker(
+LLVM_FUNC_ABI AntiDepBreaker *createAggressiveAntiDepBreaker(
     MachineFunction &MFi, const RegisterClassInfo &RCI,
     TargetSubtargetInfo::RegClassVector &CriticalPathRCs);
 
-AntiDepBreaker *createCriticalAntiDepBreaker(MachineFunction &MFi,
+LLVM_FUNC_ABI AntiDepBreaker *createCriticalAntiDepBreaker(MachineFunction &MFi,
                                              const RegisterClassInfo &RCI);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h
index 360a3b020beac90..681e8ee6e3f8874 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinter.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinter.h
@@ -82,7 +82,7 @@ class RemarkStreamer;
 }
 
 /// This class is intended to be used as a driving class for all asm writers.
-class AsmPrinter : public MachineFunctionPass {
+class LLVM_CLASS_ABI AsmPrinter : public MachineFunctionPass {
 public:
   /// Target machine description.
   TargetMachine &TM;
diff --git a/llvm/include/llvm/CodeGen/AsmPrinterHandler.h b/llvm/include/llvm/CodeGen/AsmPrinterHandler.h
index f6921a0bea7cd2e..2cc3ffb171cee18 100644
--- a/llvm/include/llvm/CodeGen/AsmPrinterHandler.h
+++ b/llvm/include/llvm/CodeGen/AsmPrinterHandler.h
@@ -31,7 +31,7 @@ typedef MCSymbol *ExceptionSymbolProvider(AsmPrinter *Asm,
 
 /// Collects and handles AsmPrinter objects required to build debug
 /// or EH information.
-class AsmPrinterHandler {
+class LLVM_CLASS_ABI AsmPrinterHandler {
 public:
   virtual ~AsmPrinterHandler();
 
diff --git a/llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h b/llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h
index 2f4126c68192ed0..c1bac56225a1061 100644
--- a/llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h
+++ b/llvm/include/llvm/CodeGen/AssignmentTrackingAnalysis.h
@@ -18,7 +18,7 @@ namespace llvm {
 /// Type wrapper for integer ID for Variables. 0 is reserved.
 enum class VariableID : unsigned { Reserved = 0 };
 /// Variable location definition used by FunctionVarLocs.
-struct VarLocInfo {
+struct LLVM_CLASS_ABI VarLocInfo {
   llvm::VariableID VariableID;
   DIExpression *Expr = nullptr;
   DebugLoc DL;
@@ -28,7 +28,7 @@ struct VarLocInfo {
 /// Data structure describing the variable locations in a function. Used as the
 /// result of the AssignmentTrackingAnalysis pass. Essentially read-only
 /// outside of AssignmentTrackingAnalysis where it is built.
-class FunctionVarLocs {
+class LLVM_CLASS_ABI FunctionVarLocs {
   /// Maps VarLocInfo.VariableID to a DebugVariable for VarLocRecords.
   SmallVector<DebugVariable> Variables;
   /// List of variable location changes grouped by the instruction the
@@ -95,7 +95,7 @@ class FunctionVarLocs {
   ///@}
 };
 
-class AssignmentTrackingAnalysis : public FunctionPass {
+class LLVM_CLASS_ABI AssignmentTrackingAnalysis : public FunctionPass {
   std::unique_ptr<FunctionVarLocs> Results;
 
 public:
diff --git a/llvm/include/llvm/CodeGen/AtomicExpandUtils.h b/llvm/include/llvm/CodeGen/AtomicExpandUtils.h
index ed6a15c0952349c..788363159601e52 100644
--- a/llvm/include/llvm/CodeGen/AtomicExpandUtils.h
+++ b/llvm/include/llvm/CodeGen/AtomicExpandUtils.h
@@ -58,7 +58,7 @@ using CreateCmpXchgInstFun =
 ///     [...]
 ///
 /// Returns true if the containing function was modified.
-bool expandAtomicRMWToCmpXchg(AtomicRMWInst *AI, CreateCmpXchgInstFun CreateCmpXchg);
+LLVM_FUNC_ABI bool expandAtomicRMWToCmpXchg(AtomicRMWInst *AI, CreateCmpXchgInstFun CreateCmpXchg);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h b/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h
index ad745b097925ae8..f77950558440b25 100644
--- a/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h
+++ b/llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h
@@ -15,7 +15,7 @@
 
 namespace llvm {
 
-extern cl::opt<std::string> BBSectionsColdTextPrefix;
+LLVM_FUNC_ABI extern cl::opt<std::string> BBSectionsColdTextPrefix;
 
 class MachineFunction;
 class MachineBasicBlock;
@@ -23,10 +23,10 @@ class MachineBasicBlock;
 using MachineBasicBlockComparator =
     function_ref<bool(const MachineBasicBlock &, const MachineBasicBlock &)>;
 
-void sortBasicBlocksAndUpdateBranches(MachineFunction &MF,
+LLVM_FUNC_ABI void sortBasicBlocksAndUpdateBranches(MachineFunction &MF,
                                       MachineBasicBlockComparator MBBCmp);
 
-void avoidZeroOffsetLandingPad(MachineFunction &MF);
+LLVM_FUNC_ABI void avoidZeroOffsetLandingPad(MachineFunction &MF);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h b/llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h
index 1955176edd23670..c7122fd45f3fe27 100644
--- a/llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h
+++ b/llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h
@@ -32,7 +32,7 @@ using namespace llvm;
 namespace llvm {
 
 // The cluster information for a machine basic block.
-struct BBClusterInfo {
+struct LLVM_CLASS_ABI BBClusterInfo {
   // Unique ID for this basic block.
   unsigned BBID;
   // Cluster ID this basic block belongs to.
@@ -43,7 +43,7 @@ struct BBClusterInfo {
 
 using ProgramBBClusterInfoMapTy = StringMap<SmallVector<BBClusterInfo>>;
 
-class BasicBlockSectionsProfileReader : public ImmutablePass {
+class LLVM_CLASS_ABI BasicBlockSectionsProfileReader : public ImmutablePass {
 public:
   static char ID;
 
@@ -111,7 +111,7 @@ class BasicBlockSectionsProfileReader : public ImmutablePass {
 // Creates a BasicBlockSectionsProfileReader pass to parse the basic block
 // sections profile. \p Buf is a memory buffer that contains the list of
 // functions and basic block ids to selectively enable basic block sections.
-ImmutablePass *
+LLVM_FUNC_ABI ImmutablePass *
 createBasicBlockSectionsProfileReaderPass(const MemoryBuffer *Buf);
 
 } // namespace llvm
diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
index c8c47d0e2af8115..bbbdcf040a74ce6 100644
--- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h
+++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h
@@ -65,7 +65,7 @@ class ScalarEvolution;
 class SCEV;
 class TargetMachine;
 
-extern cl::opt<unsigned> PartialUnrollingThreshold;
+LLVM_FUNC_ABI extern cl::opt<unsigned> PartialUnrollingThreshold;
 
 /// Base class which can be used to help build a TTI implementation.
 ///
@@ -77,7 +77,7 @@ extern cl::opt<unsigned> PartialUnrollingThreshold;
 /// We need these methods implemented in the derived class so that this class
 /// doesn't have to duplicate storage for them.
 template <typename T>
-class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
+class LLVM_CLASS_ABI BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
 private:
   using BaseT = TargetTransformInfoImplCRTPBase<T>;
   using TTI = TargetTransformInfo;
@@ -2454,7 +2454,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
 
 /// Concrete BasicTTIImpl that can be used if no further customization
 /// is needed.
-class BasicTTIImpl : public BasicTTIImplBase<BasicTTIImpl> {
+class LLVM_CLASS_ABI BasicTTIImpl : public BasicTTIImplBase<BasicTTIImpl> {
   using BaseT = BasicTTIImplBase<BasicTTIImpl>;
 
   friend class BasicTTIImplBase<BasicTTIImpl>;
diff --git a/llvm/include/llvm/CodeGen/ByteProvider.h b/llvm/include/llvm/CodeGen/ByteProvider.h
index e634e5e7978e099..db2f8d08d11d183 100644
--- a/llvm/include/llvm/CodeGen/ByteProvider.h
+++ b/llvm/include/llvm/CodeGen/ByteProvider.h
@@ -28,7 +28,7 @@ namespace llvm {
 /// some other productive instruction (e.g. arithmetic instructions).
 /// Bit manipulation instructions like shifts are not ByteProviders, rather
 /// are used to extract Bytes.
-template <typename ISelOp> class ByteProvider {
+template <typename ISelOp> class LLVM_CLASS_ABI ByteProvider {
 private:
   ByteProvider<ISelOp>(std::optional<ISelOp> Src, int64_t DestOffset,
                        int64_t SrcOffset)
diff --git a/llvm/include/llvm/CodeGen/CFIFixup.h b/llvm/include/llvm/CodeGen/CFIFixup.h
index f543d6387bb6ad7..7de316e05968d0d 100644
--- a/llvm/include/llvm/CodeGen/CFIFixup.h
+++ b/llvm/include/llvm/CodeGen/CFIFixup.h
@@ -19,7 +19,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class CFIFixup : public MachineFunctionPass {
+class LLVM_CLASS_ABI CFIFixup : public MachineFunctionPass {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/CodeGen/CSEConfigBase.h b/llvm/include/llvm/CodeGen/CSEConfigBase.h
index a219be9000812a8..61463cab17aff86 100644
--- a/llvm/include/llvm/CodeGen/CSEConfigBase.h
+++ b/llvm/include/llvm/CodeGen/CSEConfigBase.h
@@ -16,7 +16,7 @@ namespace llvm {
 // CSEInfo analysis. We define it here because TargetPassConfig can't depend on
 // the GlobalISel library, and so we use this in the interface between them
 // so that the derived classes in GISel can reference generic opcodes.
-class CSEConfigBase {
+class LLVM_CLASS_ABI CSEConfigBase {
 public:
   virtual ~CSEConfigBase() = default;
   // Hook for defining which Generic instructions should be CSEd.
diff --git a/llvm/include/llvm/CodeGen/CalcSpillWeights.h b/llvm/include/llvm/CodeGen/CalcSpillWeights.h
index 9f2fc3acaf42e95..90670dde8bdae49 100644
--- a/llvm/include/llvm/CodeGen/CalcSpillWeights.h
+++ b/llvm/include/llvm/CodeGen/CalcSpillWeights.h
@@ -43,7 +43,7 @@ class VirtRegMap;
 
   /// Calculate auxiliary information for a virtual register such as its
   /// spill weight and allocation hint.
-  class VirtRegAuxInfo {
+  class LLVM_CLASS_ABI VirtRegAuxInfo {
     MachineFunction &MF;
     LiveIntervals &LIS;
     const VirtRegMap &VRM;
diff --git a/llvm/include/llvm/CodeGen/CallingConvLower.h b/llvm/include/llvm/CodeGen/CallingConvLower.h
index 43b87c1bfabd919..2ec35bdfdfdca7a 100644
--- a/llvm/include/llvm/CodeGen/CallingConvLower.h
+++ b/llvm/include/llvm/CodeGen/CallingConvLower.h
@@ -31,7 +31,7 @@ class MVT;
 class TargetRegisterInfo;
 
 /// CCValAssign - Represent assignment of one arg/retval to a location.
-class CCValAssign {
+class LLVM_CLASS_ABI CCValAssign {
 public:
   enum LocInfo {
     Full,      // The value fills the full location.
@@ -144,7 +144,7 @@ class CCValAssign {
 
 /// Describes a register that needs to be forwarded from the prologue to a
 /// musttail call.
-struct ForwardedRegister {
+struct LLVM_CLASS_ABI ForwardedRegister {
   ForwardedRegister(Register VReg, MCPhysReg PReg, MVT VT)
       : VReg(VReg), PReg(PReg), VT(VT) {}
   Register VReg;
@@ -168,7 +168,7 @@ typedef bool CCCustomFn(unsigned &ValNo, MVT &ValVT,
 /// CCState - This class holds information needed while lowering arguments and
 /// return values.  It captures which registers are already assigned and which
 /// stack slots are used.  It provides accessors to allocate these values.
-class CCState {
+class LLVM_CLASS_ABI CCState {
 private:
   CallingConv::ID CallingConv;
   bool IsVarArg;
diff --git a/llvm/include/llvm/CodeGen/CodeGenCommonISel.h b/llvm/include/llvm/CodeGen/CodeGenCommonISel.h
index d7c627b23d49235..7797a658db77a31 100644
--- a/llvm/include/llvm/CodeGen/CodeGenCommonISel.h
+++ b/llvm/include/llvm/CodeGen/CodeGenCommonISel.h
@@ -114,7 +114,7 @@ enum FPClassTest : unsigned;
 ///        conclude by code-gening the failure basic block if we have not
 ///        code-gened it already (all stack protector checks we generate in
 ///        the same function, use the same failure basic block).
-class StackProtectorDescriptor {
+class LLVM_CLASS_ABI StackProtectorDescriptor {
 public:
   StackProtectorDescriptor() = default;
 
@@ -212,7 +212,7 @@ class StackProtectorDescriptor {
 /// terminator sequence so that we can ensure that we splice off not just the
 /// terminator, but additionally the copies that move the vregs into the
 /// physical registers.
-MachineBasicBlock::iterator
+LLVM_FUNC_ABI MachineBasicBlock::iterator
 findSplitPointForStackProtector(MachineBasicBlock *BB,
                                 const TargetInstrInfo &TII);
 
@@ -222,11 +222,11 @@ findSplitPointForStackProtector(MachineBasicBlock *BB,
 /// \param Test The test as specified in 'is_fpclass' intrinsic invocation.
 /// \returns The inverted test, or fcNone, if inversion does not produce a
 /// simpler test.
-FPClassTest invertFPClassTestIfSimpler(FPClassTest Test);
+LLVM_FUNC_ABI FPClassTest invertFPClassTestIfSimpler(FPClassTest Test);
 
 /// Assuming the instruction \p MI is going to be deleted, attempt to salvage
 /// debug users of \p MI by writing the effect of \p MI in a DIExpression.
-void salvageDebugInfoForDbgValue(const MachineRegisterInfo &MRI,
+LLVM_FUNC_ABI void salvageDebugInfoForDbgValue(const MachineRegisterInfo &MRI,
                                  MachineInstr &MI,
                                  ArrayRef<MachineOperand *> DbgUsers);
 
diff --git a/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h b/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
index cf219388926a854..51f136243d9c2de 100644
--- a/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h
@@ -99,7 +99,7 @@ namespace llvm {
 /// construction. The \c MachinePassRegistry.def file specifies how to construct
 /// all of the built-in passes, and those may reference these members during
 /// construction.
-template <typename DerivedT> class CodeGenPassBuilder {
+template <typename DerivedT> class LLVM_CLASS_ABI CodeGenPassBuilder {
 public:
   explicit CodeGenPassBuilder(LLVMTargetMachine &TM, CGPassBuilderOption Opts,
                               PassInstrumentationCallbacks *PIC)
diff --git a/llvm/include/llvm/CodeGen/CommandFlags.h b/llvm/include/llvm/CodeGen/CommandFlags.h
index cc8d34a0ee75a74..cba942a45333068 100644
--- a/llvm/include/llvm/CodeGen/CommandFlags.h
+++ b/llvm/include/llvm/CodeGen/CommandFlags.h
@@ -32,128 +32,128 @@ class Triple;
 
 namespace codegen {
 
-std::string getMArch();
+LLVM_FUNC_ABI std::string getMArch();
 
-std::string getMCPU();
+LLVM_FUNC_ABI std::string getMCPU();
 
-std::vector<std::string> getMAttrs();
+LLVM_FUNC_ABI std::vector<std::string> getMAttrs();
 
-Reloc::Model getRelocModel();
-std::optional<Reloc::Model> getExplicitRelocModel();
+LLVM_FUNC_ABI Reloc::Model getRelocModel();
+LLVM_FUNC_ABI std::optional<Reloc::Model> getExplicitRelocModel();
 
-ThreadModel::Model getThreadModel();
+LLVM_FUNC_ABI ThreadModel::Model getThreadModel();
 
-CodeModel::Model getCodeModel();
-std::optional<CodeModel::Model> getExplicitCodeModel();
+LLVM_FUNC_ABI CodeModel::Model getCodeModel();
+LLVM_FUNC_ABI std::optional<CodeModel::Model> getExplicitCodeModel();
 
-llvm::ExceptionHandling getExceptionModel();
+LLVM_FUNC_ABI llvm::ExceptionHandling getExceptionModel();
 
-std::optional<CodeGenFileType> getExplicitFileType();
+LLVM_FUNC_ABI std::optional<CodeGenFileType> getExplicitFileType();
 
-CodeGenFileType getFileType();
+LLVM_FUNC_ABI CodeGenFileType getFileType();
 
-FramePointerKind getFramePointerUsage();
+LLVM_FUNC_ABI FramePointerKind getFramePointerUsage();
 
-bool getEnableUnsafeFPMath();
+LLVM_FUNC_ABI bool getEnableUnsafeFPMath();
 
-bool getEnableNoInfsFPMath();
+LLVM_FUNC_ABI bool getEnableNoInfsFPMath();
 
-bool getEnableNoNaNsFPMath();
+LLVM_FUNC_ABI bool getEnableNoNaNsFPMath();
 
-bool getEnableNoSignedZerosFPMath();
+LLVM_FUNC_ABI bool getEnableNoSignedZerosFPMath();
 
-bool getEnableApproxFuncFPMath();
+LLVM_FUNC_ABI bool getEnableApproxFuncFPMath();
 
-bool getEnableNoTrappingFPMath();
+LLVM_FUNC_ABI bool getEnableNoTrappingFPMath();
 
-DenormalMode::DenormalModeKind getDenormalFPMath();
-DenormalMode::DenormalModeKind getDenormalFP32Math();
+LLVM_FUNC_ABI DenormalMode::DenormalModeKind getDenormalFPMath();
+LLVM_FUNC_ABI DenormalMode::DenormalModeKind getDenormalFP32Math();
 
-bool getEnableHonorSignDependentRoundingFPMath();
+LLVM_FUNC_ABI bool getEnableHonorSignDependentRoundingFPMath();
 
-llvm::FloatABI::ABIType getFloatABIForCalls();
+LLVM_FUNC_ABI llvm::FloatABI::ABIType getFloatABIForCalls();
 
-llvm::FPOpFusion::FPOpFusionMode getFuseFPOps();
+LLVM_FUNC_ABI llvm::FPOpFusion::FPOpFusionMode getFuseFPOps();
 
-SwiftAsyncFramePointerMode getSwiftAsyncFramePointer();
+LLVM_FUNC_ABI SwiftAsyncFramePointerMode getSwiftAsyncFramePointer();
 
-bool getDontPlaceZerosInBSS();
+LLVM_FUNC_ABI bool getDontPlaceZerosInBSS();
 
-bool getEnableGuaranteedTailCallOpt();
+LLVM_FUNC_ABI bool getEnableGuaranteedTailCallOpt();
 
-bool getEnableAIXExtendedAltivecABI();
+LLVM_FUNC_ABI bool getEnableAIXExtendedAltivecABI();
 
-bool getDisableTailCalls();
+LLVM_FUNC_ABI bool getDisableTailCalls();
 
-bool getStackSymbolOrdering();
+LLVM_FUNC_ABI bool getStackSymbolOrdering();
 
-unsigned getOverrideStackAlignment();
+LLVM_FUNC_ABI unsigned getOverrideStackAlignment();
 
-bool getStackRealign();
+LLVM_FUNC_ABI bool getStackRealign();
 
-std::string getTrapFuncName();
+LLVM_FUNC_ABI std::string getTrapFuncName();
 
-bool getUseCtors();
+LLVM_FUNC_ABI bool getUseCtors();
 
-bool getRelaxELFRelocations();
+LLVM_FUNC_ABI bool getRelaxELFRelocations();
 
-bool getDataSections();
-std::optional<bool> getExplicitDataSections();
+LLVM_FUNC_ABI bool getDataSections();
+LLVM_FUNC_ABI std::optional<bool> getExplicitDataSections();
 
-bool getFunctionSections();
-std::optional<bool> getExplicitFunctionSections();
+LLVM_FUNC_ABI bool getFunctionSections();
+LLVM_FUNC_ABI std::optional<bool> getExplicitFunctionSections();
 
-bool getIgnoreXCOFFVisibility();
+LLVM_FUNC_ABI bool getIgnoreXCOFFVisibility();
 
-bool getXCOFFTracebackTable();
+LLVM_FUNC_ABI bool getXCOFFTracebackTable();
 
-std::string getBBSections();
+LLVM_FUNC_ABI std::string getBBSections();
 
-unsigned getTLSSize();
+LLVM_FUNC_ABI unsigned getTLSSize();
 
-bool getEmulatedTLS();
-std::optional<bool> getExplicitEmulatedTLS();
+LLVM_FUNC_ABI bool getEmulatedTLS();
+LLVM_FUNC_ABI std::optional<bool> getExplicitEmulatedTLS();
 
-bool getUniqueSectionNames();
+LLVM_FUNC_ABI bool getUniqueSectionNames();
 
-bool getUniqueBasicBlockSectionNames();
+LLVM_FUNC_ABI bool getUniqueBasicBlockSectionNames();
 
-llvm::EABI getEABIVersion();
+LLVM_FUNC_ABI llvm::EABI getEABIVersion();
 
-llvm::DebuggerKind getDebuggerTuningOpt();
+LLVM_FUNC_ABI llvm::DebuggerKind getDebuggerTuningOpt();
 
-bool getEnableStackSizeSection();
+LLVM_FUNC_ABI bool getEnableStackSizeSection();
 
-bool getEnableAddrsig();
+LLVM_FUNC_ABI bool getEnableAddrsig();
 
-bool getEmitCallSiteInfo();
+LLVM_FUNC_ABI bool getEmitCallSiteInfo();
 
-bool getEnableMachineFunctionSplitter();
+LLVM_FUNC_ABI bool getEnableMachineFunctionSplitter();
 
-bool getEnableDebugEntryValues();
+LLVM_FUNC_ABI bool getEnableDebugEntryValues();
 
-bool getValueTrackingVariableLocations();
-std::optional<bool> getExplicitValueTrackingVariableLocations();
+LLVM_FUNC_ABI bool getValueTrackingVariableLocations();
+LLVM_FUNC_ABI std::optional<bool> getExplicitValueTrackingVariableLocations();
 
-bool getForceDwarfFrameSection();
+LLVM_FUNC_ABI bool getForceDwarfFrameSection();
 
-bool getXRayFunctionIndex();
+LLVM_FUNC_ABI bool getXRayFunctionIndex();
 
-bool getDebugStrictDwarf();
+LLVM_FUNC_ABI bool getDebugStrictDwarf();
 
-unsigned getAlignLoops();
+LLVM_FUNC_ABI unsigned getAlignLoops();
 
-bool getJMCInstrument();
+LLVM_FUNC_ABI bool getJMCInstrument();
 
-bool getXCOFFReadOnlyPointers();
+LLVM_FUNC_ABI bool getXCOFFReadOnlyPointers();
 
 /// Create this object with static storage to register codegen-related command
 /// line options.
-struct RegisterCodeGenFlags {
+struct LLVM_CLASS_ABI RegisterCodeGenFlags {
   RegisterCodeGenFlags();
 };
 
-llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options);
+LLVM_FUNC_ABI llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options);
 
 /// Common utility function tightly tied to the options listed here. Initializes
 /// a TargetOptions object with CodeGen flags and returns it.
@@ -161,27 +161,27 @@ llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options);
 ///    options are not explicitly specified. If those triple dependant options
 ///    value do not have effect for your component, a default Triple() could be
 ///    passed in.
-TargetOptions InitTargetOptionsFromCodeGenFlags(const llvm::Triple &TheTriple);
+LLVM_FUNC_ABI TargetOptions InitTargetOptionsFromCodeGenFlags(const llvm::Triple &TheTriple);
 
-std::string getCPUStr();
+LLVM_FUNC_ABI std::string getCPUStr();
 
-std::string getFeaturesStr();
+LLVM_FUNC_ABI std::string getFeaturesStr();
 
-std::vector<std::string> getFeatureList();
+LLVM_FUNC_ABI std::vector<std::string> getFeatureList();
 
-void renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val);
+LLVM_FUNC_ABI void renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val);
 
 /// Set function attributes of function \p F based on CPU, Features, and command
 /// line flags.
-void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F);
+LLVM_FUNC_ABI void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F);
 
 /// Set function attributes of functions in Module M based on CPU,
 /// Features, and command line flags.
-void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M);
+LLVM_FUNC_ABI void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M);
 
 /// Should value-tracking variable locations / instruction referencing be
 /// enabled by default for this triple?
-bool getDefaultValueTrackingVariableLocations(const llvm::Triple &T);
+LLVM_FUNC_ABI bool getDefaultValueTrackingVariableLocations(const llvm::Triple &T);
 } // namespace codegen
 } // namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h b/llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h
index a330108a7fa2ff6..19e9ae16738b8b3 100644
--- a/llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h
+++ b/llvm/include/llvm/CodeGen/ComplexDeinterleavingPass.h
@@ -22,7 +22,7 @@ namespace llvm {
 class Function;
 class TargetMachine;
 
-struct ComplexDeinterleavingPass
+struct LLVM_CLASS_ABI ComplexDeinterleavingPass
     : public PassInfoMixin<ComplexDeinterleavingPass> {
 private:
   TargetMachine *TM;
diff --git a/llvm/include/llvm/CodeGen/CostTable.h b/llvm/include/llvm/CodeGen/CostTable.h
index 66b557870407931..c969ca4c5194626 100644
--- a/llvm/include/llvm/CodeGen/CostTable.h
+++ b/llvm/include/llvm/CodeGen/CostTable.h
@@ -23,7 +23,7 @@ namespace llvm {
 
 /// Cost Table Entry
 template <typename CostType>
-struct CostTblEntryT {
+struct LLVM_CLASS_ABI CostTblEntryT {
   int ISD;
   MVT::SimpleValueType Type;
   CostType Cost;
@@ -53,7 +53,7 @@ CostTableLookup(const CostTblEntryT<CostType> (&Table)[N], int ISD, MVT Ty) {
 
 /// Type Conversion Cost Table
 template <typename CostType>
-struct TypeConversionCostTblEntryT {
+struct LLVM_CLASS_ABI TypeConversionCostTblEntryT {
   int ISD;
   MVT::SimpleValueType Dst;
   MVT::SimpleValueType Src;
diff --git a/llvm/include/llvm/CodeGen/DFAPacketizer.h b/llvm/include/llvm/CodeGen/DFAPacketizer.h
index 7934e72dabee5d8..141dc52d2e0b1e3 100644
--- a/llvm/include/llvm/CodeGen/DFAPacketizer.h
+++ b/llvm/include/llvm/CodeGen/DFAPacketizer.h
@@ -49,7 +49,7 @@ class TargetInstrInfo;
 
 // This class extends ScheduleDAGInstrs and overrides the schedule method
 // to build the dependence graph.
-class DefaultVLIWScheduler : public ScheduleDAGInstrs {
+class LLVM_CLASS_ABI DefaultVLIWScheduler : public ScheduleDAGInstrs {
 private:
   AAResults *AA;
   /// Ordered list of DAG postprocessing steps.
@@ -71,7 +71,7 @@ class DefaultVLIWScheduler : public ScheduleDAGInstrs {
   void postProcessDAG();
 };
 
-class DFAPacketizer {
+class LLVM_CLASS_ABI DFAPacketizer {
 private:
   const InstrItineraryData *InstrItins;
   Automaton<uint64_t> A;
@@ -134,7 +134,7 @@ class DFAPacketizer {
 // in the current packet. If no dependency is found, I is added to current
 // packet and the machine resource is marked as taken. If any dependency is
 // found, a target API call is made to prune the dependence.
-class VLIWPacketizerList {
+class LLVM_CLASS_ABI VLIWPacketizerList {
 protected:
   MachineFunction &MF;
   const TargetInstrInfo *TII;
diff --git a/llvm/include/llvm/CodeGen/DIE.h b/llvm/include/llvm/CodeGen/DIE.h
index 7a4adcabec2ef52..7bb7b5a3811b67d 100644
--- a/llvm/include/llvm/CodeGen/DIE.h
+++ b/llvm/include/llvm/CodeGen/DIE.h
@@ -47,7 +47,7 @@ class raw_ostream;
 
 //===--------------------------------------------------------------------===//
 /// Dwarf abbreviation data, describes one attribute of a Dwarf abbreviation.
-class DIEAbbrevData {
+class LLVM_CLASS_ABI DIEAbbrevData {
   /// Dwarf attribute code.
   dwarf::Attribute Attribute;
 
@@ -77,7 +77,7 @@ class DIEAbbrevData {
 //===--------------------------------------------------------------------===//
 /// Dwarf abbreviation, describes the organization of a debug information
 /// object.
-class DIEAbbrev : public FoldingSetNode {
+class LLVM_CLASS_ABI DIEAbbrev : public FoldingSetNode {
   /// Unique number for node.
   unsigned Number = 0;
 
@@ -138,7 +138,7 @@ class DIEAbbrev : public FoldingSetNode {
 /// assign a unique abbreviation number to each unique DIEAbbrev object it
 /// finds. The resulting collection of DIEAbbrev objects can then be emitted
 /// into the .debug_abbrev section.
-class DIEAbbrevSet {
+class LLVM_CLASS_ABI DIEAbbrevSet {
   /// The bump allocator to use when creating DIEAbbrev objects in the uniqued
   /// storage container.
   BumpPtrAllocator &Alloc;
@@ -166,7 +166,7 @@ class DIEAbbrevSet {
 //===--------------------------------------------------------------------===//
 /// An integer value DIE.
 ///
-class DIEInteger {
+class LLVM_CLASS_ABI DIEInteger {
   uint64_t Integer;
 
 public:
@@ -204,7 +204,7 @@ class DIEInteger {
 
 //===--------------------------------------------------------------------===//
 /// An expression DIE.
-class DIEExpr {
+class LLVM_CLASS_ABI DIEExpr {
   const MCExpr *Expr;
 
 public:
@@ -221,7 +221,7 @@ class DIEExpr {
 
 //===--------------------------------------------------------------------===//
 /// A label DIE.
-class DIELabel {
+class LLVM_CLASS_ABI DIELabel {
   const MCSymbol *Label;
 
 public:
@@ -238,7 +238,7 @@ class DIELabel {
 
 //===--------------------------------------------------------------------===//
 /// A BaseTypeRef DIE.
-class DIEBaseTypeRef {
+class LLVM_CLASS_ABI DIEBaseTypeRef {
   const DwarfCompileUnit *CU;
   const uint64_t Index;
   static constexpr unsigned ULEB128PadSize = 4;
@@ -259,7 +259,7 @@ class DIEBaseTypeRef {
 //===--------------------------------------------------------------------===//
 /// A simple label difference DIE.
 ///
-class DIEDelta {
+class LLVM_CLASS_ABI DIEDelta {
   const MCSymbol *LabelHi;
   const MCSymbol *LabelLo;
 
@@ -276,7 +276,7 @@ class DIEDelta {
 /// A container for string pool string values.
 ///
 /// This class is used with the DW_FORM_strp and DW_FORM_GNU_str_index forms.
-class DIEString {
+class LLVM_CLASS_ABI DIEString {
   DwarfStringPoolEntryRef S;
 
 public:
@@ -295,7 +295,7 @@ class DIEString {
 /// A container for inline string values.
 ///
 /// This class is used with the DW_FORM_string form.
-class DIEInlineString {
+class LLVM_CLASS_ABI DIEInlineString {
   StringRef S;
 
 public:
@@ -317,7 +317,7 @@ class DIEInlineString {
 /// A pointer to another debug information entry.  An instance of this class can
 /// also be used as a proxy for a debug information entry not yet defined
 /// (ie. types.)
-class DIEEntry {
+class LLVM_CLASS_ABI DIEEntry {
   DIE *Entry;
 
 public:
@@ -335,7 +335,7 @@ class DIEEntry {
 //===--------------------------------------------------------------------===//
 /// Represents a pointer to a location list in the debug_loc
 /// section.
-class DIELocList {
+class LLVM_CLASS_ABI DIELocList {
   /// Index into the .debug_loc vector.
   size_t Index;
 
@@ -353,7 +353,7 @@ class DIELocList {
 
 //===--------------------------------------------------------------------===//
 /// A BaseTypeRef DIE.
-class DIEAddrOffset {
+class LLVM_CLASS_ABI DIEAddrOffset {
   DIEInteger Addr;
   DIEDelta Offset;
 
@@ -372,7 +372,7 @@ class DIEAddrOffset {
 /// to DWARF attribute classes.
 class DIEBlock;
 class DIELoc;
-class DIEValue {
+class LLVM_CLASS_ABI DIEValue {
 public:
   enum Type {
     isNone,
@@ -520,7 +520,7 @@ class DIEValue {
   void dump() const;
 };
 
-struct IntrusiveBackListNode {
+struct LLVM_CLASS_ABI IntrusiveBackListNode {
   PointerIntPair<IntrusiveBackListNode *, 1> Next;
 
   IntrusiveBackListNode() : Next(this, true) {}
@@ -530,7 +530,7 @@ struct IntrusiveBackListNode {
   }
 };
 
-struct IntrusiveBackListBase {
+struct LLVM_CLASS_ABI IntrusiveBackListBase {
   using Node = IntrusiveBackListNode;
 
   Node *Last = nullptr;
@@ -561,7 +561,7 @@ struct IntrusiveBackListBase {
   }
 };
 
-template <class T> class IntrusiveBackList : IntrusiveBackListBase {
+template <class T> class LLVM_CLASS_ABI IntrusiveBackList : IntrusiveBackListBase {
 public:
   using IntrusiveBackListBase::empty;
 
@@ -687,7 +687,7 @@ template <class T> class IntrusiveBackList : IntrusiveBackListBase {
 ///     have 2 or fewer values, and 90% have 5 or fewer.  A vector would be
 ///     over-allocated by 50% on average anyway, the same cost as the
 ///     linked-list node.
-class DIEValueList {
+class LLVM_CLASS_ABI DIEValueList {
   struct Node : IntrusiveBackListNode {
     DIEValue V;
 
@@ -817,7 +817,7 @@ class DIEValueList {
 //===--------------------------------------------------------------------===//
 /// A structured debug information entry.  Has an abbreviation which
 /// describes its organization.
-class DIE : IntrusiveBackListNode, public DIEValueList {
+class LLVM_CLASS_ABI DIE : IntrusiveBackListNode, public DIEValueList {
   friend class IntrusiveBackList<DIE>;
   friend class DIEUnit;
 
@@ -958,7 +958,7 @@ class DIE : IntrusiveBackListNode, public DIEValueList {
 
 //===--------------------------------------------------------------------===//
 /// Represents a compile or type unit.
-class DIEUnit {
+class LLVM_CLASS_ABI DIEUnit {
   /// The compile unit or type unit DIE. This variable must be an instance of
   /// DIE so that we can calculate the DIEUnit from any DIE by traversing the
   /// parent backchain and getting the Unit DIE, and then casting itself to a
@@ -1001,14 +1001,14 @@ class DIEUnit {
   const DIE &getUnitDie() const { return Die; }
 };
 
-struct BasicDIEUnit final : DIEUnit {
+struct LLVM_CLASS_ABI BasicDIEUnit final : DIEUnit {
   explicit BasicDIEUnit(dwarf::Tag UnitTag) : DIEUnit(UnitTag) {}
 };
 
 //===--------------------------------------------------------------------===//
 /// DIELoc - Represents an expression location.
 //
-class DIELoc : public DIEValueList {
+class LLVM_CLASS_ABI DIELoc : public DIEValueList {
   mutable unsigned Size = 0; // Size in bytes excluding size header.
 
 public:
@@ -1044,7 +1044,7 @@ class DIELoc : public DIEValueList {
 //===--------------------------------------------------------------------===//
 /// DIEBlock - Represents a block of values.
 //
-class DIEBlock : public DIEValueList {
+class LLVM_CLASS_ABI DIEBlock : public DIEValueList {
   mutable unsigned Size = 0; // Size in bytes excluding size header.
 
 public:
diff --git a/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h b/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
index f527feaf4cf74d2..abccc536e06b1cc 100644
--- a/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
+++ b/llvm/include/llvm/CodeGen/DbgEntityHistoryCalculator.h
@@ -28,7 +28,7 @@ class TargetRegisterInfo;
 /// a function. Meta instructions are given the same ordinal as the preceding
 /// non-meta instruction. Class state is invalid if MF is modified after
 /// calling initialize.
-class InstructionOrdering {
+class LLVM_CLASS_ABI InstructionOrdering {
 public:
   void initialize(const MachineFunction &MF);
   void clear() { InstNumberMap.clear(); }
@@ -44,7 +44,7 @@ class InstructionOrdering {
 
 /// For each user variable, keep a list of instruction ranges where this
 /// variable is accessible. The variables are listed in order of appearance.
-class DbgValueHistoryMap {
+class LLVM_CLASS_ABI DbgValueHistoryMap {
 public:
   /// Index in the entry vector.
   typedef size_t EntryIndex;
@@ -130,7 +130,7 @@ class DbgValueHistoryMap {
 /// For each inlined instance of a source-level label, keep the corresponding
 /// DBG_LABEL instruction. The DBG_LABEL instruction could be used to generate
 /// a temporary (assembler) label before it.
-class DbgLabelInstrMap {
+class LLVM_CLASS_ABI DbgLabelInstrMap {
 public:
   using InlinedEntity = std::pair<const DINode *, const DILocation *>;
   using InstrMap = MapVector<InlinedEntity, const MachineInstr *>;
@@ -147,7 +147,7 @@ class DbgLabelInstrMap {
   InstrMap::const_iterator end() const { return LabelInstr.end(); }
 };
 
-void calculateDbgEntityHistory(const MachineFunction *MF,
+LLVM_FUNC_ABI void calculateDbgEntityHistory(const MachineFunction *MF,
                                const TargetRegisterInfo *TRI,
                                DbgValueHistoryMap &DbgValues,
                                DbgLabelInstrMap &DbgLabels);
diff --git a/llvm/include/llvm/CodeGen/DebugHandlerBase.h b/llvm/include/llvm/CodeGen/DebugHandlerBase.h
index 150708600ce08f2..f10e53850828bb0 100644
--- a/llvm/include/llvm/CodeGen/DebugHandlerBase.h
+++ b/llvm/include/llvm/CodeGen/DebugHandlerBase.h
@@ -29,7 +29,7 @@ class MachineInstr;
 class MachineModuleInfo;
 
 /// Represents the location at which a variable is stored.
-struct DbgVariableLocation {
+struct LLVM_CLASS_ABI DbgVariableLocation {
   /// Base register.
   unsigned Register;
 
@@ -51,7 +51,7 @@ struct DbgVariableLocation {
 
 /// Base class for debug information backends. Common functionality related to
 /// tracking which variables and scopes are alive at a given PC live here.
-class DebugHandlerBase : public AsmPrinterHandler {
+class LLVM_CLASS_ABI DebugHandlerBase : public AsmPrinterHandler {
 protected:
   DebugHandlerBase(AsmPrinter *A);
 
diff --git a/llvm/include/llvm/CodeGen/DetectDeadLanes.h b/llvm/include/llvm/CodeGen/DetectDeadLanes.h
index 713d36c0b2a180e..2cadfcb06cc30cc 100644
--- a/llvm/include/llvm/CodeGen/DetectDeadLanes.h
+++ b/llvm/include/llvm/CodeGen/DetectDeadLanes.h
@@ -40,7 +40,7 @@ class MachineOperand;
 class MachineRegisterInfo;
 class TargetRegisterInfo;
 
-class DeadLaneDetector {
+class LLVM_CLASS_ABI DeadLaneDetector {
 public:
   /// Contains a bitmask of which lanes of a given virtual register are
   /// defined and which ones are actually used.
diff --git a/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h b/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
index ba7cdd5ebb83616..419088a83af609e 100644
--- a/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
+++ b/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
@@ -18,7 +18,7 @@ namespace llvm {
 class MCSymbol;
 
 /// Data for a string pool entry.
-struct DwarfStringPoolEntry {
+struct LLVM_CLASS_ABI DwarfStringPoolEntry {
   static constexpr unsigned NotIndexed = -1;
 
   MCSymbol *Symbol = nullptr;
@@ -42,7 +42,7 @@ struct DwarfStringPoolEntry {
 /// It is recommended to use "By pointer" variant if not all entries
 /// of dwarf string pool have corresponding DwarfStringPoolEntry.
 
-class DwarfStringPoolEntryRef {
+class LLVM_CLASS_ABI DwarfStringPoolEntryRef {
   /// Pointer type for "By value" string entry.
   using ByValStringEntryPtr = const StringMapEntry<DwarfStringPoolEntry> *;
 
diff --git a/llvm/include/llvm/CodeGen/EdgeBundles.h b/llvm/include/llvm/CodeGen/EdgeBundles.h
index e1b1ab9c6d853c3..02ae8edf4892ac8 100644
--- a/llvm/include/llvm/CodeGen/EdgeBundles.h
+++ b/llvm/include/llvm/CodeGen/EdgeBundles.h
@@ -22,7 +22,7 @@
 
 namespace llvm {
 
-class EdgeBundles : public MachineFunctionPass {
+class LLVM_CLASS_ABI EdgeBundles : public MachineFunctionPass {
   const MachineFunction *MF = nullptr;
 
   /// EC - Each edge bundle is an equivalence class. The keys are:
diff --git a/llvm/include/llvm/CodeGen/ExecutionDomainFix.h b/llvm/include/llvm/CodeGen/ExecutionDomainFix.h
index c7e3d89a82565c3..d9dca02cce4f446 100644
--- a/llvm/include/llvm/CodeGen/ExecutionDomainFix.h
+++ b/llvm/include/llvm/CodeGen/ExecutionDomainFix.h
@@ -49,7 +49,7 @@ class TargetInstrInfo;
 /// domain, but if we were forced to pay the penalty of a domain crossing, we
 /// keep track of the fact that the register is now available in multiple
 /// domains.
-struct DomainValue {
+struct LLVM_CLASS_ABI DomainValue {
   /// Basic reference counting.
   unsigned Refs = 0;
 
@@ -114,7 +114,7 @@ struct DomainValue {
   }
 };
 
-class ExecutionDomainFix : public MachineFunctionPass {
+class LLVM_CLASS_ABI ExecutionDomainFix : public MachineFunctionPass {
   SpecificBumpPtrAllocator<DomainValue> Allocator;
   SmallVector<DomainValue *, 16> Avail;
 
diff --git a/llvm/include/llvm/CodeGen/ExpandReductions.h b/llvm/include/llvm/CodeGen/ExpandReductions.h
index e838d45b8daf91a..f60ff28feb5b232 100644
--- a/llvm/include/llvm/CodeGen/ExpandReductions.h
+++ b/llvm/include/llvm/CodeGen/ExpandReductions.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class ExpandReductionsPass
+class LLVM_CLASS_ABI ExpandReductionsPass
     : public PassInfoMixin<ExpandReductionsPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/CodeGen/ExpandVectorPredication.h b/llvm/include/llvm/CodeGen/ExpandVectorPredication.h
index a01f93d2d647d28..1b343e53282cbf3 100644
--- a/llvm/include/llvm/CodeGen/ExpandVectorPredication.h
+++ b/llvm/include/llvm/CodeGen/ExpandVectorPredication.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class ExpandVectorPredicationPass
+class LLVM_CLASS_ABI ExpandVectorPredicationPass
     : public PassInfoMixin<ExpandVectorPredicationPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/CodeGen/FastISel.h b/llvm/include/llvm/CodeGen/FastISel.h
index c733d782033505f..18c641fecac4f18 100644
--- a/llvm/include/llvm/CodeGen/FastISel.h
+++ b/llvm/include/llvm/CodeGen/FastISel.h
@@ -64,7 +64,7 @@ class Value;
 /// This is a fast-path instruction selection class that generates poor
 /// code and doesn't support illegal types or non-trivial lowering, but runs
 /// quickly.
-class FastISel {
+class LLVM_CLASS_ABI FastISel {
 public:
   using ArgListEntry = TargetLoweringBase::ArgListEntry;
   using ArgListTy = TargetLoweringBase::ArgListTy;
diff --git a/llvm/include/llvm/CodeGen/FaultMaps.h b/llvm/include/llvm/CodeGen/FaultMaps.h
index 4e8cb3dacb782e2..20e7829d773bda5 100644
--- a/llvm/include/llvm/CodeGen/FaultMaps.h
+++ b/llvm/include/llvm/CodeGen/FaultMaps.h
@@ -19,7 +19,7 @@ namespace llvm {
 class AsmPrinter;
 class MCExpr;
 
-class FaultMaps {
+class LLVM_CLASS_ABI FaultMaps {
 public:
   enum FaultKind {
     FaultingLoad = 1,
diff --git a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
index a40bbd1d973a782..6945d348a88d066 100644
--- a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -55,7 +55,7 @@ using UniformityInfo = GenericUniformityInfo<SSAContext>;
 /// FunctionLoweringInfo - This contains information that is global to a
 /// function that is used when lowering a region of the function.
 ///
-class FunctionLoweringInfo {
+class LLVM_CLASS_ABI FunctionLoweringInfo {
 public:
   const Function *Fn;
   MachineFunction *MF;
diff --git a/llvm/include/llvm/CodeGen/GCMetadata.h b/llvm/include/llvm/CodeGen/GCMetadata.h
index d0eafa664947eb7..bf168816edcd552 100644
--- a/llvm/include/llvm/CodeGen/GCMetadata.h
+++ b/llvm/include/llvm/CodeGen/GCMetadata.h
@@ -54,7 +54,7 @@ class MCSymbol;
 
 /// GCPoint - Metadata for a collector-safe point in machine code.
 ///
-struct GCPoint {
+struct LLVM_CLASS_ABI GCPoint {
   MCSymbol *Label;    ///< A label.
   DebugLoc Loc;
 
@@ -64,7 +64,7 @@ struct GCPoint {
 
 /// GCRoot - Metadata for a pointer to an object managed by the garbage
 /// collector.
-struct GCRoot {
+struct LLVM_CLASS_ABI GCRoot {
   int Num;                  ///< Usually a frame index.
   int StackOffset = -1;     ///< Offset from the stack pointer.
   const Constant *Metadata; ///< Metadata straight from the call
@@ -75,7 +75,7 @@ struct GCRoot {
 
 /// Garbage collection metadata for a single function.  Currently, this
 /// information only applies to GCStrategies which use GCRoot.
-class GCFunctionInfo {
+class LLVM_CLASS_ABI GCFunctionInfo {
 public:
   using iterator = std::vector<GCPoint>::iterator;
   using roots_iterator = std::vector<GCRoot>::iterator;
@@ -150,7 +150,7 @@ class GCFunctionInfo {
 /// An analysis pass which caches information about the entire Module.
 /// Records both the function level information used by GCRoots and a
 /// cache of the 'active' gc strategy objects for the current Module.
-class GCModuleInfo : public ImmutablePass {
+class LLVM_CLASS_ABI GCModuleInfo : public ImmutablePass {
   /// An owning list of all GCStrategies which have been created
   SmallVector<std::unique_ptr<GCStrategy>, 1> GCStrategyList;
   /// A helper map to speedup lookups into the above list
diff --git a/llvm/include/llvm/CodeGen/GCMetadataPrinter.h b/llvm/include/llvm/CodeGen/GCMetadataPrinter.h
index 1800b527d5ca0dc..5caa26bb08b0e38 100644
--- a/llvm/include/llvm/CodeGen/GCMetadataPrinter.h
+++ b/llvm/include/llvm/CodeGen/GCMetadataPrinter.h
@@ -37,7 +37,7 @@ using GCMetadataPrinterRegistry = Registry<GCMetadataPrinter>;
 
 /// GCMetadataPrinter - Emits GC metadata as assembly code.  Instances are
 /// created, managed, and owned by the AsmPrinter.
-class GCMetadataPrinter {
+class LLVM_CLASS_ABI GCMetadataPrinter {
 private:
   friend class AsmPrinter;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
index 38b8b89fbe3e19a..4db4befa8b73e9f 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
@@ -27,7 +27,7 @@ class MachineBasicBlock;
 /// A class that wraps MachineInstrs and derives from FoldingSetNode in order to
 /// be uniqued in a CSEMap. The tradeoff here is extra memory allocations for
 /// UniqueMachineInstr vs making MachineInstr bigger.
-class UniqueMachineInstr : public FoldingSetNode {
+class LLVM_CLASS_ABI UniqueMachineInstr : public FoldingSetNode {
   friend class GISelCSEInfo;
   const MachineInstr *MI;
   explicit UniqueMachineInstr(const MachineInstr *MI) : MI(MI) {}
@@ -37,14 +37,14 @@ class UniqueMachineInstr : public FoldingSetNode {
 };
 
 // A CSE config for fully optimized builds.
-class CSEConfigFull : public CSEConfigBase {
+class LLVM_CLASS_ABI CSEConfigFull : public CSEConfigBase {
 public:
   virtual ~CSEConfigFull() = default;
   bool shouldCSEOpc(unsigned Opc) override;
 };
 
 // Commonly used for O0 config.
-class CSEConfigConstantOnly : public CSEConfigBase {
+class LLVM_CLASS_ABI CSEConfigConstantOnly : public CSEConfigBase {
 public:
   virtual ~CSEConfigConstantOnly() = default;
   bool shouldCSEOpc(unsigned Opc) override;
@@ -54,7 +54,7 @@ class CSEConfigConstantOnly : public CSEConfigBase {
 // We have this logic here so targets can make use of it from their derived
 // TargetPassConfig, but can't put this logic into TargetPassConfig directly
 // because the CodeGen library can't depend on GlobalISel.
-std::unique_ptr<CSEConfigBase>
+LLVM_FUNC_ABI std::unique_ptr<CSEConfigBase>
 getStandardCSEConfigForOpt(CodeGenOpt::Level Level);
 
 /// The CSE Analysis object.
@@ -67,7 +67,7 @@ getStandardCSEConfigForOpt(CodeGenOpt::Level Level);
 /// CSEInfo should assert when trying to enter an incomplete instruction into
 /// the CSEMap. There is Opcode level granularity on which instructions can be
 /// CSE'd and for now, only Generic instructions are CSEable.
-class GISelCSEInfo : public GISelChangeObserver {
+class LLVM_CLASS_ABI GISelCSEInfo : public GISelChangeObserver {
   // Make it accessible only to CSEMIRBuilder.
   friend class CSEMIRBuilder;
 
@@ -167,7 +167,7 @@ class TargetRegisterClass;
 class RegisterBank;
 
 // Simple builder class to easily profile properties about MIs.
-class GISelInstProfileBuilder {
+class LLVM_CLASS_ABI GISelInstProfileBuilder {
   FoldingSetNodeID &ID;
   const MachineRegisterInfo &MRI;
 
@@ -202,7 +202,7 @@ class GISelInstProfileBuilder {
 /// 1) Lazily evaluate the MachineFunction to compute CSEable instructions.
 /// 2) Allows configuration of which instructions are CSEd through CSEConfig
 /// object. Provides a method called get which takes a CSEConfig object.
-class GISelCSEAnalysisWrapper {
+class LLVM_CLASS_ABI GISelCSEAnalysisWrapper {
   GISelCSEInfo Info;
   MachineFunction *MF = nullptr;
   bool AlreadyComputed = false;
@@ -220,7 +220,7 @@ class GISelCSEAnalysisWrapper {
 };
 
 /// The actual analysis pass wrapper.
-class GISelCSEAnalysisWrapperPass : public MachineFunctionPass {
+class LLVM_CLASS_ABI GISelCSEAnalysisWrapperPass : public MachineFunctionPass {
   GISelCSEAnalysisWrapper Wrapper;
 
 public:
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h b/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
index 0f287e44dae685d..faf940f2aae890e 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
@@ -30,7 +30,7 @@ class GISelInstProfileBuilder;
 /// assert(C->getOpcode() == TargetOpcode::COPY);
 /// Explicitly passing in a register would materialize a copy if possible.
 /// CSEMIRBuilder also does trivial constant folding for binary ops.
-class CSEMIRBuilder : public MachineIRBuilder {
+class LLVM_CLASS_ABI CSEMIRBuilder : public MachineIRBuilder {
 
   /// Returns true if A dominates B (within the same basic block).
   /// Both iterators must be in the same basic block.
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
index 1d248ca5e8b17c1..65eceb8340991f6 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
@@ -42,7 +42,7 @@ struct MachinePointerInfo;
 class MachineRegisterInfo;
 class TargetLowering;
 
-class CallLowering {
+class LLVM_CLASS_ABI CallLowering {
   const TargetLowering *TLI;
 
   virtual void anchor();
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Combiner.h b/llvm/include/llvm/CodeGen/GlobalISel/Combiner.h
index 2db32cfd3d8a2e6..64c304702d4f8c6 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Combiner.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Combiner.h
@@ -24,7 +24,7 @@ class GISelCSEInfo;
 class TargetPassConfig;
 class MachineFunction;
 
-class Combiner {
+class LLVM_CLASS_ABI Combiner {
 public:
   Combiner(CombinerInfo &CombinerInfo, const TargetPassConfig *TPC);
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
index aadda24bcbb3c7c..11410e4d5e821ac 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
@@ -48,31 +48,31 @@ class RegisterBankInfo;
 class TargetLowering;
 class TargetRegisterInfo;
 
-struct PreferredTuple {
+struct LLVM_CLASS_ABI PreferredTuple {
   LLT Ty;                // The result type of the extend.
   unsigned ExtendOpcode; // G_ANYEXT/G_SEXT/G_ZEXT
   MachineInstr *MI;
 };
 
-struct IndexedLoadStoreMatchInfo {
+struct LLVM_CLASS_ABI IndexedLoadStoreMatchInfo {
   Register Addr;
   Register Base;
   Register Offset;
   bool IsPre;
 };
 
-struct PtrAddChain {
+struct LLVM_CLASS_ABI PtrAddChain {
   int64_t Imm;
   Register Base;
   const RegisterBank *Bank;
 };
 
-struct RegisterImmPair {
+struct LLVM_CLASS_ABI RegisterImmPair {
   Register Reg;
   int64_t Imm;
 };
 
-struct ShiftOfShiftedLogic {
+struct LLVM_CLASS_ABI ShiftOfShiftedLogic {
   MachineInstr *Logic;
   MachineInstr *Shift2;
   Register LogicNonShiftReg;
@@ -83,7 +83,7 @@ using BuildFnTy = std::function<void(MachineIRBuilder &)>;
 
 using OperandBuildSteps =
     SmallVector<std::function<void(MachineInstrBuilder &)>, 4>;
-struct InstructionBuildSteps {
+struct LLVM_CLASS_ABI InstructionBuildSteps {
   unsigned Opcode = 0;          /// The opcode for the produced instruction.
   OperandBuildSteps OperandFns; /// Operands to be added to the instruction.
   InstructionBuildSteps() = default;
@@ -91,7 +91,7 @@ struct InstructionBuildSteps {
       : Opcode(Opcode), OperandFns(OperandFns) {}
 };
 
-struct InstructionStepsMatchInfo {
+struct LLVM_CLASS_ABI InstructionStepsMatchInfo {
   /// Describes instructions to be built during a combine.
   SmallVector<InstructionBuildSteps, 2> InstrsToBuild;
   InstructionStepsMatchInfo() = default;
@@ -100,7 +100,7 @@ struct InstructionStepsMatchInfo {
       : InstrsToBuild(InstrsToBuild) {}
 };
 
-class CombinerHelper {
+class LLVM_CLASS_ABI CombinerHelper {
 protected:
   MachineIRBuilder &Builder;
   MachineRegisterInfo &MRI;
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h
index 61d7cfe8a3c6517..7aa58bebf3557c3 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CombinerInfo.h
@@ -24,7 +24,7 @@ class MachineIRBuilder;
 
 // Contains information relevant to enabling/disabling various combines for a
 // pass.
-class CombinerInfo {
+class LLVM_CLASS_ABI CombinerInfo {
 public:
   CombinerInfo(bool AllowIllegalOps, bool ShouldLegalizeIllegal,
                const LegalizerInfo *LInfo, bool OptEnabled, bool OptSize,
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
index bbf653b457b5b66..0b6a252b6a6d4e6 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
@@ -59,7 +59,7 @@ class TargetRegisterInfo;
 /// definition for the predicates in use in <Target>GenGlobalISel.inc when
 /// GET_GLOBALISEL_PREDICATE_BITSET is defined.
 template <std::size_t MaxPredicates>
-class PredicateBitsetImpl : public std::bitset<MaxPredicates> {
+class LLVM_CLASS_ABI PredicateBitsetImpl : public std::bitset<MaxPredicates> {
 public:
   // Cannot inherit constructors because it's not supported by VC++..
   PredicateBitsetImpl() = default;
@@ -461,7 +461,7 @@ enum {
 /// Provides the logic to execute GlobalISel match tables, which are used by the
 /// instruction selector and instruction combiners as their engine to match and
 /// apply MIR patterns.
-class GIMatchTableExecutor {
+class LLVM_CLASS_ABI GIMatchTableExecutor {
 public:
   virtual ~GIMatchTableExecutor() = default;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h b/llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
index dba61a889729b78..25adda26c8ab0f1 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
@@ -27,7 +27,7 @@ class MachineRegisterInfo;
 /// Typically calling erasingInstr/createdInstr multiple times should not affect
 /// the result. The observer would likely need to check if it was already
 /// notified earlier (consider using GISelWorkList).
-class GISelChangeObserver {
+class LLVM_CLASS_ABI GISelChangeObserver {
   SmallPtrSet<MachineInstr *, 4> ChangingAllUsesOfReg;
 
 public:
@@ -64,7 +64,7 @@ class GISelChangeObserver {
 /// each one for each event. If there are multiple observers (say CSE,
 /// Legalizer, Combiner), it's sufficient to register this to the machine
 /// function as the delegate.
-class GISelObserverWrapper : public MachineFunction::Delegate,
+class LLVM_CLASS_ABI GISelObserverWrapper : public MachineFunction::Delegate,
                              public GISelChangeObserver {
   SmallVector<GISelChangeObserver *, 4> Observers;
 
@@ -106,7 +106,7 @@ class GISelObserverWrapper : public MachineFunction::Delegate,
 /// A simple RAII based Delegate installer.
 /// Use this in a scope to install a delegate to the MachineFunction and reset
 /// it at the end of the scope.
-class RAIIDelegateInstaller {
+class LLVM_CLASS_ABI RAIIDelegateInstaller {
   MachineFunction &MF;
   MachineFunction::Delegate *Delegate;
 
@@ -118,7 +118,7 @@ class RAIIDelegateInstaller {
 /// A simple RAII based Observer installer.
 /// Use this in a scope to install the Observer to the MachineFunction and reset
 /// it at the end of the scope.
-class RAIIMFObserverInstaller {
+class LLVM_CLASS_ABI RAIIMFObserverInstaller {
   MachineFunction &MF;
 
 public:
@@ -127,7 +127,7 @@ class RAIIMFObserverInstaller {
 };
 
 /// Class to install both of the above.
-class RAIIMFObsDelInstaller {
+class LLVM_CLASS_ABI RAIIMFObsDelInstaller {
   RAIIDelegateInstaller DelI;
   RAIIMFObserverInstaller ObsI;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h b/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
index f1de98b0c231f74..e6da61e4b45acda 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h
@@ -27,7 +27,7 @@ namespace llvm {
 class TargetLowering;
 class DataLayout;
 
-class GISelKnownBits : public GISelChangeObserver {
+class LLVM_CLASS_ABI GISelKnownBits : public GISelChangeObserver {
   MachineFunction &MF;
   MachineRegisterInfo &MRI;
   const TargetLowering &TL;
@@ -111,7 +111,7 @@ class GISelKnownBits : public GISelChangeObserver {
 /// Eventually add other features such as caching/ser/deserializing
 /// to MIR etc. Those implementations can derive from GISelKnownBits
 /// and override computeKnownBitsImpl.
-class GISelKnownBitsAnalysis : public MachineFunctionPass {
+class LLVM_CLASS_ABI GISelKnownBitsAnalysis : public MachineFunctionPass {
   std::unique_ptr<GISelKnownBits> Info;
 
 public:
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h b/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h
index 025647e583eaf40..5c76cd61faaf493 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GISelWorkList.h
@@ -25,7 +25,7 @@ class MachineInstr;
 // FIXME: Does it make sense to factor out common code with the
 // instcombinerWorkList?
 template<unsigned N>
-class GISelWorkList {
+class LLVM_CLASS_ABI GISelWorkList {
   SmallVector<MachineInstr *, N> Worklist;
   DenseMap<MachineInstr *, unsigned> WorklistMap;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h b/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
index 2cbd753554bc2a4..ad9f03a7cfb3575 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GenericMachineInstrs.h
@@ -24,7 +24,7 @@
 namespace llvm {
 
 /// A base class for all GenericMachineInstrs.
-class GenericMachineInstr : public MachineInstr {
+class LLVM_CLASS_ABI GenericMachineInstr : public MachineInstr {
 public:
   GenericMachineInstr() = delete;
 
@@ -39,7 +39,7 @@ class GenericMachineInstr : public MachineInstr {
 
 /// Represents any type of generic load or store.
 /// G_LOAD, G_STORE, G_ZEXTLOAD, G_SEXTLOAD.
-class GLoadStore : public GenericMachineInstr {
+class LLVM_CLASS_ABI GLoadStore : public GenericMachineInstr {
 public:
   /// Get the source register of the pointer value.
   Register getPointerReg() const { return getOperand(1).getReg(); }
@@ -77,7 +77,7 @@ class GLoadStore : public GenericMachineInstr {
 };
 
 /// Represents any generic load, including sign/zero extending variants.
-class GAnyLoad : public GLoadStore {
+class LLVM_CLASS_ABI GAnyLoad : public GLoadStore {
 public:
   /// Get the definition register of the loaded value.
   Register getDstReg() const { return getOperand(0).getReg(); }
@@ -95,7 +95,7 @@ class GAnyLoad : public GLoadStore {
 };
 
 /// Represents a G_LOAD.
-class GLoad : public GAnyLoad {
+class LLVM_CLASS_ABI GLoad : public GAnyLoad {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_LOAD;
@@ -103,7 +103,7 @@ class GLoad : public GAnyLoad {
 };
 
 /// Represents either a G_SEXTLOAD or G_ZEXTLOAD.
-class GExtLoad : public GAnyLoad {
+class LLVM_CLASS_ABI GExtLoad : public GAnyLoad {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_SEXTLOAD ||
@@ -112,7 +112,7 @@ class GExtLoad : public GAnyLoad {
 };
 
 /// Represents a G_SEXTLOAD.
-class GSExtLoad : public GExtLoad {
+class LLVM_CLASS_ABI GSExtLoad : public GExtLoad {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_SEXTLOAD;
@@ -120,7 +120,7 @@ class GSExtLoad : public GExtLoad {
 };
 
 /// Represents a G_ZEXTLOAD.
-class GZExtLoad : public GExtLoad {
+class LLVM_CLASS_ABI GZExtLoad : public GExtLoad {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_ZEXTLOAD;
@@ -128,7 +128,7 @@ class GZExtLoad : public GExtLoad {
 };
 
 /// Represents a G_STORE.
-class GStore : public GLoadStore {
+class LLVM_CLASS_ABI GStore : public GLoadStore {
 public:
   /// Get the stored value register.
   Register getValueReg() const { return getOperand(0).getReg(); }
@@ -139,7 +139,7 @@ class GStore : public GLoadStore {
 };
 
 /// Represents a G_UNMERGE_VALUES.
-class GUnmerge : public GenericMachineInstr {
+class LLVM_CLASS_ABI GUnmerge : public GenericMachineInstr {
 public:
   /// Returns the number of def registers.
   unsigned getNumDefs() const { return getNumOperands() - 1; }
@@ -154,7 +154,7 @@ class GUnmerge : public GenericMachineInstr {
 /// Represents G_BUILD_VECTOR, G_CONCAT_VECTORS or G_MERGE_VALUES.
 /// All these have the common property of generating a single value from
 /// multiple sources.
-class GMergeLikeInstr : public GenericMachineInstr {
+class LLVM_CLASS_ABI GMergeLikeInstr : public GenericMachineInstr {
 public:
   /// Returns the number of source registers.
   unsigned getNumSources() const { return getNumOperands() - 1; }
@@ -174,7 +174,7 @@ class GMergeLikeInstr : public GenericMachineInstr {
 };
 
 /// Represents a G_MERGE_VALUES.
-class GMerge : public GMergeLikeInstr {
+class LLVM_CLASS_ABI GMerge : public GMergeLikeInstr {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_MERGE_VALUES;
@@ -182,7 +182,7 @@ class GMerge : public GMergeLikeInstr {
 };
 
 /// Represents a G_CONCAT_VECTORS.
-class GConcatVectors : public GMergeLikeInstr {
+class LLVM_CLASS_ABI GConcatVectors : public GMergeLikeInstr {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_CONCAT_VECTORS;
@@ -190,7 +190,7 @@ class GConcatVectors : public GMergeLikeInstr {
 };
 
 /// Represents a G_BUILD_VECTOR.
-class GBuildVector : public GMergeLikeInstr {
+class LLVM_CLASS_ABI GBuildVector : public GMergeLikeInstr {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_BUILD_VECTOR;
@@ -198,7 +198,7 @@ class GBuildVector : public GMergeLikeInstr {
 };
 
 /// Represents a G_PTR_ADD.
-class GPtrAdd : public GenericMachineInstr {
+class LLVM_CLASS_ABI GPtrAdd : public GenericMachineInstr {
 public:
   Register getBaseReg() const { return getReg(1); }
   Register getOffsetReg() const { return getReg(2); }
@@ -209,7 +209,7 @@ class GPtrAdd : public GenericMachineInstr {
 };
 
 /// Represents a G_IMPLICIT_DEF.
-class GImplicitDef : public GenericMachineInstr {
+class LLVM_CLASS_ABI GImplicitDef : public GenericMachineInstr {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_IMPLICIT_DEF;
@@ -217,7 +217,7 @@ class GImplicitDef : public GenericMachineInstr {
 };
 
 /// Represents a G_SELECT.
-class GSelect : public GenericMachineInstr {
+class LLVM_CLASS_ABI GSelect : public GenericMachineInstr {
 public:
   Register getCondReg() const { return getReg(1); }
   Register getTrueReg() const { return getReg(2); }
@@ -229,7 +229,7 @@ class GSelect : public GenericMachineInstr {
 };
 
 /// Represent a G_ICMP or G_FCMP.
-class GAnyCmp : public GenericMachineInstr {
+class LLVM_CLASS_ABI GAnyCmp : public GenericMachineInstr {
 public:
   CmpInst::Predicate getCond() const {
     return static_cast<CmpInst::Predicate>(getOperand(1).getPredicate());
@@ -244,7 +244,7 @@ class GAnyCmp : public GenericMachineInstr {
 };
 
 /// Represent a G_ICMP.
-class GICmp : public GAnyCmp {
+class LLVM_CLASS_ABI GICmp : public GAnyCmp {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_ICMP;
@@ -252,7 +252,7 @@ class GICmp : public GAnyCmp {
 };
 
 /// Represent a G_FCMP.
-class GFCmp : public GAnyCmp {
+class LLVM_CLASS_ABI GFCmp : public GAnyCmp {
 public:
   static bool classof(const MachineInstr *MI) {
     return MI->getOpcode() == TargetOpcode::G_FCMP;
@@ -264,7 +264,7 @@ class GFCmp : public GAnyCmp {
 /// G_UADDO, G_SADDO, G_USUBO, G_SSUBO, G_UMULO, G_SMULO
 /// Carry-in and carry-out:
 /// G_UADDE, G_SADDE, G_USUBE, G_SSUBE
-class GBinOpCarryOut : public GenericMachineInstr {
+class LLVM_CLASS_ABI GBinOpCarryOut : public GenericMachineInstr {
 public:
   Register getDstReg() const { return getReg(0); }
   Register getCarryOutReg() const { return getReg(1); }
@@ -295,7 +295,7 @@ class GBinOpCarryOut : public GenericMachineInstr {
 /// G_UADDO, G_SADDO, G_USUBO, G_SSUBO
 /// Carry-in and carry-out:
 /// G_UADDE, G_SADDE, G_USUBE, G_SSUBE
-class GAddSubCarryOut : public GBinOpCarryOut {
+class LLVM_CLASS_ABI GAddSubCarryOut : public GBinOpCarryOut {
 public:
   bool isAdd() const {
     switch (getOpcode()) {
@@ -342,7 +342,7 @@ class GAddSubCarryOut : public GBinOpCarryOut {
 
 /// Represents overflowing add/sub operations that also consume a carry-in.
 /// G_UADDE, G_SADDE, G_USUBE, G_SSUBE
-class GAddSubCarryInOut : public GAddSubCarryOut {
+class LLVM_CLASS_ABI GAddSubCarryInOut : public GAddSubCarryOut {
 public:
   Register getCarryInReg() const { return getReg(4); }
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h b/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
index 3010fda890fcdd0..eda354e6c10da10 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/IRTranslator.h
@@ -64,7 +64,7 @@ class Value;
 // the information from the LLVM IR.
 // The idea is that ultimately we would be able to free up the memory used
 // by the LLVM IR as soon as the translation is over.
-class IRTranslator : public MachineFunctionPass {
+class LLVM_CLASS_ABI IRTranslator : public MachineFunctionPass {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h
index eb9e29000480fa4..c6d57532fea95a9 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/InlineAsmLowering.h
@@ -26,7 +26,7 @@ class Register;
 class TargetLowering;
 class Value;
 
-class InlineAsmLowering {
+class LLVM_CLASS_ABI InlineAsmLowering {
   const TargetLowering *TLI;
 
   virtual void anchor();
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h
index 7e47adaadd6df22..edb44546a71050c 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h
@@ -31,7 +31,7 @@ class ProfileSummaryInfo;
 /// reverse order.
 ///
 /// \post for all inst in MF: not isPreISelGenericOpcode(inst.opcode)
-class InstructionSelect : public MachineFunctionPass {
+class LLVM_CLASS_ABI InstructionSelect : public MachineFunctionPass {
 public:
   static char ID;
   StringRef getPassName() const override { return "InstructionSelect"; }
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
index 7b42795a675497a..db6f6b42fe839aa 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
@@ -17,7 +17,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class InstructionSelector : public GIMatchTableExecutor {
+class LLVM_CLASS_ABI InstructionSelector : public GIMatchTableExecutor {
 public:
   virtual ~InstructionSelector();
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
index f94aa70f75310bd..6082a848e452e17 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
@@ -75,13 +75,13 @@ enum LegacyLegalizeAction : std::uint8_t {
   NotFound,
 };
 } // end namespace LegacyLegalizeActions
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         LegacyLegalizeActions::LegacyLegalizeAction Action);
 
 /// Legalization is decided based on an instruction's opcode, which type slot
 /// we're considering, and what the existing type is. These aspects are gathered
 /// together for convenience in the InstrAspect class.
-struct InstrAspect {
+struct LLVM_CLASS_ABI InstrAspect {
   unsigned Opcode;
   unsigned Idx = 0;
   LLT Type;
@@ -98,7 +98,7 @@ struct InstrAspect {
 /// The result of a query. It either indicates a final answer of Legal or
 /// Unsupported or describes an action that must be taken to make an operation
 /// more legal.
-struct LegacyLegalizeActionStep {
+struct LLVM_CLASS_ABI LegacyLegalizeActionStep {
   /// The action to take or the final answer.
   LegacyLegalizeActions::LegacyLegalizeAction Action;
   /// If describing an action, the type index to change. Otherwise zero.
@@ -117,7 +117,7 @@ struct LegacyLegalizeActionStep {
 };
 
 
-class LegacyLegalizerInfo {
+class LLVM_CLASS_ABI LegacyLegalizerInfo {
 public:
   using SizeAndAction =
       std::pair<uint16_t, LegacyLegalizeActions::LegacyLegalizeAction>;
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
index b155245d75601a6..18df04ea3cbab15 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
@@ -31,7 +31,7 @@
 #define DEBUG_TYPE "legalizer"
 
 namespace llvm {
-class LegalizationArtifactCombiner {
+class LLVM_CLASS_ABI LegalizationArtifactCombiner {
   MachineIRBuilder &Builder;
   MachineRegisterInfo &MRI;
   const LegalizerInfo &LI;
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h b/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
index f6f7ada531e0e56..27e59391ed39faf 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
@@ -35,7 +35,7 @@ class MachineInstr;
 class GISelChangeObserver;
 class LostDebugLocObserver;
 
-class Legalizer : public MachineFunctionPass {
+class LLVM_CLASS_ABI Legalizer : public MachineFunctionPass {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
index b1ad61036d11fcd..9004a43c013810e 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
@@ -45,7 +45,7 @@ class GISelChangeObserver;
 class LostDebugLocObserver;
 class TargetLowering;
 
-class LegalizerHelper {
+class LLVM_CLASS_ABI LegalizerHelper {
 public:
   /// Expose MIRBuilder so clients can set their own RecordInsertInstruction
   /// functions
@@ -423,19 +423,19 @@ class LegalizerHelper {
 
 /// Helper function that creates a libcall to the given \p Name using the given
 /// calling convention \p CC.
-LegalizerHelper::LegalizeResult
+LLVM_FUNC_ABI LegalizerHelper::LegalizeResult
 createLibcall(MachineIRBuilder &MIRBuilder, const char *Name,
               const CallLowering::ArgInfo &Result,
               ArrayRef<CallLowering::ArgInfo> Args, CallingConv::ID CC);
 
 /// Helper function that creates the given libcall.
-LegalizerHelper::LegalizeResult
+LLVM_FUNC_ABI LegalizerHelper::LegalizeResult
 createLibcall(MachineIRBuilder &MIRBuilder, RTLIB::Libcall Libcall,
               const CallLowering::ArgInfo &Result,
               ArrayRef<CallLowering::ArgInfo> Args);
 
 /// Create a libcall to memcpy et al.
-LegalizerHelper::LegalizeResult
+LLVM_FUNC_ABI LegalizerHelper::LegalizeResult
 createMemLibcall(MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI,
                  MachineInstr &MI, LostDebugLocObserver &LocObserver);
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
index a6081a6aa9eb4c3..c47331c4859c14c 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
@@ -31,7 +31,7 @@
 
 namespace llvm {
 
-extern cl::opt<bool> DisableGISelLegalityCheck;
+LLVM_FUNC_ABI extern cl::opt<bool> DisableGISelLegalityCheck;
 
 class MachineFunction;
 class raw_ostream;
@@ -98,7 +98,7 @@ enum LegalizeAction : std::uint8_t {
   UseLegacyRules,
 };
 } // end namespace LegalizeActions
-raw_ostream &operator<<(raw_ostream &OS, LegalizeActions::LegalizeAction Action);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, LegalizeActions::LegalizeAction Action);
 
 using LegalizeActions::LegalizeAction;
 
@@ -106,7 +106,7 @@ using LegalizeActions::LegalizeAction;
 /// to decide whether a given operation is legal or not.
 /// For efficiency, it doesn't make a copy of Types so care must be taken not
 /// to free it before using the query.
-struct LegalityQuery {
+struct LLVM_CLASS_ABI LegalityQuery {
   unsigned Opcode;
   ArrayRef<LLT> Types;
 
@@ -140,7 +140,7 @@ struct LegalityQuery {
 /// The result of a query. It either indicates a final answer of Legal or
 /// Unsupported or describes an action that must be taken to make an operation
 /// more legal.
-struct LegalizeActionStep {
+struct LLVM_CLASS_ABI LegalizeActionStep {
   /// The action to take or the final answer.
   LegalizeAction Action;
   /// If describing an action, the type index to change. Otherwise zero.
@@ -202,7 +202,7 @@ using LegalizeMutation =
     std::function<std::pair<unsigned, LLT>(const LegalityQuery &)>;
 
 namespace LegalityPredicates {
-struct TypePairAndMemDesc {
+struct LLVM_CLASS_ABI TypePairAndMemDesc {
   LLT Type0;
   LLT Type1;
   LLT MemTy;
@@ -251,9 +251,9 @@ Predicate any(Predicate P0, Predicate P1, Args... args) {
 }
 
 /// True iff the given type index is the specified type.
-LegalityPredicate typeIs(unsigned TypeIdx, LLT TypesInit);
+LLVM_FUNC_ABI LegalityPredicate typeIs(unsigned TypeIdx, LLT TypesInit);
 /// True iff the given type index is one of the specified types.
-LegalityPredicate typeInSet(unsigned TypeIdx,
+LLVM_FUNC_ABI LegalityPredicate typeInSet(unsigned TypeIdx,
                             std::initializer_list<LLT> TypesInit);
 
 /// True iff the given type index is not the specified type.
@@ -265,133 +265,133 @@ inline LegalityPredicate typeIsNot(unsigned TypeIdx, LLT Type) {
 
 /// True iff the given types for the given pair of type indexes is one of the
 /// specified type pairs.
-LegalityPredicate
+LLVM_FUNC_ABI LegalityPredicate
 typePairInSet(unsigned TypeIdx0, unsigned TypeIdx1,
               std::initializer_list<std::pair<LLT, LLT>> TypesInit);
 /// True iff the given types for the given pair of type indexes is one of the
 /// specified type pairs.
-LegalityPredicate typePairAndMemDescInSet(
+LLVM_FUNC_ABI LegalityPredicate typePairAndMemDescInSet(
     unsigned TypeIdx0, unsigned TypeIdx1, unsigned MMOIdx,
     std::initializer_list<TypePairAndMemDesc> TypesAndMemDescInit);
 /// True iff the specified type index is a scalar.
-LegalityPredicate isScalar(unsigned TypeIdx);
+LLVM_FUNC_ABI LegalityPredicate isScalar(unsigned TypeIdx);
 /// True iff the specified type index is a vector.
-LegalityPredicate isVector(unsigned TypeIdx);
+LLVM_FUNC_ABI LegalityPredicate isVector(unsigned TypeIdx);
 /// True iff the specified type index is a pointer (with any address space).
-LegalityPredicate isPointer(unsigned TypeIdx);
+LLVM_FUNC_ABI LegalityPredicate isPointer(unsigned TypeIdx);
 /// True iff the specified type index is a pointer with the specified address
 /// space.
-LegalityPredicate isPointer(unsigned TypeIdx, unsigned AddrSpace);
+LLVM_FUNC_ABI LegalityPredicate isPointer(unsigned TypeIdx, unsigned AddrSpace);
 
 /// True if the type index is a vector with element type \p EltTy
-LegalityPredicate elementTypeIs(unsigned TypeIdx, LLT EltTy);
+LLVM_FUNC_ABI LegalityPredicate elementTypeIs(unsigned TypeIdx, LLT EltTy);
 
 /// True iff the specified type index is a scalar that's narrower than the given
 /// size.
-LegalityPredicate scalarNarrowerThan(unsigned TypeIdx, unsigned Size);
+LLVM_FUNC_ABI LegalityPredicate scalarNarrowerThan(unsigned TypeIdx, unsigned Size);
 
 /// True iff the specified type index is a scalar that's wider than the given
 /// size.
-LegalityPredicate scalarWiderThan(unsigned TypeIdx, unsigned Size);
+LLVM_FUNC_ABI LegalityPredicate scalarWiderThan(unsigned TypeIdx, unsigned Size);
 
 /// True iff the specified type index is a scalar or vector with an element type
 /// that's narrower than the given size.
-LegalityPredicate scalarOrEltNarrowerThan(unsigned TypeIdx, unsigned Size);
+LLVM_FUNC_ABI LegalityPredicate scalarOrEltNarrowerThan(unsigned TypeIdx, unsigned Size);
 
 /// True iff the specified type index is a scalar or a vector with an element
 /// type that's wider than the given size.
-LegalityPredicate scalarOrEltWiderThan(unsigned TypeIdx, unsigned Size);
+LLVM_FUNC_ABI LegalityPredicate scalarOrEltWiderThan(unsigned TypeIdx, unsigned Size);
 
 /// True iff the specified type index is a scalar whose size is not a multiple
 /// of Size.
-LegalityPredicate sizeNotMultipleOf(unsigned TypeIdx, unsigned Size);
+LLVM_FUNC_ABI LegalityPredicate sizeNotMultipleOf(unsigned TypeIdx, unsigned Size);
 
 /// True iff the specified type index is a scalar whose size is not a power of
 /// 2.
-LegalityPredicate sizeNotPow2(unsigned TypeIdx);
+LLVM_FUNC_ABI LegalityPredicate sizeNotPow2(unsigned TypeIdx);
 
 /// True iff the specified type index is a scalar or vector whose element size
 /// is not a power of 2.
-LegalityPredicate scalarOrEltSizeNotPow2(unsigned TypeIdx);
+LLVM_FUNC_ABI LegalityPredicate scalarOrEltSizeNotPow2(unsigned TypeIdx);
 
 /// True if the total bitwidth of the specified type index is \p Size bits.
-LegalityPredicate sizeIs(unsigned TypeIdx, unsigned Size);
+LLVM_FUNC_ABI LegalityPredicate sizeIs(unsigned TypeIdx, unsigned Size);
 
 /// True iff the specified type indices are both the same bit size.
-LegalityPredicate sameSize(unsigned TypeIdx0, unsigned TypeIdx1);
+LLVM_FUNC_ABI LegalityPredicate sameSize(unsigned TypeIdx0, unsigned TypeIdx1);
 
 /// True iff the first type index has a larger total bit size than second type
 /// index.
-LegalityPredicate largerThan(unsigned TypeIdx0, unsigned TypeIdx1);
+LLVM_FUNC_ABI LegalityPredicate largerThan(unsigned TypeIdx0, unsigned TypeIdx1);
 
 /// True iff the first type index has a smaller total bit size than second type
 /// index.
-LegalityPredicate smallerThan(unsigned TypeIdx0, unsigned TypeIdx1);
+LLVM_FUNC_ABI LegalityPredicate smallerThan(unsigned TypeIdx0, unsigned TypeIdx1);
 
 /// True iff the specified MMO index has a size (rounded to bytes) that is not a
 /// power of 2.
-LegalityPredicate memSizeInBytesNotPow2(unsigned MMOIdx);
+LLVM_FUNC_ABI LegalityPredicate memSizeInBytesNotPow2(unsigned MMOIdx);
 
 /// True iff the specified MMO index has a size that is not an even byte size,
 /// or that even byte size is not a power of 2.
-LegalityPredicate memSizeNotByteSizePow2(unsigned MMOIdx);
+LLVM_FUNC_ABI LegalityPredicate memSizeNotByteSizePow2(unsigned MMOIdx);
 
 /// True iff the specified type index is a vector whose element count is not a
 /// power of 2.
-LegalityPredicate numElementsNotPow2(unsigned TypeIdx);
+LLVM_FUNC_ABI LegalityPredicate numElementsNotPow2(unsigned TypeIdx);
 /// True iff the specified MMO index has at an atomic ordering of at Ordering or
 /// stronger.
-LegalityPredicate atomicOrderingAtLeastOrStrongerThan(unsigned MMOIdx,
+LLVM_FUNC_ABI LegalityPredicate atomicOrderingAtLeastOrStrongerThan(unsigned MMOIdx,
                                                       AtomicOrdering Ordering);
 } // end namespace LegalityPredicates
 
 namespace LegalizeMutations {
 /// Select this specific type for the given type index.
-LegalizeMutation changeTo(unsigned TypeIdx, LLT Ty);
+LLVM_FUNC_ABI LegalizeMutation changeTo(unsigned TypeIdx, LLT Ty);
 
 /// Keep the same type as the given type index.
-LegalizeMutation changeTo(unsigned TypeIdx, unsigned FromTypeIdx);
+LLVM_FUNC_ABI LegalizeMutation changeTo(unsigned TypeIdx, unsigned FromTypeIdx);
 
 /// Keep the same scalar or element type as the given type index.
-LegalizeMutation changeElementTo(unsigned TypeIdx, unsigned FromTypeIdx);
+LLVM_FUNC_ABI LegalizeMutation changeElementTo(unsigned TypeIdx, unsigned FromTypeIdx);
 
 /// Keep the same scalar or element type as the given type.
-LegalizeMutation changeElementTo(unsigned TypeIdx, LLT Ty);
+LLVM_FUNC_ABI LegalizeMutation changeElementTo(unsigned TypeIdx, LLT Ty);
 
 /// Keep the same scalar or element type as \p TypeIdx, but take the number of
 /// elements from \p FromTypeIdx.
-LegalizeMutation changeElementCountTo(unsigned TypeIdx, unsigned FromTypeIdx);
+LLVM_FUNC_ABI LegalizeMutation changeElementCountTo(unsigned TypeIdx, unsigned FromTypeIdx);
 
 /// Keep the same scalar or element type as \p TypeIdx, but take the number of
 /// elements from \p Ty.
-LegalizeMutation changeElementCountTo(unsigned TypeIdx, LLT Ty);
+LLVM_FUNC_ABI LegalizeMutation changeElementCountTo(unsigned TypeIdx, LLT Ty);
 
 /// Change the scalar size or element size to have the same scalar size as type
 /// index \p FromIndex. Unlike changeElementTo, this discards pointer types and
 /// only changes the size.
-LegalizeMutation changeElementSizeTo(unsigned TypeIdx, unsigned FromTypeIdx);
+LLVM_FUNC_ABI LegalizeMutation changeElementSizeTo(unsigned TypeIdx, unsigned FromTypeIdx);
 
 /// Widen the scalar type or vector element type for the given type index to the
 /// next power of 2.
-LegalizeMutation widenScalarOrEltToNextPow2(unsigned TypeIdx, unsigned Min = 0);
+LLVM_FUNC_ABI LegalizeMutation widenScalarOrEltToNextPow2(unsigned TypeIdx, unsigned Min = 0);
 
 /// Widen the scalar type or vector element type for the given type index to
 /// next multiple of \p Size.
-LegalizeMutation widenScalarOrEltToNextMultipleOf(unsigned TypeIdx,
+LLVM_FUNC_ABI LegalizeMutation widenScalarOrEltToNextMultipleOf(unsigned TypeIdx,
                                                   unsigned Size);
 
 /// Add more elements to the type for the given type index to the next power of
 /// 2.
-LegalizeMutation moreElementsToNextPow2(unsigned TypeIdx, unsigned Min = 0);
+LLVM_FUNC_ABI LegalizeMutation moreElementsToNextPow2(unsigned TypeIdx, unsigned Min = 0);
 /// Break up the vector type for the given type index into the element type.
-LegalizeMutation scalarize(unsigned TypeIdx);
+LLVM_FUNC_ABI LegalizeMutation scalarize(unsigned TypeIdx);
 } // end namespace LegalizeMutations
 
 /// A single rule in a legalizer info ruleset.
 /// The specified action is chosen when the predicate is true. Where appropriate
 /// for the action (e.g. for WidenScalar) the new type is selected using the
 /// given mutator.
-class LegalizeRule {
+class LLVM_CLASS_ABI LegalizeRule {
   LegalityPredicate Predicate;
   LegalizeAction Action;
   LegalizeMutation Mutation;
@@ -416,7 +416,7 @@ class LegalizeRule {
   }
 };
 
-class LegalizeRuleSet {
+class LLVM_CLASS_ABI LegalizeRuleSet {
   /// When non-zero, the opcode we are an alias of
   unsigned AliasOf = 0;
   /// If true, there is another opcode that aliases this one
@@ -1196,7 +1196,7 @@ class LegalizeRuleSet {
   LegalizeActionStep apply(const LegalityQuery &Query) const;
 };
 
-class LegalizerInfo {
+class LLVM_CLASS_ABI LegalizerInfo {
 public:
   virtual ~LegalizerInfo() = default;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h b/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
index 0e84c699c460e85..a2f3cd76aea8415 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
@@ -35,7 +35,7 @@ struct LegalityQuery;
 class MachineRegisterInfo;
 namespace GISelAddressing {
 /// Helper struct to store a base, index and offset that forms an address
-struct BaseIndexOffset {
+struct LLVM_CLASS_ABI BaseIndexOffset {
   Register BaseReg;
   Register IndexReg;
   int64_t Offset = 0;
@@ -43,25 +43,25 @@ struct BaseIndexOffset {
 };
 
 /// Returns a BaseIndexOffset which describes the pointer in \p Ptr.
-BaseIndexOffset getPointerInfo(Register Ptr, MachineRegisterInfo &MRI);
+LLVM_FUNC_ABI BaseIndexOffset getPointerInfo(Register Ptr, MachineRegisterInfo &MRI);
 
 /// Compute whether or not a memory access at \p MI1 aliases with an access at
 /// \p MI2 \returns true if either alias/no-alias is known. Sets \p IsAlias
 /// accordingly.
-bool aliasIsKnownForLoadStore(const MachineInstr &MI1, const MachineInstr &MI2,
+LLVM_FUNC_ABI bool aliasIsKnownForLoadStore(const MachineInstr &MI1, const MachineInstr &MI2,
                               bool &IsAlias, MachineRegisterInfo &MRI);
 
 /// Returns true if the instruction \p MI may alias \p Other.
 /// This function uses multiple strategies to detect aliasing, whereas
 /// aliasIsKnownForLoadStore just looks at the addresses of load/stores and is
 /// tries to reason about base/index/offsets.
-bool instMayAlias(const MachineInstr &MI, const MachineInstr &Other,
+LLVM_FUNC_ABI bool instMayAlias(const MachineInstr &MI, const MachineInstr &Other,
                   MachineRegisterInfo &MRI, AliasAnalysis *AA);
 } // namespace GISelAddressing
 
 using namespace GISelAddressing;
 
-class LoadStoreOpt : public MachineFunctionPass {
+class LLVM_CLASS_ABI LoadStoreOpt : public MachineFunctionPass {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h b/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h
index c5908cb1e52f5fd..6e1f4b868d3538d 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Localizer.h
@@ -41,7 +41,7 @@ class TargetTransformInfo;
 /// Moreover, it only materializes constants in blocks where they
 /// are used. PHI uses are considered happening at the end of the
 /// related predecessor.
-class Localizer : public MachineFunctionPass {
+class LLVM_CLASS_ABI Localizer : public MachineFunctionPass {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h b/llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
index a5c3bf47d304afa..cd8a4ea8afc3731 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
@@ -17,7 +17,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class LostDebugLocObserver : public GISelChangeObserver {
+class LLVM_CLASS_ABI LostDebugLocObserver : public GISelChangeObserver {
   StringRef DebugType;
   SmallSet<DebugLoc, 4> LostDebugLocs;
   SmallPtrSet<MachineInstr *, 4> PotentialMIsForDebugLocs;
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h b/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
index 63aa2b02abb056e..5f7c07a55283888 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
@@ -35,7 +35,7 @@ template <typename Pattern>
 }
 
 // TODO: Extend for N use.
-template <typename SubPatternT> struct OneUse_match {
+template <typename SubPatternT> struct LLVM_CLASS_ABI OneUse_match {
   SubPatternT SubPat;
   OneUse_match(const SubPatternT &SP) : SubPat(SP) {}
 
@@ -49,7 +49,7 @@ inline OneUse_match<SubPat> m_OneUse(const SubPat &SP) {
   return SP;
 }
 
-template <typename SubPatternT> struct OneNonDBGUse_match {
+template <typename SubPatternT> struct LLVM_CLASS_ABI OneNonDBGUse_match {
   SubPatternT SubPat;
   OneNonDBGUse_match(const SubPatternT &SP) : SubPat(SP) {}
 
@@ -79,7 +79,7 @@ inline std::optional<int64_t> matchConstant(Register Reg,
   return getIConstantVRegSExtVal(Reg, MRI);
 }
 
-template <typename ConstT> struct ConstantMatch {
+template <typename ConstT> struct LLVM_CLASS_ABI ConstantMatch {
   ConstT &CR;
   ConstantMatch(ConstT &C) : CR(C) {}
   bool match(const MachineRegisterInfo &MRI, Register Reg) {
@@ -114,7 +114,7 @@ matchConstantSplat(Register Reg, const MachineRegisterInfo &MRI) {
   return getIConstantSplatSExtVal(Reg, MRI);
 }
 
-template <typename ConstT> struct ICstOrSplatMatch {
+template <typename ConstT> struct LLVM_CLASS_ABI ICstOrSplatMatch {
   ConstT &CR;
   ICstOrSplatMatch(ConstT &C) : CR(C) {}
   bool match(const MachineRegisterInfo &MRI, Register Reg) {
@@ -140,7 +140,7 @@ inline ICstOrSplatMatch<int64_t> m_ICstOrSplat(int64_t &Cst) {
   return ICstOrSplatMatch<int64_t>(Cst);
 }
 
-struct GCstAndRegMatch {
+struct LLVM_CLASS_ABI GCstAndRegMatch {
   std::optional<ValueAndVReg> &ValReg;
   GCstAndRegMatch(std::optional<ValueAndVReg> &ValReg) : ValReg(ValReg) {}
   bool match(const MachineRegisterInfo &MRI, Register Reg) {
@@ -153,7 +153,7 @@ inline GCstAndRegMatch m_GCst(std::optional<ValueAndVReg> &ValReg) {
   return GCstAndRegMatch(ValReg);
 }
 
-struct GFCstAndRegMatch {
+struct LLVM_CLASS_ABI GFCstAndRegMatch {
   std::optional<FPValueAndVReg> &FPValReg;
   GFCstAndRegMatch(std::optional<FPValueAndVReg> &FPValReg)
       : FPValReg(FPValReg) {}
@@ -167,7 +167,7 @@ inline GFCstAndRegMatch m_GFCst(std::optional<FPValueAndVReg> &FPValReg) {
   return GFCstAndRegMatch(FPValReg);
 }
 
-struct GFCstOrSplatGFCstMatch {
+struct LLVM_CLASS_ABI GFCstOrSplatGFCstMatch {
   std::optional<FPValueAndVReg> &FPValReg;
   GFCstOrSplatGFCstMatch(std::optional<FPValueAndVReg> &FPValReg)
       : FPValReg(FPValReg) {}
@@ -183,7 +183,7 @@ m_GFCstOrSplat(std::optional<FPValueAndVReg> &FPValReg) {
 }
 
 /// Matcher for a specific constant value.
-struct SpecificConstantMatch {
+struct LLVM_CLASS_ABI SpecificConstantMatch {
   int64_t RequestedVal;
   SpecificConstantMatch(int64_t RequestedVal) : RequestedVal(RequestedVal) {}
   bool match(const MachineRegisterInfo &MRI, Register Reg) {
@@ -198,7 +198,7 @@ inline SpecificConstantMatch m_SpecificICst(int64_t RequestedValue) {
 }
 
 /// Matcher for a specific constant splat.
-struct SpecificConstantSplatMatch {
+struct LLVM_CLASS_ABI SpecificConstantSplatMatch {
   int64_t RequestedVal;
   SpecificConstantSplatMatch(int64_t RequestedVal)
       : RequestedVal(RequestedVal) {}
@@ -214,7 +214,7 @@ inline SpecificConstantSplatMatch m_SpecificICstSplat(int64_t RequestedValue) {
 }
 
 /// Matcher for a specific constant or constant splat.
-struct SpecificConstantOrSplatMatch {
+struct LLVM_CLASS_ABI SpecificConstantOrSplatMatch {
   int64_t RequestedVal;
   SpecificConstantOrSplatMatch(int64_t RequestedVal)
       : RequestedVal(RequestedVal) {}
@@ -243,7 +243,7 @@ inline SpecificConstantMatch m_AllOnesInt() {
 ///}
 
 /// Matcher for a specific register.
-struct SpecificRegisterMatch {
+struct LLVM_CLASS_ABI SpecificRegisterMatch {
   Register RequestedReg;
   SpecificRegisterMatch(Register RequestedReg) : RequestedReg(RequestedReg) {}
   bool match(const MachineRegisterInfo &MRI, Register Reg) {
@@ -261,7 +261,7 @@ inline SpecificRegisterMatch m_SpecificReg(Register RequestedReg) {
 // We might want to support taking in some MachineOperands and call getReg on
 // that.
 
-struct operand_type_match {
+struct LLVM_CLASS_ABI operand_type_match {
   bool match(const MachineRegisterInfo &MRI, Register Reg) { return true; }
   bool match(const MachineRegisterInfo &MRI, MachineOperand *MO) {
     return MO->isReg();
@@ -271,7 +271,7 @@ struct operand_type_match {
 inline operand_type_match m_Reg() { return operand_type_match(); }
 
 /// Matching combinators.
-template <typename... Preds> struct And {
+template <typename... Preds> struct LLVM_CLASS_ABI And {
   template <typename MatchSrc>
   bool match(const MachineRegisterInfo &MRI, MatchSrc &&src) {
     return true;
@@ -279,7 +279,7 @@ template <typename... Preds> struct And {
 };
 
 template <typename Pred, typename... Preds>
-struct And<Pred, Preds...> : And<Preds...> {
+struct LLVM_CLASS_ABI And<Pred, Preds...> : And<Preds...> {
   Pred P;
   And(Pred &&p, Preds &&... preds)
       : And<Preds...>(std::forward<Preds>(preds)...), P(std::forward<Pred>(p)) {
@@ -290,7 +290,7 @@ struct And<Pred, Preds...> : And<Preds...> {
   }
 };
 
-template <typename... Preds> struct Or {
+template <typename... Preds> struct LLVM_CLASS_ABI Or {
   template <typename MatchSrc>
   bool match(const MachineRegisterInfo &MRI, MatchSrc &&src) {
     return false;
@@ -298,7 +298,7 @@ template <typename... Preds> struct Or {
 };
 
 template <typename Pred, typename... Preds>
-struct Or<Pred, Preds...> : Or<Preds...> {
+struct LLVM_CLASS_ABI Or<Pred, Preds...> : Or<Preds...> {
   Pred P;
   Or(Pred &&p, Preds &&... preds)
       : Or<Preds...>(std::forward<Preds>(preds)...), P(std::forward<Pred>(p)) {}
@@ -316,14 +316,14 @@ template <typename... Preds> Or<Preds...> m_any_of(Preds &&... preds) {
   return Or<Preds...>(std::forward<Preds>(preds)...);
 }
 
-template <typename BindTy> struct bind_helper {
+template <typename BindTy> struct LLVM_CLASS_ABI bind_helper {
   static bool bind(const MachineRegisterInfo &MRI, BindTy &VR, BindTy &V) {
     VR = V;
     return true;
   }
 };
 
-template <> struct bind_helper<MachineInstr *> {
+template <> struct LLVM_CLASS_ABI bind_helper<MachineInstr *> {
   static bool bind(const MachineRegisterInfo &MRI, MachineInstr *&MI,
                    Register Reg) {
     MI = MRI.getVRegDef(Reg);
@@ -338,7 +338,7 @@ template <> struct bind_helper<MachineInstr *> {
   }
 };
 
-template <> struct bind_helper<LLT> {
+template <> struct LLVM_CLASS_ABI bind_helper<LLT> {
   static bool bind(const MachineRegisterInfo &MRI, LLT Ty, Register Reg) {
     Ty = MRI.getType(Reg);
     if (Ty.isValid())
@@ -347,7 +347,7 @@ template <> struct bind_helper<LLT> {
   }
 };
 
-template <> struct bind_helper<const ConstantFP *> {
+template <> struct LLVM_CLASS_ABI bind_helper<const ConstantFP *> {
   static bool bind(const MachineRegisterInfo &MRI, const ConstantFP *&F,
                    Register Reg) {
     F = getConstantFPVRegVal(Reg, MRI);
@@ -357,7 +357,7 @@ template <> struct bind_helper<const ConstantFP *> {
   }
 };
 
-template <typename Class> struct bind_ty {
+template <typename Class> struct LLVM_CLASS_ABI bind_ty {
   Class &VR;
 
   bind_ty(Class &V) : VR(V) {}
@@ -373,7 +373,7 @@ inline bind_ty<LLT> m_Type(LLT Ty) { return Ty; }
 inline bind_ty<CmpInst::Predicate> m_Pred(CmpInst::Predicate &P) { return P; }
 inline operand_type_match m_Pred() { return operand_type_match(); }
 
-struct ImplicitDefMatch {
+struct LLVM_CLASS_ABI ImplicitDefMatch {
   bool match(const MachineRegisterInfo &MRI, Register Reg) {
     MachineInstr *TmpMI;
     if (mi_match(Reg, MRI, m_MInstr(TmpMI)))
@@ -390,7 +390,7 @@ inline bind_ty<const ConstantFP *> m_GFCst(const ConstantFP *&C) { return C; }
 // General helper for all the binary generic MI such as G_ADD/G_SUB etc
 template <typename LHS_P, typename RHS_P, unsigned Opcode,
           bool Commutable = false>
-struct BinaryOp_match {
+struct LLVM_CLASS_ABI BinaryOp_match {
   LHS_P L;
   RHS_P R;
 
@@ -412,7 +412,7 @@ struct BinaryOp_match {
 
 // Helper for (commutative) binary generic MI that checks Opcode.
 template <typename LHS_P, typename RHS_P, bool Commutable = false>
-struct BinaryOpc_match {
+struct LLVM_CLASS_ABI BinaryOpc_match {
   unsigned Opc;
   LHS_P L;
   RHS_P R;
@@ -551,7 +551,7 @@ m_GSMin(const LHS &L, const RHS &R) {
 }
 
 // Helper for unary instructions (G_[ZSA]EXT/G_TRUNC) etc
-template <typename SrcTy, unsigned Opcode> struct UnaryOp_match {
+template <typename SrcTy, unsigned Opcode> struct LLVM_CLASS_ABI UnaryOp_match {
   SrcTy L;
 
   UnaryOp_match(const SrcTy &LHS) : L(LHS) {}
@@ -641,7 +641,7 @@ inline UnaryOp_match<SrcTy, TargetOpcode::G_FSQRT> m_GFSqrt(const SrcTy &Src) {
 // TODO: Allow checking a specific predicate.
 template <typename Pred_P, typename LHS_P, typename RHS_P, unsigned Opcode,
           bool Commutable = false>
-struct CompareOp_match {
+struct LLVM_CLASS_ABI CompareOp_match {
   Pred_P P;
   LHS_P L;
   RHS_P R;
@@ -713,7 +713,7 @@ m_c_GFCmp(const Pred &P, const LHS &L, const RHS &R) {
 }
 
 // Helper for checking if a Reg is of specific type.
-struct CheckType {
+struct LLVM_CLASS_ABI CheckType {
   LLT Ty;
   CheckType(const LLT Ty) : Ty(Ty) {}
 
@@ -725,7 +725,7 @@ struct CheckType {
 inline CheckType m_SpecificType(LLT Ty) { return Ty; }
 
 template <typename Src0Ty, typename Src1Ty, typename Src2Ty, unsigned Opcode>
-struct TernaryOp_match {
+struct LLVM_CLASS_ABI TernaryOp_match {
   Src0Ty Src0;
   Src1Ty Src1;
   Src2Ty Src2;
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h b/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
index c1e10586c136968..0be48c36f7c6b55 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
@@ -42,7 +42,7 @@ class GISelChangeObserver;
 /// Class which stores all the state required in a MachineIRBuilder.
 /// Since MachineIRBuilders will only store state in this object, it allows
 /// to transfer BuilderState between different kinds of MachineIRBuilders.
-struct MachineIRBuilderState {
+struct LLVM_CLASS_ABI MachineIRBuilderState {
   /// MachineFunction under construction.
   MachineFunction *MF = nullptr;
   /// Information used to access the description of the opcodes.
@@ -65,7 +65,7 @@ struct MachineIRBuilderState {
   GISelCSEInfo *CSEInfo = nullptr;
 };
 
-class DstOp {
+class LLVM_CLASS_ABI DstOp {
   union {
     LLT LLTTy;
     Register Reg;
@@ -126,7 +126,7 @@ class DstOp {
   DstType Ty;
 };
 
-class SrcOp {
+class LLVM_CLASS_ABI SrcOp {
   union {
     MachineInstrBuilder SrcMIB;
     Register Reg;
@@ -219,7 +219,7 @@ class SrcOp {
 /// It keeps internally the insertion point and debug location for all
 /// the new instructions we want to create.
 /// This information can be modified via the related setters.
-class MachineIRBuilder {
+class LLVM_CLASS_ABI MachineIRBuilder {
 
   MachineIRBuilderState State;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
index ccd06dccb5f19b0..6078fb18e647c42 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
@@ -89,7 +89,7 @@ class TargetRegisterInfo;
 
 /// This pass implements the reg bank selector pass used in the GlobalISel
 /// pipeline. At the end of this pass, all register operands have been assigned
-class RegBankSelect : public MachineFunctionPass {
+class LLVM_CLASS_ABI RegBankSelect : public MachineFunctionPass {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Utils.h b/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
index 616c7e511e23f42..76ec1a6ab57871d 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/Utils.h
@@ -87,7 +87,7 @@ class APFloat;
 /// create a new virtual register in the correct class.
 ///
 /// \return The virtual register constrained to the right register class.
-Register constrainRegToClass(MachineRegisterInfo &MRI,
+LLVM_FUNC_ABI Register constrainRegToClass(MachineRegisterInfo &MRI,
                              const TargetInstrInfo &TII,
                              const RegisterBankInfo &RBI, Register Reg,
                              const TargetRegisterClass &RegClass);
@@ -100,7 +100,7 @@ Register constrainRegToClass(MachineRegisterInfo &MRI,
 /// location of \p InsertPt is used for the new copy.
 ///
 /// \return The virtual register constrained to the right register class.
-Register constrainOperandRegClass(const MachineFunction &MF,
+LLVM_FUNC_ABI Register constrainOperandRegClass(const MachineFunction &MF,
                                   const TargetRegisterInfo &TRI,
                                   MachineRegisterInfo &MRI,
                                   const TargetInstrInfo &TII,
@@ -119,7 +119,7 @@ Register constrainOperandRegClass(const MachineFunction &MF,
 /// InsertPt is used for the new copy.
 ///
 /// \return The virtual register constrained to the right register class.
-Register constrainOperandRegClass(const MachineFunction &MF,
+LLVM_FUNC_ABI Register constrainOperandRegClass(const MachineFunction &MF,
                                   const TargetRegisterInfo &TRI,
                                   MachineRegisterInfo &MRI,
                                   const TargetInstrInfo &TII,
@@ -136,88 +136,88 @@ Register constrainOperandRegClass(const MachineFunction &MF,
 // FIXME: Not all instructions have the same number of operands. We should
 // probably expose a constrain helper per operand and let the target selector
 // constrain individual registers, like fast-isel.
-bool constrainSelectedInstRegOperands(MachineInstr &I,
+LLVM_FUNC_ABI bool constrainSelectedInstRegOperands(MachineInstr &I,
                                       const TargetInstrInfo &TII,
                                       const TargetRegisterInfo &TRI,
                                       const RegisterBankInfo &RBI);
 
 /// Check if DstReg can be replaced with SrcReg depending on the register
 /// constraints.
-bool canReplaceReg(Register DstReg, Register SrcReg, MachineRegisterInfo &MRI);
+LLVM_FUNC_ABI bool canReplaceReg(Register DstReg, Register SrcReg, MachineRegisterInfo &MRI);
 
 /// Check whether an instruction \p MI is dead: it only defines dead virtual
 /// registers, and doesn't have other side effects.
-bool isTriviallyDead(const MachineInstr &MI, const MachineRegisterInfo &MRI);
+LLVM_FUNC_ABI bool isTriviallyDead(const MachineInstr &MI, const MachineRegisterInfo &MRI);
 
 /// Report an ISel error as a missed optimization remark to the LLVMContext's
 /// diagnostic stream.  Set the FailedISel MachineFunction property.
-void reportGISelFailure(MachineFunction &MF, const TargetPassConfig &TPC,
+LLVM_FUNC_ABI void reportGISelFailure(MachineFunction &MF, const TargetPassConfig &TPC,
                         MachineOptimizationRemarkEmitter &MORE,
                         MachineOptimizationRemarkMissed &R);
 
-void reportGISelFailure(MachineFunction &MF, const TargetPassConfig &TPC,
+LLVM_FUNC_ABI void reportGISelFailure(MachineFunction &MF, const TargetPassConfig &TPC,
                         MachineOptimizationRemarkEmitter &MORE,
                         const char *PassName, StringRef Msg,
                         const MachineInstr &MI);
 
 /// Report an ISel warning as a missed optimization remark to the LLVMContext's
 /// diagnostic stream.
-void reportGISelWarning(MachineFunction &MF, const TargetPassConfig &TPC,
+LLVM_FUNC_ABI void reportGISelWarning(MachineFunction &MF, const TargetPassConfig &TPC,
                         MachineOptimizationRemarkEmitter &MORE,
                         MachineOptimizationRemarkMissed &R);
 
 /// If \p VReg is defined by a G_CONSTANT, return the corresponding value.
-std::optional<APInt> getIConstantVRegVal(Register VReg,
+LLVM_FUNC_ABI std::optional<APInt> getIConstantVRegVal(Register VReg,
                                          const MachineRegisterInfo &MRI);
 
 /// If \p VReg is defined by a G_CONSTANT fits in int64_t returns it.
-std::optional<int64_t> getIConstantVRegSExtVal(Register VReg,
+LLVM_FUNC_ABI std::optional<int64_t> getIConstantVRegSExtVal(Register VReg,
                                                const MachineRegisterInfo &MRI);
 
 /// Simple struct used to hold a constant integer value and a virtual
 /// register.
-struct ValueAndVReg {
+struct LLVM_CLASS_ABI ValueAndVReg {
   APInt Value;
   Register VReg;
 };
 
 /// If \p VReg is defined by a statically evaluable chain of instructions rooted
 /// on a G_CONSTANT returns its APInt value and def register.
-std::optional<ValueAndVReg>
+LLVM_FUNC_ABI std::optional<ValueAndVReg>
 getIConstantVRegValWithLookThrough(Register VReg,
                                    const MachineRegisterInfo &MRI,
                                    bool LookThroughInstrs = true);
 
 /// If \p VReg is defined by a statically evaluable chain of instructions rooted
 /// on a G_CONSTANT or G_FCONSTANT returns its value as APInt and def register.
-std::optional<ValueAndVReg> getAnyConstantVRegValWithLookThrough(
+LLVM_FUNC_ABI std::optional<ValueAndVReg> getAnyConstantVRegValWithLookThrough(
     Register VReg, const MachineRegisterInfo &MRI,
     bool LookThroughInstrs = true, bool LookThroughAnyExt = false);
 
-struct FPValueAndVReg {
+struct LLVM_CLASS_ABI FPValueAndVReg {
   APFloat Value;
   Register VReg;
 };
 
 /// If \p VReg is defined by a statically evaluable chain of instructions rooted
 /// on a G_FCONSTANT returns its APFloat value and def register.
-std::optional<FPValueAndVReg>
+LLVM_FUNC_ABI std::optional<FPValueAndVReg>
 getFConstantVRegValWithLookThrough(Register VReg,
                                    const MachineRegisterInfo &MRI,
                                    bool LookThroughInstrs = true);
 
-const ConstantFP* getConstantFPVRegVal(Register VReg,
+LLVM_FUNC_ABI const ConstantFP* getConstantFPVRegVal(Register VReg,
                                        const MachineRegisterInfo &MRI);
 
 /// See if Reg is defined by an single def instruction that is
 /// Opcode. Also try to do trivial folding if it's a COPY with
 /// same types. Returns null otherwise.
-MachineInstr *getOpcodeDef(unsigned Opcode, Register Reg,
+LLVM_FUNC_ABI MachineInstr *getOpcodeDef(unsigned Opcode, Register Reg,
                            const MachineRegisterInfo &MRI);
 
 /// Simple struct used to hold a Register value and the instruction which
 /// defines it.
-struct DefinitionAndSourceRegister {
+struct LLVM_CLASS_ABI DefinitionAndSourceRegister {
   MachineInstr *MI;
   Register Reg;
 };
@@ -226,14 +226,14 @@ struct DefinitionAndSourceRegister {
 /// away any copies.
 ///
 /// Also walks through hints such as G_ASSERT_ZEXT.
-std::optional<DefinitionAndSourceRegister>
+LLVM_FUNC_ABI std::optional<DefinitionAndSourceRegister>
 getDefSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI);
 
 /// Find the def instruction for \p Reg, folding away any trivial copies. May
 /// return nullptr if \p Reg is not a generic virtual register.
 ///
 /// Also walks through hints such as G_ASSERT_ZEXT.
-MachineInstr *getDefIgnoringCopies(Register Reg,
+LLVM_FUNC_ABI MachineInstr *getDefIgnoringCopies(Register Reg,
                                    const MachineRegisterInfo &MRI);
 
 /// Find the source register for \p Reg, folding away any trivial copies. It
@@ -242,7 +242,7 @@ MachineInstr *getDefIgnoringCopies(Register Reg,
 /// register.
 ///
 /// Also walks through hints such as G_ASSERT_ZEXT.
-Register getSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI);
+LLVM_FUNC_ABI Register getSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI);
 
 // Templated variant of getOpcodeDef returning a MachineInstr derived T.
 /// See if Reg is defined by an single def instruction of type T
@@ -255,47 +255,47 @@ T *getOpcodeDef(Register Reg, const MachineRegisterInfo &MRI) {
 }
 
 /// Returns an APFloat from Val converted to the appropriate size.
-APFloat getAPFloatFromSize(double Val, unsigned Size);
+LLVM_FUNC_ABI APFloat getAPFloatFromSize(double Val, unsigned Size);
 
 /// Modify analysis usage so it preserves passes required for the SelectionDAG
 /// fallback.
-void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU);
+LLVM_FUNC_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU);
 
-std::optional<APInt> ConstantFoldBinOp(unsigned Opcode, const Register Op1,
+LLVM_FUNC_ABI std::optional<APInt> ConstantFoldBinOp(unsigned Opcode, const Register Op1,
                                        const Register Op2,
                                        const MachineRegisterInfo &MRI);
-std::optional<APFloat> ConstantFoldFPBinOp(unsigned Opcode, const Register Op1,
+LLVM_FUNC_ABI std::optional<APFloat> ConstantFoldFPBinOp(unsigned Opcode, const Register Op1,
                                            const Register Op2,
                                            const MachineRegisterInfo &MRI);
 
 /// Tries to constant fold a vector binop with sources \p Op1 and \p Op2.
 /// Returns an empty vector on failure.
-SmallVector<APInt> ConstantFoldVectorBinop(unsigned Opcode, const Register Op1,
+LLVM_FUNC_ABI SmallVector<APInt> ConstantFoldVectorBinop(unsigned Opcode, const Register Op1,
                                            const Register Op2,
                                            const MachineRegisterInfo &MRI);
 
-std::optional<APInt> ConstantFoldExtOp(unsigned Opcode, const Register Op1,
+LLVM_FUNC_ABI std::optional<APInt> ConstantFoldExtOp(unsigned Opcode, const Register Op1,
                                        uint64_t Imm,
                                        const MachineRegisterInfo &MRI);
 
-std::optional<APFloat> ConstantFoldIntToFloat(unsigned Opcode, LLT DstTy,
+LLVM_FUNC_ABI std::optional<APFloat> ConstantFoldIntToFloat(unsigned Opcode, LLT DstTy,
                                               Register Src,
                                               const MachineRegisterInfo &MRI);
 
 /// Tries to constant fold a G_CTLZ operation on \p Src. If \p Src is a vector
 /// then it tries to do an element-wise constant fold.
-std::optional<SmallVector<unsigned>>
+LLVM_FUNC_ABI std::optional<SmallVector<unsigned>>
 ConstantFoldCTLZ(Register Src, const MachineRegisterInfo &MRI);
 
 /// Test if the given value is known to have exactly one bit set. This differs
 /// from computeKnownBits in that it doesn't necessarily determine which bit is
 /// set.
-bool isKnownToBeAPowerOfTwo(Register Val, const MachineRegisterInfo &MRI,
+LLVM_FUNC_ABI bool isKnownToBeAPowerOfTwo(Register Val, const MachineRegisterInfo &MRI,
                             GISelKnownBits *KnownBits = nullptr);
 
 /// Returns true if \p Val can be assumed to never be a NaN. If \p SNaN is true,
 /// this returns if \p Val can be assumed to never be a signaling NaN.
-bool isKnownNeverNaN(Register Val, const MachineRegisterInfo &MRI,
+LLVM_FUNC_ABI bool isKnownNeverNaN(Register Val, const MachineRegisterInfo &MRI,
                      bool SNaN = false);
 
 /// Returns true if \p Val can be assumed to never be a signaling NaN.
@@ -303,7 +303,7 @@ inline bool isKnownNeverSNaN(Register Val, const MachineRegisterInfo &MRI) {
   return isKnownNeverNaN(Val, MRI, true);
 }
 
-Align inferAlignFromPtrInfo(MachineFunction &MF, const MachinePointerInfo &MPO);
+LLVM_FUNC_ABI Align inferAlignFromPtrInfo(MachineFunction &MF, const MachinePointerInfo &MPO);
 
 /// Return a virtual register corresponding to the incoming argument register \p
 /// PhysReg. This register is expected to have class \p RC, and optional type \p
@@ -311,7 +311,7 @@ Align inferAlignFromPtrInfo(MachineFunction &MF, const MachinePointerInfo &MPO);
 ///
 /// If there is an existing live-in argument register, it will be returned.
 /// This will also ensure there is a valid copy
-Register getFunctionLiveInPhysReg(MachineFunction &MF,
+LLVM_FUNC_ABI Register getFunctionLiveInPhysReg(MachineFunction &MF,
                                   const TargetInstrInfo &TII,
                                   MCRegister PhysReg,
                                   const TargetRegisterClass &RC,
@@ -321,10 +321,10 @@ Register getFunctionLiveInPhysReg(MachineFunction &MF,
 /// number of vector elements or scalar bitwidth. The intent is a
 /// G_MERGE_VALUES, G_BUILD_VECTOR, or G_CONCAT_VECTORS can be constructed from
 /// \p OrigTy elements, and unmerged into \p TargetTy
-LLVM_READNONE
+LLVM_FUNC_ABI LLVM_READNONE
 LLT getLCMType(LLT OrigTy, LLT TargetTy);
 
-LLVM_READNONE
+LLVM_FUNC_ABI LLVM_READNONE
 /// Return smallest type that covers both \p OrigTy and \p TargetTy and is
 /// multiple of TargetTy.
 LLT getCoverTy(LLT OrigTy, LLT TargetTy);
@@ -342,7 +342,7 @@ LLT getCoverTy(LLT OrigTy, LLT TargetTy);
 /// original vector elements.
 ///
 /// In the worst case, this returns LLT::scalar(1)
-LLVM_READNONE
+LLVM_FUNC_ABI LLVM_READNONE
 LLT getGCDType(LLT OrigTy, LLT TargetTy);
 
 /// Represents a value which can be a Register or a constant.
@@ -350,7 +350,7 @@ LLT getGCDType(LLT OrigTy, LLT TargetTy);
 /// This is useful in situations where an instruction may have an interesting
 /// register operand or interesting constant operand. For a concrete example,
 /// \see getVectorSplat.
-class RegOrConstant {
+class LLVM_CLASS_ABI RegOrConstant {
   int64_t Cst;
   Register Reg;
   bool IsReg;
@@ -372,53 +372,53 @@ class RegOrConstant {
 
 /// \returns The splat index of a G_SHUFFLE_VECTOR \p MI when \p MI is a splat.
 /// If \p MI is not a splat, returns std::nullopt.
-std::optional<int> getSplatIndex(MachineInstr &MI);
+LLVM_FUNC_ABI std::optional<int> getSplatIndex(MachineInstr &MI);
 
 /// \returns the scalar integral splat value of \p Reg if possible.
-std::optional<APInt> getIConstantSplatVal(const Register Reg,
+LLVM_FUNC_ABI std::optional<APInt> getIConstantSplatVal(const Register Reg,
                                           const MachineRegisterInfo &MRI);
 
 /// \returns the scalar integral splat value defined by \p MI if possible.
-std::optional<APInt> getIConstantSplatVal(const MachineInstr &MI,
+LLVM_FUNC_ABI std::optional<APInt> getIConstantSplatVal(const MachineInstr &MI,
                                           const MachineRegisterInfo &MRI);
 
 /// \returns the scalar sign extended integral splat value of \p Reg if
 /// possible.
-std::optional<int64_t> getIConstantSplatSExtVal(const Register Reg,
+LLVM_FUNC_ABI std::optional<int64_t> getIConstantSplatSExtVal(const Register Reg,
                                                 const MachineRegisterInfo &MRI);
 
 /// \returns the scalar sign extended integral splat value defined by \p MI if
 /// possible.
-std::optional<int64_t> getIConstantSplatSExtVal(const MachineInstr &MI,
+LLVM_FUNC_ABI std::optional<int64_t> getIConstantSplatSExtVal(const MachineInstr &MI,
                                                 const MachineRegisterInfo &MRI);
 
 /// Returns a floating point scalar constant of a build vector splat if it
 /// exists. When \p AllowUndef == true some elements can be undef but not all.
-std::optional<FPValueAndVReg> getFConstantSplat(Register VReg,
+LLVM_FUNC_ABI std::optional<FPValueAndVReg> getFConstantSplat(Register VReg,
                                                 const MachineRegisterInfo &MRI,
                                                 bool AllowUndef = true);
 
 /// Return true if the specified register is defined by G_BUILD_VECTOR or
 /// G_BUILD_VECTOR_TRUNC where all of the elements are \p SplatValue or undef.
-bool isBuildVectorConstantSplat(const Register Reg,
+LLVM_FUNC_ABI bool isBuildVectorConstantSplat(const Register Reg,
                                 const MachineRegisterInfo &MRI,
                                 int64_t SplatValue, bool AllowUndef);
 
 /// Return true if the specified instruction is a G_BUILD_VECTOR or
 /// G_BUILD_VECTOR_TRUNC where all of the elements are \p SplatValue or undef.
-bool isBuildVectorConstantSplat(const MachineInstr &MI,
+LLVM_FUNC_ABI bool isBuildVectorConstantSplat(const MachineInstr &MI,
                                 const MachineRegisterInfo &MRI,
                                 int64_t SplatValue, bool AllowUndef);
 
 /// Return true if the specified instruction is a G_BUILD_VECTOR or
 /// G_BUILD_VECTOR_TRUNC where all of the elements are 0 or undef.
-bool isBuildVectorAllZeros(const MachineInstr &MI,
+LLVM_FUNC_ABI bool isBuildVectorAllZeros(const MachineInstr &MI,
                            const MachineRegisterInfo &MRI,
                            bool AllowUndef = false);
 
 /// Return true if the specified instruction is a G_BUILD_VECTOR or
 /// G_BUILD_VECTOR_TRUNC where all of the elements are ~0 or undef.
-bool isBuildVectorAllOnes(const MachineInstr &MI,
+LLVM_FUNC_ABI bool isBuildVectorAllOnes(const MachineInstr &MI,
                           const MachineRegisterInfo &MRI,
                           bool AllowUndef = false);
 
@@ -428,7 +428,7 @@ bool isBuildVectorAllOnes(const MachineInstr &MI,
 /// If \p AllowFP is true, this will consider G_FCONSTANT in addition to
 /// G_CONSTANT. If \p AllowOpaqueConstants is true, constant-like instructions
 /// such as G_GLOBAL_VALUE will also be considered.
-bool isConstantOrConstantVector(const MachineInstr &MI,
+LLVM_FUNC_ABI bool isConstantOrConstantVector(const MachineInstr &MI,
                                 const MachineRegisterInfo &MRI,
                                 bool AllowFP = true,
                                 bool AllowOpaqueConstants = true);
@@ -437,12 +437,12 @@ bool isConstantOrConstantVector(const MachineInstr &MI,
 /// constant 0 integer (with no undefs if \p AllowUndefs is false). This will
 /// handle G_BUILD_VECTOR and G_BUILD_VECTOR_TRUNC as truncation is not an issue
 /// for null values.
-bool isNullOrNullSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI,
+LLVM_FUNC_ABI bool isNullOrNullSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI,
                        bool AllowUndefs = false);
 
 /// Return true if the value is a constant -1 integer or a splatted vector of a
 /// constant -1 integer (with no undefs if \p AllowUndefs is false).
-bool isAllOnesOrAllOnesSplat(const MachineInstr &MI,
+LLVM_FUNC_ABI bool isAllOnesOrAllOnesSplat(const MachineInstr &MI,
                              const MachineRegisterInfo &MRI,
                              bool AllowUndefs = false);
 
@@ -465,57 +465,57 @@ bool isAllOnesOrAllOnesSplat(const MachineInstr &MI,
 /// \endcode
 ///
 /// In the above case, this will return a RegOrConstant containing 4.
-std::optional<RegOrConstant> getVectorSplat(const MachineInstr &MI,
+LLVM_FUNC_ABI std::optional<RegOrConstant> getVectorSplat(const MachineInstr &MI,
                                             const MachineRegisterInfo &MRI);
 
 /// Determines if \p MI defines a constant integer or a build vector of
 /// constant integers. Treats undef values as constants.
-bool isConstantOrConstantVector(MachineInstr &MI,
+LLVM_FUNC_ABI bool isConstantOrConstantVector(MachineInstr &MI,
                                 const MachineRegisterInfo &MRI);
 
 /// Determines if \p MI defines a constant integer or a splat vector of
 /// constant integers.
 /// \returns the scalar constant or std::nullopt.
-std::optional<APInt>
+LLVM_FUNC_ABI std::optional<APInt>
 isConstantOrConstantSplatVector(MachineInstr &MI,
                                 const MachineRegisterInfo &MRI);
 
 /// Attempt to match a unary predicate against a scalar/splat constant or every
 /// element of a constant G_BUILD_VECTOR. If \p ConstVal is null, the source
 /// value was undef.
-bool matchUnaryPredicate(const MachineRegisterInfo &MRI, Register Reg,
+LLVM_FUNC_ABI bool matchUnaryPredicate(const MachineRegisterInfo &MRI, Register Reg,
                          std::function<bool(const Constant *ConstVal)> Match,
                          bool AllowUndefs = false);
 
 /// Returns true if given the TargetLowering's boolean contents information,
 /// the value \p Val contains a true value.
-bool isConstTrueVal(const TargetLowering &TLI, int64_t Val, bool IsVector,
+LLVM_FUNC_ABI bool isConstTrueVal(const TargetLowering &TLI, int64_t Val, bool IsVector,
                     bool IsFP);
 /// \returns true if given the TargetLowering's boolean contents information,
 /// the value \p Val contains a false value.
-bool isConstFalseVal(const TargetLowering &TLI, int64_t Val, bool IsVector,
+LLVM_FUNC_ABI bool isConstFalseVal(const TargetLowering &TLI, int64_t Val, bool IsVector,
                     bool IsFP);
 
 /// Returns an integer representing true, as defined by the
 /// TargetBooleanContents.
-int64_t getICmpTrueVal(const TargetLowering &TLI, bool IsVector, bool IsFP);
+LLVM_FUNC_ABI int64_t getICmpTrueVal(const TargetLowering &TLI, bool IsVector, bool IsFP);
 
 /// Returns true if the given block should be optimized for size.
-bool shouldOptForSize(const MachineBasicBlock &MBB, ProfileSummaryInfo *PSI,
+LLVM_FUNC_ABI bool shouldOptForSize(const MachineBasicBlock &MBB, ProfileSummaryInfo *PSI,
                       BlockFrequencyInfo *BFI);
 
 using SmallInstListTy = GISelWorkList<4>;
-void saveUsesAndErase(MachineInstr &MI, MachineRegisterInfo &MRI,
+LLVM_FUNC_ABI void saveUsesAndErase(MachineInstr &MI, MachineRegisterInfo &MRI,
                       LostDebugLocObserver *LocObserver,
                       SmallInstListTy &DeadInstChain);
-void eraseInstrs(ArrayRef<MachineInstr *> DeadInstrs, MachineRegisterInfo &MRI,
+LLVM_FUNC_ABI void eraseInstrs(ArrayRef<MachineInstr *> DeadInstrs, MachineRegisterInfo &MRI,
                  LostDebugLocObserver *LocObserver = nullptr);
-void eraseInstr(MachineInstr &MI, MachineRegisterInfo &MRI,
+LLVM_FUNC_ABI void eraseInstr(MachineInstr &MI, MachineRegisterInfo &MRI,
                 LostDebugLocObserver *LocObserver = nullptr);
 
 /// Assuming the instruction \p MI is going to be deleted, attempt to salvage
 /// debug users of \p MI by writing the effect of \p MI in a DIExpression.
-void salvageDebugInfo(const MachineRegisterInfo &MRI, MachineInstr &MI);
+LLVM_FUNC_ABI void salvageDebugInfo(const MachineRegisterInfo &MRI, MachineInstr &MI);
 
 } // End namespace llvm.
 #endif
diff --git a/llvm/include/llvm/CodeGen/HardwareLoops.h b/llvm/include/llvm/CodeGen/HardwareLoops.h
index 809f1725d6144be..6edd3b87980d0b4 100644
--- a/llvm/include/llvm/CodeGen/HardwareLoops.h
+++ b/llvm/include/llvm/CodeGen/HardwareLoops.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-struct HardwareLoopOptions {
+struct LLVM_CLASS_ABI HardwareLoopOptions {
   std::optional<unsigned> Decrement;
   std::optional<unsigned> Bitwidth;
   std::optional<bool> Force;
@@ -62,7 +62,7 @@ struct HardwareLoopOptions {
   }
 };
 
-class HardwareLoopsPass : public PassInfoMixin<HardwareLoopsPass> {
+class LLVM_CLASS_ABI HardwareLoopsPass : public PassInfoMixin<HardwareLoopsPass> {
   HardwareLoopOptions Opts;
 
 public:
diff --git a/llvm/include/llvm/CodeGen/ISDOpcodes.h b/llvm/include/llvm/CodeGen/ISDOpcodes.h
index 5e7fca70b91c924..6ec90757696219a 100644
--- a/llvm/include/llvm/CodeGen/ISDOpcodes.h
+++ b/llvm/include/llvm/CodeGen/ISDOpcodes.h
@@ -1380,28 +1380,28 @@ inline bool isBitwiseLogicOp(unsigned Opcode) {
 
 /// Get underlying scalar opcode for VECREDUCE opcode.
 /// For example ISD::AND for ISD::VECREDUCE_AND.
-NodeType getVecReduceBaseOpcode(unsigned VecReduceOpcode);
+LLVM_FUNC_ABI NodeType getVecReduceBaseOpcode(unsigned VecReduceOpcode);
 
 /// Whether this is a vector-predicated Opcode.
-bool isVPOpcode(unsigned Opcode);
+LLVM_FUNC_ABI bool isVPOpcode(unsigned Opcode);
 
 /// Whether this is a vector-predicated binary operation opcode.
-bool isVPBinaryOp(unsigned Opcode);
+LLVM_FUNC_ABI bool isVPBinaryOp(unsigned Opcode);
 
 /// Whether this is a vector-predicated reduction opcode.
-bool isVPReduction(unsigned Opcode);
+LLVM_FUNC_ABI bool isVPReduction(unsigned Opcode);
 
 /// The operand position of the vector mask.
-std::optional<unsigned> getVPMaskIdx(unsigned Opcode);
+LLVM_FUNC_ABI std::optional<unsigned> getVPMaskIdx(unsigned Opcode);
 
 /// The operand position of the explicit vector length parameter.
-std::optional<unsigned> getVPExplicitVectorLengthIdx(unsigned Opcode);
+LLVM_FUNC_ABI std::optional<unsigned> getVPExplicitVectorLengthIdx(unsigned Opcode);
 
 /// Translate this VP Opcode to its corresponding non-VP Opcode.
-std::optional<unsigned> getBaseOpcodeForVP(unsigned Opcode, bool hasFPExcept);
+LLVM_FUNC_ABI std::optional<unsigned> getBaseOpcodeForVP(unsigned Opcode, bool hasFPExcept);
 
 /// Translate this non-VP Opcode to its corresponding VP Opcode.
-unsigned getVPForBaseOpcode(unsigned Opcode);
+LLVM_FUNC_ABI unsigned getVPForBaseOpcode(unsigned Opcode);
 
 //===--------------------------------------------------------------------===//
 /// MemIndexedMode enum - This enum defines the load / store indexed
@@ -1466,7 +1466,7 @@ enum LoadExtType { NON_EXTLOAD = 0, EXTLOAD, SEXTLOAD, ZEXTLOAD };
 
 static const int LAST_LOADEXT_TYPE = ZEXTLOAD + 1;
 
-NodeType getExtForLoadExtType(bool IsFP, LoadExtType);
+LLVM_FUNC_ABI NodeType getExtForLoadExtType(bool IsFP, LoadExtType);
 
 //===--------------------------------------------------------------------===//
 /// ISD::CondCode enum - These are ordered carefully to make the bitfields
@@ -1545,7 +1545,7 @@ inline unsigned getUnorderedFlavor(CondCode Cond) {
 
 /// Return the operation corresponding to !(X op Y), where 'op' is a valid
 /// SetCC operation.
-CondCode getSetCCInverse(CondCode Operation, EVT Type);
+LLVM_FUNC_ABI CondCode getSetCCInverse(CondCode Operation, EVT Type);
 
 inline bool isExtOpcode(unsigned Opcode) {
   return Opcode == ISD::ANY_EXTEND || Opcode == ISD::ZERO_EXTEND ||
@@ -1565,22 +1565,22 @@ namespace GlobalISel {
 /// this distinction. As such we need to be told whether the comparison is
 /// floating point or integer-like. Pointers should use integer-like
 /// comparisons.
-CondCode getSetCCInverse(CondCode Operation, bool isIntegerLike);
+LLVM_FUNC_ABI CondCode getSetCCInverse(CondCode Operation, bool isIntegerLike);
 } // end namespace GlobalISel
 
 /// Return the operation corresponding to (Y op X) when given the operation
 /// for (X op Y).
-CondCode getSetCCSwappedOperands(CondCode Operation);
+LLVM_FUNC_ABI CondCode getSetCCSwappedOperands(CondCode Operation);
 
 /// Return the result of a logical OR between different comparisons of
 /// identical values: ((X op1 Y) | (X op2 Y)). This function returns
 /// SETCC_INVALID if it is not possible to represent the resultant comparison.
-CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, EVT Type);
+LLVM_FUNC_ABI CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, EVT Type);
 
 /// Return the result of a logical AND between different comparisons of
 /// identical values: ((X op1 Y) & (X op2 Y)). This function returns
 /// SETCC_INVALID if it is not possible to represent the resultant comparison.
-CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, EVT Type);
+LLVM_FUNC_ABI CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, EVT Type);
 
 } // namespace ISD
 
diff --git a/llvm/include/llvm/CodeGen/IndirectThunks.h b/llvm/include/llvm/CodeGen/IndirectThunks.h
index d1b4be89851dd2c..0c1660669e1a2ff 100644
--- a/llvm/include/llvm/CodeGen/IndirectThunks.h
+++ b/llvm/include/llvm/CodeGen/IndirectThunks.h
@@ -23,7 +23,7 @@
 namespace llvm {
 
 template <typename Derived, typename InsertedThunksTy = bool>
-class ThunkInserter {
+class LLVM_CLASS_ABI ThunkInserter {
   Derived &getDerived() { return *static_cast<Derived *>(this); }
 
 protected:
diff --git a/llvm/include/llvm/CodeGen/IntrinsicLowering.h b/llvm/include/llvm/CodeGen/IntrinsicLowering.h
index f3213b6639568b7..56cfbc1451d0643 100644
--- a/llvm/include/llvm/CodeGen/IntrinsicLowering.h
+++ b/llvm/include/llvm/CodeGen/IntrinsicLowering.h
@@ -21,7 +21,7 @@ namespace llvm {
 class CallInst;
 class DataLayout;
 
-class IntrinsicLowering {
+class LLVM_CLASS_ABI IntrinsicLowering {
   const DataLayout &DL;
 
   bool Warned = false;
diff --git a/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h b/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
index c155af901e7b3c1..96c2ebce8a3eb1d 100644
--- a/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
+++ b/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h
@@ -23,14 +23,14 @@ namespace llvm {
   class LatencyPriorityQueue;
 
   /// Sorting functions for the Available queue.
-  struct latency_sort {
+  struct LLVM_CLASS_ABI latency_sort {
     LatencyPriorityQueue *PQ;
     explicit latency_sort(LatencyPriorityQueue *pq) : PQ(pq) {}
 
     bool operator()(const SUnit* LHS, const SUnit* RHS) const;
   };
 
-  class LatencyPriorityQueue : public SchedulingPriorityQueue {
+  class LLVM_CLASS_ABI LatencyPriorityQueue : public SchedulingPriorityQueue {
     // SUnits - The SUnits for the current graph.
     std::vector<SUnit> *SUnits = nullptr;
 
diff --git a/llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h b/llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h
index b8c0b72f0c1dfe2..07ea841d15f8c4c 100644
--- a/llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h
+++ b/llvm/include/llvm/CodeGen/LazyMachineBlockFrequencyInfo.h
@@ -35,7 +35,7 @@ namespace llvm {
 /// Note that it is expected that we wouldn't need this functionality for the
 /// new PM since with the new PM, analyses are executed on demand.
 
-class LazyMachineBlockFrequencyInfoPass : public MachineFunctionPass {
+class LLVM_CLASS_ABI LazyMachineBlockFrequencyInfoPass : public MachineFunctionPass {
 private:
   /// If generated on the fly this own the instance.
   mutable std::unique_ptr<MachineBlockFrequencyInfo> OwnedMBFI;
diff --git a/llvm/include/llvm/CodeGen/LexicalScopes.h b/llvm/include/llvm/CodeGen/LexicalScopes.h
index 13fd9b30172bffc..a810f2da1d331b4 100644
--- a/llvm/include/llvm/CodeGen/LexicalScopes.h
+++ b/llvm/include/llvm/CodeGen/LexicalScopes.h
@@ -42,7 +42,7 @@ using InsnRange = std::pair<const MachineInstr *, const MachineInstr *>;
 //===----------------------------------------------------------------------===//
 /// LexicalScope - This class is used to track scope information.
 ///
-class LexicalScope {
+class LLVM_CLASS_ABI LexicalScope {
 public:
   LexicalScope(LexicalScope *P, const DILocalScope *D, const DILocation *I,
                bool A)
@@ -139,7 +139,7 @@ class LexicalScope {
 /// LexicalScopes -  This class provides interface to collect and use lexical
 /// scoping information from machine instruction.
 ///
-class LexicalScopes {
+class LLVM_CLASS_ABI LexicalScopes {
 public:
   LexicalScopes() = default;
 
diff --git a/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h b/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h
index c22f9d49f374b7f..fff2f6e19262424 100644
--- a/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h
+++ b/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h
@@ -18,7 +18,7 @@
 #include <cstdlib>
 
 namespace {
-  struct ForceAsmWriterLinking {
+  struct LLVM_CLASS_ABI ForceAsmWriterLinking {
     ForceAsmWriterLinking() {
       // We must reference the plug-ins in such a way that compilers will not
       // delete it all as dead code, even with whole program optimization,
diff --git a/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h b/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h
index 565d1c36d300141..329163773fd7fec 100644
--- a/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h
+++ b/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h
@@ -20,7 +20,7 @@
 #include <cstdlib>
 
 namespace {
-  struct ForceCodegenLinking {
+  struct LLVM_CLASS_ABI ForceCodegenLinking {
     ForceCodegenLinking() {
       // We must reference the passes in such a way that compilers will not
       // delete it all as dead code, even with whole program optimization,
diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h
index a1d08cfb2212c39..e3e429517aafac6 100644
--- a/llvm/include/llvm/CodeGen/LiveInterval.h
+++ b/llvm/include/llvm/CodeGen/LiveInterval.h
@@ -51,7 +51,7 @@ namespace llvm {
   /// This class holds information about a machine level values, including
   /// definition and use points.
   ///
-  class VNInfo {
+  class LLVM_CLASS_ABI VNInfo {
   public:
     using Allocator = BumpPtrAllocator;
 
@@ -88,7 +88,7 @@ namespace llvm {
   /// Result of a LiveRange query. This class hides the implementation details
   /// of live ranges, and it should be used as the primary interface for
   /// examining live ranges around instructions.
-  class LiveQueryResult {
+  class LLVM_CLASS_ABI LiveQueryResult {
     VNInfo *const EarlyVal;
     VNInfo *const LateVal;
     const SlotIndex EndPoint;
@@ -155,7 +155,7 @@ namespace llvm {
   /// The Segments are organized in a static single assignment form: At places
   /// where a new value is defined or different values reach a CFG join a new
   /// segment with a new value number is used.
-  class LiveRange {
+  class LLVM_CLASS_ABI LiveRange {
   public:
     /// This represents a simple continuous liveness interval for a value.
     /// The start point is inclusive, the end point exclusive. These intervals
@@ -684,7 +684,7 @@ namespace llvm {
 
   /// LiveInterval - This class represents the liveness of a register,
   /// or stack slot.
-  class LiveInterval : public LiveRange {
+  class LLVM_CLASS_ABI LiveInterval : public LiveRange {
   public:
     using super = LiveRange;
 
@@ -914,7 +914,7 @@ namespace llvm {
     return OS;
   }
 
-  raw_ostream &operator<<(raw_ostream &OS, const LiveRange::Segment &S);
+  LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const LiveRange::Segment &S);
 
   inline bool operator<(SlotIndex V, const LiveRange::Segment &S) {
     return V < S.start;
@@ -932,7 +932,7 @@ namespace llvm {
   /// many segments in order.
   ///
   /// The LiveRange will be in an invalid state until flush() is called.
-  class LiveRangeUpdater {
+  class LLVM_CLASS_ABI LiveRangeUpdater {
     LiveRange *LR;
     SlotIndex LastStart;
     LiveRange::iterator WriteI;
@@ -996,7 +996,7 @@ namespace llvm {
   ///     ConEQ.Distribute(LIS);
   /// }
 
-  class ConnectedVNInfoEqClasses {
+  class LLVM_CLASS_ABI ConnectedVNInfoEqClasses {
     LiveIntervals &LIS;
     IntEqClasses EqClass;
 
diff --git a/llvm/include/llvm/CodeGen/LiveIntervalCalc.h b/llvm/include/llvm/CodeGen/LiveIntervalCalc.h
index 7750ce1b0bb51c5..a3661627dd5479b 100644
--- a/llvm/include/llvm/CodeGen/LiveIntervalCalc.h
+++ b/llvm/include/llvm/CodeGen/LiveIntervalCalc.h
@@ -26,7 +26,7 @@ template <class NodeT> class DomTreeNodeBase;
 
 using MachineDomTreeNode = DomTreeNodeBase<MachineBasicBlock>;
 
-class LiveIntervalCalc : public LiveRangeCalc {
+class LLVM_CLASS_ABI LiveIntervalCalc : public LiveRangeCalc {
   /// Extend the live range of @p LR to reach all uses of Reg.
   ///
   /// If @p LR is a main range, or if @p LI is null, then all uses must be
diff --git a/llvm/include/llvm/CodeGen/LiveIntervalUnion.h b/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
index ab77ee5edef4bb7..913d725d8a12880 100644
--- a/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
+++ b/llvm/include/llvm/CodeGen/LiveIntervalUnion.h
@@ -40,7 +40,7 @@ using LiveVirtRegBitSet = SparseBitVector<128>;
 /// single register (either physical or virtual depending on the context).  We
 /// expect the constituent live intervals to be disjoint, although we may
 /// eventually make exceptions to handle value-based interference.
-class LiveIntervalUnion {
+class LLVM_CLASS_ABI LiveIntervalUnion {
   // A set of live virtual register segments that supports fast insertion,
   // intersection, and removal.
   // Mapping SlotIndex intervals to virtual register numbers.
diff --git a/llvm/include/llvm/CodeGen/LiveIntervals.h b/llvm/include/llvm/CodeGen/LiveIntervals.h
index 3b3a4e12f79407d..f37faab434a4af2 100644
--- a/llvm/include/llvm/CodeGen/LiveIntervals.h
+++ b/llvm/include/llvm/CodeGen/LiveIntervals.h
@@ -37,7 +37,7 @@
 
 namespace llvm {
 
-extern cl::opt<bool> UseSegmentSetForPhysRegs;
+LLVM_FUNC_ABI extern cl::opt<bool> UseSegmentSetForPhysRegs;
 
 class BitVector;
 class LiveIntervalCalc;
@@ -50,7 +50,7 @@ class raw_ostream;
 class TargetInstrInfo;
 class VirtRegMap;
 
-  class LiveIntervals : public MachineFunctionPass {
+  class LLVM_CLASS_ABI LiveIntervals : public MachineFunctionPass {
     MachineFunction *MF = nullptr;
     MachineRegisterInfo *MRI = nullptr;
     const TargetRegisterInfo *TRI = nullptr;
diff --git a/llvm/include/llvm/CodeGen/LivePhysRegs.h b/llvm/include/llvm/CodeGen/LivePhysRegs.h
index 3f878ffbb6953d4..c95245d692f63e4 100644
--- a/llvm/include/llvm/CodeGen/LivePhysRegs.h
+++ b/llvm/include/llvm/CodeGen/LivePhysRegs.h
@@ -48,7 +48,7 @@ class raw_ostream;
 
 /// A set of physical registers with utility functions to track liveness
 /// when walking backward/forward through a basic block.
-class LivePhysRegs {
+class LLVM_CLASS_ABI LivePhysRegs {
   const TargetRegisterInfo *TRI = nullptr;
   using RegisterSet = SparseSet<MCPhysReg, identity<MCPhysReg>>;
   RegisterSet LiveRegs;
@@ -181,17 +181,17 @@ inline raw_ostream &operator<<(raw_ostream &OS, const LivePhysRegs& LR) {
 /// Computes registers live-in to \p MBB assuming all of its successors
 /// live-in lists are up-to-date. Puts the result into the given LivePhysReg
 /// instance \p LiveRegs.
-void computeLiveIns(LivePhysRegs &LiveRegs, const MachineBasicBlock &MBB);
+LLVM_FUNC_ABI void computeLiveIns(LivePhysRegs &LiveRegs, const MachineBasicBlock &MBB);
 
 /// Recomputes dead and kill flags in \p MBB.
-void recomputeLivenessFlags(MachineBasicBlock &MBB);
+LLVM_FUNC_ABI void recomputeLivenessFlags(MachineBasicBlock &MBB);
 
 /// Adds registers contained in \p LiveRegs to the block live-in list of \p MBB.
 /// Does not add reserved registers.
-void addLiveIns(MachineBasicBlock &MBB, const LivePhysRegs &LiveRegs);
+LLVM_FUNC_ABI void addLiveIns(MachineBasicBlock &MBB, const LivePhysRegs &LiveRegs);
 
 /// Convenience function combining computeLiveIns() and addLiveIns().
-void computeAndAddLiveIns(LivePhysRegs &LiveRegs,
+LLVM_FUNC_ABI void computeAndAddLiveIns(LivePhysRegs &LiveRegs,
                           MachineBasicBlock &MBB);
 
 /// Convenience function for recomputing live-in's for \p MBB.
diff --git a/llvm/include/llvm/CodeGen/LiveRangeCalc.h b/llvm/include/llvm/CodeGen/LiveRangeCalc.h
index 393c69d80fba577..65d4159306c2069 100644
--- a/llvm/include/llvm/CodeGen/LiveRangeCalc.h
+++ b/llvm/include/llvm/CodeGen/LiveRangeCalc.h
@@ -43,7 +43,7 @@ class MachineRegisterInfo;
 
 using MachineDomTreeNode = DomTreeNodeBase<MachineBasicBlock>;
 
-class LiveRangeCalc {
+class LLVM_CLASS_ABI LiveRangeCalc {
   const MachineFunction *MF = nullptr;
   const MachineRegisterInfo *MRI = nullptr;
   SlotIndexes *Indexes = nullptr;
diff --git a/llvm/include/llvm/CodeGen/LiveRangeEdit.h b/llvm/include/llvm/CodeGen/LiveRangeEdit.h
index 4fc28620f946172..b363d95003ca89e 100644
--- a/llvm/include/llvm/CodeGen/LiveRangeEdit.h
+++ b/llvm/include/llvm/CodeGen/LiveRangeEdit.h
@@ -40,7 +40,7 @@ class TargetRegisterInfo;
 class VirtRegMap;
 class VirtRegAuxInfo;
 
-class LiveRangeEdit : private MachineRegisterInfo::Delegate {
+class LLVM_CLASS_ABI LiveRangeEdit : private MachineRegisterInfo::Delegate {
 public:
   /// Callback methods for LiveRangeEdit owners.
   class Delegate {
diff --git a/llvm/include/llvm/CodeGen/LiveRegMatrix.h b/llvm/include/llvm/CodeGen/LiveRegMatrix.h
index 7dd82e1dce2f803..09c065752e268aa 100644
--- a/llvm/include/llvm/CodeGen/LiveRegMatrix.h
+++ b/llvm/include/llvm/CodeGen/LiveRegMatrix.h
@@ -38,7 +38,7 @@ class MachineFunction;
 class TargetRegisterInfo;
 class VirtRegMap;
 
-class LiveRegMatrix : public MachineFunctionPass {
+class LLVM_CLASS_ABI LiveRegMatrix : public MachineFunctionPass {
   const TargetRegisterInfo *TRI = nullptr;
   LiveIntervals *LIS = nullptr;
   VirtRegMap *VRM = nullptr;
diff --git a/llvm/include/llvm/CodeGen/LiveRegUnits.h b/llvm/include/llvm/CodeGen/LiveRegUnits.h
index 8cad162ee16c4dd..d1e5c33a07cd69f 100644
--- a/llvm/include/llvm/CodeGen/LiveRegUnits.h
+++ b/llvm/include/llvm/CodeGen/LiveRegUnits.h
@@ -28,7 +28,7 @@ class MachineInstr;
 class MachineBasicBlock;
 
 /// A set of register units used to track register liveness.
-class LiveRegUnits {
+class LLVM_CLASS_ABI LiveRegUnits {
   const TargetRegisterInfo *TRI = nullptr;
   BitVector Units;
 
diff --git a/llvm/include/llvm/CodeGen/LiveStacks.h b/llvm/include/llvm/CodeGen/LiveStacks.h
index 3958c398e542b72..77c2b204942ec51 100644
--- a/llvm/include/llvm/CodeGen/LiveStacks.h
+++ b/llvm/include/llvm/CodeGen/LiveStacks.h
@@ -33,7 +33,7 @@ class raw_ostream;
 class TargetRegisterClass;
 class TargetRegisterInfo;
 
-class LiveStacks : public MachineFunctionPass {
+class LLVM_CLASS_ABI LiveStacks : public MachineFunctionPass {
   const TargetRegisterInfo *TRI = nullptr;
 
   /// Special pool allocator for VNInfo's (LiveInterval val#).
diff --git a/llvm/include/llvm/CodeGen/LiveVariables.h b/llvm/include/llvm/CodeGen/LiveVariables.h
index edc1f122cc9efd9..f5647a02f0d2fd3 100644
--- a/llvm/include/llvm/CodeGen/LiveVariables.h
+++ b/llvm/include/llvm/CodeGen/LiveVariables.h
@@ -45,7 +45,7 @@ namespace llvm {
 class MachineBasicBlock;
 class MachineRegisterInfo;
 
-class LiveVariables : public MachineFunctionPass {
+class LLVM_CLASS_ABI LiveVariables : public MachineFunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
   LiveVariables() : MachineFunctionPass(ID) {
diff --git a/llvm/include/llvm/CodeGen/LoopTraversal.h b/llvm/include/llvm/CodeGen/LoopTraversal.h
index 4f2aac2fd4ba963..2b37b8655c72d40 100644
--- a/llvm/include/llvm/CodeGen/LoopTraversal.h
+++ b/llvm/include/llvm/CodeGen/LoopTraversal.h
@@ -63,7 +63,7 @@ class MachineFunction;
 ///
 /// In the optimized approach we avoid processing D twice, because we
 /// can entirely process the predecessors before getting to D.
-class LoopTraversal {
+class LLVM_CLASS_ABI LoopTraversal {
 private:
   struct MBBInfo {
     /// Whether we have gotten to this block in primary processing yet.
diff --git a/llvm/include/llvm/CodeGen/LowLevelType.h b/llvm/include/llvm/CodeGen/LowLevelType.h
index 88c557efca475b8..73026dc903e278c 100644
--- a/llvm/include/llvm/CodeGen/LowLevelType.h
+++ b/llvm/include/llvm/CodeGen/LowLevelType.h
@@ -37,7 +37,7 @@ namespace llvm {
 class Type;
 class raw_ostream;
 
-class LLT {
+class LLVM_CLASS_ABI LLT {
 public:
   /// Get a low-level scalar or aggregate "bag of bits".
   static constexpr LLT scalar(unsigned SizeInBits) {
@@ -404,7 +404,7 @@ inline raw_ostream& operator<<(raw_ostream &OS, const LLT &Ty) {
   return OS;
 }
 
-template<> struct DenseMapInfo<LLT> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<LLT> {
   static inline LLT getEmptyKey() {
     LLT Invalid;
     Invalid.IsPointer = true;
diff --git a/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h b/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
index 98a900d4656ef8d..ed1783b0491246f 100644
--- a/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
+++ b/llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
@@ -27,20 +27,20 @@ class Type;
 struct fltSemantics;
 
 /// Construct a low-level type based on an LLVM type.
-LLT getLLTForType(Type &Ty, const DataLayout &DL);
+LLVM_FUNC_ABI LLT getLLTForType(Type &Ty, const DataLayout &DL);
 
 /// Get a rough equivalent of an MVT for a given LLT. MVT can't distinguish
 /// pointers, so these will convert to a plain integer.
-MVT getMVTForLLT(LLT Ty);
-EVT getApproximateEVTForLLT(LLT Ty, const DataLayout &DL, LLVMContext &Ctx);
+LLVM_FUNC_ABI MVT getMVTForLLT(LLT Ty);
+LLVM_FUNC_ABI EVT getApproximateEVTForLLT(LLT Ty, const DataLayout &DL, LLVMContext &Ctx);
 
 /// Get a rough equivalent of an LLT for a given MVT. LLT does not yet support
 /// scalarable vector types, and will assert if used.
-LLT getLLTForMVT(MVT Ty);
+LLVM_FUNC_ABI LLT getLLTForMVT(MVT Ty);
 
 /// Get the appropriate floating point arithmetic semantic based on the bit size
 /// of the given scalar LLT.
-const llvm::fltSemantics &getFltSemanticForLLT(LLT Ty);
+LLVM_FUNC_ABI const llvm::fltSemantics &getFltSemanticForLLT(LLT Ty);
 }
 
 #endif // LLVM_CODEGEN_LOWLEVELTYPEUTILS_H
diff --git a/llvm/include/llvm/CodeGen/MBFIWrapper.h b/llvm/include/llvm/CodeGen/MBFIWrapper.h
index d8722c6737817fb..cc6b44ca1f1bdf2 100644
--- a/llvm/include/llvm/CodeGen/MBFIWrapper.h
+++ b/llvm/include/llvm/CodeGen/MBFIWrapper.h
@@ -25,7 +25,7 @@ namespace llvm {
 class MachineBasicBlock;
 class MachineBlockFrequencyInfo;
 
-class MBFIWrapper {
+class LLVM_CLASS_ABI MBFIWrapper {
  public:
   MBFIWrapper(const MachineBlockFrequencyInfo &I) : MBFI(I) {}
 
diff --git a/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h b/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h
index df4b71415929957..4d9ee356976edd6 100644
--- a/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h
+++ b/llvm/include/llvm/CodeGen/MIRFSDiscriminator.h
@@ -30,7 +30,7 @@ namespace llvm {
 class MachineFunction;
 
 using namespace sampleprof;
-class MIRAddFSDiscriminators : public MachineFunctionPass {
+class LLVM_CLASS_ABI MIRAddFSDiscriminators : public MachineFunctionPass {
   MachineFunction *MF = nullptr;
   FSDiscriminatorPass Pass;
   unsigned LowBit;
diff --git a/llvm/include/llvm/CodeGen/MIRFormatter.h b/llvm/include/llvm/CodeGen/MIRFormatter.h
index 96fb2bc3ce983af..36efe77bb5043e6 100644
--- a/llvm/include/llvm/CodeGen/MIRFormatter.h
+++ b/llvm/include/llvm/CodeGen/MIRFormatter.h
@@ -26,7 +26,7 @@ class MachineInstr;
 struct PerFunctionMIParsingState;
 
 /// MIRFormater - Interface to format MIR operand based on target
-class MIRFormatter {
+class LLVM_CLASS_ABI MIRFormatter {
 public:
   typedef function_ref<bool(StringRef::iterator Loc, const Twine &)>
       ErrorCallbackType;
diff --git a/llvm/include/llvm/CodeGen/MIRParser/MIParser.h b/llvm/include/llvm/CodeGen/MIRParser/MIParser.h
index ec532b7d4273587..9a7a5cb485039b1 100644
--- a/llvm/include/llvm/CodeGen/MIRParser/MIParser.h
+++ b/llvm/include/llvm/CodeGen/MIRParser/MIParser.h
@@ -35,7 +35,7 @@ class StringRef;
 class TargetRegisterClass;
 class TargetSubtargetInfo;
 
-struct VRegInfo {
+struct LLVM_CLASS_ABI VRegInfo {
   enum uint8_t {
     UNKNOWN, NORMAL, GENERIC, REGBANK
   } Kind = UNKNOWN;
@@ -51,7 +51,7 @@ struct VRegInfo {
 using Name2RegClassMap = StringMap<const TargetRegisterClass *>;
 using Name2RegBankMap = StringMap<const RegisterBank *>;
 
-struct PerTargetMIParsingState {
+struct LLVM_CLASS_ABI PerTargetMIParsingState {
 private:
   const TargetSubtargetInfo &Subtarget;
 
@@ -160,7 +160,7 @@ struct PerTargetMIParsingState {
   void setTarget(const TargetSubtargetInfo &NewSubtarget);
 };
 
-struct PerFunctionMIParsingState {
+struct LLVM_CLASS_ABI PerFunctionMIParsingState {
   BumpPtrAllocator Allocator;
   MachineFunction &MF;
   SourceMgr *SM;
@@ -202,7 +202,7 @@ struct PerFunctionMIParsingState {
 /// resolve the machine basic block references.
 ///
 /// Return true if an error occurred.
-bool parseMachineBasicBlockDefinitions(PerFunctionMIParsingState &PFS,
+LLVM_FUNC_ABI bool parseMachineBasicBlockDefinitions(PerFunctionMIParsingState &PFS,
                                        StringRef Src, SMDiagnostic &Error);
 
 /// Parse the machine instructions.
@@ -215,31 +215,31 @@ bool parseMachineBasicBlockDefinitions(PerFunctionMIParsingState &PFS,
 /// on the given source string.
 ///
 /// Return true if an error occurred.
-bool parseMachineInstructions(PerFunctionMIParsingState &PFS, StringRef Src,
+LLVM_FUNC_ABI bool parseMachineInstructions(PerFunctionMIParsingState &PFS, StringRef Src,
                               SMDiagnostic &Error);
 
-bool parseMBBReference(PerFunctionMIParsingState &PFS,
+LLVM_FUNC_ABI bool parseMBBReference(PerFunctionMIParsingState &PFS,
                        MachineBasicBlock *&MBB, StringRef Src,
                        SMDiagnostic &Error);
 
-bool parseRegisterReference(PerFunctionMIParsingState &PFS,
+LLVM_FUNC_ABI bool parseRegisterReference(PerFunctionMIParsingState &PFS,
                             Register &Reg, StringRef Src,
                             SMDiagnostic &Error);
 
-bool parseNamedRegisterReference(PerFunctionMIParsingState &PFS, Register &Reg,
+LLVM_FUNC_ABI bool parseNamedRegisterReference(PerFunctionMIParsingState &PFS, Register &Reg,
                                  StringRef Src, SMDiagnostic &Error);
 
-bool parseVirtualRegisterReference(PerFunctionMIParsingState &PFS,
+LLVM_FUNC_ABI bool parseVirtualRegisterReference(PerFunctionMIParsingState &PFS,
                                    VRegInfo *&Info, StringRef Src,
                                    SMDiagnostic &Error);
 
-bool parseStackObjectReference(PerFunctionMIParsingState &PFS, int &FI,
+LLVM_FUNC_ABI bool parseStackObjectReference(PerFunctionMIParsingState &PFS, int &FI,
                                StringRef Src, SMDiagnostic &Error);
 
-bool parseMDNode(PerFunctionMIParsingState &PFS, MDNode *&Node, StringRef Src,
+LLVM_FUNC_ABI bool parseMDNode(PerFunctionMIParsingState &PFS, MDNode *&Node, StringRef Src,
                  SMDiagnostic &Error);
 
-bool parseMachineMetadata(PerFunctionMIParsingState &PFS, StringRef Src,
+LLVM_FUNC_ABI bool parseMachineMetadata(PerFunctionMIParsingState &PFS, StringRef Src,
                           SMRange SourceRange, SMDiagnostic &Error);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h b/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
index 4afd49212c7f895..91813eeb3a9567b 100644
--- a/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
+++ b/llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
@@ -40,7 +40,7 @@ typedef llvm::function_ref<std::optional<std::string>(StringRef, StringRef)>
 
 /// This class initializes machine functions by applying the state loaded from
 /// a MIR file.
-class MIRParser {
+class LLVM_CLASS_ABI MIRParser {
   std::unique_ptr<MIRParserImpl> Impl;
 
 public:
@@ -74,7 +74,7 @@ class MIRParser {
 /// \param Context - Context which will be used for the parsed LLVM IR module.
 /// \param ProcessIRFunction - function to run on every IR function or stub
 /// loaded from the MIR file.
-std::unique_ptr<MIRParser> createMIRParserFromFile(
+LLVM_FUNC_ABI std::unique_ptr<MIRParser> createMIRParserFromFile(
     StringRef Filename, SMDiagnostic &Error, LLVMContext &Context,
     std::function<void(Function &)> ProcessIRFunction = nullptr);
 
@@ -86,7 +86,7 @@ std::unique_ptr<MIRParser> createMIRParserFromFile(
 ///
 /// \param Contents - The MemoryBuffer containing the machine level IR.
 /// \param Context - Context which will be used for the parsed LLVM IR module.
-std::unique_ptr<MIRParser>
+LLVM_FUNC_ABI std::unique_ptr<MIRParser>
 createMIRParser(std::unique_ptr<MemoryBuffer> Contents, LLVMContext &Context,
                 std::function<void(Function &)> ProcessIRFunction = nullptr);
 
diff --git a/llvm/include/llvm/CodeGen/MIRPrinter.h b/llvm/include/llvm/CodeGen/MIRPrinter.h
index 330bf39246b179b..838b34a762000c4 100644
--- a/llvm/include/llvm/CodeGen/MIRPrinter.h
+++ b/llvm/include/llvm/CodeGen/MIRPrinter.h
@@ -25,11 +25,11 @@ class raw_ostream;
 template <typename T> class SmallVectorImpl;
 
 /// Print LLVM IR using the MIR serialization format to the given output stream.
-void printMIR(raw_ostream &OS, const Module &M);
+LLVM_FUNC_ABI void printMIR(raw_ostream &OS, const Module &M);
 
 /// Print a machine function using the MIR serialization format to the given
 /// output stream.
-void printMIR(raw_ostream &OS, const MachineFunction &MF);
+LLVM_FUNC_ABI void printMIR(raw_ostream &OS, const MachineFunction &MF);
 
 /// Determine a possible list of successors of a basic block based on the
 /// basic block machine operand being used inside the block. This should give
@@ -38,7 +38,7 @@ void printMIR(raw_ostream &OS, const MachineFunction &MF);
 /// The MIRPRinter will skip printing successors if they match the result of
 /// this function and the parser will use this function to construct a list if
 /// it is missing.
-void guessSuccessors(const MachineBasicBlock &MBB,
+LLVM_FUNC_ABI void guessSuccessors(const MachineBasicBlock &MBB,
                      SmallVectorImpl<MachineBasicBlock*> &Result,
                      bool &IsFallthrough);
 
diff --git a/llvm/include/llvm/CodeGen/MIRYamlMapping.h b/llvm/include/llvm/CodeGen/MIRYamlMapping.h
index f1a364ec2c3dd06..ef6c2dd75774642 100644
--- a/llvm/include/llvm/CodeGen/MIRYamlMapping.h
+++ b/llvm/include/llvm/CodeGen/MIRYamlMapping.h
@@ -32,7 +32,7 @@ namespace yaml {
 
 /// A wrapper around std::string which contains a source range that's being
 /// set during parsing.
-struct StringValue {
+struct LLVM_CLASS_ABI StringValue {
   std::string Value;
   SMRange SourceRange;
 
@@ -45,7 +45,7 @@ struct StringValue {
   }
 };
 
-template <> struct ScalarTraits<StringValue> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<StringValue> {
   static void output(const StringValue &S, void *, raw_ostream &OS) {
     OS << S.Value;
   }
@@ -61,12 +61,12 @@ template <> struct ScalarTraits<StringValue> {
   static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
 };
 
-struct FlowStringValue : StringValue {
+struct LLVM_CLASS_ABI FlowStringValue : StringValue {
   FlowStringValue() = default;
   FlowStringValue(std::string Value) : StringValue(std::move(Value)) {}
 };
 
-template <> struct ScalarTraits<FlowStringValue> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<FlowStringValue> {
   static void output(const FlowStringValue &S, void *, raw_ostream &OS) {
     return ScalarTraits<StringValue>::output(S, nullptr, OS);
   }
@@ -78,7 +78,7 @@ template <> struct ScalarTraits<FlowStringValue> {
   static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
 };
 
-struct BlockStringValue {
+struct LLVM_CLASS_ABI BlockStringValue {
   StringValue Value;
 
   bool operator==(const BlockStringValue &Other) const {
@@ -86,7 +86,7 @@ struct BlockStringValue {
   }
 };
 
-template <> struct BlockScalarTraits<BlockStringValue> {
+template <> struct LLVM_CLASS_ABI BlockScalarTraits<BlockStringValue> {
   static void output(const BlockStringValue &S, void *Ctx, raw_ostream &OS) {
     return ScalarTraits<StringValue>::output(S.Value, Ctx, OS);
   }
@@ -98,7 +98,7 @@ template <> struct BlockScalarTraits<BlockStringValue> {
 
 /// A wrapper around unsigned which contains a source range that's being set
 /// during parsing.
-struct UnsignedValue {
+struct LLVM_CLASS_ABI UnsignedValue {
   unsigned Value = 0;
   SMRange SourceRange;
 
@@ -110,7 +110,7 @@ struct UnsignedValue {
   }
 };
 
-template <> struct ScalarTraits<UnsignedValue> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<UnsignedValue> {
   static void output(const UnsignedValue &Value, void *Ctx, raw_ostream &OS) {
     return ScalarTraits<unsigned>::output(Value.Value, Ctx, OS);
   }
@@ -127,7 +127,7 @@ template <> struct ScalarTraits<UnsignedValue> {
   }
 };
 
-template <> struct ScalarEnumerationTraits<MachineJumpTableInfo::JTEntryKind> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<MachineJumpTableInfo::JTEntryKind> {
   static void enumeration(yaml::IO &IO,
                           MachineJumpTableInfo::JTEntryKind &EntryKind) {
     IO.enumCase(EntryKind, "block-address",
@@ -143,7 +143,7 @@ template <> struct ScalarEnumerationTraits<MachineJumpTableInfo::JTEntryKind> {
   }
 };
 
-template <> struct ScalarTraits<MaybeAlign> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<MaybeAlign> {
   static void output(const MaybeAlign &Alignment, void *,
                      llvm::raw_ostream &out) {
     out << uint64_t(Alignment ? Alignment->value() : 0U);
@@ -160,7 +160,7 @@ template <> struct ScalarTraits<MaybeAlign> {
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
 };
 
-template <> struct ScalarTraits<Align> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<Align> {
   static void output(const Align &Alignment, void *, llvm::raw_ostream &OS) {
     OS << Alignment.value();
   }
@@ -186,7 +186,7 @@ LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::UnsignedValue)
 namespace llvm {
 namespace yaml {
 
-struct VirtualRegisterDefinition {
+struct LLVM_CLASS_ABI VirtualRegisterDefinition {
   UnsignedValue ID;
   StringValue Class;
   StringValue PreferredRegister;
@@ -199,7 +199,7 @@ struct VirtualRegisterDefinition {
   }
 };
 
-template <> struct MappingTraits<VirtualRegisterDefinition> {
+template <> struct LLVM_CLASS_ABI MappingTraits<VirtualRegisterDefinition> {
   static void mapping(IO &YamlIO, VirtualRegisterDefinition &Reg) {
     YamlIO.mapRequired("id", Reg.ID);
     YamlIO.mapRequired("class", Reg.Class);
@@ -210,7 +210,7 @@ template <> struct MappingTraits<VirtualRegisterDefinition> {
   static const bool flow = true;
 };
 
-struct MachineFunctionLiveIn {
+struct LLVM_CLASS_ABI MachineFunctionLiveIn {
   StringValue Register;
   StringValue VirtualRegister;
 
@@ -220,7 +220,7 @@ struct MachineFunctionLiveIn {
   }
 };
 
-template <> struct MappingTraits<MachineFunctionLiveIn> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachineFunctionLiveIn> {
   static void mapping(IO &YamlIO, MachineFunctionLiveIn &LiveIn) {
     YamlIO.mapRequired("reg", LiveIn.Register);
     YamlIO.mapOptional(
@@ -238,7 +238,7 @@ template <> struct MappingTraits<MachineFunctionLiveIn> {
 /// Dead stack objects aren't serialized.
 ///
 /// The 'isPreallocated' flag is determined by the local offset.
-struct MachineStackObject {
+struct LLVM_CLASS_ABI MachineStackObject {
   enum ObjectType { DefaultType, SpillSlot, VariableSized };
   UnsignedValue ID;
   StringValue Name;
@@ -267,7 +267,7 @@ struct MachineStackObject {
   }
 };
 
-template <> struct ScalarEnumerationTraits<MachineStackObject::ObjectType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<MachineStackObject::ObjectType> {
   static void enumeration(yaml::IO &IO, MachineStackObject::ObjectType &Type) {
     IO.enumCase(Type, "default", MachineStackObject::DefaultType);
     IO.enumCase(Type, "spill-slot", MachineStackObject::SpillSlot);
@@ -275,7 +275,7 @@ template <> struct ScalarEnumerationTraits<MachineStackObject::ObjectType> {
   }
 };
 
-template <> struct MappingTraits<MachineStackObject> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachineStackObject> {
   static void mapping(yaml::IO &YamlIO, MachineStackObject &Object) {
     YamlIO.mapRequired("id", Object.ID);
     YamlIO.mapOptional("name", Object.Name,
@@ -307,7 +307,7 @@ template <> struct MappingTraits<MachineStackObject> {
 
 /// Serializable representation of the MCRegister variant of
 /// MachineFunction::VariableDbgInfo.
-struct EntryValueObject {
+struct LLVM_CLASS_ABI EntryValueObject {
   StringValue EntryValueRegister;
   StringValue DebugVar;
   StringValue DebugExpr;
@@ -319,7 +319,7 @@ struct EntryValueObject {
   }
 };
 
-template <> struct MappingTraits<EntryValueObject> {
+template <> struct LLVM_CLASS_ABI MappingTraits<EntryValueObject> {
   static void mapping(yaml::IO &YamlIO, EntryValueObject &Object) {
     YamlIO.mapRequired("entry-value-register", Object.EntryValueRegister);
     YamlIO.mapRequired("debug-info-variable", Object.DebugVar);
@@ -331,7 +331,7 @@ template <> struct MappingTraits<EntryValueObject> {
 
 /// Serializable representation of the fixed stack object from the
 /// MachineFrameInfo class.
-struct FixedMachineStackObject {
+struct LLVM_CLASS_ABI FixedMachineStackObject {
   enum ObjectType { DefaultType, SpillSlot };
   UnsignedValue ID;
   ObjectType Type = DefaultType;
@@ -360,7 +360,7 @@ struct FixedMachineStackObject {
 };
 
 template <>
-struct ScalarEnumerationTraits<FixedMachineStackObject::ObjectType> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<FixedMachineStackObject::ObjectType> {
   static void enumeration(yaml::IO &IO,
                           FixedMachineStackObject::ObjectType &Type) {
     IO.enumCase(Type, "default", FixedMachineStackObject::DefaultType);
@@ -369,7 +369,7 @@ struct ScalarEnumerationTraits<FixedMachineStackObject::ObjectType> {
 };
 
 template <>
-struct ScalarEnumerationTraits<TargetStackID::Value> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<TargetStackID::Value> {
   static void enumeration(yaml::IO &IO, TargetStackID::Value &ID) {
     IO.enumCase(ID, "default", TargetStackID::Default);
     IO.enumCase(ID, "sgpr-spill", TargetStackID::SGPRSpill);
@@ -379,7 +379,7 @@ struct ScalarEnumerationTraits<TargetStackID::Value> {
   }
 };
 
-template <> struct MappingTraits<FixedMachineStackObject> {
+template <> struct LLVM_CLASS_ABI MappingTraits<FixedMachineStackObject> {
   static void mapping(yaml::IO &YamlIO, FixedMachineStackObject &Object) {
     YamlIO.mapRequired("id", Object.ID);
     YamlIO.mapOptional(
@@ -410,7 +410,7 @@ template <> struct MappingTraits<FixedMachineStackObject> {
 
 /// A serializaable representation of a reference to a stack object or fixed
 /// stack object.
-struct FrameIndex {
+struct LLVM_CLASS_ABI FrameIndex {
   // The frame index as printed. This is always a positive number, even for
   // fixed objects. To obtain the real index,
   // MachineFrameInfo::getObjectIndexBegin has to be added.
@@ -424,7 +424,7 @@ struct FrameIndex {
   Expected<int> getFI(const llvm::MachineFrameInfo &MFI) const;
 };
 
-template <> struct ScalarTraits<FrameIndex> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<FrameIndex> {
   static void output(const FrameIndex &FI, void *, raw_ostream &OS) {
     MachineOperand::printStackObjectReference(OS, FI.FI, FI.IsFixed, "");
   }
@@ -454,7 +454,7 @@ template <> struct ScalarTraits<FrameIndex> {
 };
 
 /// Serializable representation of CallSiteInfo.
-struct CallSiteInfo {
+struct LLVM_CLASS_ABI CallSiteInfo {
   // Representation of call argument and register which is used to
   // transfer it.
   struct ArgRegPair {
@@ -485,7 +485,7 @@ struct CallSiteInfo {
   }
 };
 
-template <> struct MappingTraits<CallSiteInfo::ArgRegPair> {
+template <> struct LLVM_CLASS_ABI MappingTraits<CallSiteInfo::ArgRegPair> {
   static void mapping(IO &YamlIO, CallSiteInfo::ArgRegPair &ArgReg) {
     YamlIO.mapRequired("arg", ArgReg.ArgNo);
     YamlIO.mapRequired("reg", ArgReg.Reg);
@@ -501,7 +501,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::CallSiteInfo::ArgRegPair)
 namespace llvm {
 namespace yaml {
 
-template <> struct MappingTraits<CallSiteInfo> {
+template <> struct LLVM_CLASS_ABI MappingTraits<CallSiteInfo> {
   static void mapping(IO &YamlIO, CallSiteInfo &CSInfo) {
     YamlIO.mapRequired("bb", CSInfo.CallLocation.BlockNum);
     YamlIO.mapRequired("offset", CSInfo.CallLocation.Offset);
@@ -513,7 +513,7 @@ template <> struct MappingTraits<CallSiteInfo> {
 };
 
 /// Serializable representation of debug value substitutions.
-struct DebugValueSubstitution {
+struct LLVM_CLASS_ABI DebugValueSubstitution {
   unsigned SrcInst;
   unsigned SrcOp;
   unsigned DstInst;
@@ -526,7 +526,7 @@ struct DebugValueSubstitution {
   }
 };
 
-template <> struct MappingTraits<DebugValueSubstitution> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DebugValueSubstitution> {
   static void mapping(IO &YamlIO, DebugValueSubstitution &Sub) {
     YamlIO.mapRequired("srcinst", Sub.SrcInst);
     YamlIO.mapRequired("srcop", Sub.SrcOp);
@@ -544,7 +544,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::DebugValueSubstitution)
 
 namespace llvm {
 namespace yaml {
-struct MachineConstantPoolValue {
+struct LLVM_CLASS_ABI MachineConstantPoolValue {
   UnsignedValue ID;
   StringValue Value;
   MaybeAlign Alignment = std::nullopt;
@@ -557,7 +557,7 @@ struct MachineConstantPoolValue {
   }
 };
 
-template <> struct MappingTraits<MachineConstantPoolValue> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachineConstantPoolValue> {
   static void mapping(IO &YamlIO, MachineConstantPoolValue &Constant) {
     YamlIO.mapRequired("id", Constant.ID);
     YamlIO.mapOptional("value", Constant.Value, StringValue());
@@ -566,7 +566,7 @@ template <> struct MappingTraits<MachineConstantPoolValue> {
   }
 };
 
-struct MachineJumpTable {
+struct LLVM_CLASS_ABI MachineJumpTable {
   struct Entry {
     UnsignedValue ID;
     std::vector<FlowStringValue> Blocks;
@@ -584,7 +584,7 @@ struct MachineJumpTable {
   }
 };
 
-template <> struct MappingTraits<MachineJumpTable::Entry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachineJumpTable::Entry> {
   static void mapping(IO &YamlIO, MachineJumpTable::Entry &Entry) {
     YamlIO.mapRequired("id", Entry.ID);
     YamlIO.mapOptional("blocks", Entry.Blocks, std::vector<FlowStringValue>());
@@ -606,7 +606,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineJumpTable::Entry)
 namespace llvm {
 namespace yaml {
 
-template <> struct MappingTraits<MachineJumpTable> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachineJumpTable> {
   static void mapping(IO &YamlIO, MachineJumpTable &JT) {
     YamlIO.mapRequired("kind", JT.Kind);
     YamlIO.mapOptional("entries", JT.Entries,
@@ -621,7 +621,7 @@ template <> struct MappingTraits<MachineJumpTable> {
 /// attributes.
 /// It also doesn't serialize attributes like 'NumFixedObject' and
 /// 'HasVarSizedObjects' as they are determined by the frame objects themselves.
-struct MachineFrameInfo {
+struct LLVM_CLASS_ABI MachineFrameInfo {
   bool IsFrameAddressTaken = false;
   bool IsReturnAddressTaken = false;
   bool HasStackMap = false;
@@ -666,7 +666,7 @@ struct MachineFrameInfo {
   }
 };
 
-template <> struct MappingTraits<MachineFrameInfo> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachineFrameInfo> {
   static void mapping(IO &YamlIO, MachineFrameInfo &MFI) {
     YamlIO.mapOptional("isFrameAddressTaken", MFI.IsFrameAddressTaken, false);
     YamlIO.mapOptional("isReturnAddressTaken", MFI.IsReturnAddressTaken, false);
@@ -700,19 +700,19 @@ template <> struct MappingTraits<MachineFrameInfo> {
 
 /// Targets should override this in a way that mirrors the implementation of
 /// llvm::MachineFunctionInfo.
-struct MachineFunctionInfo {
+struct LLVM_CLASS_ABI MachineFunctionInfo {
   virtual ~MachineFunctionInfo() = default;
   virtual void mappingImpl(IO &YamlIO) {}
 };
 
-template <> struct MappingTraits<std::unique_ptr<MachineFunctionInfo>> {
+template <> struct LLVM_CLASS_ABI MappingTraits<std::unique_ptr<MachineFunctionInfo>> {
   static void mapping(IO &YamlIO, std::unique_ptr<MachineFunctionInfo> &MFI) {
     if (MFI)
       MFI->mappingImpl(YamlIO);
   }
 };
 
-struct MachineFunction {
+struct LLVM_CLASS_ABI MachineFunction {
   StringRef Name;
   MaybeAlign Alignment = std::nullopt;
   bool ExposesReturnsTwice = false;
@@ -753,7 +753,7 @@ struct MachineFunction {
   BlockStringValue Body;
 };
 
-template <> struct MappingTraits<MachineFunction> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachineFunction> {
   static void mapping(IO &YamlIO, MachineFunction &MF) {
     YamlIO.mapRequired("name", MF.Name);
     YamlIO.mapOptional("alignment", MF.Alignment, std::nullopt);
diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h
index 04fea37dff47cfd..3e392d822ebe19f 100644
--- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h
@@ -49,7 +49,7 @@ class TargetRegisterInfo;
 //  {Type: Default, Number: (unsigned)} (These are regular section IDs)
 //  {Type: Exception, Number: 0}  (ExceptionSectionID)
 //  {Type: Cold, Number: 0}  (ColdSectionID)
-struct MBBSectionID {
+struct LLVM_CLASS_ABI MBBSectionID {
   enum SectionType {
     Default = 0, // Regular section (these sections are distinguished by the
                  // Number field).
@@ -75,7 +75,7 @@ struct MBBSectionID {
   MBBSectionID(SectionType T) : Type(T), Number(0) {}
 };
 
-template <> struct ilist_traits<MachineInstr> {
+template <> struct LLVM_CLASS_ABI ilist_traits<MachineInstr> {
 private:
   friend class MachineBasicBlock; // Set by the owning MachineBasicBlock.
 
@@ -92,7 +92,7 @@ template <> struct ilist_traits<MachineInstr> {
   void deleteNode(MachineInstr *MI);
 };
 
-class MachineBasicBlock
+class LLVM_CLASS_ABI MachineBasicBlock
     : public ilist_node_with_parent<MachineBasicBlock, MachineFunction> {
 public:
   /// Pair of physical register and lane mask.
@@ -1190,7 +1190,7 @@ class MachineBasicBlock
   void removePredecessor(MachineBasicBlock *Pred);
 };
 
-raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
+LLVM_FUNC_ABI raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
 
 /// Prints a machine basic block reference.
 ///
@@ -1198,10 +1198,10 @@ raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
 ///   %bb.5           - a machine basic block with MBB.getNumber() == 5.
 ///
 /// Usage: OS << printMBBReference(MBB) << '\n';
-Printable printMBBReference(const MachineBasicBlock &MBB);
+LLVM_FUNC_ABI Printable printMBBReference(const MachineBasicBlock &MBB);
 
 // This is useful when building IndexedMaps keyed on basic block pointers.
-struct MBB2NumberFunctor {
+struct LLVM_CLASS_ABI MBB2NumberFunctor {
   using argument_type = const MachineBasicBlock *;
   unsigned operator()(const MachineBasicBlock *MBB) const {
     return MBB->getNumber();
@@ -1216,7 +1216,7 @@ struct MBB2NumberFunctor {
 // MachineFunction as a graph of MachineBasicBlocks.
 //
 
-template <> struct GraphTraits<MachineBasicBlock *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<MachineBasicBlock *> {
   using NodeRef = MachineBasicBlock *;
   using ChildIteratorType = MachineBasicBlock::succ_iterator;
 
@@ -1225,7 +1225,7 @@ template <> struct GraphTraits<MachineBasicBlock *> {
   static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); }
 };
 
-template <> struct GraphTraits<const MachineBasicBlock *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<const MachineBasicBlock *> {
   using NodeRef = const MachineBasicBlock *;
   using ChildIteratorType = MachineBasicBlock::const_succ_iterator;
 
@@ -1240,7 +1240,7 @@ template <> struct GraphTraits<const MachineBasicBlock *> {
 // to be when traversing the predecessor edges of a MBB
 // instead of the successor edges.
 //
-template <> struct GraphTraits<Inverse<MachineBasicBlock*>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<MachineBasicBlock*>> {
   using NodeRef = MachineBasicBlock *;
   using ChildIteratorType = MachineBasicBlock::pred_iterator;
 
@@ -1252,7 +1252,7 @@ template <> struct GraphTraits<Inverse<MachineBasicBlock*>> {
   static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); }
 };
 
-template <> struct GraphTraits<Inverse<const MachineBasicBlock*>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<const MachineBasicBlock*>> {
   using NodeRef = const MachineBasicBlock *;
   using ChildIteratorType = MachineBasicBlock::const_pred_iterator;
 
@@ -1274,7 +1274,7 @@ inline auto predecessors(const MachineBasicBlock *BB) {
 /// containing the instruction it was initialized with, along with all
 /// those instructions inserted prior to or following that instruction
 /// at some point after the MachineInstrSpan is constructed.
-class MachineInstrSpan {
+class LLVM_CLASS_ABI MachineInstrSpan {
   MachineBasicBlock &MBB;
   MachineBasicBlock::iterator I, B, E;
 
diff --git a/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h b/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
index cf1122eefcb6d50..a400a7c8a39ed5d 100644
--- a/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
@@ -31,7 +31,7 @@ class raw_ostream;
 
 /// MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation
 /// to estimate machine basic block frequencies.
-class MachineBlockFrequencyInfo : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachineBlockFrequencyInfo : public MachineFunctionPass {
   using ImplType = BlockFrequencyInfoImpl<MachineBasicBlock>;
   std::unique_ptr<ImplType> MBFI;
 
diff --git a/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h b/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h
index 38c55feee854a43..72dbe11a1885b8d 100644
--- a/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h
@@ -20,7 +20,7 @@
 
 namespace llvm {
 
-class MachineBranchProbabilityInfo : public ImmutablePass {
+class LLVM_CLASS_ABI MachineBranchProbabilityInfo : public ImmutablePass {
   virtual void anchor();
 
   // Default weight value. Used when we don't have information about the edge.
diff --git a/llvm/include/llvm/CodeGen/MachineCFGPrinter.h b/llvm/include/llvm/CodeGen/MachineCFGPrinter.h
index 92d091d589b0c88..ae3d1799519ff4c 100644
--- a/llvm/include/llvm/CodeGen/MachineCFGPrinter.h
+++ b/llvm/include/llvm/CodeGen/MachineCFGPrinter.h
@@ -18,7 +18,7 @@
 namespace llvm {
 
 template <class GraphType> struct GraphTraits;
-class DOTMachineFuncInfo {
+class LLVM_CLASS_ABI DOTMachineFuncInfo {
 private:
   const MachineFunction *F;
 
@@ -29,7 +29,7 @@ class DOTMachineFuncInfo {
 };
 
 template <>
-struct GraphTraits<DOTMachineFuncInfo *>
+struct LLVM_CLASS_ABI GraphTraits<DOTMachineFuncInfo *>
     : public GraphTraits<const MachineBasicBlock *> {
   static NodeRef getEntryNode(DOTMachineFuncInfo *CFGInfo) {
     return &(CFGInfo->getFunction()->front());
@@ -52,7 +52,7 @@ struct GraphTraits<DOTMachineFuncInfo *>
 };
 
 template <>
-struct DOTGraphTraits<DOTMachineFuncInfo *> : public DefaultDOTGraphTraits {
+struct LLVM_CLASS_ABI DOTGraphTraits<DOTMachineFuncInfo *> : public DefaultDOTGraphTraits {
 
   DOTGraphTraits(bool isSimple = false) : DefaultDOTGraphTraits(isSimple) {}
 
diff --git a/llvm/include/llvm/CodeGen/MachineConstantPool.h b/llvm/include/llvm/CodeGen/MachineConstantPool.h
index d362eeb17b4b824..e51cf3e3ccddc1e 100644
--- a/llvm/include/llvm/CodeGen/MachineConstantPool.h
+++ b/llvm/include/llvm/CodeGen/MachineConstantPool.h
@@ -33,7 +33,7 @@ class Type;
 
 /// Abstract base class for all machine specific constantpool value subclasses.
 ///
-class MachineConstantPoolValue {
+class LLVM_CLASS_ABI MachineConstantPoolValue {
   virtual void anchor();
 
   Type *Ty;
@@ -65,7 +65,7 @@ inline raw_ostream &operator<<(raw_ostream &OS,
 /// It contains a pointer to the value and an offset from the start of
 /// the constant pool.
 /// An entry in a MachineConstantPool
-class MachineConstantPoolEntry {
+class LLVM_CLASS_ABI MachineConstantPoolEntry {
 public:
   /// The constant itself.
   union {
@@ -115,7 +115,7 @@ class MachineConstantPoolEntry {
 /// code, these virtual address references are converted to refer to the
 /// address of the function constant pool values.
 /// The machine constant pool.
-class MachineConstantPool {
+class LLVM_CLASS_ABI MachineConstantPool {
   Align PoolAlignment; ///< The alignment for the pool.
   std::vector<MachineConstantPoolEntry> Constants; ///< The pool of constants.
   /// MachineConstantPoolValues that use an existing MachineConstantPoolEntry.
diff --git a/llvm/include/llvm/CodeGen/MachineCycleAnalysis.h b/llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
index 86f2066f42699c3..e3ce576fa90b5f1 100644
--- a/llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
+++ b/llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
@@ -28,7 +28,7 @@ using MachineCycleInfo = GenericCycleInfo<MachineSSAContext>;
 using MachineCycle = MachineCycleInfo::CycleT;
 
 /// Legacy analysis pass which computes a \ref MachineCycleInfo.
-class MachineCycleInfoWrapperPass : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachineCycleInfoWrapperPass : public MachineFunctionPass {
   MachineFunction *F = nullptr;
   MachineCycleInfo CI;
 
@@ -48,7 +48,7 @@ class MachineCycleInfoWrapperPass : public MachineFunctionPass {
 
 // TODO: add this function to GenericCycle template after implementing IR
 //       version.
-bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I);
+LLVM_FUNC_ABI bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h b/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
index 807b4e8b0c092be..3f57a9a500360b7 100644
--- a/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
+++ b/llvm/include/llvm/CodeGen/MachineDominanceFrontier.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 
-class MachineDominanceFrontier : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachineDominanceFrontier : public MachineFunctionPass {
   ForwardDominanceFrontierBase<MachineBasicBlock> Base;
 
 public:
diff --git a/llvm/include/llvm/CodeGen/MachineDominators.h b/llvm/include/llvm/CodeGen/MachineDominators.h
index 891d9e15ae23399..92d33b8346d726b 100644
--- a/llvm/include/llvm/CodeGen/MachineDominators.h
+++ b/llvm/include/llvm/CodeGen/MachineDominators.h
@@ -49,7 +49,7 @@ using MachineDomTreeNode = DomTreeNodeBase<MachineBasicBlock>;
 /// DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to
 /// compute a normal dominator tree.
 ///
-class MachineDominatorTree : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachineDominatorTree : public MachineFunctionPass {
   /// Helper structure used to hold all the basic blocks
   /// involved in the split of a critical edge.
   struct CriticalEdge {
@@ -258,7 +258,7 @@ class MachineDominatorTree : public MachineFunctionPass {
 ///
 
 template <class Node, class ChildIterator>
-struct MachineDomTreeGraphTraitsBase {
+struct LLVM_CLASS_ABI MachineDomTreeGraphTraitsBase {
   using NodeRef = Node *;
   using ChildIteratorType = ChildIterator;
 
@@ -270,18 +270,18 @@ struct MachineDomTreeGraphTraitsBase {
 template <class T> struct GraphTraits;
 
 template <>
-struct GraphTraits<MachineDomTreeNode *>
+struct LLVM_CLASS_ABI GraphTraits<MachineDomTreeNode *>
     : public MachineDomTreeGraphTraitsBase<MachineDomTreeNode,
                                            MachineDomTreeNode::const_iterator> {
 };
 
 template <>
-struct GraphTraits<const MachineDomTreeNode *>
+struct LLVM_CLASS_ABI GraphTraits<const MachineDomTreeNode *>
     : public MachineDomTreeGraphTraitsBase<const MachineDomTreeNode,
                                            MachineDomTreeNode::const_iterator> {
 };
 
-template <> struct GraphTraits<MachineDominatorTree*>
+template <> struct LLVM_CLASS_ABI GraphTraits<MachineDominatorTree*>
   : public GraphTraits<MachineDomTreeNode *> {
   static NodeRef getEntryNode(MachineDominatorTree *DT) {
     return DT->getRootNode();
diff --git a/llvm/include/llvm/CodeGen/MachineFrameInfo.h b/llvm/include/llvm/CodeGen/MachineFrameInfo.h
index a500dc535d41bd5..d6195d3f314dfcc 100644
--- a/llvm/include/llvm/CodeGen/MachineFrameInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineFrameInfo.h
@@ -32,7 +32,7 @@ class AllocaInst;
 /// callee saved register is in the current frame.
 /// Callee saved reg can also be saved to a different register rather than
 /// on the stack by setting DstReg instead of FrameIdx.
-class CalleeSavedInfo {
+class LLVM_CLASS_ABI CalleeSavedInfo {
   Register Reg;
   union {
     int FrameIdx;
@@ -104,7 +104,7 @@ class CalleeSavedInfo {
 /// the program.
 ///
 /// Abstract Stack Frame Information
-class MachineFrameInfo {
+class LLVM_CLASS_ABI MachineFrameInfo {
 public:
   /// Stack Smashing Protection (SSP) rules require that vulnerable stack
   /// allocations are located close the stack protector.
diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h
index 09f9ff60f955037..e07ea38ac95a4bb 100644
--- a/llvm/include/llvm/CodeGen/MachineFunction.h
+++ b/llvm/include/llvm/CodeGen/MachineFunction.h
@@ -75,11 +75,11 @@ class TargetSubtargetInfo;
 struct WasmEHFuncInfo;
 struct WinEHFuncInfo;
 
-template <> struct ilist_alloc_traits<MachineBasicBlock> {
+template <> struct LLVM_CLASS_ABI ilist_alloc_traits<MachineBasicBlock> {
   void deleteNode(MachineBasicBlock *MBB);
 };
 
-template <> struct ilist_callback_traits<MachineBasicBlock> {
+template <> struct LLVM_CLASS_ABI ilist_callback_traits<MachineBasicBlock> {
   void addNodeToList(MachineBasicBlock* N);
   void removeNodeFromList(MachineBasicBlock* N);
 
@@ -93,7 +93,7 @@ template <> struct ilist_callback_traits<MachineBasicBlock> {
 /// hold private target-specific information for each MachineFunction.  Objects
 /// of type are accessed/created with MF::getInfo and destroyed when the
 /// MachineFunction is destroyed.
-struct MachineFunctionInfo {
+struct LLVM_CLASS_ABI MachineFunctionInfo {
   virtual ~MachineFunctionInfo();
 
   /// Factory function: default behavior is to call new using the
@@ -126,7 +126,7 @@ struct MachineFunctionInfo {
 /// Properties which a MachineFunction may have at a given point in time.
 /// Each of these has checking code in the MachineVerifier, and passes can
 /// require that a property be set.
-class MachineFunctionProperties {
+class LLVM_CLASS_ABI MachineFunctionProperties {
   // Possible TODO: Allow targets to extend this (perhaps by allowing the
   // constructor to specify the size of the bit vector)
   // Possible TODO: Allow requiring the negative (e.g. VRegsAllocated could be
@@ -235,7 +235,7 @@ class MachineFunctionProperties {
       BitVector(static_cast<unsigned>(Property::LastProperty)+1);
 };
 
-struct SEHHandler {
+struct LLVM_CLASS_ABI SEHHandler {
   /// Filter or finally function. Null indicates a catch-all.
   const Function *FilterOrFinally;
 
@@ -244,7 +244,7 @@ struct SEHHandler {
 };
 
 /// This structure is used to retain landing pad info for the current function.
-struct LandingPadInfo {
+struct LLVM_CLASS_ABI LandingPadInfo {
   MachineBasicBlock *LandingPadBlock;      // Landing pad block.
   SmallVector<MCSymbol *, 1> BeginLabels;  // Labels prior to invoke.
   SmallVector<MCSymbol *, 1> EndLabels;    // Labels after invoke.
@@ -1351,7 +1351,7 @@ class LLVM_EXTERNAL_VISIBILITY MachineFunction {
 // the same as the machine basic block iterators, except that the root
 // node is implicitly the first node of the function.
 //
-template <> struct GraphTraits<MachineFunction*> :
+template <> struct LLVM_CLASS_ABI GraphTraits<MachineFunction*> :
   public GraphTraits<MachineBasicBlock*> {
   static NodeRef getEntryNode(MachineFunction *F) { return &F->front(); }
 
@@ -1368,7 +1368,7 @@ template <> struct GraphTraits<MachineFunction*> :
 
   static unsigned       size       (MachineFunction *F) { return F->size(); }
 };
-template <> struct GraphTraits<const MachineFunction*> :
+template <> struct LLVM_CLASS_ABI GraphTraits<const MachineFunction*> :
   public GraphTraits<const MachineBasicBlock*> {
   static NodeRef getEntryNode(const MachineFunction *F) { return &F->front(); }
 
@@ -1393,13 +1393,13 @@ template <> struct GraphTraits<const MachineFunction*> :
 // a function is considered to be when traversing the predecessor edges of a BB
 // instead of the successor edges.
 //
-template <> struct GraphTraits<Inverse<MachineFunction*>> :
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<MachineFunction*>> :
   public GraphTraits<Inverse<MachineBasicBlock*>> {
   static NodeRef getEntryNode(Inverse<MachineFunction *> G) {
     return &G.Graph->front();
   }
 };
-template <> struct GraphTraits<Inverse<const MachineFunction*>> :
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<const MachineFunction*>> :
   public GraphTraits<Inverse<const MachineBasicBlock*>> {
   static NodeRef getEntryNode(Inverse<const MachineFunction *> G) {
     return &G.Graph->front();
@@ -1407,7 +1407,7 @@ template <> struct GraphTraits<Inverse<const MachineFunction*>> :
 };
 
 class MachineFunctionAnalysisManager;
-void verifyMachineFunction(MachineFunctionAnalysisManager *,
+LLVM_FUNC_ABI void verifyMachineFunction(MachineFunctionAnalysisManager *,
                            const std::string &Banner,
                            const MachineFunction &MF);
 
diff --git a/llvm/include/llvm/CodeGen/MachineFunctionPass.h b/llvm/include/llvm/CodeGen/MachineFunctionPass.h
index fa92103d414b060..d54f582a864fe6a 100644
--- a/llvm/include/llvm/CodeGen/MachineFunctionPass.h
+++ b/llvm/include/llvm/CodeGen/MachineFunctionPass.h
@@ -28,7 +28,7 @@ namespace llvm {
 /// allow convenient creation of passes that operate on the MachineFunction
 /// representation. Instead of overriding runOnFunction, subclasses
 /// override runOnMachineFunction.
-class MachineFunctionPass : public FunctionPass {
+class LLVM_CLASS_ABI MachineFunctionPass : public FunctionPass {
 public:
   bool doInitialization(Module&) override {
     // Cache the properties info at module-init time so we don't have to
diff --git a/llvm/include/llvm/CodeGen/MachineInstr.h b/llvm/include/llvm/CodeGen/MachineInstr.h
index 17f8c07c439a07d..b7802dd0aea66ec 100644
--- a/llvm/include/llvm/CodeGen/MachineInstr.h
+++ b/llvm/include/llvm/CodeGen/MachineInstr.h
@@ -65,7 +65,7 @@ class TargetRegisterInfo;
 /// MachineFunction is deleted, all the contained MachineInstrs are deallocated
 /// without having their destructor called.
 ///
-class MachineInstr
+class LLVM_CLASS_ABI MachineInstr
     : public ilist_node_with_parent<MachineInstr, MachineBasicBlock,
                                     ilist_sentinel_tracking<true>> {
 public:
@@ -2023,7 +2023,7 @@ class MachineInstr
 /// instruction rather than by pointer value.
 /// The hashing and equality testing functions ignore definitions so this is
 /// useful for CSE, etc.
-struct MachineInstrExpressionTrait : DenseMapInfo<MachineInstr*> {
+struct LLVM_CLASS_ABI MachineInstrExpressionTrait : DenseMapInfo<MachineInstr*> {
   static inline MachineInstr *getEmptyKey() {
     return nullptr;
   }
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
index 622f9898fb93845..acb788d9743191e 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBuilder.h
@@ -67,7 +67,7 @@ enum {
 
 } // end namespace RegState
 
-class MachineInstrBuilder {
+class LLVM_CLASS_ABI MachineInstrBuilder {
   MachineFunction *MF = nullptr;
   MachineInstr *MI = nullptr;
 
@@ -333,7 +333,7 @@ class MachineInstrBuilder {
 
 /// Set of metadata that should be preserved when using BuildMI(). This provides
 /// a more convenient way of preserving DebugLoc and PCSections.
-class MIMetadata {
+class LLVM_CLASS_ABI MIMetadata {
 public:
   MIMetadata() = default;
   MIMetadata(DebugLoc DL, MDNode *PCSections = nullptr)
@@ -480,14 +480,14 @@ inline MachineInstrBuilder BuildMI(MachineBasicBlock *BB,
 /// for either a value in a register or a register-indirect
 /// address.  The convention is that a DBG_VALUE is indirect iff the
 /// second operand is an immediate.
-MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL,
+LLVM_FUNC_ABI MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL,
                             const MCInstrDesc &MCID, bool IsIndirect,
                             Register Reg, const MDNode *Variable,
                             const MDNode *Expr);
 
 /// This version of the builder builds a DBG_VALUE or DBG_VALUE_LIST intrinsic
 /// for a MachineOperand.
-MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL,
+LLVM_FUNC_ABI MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL,
                             const MCInstrDesc &MCID, bool IsIndirect,
                             ArrayRef<MachineOperand> MOs,
                             const MDNode *Variable, const MDNode *Expr);
@@ -495,7 +495,7 @@ MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL,
 /// This version of the builder builds a DBG_VALUE intrinsic
 /// for either a value in a register or a register-indirect
 /// address and inserts it at position I.
-MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
+LLVM_FUNC_ABI MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
                             MachineBasicBlock::iterator I, const DebugLoc &DL,
                             const MCInstrDesc &MCID, bool IsIndirect,
                             Register Reg, const MDNode *Variable,
@@ -503,25 +503,25 @@ MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
 
 /// This version of the builder builds a DBG_VALUE, DBG_INSTR_REF, or
 /// DBG_VALUE_LIST intrinsic for a machine operand and inserts it at position I.
-MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
+LLVM_FUNC_ABI MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
                             MachineBasicBlock::iterator I, const DebugLoc &DL,
                             const MCInstrDesc &MCID, bool IsIndirect,
                             ArrayRef<MachineOperand> MOs,
                             const MDNode *Variable, const MDNode *Expr);
 
 /// Clone a DBG_VALUE whose value has been spilled to FrameIndex.
-MachineInstr *buildDbgValueForSpill(MachineBasicBlock &BB,
+LLVM_FUNC_ABI MachineInstr *buildDbgValueForSpill(MachineBasicBlock &BB,
                                     MachineBasicBlock::iterator I,
                                     const MachineInstr &Orig, int FrameIndex,
                                     Register SpillReg);
-MachineInstr *
+LLVM_FUNC_ABI MachineInstr *
 buildDbgValueForSpill(MachineBasicBlock &BB, MachineBasicBlock::iterator I,
                       const MachineInstr &Orig, int FrameIndex,
                       SmallVectorImpl<const MachineOperand *> &SpilledOperands);
 
 /// Update a DBG_VALUE whose value has been spilled to FrameIndex. Useful when
 /// modifying an instruction in place while iterating over a basic block.
-void updateDbgValueForSpill(MachineInstr &Orig, int FrameIndex, Register Reg);
+LLVM_FUNC_ABI void updateDbgValueForSpill(MachineInstr &Orig, int FrameIndex, Register Reg);
 
 inline unsigned getDefRegState(bool B) {
   return B ? RegState::Define : 0;
@@ -565,7 +565,7 @@ inline unsigned getRegState(const MachineOperand &RegOp) {
 /// MIBundleBuilder can create a bundle from scratch by inserting new
 /// MachineInstrs one at a time, or it can create a bundle from a sequence of
 /// existing MachineInstrs in a basic block.
-class MIBundleBuilder {
+class LLVM_CLASS_ABI MIBundleBuilder {
   MachineBasicBlock &MBB;
   MachineBasicBlock::instr_iterator Begin;
   MachineBasicBlock::instr_iterator End;
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBundle.h b/llvm/include/llvm/CodeGen/MachineInstrBundle.h
index ea1943f1810e399..ac803009c708010 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBundle.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBundle.h
@@ -25,7 +25,7 @@ namespace llvm {
 /// IsInternalRead markers to MachineOperands which are defined inside the
 /// bundle, and it copies externally visible defs and uses to the BUNDLE
 /// instruction.
-void finalizeBundle(MachineBasicBlock &MBB,
+LLVM_FUNC_ABI void finalizeBundle(MachineBasicBlock &MBB,
                     MachineBasicBlock::instr_iterator FirstMI,
                     MachineBasicBlock::instr_iterator LastMI);
 
@@ -34,12 +34,12 @@ void finalizeBundle(MachineBasicBlock &MBB,
 /// used in cases where bundles are pre-determined by marking instructions
 /// with 'InsideBundle' marker. It returns the MBB instruction iterator that
 /// points to the end of the bundle.
-MachineBasicBlock::instr_iterator finalizeBundle(MachineBasicBlock &MBB,
+LLVM_FUNC_ABI MachineBasicBlock::instr_iterator finalizeBundle(MachineBasicBlock &MBB,
                     MachineBasicBlock::instr_iterator FirstMI);
 
 /// finalizeBundles - Finalize instruction bundles in the specified
 /// MachineFunction. Return true if any bundles are finalized.
-bool finalizeBundles(MachineFunction &MF);
+LLVM_FUNC_ABI bool finalizeBundles(MachineFunction &MF);
 
 /// Returns an iterator to the first instruction in the bundle containing \p I.
 inline MachineBasicBlock::instr_iterator getBundleStart(
@@ -92,7 +92,7 @@ inline MachineBasicBlock::const_instr_iterator getBundleEnd(
 ///   }
 ///
 template <typename ValueT>
-class MIBundleOperandIteratorBase
+class LLVM_CLASS_ABI MIBundleOperandIteratorBase
     : public iterator_facade_base<MIBundleOperandIteratorBase<ValueT>,
                                   std::forward_iterator_tag, ValueT> {
   MachineBasicBlock::instr_iterator InstrI, InstrE;
@@ -164,7 +164,7 @@ class MIBundleOperandIteratorBase
 /// MIBundleOperands - Iterate over all operands in a bundle of machine
 /// instructions.
 ///
-class MIBundleOperands : public MIBundleOperandIteratorBase<MachineOperand> {
+class LLVM_CLASS_ABI MIBundleOperands : public MIBundleOperandIteratorBase<MachineOperand> {
   /// Constructor for an iterator past the last iteration.
   MIBundleOperands(MachineBasicBlock::instr_iterator InstrE,
                    MachineInstr::mop_iterator OpE)
@@ -183,7 +183,7 @@ class MIBundleOperands : public MIBundleOperandIteratorBase<MachineOperand> {
 /// ConstMIBundleOperands - Iterate over all operands in a const bundle of
 /// machine instructions.
 ///
-class ConstMIBundleOperands
+class LLVM_CLASS_ABI ConstMIBundleOperands
     : public MIBundleOperandIteratorBase<const MachineOperand> {
 
   /// Constructor for an iterator past the last iteration.
@@ -216,7 +216,7 @@ inline iterator_range<MIBundleOperands> mi_bundle_ops(MachineInstr &MI) {
 /// VirtRegInfo - Information about a virtual register used by a set of
 /// operands.
 ///
-struct VirtRegInfo {
+struct LLVM_CLASS_ABI VirtRegInfo {
   /// Reads - One of the operands read the virtual register.  This does not
   /// include undef or internal use operands, see MO::readsReg().
   bool Reads;
@@ -238,20 +238,20 @@ struct VirtRegInfo {
 /// @param Ops When set, this vector will receive an (MI, OpNum) entry for
 ///            each operand referring to Reg.
 /// @returns A filled-in RegInfo struct.
-VirtRegInfo AnalyzeVirtRegInBundle(
+LLVM_FUNC_ABI VirtRegInfo AnalyzeVirtRegInBundle(
     MachineInstr &MI, Register Reg,
     SmallVectorImpl<std::pair<MachineInstr *, unsigned>> *Ops = nullptr);
 
 /// Return a pair of lane masks (reads, writes) indicating which lanes this
 /// instruction uses with Reg.
-std::pair<LaneBitmask, LaneBitmask>
+LLVM_FUNC_ABI std::pair<LaneBitmask, LaneBitmask>
 AnalyzeVirtRegLanesInBundle(const MachineInstr &MI, Register Reg,
                             const MachineRegisterInfo &MRI,
                             const TargetRegisterInfo &TRI);
 
 /// Information about how a physical register Reg is used by a set of
 /// operands.
-struct PhysRegInfo {
+struct LLVM_CLASS_ABI PhysRegInfo {
   /// There is a regmask operand indicating Reg is clobbered.
   /// \see MachineOperand::CreateRegMask().
   bool Clobbered;
@@ -289,7 +289,7 @@ struct PhysRegInfo {
 ///
 /// @param Reg The physical register to analyze.
 /// @returns A filled-in PhysRegInfo struct.
-PhysRegInfo AnalyzePhysRegInBundle(const MachineInstr &MI, Register Reg,
+LLVM_FUNC_ABI PhysRegInfo AnalyzePhysRegInBundle(const MachineInstr &MI, Register Reg,
                                    const TargetRegisterInfo *TRI);
 
 } // End llvm namespace
diff --git a/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h b/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
index 68c73850b5d6ba9..ce2e0440cfffac8 100644
--- a/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
+++ b/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h
@@ -23,25 +23,25 @@
 namespace llvm {
 
 template <class T, bool IsReverse> struct MachineInstrBundleIteratorTraits;
-template <class T> struct MachineInstrBundleIteratorTraits<T, false> {
+template <class T> struct LLVM_CLASS_ABI MachineInstrBundleIteratorTraits<T, false> {
   using list_type = simple_ilist<T, ilist_sentinel_tracking<true>>;
   using instr_iterator = typename list_type::iterator;
   using nonconst_instr_iterator = typename list_type::iterator;
   using const_instr_iterator = typename list_type::const_iterator;
 };
-template <class T> struct MachineInstrBundleIteratorTraits<T, true> {
+template <class T> struct LLVM_CLASS_ABI MachineInstrBundleIteratorTraits<T, true> {
   using list_type = simple_ilist<T, ilist_sentinel_tracking<true>>;
   using instr_iterator = typename list_type::reverse_iterator;
   using nonconst_instr_iterator = typename list_type::reverse_iterator;
   using const_instr_iterator = typename list_type::const_reverse_iterator;
 };
-template <class T> struct MachineInstrBundleIteratorTraits<const T, false> {
+template <class T> struct LLVM_CLASS_ABI MachineInstrBundleIteratorTraits<const T, false> {
   using list_type = simple_ilist<T, ilist_sentinel_tracking<true>>;
   using instr_iterator = typename list_type::const_iterator;
   using nonconst_instr_iterator = typename list_type::iterator;
   using const_instr_iterator = typename list_type::const_iterator;
 };
-template <class T> struct MachineInstrBundleIteratorTraits<const T, true> {
+template <class T> struct LLVM_CLASS_ABI MachineInstrBundleIteratorTraits<const T, true> {
   using list_type = simple_ilist<T, ilist_sentinel_tracking<true>>;
   using instr_iterator = typename list_type::const_reverse_iterator;
   using nonconst_instr_iterator = typename list_type::reverse_iterator;
@@ -49,7 +49,7 @@ template <class T> struct MachineInstrBundleIteratorTraits<const T, true> {
 };
 
 template <bool IsReverse> struct MachineInstrBundleIteratorHelper;
-template <> struct MachineInstrBundleIteratorHelper<false> {
+template <> struct LLVM_CLASS_ABI MachineInstrBundleIteratorHelper<false> {
   /// Get the beginning of the current bundle.
   template <class Iterator> static Iterator getBundleBegin(Iterator I) {
     if (!I.isEnd())
@@ -77,7 +77,7 @@ template <> struct MachineInstrBundleIteratorHelper<false> {
   }
 };
 
-template <> struct MachineInstrBundleIteratorHelper<true> {
+template <> struct LLVM_CLASS_ABI MachineInstrBundleIteratorHelper<true> {
   /// Get the beginning of the current bundle.
   template <class Iterator> static Iterator getBundleBegin(Iterator I) {
     return MachineInstrBundleIteratorHelper<false>::getBundleBegin(
@@ -106,7 +106,7 @@ template <> struct MachineInstrBundleIteratorHelper<true> {
 /// MachineBasicBlock iterator that automatically skips over MIs that are
 /// inside bundles (i.e. walk top level MIs only).
 template <typename Ty, bool IsReverse = false>
-class MachineInstrBundleIterator : MachineInstrBundleIteratorHelper<IsReverse> {
+class LLVM_CLASS_ABI MachineInstrBundleIterator : MachineInstrBundleIteratorHelper<IsReverse> {
   using Traits = MachineInstrBundleIteratorTraits<Ty, IsReverse>;
   using instr_iterator = typename Traits::instr_iterator;
 
diff --git a/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h b/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
index 9ba3e2d6292af36..45d2039e872dce6 100644
--- a/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
@@ -32,7 +32,7 @@ class raw_ostream;
 
 /// MachineJumpTableEntry - One jump table in the jump table info.
 ///
-struct MachineJumpTableEntry {
+struct LLVM_CLASS_ABI MachineJumpTableEntry {
   /// MBBs - The vector of basic blocks from which to create the jump table.
   std::vector<MachineBasicBlock*> MBBs;
 
@@ -40,7 +40,7 @@ struct MachineJumpTableEntry {
   : MBBs(M) {}
 };
 
-class MachineJumpTableInfo {
+class LLVM_CLASS_ABI MachineJumpTableInfo {
 public:
   /// JTEntryKind - This enum indicates how each entry of the jump table is
   /// represented and emitted.
@@ -136,7 +136,7 @@ class MachineJumpTableInfo {
 ///   %jump-table.5       - a jump table entry with index == 5.
 ///
 /// Usage: OS << printJumpTableEntryReference(Idx) << '\n';
-Printable printJumpTableEntryReference(unsigned Idx);
+LLVM_FUNC_ABI Printable printJumpTableEntryReference(unsigned Idx);
 
 } // End llvm namespace
 
diff --git a/llvm/include/llvm/CodeGen/MachineLoopInfo.h b/llvm/include/llvm/CodeGen/MachineLoopInfo.h
index d40be0a7d8d1bc8..a5fbb64074d1769 100644
--- a/llvm/include/llvm/CodeGen/MachineLoopInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineLoopInfo.h
@@ -42,7 +42,7 @@ class MachineDominatorTree;
 class MachineLoop;
 extern template class LoopBase<MachineBasicBlock, MachineLoop>;
 
-class MachineLoop : public LoopBase<MachineBasicBlock, MachineLoop> {
+class LLVM_CLASS_ABI MachineLoop : public LoopBase<MachineBasicBlock, MachineLoop> {
 public:
   /// Return the "top" block in the loop, which is the first block in the linear
   /// layout, ignoring any parts of the loop not contiguous with the part that
@@ -87,7 +87,7 @@ class MachineLoop : public LoopBase<MachineBasicBlock, MachineLoop> {
 // Implementation in LoopInfoImpl.h
 extern template class LoopInfoBase<MachineBasicBlock, MachineLoop>;
 
-class MachineLoopInfo : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachineLoopInfo : public MachineFunctionPass {
   friend class LoopBase<MachineBasicBlock, MachineLoop>;
 
   LoopInfoBase<MachineBasicBlock, MachineLoop> LI;
@@ -182,7 +182,7 @@ class MachineLoopInfo : public MachineFunctionPass {
 };
 
 // Allow clients to walk the list of nested loops...
-template <> struct GraphTraits<const MachineLoop*> {
+template <> struct LLVM_CLASS_ABI GraphTraits<const MachineLoop*> {
   using NodeRef = const MachineLoop *;
   using ChildIteratorType = MachineLoopInfo::iterator;
 
@@ -191,7 +191,7 @@ template <> struct GraphTraits<const MachineLoop*> {
   static ChildIteratorType child_end(NodeRef N) { return N->end(); }
 };
 
-template <> struct GraphTraits<MachineLoop*> {
+template <> struct LLVM_CLASS_ABI GraphTraits<MachineLoop*> {
   using NodeRef = MachineLoop *;
   using ChildIteratorType = MachineLoopInfo::iterator;
 
diff --git a/llvm/include/llvm/CodeGen/MachineLoopUtils.h b/llvm/include/llvm/CodeGen/MachineLoopUtils.h
index 022f9a69fafb789..f441faff43a89e3 100644
--- a/llvm/include/llvm/CodeGen/MachineLoopUtils.h
+++ b/llvm/include/llvm/CodeGen/MachineLoopUtils.h
@@ -33,7 +33,7 @@ enum LoopPeelDirection {
 /// clone so as to execute a single iteration.
 ///
 /// The trip count of Loop is not updated.
-MachineBasicBlock *PeelSingleBlockLoop(LoopPeelDirection Direction,
+LLVM_FUNC_ABI MachineBasicBlock *PeelSingleBlockLoop(LoopPeelDirection Direction,
                                        MachineBasicBlock *Loop,
                                        MachineRegisterInfo &MRI,
                                        const TargetInstrInfo *TII);
diff --git a/llvm/include/llvm/CodeGen/MachineMemOperand.h b/llvm/include/llvm/CodeGen/MachineMemOperand.h
index 93e1ba1b1009eb9..fb4786312f30b13 100644
--- a/llvm/include/llvm/CodeGen/MachineMemOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineMemOperand.h
@@ -36,7 +36,7 @@ class TargetInstrInfo;
 /// This class contains a discriminated union of information about pointers in
 /// memory operands, relating them back to LLVM IR or to virtual locations (such
 /// as frame indices) that are exposed during codegen.
-struct MachinePointerInfo {
+struct LLVM_CLASS_ABI MachinePointerInfo {
   /// This is the IR pointer value for the access, or it is null if unknown.
   PointerUnion<const Value *, const PseudoSourceValue *> V;
 
@@ -124,7 +124,7 @@ struct MachinePointerInfo {
 /// objects can be used to represent loads and stores to memory locations
 /// that aren't explicit in the regular LLVM IR.
 ///
-class MachineMemOperand {
+class LLVM_CLASS_ABI MachineMemOperand {
 public:
   /// Flags values. These may be or'd together.
   enum Flags : uint16_t {
diff --git a/llvm/include/llvm/CodeGen/MachineModuleInfo.h b/llvm/include/llvm/CodeGen/MachineModuleInfo.h
index f629643b1bf14f0..66b0746ebff5832 100644
--- a/llvm/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineModuleInfo.h
@@ -54,7 +54,7 @@ class Module;
 /// accessed/created with MachineModuleInfo::getObjFileInfo and destroyed when
 /// the MachineModuleInfo is destroyed.
 ///
-class MachineModuleInfoImpl {
+class LLVM_CLASS_ABI MachineModuleInfoImpl {
 public:
   using StubValueTy = PointerIntPair<MCSymbol *, 1, bool>;
   using SymbolListTy = std::vector<std::pair<MCSymbol *, StubValueTy>>;
@@ -72,7 +72,7 @@ class MachineModuleInfoImpl {
 /// made by different debugging and exception handling schemes and reformated
 /// for specific use.
 ///
-class MachineModuleInfo {
+class LLVM_CLASS_ABI MachineModuleInfo {
   friend class MachineModuleInfoWrapperPass;
   friend class MachineModuleAnalysis;
 
@@ -201,7 +201,7 @@ class MachineModuleInfo {
   }
 }; // End class MachineModuleInfo
 
-class MachineModuleInfoWrapperPass : public ImmutablePass {
+class LLVM_CLASS_ABI MachineModuleInfoWrapperPass : public ImmutablePass {
   MachineModuleInfo MMI;
 
 public:
@@ -220,7 +220,7 @@ class MachineModuleInfoWrapperPass : public ImmutablePass {
 };
 
 /// An analysis that produces \c MachineInfo for a module.
-class MachineModuleAnalysis : public AnalysisInfoMixin<MachineModuleAnalysis> {
+class LLVM_CLASS_ABI MachineModuleAnalysis : public AnalysisInfoMixin<MachineModuleAnalysis> {
   friend AnalysisInfoMixin<MachineModuleAnalysis>;
   static AnalysisKey Key;
 
diff --git a/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h b/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h
index 0a2c820df98ba93..6aa923371acfba1 100644
--- a/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h
+++ b/llvm/include/llvm/CodeGen/MachineModuleInfoImpls.h
@@ -26,7 +26,7 @@ class MCSymbol;
 
 /// MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation
 /// for MachO targets.
-class MachineModuleInfoMachO : public MachineModuleInfoImpl {
+class LLVM_CLASS_ABI MachineModuleInfoMachO : public MachineModuleInfoImpl {
   /// GVStubs - Darwin '$non_lazy_ptr' stubs.  The key is something like
   /// "Lfoo$non_lazy_ptr", the value is something like "_foo". The extra bit
   /// is true if this GV is external.
@@ -61,7 +61,7 @@ class MachineModuleInfoMachO : public MachineModuleInfoImpl {
 
 /// MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation
 /// for ELF targets.
-class MachineModuleInfoELF : public MachineModuleInfoImpl {
+class LLVM_CLASS_ABI MachineModuleInfoELF : public MachineModuleInfoImpl {
   /// GVStubs - These stubs are used to materialize global addresses in PIC
   /// mode.
   DenseMap<MCSymbol *, StubValueTy> GVStubs;
@@ -83,7 +83,7 @@ class MachineModuleInfoELF : public MachineModuleInfoImpl {
 
 /// MachineModuleInfoCOFF - This is a MachineModuleInfoImpl implementation
 /// for COFF targets.
-class MachineModuleInfoCOFF : public MachineModuleInfoImpl {
+class LLVM_CLASS_ABI MachineModuleInfoCOFF : public MachineModuleInfoImpl {
   /// GVStubs - These stubs are used to materialize global addresses in PIC
   /// mode.
   DenseMap<MCSymbol *, StubValueTy> GVStubs;
@@ -105,7 +105,7 @@ class MachineModuleInfoCOFF : public MachineModuleInfoImpl {
 
 /// MachineModuleInfoWasm - This is a MachineModuleInfoImpl implementation
 /// for Wasm targets.
-class MachineModuleInfoWasm : public MachineModuleInfoImpl {
+class LLVM_CLASS_ABI MachineModuleInfoWasm : public MachineModuleInfoImpl {
   virtual void anchor(); // Out of line virtual method.
 
 public:
diff --git a/llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h b/llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h
index 19dbeeec0aec505..4217aef528732eb 100644
--- a/llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h
+++ b/llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h
@@ -20,7 +20,7 @@ class MachineModuleInfo;
 class MachineFunction;
 class Module;
 
-class MachineModuleSlotTracker : public ModuleSlotTracker {
+class LLVM_CLASS_ABI MachineModuleSlotTracker : public ModuleSlotTracker {
   const Function &TheFunction;
   const MachineModuleInfo &TheMMI;
   unsigned MDNStartSlot = 0, MDNEndSlot = 0;
diff --git a/llvm/include/llvm/CodeGen/MachineOperand.h b/llvm/include/llvm/CodeGen/MachineOperand.h
index c7c6e609f75e0bf..d219bf19c732577 100644
--- a/llvm/include/llvm/CodeGen/MachineOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineOperand.h
@@ -46,7 +46,7 @@ class MCSymbol;
 /// MachineRegisterInfo::moveOperands(), and MF::DeleteMachineInstr() depend on
 /// not having to call the MachineOperand destructor.
 ///
-class MachineOperand {
+class LLVM_CLASS_ABI MachineOperand {
 public:
   enum MachineOperandType : unsigned char {
     MO_Register,          ///< Register operand.
@@ -764,7 +764,7 @@ class MachineOperand {
   /// isIdenticalTo uses for comparison. It is thus suited for use in hash
   /// tables which use that function for equality comparisons only. This must
   /// stay exactly in sync with isIdenticalTo above.
-  friend hash_code hash_value(const MachineOperand &MO);
+  friend LLVM_FUNC_ABI hash_code hash_value(const MachineOperand &MO);
 
   /// ChangeToImmediate - Replace this operand with a new immediate operand of
   /// the specified value.  If an operand is known to be an immediate already,
@@ -1013,7 +1013,7 @@ class MachineOperand {
   }
 };
 
-template <> struct DenseMapInfo<MachineOperand> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<MachineOperand> {
   static MachineOperand getEmptyKey() {
     return MachineOperand(static_cast<MachineOperand::MachineOperandType>(
         MachineOperand::MO_Empty));
@@ -1042,7 +1042,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MachineOperand &MO) {
 
 // See friend declaration above. This additional declaration is required in
 // order to compile LLVM with IBM xlC compiler.
-hash_code hash_value(const MachineOperand &MO);
+LLVM_FUNC_ABI hash_code hash_value(const MachineOperand &MO);
 } // namespace llvm
 
 #endif
diff --git a/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h b/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
index 45728b8f3f2ceb7..922c8950c19224d 100644
--- a/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
+++ b/llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
@@ -28,7 +28,7 @@ class MachineInstr;
 
 /// Common features for diagnostics dealing with optimization remarks
 /// that are used by machine passes.
-class DiagnosticInfoMIROptimization : public DiagnosticInfoOptimizationBase {
+class LLVM_CLASS_ABI DiagnosticInfoMIROptimization : public DiagnosticInfoOptimizationBase {
 public:
   DiagnosticInfoMIROptimization(enum DiagnosticKind Kind, const char *PassName,
                                 StringRef RemarkName,
@@ -56,7 +56,7 @@ class DiagnosticInfoMIROptimization : public DiagnosticInfoOptimizationBase {
 };
 
 /// Diagnostic information for applied optimization remarks.
-class MachineOptimizationRemark : public DiagnosticInfoMIROptimization {
+class LLVM_CLASS_ABI MachineOptimizationRemark : public DiagnosticInfoMIROptimization {
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass=, then the diagnostic will
@@ -82,7 +82,7 @@ class MachineOptimizationRemark : public DiagnosticInfoMIROptimization {
 };
 
 /// Diagnostic information for missed-optimization remarks.
-class MachineOptimizationRemarkMissed : public DiagnosticInfoMIROptimization {
+class LLVM_CLASS_ABI MachineOptimizationRemarkMissed : public DiagnosticInfoMIROptimization {
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass-missed=, then the
@@ -108,7 +108,7 @@ class MachineOptimizationRemarkMissed : public DiagnosticInfoMIROptimization {
 };
 
 /// Diagnostic information for optimization analysis remarks.
-class MachineOptimizationRemarkAnalysis : public DiagnosticInfoMIROptimization {
+class LLVM_CLASS_ABI MachineOptimizationRemarkAnalysis : public DiagnosticInfoMIROptimization {
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass-analysis=, then the
@@ -150,7 +150,7 @@ using MNV = DiagnosticInfoMIROptimization::MachineArgument;
 /// along with the reasons for it.  Hotness information of the corresponding
 /// code region can be included in the remark if DiagnosticsHotnessRequested is
 /// enabled in the LLVM context.
-class MachineOptimizationRemarkEmitter {
+class LLVM_CLASS_ABI MachineOptimizationRemarkEmitter {
 public:
   MachineOptimizationRemarkEmitter(MachineFunction &MF,
                                    MachineBlockFrequencyInfo *MBFI)
@@ -218,7 +218,7 @@ class MachineOptimizationRemarkEmitter {
 /// Note that this pass shouldn't generally be marked as preserved by other
 /// passes.  It's holding onto BFI, so if the pass does not preserve BFI, BFI
 /// could be freed.
-class MachineOptimizationRemarkEmitterPass : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachineOptimizationRemarkEmitterPass : public MachineFunctionPass {
   std::unique_ptr<MachineOptimizationRemarkEmitter> ORE;
 
 public:
diff --git a/llvm/include/llvm/CodeGen/MachineOutliner.h b/llvm/include/llvm/CodeGen/MachineOutliner.h
index 88d7ca3b3f3cd72..03d84a569ad0d41 100644
--- a/llvm/include/llvm/CodeGen/MachineOutliner.h
+++ b/llvm/include/llvm/CodeGen/MachineOutliner.h
@@ -35,7 +35,7 @@ enum InstrType { Legal, LegalTerminator, Illegal, Invisible };
 
 /// An individual sequence of instructions to be replaced with a call to
 /// an outlined function.
-struct Candidate {
+struct LLVM_CLASS_ABI Candidate {
 private:
   /// The start index of this \p Candidate in the instruction list.
   unsigned StartIdx = 0;
@@ -212,7 +212,7 @@ struct Candidate {
 
 /// The information necessary to create an outlined function for some
 /// class of candidate.
-struct OutlinedFunction {
+struct LLVM_CLASS_ABI OutlinedFunction {
 
 public:
   std::vector<Candidate> Candidates;
diff --git a/llvm/include/llvm/CodeGen/MachinePassManager.h b/llvm/include/llvm/CodeGen/MachinePassManager.h
index 77174c23bd4fcb6..34191bcdc9f1de2 100644
--- a/llvm/include/llvm/CodeGen/MachinePassManager.h
+++ b/llvm/include/llvm/CodeGen/MachinePassManager.h
@@ -39,7 +39,7 @@ class MachineFunction;
 extern template class AnalysisManager<MachineFunction>;
 
 /// An AnalysisManager<MachineFunction> that also exposes IR analysis results.
-class MachineFunctionAnalysisManager : public AnalysisManager<MachineFunction> {
+class LLVM_CLASS_ABI MachineFunctionAnalysisManager : public AnalysisManager<MachineFunction> {
 public:
   using Base = AnalysisManager<MachineFunction>;
 
@@ -130,7 +130,7 @@ extern template class PassManager<MachineFunction>;
 ///
 /// - Support codegening in the SCC order. Users include interprocedural
 ///   register allocation (IPRA).
-class MachineFunctionPassManager
+class LLVM_CLASS_ABI MachineFunctionPassManager
     : public PassManager<MachineFunction, MachineFunctionAnalysisManager> {
   using Base = PassManager<MachineFunction, MachineFunctionAnalysisManager>;
 
diff --git a/llvm/include/llvm/CodeGen/MachinePassRegistry.h b/llvm/include/llvm/CodeGen/MachinePassRegistry.h
index e6bcf2f3994cb50..ac5ccb9d648c2be 100644
--- a/llvm/include/llvm/CodeGen/MachinePassRegistry.h
+++ b/llvm/include/llvm/CodeGen/MachinePassRegistry.h
@@ -30,7 +30,7 @@ namespace llvm {
 /// registration list.
 ///
 //===----------------------------------------------------------------------===//
-template <class PassCtorTy> class MachinePassRegistryListener {
+template <class PassCtorTy> class LLVM_CLASS_ABI MachinePassRegistryListener {
   virtual void anchor() {}
 
 public:
@@ -46,7 +46,7 @@ template <class PassCtorTy> class MachinePassRegistryListener {
 /// MachinePassRegistryNode - Machine pass node stored in registration list.
 ///
 //===----------------------------------------------------------------------===//
-template <typename PassCtorTy> class MachinePassRegistryNode {
+template <typename PassCtorTy> class LLVM_CLASS_ABI MachinePassRegistryNode {
 private:
   MachinePassRegistryNode *Next = nullptr; // Next function pass in list.
   StringRef Name;                       // Name of function pass.
@@ -71,7 +71,7 @@ template <typename PassCtorTy> class MachinePassRegistryNode {
 /// MachinePassRegistry - Track the registration of machine passes.
 ///
 //===----------------------------------------------------------------------===//
-template <typename PassCtorTy> class MachinePassRegistry {
+template <typename PassCtorTy> class LLVM_CLASS_ABI MachinePassRegistry {
 private:
   MachinePassRegistryNode<PassCtorTy> *List; // List of registry nodes.
   PassCtorTy Default;                        // Default function pass creator.
@@ -133,7 +133,7 @@ template <typename PassCtorTy> class MachinePassRegistry {
 ///
 //===----------------------------------------------------------------------===//
 template <class RegistryClass>
-class RegisterPassParser
+class LLVM_CLASS_ABI RegisterPassParser
     : public MachinePassRegistryListener<
           typename RegistryClass::FunctionPassCtor>,
       public cl::parser<typename RegistryClass::FunctionPassCtor> {
diff --git a/llvm/include/llvm/CodeGen/MachinePipeliner.h b/llvm/include/llvm/CodeGen/MachinePipeliner.h
index 12cd22116d719d6..87f8b43b1e16d01 100644
--- a/llvm/include/llvm/CodeGen/MachinePipeliner.h
+++ b/llvm/include/llvm/CodeGen/MachinePipeliner.h
@@ -59,12 +59,12 @@ class AAResults;
 class NodeSet;
 class SMSchedule;
 
-extern cl::opt<bool> SwpEnableCopyToPhi;
-extern cl::opt<int> SwpForceIssueWidth;
+LLVM_FUNC_ABI extern cl::opt<bool> SwpEnableCopyToPhi;
+LLVM_FUNC_ABI extern cl::opt<int> SwpForceIssueWidth;
 
 /// The main class in the implementation of the target independent
 /// software pipeliner pass.
-class MachinePipeliner : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachinePipeliner : public MachineFunctionPass {
 public:
   MachineFunction *MF = nullptr;
   MachineOptimizationRemarkEmitter *ORE = nullptr;
@@ -112,7 +112,7 @@ class MachinePipeliner : public MachineFunctionPass {
 
 /// This class builds the dependence graph for the instructions in a loop,
 /// and attempts to schedule the instructions using the SMS algorithm.
-class SwingSchedulerDAG : public ScheduleDAGInstrs {
+class LLVM_CLASS_ABI SwingSchedulerDAG : public ScheduleDAGInstrs {
   MachinePipeliner &Pass;
   /// The minimum initiation interval between iterations for this schedule.
   unsigned MII = 0;
@@ -321,7 +321,7 @@ class SwingSchedulerDAG : public ScheduleDAGInstrs {
 
 /// A NodeSet contains a set of SUnit DAG nodes with additional information
 /// that assigns a priority to the set.
-class NodeSet {
+class LLVM_CLASS_ABI NodeSet {
   SetVector<SUnit *> Nodes;
   bool HasRecurrence = false;
   unsigned RecMII = 0;
@@ -444,7 +444,7 @@ class NodeSet {
 // existing Subtargets, so that SmallVector don't need to resize too often.
 static const int DefaultProcResSize = 16;
 
-class ResourceManager {
+class LLVM_CLASS_ABI ResourceManager {
 private:
   const MCSubtargetInfo *STI;
   const MCSchedModel &SM;
@@ -532,7 +532,7 @@ class ResourceManager {
 ///
 /// The SMS algorithm allows negative values for cycles, so the first cycle
 /// in the schedule is the smallest cycle value.
-class SMSchedule {
+class LLVM_CLASS_ABI SMSchedule {
 private:
   /// Map from execution cycle to instructions.
   DenseMap<int, std::deque<SUnit *>> ScheduledInstrs;
diff --git a/llvm/include/llvm/CodeGen/MachinePostDominators.h b/llvm/include/llvm/CodeGen/MachinePostDominators.h
index 05543581f2695fb..c805c34012007a1 100644
--- a/llvm/include/llvm/CodeGen/MachinePostDominators.h
+++ b/llvm/include/llvm/CodeGen/MachinePostDominators.h
@@ -25,7 +25,7 @@ namespace llvm {
 /// MachinePostDominatorTree - an analysis pass wrapper for DominatorTree
 /// used to compute the post-dominator tree for MachineFunctions.
 ///
-class MachinePostDominatorTree : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachinePostDominatorTree : public MachineFunctionPass {
   using PostDomTreeT = PostDomTreeBase<MachineBasicBlock>;
   std::unique_ptr<PostDomTreeT> PDT;
 
diff --git a/llvm/include/llvm/CodeGen/MachineRegionInfo.h b/llvm/include/llvm/CodeGen/MachineRegionInfo.h
index 381fe855ec73748..af0e30a33e36f4a 100644
--- a/llvm/include/llvm/CodeGen/MachineRegionInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineRegionInfo.h
@@ -28,7 +28,7 @@ class MachineRegion;
 class MachineRegionNode;
 class MachineRegionInfo;
 
-template <> struct RegionTraits<MachineFunction> {
+template <> struct LLVM_CLASS_ABI RegionTraits<MachineFunction> {
   using FuncT = MachineFunction;
   using BlockT = MachineBasicBlock;
   using RegionT = MachineRegion;
@@ -47,7 +47,7 @@ template <> struct RegionTraits<MachineFunction> {
   }
 };
 
-class MachineRegionNode : public RegionNodeBase<RegionTraits<MachineFunction>> {
+class LLVM_CLASS_ABI MachineRegionNode : public RegionNodeBase<RegionTraits<MachineFunction>> {
 public:
   inline MachineRegionNode(MachineRegion *Parent, MachineBasicBlock *Entry,
                            bool isSubRegion = false)
@@ -59,7 +59,7 @@ class MachineRegionNode : public RegionNodeBase<RegionTraits<MachineFunction>> {
   }
 };
 
-class MachineRegion : public RegionBase<RegionTraits<MachineFunction>> {
+class LLVM_CLASS_ABI MachineRegion : public RegionBase<RegionTraits<MachineFunction>> {
 public:
   MachineRegion(MachineBasicBlock *Entry, MachineBasicBlock *Exit,
                 MachineRegionInfo *RI, MachineDominatorTree *DT,
@@ -71,7 +71,7 @@ class MachineRegion : public RegionBase<RegionTraits<MachineFunction>> {
   }
 };
 
-class MachineRegionInfo : public RegionInfoBase<RegionTraits<MachineFunction>> {
+class LLVM_CLASS_ABI MachineRegionInfo : public RegionInfoBase<RegionTraits<MachineFunction>> {
 public:
   explicit MachineRegionInfo();
   ~MachineRegionInfo() override;
@@ -83,7 +83,7 @@ class MachineRegionInfo : public RegionInfoBase<RegionTraits<MachineFunction>> {
                    MachinePostDominatorTree *PDT, MachineDominanceFrontier *DF);
 };
 
-class MachineRegionInfoPass : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachineRegionInfoPass : public MachineFunctionPass {
   MachineRegionInfo RI;
 
 public:
@@ -135,7 +135,7 @@ RegionGraphTraits(MachineRegion, MachineRegionNode);
 RegionGraphTraits(const MachineRegion, const MachineRegionNode);
 
 template <>
-struct GraphTraits<MachineRegionInfo *>
+struct LLVM_CLASS_ABI GraphTraits<MachineRegionInfo *>
     : public GraphTraits<FlatIt<MachineRegionNode *>> {
   using nodes_iterator = df_iterator<NodeRef, df_iterator_default_set<NodeRef>,
                                      false, GraphTraits<FlatIt<NodeRef>>>;
@@ -155,7 +155,7 @@ struct GraphTraits<MachineRegionInfo *>
 };
 
 template <>
-struct GraphTraits<MachineRegionInfoPass *>
+struct LLVM_CLASS_ABI GraphTraits<MachineRegionInfoPass *>
     : public GraphTraits<MachineRegionInfo *> {
   using nodes_iterator = df_iterator<NodeRef, df_iterator_default_set<NodeRef>,
                                      false, GraphTraits<FlatIt<NodeRef>>>;
diff --git a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
index 65f94fabb52e623..de0e7e2666b42f0 100644
--- a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
@@ -49,7 +49,7 @@ using RegClassOrRegBank =
 /// MachineRegisterInfo - Keep track of information for virtual and physical
 /// registers, including vreg register classes, use/def chains for registers,
 /// etc.
-class MachineRegisterInfo {
+class LLVM_CLASS_ABI MachineRegisterInfo {
 public:
   class Delegate {
     virtual void anchor();
@@ -1230,7 +1230,7 @@ class MachineRegisterInfo {
 /// Iterate over the pressure sets affected by the given physical or virtual
 /// register. If Reg is physical, it must be a register unit (from
 /// MCRegUnitIterator).
-class PSetIterator {
+class LLVM_CLASS_ABI PSetIterator {
   const int *PSet = nullptr;
   unsigned Weight = 0;
 
diff --git a/llvm/include/llvm/CodeGen/MachineSSAContext.h b/llvm/include/llvm/CodeGen/MachineSSAContext.h
index 6d0c24f1f450846..db2d8980738d697 100644
--- a/llvm/include/llvm/CodeGen/MachineSSAContext.h
+++ b/llvm/include/llvm/CodeGen/MachineSSAContext.h
@@ -35,7 +35,7 @@ inline unsigned pred_size(const MachineBasicBlock *BB) {
 }
 inline auto instrs(const MachineBasicBlock &BB) { return BB.instrs(); }
 
-template <> class GenericSSAContext<MachineFunction> {
+template <> class LLVM_CLASS_ABI GenericSSAContext<MachineFunction> {
   const MachineRegisterInfo *RegInfo = nullptr;
   MachineFunction *MF = nullptr;
 
diff --git a/llvm/include/llvm/CodeGen/MachineSSAUpdater.h b/llvm/include/llvm/CodeGen/MachineSSAUpdater.h
index d522a5b45fd9751..54465906610f14f 100644
--- a/llvm/include/llvm/CodeGen/MachineSSAUpdater.h
+++ b/llvm/include/llvm/CodeGen/MachineSSAUpdater.h
@@ -32,7 +32,7 @@ template<typename T> class SSAUpdaterTraits;
 /// registers defined in multiple blocks.  This is used when code duplication
 /// or another unstructured transformation wants to rewrite a set of uses of one
 /// vreg with uses of a set of vregs.
-class MachineSSAUpdater {
+class LLVM_CLASS_ABI MachineSSAUpdater {
   friend class SSAUpdaterTraits<MachineSSAUpdater>;
 
 private:
diff --git a/llvm/include/llvm/CodeGen/MachineScheduler.h b/llvm/include/llvm/CodeGen/MachineScheduler.h
index c6b9fb3756c9064..17d4c147bf5417d 100644
--- a/llvm/include/llvm/CodeGen/MachineScheduler.h
+++ b/llvm/include/llvm/CodeGen/MachineScheduler.h
@@ -100,15 +100,15 @@
 
 namespace llvm {
 
-extern cl::opt<bool> ForceTopDown;
-extern cl::opt<bool> ForceBottomUp;
-extern cl::opt<bool> VerifyScheduling;
+LLVM_FUNC_ABI extern cl::opt<bool> ForceTopDown;
+LLVM_FUNC_ABI extern cl::opt<bool> ForceBottomUp;
+LLVM_FUNC_ABI extern cl::opt<bool> VerifyScheduling;
 #ifndef NDEBUG
 extern cl::opt<bool> ViewMISchedDAGs;
 extern cl::opt<bool> PrintDAGs;
 #else
-extern const bool ViewMISchedDAGs;
-extern const bool PrintDAGs;
+LLVM_FUNC_ABI extern const bool ViewMISchedDAGs;
+LLVM_FUNC_ABI extern const bool PrintDAGs;
 #endif
 
 class AAResults;
@@ -126,7 +126,7 @@ class TargetRegisterInfo;
 
 /// MachineSchedContext provides enough context from the MachineScheduler pass
 /// for the target to instantiate a scheduler.
-struct MachineSchedContext {
+struct LLVM_CLASS_ABI MachineSchedContext {
   MachineFunction *MF = nullptr;
   const MachineLoopInfo *MLI = nullptr;
   const MachineDominatorTree *MDT = nullptr;
@@ -144,7 +144,7 @@ struct MachineSchedContext {
 
 /// MachineSchedRegistry provides a selection of available machine instruction
 /// schedulers.
-class MachineSchedRegistry
+class LLVM_CLASS_ABI MachineSchedRegistry
     : public MachinePassRegistryNode<
           ScheduleDAGInstrs *(*)(MachineSchedContext *)> {
 public:
@@ -182,7 +182,7 @@ class ScheduleDAGMI;
 /// Define a generic scheduling policy for targets that don't provide their own
 /// MachineSchedStrategy. This can be overriden for each scheduling region
 /// before building the DAG.
-struct MachineSchedPolicy {
+struct LLVM_CLASS_ABI MachineSchedPolicy {
   // Allow the scheduler to disable register pressure tracking.
   bool ShouldTrackPressure = false;
   /// Track LaneMasks to allow reordering of independent subregister writes
@@ -209,7 +209,7 @@ struct MachineSchedPolicy {
 ///
 /// Initialization sequence:
 ///   initPolicy -> shouldTrackPressure -> initialize(DAG) -> registerRoots
-class MachineSchedStrategy {
+class LLVM_CLASS_ABI MachineSchedStrategy {
   virtual void anchor();
 
 public:
@@ -274,7 +274,7 @@ class MachineSchedStrategy {
 /// schedules machine instructions according to the given MachineSchedStrategy
 /// without much extra book-keeping. This is the common functionality between
 /// PreRA and PostRA MachineScheduler.
-class ScheduleDAGMI : public ScheduleDAGInstrs {
+class LLVM_CLASS_ABI ScheduleDAGMI : public ScheduleDAGInstrs {
 protected:
   AAResults *AA;
   LiveIntervals *LIS;
@@ -396,7 +396,7 @@ class ScheduleDAGMI : public ScheduleDAGInstrs {
 
 /// ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules
 /// machine instructions while updating LiveIntervals and tracking regpressure.
-class ScheduleDAGMILive : public ScheduleDAGMI {
+class LLVM_CLASS_ABI ScheduleDAGMILive : public ScheduleDAGMI {
 protected:
   RegisterClassInfo *RegClassInfo;
 
@@ -538,7 +538,7 @@ class ScheduleDAGMILive : public ScheduleDAGMI {
 ///
 /// This is a convenience class that may be used by implementations of
 /// MachineSchedStrategy.
-class ReadyQueue {
+class LLVM_CLASS_ABI ReadyQueue {
   unsigned ID;
   std::string Name;
   std::vector<SUnit*> Queue;
@@ -586,7 +586,7 @@ class ReadyQueue {
 };
 
 /// Summarize the unscheduled region.
-struct SchedRemainder {
+struct LLVM_CLASS_ABI SchedRemainder {
   // Critical path through the DAG in expected latency.
   unsigned CriticalPath;
   unsigned CyclicCritPath;
@@ -625,7 +625,7 @@ struct SchedRemainder {
 ///
 /// A \ref ResourceSegments instance represents the cycle
 /// reservation history of the instance of and individual resource.
-class ResourceSegments {
+class LLVM_CLASS_ABI ResourceSegments {
 public:
   /// Represents an interval of discrete integer values closed on
   /// the left and open on the right: [a, b).
@@ -829,7 +829,7 @@ class ResourceSegments {
 /// Each Scheduling boundary is associated with ready queues. It tracks the
 /// current cycle in the direction of movement, and maintains the state
 /// of "hazards" and other interlocks at the current cycle.
-class SchedBoundary {
+class LLVM_CLASS_ABI SchedBoundary {
 public:
   /// SUnit::NodeQueueId: 0 (none), 1 (top), 2 (bot), 3 (both)
   enum {
@@ -1064,7 +1064,7 @@ class SchedBoundary {
 /// Base class for GenericScheduler. This class maintains information about
 /// scheduling candidates based on TargetSchedModel making it easy to implement
 /// heuristics for either preRA or postRA scheduling.
-class GenericSchedulerBase : public MachineSchedStrategy {
+class LLVM_CLASS_ABI GenericSchedulerBase : public MachineSchedStrategy {
 public:
   /// Represent the type of SchedCandidate found within a single queue.
   /// pickNodeBidirectional depends on these listed by decreasing priority.
@@ -1184,30 +1184,30 @@ class GenericSchedulerBase : public MachineSchedStrategy {
 };
 
 // Utility functions used by heuristics in tryCandidate().
-bool tryLess(int TryVal, int CandVal,
+LLVM_FUNC_ABI bool tryLess(int TryVal, int CandVal,
              GenericSchedulerBase::SchedCandidate &TryCand,
              GenericSchedulerBase::SchedCandidate &Cand,
              GenericSchedulerBase::CandReason Reason);
-bool tryGreater(int TryVal, int CandVal,
+LLVM_FUNC_ABI bool tryGreater(int TryVal, int CandVal,
                 GenericSchedulerBase::SchedCandidate &TryCand,
                 GenericSchedulerBase::SchedCandidate &Cand,
                 GenericSchedulerBase::CandReason Reason);
-bool tryLatency(GenericSchedulerBase::SchedCandidate &TryCand,
+LLVM_FUNC_ABI bool tryLatency(GenericSchedulerBase::SchedCandidate &TryCand,
                 GenericSchedulerBase::SchedCandidate &Cand,
                 SchedBoundary &Zone);
-bool tryPressure(const PressureChange &TryP,
+LLVM_FUNC_ABI bool tryPressure(const PressureChange &TryP,
                  const PressureChange &CandP,
                  GenericSchedulerBase::SchedCandidate &TryCand,
                  GenericSchedulerBase::SchedCandidate &Cand,
                  GenericSchedulerBase::CandReason Reason,
                  const TargetRegisterInfo *TRI,
                  const MachineFunction &MF);
-unsigned getWeakLeft(const SUnit *SU, bool isTop);
-int biasPhysReg(const SUnit *SU, bool isTop);
+LLVM_FUNC_ABI unsigned getWeakLeft(const SUnit *SU, bool isTop);
+LLVM_FUNC_ABI int biasPhysReg(const SUnit *SU, bool isTop);
 
 /// GenericScheduler shrinks the unscheduled zone using heuristics to balance
 /// the schedule.
-class GenericScheduler : public GenericSchedulerBase {
+class LLVM_CLASS_ABI GenericScheduler : public GenericSchedulerBase {
 public:
   GenericScheduler(const MachineSchedContext *C):
     GenericSchedulerBase(C), Top(SchedBoundary::TopQID, "TopQ"),
@@ -1289,7 +1289,7 @@ class GenericScheduler : public GenericSchedulerBase {
 ///
 /// Callbacks from ScheduleDAGMI:
 ///   initPolicy -> initialize(DAG) -> registerRoots -> pickNode ...
-class PostGenericScheduler : public GenericSchedulerBase {
+class LLVM_CLASS_ABI PostGenericScheduler : public GenericSchedulerBase {
 protected:
   ScheduleDAGMI *DAG = nullptr;
   SchedBoundary Top;
@@ -1342,20 +1342,20 @@ class PostGenericScheduler : public GenericSchedulerBase {
 /// Create the standard converging machine scheduler. This will be used as the
 /// default scheduler if the target does not set a default.
 /// Adds default DAG mutations.
-ScheduleDAGMILive *createGenericSchedLive(MachineSchedContext *C);
+LLVM_FUNC_ABI ScheduleDAGMILive *createGenericSchedLive(MachineSchedContext *C);
 
 /// Create a generic scheduler with no vreg liveness or DAG mutation passes.
-ScheduleDAGMI *createGenericSchedPostRA(MachineSchedContext *C);
+LLVM_FUNC_ABI ScheduleDAGMI *createGenericSchedPostRA(MachineSchedContext *C);
 
-std::unique_ptr<ScheduleDAGMutation>
+LLVM_FUNC_ABI std::unique_ptr<ScheduleDAGMutation>
 createLoadClusterDAGMutation(const TargetInstrInfo *TII,
                              const TargetRegisterInfo *TRI);
 
-std::unique_ptr<ScheduleDAGMutation>
+LLVM_FUNC_ABI std::unique_ptr<ScheduleDAGMutation>
 createStoreClusterDAGMutation(const TargetInstrInfo *TII,
                               const TargetRegisterInfo *TRI);
 
-std::unique_ptr<ScheduleDAGMutation>
+LLVM_FUNC_ABI std::unique_ptr<ScheduleDAGMutation>
 createCopyConstrainDAGMutation(const TargetInstrInfo *TII,
                                const TargetRegisterInfo *TRI);
 
diff --git a/llvm/include/llvm/CodeGen/MachineSizeOpts.h b/llvm/include/llvm/CodeGen/MachineSizeOpts.h
index 76ddb7175b6a13a..1b4f397519c558e 100644
--- a/llvm/include/llvm/CodeGen/MachineSizeOpts.h
+++ b/llvm/include/llvm/CodeGen/MachineSizeOpts.h
@@ -26,18 +26,18 @@ class MBFIWrapper;
 
 /// Returns true if machine function \p MF is suggested to be size-optimized
 /// based on the profile.
-bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI,
+LLVM_FUNC_ABI bool shouldOptimizeForSize(const MachineFunction *MF, ProfileSummaryInfo *PSI,
                            const MachineBlockFrequencyInfo *BFI,
                            PGSOQueryType QueryType = PGSOQueryType::Other);
 /// Returns true if machine basic block \p MBB is suggested to be size-optimized
 /// based on the profile.
-bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
+LLVM_FUNC_ABI bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
                            ProfileSummaryInfo *PSI,
                            const MachineBlockFrequencyInfo *MBFI,
                            PGSOQueryType QueryType = PGSOQueryType::Other);
 /// Returns true if machine basic block \p MBB is suggested to be size-optimized
 /// based on the profile.
-bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
+LLVM_FUNC_ABI bool shouldOptimizeForSize(const MachineBasicBlock *MBB,
                            ProfileSummaryInfo *PSI,
                            MBFIWrapper *MBFIWrapper,
                            PGSOQueryType QueryType = PGSOQueryType::Other);
diff --git a/llvm/include/llvm/CodeGen/MachineStableHash.h b/llvm/include/llvm/CodeGen/MachineStableHash.h
index da73311573211b4..e5ad5a13c77d675 100644
--- a/llvm/include/llvm/CodeGen/MachineStableHash.h
+++ b/llvm/include/llvm/CodeGen/MachineStableHash.h
@@ -23,12 +23,12 @@ class MachineFunction;
 class MachineInstr;
 class MachineOperand;
 
-stable_hash stableHashValue(const MachineOperand &MO);
-stable_hash stableHashValue(const MachineInstr &MI, bool HashVRegs = false,
+LLVM_FUNC_ABI stable_hash stableHashValue(const MachineOperand &MO);
+LLVM_FUNC_ABI stable_hash stableHashValue(const MachineInstr &MI, bool HashVRegs = false,
                             bool HashConstantPoolIndices = false,
                             bool HashMemOperands = false);
-stable_hash stableHashValue(const MachineBasicBlock &MBB);
-stable_hash stableHashValue(const MachineFunction &MF);
+LLVM_FUNC_ABI stable_hash stableHashValue(const MachineBasicBlock &MBB);
+LLVM_FUNC_ABI stable_hash stableHashValue(const MachineFunction &MF);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/MachineTraceMetrics.h b/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
index 4e0a56e14494591..123b9f18f1e815e 100644
--- a/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
+++ b/llvm/include/llvm/CodeGen/MachineTraceMetrics.h
@@ -72,7 +72,7 @@ class TargetRegisterInfo;
 // Associate each regunit with an instruction operand. Depending on the
 // direction instructions are scanned, it could be the operand that defined the
 // regunit, or the highest operand to read the regunit.
-struct LiveRegUnit {
+struct LLVM_CLASS_ABI LiveRegUnit {
   unsigned RegUnit;
   unsigned Cycle = 0;
   const MachineInstr *MI = nullptr;
@@ -94,7 +94,7 @@ enum class MachineTraceStrategy {
   TS_NumStrategies
 };
 
-class MachineTraceMetrics : public MachineFunctionPass {
+class LLVM_CLASS_ABI MachineTraceMetrics : public MachineFunctionPass {
   const MachineFunction *MF = nullptr;
   const TargetInstrInfo *TII = nullptr;
   const TargetRegisterInfo *TRI = nullptr;
diff --git a/llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h b/llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h
index 63417cdf6571532..e9a5c6c375ad82b 100644
--- a/llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h
+++ b/llvm/include/llvm/CodeGen/MachineUniformityAnalysis.h
@@ -29,7 +29,7 @@ using MachineUniformityInfo = GenericUniformityInfo<MachineSSAContext>;
 ///
 /// If \p HasBranchDivergence is false, produces a dummy result which assumes
 /// everything is uniform.
-MachineUniformityInfo computeMachineUniformityInfo(
+LLVM_FUNC_ABI MachineUniformityInfo computeMachineUniformityInfo(
     MachineFunction &F, const MachineCycleInfo &cycleInfo,
     const MachineDomTree &domTree, bool HasBranchDivergence);
 
diff --git a/llvm/include/llvm/CodeGen/MachineValueType.h b/llvm/include/llvm/CodeGen/MachineValueType.h
index 17f017522d9e8c2..1956b2dd3e30e04 100644
--- a/llvm/include/llvm/CodeGen/MachineValueType.h
+++ b/llvm/include/llvm/CodeGen/MachineValueType.h
@@ -32,7 +32,7 @@ namespace llvm {
   /// Machine Value Type. Every type that is supported natively by some
   /// processor targeted by LLVM occurs here. This means that any legal value
   /// type can be represented by an MVT.
-  class MVT {
+  class LLVM_CLASS_ABI MVT {
   public:
     enum SimpleValueType : uint8_t {
       // Simple value types that aren't explicitly part of this enumeration
diff --git a/llvm/include/llvm/CodeGen/MacroFusion.h b/llvm/include/llvm/CodeGen/MacroFusion.h
index c8246fcf2e3fb68..a18e22241b37ec9 100644
--- a/llvm/include/llvm/CodeGen/MacroFusion.h
+++ b/llvm/include/llvm/CodeGen/MacroFusion.h
@@ -37,26 +37,26 @@ using ShouldSchedulePredTy = std::function<bool(const TargetInstrInfo &TII,
 
 /// Checks if the number of cluster edges between SU and its predecessors is
 /// less than FuseLimit
-bool hasLessThanNumFused(const SUnit &SU, unsigned FuseLimit);
+LLVM_FUNC_ABI bool hasLessThanNumFused(const SUnit &SU, unsigned FuseLimit);
 
 /// Create an artificial edge between FirstSU and SecondSU.
 /// Make data dependencies from the FirstSU also dependent on the SecondSU to
 /// prevent them from being scheduled between the FirstSU and the SecondSU
 /// and vice-versa.
 /// Fusing more than 2 instructions is not currently supported.
-bool fuseInstructionPair(ScheduleDAGInstrs &DAG, SUnit &FirstSU,
+LLVM_FUNC_ABI bool fuseInstructionPair(ScheduleDAGInstrs &DAG, SUnit &FirstSU,
                          SUnit &SecondSU);
 
 /// Create a DAG scheduling mutation to pair instructions back to back
 /// for instructions that benefit according to the target-specific
 /// shouldScheduleAdjacent predicate function.
-std::unique_ptr<ScheduleDAGMutation>
+LLVM_FUNC_ABI std::unique_ptr<ScheduleDAGMutation>
 createMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent);
 
 /// Create a DAG scheduling mutation to pair branch instructions with one
 /// of their predecessors back to back for instructions that benefit according
 /// to the target-specific shouldScheduleAdjacent predicate function.
-std::unique_ptr<ScheduleDAGMutation>
+LLVM_FUNC_ABI std::unique_ptr<ScheduleDAGMutation>
 createBranchMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/ModuloSchedule.h b/llvm/include/llvm/CodeGen/ModuloSchedule.h
index 77ca6ff696b6ac9..6251cce49d436de 100644
--- a/llvm/include/llvm/CodeGen/ModuloSchedule.h
+++ b/llvm/include/llvm/CodeGen/ModuloSchedule.h
@@ -77,7 +77,7 @@ class LiveIntervals;
 
 /// Represents a schedule for a single-block loop. For every instruction we
 /// maintain a Cycle and Stage.
-class ModuloSchedule {
+class LLVM_CLASS_ABI ModuloSchedule {
 private:
   /// The block containing the loop instructions.
   MachineLoop *Loop;
@@ -158,7 +158,7 @@ class ModuloSchedule {
 
 /// The ModuloScheduleExpander takes a ModuloSchedule and expands it in-place,
 /// rewriting the old loop and inserting prologs and epilogs as required.
-class ModuloScheduleExpander {
+class LLVM_CLASS_ABI ModuloScheduleExpander {
 public:
   using InstrChangesTy = DenseMap<MachineInstr *, std::pair<unsigned, int64_t>>;
 
@@ -280,7 +280,7 @@ class ModuloScheduleExpander {
 
 /// A reimplementation of ModuloScheduleExpander. It works by generating a
 /// standalone kernel loop and peeling out the prologs and epilogs.
-class PeelingModuloScheduleExpander {
+class LLVM_CLASS_ABI PeelingModuloScheduleExpander {
 public:
   PeelingModuloScheduleExpander(MachineFunction &MF, ModuloSchedule &S,
                                 LiveIntervals *LIS)
@@ -376,7 +376,7 @@ class PeelingModuloScheduleExpander {
 /// The post-instr symbol is a way of annotating an instruction that can be
 /// roundtripped in MIR. The syntax is:
 ///   MYINST %0, post-instr-symbol <mcsymbol Stage-1_Cycle-5>
-class ModuloScheduleTestAnnotater {
+class LLVM_CLASS_ABI ModuloScheduleTestAnnotater {
   MachineFunction &MF;
   ModuloSchedule &S;
 
diff --git a/llvm/include/llvm/CodeGen/MultiHazardRecognizer.h b/llvm/include/llvm/CodeGen/MultiHazardRecognizer.h
index 987ad742bfe05ee..71661d6ca86f9c1 100644
--- a/llvm/include/llvm/CodeGen/MultiHazardRecognizer.h
+++ b/llvm/include/llvm/CodeGen/MultiHazardRecognizer.h
@@ -23,7 +23,7 @@ namespace llvm {
 class MachineInstr;
 class SUnit;
 
-class MultiHazardRecognizer : public ScheduleHazardRecognizer {
+class LLVM_CLASS_ABI MultiHazardRecognizer : public ScheduleHazardRecognizer {
   SmallVector<std::unique_ptr<ScheduleHazardRecognizer>, 4> Recognizers;
 
 public:
diff --git a/llvm/include/llvm/CodeGen/NonRelocatableStringpool.h b/llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
index a03846d05d6b2ad..1a9fcd906dd95f1 100644
--- a/llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
+++ b/llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
@@ -21,7 +21,7 @@ namespace llvm {
 ///
 /// Use this class when a string table doesn't need relocations.
 /// This class provides this ability by just associating offsets with strings.
-class NonRelocatableStringpool {
+class LLVM_CLASS_ABI NonRelocatableStringpool {
 public:
   /// Entries are stored into the StringMap and simply linked together through
   /// the second element of this pair in order to keep track of insertion
@@ -65,7 +65,7 @@ class NonRelocatableStringpool {
 };
 
 /// Helper for making strong types.
-template <typename T, typename S> class StrongType : public T {
+template <typename T, typename S> class LLVM_CLASS_ABI StrongType : public T {
 public:
   template <typename... Args>
   explicit StrongType(Args... A) : T(std::forward<Args>(A)...) {}
@@ -74,8 +74,8 @@ template <typename T, typename S> class StrongType : public T {
 /// It's very easy to introduce bugs by passing the wrong string pool.
 /// By using strong types the interface enforces that the right
 /// kind of pool is used.
-struct UniqueTag {};
-struct OffsetsTag {};
+struct LLVM_CLASS_ABI UniqueTag {};
+struct LLVM_CLASS_ABI OffsetsTag {};
 using UniquingStringPool = StrongType<NonRelocatableStringpool, UniqueTag>;
 using OffsetsStringPool = StrongType<NonRelocatableStringpool, OffsetsTag>;
 
diff --git a/llvm/include/llvm/CodeGen/PBQP/CostAllocator.h b/llvm/include/llvm/CodeGen/PBQP/CostAllocator.h
index 7e28d04663d961b..4c55a1f31f1ad1d 100644
--- a/llvm/include/llvm/CodeGen/PBQP/CostAllocator.h
+++ b/llvm/include/llvm/CodeGen/PBQP/CostAllocator.h
@@ -26,7 +26,7 @@
 namespace llvm {
 namespace PBQP {
 
-template <typename ValueT> class ValuePool {
+template <typename ValueT> class LLVM_CLASS_ABI ValuePool {
 public:
   using PoolRef = std::shared_ptr<const ValueT>;
 
@@ -105,7 +105,7 @@ template <typename ValueT> class ValuePool {
   }
 };
 
-template <typename VectorT, typename MatrixT> class PoolCostAllocator {
+template <typename VectorT, typename MatrixT> class LLVM_CLASS_ABI PoolCostAllocator {
 private:
   using VectorCostPool = ValuePool<VectorT>;
   using MatrixCostPool = ValuePool<MatrixT>;
diff --git a/llvm/include/llvm/CodeGen/PBQP/Graph.h b/llvm/include/llvm/CodeGen/PBQP/Graph.h
index 142bfa1461a0850..49b89748b6ef20c 100644
--- a/llvm/include/llvm/CodeGen/PBQP/Graph.h
+++ b/llvm/include/llvm/CodeGen/PBQP/Graph.h
@@ -24,7 +24,7 @@
 namespace llvm {
 namespace PBQP {
 
-  class GraphBase {
+  class LLVM_CLASS_ABI GraphBase {
   public:
     using NodeId = unsigned;
     using EdgeId = unsigned;
@@ -44,7 +44,7 @@ namespace PBQP {
   /// Instances of this class describe PBQP problems.
   ///
   template <typename SolverT>
-  class Graph : public GraphBase {
+  class LLVM_CLASS_ABI Graph : public GraphBase {
   private:
     using CostAllocator = typename SolverT::CostAllocator;
 
diff --git a/llvm/include/llvm/CodeGen/PBQP/Math.h b/llvm/include/llvm/CodeGen/PBQP/Math.h
index b9d45848f1267be..7607ae4b6c9aad0 100644
--- a/llvm/include/llvm/CodeGen/PBQP/Math.h
+++ b/llvm/include/llvm/CodeGen/PBQP/Math.h
@@ -23,8 +23,8 @@ namespace PBQP {
 using PBQPNum = float;
 
 /// PBQP Vector class.
-class Vector {
-  friend hash_code hash_value(const Vector &);
+class LLVM_CLASS_ABI Vector {
+  friend LLVM_FUNC_ABI hash_code hash_value(const Vector &);
 
 public:
   /// Construct a PBQP vector of the given size.
@@ -119,9 +119,9 @@ OStream& operator<<(OStream &OS, const Vector &V) {
 }
 
 /// PBQP Matrix class
-class Matrix {
+class LLVM_CLASS_ABI Matrix {
 private:
-  friend hash_code hash_value(const Matrix &);
+  friend LLVM_FUNC_ABI hash_code hash_value(const Matrix &);
 
 public:
   /// Construct a PBQP Matrix with the given dimensions.
@@ -253,7 +253,7 @@ OStream& operator<<(OStream &OS, const Matrix &M) {
 }
 
 template <typename Metadata>
-class MDVector : public Vector {
+class LLVM_CLASS_ABI MDVector : public Vector {
 public:
   MDVector(const Vector &v) : Vector(v), md(*this) {}
   MDVector(Vector &&v) : Vector(std::move(v)), md(*this) { }
@@ -270,7 +270,7 @@ inline hash_code hash_value(const MDVector<Metadata> &V) {
 }
 
 template <typename Metadata>
-class MDMatrix : public Matrix {
+class LLVM_CLASS_ABI MDMatrix : public Matrix {
 public:
   MDMatrix(const Matrix &m) : Matrix(m), md(*this) {}
   MDMatrix(Matrix &&m) : Matrix(std::move(m)), md(*this) { }
diff --git a/llvm/include/llvm/CodeGen/PBQP/Solution.h b/llvm/include/llvm/CodeGen/PBQP/Solution.h
index de2abef047ce87f..7c8abbe218b6564 100644
--- a/llvm/include/llvm/CodeGen/PBQP/Solution.h
+++ b/llvm/include/llvm/CodeGen/PBQP/Solution.h
@@ -24,7 +24,7 @@ namespace PBQP {
   /// Represents a solution to a PBQP problem.
   ///
   /// To get the selection for each node in the problem use the getSelection method.
-  class Solution {
+  class LLVM_CLASS_ABI Solution {
   private:
     using SelectionsMap = std::map<GraphBase::NodeId, unsigned>;
     SelectionsMap selections;
diff --git a/llvm/include/llvm/CodeGen/PBQPRAConstraint.h b/llvm/include/llvm/CodeGen/PBQPRAConstraint.h
index a683bff1ff9e807..dea299e62e4d9de 100644
--- a/llvm/include/llvm/CodeGen/PBQPRAConstraint.h
+++ b/llvm/include/llvm/CodeGen/PBQPRAConstraint.h
@@ -35,7 +35,7 @@ using PBQPRAGraph = PBQP::RegAlloc::PBQPRAGraph;
 
 /// Abstract base for classes implementing PBQP register allocation
 ///        constraints (e.g. Spill-costs, interference, coalescing).
-class PBQPRAConstraint {
+class LLVM_CLASS_ABI PBQPRAConstraint {
 public:
   virtual ~PBQPRAConstraint() = 0;
   virtual void apply(PBQPRAGraph &G) = 0;
@@ -48,7 +48,7 @@ class PBQPRAConstraint {
 ///
 ///   Constraints added to this list will be applied, in the order that they are
 /// added, to the PBQP graph.
-class PBQPRAConstraintList : public PBQPRAConstraint {
+class LLVM_CLASS_ABI PBQPRAConstraintList : public PBQPRAConstraint {
 public:
   void apply(PBQPRAGraph &G) override {
     for (auto &C : Constraints)
diff --git a/llvm/include/llvm/CodeGen/ParallelCG.h b/llvm/include/llvm/CodeGen/ParallelCG.h
index df72be4c5841bf0..1c32c4da0138f8a 100644
--- a/llvm/include/llvm/CodeGen/ParallelCG.h
+++ b/llvm/include/llvm/CodeGen/ParallelCG.h
@@ -33,7 +33,7 @@ class raw_pwrite_stream;
 ///
 /// Writes bitcode for individual partitions into output streams in BCOSs, if
 /// BCOSs is not empty.
-void splitCodeGen(
+LLVM_FUNC_ABI void splitCodeGen(
     Module &M, ArrayRef<raw_pwrite_stream *> OSs,
     ArrayRef<llvm::raw_pwrite_stream *> BCOSs,
     const std::function<std::unique_ptr<TargetMachine>()> &TMFactory,
diff --git a/llvm/include/llvm/CodeGen/Passes.h b/llvm/include/llvm/CodeGen/Passes.h
index 088e1653816f666..11cdea148a4efed 100644
--- a/llvm/include/llvm/CodeGen/Passes.h
+++ b/llvm/include/llvm/CodeGen/Passes.h
@@ -45,7 +45,7 @@ namespace llvm {
   /// AtomicExpandPass - At IR level this pass replace atomic instructions with
   /// __atomic_* library calls, or target specific instruction which implement the
   /// same semantics in a way which better fits the target backend.
-  FunctionPass *createAtomicExpandPass();
+  LLVM_FUNC_ABI FunctionPass *createAtomicExpandPass();
 
   /// createUnreachableBlockEliminationPass - The LLVM code generator does not
   /// work well with unreachable basic blocks (what live ranges make sense for a
@@ -53,555 +53,555 @@ namespace llvm {
   /// not instruction select unreachable blocks, or run this pass as its
   /// last LLVM modifying pass to clean up blocks that are not reachable from
   /// the entry block.
-  FunctionPass *createUnreachableBlockEliminationPass();
+  LLVM_FUNC_ABI FunctionPass *createUnreachableBlockEliminationPass();
 
   /// createBasicBlockSections Pass - This pass assigns sections to machine
   /// basic blocks and is enabled with -fbasic-block-sections.
-  MachineFunctionPass *createBasicBlockSectionsPass();
+  LLVM_FUNC_ABI MachineFunctionPass *createBasicBlockSectionsPass();
 
   /// createMachineFunctionSplitterPass - This pass splits machine functions
   /// using profile information.
-  MachineFunctionPass *createMachineFunctionSplitterPass();
+  LLVM_FUNC_ABI MachineFunctionPass *createMachineFunctionSplitterPass();
 
   /// MachineFunctionPrinter pass - This pass prints out the machine function to
   /// the given stream as a debugging tool.
-  MachineFunctionPass *
+  LLVM_FUNC_ABI MachineFunctionPass *
   createMachineFunctionPrinterPass(raw_ostream &OS,
                                    const std::string &Banner ="");
 
   /// StackFramePrinter pass - This pass prints out the machine function's
   /// stack frame to the given stream as a debugging tool.
-  MachineFunctionPass *createStackFrameLayoutAnalysisPass();
+  LLVM_FUNC_ABI MachineFunctionPass *createStackFrameLayoutAnalysisPass();
 
   /// MIRPrinting pass - this pass prints out the LLVM IR into the given stream
   /// using the MIR serialization format.
-  MachineFunctionPass *createPrintMIRPass(raw_ostream &OS);
+  LLVM_FUNC_ABI MachineFunctionPass *createPrintMIRPass(raw_ostream &OS);
 
   /// This pass resets a MachineFunction when it has the FailedISel property
   /// as if it was just created.
   /// If EmitFallbackDiag is true, the pass will emit a
   /// DiagnosticInfoISelFallback for every MachineFunction it resets.
   /// If AbortOnFailedISel is true, abort compilation instead of resetting.
-  MachineFunctionPass *createResetMachineFunctionPass(bool EmitFallbackDiag,
+  LLVM_FUNC_ABI MachineFunctionPass *createResetMachineFunctionPass(bool EmitFallbackDiag,
                                                       bool AbortOnFailedISel);
 
   /// createCodeGenPreparePass - Transform the code to expose more pattern
   /// matching during instruction selection.
-  FunctionPass *createCodeGenPreparePass();
+  LLVM_FUNC_ABI FunctionPass *createCodeGenPreparePass();
 
   /// This pass implements generation of target-specific intrinsics to support
   /// handling of complex number arithmetic
-  FunctionPass *createComplexDeinterleavingPass(const TargetMachine *TM);
+  LLVM_FUNC_ABI FunctionPass *createComplexDeinterleavingPass(const TargetMachine *TM);
 
   /// AtomicExpandID -- Lowers atomic operations in terms of either cmpxchg
   /// load-linked/store-conditional loops.
-  extern char &AtomicExpandID;
+  LLVM_FUNC_ABI extern char &AtomicExpandID;
 
   /// MachineLoopInfo - This pass is a loop analysis pass.
-  extern char &MachineLoopInfoID;
+  LLVM_FUNC_ABI extern char &MachineLoopInfoID;
 
   /// MachineDominators - This pass is a machine dominators analysis pass.
-  extern char &MachineDominatorsID;
+  LLVM_FUNC_ABI extern char &MachineDominatorsID;
 
   /// MachineDominanaceFrontier - This pass is a machine dominators analysis.
-  extern char &MachineDominanceFrontierID;
+  LLVM_FUNC_ABI extern char &MachineDominanceFrontierID;
 
   /// MachineRegionInfo - This pass computes SESE regions for machine functions.
-  extern char &MachineRegionInfoPassID;
+  LLVM_FUNC_ABI extern char &MachineRegionInfoPassID;
 
   /// EdgeBundles analysis - Bundle machine CFG edges.
-  extern char &EdgeBundlesID;
+  LLVM_FUNC_ABI extern char &EdgeBundlesID;
 
   /// LiveVariables pass - This pass computes the set of blocks in which each
   /// variable is life and sets machine operand kill flags.
-  extern char &LiveVariablesID;
+  LLVM_FUNC_ABI extern char &LiveVariablesID;
 
   /// PHIElimination - This pass eliminates machine instruction PHI nodes
   /// by inserting copy instructions.  This destroys SSA information, but is the
   /// desired input for some register allocators.  This pass is "required" by
   /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
-  extern char &PHIEliminationID;
+  LLVM_FUNC_ABI extern char &PHIEliminationID;
 
   /// LiveIntervals - This analysis keeps track of the live ranges of virtual
   /// and physical registers.
-  extern char &LiveIntervalsID;
+  LLVM_FUNC_ABI extern char &LiveIntervalsID;
 
   /// LiveStacks pass. An analysis keeping track of the liveness of stack slots.
-  extern char &LiveStacksID;
+  LLVM_FUNC_ABI extern char &LiveStacksID;
 
   /// TwoAddressInstruction - This pass reduces two-address instructions to
   /// use two operands. This destroys SSA information but it is desired by
   /// register allocators.
-  extern char &TwoAddressInstructionPassID;
+  LLVM_FUNC_ABI extern char &TwoAddressInstructionPassID;
 
   /// ProcessImpicitDefs pass - This pass removes IMPLICIT_DEFs.
-  extern char &ProcessImplicitDefsID;
+  LLVM_FUNC_ABI extern char &ProcessImplicitDefsID;
 
   /// RegisterCoalescer - This pass merges live ranges to eliminate copies.
-  extern char &RegisterCoalescerID;
+  LLVM_FUNC_ABI extern char &RegisterCoalescerID;
 
   /// MachineScheduler - This pass schedules machine instructions.
-  extern char &MachineSchedulerID;
+  LLVM_FUNC_ABI extern char &MachineSchedulerID;
 
   /// PostMachineScheduler - This pass schedules machine instructions postRA.
-  extern char &PostMachineSchedulerID;
+  LLVM_FUNC_ABI extern char &PostMachineSchedulerID;
 
   /// SpillPlacement analysis. Suggest optimal placement of spill code between
   /// basic blocks.
-  extern char &SpillPlacementID;
+  LLVM_FUNC_ABI extern char &SpillPlacementID;
 
   /// ShrinkWrap pass. Look for the best place to insert save and restore
   // instruction and update the MachineFunctionInfo with that information.
-  extern char &ShrinkWrapID;
+  LLVM_FUNC_ABI extern char &ShrinkWrapID;
 
   /// LiveRangeShrink pass. Move instruction close to its definition to shrink
   /// the definition's live range.
-  extern char &LiveRangeShrinkID;
+  LLVM_FUNC_ABI extern char &LiveRangeShrinkID;
 
   /// Greedy register allocator.
-  extern char &RAGreedyID;
+  LLVM_FUNC_ABI extern char &RAGreedyID;
 
   /// Basic register allocator.
-  extern char &RABasicID;
+  LLVM_FUNC_ABI extern char &RABasicID;
 
   /// VirtRegRewriter pass. Rewrite virtual registers to physical registers as
   /// assigned in VirtRegMap.
-  extern char &VirtRegRewriterID;
-  FunctionPass *createVirtRegRewriter(bool ClearVirtRegs = true);
+  LLVM_FUNC_ABI extern char &VirtRegRewriterID;
+  LLVM_FUNC_ABI FunctionPass *createVirtRegRewriter(bool ClearVirtRegs = true);
 
   /// UnreachableMachineBlockElimination - This pass removes unreachable
   /// machine basic blocks.
-  extern char &UnreachableMachineBlockElimID;
+  LLVM_FUNC_ABI extern char &UnreachableMachineBlockElimID;
 
   /// DeadMachineInstructionElim - This pass removes dead machine instructions.
-  extern char &DeadMachineInstructionElimID;
+  LLVM_FUNC_ABI extern char &DeadMachineInstructionElimID;
 
   /// This pass adds dead/undef flags after analyzing subregister lanes.
-  extern char &DetectDeadLanesID;
+  LLVM_FUNC_ABI extern char &DetectDeadLanesID;
 
   /// This pass perform post-ra machine sink for COPY instructions.
-  extern char &PostRAMachineSinkingID;
+  LLVM_FUNC_ABI extern char &PostRAMachineSinkingID;
 
   /// This pass adds flow sensitive discriminators.
-  extern char &MIRAddFSDiscriminatorsID;
+  LLVM_FUNC_ABI extern char &MIRAddFSDiscriminatorsID;
 
   /// This pass reads flow sensitive profile.
-  extern char &MIRProfileLoaderPassID;
+  LLVM_FUNC_ABI extern char &MIRProfileLoaderPassID;
 
   /// FastRegisterAllocation Pass - This pass register allocates as fast as
   /// possible. It is best suited for debug code where live ranges are short.
   ///
-  FunctionPass *createFastRegisterAllocator();
-  FunctionPass *createFastRegisterAllocator(RegClassFilterFunc F,
+  LLVM_FUNC_ABI FunctionPass *createFastRegisterAllocator();
+  LLVM_FUNC_ABI FunctionPass *createFastRegisterAllocator(RegClassFilterFunc F,
                                             bool ClearVirtRegs);
 
   /// BasicRegisterAllocation Pass - This pass implements a degenerate global
   /// register allocator using the basic regalloc framework.
   ///
-  FunctionPass *createBasicRegisterAllocator();
-  FunctionPass *createBasicRegisterAllocator(RegClassFilterFunc F);
+  LLVM_FUNC_ABI FunctionPass *createBasicRegisterAllocator();
+  LLVM_FUNC_ABI FunctionPass *createBasicRegisterAllocator(RegClassFilterFunc F);
 
   /// Greedy register allocation pass - This pass implements a global register
   /// allocator for optimized builds.
   ///
-  FunctionPass *createGreedyRegisterAllocator();
-  FunctionPass *createGreedyRegisterAllocator(RegClassFilterFunc F);
+  LLVM_FUNC_ABI FunctionPass *createGreedyRegisterAllocator();
+  LLVM_FUNC_ABI FunctionPass *createGreedyRegisterAllocator(RegClassFilterFunc F);
 
   /// PBQPRegisterAllocation Pass - This pass implements the Partitioned Boolean
   /// Quadratic Prograaming (PBQP) based register allocator.
   ///
-  FunctionPass *createDefaultPBQPRegisterAllocator();
+  LLVM_FUNC_ABI FunctionPass *createDefaultPBQPRegisterAllocator();
 
   /// PrologEpilogCodeInserter - This pass inserts prolog and epilog code,
   /// and eliminates abstract frame references.
-  extern char &PrologEpilogCodeInserterID;
-  MachineFunctionPass *createPrologEpilogInserterPass();
+  LLVM_FUNC_ABI extern char &PrologEpilogCodeInserterID;
+  LLVM_FUNC_ABI MachineFunctionPass *createPrologEpilogInserterPass();
 
   /// ExpandPostRAPseudos - This pass expands pseudo instructions after
   /// register allocation.
-  extern char &ExpandPostRAPseudosID;
+  LLVM_FUNC_ABI extern char &ExpandPostRAPseudosID;
 
   /// PostRAHazardRecognizer - This pass runs the post-ra hazard
   /// recognizer.
-  extern char &PostRAHazardRecognizerID;
+  LLVM_FUNC_ABI extern char &PostRAHazardRecognizerID;
 
   /// PostRAScheduler - This pass performs post register allocation
   /// scheduling.
-  extern char &PostRASchedulerID;
+  LLVM_FUNC_ABI extern char &PostRASchedulerID;
 
   /// BranchFolding - This pass performs machine code CFG based
   /// optimizations to delete branches to branches, eliminate branches to
   /// successor blocks (creating fall throughs), and eliminating branches over
   /// branches.
-  extern char &BranchFolderPassID;
+  LLVM_FUNC_ABI extern char &BranchFolderPassID;
 
   /// BranchRelaxation - This pass replaces branches that need to jump further
   /// than is supported by a branch instruction.
-  extern char &BranchRelaxationPassID;
+  LLVM_FUNC_ABI extern char &BranchRelaxationPassID;
 
   /// MachineFunctionPrinterPass - This pass prints out MachineInstr's.
-  extern char &MachineFunctionPrinterPassID;
+  LLVM_FUNC_ABI extern char &MachineFunctionPrinterPassID;
 
   /// MIRPrintingPass - this pass prints out the LLVM IR using the MIR
   /// serialization format.
-  extern char &MIRPrintingPassID;
+  LLVM_FUNC_ABI extern char &MIRPrintingPassID;
 
   /// TailDuplicate - Duplicate blocks with unconditional branches
   /// into tails of their predecessors.
-  extern char &TailDuplicateID;
+  LLVM_FUNC_ABI extern char &TailDuplicateID;
 
   /// Duplicate blocks with unconditional branches into tails of their
   /// predecessors. Variant that works before register allocation.
-  extern char &EarlyTailDuplicateID;
+  LLVM_FUNC_ABI extern char &EarlyTailDuplicateID;
 
   /// MachineTraceMetrics - This pass computes critical path and CPU resource
   /// usage in an ensemble of traces.
-  extern char &MachineTraceMetricsID;
+  LLVM_FUNC_ABI extern char &MachineTraceMetricsID;
 
   /// EarlyIfConverter - This pass performs if-conversion on SSA form by
   /// inserting cmov instructions.
-  extern char &EarlyIfConverterID;
+  LLVM_FUNC_ABI extern char &EarlyIfConverterID;
 
   /// EarlyIfPredicator - This pass performs if-conversion on SSA form by
   /// predicating if/else block and insert select at the join point.
-  extern char &EarlyIfPredicatorID;
+  LLVM_FUNC_ABI extern char &EarlyIfPredicatorID;
 
   /// This pass performs instruction combining using trace metrics to estimate
   /// critical-path and resource depth.
-  extern char &MachineCombinerID;
+  LLVM_FUNC_ABI extern char &MachineCombinerID;
 
   /// StackSlotColoring - This pass performs stack coloring and merging.
   /// It merges disjoint allocas to reduce the stack size.
-  extern char &StackColoringID;
+  LLVM_FUNC_ABI extern char &StackColoringID;
 
   /// StackFramePrinter - This pass prints the stack frame layout and variable
   /// mappings.
-  extern char &StackFrameLayoutAnalysisPassID;
+  LLVM_FUNC_ABI extern char &StackFrameLayoutAnalysisPassID;
 
   /// IfConverter - This pass performs machine code if conversion.
-  extern char &IfConverterID;
+  LLVM_FUNC_ABI extern char &IfConverterID;
 
-  FunctionPass *createIfConverter(
+  LLVM_FUNC_ABI FunctionPass *createIfConverter(
       std::function<bool(const MachineFunction &)> Ftor);
 
   /// MachineBlockPlacement - This pass places basic blocks based on branch
   /// probabilities.
-  extern char &MachineBlockPlacementID;
+  LLVM_FUNC_ABI extern char &MachineBlockPlacementID;
 
   /// MachineBlockPlacementStats - This pass collects statistics about the
   /// basic block placement using branch probabilities and block frequency
   /// information.
-  extern char &MachineBlockPlacementStatsID;
+  LLVM_FUNC_ABI extern char &MachineBlockPlacementStatsID;
 
   /// GCLowering Pass - Used by gc.root to perform its default lowering
   /// operations.
-  FunctionPass *createGCLoweringPass();
+  LLVM_FUNC_ABI FunctionPass *createGCLoweringPass();
 
   /// GCLowering Pass - Used by gc.root to perform its default lowering
   /// operations.
-  extern char &GCLoweringID;
+  LLVM_FUNC_ABI extern char &GCLoweringID;
 
   /// ShadowStackGCLowering - Implements the custom lowering mechanism
   /// used by the shadow stack GC.  Only runs on functions which opt in to
   /// the shadow stack collector.
-  FunctionPass *createShadowStackGCLoweringPass();
+  LLVM_FUNC_ABI FunctionPass *createShadowStackGCLoweringPass();
 
   /// ShadowStackGCLowering - Implements the custom lowering mechanism
   /// used by the shadow stack GC.
-  extern char &ShadowStackGCLoweringID;
+  LLVM_FUNC_ABI extern char &ShadowStackGCLoweringID;
 
   /// GCMachineCodeAnalysis - Target-independent pass to mark safe points
   /// in machine code. Must be added very late during code generation, just
   /// prior to output, and importantly after all CFG transformations (such as
   /// branch folding).
-  extern char &GCMachineCodeAnalysisID;
+  LLVM_FUNC_ABI extern char &GCMachineCodeAnalysisID;
 
   /// Creates a pass to print GC metadata.
   ///
-  FunctionPass *createGCInfoPrinter(raw_ostream &OS);
+  LLVM_FUNC_ABI FunctionPass *createGCInfoPrinter(raw_ostream &OS);
 
   /// MachineCSE - This pass performs global CSE on machine instructions.
-  extern char &MachineCSEID;
+  LLVM_FUNC_ABI extern char &MachineCSEID;
 
   /// MIRCanonicalizer - This pass canonicalizes MIR by renaming vregs
   /// according to the semantics of the instruction as well as hoists
   /// code.
-  extern char &MIRCanonicalizerID;
+  LLVM_FUNC_ABI extern char &MIRCanonicalizerID;
 
   /// ImplicitNullChecks - This pass folds null pointer checks into nearby
   /// memory operations.
-  extern char &ImplicitNullChecksID;
+  LLVM_FUNC_ABI extern char &ImplicitNullChecksID;
 
   /// This pass performs loop invariant code motion on machine instructions.
-  extern char &MachineLICMID;
+  LLVM_FUNC_ABI extern char &MachineLICMID;
 
   /// This pass performs loop invariant code motion on machine instructions.
   /// This variant works before register allocation. \see MachineLICMID.
-  extern char &EarlyMachineLICMID;
+  LLVM_FUNC_ABI extern char &EarlyMachineLICMID;
 
   /// MachineSinking - This pass performs sinking on machine instructions.
-  extern char &MachineSinkingID;
+  LLVM_FUNC_ABI extern char &MachineSinkingID;
 
   /// MachineCopyPropagation - This pass performs copy propagation on
   /// machine instructions.
-  extern char &MachineCopyPropagationID;
+  LLVM_FUNC_ABI extern char &MachineCopyPropagationID;
 
-  MachineFunctionPass *createMachineCopyPropagationPass(bool UseCopyInstr);
+  LLVM_FUNC_ABI MachineFunctionPass *createMachineCopyPropagationPass(bool UseCopyInstr);
 
   /// MachineLateInstrsCleanup - This pass removes redundant identical
   /// instructions after register allocation and rematerialization.
-  extern char &MachineLateInstrsCleanupID;
+  LLVM_FUNC_ABI extern char &MachineLateInstrsCleanupID;
 
   /// PeepholeOptimizer - This pass performs peephole optimizations -
   /// like extension and comparison eliminations.
-  extern char &PeepholeOptimizerID;
+  LLVM_FUNC_ABI extern char &PeepholeOptimizerID;
 
   /// OptimizePHIs - This pass optimizes machine instruction PHIs
   /// to take advantage of opportunities created during DAG legalization.
-  extern char &OptimizePHIsID;
+  LLVM_FUNC_ABI extern char &OptimizePHIsID;
 
   /// StackSlotColoring - This pass performs stack slot coloring.
-  extern char &StackSlotColoringID;
+  LLVM_FUNC_ABI extern char &StackSlotColoringID;
 
   /// This pass lays out funclets contiguously.
-  extern char &FuncletLayoutID;
+  LLVM_FUNC_ABI extern char &FuncletLayoutID;
 
   /// This pass inserts the XRay instrumentation sleds if they are supported by
   /// the target platform.
-  extern char &XRayInstrumentationID;
+  LLVM_FUNC_ABI extern char &XRayInstrumentationID;
 
   /// This pass inserts FEntry calls
-  extern char &FEntryInserterID;
+  LLVM_FUNC_ABI extern char &FEntryInserterID;
 
   /// This pass implements the "patchable-function" attribute.
-  extern char &PatchableFunctionID;
+  LLVM_FUNC_ABI extern char &PatchableFunctionID;
 
   /// createStackProtectorPass - This pass adds stack protectors to functions.
   ///
-  FunctionPass *createStackProtectorPass();
+  LLVM_FUNC_ABI FunctionPass *createStackProtectorPass();
 
   /// createMachineVerifierPass - This pass verifies cenerated machine code
   /// instructions for correctness.
   ///
-  FunctionPass *createMachineVerifierPass(const std::string& Banner);
+  LLVM_FUNC_ABI FunctionPass *createMachineVerifierPass(const std::string& Banner);
 
   /// createDwarfEHPass - This pass mulches exception handling code into a form
   /// adapted to code generation.  Required if using dwarf exception handling.
-  FunctionPass *createDwarfEHPass(CodeGenOpt::Level OptLevel);
+  LLVM_FUNC_ABI FunctionPass *createDwarfEHPass(CodeGenOpt::Level OptLevel);
 
   /// createWinEHPass - Prepares personality functions used by MSVC on Windows,
   /// in addition to the Itanium LSDA based personalities.
-  FunctionPass *createWinEHPass(bool DemoteCatchSwitchPHIOnly = false);
+  LLVM_FUNC_ABI FunctionPass *createWinEHPass(bool DemoteCatchSwitchPHIOnly = false);
 
   /// createSjLjEHPreparePass - This pass adapts exception handling code to use
   /// the GCC-style builtin setjmp/longjmp (sjlj) to handling EH control flow.
   ///
-  FunctionPass *createSjLjEHPreparePass(const TargetMachine *TM);
+  LLVM_FUNC_ABI FunctionPass *createSjLjEHPreparePass(const TargetMachine *TM);
 
   /// createWasmEHPass - This pass adapts exception handling code to use
   /// WebAssembly's exception handling scheme.
-  FunctionPass *createWasmEHPass();
+  LLVM_FUNC_ABI FunctionPass *createWasmEHPass();
 
   /// LocalStackSlotAllocation - This pass assigns local frame indices to stack
   /// slots relative to one another and allocates base registers to access them
   /// when it is estimated by the target to be out of range of normal frame
   /// pointer or stack pointer index addressing.
-  extern char &LocalStackSlotAllocationID;
+  LLVM_FUNC_ABI extern char &LocalStackSlotAllocationID;
 
   /// This pass expands pseudo-instructions, reserves registers and adjusts
   /// machine frame information.
-  extern char &FinalizeISelID;
+  LLVM_FUNC_ABI extern char &FinalizeISelID;
 
   /// UnpackMachineBundles - This pass unpack machine instruction bundles.
-  extern char &UnpackMachineBundlesID;
+  LLVM_FUNC_ABI extern char &UnpackMachineBundlesID;
 
-  FunctionPass *
+  LLVM_FUNC_ABI FunctionPass *
   createUnpackMachineBundles(std::function<bool(const MachineFunction &)> Ftor);
 
   /// FinalizeMachineBundles - This pass finalize machine instruction
   /// bundles (created earlier, e.g. during pre-RA scheduling).
-  extern char &FinalizeMachineBundlesID;
+  LLVM_FUNC_ABI extern char &FinalizeMachineBundlesID;
 
   /// StackMapLiveness - This pass analyses the register live-out set of
   /// stackmap/patchpoint intrinsics and attaches the calculated information to
   /// the intrinsic for later emission to the StackMap.
-  extern char &StackMapLivenessID;
+  LLVM_FUNC_ABI extern char &StackMapLivenessID;
 
   // MachineSanitizerBinaryMetadata - appends/finalizes sanitizer binary
   // metadata after llvm SanitizerBinaryMetadata pass.
-  extern char &MachineSanitizerBinaryMetadataID;
+  LLVM_FUNC_ABI extern char &MachineSanitizerBinaryMetadataID;
 
   /// RemoveRedundantDebugValues pass.
-  extern char &RemoveRedundantDebugValuesID;
+  LLVM_FUNC_ABI extern char &RemoveRedundantDebugValuesID;
 
   /// MachineCFGPrinter pass.
-  extern char &MachineCFGPrinterID;
+  LLVM_FUNC_ABI extern char &MachineCFGPrinterID;
 
   /// LiveDebugValues pass
-  extern char &LiveDebugValuesID;
+  LLVM_FUNC_ABI extern char &LiveDebugValuesID;
 
   /// createJumpInstrTables - This pass creates jump-instruction tables.
-  ModulePass *createJumpInstrTablesPass();
+  LLVM_FUNC_ABI ModulePass *createJumpInstrTablesPass();
 
   /// InterleavedAccess Pass - This pass identifies and matches interleaved
   /// memory accesses to target specific intrinsics.
   ///
-  FunctionPass *createInterleavedAccessPass();
+  LLVM_FUNC_ABI FunctionPass *createInterleavedAccessPass();
 
   /// InterleavedLoadCombines Pass - This pass identifies interleaved loads and
   /// combines them into wide loads detectable by InterleavedAccessPass
   ///
-  FunctionPass *createInterleavedLoadCombinePass();
+  LLVM_FUNC_ABI FunctionPass *createInterleavedLoadCombinePass();
 
   /// LowerEmuTLS - This pass generates __emutls_[vt].xyz variables for all
   /// TLS variables for the emulated TLS model.
   ///
-  ModulePass *createLowerEmuTLSPass();
+  LLVM_FUNC_ABI ModulePass *createLowerEmuTLSPass();
 
   /// This pass lowers the \@llvm.load.relative and \@llvm.objc.* intrinsics to
   /// instructions.  This is unsafe to do earlier because a pass may combine the
   /// constant initializer into the load, which may result in an overflowing
   /// evaluation.
-  ModulePass *createPreISelIntrinsicLoweringPass();
+  LLVM_FUNC_ABI ModulePass *createPreISelIntrinsicLoweringPass();
 
   /// GlobalMerge - This pass merges internal (by default) globals into structs
   /// to enable reuse of a base pointer by indexed addressing modes.
   /// It can also be configured to focus on size optimizations only.
   ///
-  Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
+  LLVM_FUNC_ABI Pass *createGlobalMergePass(const TargetMachine *TM, unsigned MaximalOffset,
                               bool OnlyOptimizeForSize = false,
                               bool MergeExternalByDefault = false);
 
   /// This pass splits the stack into a safe stack and an unsafe stack to
   /// protect against stack-based overflow vulnerabilities.
-  FunctionPass *createSafeStackPass();
+  LLVM_FUNC_ABI FunctionPass *createSafeStackPass();
 
   /// This pass detects subregister lanes in a virtual register that are used
   /// independently of other lanes and splits them into separate virtual
   /// registers.
-  extern char &RenameIndependentSubregsID;
+  LLVM_FUNC_ABI extern char &RenameIndependentSubregsID;
 
   /// This pass is executed POST-RA to collect which physical registers are
   /// preserved by given machine function.
-  FunctionPass *createRegUsageInfoCollector();
+  LLVM_FUNC_ABI FunctionPass *createRegUsageInfoCollector();
 
   /// Return a MachineFunction pass that identifies call sites
   /// and propagates register usage information of callee to caller
   /// if available with PysicalRegisterUsageInfo pass.
-  FunctionPass *createRegUsageInfoPropPass();
+  LLVM_FUNC_ABI FunctionPass *createRegUsageInfoPropPass();
 
   /// This pass performs software pipelining on machine instructions.
-  extern char &MachinePipelinerID;
+  LLVM_FUNC_ABI extern char &MachinePipelinerID;
 
   /// This pass frees the memory occupied by the MachineFunction.
-  FunctionPass *createFreeMachineFunctionPass();
+  LLVM_FUNC_ABI FunctionPass *createFreeMachineFunctionPass();
 
   /// This pass performs outlining on machine instructions directly before
   /// printing assembly.
-  ModulePass *createMachineOutlinerPass(bool RunOnAllFunctions = true);
+  LLVM_FUNC_ABI ModulePass *createMachineOutlinerPass(bool RunOnAllFunctions = true);
 
   /// This pass expands the reduction intrinsics into sequences of shuffles.
-  FunctionPass *createExpandReductionsPass();
+  LLVM_FUNC_ABI FunctionPass *createExpandReductionsPass();
 
   // This pass replaces intrinsics operating on vector operands with calls to
   // the corresponding function in a vector library (e.g., SVML, libmvec).
-  FunctionPass *createReplaceWithVeclibLegacyPass();
+  LLVM_FUNC_ABI FunctionPass *createReplaceWithVeclibLegacyPass();
 
   /// This pass expands the vector predication intrinsics into unpredicated
   /// instructions with selects or just the explicit vector length into the
   /// predicate mask.
-  FunctionPass *createExpandVectorPredicationPass();
+  LLVM_FUNC_ABI FunctionPass *createExpandVectorPredicationPass();
 
   // Expands large div/rem instructions.
-  FunctionPass *createExpandLargeDivRemPass();
+  LLVM_FUNC_ABI FunctionPass *createExpandLargeDivRemPass();
 
   // Expands large div/rem instructions.
-  FunctionPass *createExpandLargeFpConvertPass();
+  LLVM_FUNC_ABI FunctionPass *createExpandLargeFpConvertPass();
 
   // This pass expands memcmp() to load/stores.
-  FunctionPass *createExpandMemCmpPass();
+  LLVM_FUNC_ABI FunctionPass *createExpandMemCmpPass();
 
   /// Creates Break False Dependencies pass. \see BreakFalseDeps.cpp
-  FunctionPass *createBreakFalseDeps();
+  LLVM_FUNC_ABI FunctionPass *createBreakFalseDeps();
 
   // This pass expands indirectbr instructions.
-  FunctionPass *createIndirectBrExpandPass();
+  LLVM_FUNC_ABI FunctionPass *createIndirectBrExpandPass();
 
   /// Creates CFI Fixup pass. \see CFIFixup.cpp
-  FunctionPass *createCFIFixup();
+  LLVM_FUNC_ABI FunctionPass *createCFIFixup();
 
   /// Creates CFI Instruction Inserter pass. \see CFIInstrInserter.cpp
-  FunctionPass *createCFIInstrInserter();
+  LLVM_FUNC_ABI FunctionPass *createCFIInstrInserter();
 
   /// Creates CFGuard longjmp target identification pass.
   /// \see CFGuardLongjmp.cpp
-  FunctionPass *createCFGuardLongjmpPass();
+  LLVM_FUNC_ABI FunctionPass *createCFGuardLongjmpPass();
 
   /// Creates EHContGuard catchret target identification pass.
   /// \see EHContGuardCatchret.cpp
-  FunctionPass *createEHContGuardCatchretPass();
+  LLVM_FUNC_ABI FunctionPass *createEHContGuardCatchretPass();
 
   /// Create Hardware Loop pass. \see HardwareLoops.cpp
-  FunctionPass *createHardwareLoopsLegacyPass();
+  LLVM_FUNC_ABI FunctionPass *createHardwareLoopsLegacyPass();
 
   /// This pass inserts pseudo probe annotation for callsite profiling.
-  FunctionPass *createPseudoProbeInserter();
+  LLVM_FUNC_ABI FunctionPass *createPseudoProbeInserter();
 
   /// Create IR Type Promotion pass. \see TypePromotion.cpp
-  FunctionPass *createTypePromotionLegacyPass();
+  LLVM_FUNC_ABI FunctionPass *createTypePromotionLegacyPass();
 
   /// Add Flow Sensitive Discriminators. PassNum specifies the
   /// sequence number of this pass (starting from 1).
-  FunctionPass *
+  LLVM_FUNC_ABI FunctionPass *
   createMIRAddFSDiscriminatorsPass(sampleprof::FSDiscriminatorPass P);
 
   /// Read Flow Sensitive Profile.
-  FunctionPass *
+  LLVM_FUNC_ABI FunctionPass *
   createMIRProfileLoaderPass(std::string File, std::string RemappingFile,
                              sampleprof::FSDiscriminatorPass P,
                              IntrusiveRefCntPtr<vfs::FileSystem> FS);
 
   /// Creates MIR Debugify pass. \see MachineDebugify.cpp
-  ModulePass *createDebugifyMachineModulePass();
+  LLVM_FUNC_ABI ModulePass *createDebugifyMachineModulePass();
 
   /// Creates MIR Strip Debug pass. \see MachineStripDebug.cpp
   /// If OnlyDebugified is true then it will only strip debug info if it was
   /// added by a Debugify pass. The module will be left unchanged if the debug
   /// info was generated by another source such as clang.
-  ModulePass *createStripDebugMachineModulePass(bool OnlyDebugified);
+  LLVM_FUNC_ABI ModulePass *createStripDebugMachineModulePass(bool OnlyDebugified);
 
   /// Creates MIR Check Debug pass. \see MachineCheckDebugify.cpp
-  ModulePass *createCheckDebugMachineModulePass();
+  LLVM_FUNC_ABI ModulePass *createCheckDebugMachineModulePass();
 
   /// The pass fixups statepoint machine instruction to replace usage of
   /// caller saved registers with stack slots.
-  extern char &FixupStatepointCallerSavedID;
+  LLVM_FUNC_ABI extern char &FixupStatepointCallerSavedID;
 
   /// The pass transforms load/store <256 x i32> to AMX load/store intrinsics
   /// or split the data to two <128 x i32>.
-  FunctionPass *createX86LowerAMXTypePass();
+  LLVM_FUNC_ABI FunctionPass *createX86LowerAMXTypePass();
 
   /// The pass insert tile config intrinsics for AMX fast register allocation.
-  FunctionPass *createX86PreAMXConfigPass();
+  LLVM_FUNC_ABI FunctionPass *createX86PreAMXConfigPass();
 
   /// The pass transforms amx intrinsics to scalar operation if the function has
   /// optnone attribute or it is O0.
-  FunctionPass *createX86LowerAMXIntrinsicsPass();
+  LLVM_FUNC_ABI FunctionPass *createX86LowerAMXIntrinsicsPass();
 
   /// When learning an eviction policy, extract score(reward) information,
   /// otherwise this does nothing
-  FunctionPass *createRegAllocScoringPass();
+  LLVM_FUNC_ABI FunctionPass *createRegAllocScoringPass();
 
   /// JMC instrument pass.
-  ModulePass *createJMCInstrumenterPass();
+  LLVM_FUNC_ABI ModulePass *createJMCInstrumenterPass();
 
   /// This pass converts conditional moves to conditional jumps when profitable.
-  FunctionPass *createSelectOptimizePass();
+  LLVM_FUNC_ABI FunctionPass *createSelectOptimizePass();
 
-  FunctionPass *createCallBrPass();
+  LLVM_FUNC_ABI FunctionPass *createCallBrPass();
 
   /// Lowers KCFI operand bundles for indirect calls.
-  FunctionPass *createKCFIPass();
+  LLVM_FUNC_ABI FunctionPass *createKCFIPass();
 } // End llvm namespace
 
 #endif
diff --git a/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h b/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h
index 97d3b2e1229b1bb..08053a3058f7815 100644
--- a/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h
+++ b/llvm/include/llvm/CodeGen/PreISelIntrinsicLowering.h
@@ -20,7 +20,7 @@ namespace llvm {
 
 class Module;
 
-struct PreISelIntrinsicLoweringPass
+struct LLVM_CLASS_ABI PreISelIntrinsicLoweringPass
     : PassInfoMixin<PreISelIntrinsicLoweringPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/CodeGen/PseudoSourceValue.h b/llvm/include/llvm/CodeGen/PseudoSourceValue.h
index bffa2dd57851f66..a5494924f1d8c2d 100644
--- a/llvm/include/llvm/CodeGen/PseudoSourceValue.h
+++ b/llvm/include/llvm/CodeGen/PseudoSourceValue.h
@@ -28,12 +28,12 @@ class PseudoSourceValue;
 class raw_ostream;
 class TargetMachine;
 
-raw_ostream &operator<<(raw_ostream &OS, const PseudoSourceValue* PSV);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PseudoSourceValue* PSV);
 
 /// Special value supplied for machine level alias analysis. It indicates that
 /// a memory access references the functions stack frame (e.g., a spill slot),
 /// below the stack frame (e.g., argument space), or constant pool.
-class PseudoSourceValue {
+class LLVM_CLASS_ABI PseudoSourceValue {
 public:
   enum PSVKind : unsigned {
     Stack,
@@ -49,7 +49,7 @@ class PseudoSourceValue {
 private:
   unsigned Kind;
   unsigned AddressSpace;
-  friend raw_ostream &llvm::operator<<(raw_ostream &OS,
+  friend LLVM_FUNC_ABI raw_ostream &llvm::operator<<(raw_ostream &OS,
                                        const PseudoSourceValue* PSV);
 
   friend class MachineMemOperand; // For printCustom().
@@ -92,7 +92,7 @@ class PseudoSourceValue {
 
 /// A specialized PseudoSourceValue for holding FixedStack values, which must
 /// include a frame index.
-class FixedStackPseudoSourceValue : public PseudoSourceValue {
+class LLVM_CLASS_ABI FixedStackPseudoSourceValue : public PseudoSourceValue {
   const int FI;
 
 public:
@@ -114,7 +114,7 @@ class FixedStackPseudoSourceValue : public PseudoSourceValue {
   int getFrameIndex() const { return FI; }
 };
 
-class CallEntryPseudoSourceValue : public PseudoSourceValue {
+class LLVM_CLASS_ABI CallEntryPseudoSourceValue : public PseudoSourceValue {
 protected:
   CallEntryPseudoSourceValue(unsigned Kind, const TargetMachine &TM);
 
@@ -125,7 +125,7 @@ class CallEntryPseudoSourceValue : public PseudoSourceValue {
 };
 
 /// A specialized pseudo source value for holding GlobalValue values.
-class GlobalValuePseudoSourceValue : public CallEntryPseudoSourceValue {
+class LLVM_CLASS_ABI GlobalValuePseudoSourceValue : public CallEntryPseudoSourceValue {
   const GlobalValue *GV;
 
 public:
@@ -139,7 +139,7 @@ class GlobalValuePseudoSourceValue : public CallEntryPseudoSourceValue {
 };
 
 /// A specialized pseudo source value for holding external symbol values.
-class ExternalSymbolPseudoSourceValue : public CallEntryPseudoSourceValue {
+class LLVM_CLASS_ABI ExternalSymbolPseudoSourceValue : public CallEntryPseudoSourceValue {
   const char *ES;
 
 public:
@@ -153,7 +153,7 @@ class ExternalSymbolPseudoSourceValue : public CallEntryPseudoSourceValue {
 };
 
 /// Manages creation of pseudo source values.
-class PseudoSourceValueManager {
+class LLVM_CLASS_ABI PseudoSourceValueManager {
   const TargetMachine &TM;
   const PseudoSourceValue StackPSV, GOTPSV, JumpTablePSV, ConstantPoolPSV;
   std::map<int, std::unique_ptr<FixedStackPseudoSourceValue>> FSValues;
diff --git a/llvm/include/llvm/CodeGen/RDFGraph.h b/llvm/include/llvm/CodeGen/RDFGraph.h
index 1e9ccc812ff1fa1..0c0f86b46b2c6d3 100644
--- a/llvm/include/llvm/CodeGen/RDFGraph.h
+++ b/llvm/include/llvm/CodeGen/RDFGraph.h
@@ -264,7 +264,7 @@ using NodeId = uint32_t;
 
 struct DataFlowGraph;
 
-struct NodeAttrs {
+struct LLVM_CLASS_ABI NodeAttrs {
   // clang-format off
   enum : uint16_t {
     None          = 0x0000,   // Nothing
@@ -334,7 +334,7 @@ struct NodeAttrs {
   }
 };
 
-struct BuildOptions {
+struct LLVM_CLASS_ABI BuildOptions {
   enum : unsigned {
     None = 0x00,
     KeepDeadPhis = 0x01, // Do not remove dead phis during build.
@@ -342,7 +342,7 @@ struct BuildOptions {
   };
 };
 
-template <typename T> struct NodeAddr {
+template <typename T> struct LLVM_CLASS_ABI NodeAddr {
   NodeAddr() = default;
   NodeAddr(T A, NodeId I) : Addr(A), Id(I) {}
 
@@ -409,7 +409,7 @@ using Func = NodeAddr<FuncNode *>;
 //
 // This method significantly improved the build time, compared to using maps
 // (std::unordered_map or DenseMap) to translate between pointers and ids.
-struct NodeAllocator {
+struct LLVM_CLASS_ABI NodeAllocator {
   // Amount of storage for a single node.
   enum { NodeMemSize = 32 };
 
@@ -450,7 +450,7 @@ struct NodeAllocator {
 
 using RegisterSet = std::set<RegisterRef>;
 
-struct TargetOperandInfo {
+struct LLVM_CLASS_ABI TargetOperandInfo {
   TargetOperandInfo(const TargetInstrInfo &tii) : TII(tii) {}
   virtual ~TargetOperandInfo() = default;
 
@@ -462,12 +462,12 @@ struct TargetOperandInfo {
 };
 
 // Packed register reference. Only used for storage.
-struct PackedRegisterRef {
+struct LLVM_CLASS_ABI PackedRegisterRef {
   RegisterId Reg;
   uint32_t MaskId;
 };
 
-struct LaneMaskIndex : private IndexedSet<LaneBitmask> {
+struct LLVM_CLASS_ABI LaneMaskIndex : private IndexedSet<LaneBitmask> {
   LaneMaskIndex() = default;
 
   LaneBitmask getLaneMaskForIndex(uint32_t K) const {
@@ -485,7 +485,7 @@ struct LaneMaskIndex : private IndexedSet<LaneBitmask> {
   }
 };
 
-struct NodeBase {
+struct LLVM_CLASS_ABI NodeBase {
 public:
   // Make sure this is a POD.
   NodeBase() = default;
@@ -551,7 +551,7 @@ static_assert(sizeof(NodeBase) <= NodeAllocator::NodeMemSize,
 using NodeList = SmallVector<Node, 4>;
 using NodeSet = std::set<NodeId>;
 
-struct RefNode : public NodeBase {
+struct LLVM_CLASS_ABI RefNode : public NodeBase {
   RefNode() = default;
 
   RegisterRef getRegRef(const DataFlowGraph &G) const;
@@ -586,7 +586,7 @@ struct RefNode : public NodeBase {
   Node getOwner(const DataFlowGraph &G);
 };
 
-struct DefNode : public RefNode {
+struct LLVM_CLASS_ABI DefNode : public RefNode {
   NodeId getReachedDef() const { return RefData.Def.DD; }
   void setReachedDef(NodeId D) { RefData.Def.DD = D; }
   NodeId getReachedUse() const { return RefData.Def.DU; }
@@ -595,11 +595,11 @@ struct DefNode : public RefNode {
   void linkToDef(NodeId Self, Def DA);
 };
 
-struct UseNode : public RefNode {
+struct LLVM_CLASS_ABI UseNode : public RefNode {
   void linkToDef(NodeId Self, Def DA);
 };
 
-struct PhiUseNode : public UseNode {
+struct LLVM_CLASS_ABI PhiUseNode : public UseNode {
   NodeId getPredecessor() const {
     assert(getFlags() & NodeAttrs::PhiRef);
     return RefData.PhiU.PredB;
@@ -610,7 +610,7 @@ struct PhiUseNode : public UseNode {
   }
 };
 
-struct CodeNode : public NodeBase {
+struct LLVM_CLASS_ABI CodeNode : public NodeBase {
   template <typename T> T getCode() const { //
     return static_cast<T>(CodeData.CP);
   }
@@ -627,21 +627,21 @@ struct CodeNode : public NodeBase {
   NodeList members_if(Predicate P, const DataFlowGraph &G) const;
 };
 
-struct InstrNode : public CodeNode {
+struct LLVM_CLASS_ABI InstrNode : public CodeNode {
   Node getOwner(const DataFlowGraph &G);
 };
 
-struct PhiNode : public InstrNode {
+struct LLVM_CLASS_ABI PhiNode : public InstrNode {
   MachineInstr *getCode() const { return nullptr; }
 };
 
-struct StmtNode : public InstrNode {
+struct LLVM_CLASS_ABI StmtNode : public InstrNode {
   MachineInstr *getCode() const { //
     return CodeNode::getCode<MachineInstr *>();
   }
 };
 
-struct BlockNode : public CodeNode {
+struct LLVM_CLASS_ABI BlockNode : public CodeNode {
   MachineBasicBlock *getCode() const {
     return CodeNode::getCode<MachineBasicBlock *>();
   }
@@ -649,7 +649,7 @@ struct BlockNode : public CodeNode {
   void addPhi(Phi PA, const DataFlowGraph &G);
 };
 
-struct FuncNode : public CodeNode {
+struct LLVM_CLASS_ABI FuncNode : public CodeNode {
   MachineFunction *getCode() const {
     return CodeNode::getCode<MachineFunction *>();
   }
@@ -658,7 +658,7 @@ struct FuncNode : public CodeNode {
   Block getEntryBlock(const DataFlowGraph &G);
 };
 
-struct DataFlowGraph {
+struct LLVM_CLASS_ABI DataFlowGraph {
   DataFlowGraph(MachineFunction &mf, const TargetInstrInfo &tii,
                 const TargetRegisterInfo &tri, const MachineDominatorTree &mdt,
                 const MachineDominanceFrontier &mdf);
@@ -958,7 +958,7 @@ NodeList CodeNode::members_if(Predicate P, const DataFlowGraph &G) const {
   return MM;
 }
 
-template <typename T> struct Print {
+template <typename T> struct LLVM_CLASS_ABI Print {
   Print(const T &x, const DataFlowGraph &g) : Obj(x), G(g) {}
 
   const T &Obj;
@@ -967,27 +967,27 @@ template <typename T> struct Print {
 
 template <typename T> Print(const T &, const DataFlowGraph &) -> Print<T>;
 
-template <typename T> struct PrintNode : Print<NodeAddr<T>> {
+template <typename T> struct LLVM_CLASS_ABI PrintNode : Print<NodeAddr<T>> {
   PrintNode(const NodeAddr<T> &x, const DataFlowGraph &g)
       : Print<NodeAddr<T>>(x, g) {}
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterRef> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<NodeId> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<Def> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<Use> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<PhiUse> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<Ref> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<NodeList> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<NodeSet> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<Phi> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<Stmt> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<Instr> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<Block> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<Func> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterSet> &P);
-raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterAggr> &P);
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterRef> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<NodeId> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Def> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Use> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<PhiUse> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Ref> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<NodeList> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<NodeSet> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Phi> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Stmt> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Instr> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Block> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Func> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterSet> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterAggr> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         const Print<DataFlowGraph::DefStack> &P);
 
 } // end namespace rdf
diff --git a/llvm/include/llvm/CodeGen/RDFLiveness.h b/llvm/include/llvm/CodeGen/RDFLiveness.h
index 4091769fab938e2..a4a1436639a7020 100644
--- a/llvm/include/llvm/CodeGen/RDFLiveness.h
+++ b/llvm/include/llvm/CodeGen/RDFLiveness.h
@@ -42,7 +42,7 @@ using NodeRef = std::pair<NodeId, LaneBitmask>;
 
 namespace std {
 
-template <> struct hash<llvm::rdf::detail::NodeRef> {
+template <> struct LLVM_CLASS_ABI hash<llvm::rdf::detail::NodeRef> {
   std::size_t operator()(llvm::rdf::detail::NodeRef R) const {
     return std::hash<llvm::rdf::NodeId>{}(R.first) ^
            std::hash<llvm::LaneBitmask::Type>{}(R.second.getAsInteger());
@@ -53,7 +53,7 @@ template <> struct hash<llvm::rdf::detail::NodeRef> {
 
 namespace llvm::rdf {
 
-struct Liveness {
+struct LLVM_CLASS_ABI Liveness {
 public:
   using LiveMapType = RegisterAggrMap<MachineBasicBlock *>;
   using NodeRef = detail::NodeRef;
@@ -154,7 +154,7 @@ struct Liveness {
                             unsigned Nest, unsigned MaxNest);
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const Print<Liveness::RefMap> &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Print<Liveness::RefMap> &P);
 
 } // end namespace llvm::rdf
 
diff --git a/llvm/include/llvm/CodeGen/RDFRegisters.h b/llvm/include/llvm/CodeGen/RDFRegisters.h
index 9d8174600f99467..6172e5bcd5c7bd6 100644
--- a/llvm/include/llvm/CodeGen/RDFRegisters.h
+++ b/llvm/include/llvm/CodeGen/RDFRegisters.h
@@ -51,7 +51,7 @@ bool disjoint(const std::set<T> &A, const std::set<T> &B) {
 // The map will act like an indexed set: upon insertion of a new object,
 // it will automatically assign a new index to it. Index of 0 is treated
 // as invalid and is never allocated.
-template <typename T, unsigned N = 32> struct IndexedSet {
+template <typename T, unsigned N = 32> struct LLVM_CLASS_ABI IndexedSet {
   IndexedSet() { Map.reserve(N); }
 
   T get(uint32_t Idx) const {
@@ -86,7 +86,7 @@ template <typename T, unsigned N = 32> struct IndexedSet {
   std::vector<T> Map;
 };
 
-struct RegisterRef {
+struct LLVM_CLASS_ABI RegisterRef {
   RegisterId Reg = 0;
   LaneBitmask Mask = LaneBitmask::getNone(); // Only for registers.
 
@@ -139,7 +139,7 @@ struct RegisterRef {
   bool operator!=(RegisterRef) const = delete;
 };
 
-struct PhysicalRegisterInfo {
+struct LLVM_CLASS_ABI PhysicalRegisterInfo {
   PhysicalRegisterInfo(const TargetRegisterInfo &tri,
                        const MachineFunction &mf);
 
@@ -202,7 +202,7 @@ struct PhysicalRegisterInfo {
   std::vector<AliasInfo> AliasInfos;
 };
 
-struct RegisterAggr {
+struct LLVM_CLASS_ABI RegisterAggr {
   RegisterAggr(const PhysicalRegisterInfo &pri)
       : Units(pri.getTRI().getNumRegUnits()), PRI(pri) {}
   RegisterAggr(const RegisterAggr &RG) = default;
@@ -288,7 +288,7 @@ struct RegisterAggr {
 
 // This is really a std::map, except that it provides a non-trivial
 // default constructor to the element accessed via [].
-template <typename KeyType> struct RegisterAggrMap {
+template <typename KeyType> struct LLVM_CLASS_ABI RegisterAggrMap {
   RegisterAggrMap(const PhysicalRegisterInfo &pri) : Empty(pri) {}
 
   RegisterAggr &operator[](KeyType Key) {
@@ -311,33 +311,33 @@ template <typename KeyType> struct RegisterAggrMap {
   using value_type = typename decltype(Map)::value_type;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const RegisterAggr &A);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const RegisterAggr &A);
 
 // Print the lane mask in a short form (or not at all if all bits are set).
-struct PrintLaneMaskShort {
+struct LLVM_CLASS_ABI PrintLaneMaskShort {
   PrintLaneMaskShort(LaneBitmask M) : Mask(M) {}
   LaneBitmask Mask;
 };
-raw_ostream &operator<<(raw_ostream &OS, const PrintLaneMaskShort &P);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PrintLaneMaskShort &P);
 
 } // end namespace rdf
 } // end namespace llvm
 
 namespace std {
 
-template <> struct hash<llvm::rdf::RegisterRef> {
+template <> struct LLVM_CLASS_ABI hash<llvm::rdf::RegisterRef> {
   size_t operator()(llvm::rdf::RegisterRef A) const { //
     return A.hash();
   }
 };
 
-template <> struct hash<llvm::rdf::RegisterAggr> {
+template <> struct LLVM_CLASS_ABI hash<llvm::rdf::RegisterAggr> {
   size_t operator()(const llvm::rdf::RegisterAggr &A) const { //
     return A.hash();
   }
 };
 
-template <> struct equal_to<llvm::rdf::RegisterRef> {
+template <> struct LLVM_CLASS_ABI equal_to<llvm::rdf::RegisterRef> {
   constexpr equal_to(const llvm::rdf::PhysicalRegisterInfo &pri) : PRI(&pri) {}
 
   bool operator()(llvm::rdf::RegisterRef A, llvm::rdf::RegisterRef B) const {
@@ -349,14 +349,14 @@ template <> struct equal_to<llvm::rdf::RegisterRef> {
   const llvm::rdf::PhysicalRegisterInfo *PRI;
 };
 
-template <> struct equal_to<llvm::rdf::RegisterAggr> {
+template <> struct LLVM_CLASS_ABI equal_to<llvm::rdf::RegisterAggr> {
   bool operator()(const llvm::rdf::RegisterAggr &A,
                   const llvm::rdf::RegisterAggr &B) const {
     return A == B;
   }
 };
 
-template <> struct less<llvm::rdf::RegisterRef> {
+template <> struct LLVM_CLASS_ABI less<llvm::rdf::RegisterRef> {
   constexpr less(const llvm::rdf::PhysicalRegisterInfo &pri) : PRI(&pri) {}
 
   bool operator()(llvm::rdf::RegisterRef A, llvm::rdf::RegisterRef B) const {
diff --git a/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h b/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h
index 7386af9d54eee4b..36ad2ef22c09c1e 100644
--- a/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h
+++ b/llvm/include/llvm/CodeGen/ReachingDefAnalysis.h
@@ -38,7 +38,7 @@ class MachineInstr;
 /// using an encoding that makes it compatible with TinyPtrVector.
 /// The 0th LSB is forced zero (and will be used for pointer union tagging),
 /// The 1st LSB is forced one (to make sure the value is non-zero).
-class ReachingDef {
+class LLVM_CLASS_ABI ReachingDef {
   uintptr_t Encoded;
   friend struct PointerLikeTypeTraits<ReachingDef>;
   explicit ReachingDef(uintptr_t Encoded) : Encoded(Encoded) {}
@@ -50,7 +50,7 @@ class ReachingDef {
 };
 
 template<>
-struct PointerLikeTypeTraits<ReachingDef> {
+struct LLVM_CLASS_ABI PointerLikeTypeTraits<ReachingDef> {
   static constexpr int NumLowBitsAvailable = 1;
 
   static inline void *getAsVoidPointer(const ReachingDef &RD) {
@@ -67,7 +67,7 @@ struct PointerLikeTypeTraits<ReachingDef> {
 };
 
 /// This class provides the reaching def analysis.
-class ReachingDefAnalysis : public MachineFunctionPass {
+class LLVM_CLASS_ABI ReachingDefAnalysis : public MachineFunctionPass {
 private:
   MachineFunction *MF = nullptr;
   const TargetRegisterInfo *TRI = nullptr;
diff --git a/llvm/include/llvm/CodeGen/RegAllocPBQP.h b/llvm/include/llvm/CodeGen/RegAllocPBQP.h
index c0cc2726a159211..1ae93145c444488 100644
--- a/llvm/include/llvm/CodeGen/RegAllocPBQP.h
+++ b/llvm/include/llvm/CodeGen/RegAllocPBQP.h
@@ -51,7 +51,7 @@ inline unsigned getSpillOptionIdx() { return 0; }
 /// Metadata to speed allocatability test.
 ///
 /// Keeps track of the number of infinities in each row and column.
-class MatrixMetadata {
+class LLVM_CLASS_ABI MatrixMetadata {
 public:
   MatrixMetadata(const Matrix& M)
     : UnsafeRows(new bool[M.getRows() - 1]()),
@@ -92,8 +92,8 @@ class MatrixMetadata {
 };
 
 /// Holds a vector of the allowed physical regs for a vreg.
-class AllowedRegVector {
-  friend hash_code hash_value(const AllowedRegVector &);
+class LLVM_CLASS_ABI AllowedRegVector {
+  friend LLVM_FUNC_ABI hash_code hash_value(const AllowedRegVector &);
 
 public:
   AllowedRegVector() = default;
@@ -130,7 +130,7 @@ inline hash_code hash_value(const AllowedRegVector &OptRegs) {
 }
 
 /// Holds graph-level metadata relevant to PBQP RA problems.
-class GraphMetadata {
+class LLVM_CLASS_ABI GraphMetadata {
 private:
   using AllowedRegVecPool = ValuePool<AllowedRegVector>;
 
@@ -167,7 +167,7 @@ class GraphMetadata {
 };
 
 /// Holds solver state and other metadata relevant to each PBQP RA node.
-class NodeMetadata {
+class LLVM_CLASS_ABI NodeMetadata {
 public:
   using AllowedRegVector = RegAlloc::AllowedRegVector;
 
@@ -268,7 +268,7 @@ class NodeMetadata {
 #endif
 };
 
-class RegAllocSolverImpl {
+class LLVM_CLASS_ABI RegAllocSolverImpl {
 private:
   using RAMatrix = MDMatrix<MatrixMetadata>;
 
@@ -501,7 +501,7 @@ class RegAllocSolverImpl {
   NodeSet NotProvablyAllocatableNodes;
 };
 
-class PBQPRAGraph : public PBQP::Graph<RegAllocSolverImpl> {
+class LLVM_CLASS_ABI PBQPRAGraph : public PBQP::Graph<RegAllocSolverImpl> {
 private:
   using BaseT = PBQP::Graph<RegAllocSolverImpl>;
 
@@ -531,7 +531,7 @@ inline Solution solve(PBQPRAGraph& G) {
 } // end namespace PBQP
 
 /// Create a PBQP register allocator instance.
-FunctionPass *
+LLVM_FUNC_ABI FunctionPass *
 createPBQPRegisterAllocator(char *customPassID = nullptr);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/RegAllocRegistry.h b/llvm/include/llvm/CodeGen/RegAllocRegistry.h
index 14fa5861f0cf4ff..b53fd82d6c345cf 100644
--- a/llvm/include/llvm/CodeGen/RegAllocRegistry.h
+++ b/llvm/include/llvm/CodeGen/RegAllocRegistry.h
@@ -28,7 +28,7 @@ class FunctionPass;
 ///
 //===----------------------------------------------------------------------===//
 template <class SubClass>
-class RegisterRegAllocBase : public MachinePassRegistryNode<FunctionPass *(*)()> {
+class LLVM_CLASS_ABI RegisterRegAllocBase : public MachinePassRegistryNode<FunctionPass *(*)()> {
 public:
   using FunctionPassCtor = FunctionPass *(*)();
 
@@ -59,7 +59,7 @@ class RegisterRegAllocBase : public MachinePassRegistryNode<FunctionPass *(*)()>
   }
 };
 
-class RegisterRegAlloc : public RegisterRegAllocBase<RegisterRegAlloc> {
+class LLVM_CLASS_ABI RegisterRegAlloc : public RegisterRegAllocBase<RegisterRegAlloc> {
 public:
   RegisterRegAlloc(const char *N, const char *D, FunctionPassCtor C)
     : RegisterRegAllocBase(N, D, C) {}
diff --git a/llvm/include/llvm/CodeGen/Register.h b/llvm/include/llvm/CodeGen/Register.h
index f8daf0b4e1e0f4b..711ac188882a4ae 100644
--- a/llvm/include/llvm/CodeGen/Register.h
+++ b/llvm/include/llvm/CodeGen/Register.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 /// Wrapper class representing virtual and physical registers. Should be passed
 /// by value.
-class Register {
+class LLVM_CLASS_ABI Register {
   unsigned Reg;
 
 public:
@@ -148,7 +148,7 @@ class Register {
 };
 
 // Provide DenseMapInfo for Register
-template <> struct DenseMapInfo<Register> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<Register> {
   static inline unsigned getEmptyKey() {
     return DenseMapInfo<unsigned>::getEmptyKey();
   }
diff --git a/llvm/include/llvm/CodeGen/RegisterBank.h b/llvm/include/llvm/CodeGen/RegisterBank.h
index 56fa270f04a5652..797aa88efee0287 100644
--- a/llvm/include/llvm/CodeGen/RegisterBank.h
+++ b/llvm/include/llvm/CodeGen/RegisterBank.h
@@ -26,7 +26,7 @@ class TargetRegisterInfo;
 /// This class implements the register bank concept.
 /// Two instances of RegisterBank must have different ID.
 /// This property is enforced by the RegisterBankInfo class.
-class RegisterBank {
+class LLVM_CLASS_ABI RegisterBank {
 private:
   unsigned ID;
   const char *Name;
diff --git a/llvm/include/llvm/CodeGen/RegisterBankInfo.h b/llvm/include/llvm/CodeGen/RegisterBankInfo.h
index 10a4ef06410d454..a05e771f9535f58 100644
--- a/llvm/include/llvm/CodeGen/RegisterBankInfo.h
+++ b/llvm/include/llvm/CodeGen/RegisterBankInfo.h
@@ -37,7 +37,7 @@ class TargetRegisterClass;
 class TargetRegisterInfo;
 
 /// Holds all the information related to register banks.
-class RegisterBankInfo {
+class LLVM_CLASS_ABI RegisterBankInfo {
 public:
   /// Helper struct that represents how a value is partially mapped
   /// into a register.
@@ -786,7 +786,7 @@ operator<<(raw_ostream &OS, const RegisterBankInfo::OperandsMapper &OpdMapper) {
 
 /// Hashing function for PartialMapping.
 /// It is required for the hashing of ValueMapping.
-hash_code hash_value(const RegisterBankInfo::PartialMapping &PartMapping);
+LLVM_FUNC_ABI hash_code hash_value(const RegisterBankInfo::PartialMapping &PartMapping);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/RegisterClassInfo.h b/llvm/include/llvm/CodeGen/RegisterClassInfo.h
index e9297a85b1495a6..59f542df34c67a6 100644
--- a/llvm/include/llvm/CodeGen/RegisterClassInfo.h
+++ b/llvm/include/llvm/CodeGen/RegisterClassInfo.h
@@ -27,7 +27,7 @@
 
 namespace llvm {
 
-class RegisterClassInfo {
+class LLVM_CLASS_ABI RegisterClassInfo {
   struct RCInfo {
     unsigned Tag = 0;
     unsigned NumRegs = 0;
diff --git a/llvm/include/llvm/CodeGen/RegisterPressure.h b/llvm/include/llvm/CodeGen/RegisterPressure.h
index b2d0507bcf5b1fd..a0efb23d89da146 100644
--- a/llvm/include/llvm/CodeGen/RegisterPressure.h
+++ b/llvm/include/llvm/CodeGen/RegisterPressure.h
@@ -36,7 +36,7 @@ class MachineInstr;
 class MachineRegisterInfo;
 class RegisterClassInfo;
 
-struct RegisterMaskPair {
+struct LLVM_CLASS_ABI RegisterMaskPair {
   Register RegUnit; ///< Virtual register or register unit.
   LaneBitmask LaneMask;
 
@@ -45,7 +45,7 @@ struct RegisterMaskPair {
 };
 
 /// Base class for register pressure results.
-struct RegisterPressure {
+struct LLVM_CLASS_ABI RegisterPressure {
   /// Map of max reg pressure indexed by pressure set ID, not class ID.
   std::vector<unsigned> MaxSetPressure;
 
@@ -65,7 +65,7 @@ struct RegisterPressure {
 /// because delimiting regions by SlotIndex is more robust and convenient than
 /// holding block iterators. The block contents can change without invalidating
 /// the pressure result.
-struct IntervalPressure : RegisterPressure {
+struct LLVM_CLASS_ABI IntervalPressure : RegisterPressure {
   /// Record the boundary of the region being tracked.
   SlotIndex TopIdx;
   SlotIndex BottomIdx;
@@ -80,7 +80,7 @@ struct IntervalPressure : RegisterPressure {
 /// RegisterPressure computed within a region of instructions delimited by
 /// TopPos and BottomPos. This is a less precise version of IntervalPressure for
 /// use when LiveIntervals are unavailable.
-struct RegionPressure : RegisterPressure {
+struct LLVM_CLASS_ABI RegionPressure : RegisterPressure {
   /// Record the boundary of the region being tracked.
   MachineBasicBlock::const_iterator TopPos;
   MachineBasicBlock::const_iterator BottomPos;
@@ -100,7 +100,7 @@ struct RegionPressure : RegisterPressure {
 /// heuristics, so we don't check UnitInc overflow. Instead, we may have a
 /// higher level assert that pressure is consistent within a region. We also
 /// effectively ignore dead defs which don't affect heuristics much.
-class PressureChange {
+class LLVM_CLASS_ABI PressureChange {
   uint16_t PSetID = 0; // ID+1. 0=Invalid.
   int16_t UnitInc = 0;
 
@@ -138,7 +138,7 @@ class PressureChange {
 /// Use a small fixed number, because we can fit more PressureChanges in an
 /// empty SmallVector than ever need to be tracked per register class. If more
 /// PSets are affected, then we only track the most constrained.
-class PressureDiff {
+class LLVM_CLASS_ABI PressureDiff {
   // The initial design was for MaxPSets=4, but that requires PSet partitions,
   // which are not yet implemented. (PSet partitions are equivalent PSets given
   // the register classes actually in use within the scheduling region.)
@@ -164,7 +164,7 @@ class PressureDiff {
 };
 
 /// List of registers defined and used by a machine instruction.
-class RegisterOperands {
+class LLVM_CLASS_ABI RegisterOperands {
 public:
   /// List of virtual registers and register units read by the instruction.
   SmallVector<RegisterMaskPair, 8> Uses;
@@ -195,7 +195,7 @@ class RegisterOperands {
 };
 
 /// Array of PressureDiffs.
-class PressureDiffs {
+class LLVM_CLASS_ABI PressureDiffs {
   PressureDiff *PDiffArray = nullptr;
   unsigned Size = 0;
   unsigned Max = 0;
@@ -238,7 +238,7 @@ class PressureDiffs {
 ///
 /// CurrentMax records the largest increase in the tracker's max pressure that
 /// exceeds the current limit for some pressure set determined by the client.
-struct RegPressureDelta {
+struct LLVM_CLASS_ABI RegPressureDelta {
   PressureChange Excess;
   PressureChange CriticalMax;
   PressureChange CurrentMax;
@@ -259,7 +259,7 @@ struct RegPressureDelta {
 ///
 /// This is a wrapper around a SparseSet which deals with mapping register unit
 /// and virtual register indexes to an index usable by the sparse set.
-class LiveRegSet {
+class LLVM_CLASS_ABI LiveRegSet {
 private:
   struct IndexMaskPair {
     unsigned Index;
@@ -357,7 +357,7 @@ class LiveRegSet {
 /// explicitly called. Similarly, P.TopIdx is invalid during upward
 /// tracking. Changing direction has the side effect of closing region, and
 /// traversing past TopIdx or BottomIdx reopens it.
-class RegPressureTracker {
+class LLVM_CLASS_ABI RegPressureTracker {
   const MachineFunction *MF = nullptr;
   const TargetRegisterInfo *TRI = nullptr;
   const RegisterClassInfo *RCI = nullptr;
@@ -568,7 +568,7 @@ class RegPressureTracker {
   LaneBitmask getLiveThroughAt(Register RegUnit, SlotIndex Pos) const;
 };
 
-void dumpRegSetPressure(ArrayRef<unsigned> SetPressure,
+LLVM_FUNC_ABI void dumpRegSetPressure(ArrayRef<unsigned> SetPressure,
                         const TargetRegisterInfo *TRI);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/RegisterScavenging.h b/llvm/include/llvm/CodeGen/RegisterScavenging.h
index bd7a688e77a34fc..55a6c3701adb534 100644
--- a/llvm/include/llvm/CodeGen/RegisterScavenging.h
+++ b/llvm/include/llvm/CodeGen/RegisterScavenging.h
@@ -32,7 +32,7 @@ class TargetInstrInfo;
 class TargetRegisterClass;
 class TargetRegisterInfo;
 
-class RegScavenger {
+class LLVM_CLASS_ABI RegScavenger {
   const TargetRegisterInfo *TRI = nullptr;
   const TargetInstrInfo *TII = nullptr;
   MachineRegisterInfo *MRI = nullptr;
@@ -213,7 +213,7 @@ class RegScavenger {
 
 /// Replaces all frame index virtual registers with physical registers. Uses the
 /// register scavenger to find an appropriate register to use.
-void scavengeFrameVirtualRegs(MachineFunction &MF, RegScavenger &RS);
+LLVM_FUNC_ABI void scavengeFrameVirtualRegs(MachineFunction &MF, RegScavenger &RS);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/RegisterUsageInfo.h b/llvm/include/llvm/CodeGen/RegisterUsageInfo.h
index 4b474c4eb8433a0..65503fb88604474 100644
--- a/llvm/include/llvm/CodeGen/RegisterUsageInfo.h
+++ b/llvm/include/llvm/CodeGen/RegisterUsageInfo.h
@@ -32,7 +32,7 @@ namespace llvm {
 class Function;
 class LLVMTargetMachine;
 
-class PhysicalRegisterUsageInfo : public ImmutablePass {
+class LLVM_CLASS_ABI PhysicalRegisterUsageInfo : public ImmutablePass {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/CodeGen/ReplaceWithVeclib.h b/llvm/include/llvm/CodeGen/ReplaceWithVeclib.h
index b4d308d890bf2c1..ddc370b19246e95 100644
--- a/llvm/include/llvm/CodeGen/ReplaceWithVeclib.h
+++ b/llvm/include/llvm/CodeGen/ReplaceWithVeclib.h
@@ -22,12 +22,12 @@
 
 namespace llvm {
 class Function;
-struct ReplaceWithVeclib : public PassInfoMixin<ReplaceWithVeclib> {
+struct LLVM_CLASS_ABI ReplaceWithVeclib : public PassInfoMixin<ReplaceWithVeclib> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
 // Legacy pass
-struct ReplaceWithVeclibLegacy : public FunctionPass {
+struct LLVM_CLASS_ABI ReplaceWithVeclibLegacy : public FunctionPass {
   static char ID;
   ReplaceWithVeclibLegacy() : FunctionPass(ID) {
     initializeReplaceWithVeclibLegacyPass(*PassRegistry::getPassRegistry());
diff --git a/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h b/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
index 41bdd72c4bd5a8e..4ad8b3522e9fee4 100644
--- a/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
+++ b/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h
@@ -28,14 +28,14 @@ namespace llvm {
   class TargetRegisterInfo;
 
   /// Sorting functions for the Available queue.
-  struct resource_sort {
+  struct LLVM_CLASS_ABI resource_sort {
     ResourcePriorityQueue *PQ;
     explicit resource_sort(ResourcePriorityQueue *pq) : PQ(pq) {}
 
     bool operator()(const SUnit* LHS, const SUnit* RHS) const;
   };
 
-  class ResourcePriorityQueue : public SchedulingPriorityQueue {
+  class LLVM_CLASS_ABI ResourcePriorityQueue : public SchedulingPriorityQueue {
     /// SUnits - The SUnits for the current graph.
     std::vector<SUnit> *SUnits;
 
diff --git a/llvm/include/llvm/CodeGen/RuntimeLibcalls.h b/llvm/include/llvm/CodeGen/RuntimeLibcalls.h
index fa2868b993c5705..6d1333d0c19d383 100644
--- a/llvm/include/llvm/CodeGen/RuntimeLibcalls.h
+++ b/llvm/include/llvm/CodeGen/RuntimeLibcalls.h
@@ -36,7 +36,7 @@ namespace RTLIB {
 
   /// GetFPLibCall - Helper to return the right libcall for the given floating
   /// point type, or UNKNOWN_LIBCALL if there is none.
-  Libcall getFPLibCall(EVT VT,
+  LLVM_FUNC_ABI Libcall getFPLibCall(EVT VT,
                        Libcall Call_F32,
                        Libcall Call_F64,
                        Libcall Call_F80,
@@ -45,62 +45,62 @@ namespace RTLIB {
 
   /// getFPEXT - Return the FPEXT_*_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getFPEXT(EVT OpVT, EVT RetVT);
+  LLVM_FUNC_ABI Libcall getFPEXT(EVT OpVT, EVT RetVT);
 
   /// getFPROUND - Return the FPROUND_*_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getFPROUND(EVT OpVT, EVT RetVT);
+  LLVM_FUNC_ABI Libcall getFPROUND(EVT OpVT, EVT RetVT);
 
   /// getFPTOSINT - Return the FPTOSINT_*_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
+  LLVM_FUNC_ABI Libcall getFPTOSINT(EVT OpVT, EVT RetVT);
 
   /// getFPTOUINT - Return the FPTOUINT_*_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
+  LLVM_FUNC_ABI Libcall getFPTOUINT(EVT OpVT, EVT RetVT);
 
   /// getSINTTOFP - Return the SINTTOFP_*_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
+  LLVM_FUNC_ABI Libcall getSINTTOFP(EVT OpVT, EVT RetVT);
 
   /// getUINTTOFP - Return the UINTTOFP_*_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
+  LLVM_FUNC_ABI Libcall getUINTTOFP(EVT OpVT, EVT RetVT);
 
   /// getPOWI - Return the POWI_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getPOWI(EVT RetVT);
+  LLVM_FUNC_ABI Libcall getPOWI(EVT RetVT);
 
   /// getLDEXP - Return the LDEXP_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getLDEXP(EVT RetVT);
+  LLVM_FUNC_ABI Libcall getLDEXP(EVT RetVT);
 
   /// getFREXP - Return the FREXP_* value for the given types, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getFREXP(EVT RetVT);
+  LLVM_FUNC_ABI Libcall getFREXP(EVT RetVT);
 
   /// Return the SYNC_FETCH_AND_* value for the given opcode and type, or
   /// UNKNOWN_LIBCALL if there is none.
-  Libcall getSYNC(unsigned Opc, MVT VT);
+  LLVM_FUNC_ABI Libcall getSYNC(unsigned Opc, MVT VT);
 
   /// Return the outline atomics value for the given opcode, atomic ordering
   /// and type, or UNKNOWN_LIBCALL if there is none.
-  Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT);
+  LLVM_FUNC_ABI Libcall getOUTLINE_ATOMIC(unsigned Opc, AtomicOrdering Order, MVT VT);
 
   /// getMEMCPY_ELEMENT_UNORDERED_ATOMIC - Return
   /// MEMCPY_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
   /// UNKNOW_LIBCALL if there is none.
-  Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
+  LLVM_FUNC_ABI Libcall getMEMCPY_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
 
   /// getMEMMOVE_ELEMENT_UNORDERED_ATOMIC - Return
   /// MEMMOVE_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
   /// UNKNOW_LIBCALL if there is none.
-  Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
+  LLVM_FUNC_ABI Libcall getMEMMOVE_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
 
   /// getMEMSET_ELEMENT_UNORDERED_ATOMIC - Return
   /// MEMSET_ELEMENT_UNORDERED_ATOMIC_* value for the given element size or
   /// UNKNOW_LIBCALL if there is none.
-  Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
+  LLVM_FUNC_ABI Libcall getMEMSET_ELEMENT_UNORDERED_ATOMIC(uint64_t ElementSize);
 
 }
 }
diff --git a/llvm/include/llvm/CodeGen/ScheduleDAG.h b/llvm/include/llvm/CodeGen/ScheduleDAG.h
index 2131f60a796cd67..7eafd584bd57377 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDAG.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDAG.h
@@ -47,7 +47,7 @@ class TargetRegisterInfo;
 
   /// Scheduling dependency. This represents one direction of an edge in the
   /// scheduling DAG.
-  class SDep {
+  class LLVM_CLASS_ABI SDep {
   public:
     /// These are the different kinds of scheduling dependencies.
     enum Kind {
@@ -240,7 +240,7 @@ class TargetRegisterInfo;
   };
 
   /// Scheduling unit. This is a node in the scheduling DAG.
-  class SUnit {
+  class LLVM_CLASS_ABI SUnit {
   private:
     enum : unsigned { BoundaryID = ~0u };
 
@@ -494,7 +494,7 @@ class TargetRegisterInfo;
   /// returned in priority order.  The computation of the priority and the
   /// representation of the queue are totally up to the implementation to
   /// decide.
-  class SchedulingPriorityQueue {
+  class LLVM_CLASS_ABI SchedulingPriorityQueue {
     virtual void anchor();
 
     unsigned CurCycle = 0;
@@ -552,7 +552,7 @@ class TargetRegisterInfo;
     }
   };
 
-  class ScheduleDAG {
+  class LLVM_CLASS_ABI ScheduleDAG {
   public:
     const LLVMTargetMachine &TM;        ///< Target processor
     const TargetInstrInfo *TII;         ///< Target instruction information
@@ -623,7 +623,7 @@ class TargetRegisterInfo;
     const MCInstrDesc *getNodeDesc(const SDNode *Node) const;
   };
 
-  class SUnitIterator {
+  class LLVM_CLASS_ABI SUnitIterator {
     SUnit *Node;
     unsigned Operand;
 
@@ -674,7 +674,7 @@ class TargetRegisterInfo;
     }
   };
 
-  template <> struct GraphTraits<SUnit*> {
+  template <> struct LLVM_CLASS_ABI GraphTraits<SUnit*> {
     typedef SUnit *NodeRef;
     typedef SUnitIterator ChildIteratorType;
     static NodeRef getEntryNode(SUnit *N) { return N; }
@@ -686,7 +686,7 @@ class TargetRegisterInfo;
     }
   };
 
-  template <> struct GraphTraits<ScheduleDAG*> : public GraphTraits<SUnit*> {
+  template <> struct LLVM_CLASS_ABI GraphTraits<ScheduleDAG*> : public GraphTraits<SUnit*> {
     typedef pointer_iterator<std::vector<SUnit>::iterator> nodes_iterator;
     static nodes_iterator nodes_begin(ScheduleDAG *G) {
       return nodes_iterator(G->SUnits.begin());
@@ -700,7 +700,7 @@ class TargetRegisterInfo;
   /// methods for dynamically updating the ordering as new edges are added.
   ///
   /// This allows a very fast implementation of IsReachable, for example.
-  class ScheduleDAGTopologicalSort {
+  class LLVM_CLASS_ABI ScheduleDAGTopologicalSort {
     /// A reference to the ScheduleDAG's SUnits.
     std::vector<SUnit> &SUnits;
     SUnit *ExitSU;
diff --git a/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h b/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
index 7f23777df1a32db..f1e62aaf1d64561 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
@@ -51,7 +51,7 @@ namespace llvm {
   class Value;
 
   /// An individual mapping from virtual register number to SUnit.
-  struct VReg2SUnit {
+  struct LLVM_CLASS_ABI VReg2SUnit {
     unsigned VirtReg;
     LaneBitmask LaneMask;
     SUnit *SU;
@@ -65,7 +65,7 @@ namespace llvm {
   };
 
   /// Mapping from virtual register to SUnit including an operand index.
-  struct VReg2SUnitOperIdx : public VReg2SUnit {
+  struct LLVM_CLASS_ABI VReg2SUnitOperIdx : public VReg2SUnit {
     unsigned OperandIndex;
 
     VReg2SUnitOperIdx(unsigned VReg, LaneBitmask LaneMask,
@@ -75,7 +75,7 @@ namespace llvm {
 
   /// Record a physical register access.
   /// For non-data-dependent uses, OpIdx == -1.
-  struct PhysRegSUOper {
+  struct LLVM_CLASS_ABI PhysRegSUOper {
     SUnit *SU;
     int OpIdx;
     unsigned Reg;
@@ -107,7 +107,7 @@ namespace llvm {
 
   using ValueType = PointerUnion<const Value *, const PseudoSourceValue *>;
 
-  struct UnderlyingObject : PointerIntPair<ValueType, 1, bool> {
+  struct LLVM_CLASS_ABI UnderlyingObject : PointerIntPair<ValueType, 1, bool> {
     UnderlyingObject(ValueType V, bool MayAlias)
         : PointerIntPair<ValueType, 1, bool>(V, MayAlias) {}
 
@@ -118,7 +118,7 @@ namespace llvm {
   using UnderlyingObjectsVector = SmallVector<UnderlyingObject, 4>;
 
   /// A ScheduleDAG for scheduling lists of MachineInstr.
-  class ScheduleDAGInstrs : public ScheduleDAG {
+  class LLVM_CLASS_ABI ScheduleDAGInstrs : public ScheduleDAG {
   protected:
     const MachineLoopInfo *MLI = nullptr;
     const MachineFrameInfo &MFI;
diff --git a/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h b/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h
index 6e68de285f02504..9f1c62e1588e82d 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDAGMutation.h
@@ -21,7 +21,7 @@ namespace llvm {
 class ScheduleDAGInstrs;
 
 /// Mutate the DAG as a postpass after normal DAG building.
-class ScheduleDAGMutation {
+class LLVM_CLASS_ABI ScheduleDAGMutation {
   virtual void anchor();
 
 public:
diff --git a/llvm/include/llvm/CodeGen/ScheduleDFS.h b/llvm/include/llvm/CodeGen/ScheduleDFS.h
index 99f33831db9bb8b..b1365979ce069ba 100644
--- a/llvm/include/llvm/CodeGen/ScheduleDFS.h
+++ b/llvm/include/llvm/CodeGen/ScheduleDFS.h
@@ -32,7 +32,7 @@ class raw_ostream;
 ///
 /// When computed using bottom-up DFS, this metric assumes that the DAG is a
 /// forest of trees with roots at the bottom of the schedule branching upward.
-struct ILPValue {
+struct LLVM_CLASS_ABI ILPValue {
   unsigned InstrCount;
   /// Length may either correspond to depth or height, depending on direction,
   /// and cycles or nodes depending on context.
@@ -63,7 +63,7 @@ struct ILPValue {
 };
 
 /// Compute the values of each DAG node for various metrics during DFS.
-class SchedDFSResult {
+class LLVM_CLASS_ABI SchedDFSResult {
   friend class SchedDFSImpl;
 
   static const unsigned InvalidSubtreeID = ~0u;
@@ -187,7 +187,7 @@ class SchedDFSResult {
   void scheduleTree(unsigned SubtreeID);
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const ILPValue &Val);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const ILPValue &Val);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h b/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h
index 7b02667251862a9..bc9868bcc264499 100644
--- a/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h
+++ b/llvm/include/llvm/CodeGen/ScheduleHazardRecognizer.h
@@ -24,7 +24,7 @@ class SUnit;
 /// HazardRecognizer - This determines whether or not an instruction can be
 /// issued this cycle, and whether or not a noop needs to be inserted to handle
 /// the hazard.
-class ScheduleHazardRecognizer {
+class LLVM_CLASS_ABI ScheduleHazardRecognizer {
 protected:
   /// MaxLookAhead - Indicate the number of cycles in the scoreboard
   /// state. Important to restore the state after backtracking. Additionally,
diff --git a/llvm/include/llvm/CodeGen/SchedulerRegistry.h b/llvm/include/llvm/CodeGen/SchedulerRegistry.h
index b06dc1306ced3ab..5aafe6f601f546b 100644
--- a/llvm/include/llvm/CodeGen/SchedulerRegistry.h
+++ b/llvm/include/llvm/CodeGen/SchedulerRegistry.h
@@ -29,7 +29,7 @@ namespace llvm {
 class ScheduleDAGSDNodes;
 class SelectionDAGISel;
 
-class RegisterScheduler
+class LLVM_CLASS_ABI RegisterScheduler
     : public MachinePassRegistryNode<
           ScheduleDAGSDNodes *(*)(SelectionDAGISel *, CodeGenOpt::Level)> {
 public:
@@ -61,46 +61,46 @@ class RegisterScheduler
 
 /// createBURRListDAGScheduler - This creates a bottom up register usage
 /// reduction list scheduler.
-ScheduleDAGSDNodes *createBURRListDAGScheduler(SelectionDAGISel *IS,
+LLVM_FUNC_ABI ScheduleDAGSDNodes *createBURRListDAGScheduler(SelectionDAGISel *IS,
                                                CodeGenOpt::Level OptLevel);
 
 /// createBURRListDAGScheduler - This creates a bottom up list scheduler that
 /// schedules nodes in source code order when possible.
-ScheduleDAGSDNodes *createSourceListDAGScheduler(SelectionDAGISel *IS,
+LLVM_FUNC_ABI ScheduleDAGSDNodes *createSourceListDAGScheduler(SelectionDAGISel *IS,
                                                  CodeGenOpt::Level OptLevel);
 
 /// createHybridListDAGScheduler - This creates a bottom up register pressure
 /// aware list scheduler that make use of latency information to avoid stalls
 /// for long latency instructions in low register pressure mode. In high
 /// register pressure mode it schedules to reduce register pressure.
-ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
+LLVM_FUNC_ABI ScheduleDAGSDNodes *createHybridListDAGScheduler(SelectionDAGISel *IS,
                                                  CodeGenOpt::Level);
 
 /// createILPListDAGScheduler - This creates a bottom up register pressure
 /// aware list scheduler that tries to increase instruction level parallelism
 /// in low register pressure mode. In high register pressure mode it schedules
 /// to reduce register pressure.
-ScheduleDAGSDNodes *createILPListDAGScheduler(SelectionDAGISel *IS,
+LLVM_FUNC_ABI ScheduleDAGSDNodes *createILPListDAGScheduler(SelectionDAGISel *IS,
                                               CodeGenOpt::Level);
 
 /// createFastDAGScheduler - This creates a "fast" scheduler.
 ///
-ScheduleDAGSDNodes *createFastDAGScheduler(SelectionDAGISel *IS,
+LLVM_FUNC_ABI ScheduleDAGSDNodes *createFastDAGScheduler(SelectionDAGISel *IS,
                                            CodeGenOpt::Level OptLevel);
 
 /// createVLIWDAGScheduler - Scheduler for VLIW targets. This creates top down
 /// DFA driven list scheduler with clustering heuristic to control
 /// register pressure.
-ScheduleDAGSDNodes *createVLIWDAGScheduler(SelectionDAGISel *IS,
+LLVM_FUNC_ABI ScheduleDAGSDNodes *createVLIWDAGScheduler(SelectionDAGISel *IS,
                                            CodeGenOpt::Level OptLevel);
 /// createDefaultScheduler - This creates an instruction scheduler appropriate
 /// for the target.
-ScheduleDAGSDNodes *createDefaultScheduler(SelectionDAGISel *IS,
+LLVM_FUNC_ABI ScheduleDAGSDNodes *createDefaultScheduler(SelectionDAGISel *IS,
                                            CodeGenOpt::Level OptLevel);
 
 /// createDAGLinearizer - This creates a "no-scheduling" scheduler which
 /// linearize the DAG using topological order.
-ScheduleDAGSDNodes *createDAGLinearizer(SelectionDAGISel *IS,
+LLVM_FUNC_ABI ScheduleDAGSDNodes *createDAGLinearizer(SelectionDAGISel *IS,
                                         CodeGenOpt::Level OptLevel);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h b/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
index e449b68a8280c10..f89e39505e41a87 100644
--- a/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
+++ b/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
@@ -27,7 +27,7 @@ namespace llvm {
 class ScheduleDAG;
 class SUnit;
 
-class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
+class LLVM_CLASS_ABI ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
   // Scoreboard to track function unit usage. Scoreboard[0] is a
   // mask of the FUs in use in the cycle currently being
   // schedule. Scoreboard[1] is a mask for the next cycle. The
diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h
index cf6ec3c91fa7820..6743605cc743135 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -94,7 +94,7 @@ using SSAContext = GenericSSAContext<Function>;
 template <typename T> class GenericUniformityInfo;
 using UniformityInfo = GenericUniformityInfo<SSAContext>;
 
-class SDVTListNode : public FoldingSetNode {
+class LLVM_CLASS_ABI SDVTListNode : public FoldingSetNode {
   friend struct FoldingSetTrait<SDVTListNode>;
 
   /// A reference to an Interned FoldingSetNodeID for this node.
@@ -123,7 +123,7 @@ class SDVTListNode : public FoldingSetNode {
 
 /// Specialize FoldingSetTrait for SDVTListNode
 /// to avoid computing temp FoldingSetNodeID and hash value.
-template<> struct FoldingSetTrait<SDVTListNode> : DefaultFoldingSetTrait<SDVTListNode> {
+template<> struct LLVM_CLASS_ABI FoldingSetTrait<SDVTListNode> : DefaultFoldingSetTrait<SDVTListNode> {
   static void Profile(const SDVTListNode &X, FoldingSetNodeID& ID) {
     ID = X.FastID;
   }
@@ -140,7 +140,7 @@ template<> struct FoldingSetTrait<SDVTListNode> : DefaultFoldingSetTrait<SDVTLis
   }
 };
 
-template <> struct ilist_alloc_traits<SDNode> {
+template <> struct LLVM_CLASS_ABI ilist_alloc_traits<SDNode> {
   static void deleteNode(SDNode *) {
     llvm_unreachable("ilist_traits<SDNode> shouldn't see a deleteNode call!");
   }
@@ -157,7 +157,7 @@ template <> struct ilist_alloc_traits<SDNode> {
 /// should always go at the beginning of the function regardless of other code
 /// motion, and debug info for them is potentially useful even if the parameter
 /// is unused.  Right now only byval parameters are handled separately.
-class SDDbgInfo {
+class LLVM_CLASS_ABI SDDbgInfo {
   BumpPtrAllocator Alloc;
   SmallVector<SDDbgValue*, 32> DbgValues;
   SmallVector<SDDbgValue*, 32> ByvalParmDbgValues;
@@ -210,7 +210,7 @@ class SDDbgInfo {
   DbgLabelIterator DbgLabelEnd()   { return DbgLabels.end(); }
 };
 
-void checkForCycles(const SelectionDAG *DAG, bool force = false);
+LLVM_FUNC_ABI void checkForCycles(const SelectionDAG *DAG, bool force = false);
 
 /// This is used to represent a portion of an LLVM function in a low-level
 /// Data Dependence DAG representation suitable for instruction selection.
@@ -223,7 +223,7 @@ void checkForCycles(const SelectionDAG *DAG, bool force = false);
 /// but is significantly more simple, powerful, and is a graph form instead of a
 /// linear form.
 ///
-class SelectionDAG {
+class LLVM_CLASS_ABI SelectionDAG {
   const TargetMachine &TM;
   const SelectionDAGTargetInfo *TSI = nullptr;
   const TargetLowering *TLI = nullptr;
@@ -2401,7 +2401,7 @@ class SelectionDAG {
   FlagInserter *Inserter = nullptr;
 };
 
-template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {
+template <> struct LLVM_CLASS_ABI GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {
   using nodes_iterator = pointer_iterator<SelectionDAG::allnodes_iterator>;
 
   static nodes_iterator nodes_begin(SelectionDAG *G) {
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h b/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
index 0901b195b770b63..6b53ac62bd77d14 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
@@ -30,7 +30,7 @@ class SelectionDAG;
 /// (load (i64 add (i64 copyfromreg %c)
 ///                (i64 signextend (i32 add (i32 signextend (i8 load %index))
 ///                                         (i32 1)))))
-class BaseIndexOffset {
+class LLVM_CLASS_ABI BaseIndexOffset {
 private:
   SDValue Base;
   SDValue Index;
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGISel.h b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
index 6788442d8ffb039..1c523d1def87422 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGISel.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
@@ -39,7 +39,7 @@ class ScheduleDAGSDNodes;
 
 /// SelectionDAGISel - This is the common base class used for SelectionDAG-based
 /// pattern-matching instruction selectors.
-class SelectionDAGISel : public MachineFunctionPass {
+class LLVM_CLASS_ABI SelectionDAGISel : public MachineFunctionPass {
 public:
   TargetMachine &TM;
   const TargetLibraryInfo *LibInfo;
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
index e411bd143d06b37..4a3728b07e86060 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -70,14 +70,14 @@ class SelectionDAG;
 class Type;
 class Value;
 
-void checkForCycles(const SDNode *N, const SelectionDAG *DAG = nullptr,
+LLVM_FUNC_ABI void checkForCycles(const SDNode *N, const SelectionDAG *DAG = nullptr,
                     bool force = false);
 
 /// This represents a list of ValueType's that has been intern'd by
 /// a SelectionDAG.  Instances of this simple value class are returned by
 /// SelectionDAG::getVTList(...).
 ///
-struct SDVTList {
+struct LLVM_CLASS_ABI SDVTList {
   const EVT *VTs;
   unsigned int NumVTs;
 };
@@ -89,46 +89,46 @@ namespace ISD {
 /// If N is a BUILD_VECTOR or SPLAT_VECTOR node whose elements are all the
 /// same constant or undefined, return true and return the constant value in
 /// \p SplatValue.
-bool isConstantSplatVector(const SDNode *N, APInt &SplatValue);
+LLVM_FUNC_ABI bool isConstantSplatVector(const SDNode *N, APInt &SplatValue);
 
 /// Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where
 /// all of the elements are ~0 or undef. If \p BuildVectorOnly is set to
 /// true, it only checks BUILD_VECTOR.
-bool isConstantSplatVectorAllOnes(const SDNode *N,
+LLVM_FUNC_ABI bool isConstantSplatVectorAllOnes(const SDNode *N,
                                   bool BuildVectorOnly = false);
 
 /// Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where
 /// all of the elements are 0 or undef. If \p BuildVectorOnly is set to true, it
 /// only checks BUILD_VECTOR.
-bool isConstantSplatVectorAllZeros(const SDNode *N,
+LLVM_FUNC_ABI bool isConstantSplatVectorAllZeros(const SDNode *N,
                                    bool BuildVectorOnly = false);
 
 /// Return true if the specified node is a BUILD_VECTOR where all of the
 /// elements are ~0 or undef.
-bool isBuildVectorAllOnes(const SDNode *N);
+LLVM_FUNC_ABI bool isBuildVectorAllOnes(const SDNode *N);
 
 /// Return true if the specified node is a BUILD_VECTOR where all of the
 /// elements are 0 or undef.
-bool isBuildVectorAllZeros(const SDNode *N);
+LLVM_FUNC_ABI bool isBuildVectorAllZeros(const SDNode *N);
 
 /// Return true if the specified node is a BUILD_VECTOR node of all
 /// ConstantSDNode or undef.
-bool isBuildVectorOfConstantSDNodes(const SDNode *N);
+LLVM_FUNC_ABI bool isBuildVectorOfConstantSDNodes(const SDNode *N);
 
 /// Return true if the specified node is a BUILD_VECTOR node of all
 /// ConstantFPSDNode or undef.
-bool isBuildVectorOfConstantFPSDNodes(const SDNode *N);
+LLVM_FUNC_ABI bool isBuildVectorOfConstantFPSDNodes(const SDNode *N);
 
 /// Returns true if the specified node is a vector where all elements can
 /// be truncated to the specified element size without a loss in meaning.
-bool isVectorShrinkable(const SDNode *N, unsigned NewEltSize, bool Signed);
+LLVM_FUNC_ABI bool isVectorShrinkable(const SDNode *N, unsigned NewEltSize, bool Signed);
 
 /// Return true if the node has at least one operand and all operands of the
 /// specified node are ISD::UNDEF.
-bool allOperandsUndef(const SDNode *N);
+LLVM_FUNC_ABI bool allOperandsUndef(const SDNode *N);
 
 /// Return true if the specified node is FREEZE(UNDEF).
-bool isFreezeUndef(const SDNode *N);
+LLVM_FUNC_ABI bool isFreezeUndef(const SDNode *N);
 
 } // end namespace ISD
 
@@ -143,7 +143,7 @@ bool isFreezeUndef(const SDNode *N);
 /// computes it as well as which return value to use from that node.  This pair
 /// of information is represented with the SDValue value type.
 ///
-class SDValue {
+class LLVM_CLASS_ABI SDValue {
   friend struct DenseMapInfo<SDValue>;
 
   SDNode *Node = nullptr; // The node defining the value we are using.
@@ -237,7 +237,7 @@ class SDValue {
   inline bool hasOneUse() const;
 };
 
-template<> struct DenseMapInfo<SDValue> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<SDValue> {
   static inline SDValue getEmptyKey() {
     SDValue V;
     V.ResNo = -1U;
@@ -262,14 +262,14 @@ template<> struct DenseMapInfo<SDValue> {
 
 /// Allow casting operators to work directly on
 /// SDValues as if they were SDNode*'s.
-template<> struct simplify_type<SDValue> {
+template<> struct LLVM_CLASS_ABI simplify_type<SDValue> {
   using SimpleType = SDNode *;
 
   static SimpleType getSimplifiedValue(SDValue &Val) {
     return Val.getNode();
   }
 };
-template<> struct simplify_type<const SDValue> {
+template<> struct LLVM_CLASS_ABI simplify_type<const SDValue> {
   using SimpleType = /*const*/ SDNode *;
 
   static SimpleType getSimplifiedValue(const SDValue &Val) {
@@ -282,7 +282,7 @@ template<> struct simplify_type<const SDValue> {
 /// pointer to the SDNode using the value, and Next and Prev pointers,
 /// which link together all the uses of an SDNode.
 ///
-class SDUse {
+class LLVM_CLASS_ABI SDUse {
   /// Val - The value being used.
   SDValue Val;
   /// User - The user of this value.
@@ -366,7 +366,7 @@ class SDUse {
 
 /// simplify_type specializations - Allow casting operators to work directly on
 /// SDValues as if they were SDNode*'s.
-template<> struct simplify_type<SDUse> {
+template<> struct LLVM_CLASS_ABI simplify_type<SDUse> {
   using SimpleType = SDNode *;
 
   static SimpleType getSimplifiedValue(SDUse &Val) {
@@ -377,7 +377,7 @@ template<> struct simplify_type<SDUse> {
 /// These are IR-level optimization flags that may be propagated to SDNodes.
 /// TODO: This data structure should be shared by the IR optimizer and the
 /// the backend.
-struct SDNodeFlags {
+struct LLVM_CLASS_ABI SDNodeFlags {
 private:
   bool NoUnsignedWrap : 1;
   bool NoSignedWrap : 1;
@@ -466,7 +466,7 @@ struct SDNodeFlags {
 
 /// Represents one node in the SelectionDAG.
 ///
-class SDNode : public FoldingSetNode, public ilist_node<SDNode> {
+class LLVM_CLASS_ABI SDNode : public FoldingSetNode, public ilist_node<SDNode> {
 private:
   /// The operation that this node performs.
   int32_t NodeType;
@@ -1109,7 +1109,7 @@ END_TWO_BYTE_PACK()
 /// the IROrder are propagated from the original SDNode.
 /// So SDLoc class provides two constructors besides the default one, one to
 /// be used by the DAGBuilder, the other to be used by others.
-class SDLoc {
+class LLVM_CLASS_ABI SDLoc {
 private:
   DebugLoc DL;
   int IROrder = 0;
@@ -1236,7 +1236,7 @@ inline void SDUse::setNode(SDNode *N) {
 /// is persistent and is updated across invocations of replaceAllUsesWith on its
 /// operand.  This node should be directly created by end-users and not added to
 /// the AllNodes list.
-class HandleSDNode : public SDNode {
+class LLVM_CLASS_ABI HandleSDNode : public SDNode {
   SDUse Op;
 
 public:
@@ -1260,7 +1260,7 @@ class HandleSDNode : public SDNode {
   const SDValue &getValue() const { return Op; }
 };
 
-class AddrSpaceCastSDNode : public SDNode {
+class LLVM_CLASS_ABI AddrSpaceCastSDNode : public SDNode {
 private:
   unsigned SrcAddrSpace;
   unsigned DestAddrSpace;
@@ -1278,7 +1278,7 @@ class AddrSpaceCastSDNode : public SDNode {
 };
 
 /// This is an abstract virtual class for memory operations.
-class MemSDNode : public SDNode {
+class LLVM_CLASS_ABI MemSDNode : public SDNode {
 private:
   // VT of in-memory value.
   EVT MemoryVT;
@@ -1449,7 +1449,7 @@ class MemSDNode : public SDNode {
 };
 
 /// This is an SDNode representing atomic operations.
-class AtomicSDNode : public MemSDNode {
+class LLVM_CLASS_ABI AtomicSDNode : public MemSDNode {
 public:
   AtomicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTL,
                EVT MemVT, MachineMemOperand *MMO)
@@ -1507,7 +1507,7 @@ class AtomicSDNode : public MemSDNode {
 /// memory and need an associated MachineMemOperand. Its opcode may be
 /// INTRINSIC_VOID, INTRINSIC_W_CHAIN, PREFETCH, or a target-specific opcode
 /// with a value not less than FIRST_TARGET_MEMORY_OPCODE.
-class MemIntrinsicSDNode : public MemSDNode {
+class LLVM_CLASS_ABI MemIntrinsicSDNode : public MemSDNode {
 public:
   MemIntrinsicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl,
                      SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
@@ -1533,7 +1533,7 @@ class MemIntrinsicSDNode : public MemSDNode {
 /// refer to elements from the LHS input, and indices from N to 2N-1 the RHS.
 /// An index of -1 is treated as undef, such that the code generator may put
 /// any value in the corresponding element of the result.
-class ShuffleVectorSDNode : public SDNode {
+class LLVM_CLASS_ABI ShuffleVectorSDNode : public SDNode {
   // The memory for Mask is owned by the SelectionDAG's OperandAllocator, and
   // is freed when the SelectionDAG object is destroyed.
   const int *Mask;
@@ -1591,7 +1591,7 @@ class ShuffleVectorSDNode : public SDNode {
   }
 };
 
-class ConstantSDNode : public SDNode {
+class LLVM_CLASS_ABI ConstantSDNode : public SDNode {
   friend class SelectionDAG;
 
   const ConstantInt *Value;
@@ -1636,7 +1636,7 @@ const APInt &SDNode::getConstantOperandAPInt(unsigned Num) const {
   return cast<ConstantSDNode>(getOperand(Num))->getAPIntValue();
 }
 
-class ConstantFPSDNode : public SDNode {
+class LLVM_CLASS_ABI ConstantFPSDNode : public SDNode {
   friend class SelectionDAG;
 
   const ConstantFP *Value;
@@ -1684,91 +1684,91 @@ class ConstantFPSDNode : public SDNode {
 };
 
 /// Returns true if \p V is a constant integer zero.
-bool isNullConstant(SDValue V);
+LLVM_FUNC_ABI bool isNullConstant(SDValue V);
 
 /// Returns true if \p V is an FP constant with a value of positive zero.
-bool isNullFPConstant(SDValue V);
+LLVM_FUNC_ABI bool isNullFPConstant(SDValue V);
 
 /// Returns true if \p V is an integer constant with all bits set.
-bool isAllOnesConstant(SDValue V);
+LLVM_FUNC_ABI bool isAllOnesConstant(SDValue V);
 
 /// Returns true if \p V is a constant integer one.
-bool isOneConstant(SDValue V);
+LLVM_FUNC_ABI bool isOneConstant(SDValue V);
 
 /// Returns true if \p V is a constant min signed integer value.
-bool isMinSignedConstant(SDValue V);
+LLVM_FUNC_ABI bool isMinSignedConstant(SDValue V);
 
 /// Returns true if \p V is a neutral element of Opc with Flags.
 /// When OperandNo is 0, it checks that V is a left identity. Otherwise, it
 /// checks that V is a right identity.
-bool isNeutralConstant(unsigned Opc, SDNodeFlags Flags, SDValue V,
+LLVM_FUNC_ABI bool isNeutralConstant(unsigned Opc, SDNodeFlags Flags, SDValue V,
                        unsigned OperandNo);
 
 /// Return the non-bitcasted source operand of \p V if it exists.
 /// If \p V is not a bitcasted value, it is returned as-is.
-SDValue peekThroughBitcasts(SDValue V);
+LLVM_FUNC_ABI SDValue peekThroughBitcasts(SDValue V);
 
 /// Return the non-bitcasted and one-use source operand of \p V if it exists.
 /// If \p V is not a bitcasted one-use value, it is returned as-is.
-SDValue peekThroughOneUseBitcasts(SDValue V);
+LLVM_FUNC_ABI SDValue peekThroughOneUseBitcasts(SDValue V);
 
 /// Return the non-extracted vector source operand of \p V if it exists.
 /// If \p V is not an extracted subvector, it is returned as-is.
-SDValue peekThroughExtractSubvectors(SDValue V);
+LLVM_FUNC_ABI SDValue peekThroughExtractSubvectors(SDValue V);
 
 /// Return the non-truncated source operand of \p V if it exists.
 /// If \p V is not a truncation, it is returned as-is.
-SDValue peekThroughTruncates(SDValue V);
+LLVM_FUNC_ABI SDValue peekThroughTruncates(SDValue V);
 
 /// Returns true if \p V is a bitwise not operation. Assumes that an all ones
 /// constant is canonicalized to be operand 1.
-bool isBitwiseNot(SDValue V, bool AllowUndefs = false);
+LLVM_FUNC_ABI bool isBitwiseNot(SDValue V, bool AllowUndefs = false);
 
 /// If \p V is a bitwise not, returns the inverted operand. Otherwise returns
 /// an empty SDValue. Only bits set in \p Mask are required to be inverted,
 /// other bits may be arbitrary.
-SDValue getBitwiseNotOperand(SDValue V, SDValue Mask, bool AllowUndefs);
+LLVM_FUNC_ABI SDValue getBitwiseNotOperand(SDValue V, SDValue Mask, bool AllowUndefs);
 
 /// Returns the SDNode if it is a constant splat BuildVector or constant int.
-ConstantSDNode *isConstOrConstSplat(SDValue N, bool AllowUndefs = false,
+LLVM_FUNC_ABI ConstantSDNode *isConstOrConstSplat(SDValue N, bool AllowUndefs = false,
                                     bool AllowTruncation = false);
 
 /// Returns the SDNode if it is a demanded constant splat BuildVector or
 /// constant int.
-ConstantSDNode *isConstOrConstSplat(SDValue N, const APInt &DemandedElts,
+LLVM_FUNC_ABI ConstantSDNode *isConstOrConstSplat(SDValue N, const APInt &DemandedElts,
                                     bool AllowUndefs = false,
                                     bool AllowTruncation = false);
 
 /// Returns the SDNode if it is a constant splat BuildVector or constant float.
-ConstantFPSDNode *isConstOrConstSplatFP(SDValue N, bool AllowUndefs = false);
+LLVM_FUNC_ABI ConstantFPSDNode *isConstOrConstSplatFP(SDValue N, bool AllowUndefs = false);
 
 /// Returns the SDNode if it is a demanded constant splat BuildVector or
 /// constant float.
-ConstantFPSDNode *isConstOrConstSplatFP(SDValue N, const APInt &DemandedElts,
+LLVM_FUNC_ABI ConstantFPSDNode *isConstOrConstSplatFP(SDValue N, const APInt &DemandedElts,
                                         bool AllowUndefs = false);
 
 /// Return true if the value is a constant 0 integer or a splatted vector of
 /// a constant 0 integer (with no undefs by default).
 /// Build vector implicit truncation is not an issue for null values.
-bool isNullOrNullSplat(SDValue V, bool AllowUndefs = false);
+LLVM_FUNC_ABI bool isNullOrNullSplat(SDValue V, bool AllowUndefs = false);
 
 /// Return true if the value is a constant 1 integer or a splatted vector of a
 /// constant 1 integer (with no undefs).
 /// Build vector implicit truncation is allowed, but the truncated bits need to
 /// be zero.
-bool isOneOrOneSplat(SDValue V, bool AllowUndefs = false);
+LLVM_FUNC_ABI bool isOneOrOneSplat(SDValue V, bool AllowUndefs = false);
 
 /// Return true if the value is a constant -1 integer or a splatted vector of a
 /// constant -1 integer (with no undefs).
 /// Does not permit build vector implicit truncation.
-bool isAllOnesOrAllOnesSplat(SDValue V, bool AllowUndefs = false);
+LLVM_FUNC_ABI bool isAllOnesOrAllOnesSplat(SDValue V, bool AllowUndefs = false);
 
 /// Return true if \p V is either a integer or FP constant.
 inline bool isIntOrFPConstant(SDValue V) {
   return isa<ConstantSDNode>(V) || isa<ConstantFPSDNode>(V);
 }
 
-class GlobalAddressSDNode : public SDNode {
+class LLVM_CLASS_ABI GlobalAddressSDNode : public SDNode {
   friend class SelectionDAG;
 
   const GlobalValue *TheGlobal;
@@ -1794,7 +1794,7 @@ class GlobalAddressSDNode : public SDNode {
   }
 };
 
-class FrameIndexSDNode : public SDNode {
+class LLVM_CLASS_ABI FrameIndexSDNode : public SDNode {
   friend class SelectionDAG;
 
   int FI;
@@ -1815,7 +1815,7 @@ class FrameIndexSDNode : public SDNode {
 
 /// This SDNode is used for LIFETIME_START/LIFETIME_END values, which indicate
 /// the offet and size that are started/ended in the underlying FrameIndex.
-class LifetimeSDNode : public SDNode {
+class LLVM_CLASS_ABI LifetimeSDNode : public SDNode {
   friend class SelectionDAG;
   int64_t Size;
   int64_t Offset; // -1 if offset is unknown.
@@ -1849,7 +1849,7 @@ class LifetimeSDNode : public SDNode {
 /// the index of the basic block being probed. A pseudo probe serves as a place
 /// holder and will be removed at the end of compilation. It does not have any
 /// operand because we do not want the instruction selection to deal with any.
-class PseudoProbeSDNode : public SDNode {
+class LLVM_CLASS_ABI PseudoProbeSDNode : public SDNode {
   friend class SelectionDAG;
   uint64_t Guid;
   uint64_t Index;
@@ -1871,7 +1871,7 @@ class PseudoProbeSDNode : public SDNode {
   }
 };
 
-class JumpTableSDNode : public SDNode {
+class LLVM_CLASS_ABI JumpTableSDNode : public SDNode {
   friend class SelectionDAG;
 
   int JTI;
@@ -1892,7 +1892,7 @@ class JumpTableSDNode : public SDNode {
   }
 };
 
-class ConstantPoolSDNode : public SDNode {
+class LLVM_CLASS_ABI ConstantPoolSDNode : public SDNode {
   friend class SelectionDAG;
 
   union {
@@ -1955,7 +1955,7 @@ class ConstantPoolSDNode : public SDNode {
 };
 
 /// Completely target-dependent object reference.
-class TargetIndexSDNode : public SDNode {
+class LLVM_CLASS_ABI TargetIndexSDNode : public SDNode {
   friend class SelectionDAG;
 
   unsigned TargetFlags;
@@ -1976,7 +1976,7 @@ class TargetIndexSDNode : public SDNode {
   }
 };
 
-class BasicBlockSDNode : public SDNode {
+class LLVM_CLASS_ABI BasicBlockSDNode : public SDNode {
   friend class SelectionDAG;
 
   MachineBasicBlock *MBB;
@@ -1997,7 +1997,7 @@ class BasicBlockSDNode : public SDNode {
 };
 
 /// A "pseudo-class" with methods for operating on BUILD_VECTORs.
-class BuildVectorSDNode : public SDNode {
+class LLVM_CLASS_ABI BuildVectorSDNode : public SDNode {
 public:
   // These are constructed as SDNodes and then cast to BuildVectorSDNodes.
   explicit BuildVectorSDNode() = delete;
@@ -2135,7 +2135,7 @@ class BuildVectorSDNode : public SDNode {
 /// used when the SelectionDAG needs to make a simple reference to something
 /// in the LLVM IR representation.
 ///
-class SrcValueSDNode : public SDNode {
+class LLVM_CLASS_ABI SrcValueSDNode : public SDNode {
   friend class SelectionDAG;
 
   const Value *V;
@@ -2153,7 +2153,7 @@ class SrcValueSDNode : public SDNode {
   }
 };
 
-class MDNodeSDNode : public SDNode {
+class LLVM_CLASS_ABI MDNodeSDNode : public SDNode {
   friend class SelectionDAG;
 
   const MDNode *MD;
@@ -2170,7 +2170,7 @@ class MDNodeSDNode : public SDNode {
   }
 };
 
-class RegisterSDNode : public SDNode {
+class LLVM_CLASS_ABI RegisterSDNode : public SDNode {
   friend class SelectionDAG;
 
   Register Reg;
@@ -2186,7 +2186,7 @@ class RegisterSDNode : public SDNode {
   }
 };
 
-class RegisterMaskSDNode : public SDNode {
+class LLVM_CLASS_ABI RegisterMaskSDNode : public SDNode {
   friend class SelectionDAG;
 
   // The memory for RegMask is not owned by the node.
@@ -2204,7 +2204,7 @@ class RegisterMaskSDNode : public SDNode {
   }
 };
 
-class BlockAddressSDNode : public SDNode {
+class LLVM_CLASS_ABI BlockAddressSDNode : public SDNode {
   friend class SelectionDAG;
 
   const BlockAddress *BA;
@@ -2227,7 +2227,7 @@ class BlockAddressSDNode : public SDNode {
   }
 };
 
-class LabelSDNode : public SDNode {
+class LLVM_CLASS_ABI LabelSDNode : public SDNode {
   friend class SelectionDAG;
 
   MCSymbol *Label;
@@ -2246,7 +2246,7 @@ class LabelSDNode : public SDNode {
   }
 };
 
-class ExternalSymbolSDNode : public SDNode {
+class LLVM_CLASS_ABI ExternalSymbolSDNode : public SDNode {
   friend class SelectionDAG;
 
   const char *Symbol;
@@ -2267,7 +2267,7 @@ class ExternalSymbolSDNode : public SDNode {
   }
 };
 
-class MCSymbolSDNode : public SDNode {
+class LLVM_CLASS_ABI MCSymbolSDNode : public SDNode {
   friend class SelectionDAG;
 
   MCSymbol *Symbol;
@@ -2283,7 +2283,7 @@ class MCSymbolSDNode : public SDNode {
   }
 };
 
-class CondCodeSDNode : public SDNode {
+class LLVM_CLASS_ABI CondCodeSDNode : public SDNode {
   friend class SelectionDAG;
 
   ISD::CondCode Condition;
@@ -2302,7 +2302,7 @@ class CondCodeSDNode : public SDNode {
 
 /// This class is used to represent EVT's, which are used
 /// to parameterize some operations.
-class VTSDNode : public SDNode {
+class LLVM_CLASS_ABI VTSDNode : public SDNode {
   friend class SelectionDAG;
 
   EVT ValueType;
@@ -2320,7 +2320,7 @@ class VTSDNode : public SDNode {
 };
 
 /// Base class for LoadSDNode and StoreSDNode
-class LSBaseSDNode : public MemSDNode {
+class LLVM_CLASS_ABI LSBaseSDNode : public MemSDNode {
 public:
   LSBaseSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl,
                SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT,
@@ -2353,7 +2353,7 @@ class LSBaseSDNode : public MemSDNode {
 };
 
 /// This class is used to represent ISD::LOAD nodes.
-class LoadSDNode : public LSBaseSDNode {
+class LLVM_CLASS_ABI LoadSDNode : public LSBaseSDNode {
   friend class SelectionDAG;
 
   LoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
@@ -2381,7 +2381,7 @@ class LoadSDNode : public LSBaseSDNode {
 };
 
 /// This class is used to represent ISD::STORE nodes.
-class StoreSDNode : public LSBaseSDNode {
+class LLVM_CLASS_ABI StoreSDNode : public LSBaseSDNode {
   friend class SelectionDAG;
 
   StoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
@@ -2413,7 +2413,7 @@ class StoreSDNode : public LSBaseSDNode {
 
 /// This base class is used to represent VP_LOAD, VP_STORE,
 /// EXPERIMENTAL_VP_STRIDED_LOAD and EXPERIMENTAL_VP_STRIDED_STORE nodes
-class VPBaseLoadStoreSDNode : public MemSDNode {
+class LLVM_CLASS_ABI VPBaseLoadStoreSDNode : public MemSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2491,7 +2491,7 @@ class VPBaseLoadStoreSDNode : public MemSDNode {
 };
 
 /// This class is used to represent a VP_LOAD node
-class VPLoadSDNode : public VPBaseLoadStoreSDNode {
+class LLVM_CLASS_ABI VPLoadSDNode : public VPBaseLoadStoreSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2519,7 +2519,7 @@ class VPLoadSDNode : public VPBaseLoadStoreSDNode {
 };
 
 /// This class is used to represent an EXPERIMENTAL_VP_STRIDED_LOAD node.
-class VPStridedLoadSDNode : public VPBaseLoadStoreSDNode {
+class LLVM_CLASS_ABI VPStridedLoadSDNode : public VPBaseLoadStoreSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2549,7 +2549,7 @@ class VPStridedLoadSDNode : public VPBaseLoadStoreSDNode {
 };
 
 /// This class is used to represent a VP_STORE node
-class VPStoreSDNode : public VPBaseLoadStoreSDNode {
+class LLVM_CLASS_ABI VPStoreSDNode : public VPBaseLoadStoreSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2584,7 +2584,7 @@ class VPStoreSDNode : public VPBaseLoadStoreSDNode {
 };
 
 /// This class is used to represent an EXPERIMENTAL_VP_STRIDED_STORE node.
-class VPStridedStoreSDNode : public VPBaseLoadStoreSDNode {
+class LLVM_CLASS_ABI VPStridedStoreSDNode : public VPBaseLoadStoreSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2621,7 +2621,7 @@ class VPStridedStoreSDNode : public VPBaseLoadStoreSDNode {
 };
 
 /// This base class is used to represent MLOAD and MSTORE nodes
-class MaskedLoadStoreSDNode : public MemSDNode {
+class LLVM_CLASS_ABI MaskedLoadStoreSDNode : public MemSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2663,7 +2663,7 @@ class MaskedLoadStoreSDNode : public MemSDNode {
 };
 
 /// This class is used to represent an MLOAD node
-class MaskedLoadSDNode : public MaskedLoadStoreSDNode {
+class LLVM_CLASS_ABI MaskedLoadSDNode : public MaskedLoadStoreSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2692,7 +2692,7 @@ class MaskedLoadSDNode : public MaskedLoadStoreSDNode {
 };
 
 /// This class is used to represent an MSTORE node
-class MaskedStoreSDNode : public MaskedLoadStoreSDNode {
+class LLVM_CLASS_ABI MaskedStoreSDNode : public MaskedLoadStoreSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2728,7 +2728,7 @@ class MaskedStoreSDNode : public MaskedLoadStoreSDNode {
 /// This is a base class used to represent
 /// VP_GATHER and VP_SCATTER nodes
 ///
-class VPGatherScatterSDNode : public MemSDNode {
+class LLVM_CLASS_ABI VPGatherScatterSDNode : public MemSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2777,7 +2777,7 @@ class VPGatherScatterSDNode : public MemSDNode {
 
 /// This class is used to represent an VP_GATHER node
 ///
-class VPGatherSDNode : public VPGatherScatterSDNode {
+class LLVM_CLASS_ABI VPGatherSDNode : public VPGatherScatterSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2793,7 +2793,7 @@ class VPGatherSDNode : public VPGatherScatterSDNode {
 
 /// This class is used to represent an VP_SCATTER node
 ///
-class VPScatterSDNode : public VPGatherScatterSDNode {
+class LLVM_CLASS_ABI VPScatterSDNode : public VPGatherScatterSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2812,7 +2812,7 @@ class VPScatterSDNode : public VPGatherScatterSDNode {
 /// This is a base class used to represent
 /// MGATHER and MSCATTER nodes
 ///
-class MaskedGatherScatterSDNode : public MemSDNode {
+class LLVM_CLASS_ABI MaskedGatherScatterSDNode : public MemSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2850,7 +2850,7 @@ class MaskedGatherScatterSDNode : public MemSDNode {
 
 /// This class is used to represent an MGATHER node
 ///
-class MaskedGatherSDNode : public MaskedGatherScatterSDNode {
+class LLVM_CLASS_ABI MaskedGatherSDNode : public MaskedGatherScatterSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2875,7 +2875,7 @@ class MaskedGatherSDNode : public MaskedGatherScatterSDNode {
 
 /// This class is used to represent an MSCATTER node
 ///
-class MaskedScatterSDNode : public MaskedGatherScatterSDNode {
+class LLVM_CLASS_ABI MaskedScatterSDNode : public MaskedGatherScatterSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2899,7 +2899,7 @@ class MaskedScatterSDNode : public MaskedGatherScatterSDNode {
   }
 };
 
-class FPStateAccessSDNode : public MemSDNode {
+class LLVM_CLASS_ABI FPStateAccessSDNode : public MemSDNode {
 public:
   friend class SelectionDAG;
 
@@ -2923,7 +2923,7 @@ class FPStateAccessSDNode : public MemSDNode {
 /// Note that the only supported way to set the `memoperands` is by calling the
 /// `SelectionDAG::setNodeMemRefs` function as the memory management happens
 /// inside the DAG rather than in the node.
-class MachineSDNode : public SDNode {
+class LLVM_CLASS_ABI MachineSDNode : public SDNode {
 private:
   friend class SelectionDAG;
 
@@ -2982,7 +2982,7 @@ class MachineSDNode : public SDNode {
 
 /// An SDNode that records if a register contains a value that is guaranteed to
 /// be aligned accordingly.
-class AssertAlignSDNode : public SDNode {
+class LLVM_CLASS_ABI AssertAlignSDNode : public SDNode {
   Align Alignment;
 
 public:
@@ -2996,7 +2996,7 @@ class AssertAlignSDNode : public SDNode {
   }
 };
 
-class SDNodeIterator {
+class LLVM_CLASS_ABI SDNodeIterator {
   const SDNode *Node;
   unsigned Operand;
 
@@ -3041,7 +3041,7 @@ class SDNodeIterator {
   const SDNode *getNode() const { return Node; }
 };
 
-template <> struct GraphTraits<SDNode*> {
+template <> struct LLVM_CLASS_ABI GraphTraits<SDNode*> {
   using NodeRef = SDNode *;
   using ChildIteratorType = SDNodeIterator;
 
@@ -3124,7 +3124,7 @@ namespace ISD {
   /// Attempt to match a unary predicate against a scalar/splat constant or
   /// every element of a constant BUILD_VECTOR.
   /// If AllowUndef is true, then UNDEF elements will pass nullptr to Match.
-  bool matchUnaryPredicate(SDValue Op,
+  LLVM_FUNC_ABI bool matchUnaryPredicate(SDValue Op,
                            std::function<bool(ConstantSDNode *)> Match,
                            bool AllowUndefs = false);
 
@@ -3132,7 +3132,7 @@ namespace ISD {
   /// constants or every element of a pair of constant BUILD_VECTORs.
   /// If AllowUndef is true, then UNDEF elements will pass nullptr to Match.
   /// If AllowTypeMismatch is true then RetType + ArgTypes don't need to match.
-  bool matchBinaryPredicate(
+  LLVM_FUNC_ABI bool matchBinaryPredicate(
       SDValue LHS, SDValue RHS,
       std::function<bool(ConstantSDNode *, ConstantSDNode *)> Match,
       bool AllowUndefs = false, bool AllowTypeMismatch = false);
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h b/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h
index 6be0884e57f2cc9..582b75a66878638 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h
@@ -29,7 +29,7 @@ class SelectionDAG;
 /// Targets can subclass this to parameterize the
 /// SelectionDAG lowering and instruction selection process.
 ///
-class SelectionDAGTargetInfo {
+class LLVM_CLASS_ABI SelectionDAGTargetInfo {
 public:
   explicit SelectionDAGTargetInfo() = default;
   SelectionDAGTargetInfo(const SelectionDAGTargetInfo &) = delete;
diff --git a/llvm/include/llvm/CodeGen/SlotIndexes.h b/llvm/include/llvm/CodeGen/SlotIndexes.h
index 5fe6c1097a0b1a4..d3def2fa9b905bb 100644
--- a/llvm/include/llvm/CodeGen/SlotIndexes.h
+++ b/llvm/include/llvm/CodeGen/SlotIndexes.h
@@ -43,7 +43,7 @@ class raw_ostream;
   /// SlotIndexes pass. It should not be used directly. See the
   /// SlotIndex & SlotIndexes classes for the public interface to this
   /// information.
-  class IndexListEntry : public ilist_node<IndexListEntry> {
+  class LLVM_CLASS_ABI IndexListEntry : public ilist_node<IndexListEntry> {
     MachineInstr *mi;
     unsigned index;
 
@@ -76,11 +76,11 @@ class raw_ostream;
   };
 
   template <>
-  struct ilist_alloc_traits<IndexListEntry>
+  struct LLVM_CLASS_ABI ilist_alloc_traits<IndexListEntry>
       : public ilist_noalloc_traits<IndexListEntry> {};
 
   /// SlotIndex - An opaque wrapper around machine indexes.
-  class SlotIndex {
+  class LLVM_CLASS_ABI SlotIndex {
     friend class SlotIndexes;
 
     enum Slot {
@@ -317,7 +317,7 @@ class raw_ostream;
   /// SlotIndexes pass.
   ///
   /// This pass assigns indexes to each instruction.
-  class SlotIndexes : public MachineFunctionPass {
+  class LLVM_CLASS_ABI SlotIndexes : public MachineFunctionPass {
   private:
     // IndexListEntry allocator.
     BumpPtrAllocator ileAllocator;
@@ -645,7 +645,7 @@ class raw_ostream;
 
   // Specialize IntervalMapInfo for half-open slot index intervals.
   template <>
-  struct IntervalMapInfo<SlotIndex> : IntervalMapHalfOpenInfo<SlotIndex> {
+  struct LLVM_CLASS_ABI IntervalMapInfo<SlotIndex> : IntervalMapHalfOpenInfo<SlotIndex> {
   };
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/Spiller.h b/llvm/include/llvm/CodeGen/Spiller.h
index 4f1309916f06cdf..34ef488df0d5c5c 100644
--- a/llvm/include/llvm/CodeGen/Spiller.h
+++ b/llvm/include/llvm/CodeGen/Spiller.h
@@ -23,7 +23,7 @@ class VirtRegAuxInfo;
 ///
 /// Implementations are utility classes which insert spill or remat code on
 /// demand.
-class Spiller {
+class LLVM_CLASS_ABI Spiller {
   virtual void anchor();
 
 public:
@@ -37,7 +37,7 @@ class Spiller {
 
 /// Create and return a spiller that will insert spill code directly instead
 /// of deferring though VirtRegMap.
-Spiller *createInlineSpiller(MachineFunctionPass &Pass, MachineFunction &MF,
+LLVM_FUNC_ABI Spiller *createInlineSpiller(MachineFunctionPass &Pass, MachineFunction &MF,
                              VirtRegMap &VRM, VirtRegAuxInfo &VRAI);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/StackMaps.h b/llvm/include/llvm/CodeGen/StackMaps.h
index ecf3c2c77a88622..6af861a803730de 100644
--- a/llvm/include/llvm/CodeGen/StackMaps.h
+++ b/llvm/include/llvm/CodeGen/StackMaps.h
@@ -33,7 +33,7 @@ class TargetRegisterInfo;
 ///
 /// MI stackmap operations take the form:
 /// <id>, <numBytes>, live args...
-class StackMapOpers {
+class LLVM_CLASS_ABI StackMapOpers {
 public:
   /// Enumerate the meta operands.
   enum { IDPos, NBytesPos };
@@ -74,7 +74,7 @@ class StackMapOpers {
 /// Patchpoints following the anyregcc convention are handled specially. For
 /// these, the stack map also records the location of the return value and
 /// arguments.
-class PatchPointOpers {
+class LLVM_CLASS_ABI PatchPointOpers {
 public:
   /// Enumerate the meta operands.
   enum { IDPos, NBytesPos, TargetPos, NArgPos, CCPos, MetaEnd };
@@ -156,7 +156,7 @@ class PatchPointOpers {
 ///   section.
 ///   All gc pointers assigned to VRegs produce new value (in form of MI Def
 ///   operand) and are tied to it.
-class StatepointOpers {
+class LLVM_CLASS_ABI StatepointOpers {
   // TODO:: we should change the STATEPOINT representation so that CC and
   // Flags should be part of meta operands, with args and deopt operands, and
   // gc operands all prefixed by their length and a type code. This would be
@@ -257,7 +257,7 @@ class StatepointOpers {
   unsigned NumDefs;
 };
 
-class StackMaps {
+class LLVM_CLASS_ABI StackMaps {
 public:
   struct Location {
     enum LocationType {
diff --git a/llvm/include/llvm/CodeGen/StackProtector.h b/llvm/include/llvm/CodeGen/StackProtector.h
index bbbbdf5899982d4..45b919332916704 100644
--- a/llvm/include/llvm/CodeGen/StackProtector.h
+++ b/llvm/include/llvm/CodeGen/StackProtector.h
@@ -32,7 +32,7 @@ class Module;
 class TargetLoweringBase;
 class TargetMachine;
 
-class StackProtector : public FunctionPass {
+class LLVM_CLASS_ABI StackProtector : public FunctionPass {
 private:
   static constexpr unsigned DefaultSSPBufferSize = 8;
 
diff --git a/llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h b/llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h
index 381f8ea5f80ae23..52a30ca8afe8f2d 100644
--- a/llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h
+++ b/llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h
@@ -32,7 +32,7 @@ namespace llvm {
   class TargetInstrInfo;
   class TargetLowering;
 
-class SwiftErrorValueTracking {
+class LLVM_CLASS_ABI SwiftErrorValueTracking {
   // Some useful objects to reduce the number of function arguments needed.
   MachineFunction *MF;
   const Function *Fn;
diff --git a/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h b/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h
index 2bb840c8f6ba756..dbbdc1e261220d2 100644
--- a/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h
+++ b/llvm/include/llvm/CodeGen/SwitchLoweringUtils.h
@@ -40,7 +40,7 @@ enum CaseClusterKind {
 };
 
 /// A cluster of case labels.
-struct CaseCluster {
+struct LLVM_CLASS_ABI CaseCluster {
   CaseClusterKind Kind;
   const ConstantInt *Low, *High;
   union {
@@ -88,9 +88,9 @@ using CaseClusterVector = std::vector<CaseCluster>;
 using CaseClusterIt = CaseClusterVector::iterator;
 
 /// Sort Clusters and merge adjacent cases.
-void sortAndRangeify(CaseClusterVector &Clusters);
+LLVM_FUNC_ABI void sortAndRangeify(CaseClusterVector &Clusters);
 
-struct CaseBits {
+struct LLVM_CLASS_ABI CaseBits {
   uint64_t Mask = 0;
   MachineBasicBlock *BB = nullptr;
   unsigned Bits = 0;
@@ -107,7 +107,7 @@ using CaseBitsVector = std::vector<CaseBits>;
 /// This structure is used to communicate between SelectionDAGBuilder and
 /// SDISel for the code generation of additional basic blocks needed by
 /// multi-case switch statements.
-struct CaseBlock {
+struct LLVM_CLASS_ABI CaseBlock {
   // For the GISel interface.
   struct PredInfoPair {
     CmpInst::Predicate Pred;
@@ -163,7 +163,7 @@ struct CaseBlock {
         DbgLoc(dl), TrueProb(trueprob), FalseProb(falseprob) {}
 };
 
-struct JumpTable {
+struct LLVM_CLASS_ABI JumpTable {
   /// The virtual register containing the index of the jump table entry
   /// to jump to.
   unsigned Reg;
@@ -178,7 +178,7 @@ struct JumpTable {
   JumpTable(unsigned R, unsigned J, MachineBasicBlock *M, MachineBasicBlock *D)
       : Reg(R), JTI(J), MBB(M), Default(D) {}
 };
-struct JumpTableHeader {
+struct LLVM_CLASS_ABI JumpTableHeader {
   APInt First;
   APInt Last;
   const Value *SValue;
@@ -193,7 +193,7 @@ struct JumpTableHeader {
 };
 using JumpTableBlock = std::pair<JumpTableHeader, JumpTable>;
 
-struct BitTestCase {
+struct LLVM_CLASS_ABI BitTestCase {
   uint64_t Mask;
   MachineBasicBlock *ThisBB;
   MachineBasicBlock *TargetBB;
@@ -206,7 +206,7 @@ struct BitTestCase {
 
 using BitTestInfo = SmallVector<BitTestCase, 3>;
 
-struct BitTestBlock {
+struct LLVM_CLASS_ABI BitTestBlock {
   APInt First;
   APInt Range;
   const Value *SValue;
@@ -230,14 +230,14 @@ struct BitTestBlock {
 };
 
 /// Return the range of values within a range.
-uint64_t getJumpTableRange(const CaseClusterVector &Clusters, unsigned First,
+LLVM_FUNC_ABI uint64_t getJumpTableRange(const CaseClusterVector &Clusters, unsigned First,
                            unsigned Last);
 
 /// Return the number of cases within a range.
-uint64_t getJumpTableNumCases(const SmallVectorImpl<unsigned> &TotalCases,
+LLVM_FUNC_ABI uint64_t getJumpTableNumCases(const SmallVectorImpl<unsigned> &TotalCases,
                               unsigned First, unsigned Last);
 
-struct SwitchWorkListItem {
+struct LLVM_CLASS_ABI SwitchWorkListItem {
   MachineBasicBlock *MBB = nullptr;
   CaseClusterIt FirstCluster;
   CaseClusterIt LastCluster;
@@ -247,7 +247,7 @@ struct SwitchWorkListItem {
 };
 using SwitchWorkList = SmallVector<SwitchWorkListItem, 4>;
 
-class SwitchLowering {
+class LLVM_CLASS_ABI SwitchLowering {
 public:
   SwitchLowering(FunctionLoweringInfo &funcinfo) : FuncInfo(funcinfo) {}
 
diff --git a/llvm/include/llvm/CodeGen/TailDuplicator.h b/llvm/include/llvm/CodeGen/TailDuplicator.h
index 4ffe638f41082e7..8094e17110802bc 100644
--- a/llvm/include/llvm/CodeGen/TailDuplicator.h
+++ b/llvm/include/llvm/CodeGen/TailDuplicator.h
@@ -37,7 +37,7 @@ class ProfileSummaryInfo;
 class TargetRegisterInfo;
 
 /// Utility class to perform tail duplication.
-class TailDuplicator {
+class LLVM_CLASS_ABI TailDuplicator {
   const TargetInstrInfo *TII;
   const TargetRegisterInfo *TRI;
   const MachineBranchProbabilityInfo *MBPI;
diff --git a/llvm/include/llvm/CodeGen/TargetCallingConv.h b/llvm/include/llvm/CodeGen/TargetCallingConv.h
index ca51121b31c045d..83b20d955c9bad6 100644
--- a/llvm/include/llvm/CodeGen/TargetCallingConv.h
+++ b/llvm/include/llvm/CodeGen/TargetCallingConv.h
@@ -25,7 +25,7 @@
 namespace llvm {
 namespace ISD {
 
-  struct ArgFlagsTy {
+  struct LLVM_CLASS_ABI ArgFlagsTy {
   private:
     unsigned IsZExt : 1;     ///< Zero extended
     unsigned IsSExt : 1;     ///< Sign extended
@@ -193,7 +193,7 @@ namespace ISD {
   /// single incoming (formal) argument or incoming (from the perspective
   /// of the caller) return value virtual register.
   ///
-  struct InputArg {
+  struct LLVM_CLASS_ABI InputArg {
     ArgFlagsTy Flags;
     MVT VT = MVT::Other;
     EVT ArgVT;
@@ -231,7 +231,7 @@ namespace ISD {
   /// single outgoing (actual) argument or outgoing (from the perspective
   /// of the caller) return value virtual register.
   ///
-  struct OutputArg {
+  struct LLVM_CLASS_ABI OutputArg {
     ArgFlagsTy Flags;
     MVT VT;
     EVT ArgVT;
diff --git a/llvm/include/llvm/CodeGen/TargetFrameLowering.h b/llvm/include/llvm/CodeGen/TargetFrameLowering.h
index 2de5b174cc569cf..bb4a151649bc837 100644
--- a/llvm/include/llvm/CodeGen/TargetFrameLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetFrameLowering.h
@@ -41,7 +41,7 @@ enum Value {
 /// The offset to the local area is the offset from the stack pointer on
 /// function entry to the first location where function data (local variables,
 /// spill locations) can be stored.
-class TargetFrameLowering {
+class LLVM_CLASS_ABI TargetFrameLowering {
 public:
   enum StackDirection {
     StackGrowsUp,        // Adding to the stack increases the stack address
diff --git a/llvm/include/llvm/CodeGen/TargetInstrInfo.h b/llvm/include/llvm/CodeGen/TargetInstrInfo.h
index 7704a3568186193..8af2669fbc1b6bd 100644
--- a/llvm/include/llvm/CodeGen/TargetInstrInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetInstrInfo.h
@@ -68,7 +68,7 @@ template <class T> class SmallVectorImpl;
 
 using ParamLoadedValue = std::pair<MachineOperand, DIExpression*>;
 
-struct DestSourcePair {
+struct LLVM_CLASS_ABI DestSourcePair {
   const MachineOperand *Destination;
   const MachineOperand *Source;
 
@@ -77,7 +77,7 @@ struct DestSourcePair {
 };
 
 /// Used to describe a register and immediate addition.
-struct RegImmPair {
+struct LLVM_CLASS_ABI RegImmPair {
   Register Reg;
   int64_t Imm;
 
@@ -86,7 +86,7 @@ struct RegImmPair {
 
 /// Used to describe addressing mode similar to ExtAddrMode in CodeGenPrepare.
 /// It holds the register values, the scale value and the displacement.
-struct ExtAddrMode {
+struct LLVM_CLASS_ABI ExtAddrMode {
   Register BaseReg;
   Register ScaledReg;
   int64_t Scale;
@@ -97,7 +97,7 @@ struct ExtAddrMode {
 ///
 /// TargetInstrInfo - Interface to description of machine instruction set
 ///
-class TargetInstrInfo : public MCInstrInfo {
+class LLVM_CLASS_ABI TargetInstrInfo : public MCInstrInfo {
 public:
   TargetInstrInfo(unsigned CFSetupOpcode = ~0u, unsigned CFDestroyOpcode = ~0u,
                   unsigned CatchRetOpcode = ~0u, unsigned ReturnOpcode = ~0u)
@@ -2141,7 +2141,7 @@ class TargetInstrInfo : public MCInstrInfo {
 };
 
 /// Provide DenseMapInfo for TargetInstrInfo::RegSubRegPair.
-template <> struct DenseMapInfo<TargetInstrInfo::RegSubRegPair> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<TargetInstrInfo::RegSubRegPair> {
   using RegInfo = DenseMapInfo<unsigned>;
 
   static inline TargetInstrInfo::RegSubRegPair getEmptyKey() {
diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 6bc1202c0f7945f..cc378d1cbc79c00 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -110,7 +110,7 @@ enum Preference {
 } // end namespace Sched
 
 // MemOp models a memory operation, either memset or memcpy/memmove.
-struct MemOp {
+struct LLVM_CLASS_ABI MemOp {
 private:
   // Shared
   uint64_t Size;
@@ -190,7 +190,7 @@ struct MemOp {
 
 /// This base class for TargetLowering contains the SelectionDAG-independent
 /// parts that can be used from the rest of CodeGen.
-class TargetLoweringBase {
+class LLVM_CLASS_ABI TargetLoweringBase {
 public:
   /// This enum indicates whether operations are valid for a target, and if not,
   /// what action should be used to make them valid.
@@ -3579,7 +3579,7 @@ class TargetLoweringBase {
 ///
 /// This class also defines callbacks that targets must implement to lower
 /// target-specific constructs to SelectionDAG operators.
-class TargetLowering : public TargetLoweringBase {
+class LLVM_CLASS_ABI TargetLowering : public TargetLoweringBase {
 public:
   struct DAGCombinerInfo;
   struct MakeLibCallOptions;
@@ -5337,7 +5337,7 @@ class TargetLowering : public TargetLoweringBase {
 /// Given an LLVM IR type and return type attributes, compute the return value
 /// EVTs and flags, and optionally also the offsets, if the return value is
 /// being lowered to memory.
-void GetReturnInfo(CallingConv::ID CC, Type *ReturnType, AttributeList attr,
+LLVM_FUNC_ABI void GetReturnInfo(CallingConv::ID CC, Type *ReturnType, AttributeList attr,
                    SmallVectorImpl<ISD::OutputArg> &Outs,
                    const TargetLowering &TLI, const DataLayout &DL);
 
diff --git a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
index bd442a1d926df41..66b21706666d472 100644
--- a/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
+++ b/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
@@ -32,7 +32,7 @@ class MCSymbol;
 class Module;
 class TargetMachine;
 
-class TargetLoweringObjectFileELF : public TargetLoweringObjectFile {
+class LLVM_CLASS_ABI TargetLoweringObjectFileELF : public TargetLoweringObjectFile {
   bool UseInitArray = false;
   mutable unsigned NextUniqueID = 1;  // ID 0 is reserved for execute-only sections
   SmallPtrSet<GlobalObject *, 2> Used;
@@ -113,7 +113,7 @@ class TargetLoweringObjectFileELF : public TargetLoweringObjectFile {
   MCSection *getSectionForCommandLines() const override;
 };
 
-class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
+class LLVM_CLASS_ABI TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
 public:
   TargetLoweringObjectFileMachO();
   ~TargetLoweringObjectFileMachO() override = default;
@@ -159,7 +159,7 @@ class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
                          const TargetMachine &TM) const override;
 };
 
-class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
+class LLVM_CLASS_ABI TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
   mutable unsigned NextUniqueID = 0;
   const TargetMachine *TM = nullptr;
 
@@ -204,7 +204,7 @@ class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
   void emitLinkerDirectives(MCStreamer &Streamer, Module &M) const;
 };
 
-class TargetLoweringObjectFileWasm : public TargetLoweringObjectFile {
+class LLVM_CLASS_ABI TargetLoweringObjectFileWasm : public TargetLoweringObjectFile {
   mutable unsigned NextUniqueID = 0;
 
 public:
@@ -231,7 +231,7 @@ class TargetLoweringObjectFileWasm : public TargetLoweringObjectFile {
                                        const TargetMachine &TM) const override;
 };
 
-class TargetLoweringObjectFileXCOFF : public TargetLoweringObjectFile {
+class LLVM_CLASS_ABI TargetLoweringObjectFileXCOFF : public TargetLoweringObjectFile {
 public:
   TargetLoweringObjectFileXCOFF() = default;
   ~TargetLoweringObjectFileXCOFF() override = default;
@@ -299,7 +299,7 @@ class TargetLoweringObjectFileXCOFF : public TargetLoweringObjectFile {
                                const TargetMachine &TM) const override;
 };
 
-class TargetLoweringObjectFileGOFF : public TargetLoweringObjectFile {
+class LLVM_CLASS_ABI TargetLoweringObjectFileGOFF : public TargetLoweringObjectFile {
 public:
   TargetLoweringObjectFileGOFF();
   ~TargetLoweringObjectFileGOFF() override = default;
diff --git a/llvm/include/llvm/CodeGen/TargetPassConfig.h b/llvm/include/llvm/CodeGen/TargetPassConfig.h
index 7efd4f6bc99b069..a1fc1854afe5289 100644
--- a/llvm/include/llvm/CodeGen/TargetPassConfig.h
+++ b/llvm/include/llvm/CodeGen/TargetPassConfig.h
@@ -51,7 +51,7 @@ using legacy::PassManagerBase;
 /// the PassConfig API to handle either type.
 ///
 /// AnalysisID is sadly char*, so PointerIntPair won't work.
-class IdentifyingPassPtr {
+class LLVM_CLASS_ABI IdentifyingPassPtr {
   union {
     AnalysisID ID;
     Pass *P;
@@ -82,7 +82,7 @@ class IdentifyingPassPtr {
 ///
 /// This is an ImmutablePass solely for the purpose of exposing CodeGen options
 /// to the internals of other CodeGen passes.
-class TargetPassConfig : public ImmutablePass {
+class LLVM_CLASS_ABI TargetPassConfig : public ImmutablePass {
 private:
   PassManagerBase *PM = nullptr;
   AnalysisID StartBefore = nullptr;
@@ -468,7 +468,7 @@ class TargetPassConfig : public ImmutablePass {
   virtual bool addRegAssignAndRewriteOptimized();
 };
 
-void registerCodeGenCallback(PassInstrumentationCallbacks &PIC,
+LLVM_FUNC_ABI void registerCodeGenCallback(PassInstrumentationCallbacks &PIC,
                              LLVMTargetMachine &);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
index 48bd68084d0a7d8..870d22559bbabc4 100644
--- a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h
@@ -43,7 +43,7 @@ class VirtRegMap;
 class LiveIntervals;
 class LiveInterval;
 
-class TargetRegisterClass {
+class LLVM_CLASS_ABI TargetRegisterClass {
 public:
   using iterator = const MCPhysReg *;
   using const_iterator = const MCPhysReg *;
@@ -214,7 +214,7 @@ class TargetRegisterClass {
 
 /// Extra information, not in MCRegisterDesc, about registers.
 /// These are used by codegen, not by MC.
-struct TargetRegisterInfoDesc {
+struct LLVM_CLASS_ABI TargetRegisterInfoDesc {
   const uint8_t *CostPerUse; // Extra cost of instructions using register.
   unsigned NumCosts; // Number of cost values associated with each register.
   const bool
@@ -223,7 +223,7 @@ struct TargetRegisterInfoDesc {
 
 /// Each TargetRegisterClass has a per register weight, and weight
 /// limit which must be less than the limits of its pressure sets.
-struct RegClassWeight {
+struct LLVM_CLASS_ABI RegClassWeight {
   unsigned RegWeight;
   unsigned WeightLimit;
 };
@@ -234,7 +234,7 @@ struct RegClassWeight {
 /// to this array so that we can turn register number into a register
 /// descriptor.
 ///
-class TargetRegisterInfo : public MCRegisterInfo {
+class LLVM_CLASS_ABI TargetRegisterInfo : public MCRegisterInfo {
 public:
   using regclass_iterator = const TargetRegisterClass * const *;
   using vt_iterator = const MVT::SimpleValueType *;
@@ -1181,7 +1181,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
 // The iterator can include (O, RC->getSubClassMask()) as the first entry which
 // also satisfies the above requirement, assuming Reg:0 == Reg.
 //
-class SuperRegClassIterator {
+class LLVM_CLASS_ABI SuperRegClassIterator {
   const unsigned RCMaskWords;
   unsigned SubReg = 0;
   const uint16_t *Idx;
@@ -1227,7 +1227,7 @@ class SuperRegClassIterator {
 /// the various RegClass related APIs.
 /// E.g., this class can be used to iterate over the subclasses provided by
 /// TargetRegisterClass::getSubClassMask or SuperRegClassIterator::getMask.
-class BitMaskClassIterator {
+class LLVM_CLASS_ABI BitMaskClassIterator {
   /// Total number of register classes.
   const unsigned NumRegClasses;
   /// Base index of CurrentChunk.
@@ -1311,7 +1311,7 @@ class BitMaskClassIterator {
 };
 
 // This is useful when building IndexedMaps keyed on virtual registers
-struct VirtReg2IndexFunctor {
+struct LLVM_CLASS_ABI VirtReg2IndexFunctor {
   using argument_type = Register;
   unsigned operator()(Register Reg) const {
     return Register::virtReg2Index(Reg);
@@ -1328,7 +1328,7 @@ struct VirtReg2IndexFunctor {
 ///   %physreg17      - a physical register when no TRI instance given.
 ///
 /// Usage: OS << printReg(Reg, TRI, SubRegIdx) << '\n';
-Printable printReg(Register Reg, const TargetRegisterInfo *TRI = nullptr,
+LLVM_FUNC_ABI Printable printReg(Register Reg, const TargetRegisterInfo *TRI = nullptr,
                    unsigned SubIdx = 0,
                    const MachineRegisterInfo *MRI = nullptr);
 
@@ -1340,15 +1340,15 @@ Printable printReg(Register Reg, const TargetRegisterInfo *TRI = nullptr,
 ///   fp0~st7 - Dual roots.
 ///
 /// Usage: OS << printRegUnit(Unit, TRI) << '\n';
-Printable printRegUnit(unsigned Unit, const TargetRegisterInfo *TRI);
+LLVM_FUNC_ABI Printable printRegUnit(unsigned Unit, const TargetRegisterInfo *TRI);
 
 /// Create Printable object to print virtual registers and physical
 /// registers on a \ref raw_ostream.
-Printable printVRegOrUnit(unsigned VRegOrUnit, const TargetRegisterInfo *TRI);
+LLVM_FUNC_ABI Printable printVRegOrUnit(unsigned VRegOrUnit, const TargetRegisterInfo *TRI);
 
 /// Create Printable object to print register classes or register banks
 /// on a \ref raw_ostream.
-Printable printRegClassOrBank(Register Reg, const MachineRegisterInfo &RegInfo,
+LLVM_FUNC_ABI Printable printRegClassOrBank(Register Reg, const MachineRegisterInfo &RegInfo,
                               const TargetRegisterInfo *TRI);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/CodeGen/TargetSchedule.h b/llvm/include/llvm/CodeGen/TargetSchedule.h
index d2c170d143033f5..583c66a511defc5 100644
--- a/llvm/include/llvm/CodeGen/TargetSchedule.h
+++ b/llvm/include/llvm/CodeGen/TargetSchedule.h
@@ -28,7 +28,7 @@ class MachineInstr;
 class TargetInstrInfo;
 
 /// Provide an instruction scheduling machine model to CodeGen passes.
-class TargetSchedModel {
+class LLVM_CLASS_ABI TargetSchedModel {
   // For efficiency, hold a copy of the statically defined MCSchedModel for this
   // processor.
   MCSchedModel SchedModel;
diff --git a/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h b/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
index 8f3b9dfa164bb32..898b1ef86a64523 100644
--- a/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
@@ -60,7 +60,7 @@ class Triple;
 /// Target-specific options that control code generation and printing should
 /// be exposed through a TargetSubtargetInfo-derived class.
 ///
-class TargetSubtargetInfo : public MCSubtargetInfo {
+class LLVM_CLASS_ABI TargetSubtargetInfo : public MCSubtargetInfo {
 protected: // Can only create subclasses...
   TargetSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU,
                       StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
diff --git a/llvm/include/llvm/CodeGen/TileShapeInfo.h b/llvm/include/llvm/CodeGen/TileShapeInfo.h
index e902404d05a0a4a..1ac703de4a49c3f 100644
--- a/llvm/include/llvm/CodeGen/TileShapeInfo.h
+++ b/llvm/include/llvm/CodeGen/TileShapeInfo.h
@@ -28,7 +28,7 @@
 
 namespace llvm {
 
-class ShapeT {
+class LLVM_CLASS_ABI ShapeT {
 public:
   ShapeT(MachineOperand *Row, MachineOperand *Col,
          const MachineRegisterInfo *MRI = nullptr)
diff --git a/llvm/include/llvm/CodeGen/TypePromotion.h b/llvm/include/llvm/CodeGen/TypePromotion.h
index dd8fc920a78aadd..2a81fcbdd645c88 100644
--- a/llvm/include/llvm/CodeGen/TypePromotion.h
+++ b/llvm/include/llvm/CodeGen/TypePromotion.h
@@ -22,7 +22,7 @@ namespace llvm {
 class Function;
 class TargetMachine;
 
-class TypePromotionPass : public PassInfoMixin<TypePromotionPass> {
+class LLVM_CLASS_ABI TypePromotionPass : public PassInfoMixin<TypePromotionPass> {
 private:
   const TargetMachine *TM;
 
diff --git a/llvm/include/llvm/CodeGen/UnreachableBlockElim.h b/llvm/include/llvm/CodeGen/UnreachableBlockElim.h
index 5732c4abe57b548..ef7799d086a7a4e 100644
--- a/llvm/include/llvm/CodeGen/UnreachableBlockElim.h
+++ b/llvm/include/llvm/CodeGen/UnreachableBlockElim.h
@@ -27,7 +27,7 @@
 
 namespace llvm {
 
-class UnreachableBlockElimPass
+class LLVM_CLASS_ABI UnreachableBlockElimPass
     : public PassInfoMixin<UnreachableBlockElimPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/CodeGen/VLIWMachineScheduler.h b/llvm/include/llvm/CodeGen/VLIWMachineScheduler.h
index 14c262dcd624104..cbf7f756fdcb8e5 100644
--- a/llvm/include/llvm/CodeGen/VLIWMachineScheduler.h
+++ b/llvm/include/llvm/CodeGen/VLIWMachineScheduler.h
@@ -29,7 +29,7 @@ class SUnit;
 class TargetInstrInfo;
 class TargetSubtargetInfo;
 
-class VLIWResourceModel {
+class LLVM_CLASS_ABI VLIWResourceModel {
 protected:
   const TargetInstrInfo *TII;
 
@@ -68,7 +68,7 @@ class VLIWResourceModel {
 
 /// Extend the standard ScheduleDAGMILive to provide more context and override
 /// the top-level schedule() driver.
-class VLIWMachineScheduler : public ScheduleDAGMILive {
+class LLVM_CLASS_ABI VLIWMachineScheduler : public ScheduleDAGMILive {
 public:
   VLIWMachineScheduler(MachineSchedContext *C,
                        std::unique_ptr<MachineSchedStrategy> S)
@@ -87,7 +87,7 @@ class VLIWMachineScheduler : public ScheduleDAGMILive {
 // MachineSchedStrategy.
 //===----------------------------------------------------------------------===//
 
-class ConvergingVLIWScheduler : public MachineSchedStrategy {
+class LLVM_CLASS_ABI ConvergingVLIWScheduler : public MachineSchedStrategy {
 protected:
   /// Store the state used by ConvergingVLIWScheduler heuristics, required
   ///  for the lifetime of one invocation of pickNode().
diff --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h
index 747cce781cf7a6d..9d4c5a71f2ae610 100644
--- a/llvm/include/llvm/CodeGen/ValueTypes.h
+++ b/llvm/include/llvm/CodeGen/ValueTypes.h
@@ -31,7 +31,7 @@ namespace llvm {
   /// Extended Value Type. Capable of holding value types which are not native
   /// for any processor (such as the i12345 type), as well as the types an MVT
   /// can represent.
-  struct EVT {
+  struct LLVM_CLASS_ABI EVT {
   private:
     MVT V = MVT::INVALID_SIMPLE_VALUE_TYPE;
     Type *LLVMTy = nullptr;
diff --git a/llvm/include/llvm/CodeGen/VirtRegMap.h b/llvm/include/llvm/CodeGen/VirtRegMap.h
index a46469eef1b6ee9..f4b12c3dc9e38eb 100644
--- a/llvm/include/llvm/CodeGen/VirtRegMap.h
+++ b/llvm/include/llvm/CodeGen/VirtRegMap.h
@@ -31,7 +31,7 @@ class MachineRegisterInfo;
 class raw_ostream;
 class TargetInstrInfo;
 
-  class VirtRegMap : public MachineFunctionPass {
+  class LLVM_CLASS_ABI VirtRegMap : public MachineFunctionPass {
   public:
     enum {
       NO_PHYS_REG = 0,
diff --git a/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h b/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
index a710c091186e3ab..01fd2fd72bcf071 100644
--- a/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
+++ b/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
@@ -30,7 +30,7 @@ enum Tag { CPP_EXCEPTION = 0, C_LONGJMP = 1 };
 
 using BBOrMBB = PointerUnion<const BasicBlock *, MachineBasicBlock *>;
 
-struct WasmEHFuncInfo {
+struct LLVM_CLASS_ABI WasmEHFuncInfo {
   // When there is an entry <A, B>, if an exception is not caught by A, it
   // should next unwind to the EH pad B.
   DenseMap<BBOrMBB, BBOrMBB> SrcToUnwindDest;
@@ -86,7 +86,7 @@ struct WasmEHFuncInfo {
 };
 
 // Analyze the IR in the given function to build WasmEHFuncInfo.
-void calculateWasmEHInfo(const Function *F, WasmEHFuncInfo &EHInfo);
+LLVM_FUNC_ABI void calculateWasmEHInfo(const Function *F, WasmEHFuncInfo &EHInfo);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/CodeGen/WinEHFuncInfo.h b/llvm/include/llvm/CodeGen/WinEHFuncInfo.h
index 7e1a55c4bbf2b45..e0452969999c263 100644
--- a/llvm/include/llvm/CodeGen/WinEHFuncInfo.h
+++ b/llvm/include/llvm/CodeGen/WinEHFuncInfo.h
@@ -38,13 +38,13 @@ class MCSymbol;
 
 using MBBOrBasicBlock = PointerUnion<const BasicBlock *, MachineBasicBlock *>;
 
-struct CxxUnwindMapEntry {
+struct LLVM_CLASS_ABI CxxUnwindMapEntry {
   int ToState;
   MBBOrBasicBlock Cleanup;
 };
 
 /// Similar to CxxUnwindMapEntry, but supports SEH filters.
-struct SEHUnwindMapEntry {
+struct LLVM_CLASS_ABI SEHUnwindMapEntry {
   /// If unwinding continues through this handler, transition to the handler at
   /// this state. This indexes into SEHUnwindMap.
   int ToState = -1;
@@ -58,7 +58,7 @@ struct SEHUnwindMapEntry {
   MBBOrBasicBlock Handler;
 };
 
-struct WinEHHandlerType {
+struct LLVM_CLASS_ABI WinEHHandlerType {
   int Adjectives;
   /// The CatchObj starts out life as an LLVM alloca and is eventually turned
   /// frame index.
@@ -70,7 +70,7 @@ struct WinEHHandlerType {
   MBBOrBasicBlock Handler;
 };
 
-struct WinEHTryBlockMapEntry {
+struct LLVM_CLASS_ABI WinEHTryBlockMapEntry {
   int TryLow = -1;
   int TryHigh = -1;
   int CatchHigh = -1;
@@ -79,7 +79,7 @@ struct WinEHTryBlockMapEntry {
 
 enum class ClrHandlerType { Catch, Finally, Fault, Filter };
 
-struct ClrEHUnwindMapEntry {
+struct LLVM_CLASS_ABI ClrEHUnwindMapEntry {
   MBBOrBasicBlock Handler;
   uint32_t TypeToken;
   int HandlerParentState; ///< Outer handler enclosing this entry's handler
@@ -88,7 +88,7 @@ struct ClrEHUnwindMapEntry {
   ClrHandlerType HandlerType;
 };
 
-struct WinEHFuncInfo {
+struct LLVM_CLASS_ABI WinEHFuncInfo {
   DenseMap<const Instruction *, int> EHPadStateMap;
   DenseMap<const FuncletPadInst *, int> FuncletBaseStateMap;
   DenseMap<const InvokeInst *, int> InvokeStateMap;
@@ -119,18 +119,18 @@ struct WinEHFuncInfo {
 /// Analyze the IR in ParentFn and it's handlers to build WinEHFuncInfo, which
 /// describes the state numbers and tables used by __CxxFrameHandler3. This
 /// analysis assumes that WinEHPrepare has already been run.
-void calculateWinCXXEHStateNumbers(const Function *ParentFn,
+LLVM_FUNC_ABI void calculateWinCXXEHStateNumbers(const Function *ParentFn,
                                    WinEHFuncInfo &FuncInfo);
 
-void calculateSEHStateNumbers(const Function *ParentFn,
+LLVM_FUNC_ABI void calculateSEHStateNumbers(const Function *ParentFn,
                               WinEHFuncInfo &FuncInfo);
 
-void calculateClrEHStateNumbers(const Function *Fn, WinEHFuncInfo &FuncInfo);
+LLVM_FUNC_ABI void calculateClrEHStateNumbers(const Function *Fn, WinEHFuncInfo &FuncInfo);
 
 // For AsynchEH (VC++ option -EHa)
-void calculateCXXStateForAsynchEH(const BasicBlock *BB, int State,
+LLVM_FUNC_ABI void calculateCXXStateForAsynchEH(const BasicBlock *BB, int State,
                                   WinEHFuncInfo &FuncInfo);
-void calculateSEHStateForAsynchEH(const BasicBlock *BB, int State,
+LLVM_FUNC_ABI void calculateSEHStateForAsynchEH(const BasicBlock *BB, int State,
                                   WinEHFuncInfo &FuncInfo);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/Config/abi-breaking.h.cmake b/llvm/include/llvm/Config/abi-breaking.h.cmake
index 2d27e02b1d54574..9bf5475dfde323f 100644
--- a/llvm/include/llvm/Config/abi-breaking.h.cmake
+++ b/llvm/include/llvm/Config/abi-breaking.h.cmake
@@ -12,6 +12,8 @@
 #ifndef LLVM_ABI_BREAKING_CHECKS_H
 #define LLVM_ABI_BREAKING_CHECKS_H
 
+#include "llvm/Support/Compiler.h"
+
 /* Define to enable checks that alter the LLVM C++ ABI */
 #cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS
 
@@ -43,12 +45,12 @@
 #endif
 namespace llvm {
 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
-extern int EnableABIBreakingChecks;
+LLVM_FUNC_ABI extern int EnableABIBreakingChecks;
 LLVM_HIDDEN_VISIBILITY
 __attribute__((weak)) int *VerifyEnableABIBreakingChecks =
     &EnableABIBreakingChecks;
 #else
-extern int DisableABIBreakingChecks;
+LLVM_FUNC_ABI extern int DisableABIBreakingChecks;
 LLVM_HIDDEN_VISIBILITY
 __attribute__((weak)) int *VerifyDisableABIBreakingChecks =
     &DisableABIBreakingChecks;
diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinker.h b/llvm/include/llvm/DWARFLinker/DWARFLinker.h
index 5bb6e145810abd8..3569339652914ce 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFLinker.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinker.h
@@ -35,7 +35,7 @@ enum class DwarfLinkerClient { Dsymutil, LLD, General };
 /// by debug information. Valid addresses are those which points to
 /// live code sections. i.e. relocations for these addresses point
 /// into sections which would be/are placed into resulting binary.
-class AddressesMap {
+class LLVM_CLASS_ABI AddressesMap {
 public:
   virtual ~AddressesMap();
 
@@ -77,7 +77,7 @@ class AddressesMap {
 using Offset2UnitMap = DenseMap<uint64_t, CompileUnit *>;
 
 /// DwarfEmitter presents interface to generate all debug info tables.
-class DwarfEmitter {
+class LLVM_CLASS_ABI DwarfEmitter {
 public:
   virtual ~DwarfEmitter();
 
@@ -232,7 +232,7 @@ using UnitListTy = std::vector<std::unique_ptr<CompileUnit>>;
 
 /// This class represents DWARF information for source file
 /// and its address map.
-class DWARFFile {
+class LLVM_CLASS_ABI DWARFFile {
 public:
   DWARFFile(StringRef Name, std::unique_ptr<DWARFContext> Dwarf,
             std::unique_ptr<AddressesMap> Addresses,
@@ -272,7 +272,7 @@ typedef function_ref<void(const DWARFUnit &Unit)> CompileUnitHandler;
 /// a variable). These relocations are called ValidRelocs in the
 /// AddressesInfo and are gathered as a very first step when we start
 /// processing a object file.
-class DWARFLinker {
+class LLVM_CLASS_ABI DWARFLinker {
 public:
   typedef std::function<void(const Twine &Warning, StringRef Context,
                              const DWARFDie *DIE)>
diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h b/llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
index c78421c3518435a..4c70da8d5ffddb4 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h
@@ -32,7 +32,7 @@ using RangesTy = AddressRangesMap;
 // is of type 'exprloc'.
 // ASSUMPTION: Location attributes of 'loclist' type containing 'exprloc'
 //             with address expression operands are not supported yet.
-struct PatchLocation {
+struct LLVM_CLASS_ABI PatchLocation {
   DIE::value_iterator I;
   int64_t RelocAdjustment = 0;
 
@@ -59,7 +59,7 @@ using LocListAttributesTy = SmallVector<PatchLocation>;
 
 /// Stores all information relating to a compile unit, be it in its original
 /// instance in the object file to its brand new cloned and generated DIE tree.
-class CompileUnit {
+class LLVM_CLASS_ABI CompileUnit {
 public:
   /// Information gathered about a DIE in the object file.
   struct DIEInfo {
diff --git a/llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h b/llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h
index 488ae6f164a1185..1fa824426a8b39d 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h
@@ -30,7 +30,7 @@ struct DeclMapInfo;
 /// number of calls to realpath which is expensive. We assume the input are
 /// files, and cache the realpath of their parent. This way we can quickly
 /// resolve different files under the same path.
-class CachedPathResolver {
+class LLVM_CLASS_ABI CachedPathResolver {
 public:
   /// Resolve a path by calling realpath and cache its result. The returned
   /// StringRef is interned in the given \p StringPool.
@@ -76,7 +76,7 @@ class CachedPathResolver {
 /// allows to walk up the tree), but to query the existence of a specific
 /// DeclContext using a separate DenseMap keyed on the hash of the fully
 /// qualified name of the context.
-class DeclContext {
+class LLVM_CLASS_ABI DeclContext {
 public:
   using Map = DenseSet<DeclContext *, DeclMapInfo>;
 
@@ -125,7 +125,7 @@ class DeclContext {
 /// This class gives a tree-like API to the DenseMap that stores the
 /// DeclContext objects. It holds the BumpPtrAllocator where these objects will
 /// be allocated.
-class DeclContextTree {
+class LLVM_CLASS_ABI DeclContextTree {
 public:
   /// Get the child of \a Context described by \a DIE in \a Unit. The
   /// required strings will be interned in \a StringPool.
@@ -166,7 +166,7 @@ class DeclContextTree {
 };
 
 /// Info type for the DenseMap storing the DeclContext pointers.
-struct DeclMapInfo : private DenseMapInfo<DeclContext *> {
+struct LLVM_CLASS_ABI DeclMapInfo : private DenseMapInfo<DeclContext *> {
   using DenseMapInfo<DeclContext *>::getEmptyKey;
   using DenseMapInfo<DeclContext *>::getTombstoneKey;
 
diff --git a/llvm/include/llvm/DWARFLinker/DWARFStreamer.h b/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
index 1f318a065505d40..a3327f551e7f48b 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
@@ -39,7 +39,7 @@ class DWARFDebugMacro;
 ///
 /// All interactions with the MC layer that is used to build the debug
 /// information binary representation are handled in this class.
-class DwarfStreamer : public DwarfEmitter {
+class LLVM_CLASS_ABI DwarfStreamer : public DwarfEmitter {
 public:
   DwarfStreamer(DWARFLinker::OutputFileType OutFileType,
                 raw_pwrite_stream &OutFile,
diff --git a/llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h b/llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h
index a819b791b5ac87f..678c984beaff6ee 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h
@@ -26,7 +26,7 @@ using RangesTy = AddressRangesMap;
 /// by debug information. Valid addresses are those which points to
 /// live code sections. i.e. relocations for these addresses point
 /// into sections which would be/are placed into resulting binary.
-class AddressesMap {
+class LLVM_CLASS_ABI AddressesMap {
 public:
   virtual ~AddressesMap() = default;
 
diff --git a/llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h b/llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h
index 21eecb20b527216..1769ccc26661f4b 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/DWARFFile.h
@@ -24,7 +24,7 @@ namespace dwarflinker_parallel {
 /// and it's address map.
 ///
 /// May be used asynchroniously for reading.
-class DWARFFile {
+class LLVM_CLASS_ABI DWARFFile {
 public:
   using UnloadCallbackTy = std::function<void(StringRef FileName)>;
 
diff --git a/llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h b/llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h
index f893b41d68f2a36..47a9293c0b7e3ee 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/DWARFLinker.h
@@ -91,7 +91,7 @@ namespace dwarflinker_parallel {
 
 /// ExtraDwarfEmitter allows adding extra data to the DWARFLinker output.
 /// The finish() method should be called after all extra data are emitted.
-class ExtraDwarfEmitter {
+class LLVM_CLASS_ABI ExtraDwarfEmitter {
 public:
   virtual ~ExtraDwarfEmitter() = default;
 
@@ -116,7 +116,7 @@ class ExtraDwarfEmitter {
   virtual AsmPrinter &getAsmPrinter() const = 0;
 };
 
-class DWARFLinker {
+class LLVM_CLASS_ABI DWARFLinker {
 public:
   /// Type of output file.
   enum class OutputFileType {
diff --git a/llvm/include/llvm/DWARFLinkerParallel/StringPool.h b/llvm/include/llvm/DWARFLinkerParallel/StringPool.h
index 8cb976d12ec85c3..a49c96787802556 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/StringPool.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/StringPool.h
@@ -24,7 +24,7 @@ namespace dwarflinker_parallel {
 /// and a string body which is placed right after StringEntry.
 using StringEntry = StringMapEntry<DwarfStringPoolEntry *>;
 
-class StringPoolEntryInfo {
+class LLVM_CLASS_ABI StringPoolEntryInfo {
 public:
   /// \returns Hash value for the specified \p Key.
   static inline uint64_t getHashValue(const StringRef &Key) {
@@ -48,7 +48,7 @@ class StringPoolEntryInfo {
   }
 };
 
-class StringPool
+class LLVM_CLASS_ABI StringPool
     : public ConcurrentHashTableByPtr<StringRef, StringEntry,
                                       parallel::PerThreadBumpPtrAllocator,
                                       StringPoolEntryInfo> {
diff --git a/llvm/include/llvm/DWARFLinkerParallel/StringTable.h b/llvm/include/llvm/DWARFLinkerParallel/StringTable.h
index a1d02e1b9864a9c..de404fee27efc48 100644
--- a/llvm/include/llvm/DWARFLinkerParallel/StringTable.h
+++ b/llvm/include/llvm/DWARFLinkerParallel/StringTable.h
@@ -20,7 +20,7 @@ using StringsVector = SmallVector<StringEntry *>;
 
 /// This class prepares strings for emission into .debug_str table:
 /// translates string if necessary, assigns index and offset, keeps in order.
-class StringTable {
+class LLVM_CLASS_ABI StringTable {
 public:
   StringTable(StringPool &Strings,
               std::function<StringRef(StringRef)> StringsTranslator)
diff --git a/llvm/include/llvm/DWP/DWP.h b/llvm/include/llvm/DWP/DWP.h
index 389c3c830e4c869..8085ef5e7c356c4 100644
--- a/llvm/include/llvm/DWP/DWP.h
+++ b/llvm/include/llvm/DWP/DWP.h
@@ -16,7 +16,7 @@
 #include <vector>
 
 namespace llvm {
-struct UnitIndexEntry {
+struct LLVM_CLASS_ABI UnitIndexEntry {
   DWARFUnitIndex::Entry::SectionContribution Contributions[8];
   std::string Name;
   std::string DWOName;
@@ -26,7 +26,7 @@ struct UnitIndexEntry {
 // Holds data for Skeleton, Split Compilation, and Type Unit Headers (only in
 // v5) as defined in Dwarf 5 specification, 7.5.1.2, 7.5.1.3 and Dwarf 4
 // specification 7.5.1.1.
-struct InfoSectionUnitHeader {
+struct LLVM_CLASS_ABI InfoSectionUnitHeader {
   // unit_length field. Note that the type is uint64_t even in 32-bit dwarf.
   uint64_t Length = 0;
 
@@ -55,18 +55,18 @@ struct InfoSectionUnitHeader {
   uint8_t HeaderSize = 0;
 };
 
-struct CompileUnitIdentifiers {
+struct LLVM_CLASS_ABI CompileUnitIdentifiers {
   uint64_t Signature = 0;
   const char *Name = "";
   const char *DWOName = "";
 };
 
-Error write(MCStreamer &Out, ArrayRef<std::string> Inputs,
+LLVM_FUNC_ABI Error write(MCStreamer &Out, ArrayRef<std::string> Inputs,
             bool ContinueOnCuIndexOverflow);
 
-unsigned getContributionIndex(DWARFSectionKind Kind, uint32_t IndexVersion);
+LLVM_FUNC_ABI unsigned getContributionIndex(DWARFSectionKind Kind, uint32_t IndexVersion);
 
-Error handleSection(
+LLVM_FUNC_ABI Error handleSection(
     const StringMap<std::pair<MCSection *, DWARFSectionKind>> &KnownSections,
     const MCSection *StrSection, const MCSection *StrOffsetSection,
     const MCSection *TypesSection, const MCSection *CUIndexSection,
@@ -80,17 +80,17 @@ Error handleSection(
     StringRef &CurCUIndexSection, StringRef &CurTUIndexSection,
     std::vector<std::pair<DWARFSectionKind, uint32_t>> &SectionLength);
 
-Expected<InfoSectionUnitHeader> parseInfoSectionUnitHeader(StringRef Info);
+LLVM_FUNC_ABI Expected<InfoSectionUnitHeader> parseInfoSectionUnitHeader(StringRef Info);
 
-void writeStringsAndOffsets(MCStreamer &Out, DWPStringPool &Strings,
+LLVM_FUNC_ABI void writeStringsAndOffsets(MCStreamer &Out, DWPStringPool &Strings,
                             MCSection *StrOffsetSection,
                             StringRef CurStrSection,
                             StringRef CurStrOffsetSection, uint16_t Version);
 
-Error buildDuplicateError(const std::pair<uint64_t, UnitIndexEntry> &PrevE,
+LLVM_FUNC_ABI Error buildDuplicateError(const std::pair<uint64_t, UnitIndexEntry> &PrevE,
                           const CompileUnitIdentifiers &ID, StringRef DWPName);
 
-void writeIndex(MCStreamer &Out, MCSection *Section,
+LLVM_FUNC_ABI void writeIndex(MCStreamer &Out, MCSection *Section,
                 ArrayRef<unsigned> ContributionOffsets,
                 const MapVector<uint64_t, UnitIndexEntry> &IndexEntries,
                 uint32_t IndexVersion);
diff --git a/llvm/include/llvm/DWP/DWPError.h b/llvm/include/llvm/DWP/DWPError.h
index da8c8406dcf17ce..efb0b6ac904ec0c 100644
--- a/llvm/include/llvm/DWP/DWPError.h
+++ b/llvm/include/llvm/DWP/DWPError.h
@@ -7,7 +7,7 @@
 #include <string>
 
 namespace llvm {
-class DWPError : public ErrorInfo<DWPError> {
+class LLVM_CLASS_ABI DWPError : public ErrorInfo<DWPError> {
 public:
   DWPError(std::string Info) : Info(std::move(Info)) {}
   void log(raw_ostream &OS) const override { OS << Info; }
diff --git a/llvm/include/llvm/DWP/DWPStringPool.h b/llvm/include/llvm/DWP/DWPStringPool.h
index 6234be924dae4d7..4f269308cdda996 100644
--- a/llvm/include/llvm/DWP/DWPStringPool.h
+++ b/llvm/include/llvm/DWP/DWPStringPool.h
@@ -8,7 +8,7 @@
 #include <cassert>
 
 namespace llvm {
-class DWPStringPool {
+class LLVM_CLASS_ABI DWPStringPool {
 
   struct CStrDenseMapInfo {
     static inline const char *getEmptyKey() {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
index 945c5609c6ca4f5..c1516dd37de0fe4 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/AppendingTypeTableBuilder.h
@@ -24,7 +24,7 @@ namespace codeview {
 
 class ContinuationRecordBuilder;
 
-class AppendingTypeTableBuilder : public TypeCollection {
+class LLVM_CLASS_ABI AppendingTypeTableBuilder : public TypeCollection {
 
   BumpPtrAllocator &RecordStorage;
   SimpleTypeSerializer SimpleSerializer;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h b/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
index 025db3b0b19aaca..a25cdfa8d3f9d26 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
@@ -27,7 +27,7 @@ namespace codeview {
 /// CVRecord is a fat pointer (base + size pair) to a symbol or type record.
 /// Carrying the size separately instead of trusting the size stored in the
 /// record prefix provides some extra safety and flexibility.
-template <typename Kind> class CVRecord {
+template <typename Kind> class LLVM_CLASS_ABI CVRecord {
 public:
   CVRecord() = default;
 
@@ -111,7 +111,7 @@ inline Expected<CVRecord<Kind>> readCVRecordFromStream(BinaryStreamRef Stream,
 } // end namespace codeview
 
 template <typename Kind>
-struct VarStreamArrayExtractor<codeview::CVRecord<Kind>> {
+struct LLVM_CLASS_ABI VarStreamArrayExtractor<codeview::CVRecord<Kind>> {
   Error operator()(BinaryStreamRef Stream, uint32_t &Len,
                    codeview::CVRecord<Kind> &Item) {
     auto ExpectedRec = codeview::readCVRecordFromStream<Kind>(Stream, 0);
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
index 28a98e03d5ab607..d6a7d90da896edd 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVSymbolVisitor.h
@@ -17,7 +17,7 @@ namespace llvm {
 namespace codeview {
 class SymbolVisitorCallbacks;
 
-class CVSymbolVisitor {
+class LLVM_CLASS_ABI CVSymbolVisitor {
 public:
   struct FilterOptions {
     std::optional<uint32_t> SymbolOffset;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
index ce9467760eb3192..aca6404a1915b1e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
@@ -31,24 +31,24 @@ enum VisitorDataSource {
                     // supply the bytes.
 };
 
-Error visitTypeRecord(CVType &Record, TypeIndex Index,
+LLVM_FUNC_ABI Error visitTypeRecord(CVType &Record, TypeIndex Index,
                       TypeVisitorCallbacks &Callbacks,
                       VisitorDataSource Source = VDS_BytesPresent);
-Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
+LLVM_FUNC_ABI Error visitTypeRecord(CVType &Record, TypeVisitorCallbacks &Callbacks,
                       VisitorDataSource Source = VDS_BytesPresent);
 
-Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks,
+LLVM_FUNC_ABI Error visitMemberRecord(CVMemberRecord Record, TypeVisitorCallbacks &Callbacks,
                         VisitorDataSource Source = VDS_BytesPresent);
-Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
+LLVM_FUNC_ABI Error visitMemberRecord(TypeLeafKind Kind, ArrayRef<uint8_t> Record,
                         TypeVisitorCallbacks &Callbacks);
 
-Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
+LLVM_FUNC_ABI Error visitMemberRecordStream(ArrayRef<uint8_t> FieldList,
                               TypeVisitorCallbacks &Callbacks);
 
-Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks,
+LLVM_FUNC_ABI Error visitTypeStream(const CVTypeArray &Types, TypeVisitorCallbacks &Callbacks,
                       VisitorDataSource Source = VDS_BytesPresent);
-Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks);
-Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks);
+LLVM_FUNC_ABI Error visitTypeStream(CVTypeRange Types, TypeVisitorCallbacks &Callbacks);
+LLVM_FUNC_ABI Error visitTypeStream(TypeCollection &Types, TypeVisitorCallbacks &Callbacks);
 
 } // end namespace codeview
 } // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
index ac09772ca0b4630..7499e04c873acce 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeView.h
@@ -529,7 +529,7 @@ enum class RegisterId : uint16_t {
 
 // Register Ids are shared between architectures in CodeView. CPUType is needed
 // to map register Id to name.
-struct CPURegister {
+struct LLVM_CLASS_ABI CPURegister {
   CPURegister() = delete;
   CPURegister(CPUType Cpu, codeview::RegisterId Reg) {
     this->Cpu = Cpu;
@@ -548,9 +548,9 @@ enum class EncodedFramePtrReg : uint8_t {
   BasePtr = 3,
 };
 
-RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU);
+LLVM_FUNC_ABI RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU);
 
-EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
+LLVM_FUNC_ABI EncodedFramePtrReg encodeFramePtrReg(RegisterId Reg, CPUType CPU);
 
 /// These values correspond to the THUNK_ORDINAL enumeration.
 enum class ThunkOrdinal : uint8_t {
@@ -574,7 +574,7 @@ enum LineFlags : uint16_t {
 };
 
 /// Data in the SUBSEC_FRAMEDATA subection.
-struct FrameData {
+struct LLVM_CLASS_ABI FrameData {
   support::ulittle32_t RvaStart;
   support::ulittle32_t CodeSize;
   support::ulittle32_t LocalSize;
@@ -598,12 +598,12 @@ struct FrameData {
 // IDs may clash between the various compile time PDBs.  For each affected
 // module, a subsection would be put into the PDB containing a mapping from its
 // local IDs to a single ID namespace for all items in the PDB file.
-struct CrossModuleExport {
+struct LLVM_CLASS_ABI CrossModuleExport {
   support::ulittle32_t Local;
   support::ulittle32_t Global;
 };
 
-struct CrossModuleImport {
+struct LLVM_CLASS_ABI CrossModuleImport {
   support::ulittle32_t ModuleNameOffset;
   support::ulittle32_t Count; // Number of elements
   // support::ulittle32_t ids[Count]; // id from referenced module
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
index 4f59e182a3d3a66..096a1cfebe8a358 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewError.h
@@ -27,19 +27,19 @@ enum class cv_error_code {
 
 namespace std {
 template <>
-struct is_error_code_enum<llvm::codeview::cv_error_code> : std::true_type {};
+struct LLVM_CLASS_ABI is_error_code_enum<llvm::codeview::cv_error_code> : std::true_type {};
 } // namespace std
 
 namespace llvm {
 namespace codeview {
-const std::error_category &CVErrorCategory();
+LLVM_FUNC_ABI const std::error_category &CVErrorCategory();
 
 inline std::error_code make_error_code(cv_error_code E) {
   return std::error_code(static_cast<int>(E), CVErrorCategory());
 }
 
 /// Base class for errors originating when parsing raw PDB files
-class CodeViewError : public ErrorInfo<CodeViewError, StringError> {
+class LLVM_CLASS_ABI CodeViewError : public ErrorInfo<CodeViewError, StringError> {
 public:
   using ErrorInfo<CodeViewError,
                   StringError>::ErrorInfo; // inherit constructors
diff --git a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
index fc6bbb1ba5a1d21..da4f9ab1fd75934 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
@@ -29,7 +29,7 @@ namespace codeview {
 class TypeIndex;
 struct GUID;
 
-class CodeViewRecordStreamer {
+class LLVM_CLASS_ABI CodeViewRecordStreamer {
 public:
   virtual void emitBytes(StringRef Data) = 0;
   virtual void emitIntValue(uint64_t Value, unsigned Size) = 0;
@@ -41,7 +41,7 @@ class CodeViewRecordStreamer {
   virtual ~CodeViewRecordStreamer() = default;
 };
 
-class CodeViewRecordIO {
+class LLVM_CLASS_ABI CodeViewRecordIO {
   uint32_t getCurrentOffset() const {
     if (isWriting())
       return Writer->getOffset();
diff --git a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
index 90ec227748d3b84..06a33cba2f95fcd 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/ContinuationRecordBuilder.h
@@ -24,7 +24,7 @@ namespace codeview {
 class TypeIndex;
 enum class ContinuationRecordKind { FieldList, MethodOverloadList };
 
-class ContinuationRecordBuilder {
+class LLVM_CLASS_ABI ContinuationRecordBuilder {
   SmallVector<uint32_t, 4> SegmentOffsets;
   std::optional<ContinuationRecordKind> Kind;
   AppendingBinaryByteStream Buffer;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
index 89f9496e1f82608..f4c5d00ff243f12 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h
@@ -31,7 +31,7 @@ namespace codeview {
 
 class DebugStringTableSubsection;
 
-struct FileChecksumEntry {
+struct LLVM_CLASS_ABI FileChecksumEntry {
   uint32_t FileNameOffset;    // Byte offset of filename in global stringtable.
   FileChecksumKind Kind;      // The type of checksum.
   ArrayRef<uint8_t> Checksum; // The bytes of the checksum.
@@ -39,7 +39,7 @@ struct FileChecksumEntry {
 
 } // end namespace codeview
 
-template <> struct VarStreamArrayExtractor<codeview::FileChecksumEntry> {
+template <> struct LLVM_CLASS_ABI VarStreamArrayExtractor<codeview::FileChecksumEntry> {
 public:
   using ContextType = void;
 
@@ -49,7 +49,7 @@ template <> struct VarStreamArrayExtractor<codeview::FileChecksumEntry> {
 
 namespace codeview {
 
-class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
   using FileChecksumArray = VarStreamArray<codeview::FileChecksumEntry>;
   using Iterator = FileChecksumArray::Iterator;
 
@@ -75,7 +75,7 @@ class DebugChecksumsSubsectionRef final : public DebugSubsectionRef {
   FileChecksumArray Checksums;
 };
 
-class DebugChecksumsSubsection final : public DebugSubsection {
+class LLVM_CLASS_ABI DebugChecksumsSubsection final : public DebugSubsection {
 public:
   explicit DebugChecksumsSubsection(DebugStringTableSubsection &Strings);
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
index fe2acc5c725127f..49044e7c8042469 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossExSubsection.h
@@ -23,7 +23,7 @@ class BinaryStreamReader;
 class BinaryStreamWriter;
 namespace codeview {
 
-class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
   using ReferenceArray = FixedStreamArray<CrossModuleExport>;
   using Iterator = ReferenceArray::Iterator;
 
@@ -45,7 +45,7 @@ class DebugCrossModuleExportsSubsectionRef final : public DebugSubsectionRef {
   FixedStreamArray<CrossModuleExport> References;
 };
 
-class DebugCrossModuleExportsSubsection final : public DebugSubsection {
+class LLVM_CLASS_ABI DebugCrossModuleExportsSubsection final : public DebugSubsection {
 public:
   DebugCrossModuleExportsSubsection()
       : DebugSubsection(DebugSubsectionKind::CrossScopeExports) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
index b2dd04684384b69..71273ce1d595332 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugCrossImpSubsection.h
@@ -27,14 +27,14 @@ class BinaryStreamWriter;
 
 namespace codeview {
 
-struct CrossModuleImportItem {
+struct LLVM_CLASS_ABI CrossModuleImportItem {
   const CrossModuleImport *Header = nullptr;
   FixedStreamArray<support::ulittle32_t> Imports;
 };
 
 } // end namespace codeview
 
-template <> struct VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
+template <> struct LLVM_CLASS_ABI VarStreamArrayExtractor<codeview::CrossModuleImportItem> {
 public:
   using ContextType = void;
 
@@ -46,7 +46,7 @@ namespace codeview {
 
 class DebugStringTableSubsection;
 
-class DebugCrossModuleImportsSubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugCrossModuleImportsSubsectionRef final : public DebugSubsectionRef {
   using ReferenceArray = VarStreamArray<CrossModuleImportItem>;
   using Iterator = ReferenceArray::Iterator;
 
@@ -68,7 +68,7 @@ class DebugCrossModuleImportsSubsectionRef final : public DebugSubsectionRef {
   ReferenceArray References;
 };
 
-class DebugCrossModuleImportsSubsection final : public DebugSubsection {
+class LLVM_CLASS_ABI DebugCrossModuleImportsSubsection final : public DebugSubsection {
 public:
   explicit DebugCrossModuleImportsSubsection(
       DebugStringTableSubsection &Strings)
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
index 9c80dc00bdcd7df..be6790604cb82a3 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugFrameDataSubsection.h
@@ -22,7 +22,7 @@ class BinaryStreamReader;
 class BinaryStreamWriter;
 
 namespace codeview {
-class DebugFrameDataSubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugFrameDataSubsectionRef final : public DebugSubsectionRef {
 public:
   DebugFrameDataSubsectionRef()
       : DebugSubsectionRef(DebugSubsectionKind::FrameData) {}
@@ -43,7 +43,7 @@ class DebugFrameDataSubsectionRef final : public DebugSubsectionRef {
   FixedStreamArray<FrameData> Frames;
 };
 
-class DebugFrameDataSubsection final : public DebugSubsection {
+class LLVM_CLASS_ABI DebugFrameDataSubsection final : public DebugSubsection {
 public:
   DebugFrameDataSubsection(bool IncludeRelocPtr)
       : DebugSubsection(DebugSubsectionKind::FrameData),
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
index 064a38c96cab3c9..4578162f53db0cd 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h
@@ -33,7 +33,7 @@ enum class InlineeLinesSignature : uint32_t {
   ExtraFiles // CV_INLINEE_SOURCE_LINE_SIGNATURE_EX
 };
 
-struct InlineeSourceLineHeader {
+struct LLVM_CLASS_ABI InlineeSourceLineHeader {
   TypeIndex Inlinee;                  // ID of the function that was inlined.
   support::ulittle32_t FileID;        // Offset into FileChecksums subsection.
   support::ulittle32_t SourceLineNum; // First line of inlined code.
@@ -42,14 +42,14 @@ struct InlineeSourceLineHeader {
                                       //   ulittle32_t Files[];
 };
 
-struct InlineeSourceLine {
+struct LLVM_CLASS_ABI InlineeSourceLine {
   const InlineeSourceLineHeader *Header;
   FixedStreamArray<support::ulittle32_t> ExtraFiles;
 };
 
 } // end namespace codeview
 
-template <> struct VarStreamArrayExtractor<codeview::InlineeSourceLine> {
+template <> struct LLVM_CLASS_ABI VarStreamArrayExtractor<codeview::InlineeSourceLine> {
   Error operator()(BinaryStreamRef Stream, uint32_t &Len,
                    codeview::InlineeSourceLine &Item);
 
@@ -58,7 +58,7 @@ template <> struct VarStreamArrayExtractor<codeview::InlineeSourceLine> {
 
 namespace codeview {
 
-class DebugInlineeLinesSubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugInlineeLinesSubsectionRef final : public DebugSubsectionRef {
   using LinesArray = VarStreamArray<InlineeSourceLine>;
   using Iterator = LinesArray::Iterator;
 
@@ -85,7 +85,7 @@ class DebugInlineeLinesSubsectionRef final : public DebugSubsectionRef {
   LinesArray Lines;
 };
 
-class DebugInlineeLinesSubsection final : public DebugSubsection {
+class LLVM_CLASS_ABI DebugInlineeLinesSubsection final : public DebugSubsection {
 public:
   struct Entry {
     std::vector<support::ulittle32_t> ExtraFiles;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
index a5748510ca73f4f..9b886e702efa187 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugLinesSubsection.h
@@ -30,7 +30,7 @@ class DebugChecksumsSubsection;
 class DebugStringTableSubsection;
 
 // Corresponds to the `CV_DebugSLinesHeader_t` structure.
-struct LineFragmentHeader {
+struct LLVM_CLASS_ABI LineFragmentHeader {
   support::ulittle32_t RelocOffset;  // Code offset of line contribution.
   support::ulittle16_t RelocSegment; // Code segment of line contribution.
   support::ulittle16_t Flags;        // See LineFlags enumeration.
@@ -38,7 +38,7 @@ struct LineFragmentHeader {
 };
 
 // Corresponds to the `CV_DebugSLinesFileBlockHeader_t` structure.
-struct LineBlockFragmentHeader {
+struct LLVM_CLASS_ABI LineBlockFragmentHeader {
   support::ulittle32_t NameIndex; // Offset of FileChecksum entry in File
                                   // checksums buffer.  The checksum entry then
                                   // contains another offset into the string
@@ -52,24 +52,24 @@ struct LineBlockFragmentHeader {
 };
 
 // Corresponds to `CV_Line_t` structure
-struct LineNumberEntry {
+struct LLVM_CLASS_ABI LineNumberEntry {
   support::ulittle32_t Offset; // Offset to start of code bytes for line number
   support::ulittle32_t Flags;  // Start:24, End:7, IsStatement:1
 };
 
 // Corresponds to `CV_Column_t` structure
-struct ColumnNumberEntry {
+struct LLVM_CLASS_ABI ColumnNumberEntry {
   support::ulittle16_t StartColumn;
   support::ulittle16_t EndColumn;
 };
 
-struct LineColumnEntry {
+struct LLVM_CLASS_ABI LineColumnEntry {
   support::ulittle32_t NameIndex;
   FixedStreamArray<LineNumberEntry> LineNumbers;
   FixedStreamArray<ColumnNumberEntry> Columns;
 };
 
-class LineColumnExtractor {
+class LLVM_CLASS_ABI LineColumnExtractor {
 public:
   Error operator()(BinaryStreamRef Stream, uint32_t &Len,
                    LineColumnEntry &Item);
@@ -77,7 +77,7 @@ class LineColumnExtractor {
   const LineFragmentHeader *Header = nullptr;
 };
 
-class DebugLinesSubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugLinesSubsectionRef final : public DebugSubsectionRef {
   friend class LineColumnExtractor;
 
   using LineInfoArray = VarStreamArray<LineColumnEntry, LineColumnExtractor>;
@@ -104,7 +104,7 @@ class DebugLinesSubsectionRef final : public DebugSubsectionRef {
   LineInfoArray LinesAndColumns;
 };
 
-class DebugLinesSubsection final : public DebugSubsection {
+class LLVM_CLASS_ABI DebugLinesSubsection final : public DebugSubsection {
   struct Block {
     Block(uint32_t ChecksumBufferOffset)
         : ChecksumBufferOffset(ChecksumBufferOffset) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
index bb3054a431a3532..4ded7818b546a35 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugStringTableSubsection.h
@@ -29,7 +29,7 @@ namespace codeview {
 /// simple flat buffer consisting of null-terminated strings, where strings
 /// are retrieved by their offset in the buffer.  DebugStringTableSubsectionRef
 /// does not own the underlying storage for the buffer.
-class DebugStringTableSubsectionRef : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugStringTableSubsectionRef : public DebugSubsectionRef {
 public:
   DebugStringTableSubsectionRef();
 
@@ -54,7 +54,7 @@ class DebugStringTableSubsectionRef : public DebugSubsectionRef {
 /// DebugStringTableSubsection owns the underlying storage for the table, and is
 /// capable of serializing the string table into a format understood by
 /// DebugStringTableSubsectionRef.
-class DebugStringTableSubsection : public DebugSubsection {
+class LLVM_CLASS_ABI DebugStringTableSubsection : public DebugSubsection {
 public:
   DebugStringTableSubsection();
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h
index 5e7e8d8135d387e..5a598966de7e7b1 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsection.h
@@ -19,7 +19,7 @@ namespace llvm {
 class BinaryStreamWriter;
 namespace codeview {
 
-class DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugSubsectionRef {
 public:
   explicit DebugSubsectionRef(DebugSubsectionKind Kind) : Kind(Kind) {}
   virtual ~DebugSubsectionRef();
@@ -32,7 +32,7 @@ class DebugSubsectionRef {
   DebugSubsectionKind Kind;
 };
 
-class DebugSubsection {
+class LLVM_CLASS_ABI DebugSubsection {
 public:
   explicit DebugSubsection(DebugSubsectionKind Kind) : Kind(Kind) {}
   virtual ~DebugSubsection();
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
index e0c3ecbc4a3fb01..235df4aaf9a6213 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionRecord.h
@@ -28,12 +28,12 @@ namespace codeview {
 class DebugSubsection;
 
 // Corresponds to the `CV_DebugSSubsectionHeader_t` structure.
-struct DebugSubsectionHeader {
+struct LLVM_CLASS_ABI DebugSubsectionHeader {
   support::ulittle32_t Kind;   // codeview::DebugSubsectionKind enum
   support::ulittle32_t Length; // number of bytes occupied by this record.
 };
 
-class DebugSubsectionRecord {
+class LLVM_CLASS_ABI DebugSubsectionRecord {
 public:
   DebugSubsectionRecord();
   DebugSubsectionRecord(DebugSubsectionKind Kind, BinaryStreamRef Data);
@@ -49,7 +49,7 @@ class DebugSubsectionRecord {
   BinaryStreamRef Data;
 };
 
-class DebugSubsectionRecordBuilder {
+class LLVM_CLASS_ABI DebugSubsectionRecordBuilder {
 public:
   DebugSubsectionRecordBuilder(std::shared_ptr<DebugSubsection> Subsection);
 
@@ -72,7 +72,7 @@ class DebugSubsectionRecordBuilder {
 
 } // end namespace codeview
 
-template <> struct VarStreamArrayExtractor<codeview::DebugSubsectionRecord> {
+template <> struct LLVM_CLASS_ABI VarStreamArrayExtractor<codeview::DebugSubsectionRecord> {
   Error operator()(BinaryStreamRef Stream, uint32_t &Length,
                    codeview::DebugSubsectionRecord &Info) {
     // FIXME: We need to pass the container type through to this function.  In
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
index 67c7856ee8fa093..f9faa1280a82be1 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSubsectionVisitor.h
@@ -29,7 +29,7 @@ class DebugSymbolRVASubsectionRef;
 class DebugSymbolsSubsectionRef;
 class DebugUnknownSubsectionRef;
 
-class DebugSubsectionVisitor {
+class LLVM_CLASS_ABI DebugSubsectionVisitor {
 public:
   virtual ~DebugSubsectionVisitor() = default;
 
@@ -61,7 +61,7 @@ class DebugSubsectionVisitor {
                                     const StringsAndChecksumsRef &State) = 0;
 };
 
-Error visitDebugSubsection(const DebugSubsectionRecord &R,
+LLVM_FUNC_ABI Error visitDebugSubsection(const DebugSubsectionRecord &R,
                            DebugSubsectionVisitor &V,
                            const StringsAndChecksumsRef &State);
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
index 034e82b113359f1..04b61b95e496b21 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolRVASubsection.h
@@ -24,7 +24,7 @@ class BinaryStreamReader;
 
 namespace codeview {
 
-class DebugSymbolRVASubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugSymbolRVASubsectionRef final : public DebugSubsectionRef {
 public:
   using ArrayType = FixedStreamArray<support::ulittle32_t>;
 
@@ -43,7 +43,7 @@ class DebugSymbolRVASubsectionRef final : public DebugSubsectionRef {
   ArrayType RVAs;
 };
 
-class DebugSymbolRVASubsection final : public DebugSubsection {
+class LLVM_CLASS_ABI DebugSymbolRVASubsection final : public DebugSubsection {
 public:
   DebugSymbolRVASubsection();
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
index 006a0a59220b0a5..9d18e15a1b9e437 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugSymbolsSubsection.h
@@ -16,7 +16,7 @@
 
 namespace llvm {
 namespace codeview {
-class DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
 public:
   DebugSymbolsSubsectionRef()
       : DebugSubsectionRef(DebugSubsectionKind::Symbols) {}
@@ -34,7 +34,7 @@ class DebugSymbolsSubsectionRef final : public DebugSubsectionRef {
   CVSymbolArray Records;
 };
 
-class DebugSymbolsSubsection final : public DebugSubsection {
+class LLVM_CLASS_ABI DebugSymbolsSubsection final : public DebugSubsection {
 public:
   DebugSymbolsSubsection() : DebugSubsection(DebugSubsectionKind::Symbols) {}
   static bool classof(const DebugSubsection *S) {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h b/llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
index ff6c1253edc50f6..72201f35a96b523 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/DebugUnknownSubsection.h
@@ -16,7 +16,7 @@
 namespace llvm {
 namespace codeview {
 
-class DebugUnknownSubsectionRef final : public DebugSubsectionRef {
+class LLVM_CLASS_ABI DebugUnknownSubsectionRef final : public DebugSubsectionRef {
 public:
   DebugUnknownSubsectionRef(DebugSubsectionKind Kind, BinaryStreamRef Data)
       : DebugSubsectionRef(Kind), Data(Data) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h b/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h
index 62a0cb60e38117e..55ecc081c33382b 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/EnumTables.h
@@ -19,36 +19,36 @@ namespace llvm {
 template <typename T> struct EnumEntry;
 namespace codeview {
 
-ArrayRef<EnumEntry<SymbolKind>> getSymbolTypeNames();
-ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames();
-ArrayRef<EnumEntry<uint16_t>> getRegisterNames(CPUType Cpu);
-ArrayRef<EnumEntry<uint32_t>> getPublicSymFlagNames();
-ArrayRef<EnumEntry<uint8_t>> getProcSymFlagNames();
-ArrayRef<EnumEntry<uint16_t>> getLocalFlagNames();
-ArrayRef<EnumEntry<uint8_t>> getFrameCookieKindNames();
-ArrayRef<EnumEntry<SourceLanguage>> getSourceLanguageNames();
-ArrayRef<EnumEntry<uint32_t>> getCompileSym2FlagNames();
-ArrayRef<EnumEntry<uint32_t>> getCompileSym3FlagNames();
-ArrayRef<EnumEntry<uint32_t>> getFileChecksumNames();
-ArrayRef<EnumEntry<unsigned>> getCPUTypeNames();
-ArrayRef<EnumEntry<uint32_t>> getFrameProcSymFlagNames();
-ArrayRef<EnumEntry<uint16_t>> getExportSymFlagNames();
-ArrayRef<EnumEntry<uint32_t>> getModuleSubstreamKindNames();
-ArrayRef<EnumEntry<uint8_t>> getThunkOrdinalNames();
-ArrayRef<EnumEntry<uint16_t>> getTrampolineNames();
-ArrayRef<EnumEntry<COFF::SectionCharacteristics>>
+LLVM_FUNC_ABI ArrayRef<EnumEntry<SymbolKind>> getSymbolTypeNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<TypeLeafKind>> getTypeLeafNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getRegisterNames(CPUType Cpu);
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint32_t>> getPublicSymFlagNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint8_t>> getProcSymFlagNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getLocalFlagNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint8_t>> getFrameCookieKindNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<SourceLanguage>> getSourceLanguageNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint32_t>> getCompileSym2FlagNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint32_t>> getCompileSym3FlagNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint32_t>> getFileChecksumNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<unsigned>> getCPUTypeNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint32_t>> getFrameProcSymFlagNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getExportSymFlagNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint32_t>> getModuleSubstreamKindNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint8_t>> getThunkOrdinalNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getTrampolineNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<COFF::SectionCharacteristics>>
 getImageSectionCharacteristicNames();
-ArrayRef<EnumEntry<uint16_t>> getClassOptionNames();
-ArrayRef<EnumEntry<uint8_t>> getMemberAccessNames();
-ArrayRef<EnumEntry<uint16_t>> getMethodOptionNames();
-ArrayRef<EnumEntry<uint16_t>> getMemberKindNames();
-ArrayRef<EnumEntry<uint8_t>> getPtrKindNames();
-ArrayRef<EnumEntry<uint8_t>> getPtrModeNames();
-ArrayRef<EnumEntry<uint16_t>> getPtrMemberRepNames();
-ArrayRef<EnumEntry<uint16_t>> getTypeModifierNames();
-ArrayRef<EnumEntry<uint8_t>> getCallingConventions();
-ArrayRef<EnumEntry<uint8_t>> getFunctionOptionEnum();
-ArrayRef<EnumEntry<uint16_t>> getLabelTypeEnum();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getClassOptionNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint8_t>> getMemberAccessNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getMethodOptionNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getMemberKindNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint8_t>> getPtrKindNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint8_t>> getPtrModeNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getPtrMemberRepNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getTypeModifierNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint8_t>> getCallingConventions();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint8_t>> getFunctionOptionEnum();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getLabelTypeEnum();
 
 } // end namespace codeview
 } // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/Formatters.h b/llvm/include/llvm/DebugInfo/CodeView/Formatters.h
index 91c93b03a92ae1e..71d3a1ac6de1874 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/Formatters.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/Formatters.h
@@ -27,7 +27,7 @@ struct GUID;
 
 namespace detail {
 
-class GuidAdapter final : public FormatAdapter<ArrayRef<uint8_t>> {
+class LLVM_CLASS_ABI GuidAdapter final : public FormatAdapter<ArrayRef<uint8_t>> {
   ArrayRef<uint8_t> Guid;
 
 public:
@@ -49,7 +49,7 @@ inline detail::GuidAdapter fmt_guid(ArrayRef<uint8_t> Item) {
 
 } // end namespace codeview
 
-template <> struct format_provider<codeview::TypeIndex> {
+template <> struct LLVM_CLASS_ABI format_provider<codeview::TypeIndex> {
 public:
   static void format(const codeview::TypeIndex &V, raw_ostream &Stream,
                      StringRef Style) {
@@ -63,7 +63,7 @@ template <> struct format_provider<codeview::TypeIndex> {
   }
 };
 
-template <> struct format_provider<codeview::GUID> {
+template <> struct LLVM_CLASS_ABI format_provider<codeview::GUID> {
   static void format(const codeview::GUID &V, llvm::raw_ostream &Stream,
                      StringRef Style) {
     Stream << V;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/GUID.h b/llvm/include/llvm/DebugInfo/CodeView/GUID.h
index 74cc98d33ec1222..0becbc2a781857e 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/GUID.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/GUID.h
@@ -19,7 +19,7 @@ class raw_ostream;
 namespace codeview {
 
 /// This represents the 'GUID' type from windows.h.
-struct GUID {
+struct LLVM_CLASS_ABI GUID {
   uint8_t Guid[16];
 };
 
@@ -47,7 +47,7 @@ inline bool operator!=(const GUID &LHS, const GUID &RHS) {
   return !(LHS == RHS);
 }
 
-raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid);
 
 } // namespace codeview
 } // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
index 840ff27867d9cad..fa329a2b147c26a 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/GlobalTypeTableBuilder.h
@@ -27,7 +27,7 @@ namespace codeview {
 
 class ContinuationRecordBuilder;
 
-class GlobalTypeTableBuilder : public TypeCollection {
+class LLVM_CLASS_ABI GlobalTypeTableBuilder : public TypeCollection {
   /// Storage for records.  These need to outlive the TypeTableBuilder.
   BumpPtrAllocator &RecordStorage;
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h b/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
index d9434411847a485..3e80ba4d88b7966 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h
@@ -46,7 +46,7 @@ namespace codeview {
 /// require more than one linear scan.  For a type stream of N elements divided
 /// into M chunks of roughly equal size, this yields a worst case lookup time
 /// of O(N/M) and an amortized time of O(1).
-class LazyRandomTypeCollection : public TypeCollection {
+class LLVM_CLASS_ABI LazyRandomTypeCollection : public TypeCollection {
   using PartialOffsetArray = FixedStreamArray<TypeIndexOffset>;
 
   struct CacheEntry {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/Line.h b/llvm/include/llvm/DebugInfo/CodeView/Line.h
index a0ac8a94f50cdea..b55fbe95cdd285a 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/Line.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/Line.h
@@ -18,7 +18,7 @@ namespace codeview {
 
 using llvm::support::ulittle32_t;
 
-class LineInfo {
+class LLVM_CLASS_ABI LineInfo {
 public:
   enum : uint32_t {
     AlwaysStepIntoLineNumber = 0xfeefee,
@@ -60,7 +60,7 @@ class LineInfo {
   uint32_t LineData;
 };
 
-class ColumnInfo {
+class LLVM_CLASS_ABI ColumnInfo {
 private:
   static const uint32_t StartColumnMask = 0x0000ffffu;
   static const uint32_t EndColumnMask = 0xffff0000u;
@@ -88,7 +88,7 @@ class ColumnInfo {
   uint32_t ColumnData;
 };
 
-class Line {
+class LLVM_CLASS_ABI Line {
 private:
   int32_t CodeOffset;
   LineInfo LineInf;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h b/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
index f602362c347e6de..da119756a2dd6ab 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/MergingTypeTableBuilder.h
@@ -26,7 +26,7 @@ struct LocallyHashedType;
 
 class ContinuationRecordBuilder;
 
-class MergingTypeTableBuilder : public TypeCollection {
+class LLVM_CLASS_ABI MergingTypeTableBuilder : public TypeCollection {
   /// Storage for records.  These need to outlive the TypeTableBuilder.
   BumpPtrAllocator &RecordStorage;
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/RecordName.h b/llvm/include/llvm/DebugInfo/CodeView/RecordName.h
index 50432f3805b3b07..5c9dee9597fb9f1 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/RecordName.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/RecordName.h
@@ -18,8 +18,8 @@ namespace llvm {
 namespace codeview {
 class TypeCollection;
 class TypeIndex;
-std::string computeTypeName(TypeCollection &Types, TypeIndex Index);
-StringRef getSymbolName(CVSymbol Sym);
+LLVM_FUNC_ABI std::string computeTypeName(TypeCollection &Types, TypeIndex Index);
+LLVM_FUNC_ABI StringRef getSymbolName(CVSymbol Sym);
 } // namespace codeview
 } // namespace llvm
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
index 8f9e13cca2c6fb1..5203b4537fb3707 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
@@ -30,7 +30,7 @@ using llvm::support::ulittle32_t;
 /// RecordPrefix. MSVC does not emit any records larger than this.
 enum : unsigned { MaxRecordLength = 0xFF00 };
 
-struct RecordPrefix {
+struct LLVM_CLASS_ABI RecordPrefix {
   RecordPrefix() = default;
   explicit RecordPrefix(uint16_t Kind) : RecordLen(2), RecordKind(Kind) {}
 
@@ -40,8 +40,8 @@ struct RecordPrefix {
 
 /// Reinterpret a byte array as an array of characters. Does not interpret as
 /// a C string, as StringRef has several helpers (split) that make that easy.
-StringRef getBytesAsCharacters(ArrayRef<uint8_t> LeafData);
-StringRef getBytesAsCString(ArrayRef<uint8_t> LeafData);
+LLVM_FUNC_ABI StringRef getBytesAsCharacters(ArrayRef<uint8_t> LeafData);
+LLVM_FUNC_ABI StringRef getBytesAsCString(ArrayRef<uint8_t> LeafData);
 
 inline Error consume(BinaryStreamReader &Reader) { return Error::success(); }
 
@@ -49,20 +49,20 @@ inline Error consume(BinaryStreamReader &Reader) { return Error::success(); }
 /// the type stream. If the value is positive and less than LF_NUMERIC (1 <<
 /// 15), it is emitted directly in Data. Otherwise, it has a tag like LF_CHAR
 /// that indicates the bitwidth and sign of the numeric data.
-Error consume(BinaryStreamReader &Reader, APSInt &Num);
+LLVM_FUNC_ABI Error consume(BinaryStreamReader &Reader, APSInt &Num);
 
 /// Decodes a numeric leaf value that is known to be a particular type.
-Error consume_numeric(BinaryStreamReader &Reader, uint64_t &Value);
+LLVM_FUNC_ABI Error consume_numeric(BinaryStreamReader &Reader, uint64_t &Value);
 
 /// Decodes signed and unsigned fixed-length integers.
-Error consume(BinaryStreamReader &Reader, uint32_t &Item);
-Error consume(BinaryStreamReader &Reader, int32_t &Item);
+LLVM_FUNC_ABI Error consume(BinaryStreamReader &Reader, uint32_t &Item);
+LLVM_FUNC_ABI Error consume(BinaryStreamReader &Reader, int32_t &Item);
 
 /// Decodes a null terminated string.
-Error consume(BinaryStreamReader &Reader, StringRef &Item);
+LLVM_FUNC_ABI Error consume(BinaryStreamReader &Reader, StringRef &Item);
 
-Error consume(StringRef &Data, APSInt &Num);
-Error consume(StringRef &Data, uint32_t &Item);
+LLVM_FUNC_ABI Error consume(StringRef &Data, APSInt &Num);
+LLVM_FUNC_ABI Error consume(StringRef &Data, uint32_t &Item);
 
 /// Decodes an arbitrary object whose layout matches that of the underlying
 /// byte sequence, and returns a pointer to the object.
@@ -70,7 +70,7 @@ template <typename T> Error consume(BinaryStreamReader &Reader, T *&Item) {
   return Reader.readObject(Item);
 }
 
-template <typename T, typename U> struct serialize_conditional_impl {
+template <typename T, typename U> struct LLVM_CLASS_ABI serialize_conditional_impl {
   serialize_conditional_impl(T &Item, U Func) : Item(Item), Func(Func) {}
 
   Error deserialize(BinaryStreamReader &Reader) const {
@@ -88,7 +88,7 @@ serialize_conditional_impl<T, U> serialize_conditional(T &Item, U Func) {
   return serialize_conditional_impl<T, U>(Item, Func);
 }
 
-template <typename T, typename U> struct serialize_array_impl {
+template <typename T, typename U> struct LLVM_CLASS_ABI serialize_array_impl {
   serialize_array_impl(ArrayRef<T> &Item, U Func) : Item(Item), Func(Func) {}
 
   Error deserialize(BinaryStreamReader &Reader) const {
@@ -99,7 +99,7 @@ template <typename T, typename U> struct serialize_array_impl {
   U Func;
 };
 
-template <typename T> struct serialize_vector_tail_impl {
+template <typename T> struct LLVM_CLASS_ABI serialize_vector_tail_impl {
   serialize_vector_tail_impl(std::vector<T> &Item) : Item(Item) {}
 
   Error deserialize(BinaryStreamReader &Reader) const {
@@ -116,7 +116,7 @@ template <typename T> struct serialize_vector_tail_impl {
   std::vector<T> &Item;
 };
 
-struct serialize_null_term_string_array_impl {
+struct LLVM_CLASS_ABI serialize_null_term_string_array_impl {
   serialize_null_term_string_array_impl(std::vector<StringRef> &Item)
       : Item(Item) {}
 
@@ -137,7 +137,7 @@ struct serialize_null_term_string_array_impl {
   std::vector<StringRef> &Item;
 };
 
-template <typename T> struct serialize_arrayref_tail_impl {
+template <typename T> struct LLVM_CLASS_ABI serialize_arrayref_tail_impl {
   serialize_arrayref_tail_impl(ArrayRef<T> &Item) : Item(Item) {}
 
   Error deserialize(BinaryStreamReader &Reader) const {
@@ -148,7 +148,7 @@ template <typename T> struct serialize_arrayref_tail_impl {
   ArrayRef<T> &Item;
 };
 
-template <typename T> struct serialize_numeric_impl {
+template <typename T> struct LLVM_CLASS_ABI serialize_numeric_impl {
   serialize_numeric_impl(T &Item) : Item(Item) {}
 
   Error deserialize(BinaryStreamReader &Reader) const {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h b/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
index 203813c697500fa..9a48ee5bc6cb1df 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SimpleTypeSerializer.h
@@ -17,7 +17,7 @@ namespace llvm {
 namespace codeview {
 class FieldListRecord;
 
-class SimpleTypeSerializer {
+class LLVM_CLASS_ABI SimpleTypeSerializer {
   std::vector<uint8_t> ScratchBuffer;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h b/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
index 8904ea5043f5f1b..bbb555d97441e65 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/StringsAndChecksums.h
@@ -21,7 +21,7 @@ class DebugChecksumsSubsectionRef;
 class DebugStringTableSubsection;
 class DebugStringTableSubsectionRef;
 
-class StringsAndChecksumsRef {
+class LLVM_CLASS_ABI StringsAndChecksumsRef {
 public:
   // If no subsections are known about initially, we find as much as we can.
   StringsAndChecksumsRef();
@@ -81,7 +81,7 @@ class StringsAndChecksumsRef {
   const DebugChecksumsSubsectionRef *Checksums = nullptr;
 };
 
-class StringsAndChecksums {
+class LLVM_CLASS_ABI StringsAndChecksums {
 public:
   using StringsPtr = std::shared_ptr<DebugStringTableSubsection>;
   using ChecksumsPtr = std::shared_ptr<DebugChecksumsSubsection>;
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
index 48f272e1d77d102..dd5202840c9124d 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
@@ -22,7 +22,7 @@
 namespace llvm {
 namespace codeview {
 class SymbolVisitorDelegate;
-class SymbolDeserializer : public SymbolVisitorCallbacks {
+class LLVM_CLASS_ABI SymbolDeserializer : public SymbolVisitorCallbacks {
   struct MappingInfo {
     MappingInfo(ArrayRef<uint8_t> RecordData, CodeViewContainer Container)
         : Stream(RecordData, llvm::support::little), Reader(Stream),
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
index fddd4cd7652d4cb..4f67a25e3b0b848 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolDumpDelegate.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace codeview {
 
-class SymbolDumpDelegate : public SymbolVisitorDelegate {
+class LLVM_CLASS_ABI SymbolDumpDelegate : public SymbolVisitorDelegate {
 public:
   ~SymbolDumpDelegate() override = default;
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h
index 6c8f875bff25bdb..340a21ab541a12f 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolDumper.h
@@ -25,7 +25,7 @@ namespace codeview {
 class TypeCollection;
 
 /// Dumper for CodeView symbol streams found in COFF object files and PDB files.
-class CVSymbolDumper {
+class LLVM_CLASS_ABI CVSymbolDumper {
 public:
   CVSymbolDumper(ScopedPrinter &W, TypeCollection &Types,
                  CodeViewContainer Container,
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h
index 10b1e6b1cb7365a..fc510d1e7f21764 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h
@@ -27,7 +27,7 @@
 namespace llvm {
 namespace codeview {
 
-class SymbolRecord {
+class LLVM_CLASS_ABI SymbolRecord {
 protected:
   explicit SymbolRecord(SymbolRecordKind Kind) : Kind(Kind) {}
 
@@ -39,7 +39,7 @@ class SymbolRecord {
 
 // S_GPROC32, S_LPROC32, S_GPROC32_ID, S_LPROC32_ID, S_LPROC32_DPC or
 // S_LPROC32_DPC_ID
-class ProcSym : public SymbolRecord {
+class LLVM_CLASS_ABI ProcSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 32;
 
 public:
@@ -67,7 +67,7 @@ class ProcSym : public SymbolRecord {
 };
 
 // S_THUNK32
-class Thunk32Sym : public SymbolRecord {
+class LLVM_CLASS_ABI Thunk32Sym : public SymbolRecord {
 public:
   explicit Thunk32Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
@@ -87,7 +87,7 @@ class Thunk32Sym : public SymbolRecord {
 };
 
 // S_TRAMPOLINE
-class TrampolineSym : public SymbolRecord {
+class LLVM_CLASS_ABI TrampolineSym : public SymbolRecord {
 public:
   explicit TrampolineSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
@@ -104,7 +104,7 @@ class TrampolineSym : public SymbolRecord {
 };
 
 // S_SECTION
-class SectionSym : public SymbolRecord {
+class LLVM_CLASS_ABI SectionSym : public SymbolRecord {
 public:
   explicit SectionSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
@@ -121,7 +121,7 @@ class SectionSym : public SymbolRecord {
 };
 
 // S_COFFGROUP
-class CoffGroupSym : public SymbolRecord {
+class LLVM_CLASS_ABI CoffGroupSym : public SymbolRecord {
 public:
   explicit CoffGroupSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
@@ -136,7 +136,7 @@ class CoffGroupSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-class ScopeEndSym : public SymbolRecord {
+class LLVM_CLASS_ABI ScopeEndSym : public SymbolRecord {
 public:
   explicit ScopeEndSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   ScopeEndSym(SymbolRecordKind Kind, uint32_t RecordOffset)
@@ -145,7 +145,7 @@ class ScopeEndSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-class CallerSym : public SymbolRecord {
+class LLVM_CLASS_ABI CallerSym : public SymbolRecord {
 public:
   explicit CallerSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)
@@ -156,7 +156,7 @@ class CallerSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-struct DecodedAnnotation {
+struct LLVM_CLASS_ABI DecodedAnnotation {
   StringRef Name;
   ArrayRef<uint8_t> Bytes;
   BinaryAnnotationsOpCode OpCode = BinaryAnnotationsOpCode::Invalid;
@@ -165,7 +165,7 @@ struct DecodedAnnotation {
   int32_t S1 = 0;
 };
 
-struct BinaryAnnotationIterator
+struct LLVM_CLASS_ABI BinaryAnnotationIterator
     : public iterator_facade_base<BinaryAnnotationIterator,
                                   std::forward_iterator_tag,
                                   DecodedAnnotation> {
@@ -330,7 +330,7 @@ struct BinaryAnnotationIterator
 };
 
 // S_INLINESITE
-class InlineSiteSym : public SymbolRecord {
+class LLVM_CLASS_ABI InlineSiteSym : public SymbolRecord {
 public:
   explicit InlineSiteSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit InlineSiteSym(uint32_t RecordOffset)
@@ -350,7 +350,7 @@ class InlineSiteSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-struct PublicSym32Header {
+struct LLVM_CLASS_ABI PublicSym32Header {
   ulittle32_t Flags;
   ulittle32_t Offset;
   ulittle16_t Segment;
@@ -358,7 +358,7 @@ struct PublicSym32Header {
 };
 
 // S_PUB32
-class PublicSym32 : public SymbolRecord {
+class LLVM_CLASS_ABI PublicSym32 : public SymbolRecord {
 public:
   PublicSym32() : SymbolRecord(SymbolRecordKind::PublicSym32) {}
   explicit PublicSym32(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
@@ -375,7 +375,7 @@ class PublicSym32 : public SymbolRecord {
 };
 
 // S_REGISTER
-class RegisterSym : public SymbolRecord {
+class LLVM_CLASS_ABI RegisterSym : public SymbolRecord {
 public:
   explicit RegisterSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit RegisterSym(uint32_t RecordOffset)
@@ -390,7 +390,7 @@ class RegisterSym : public SymbolRecord {
 };
 
 // S_PROCREF, S_LPROCREF
-class ProcRefSym : public SymbolRecord {
+class LLVM_CLASS_ABI ProcRefSym : public SymbolRecord {
 public:
   explicit ProcRefSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit ProcRefSym(uint32_t RecordOffset)
@@ -407,7 +407,7 @@ class ProcRefSym : public SymbolRecord {
 };
 
 // S_LOCAL
-class LocalSym : public SymbolRecord {
+class LLVM_CLASS_ABI LocalSym : public SymbolRecord {
 public:
   explicit LocalSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit LocalSym(uint32_t RecordOffset)
@@ -420,13 +420,13 @@ class LocalSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-struct LocalVariableAddrRange {
+struct LLVM_CLASS_ABI LocalVariableAddrRange {
   uint32_t OffsetStart = 0;
   uint16_t ISectStart = 0;
   uint16_t Range = 0;
 };
 
-struct LocalVariableAddrGap {
+struct LLVM_CLASS_ABI LocalVariableAddrGap {
   uint16_t GapStartOffset = 0;
   uint16_t Range = 0;
 };
@@ -434,7 +434,7 @@ struct LocalVariableAddrGap {
 enum : uint16_t { MaxDefRange = 0xf000 };
 
 // S_DEFRANGE
-class DefRangeSym : public SymbolRecord {
+class LLVM_CLASS_ABI DefRangeSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 8;
 
 public:
@@ -455,7 +455,7 @@ class DefRangeSym : public SymbolRecord {
 };
 
 // S_DEFRANGE_SUBFIELD
-class DefRangeSubfieldSym : public SymbolRecord {
+class LLVM_CLASS_ABI DefRangeSubfieldSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 12;
 
 public:
@@ -476,13 +476,13 @@ class DefRangeSubfieldSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-struct DefRangeRegisterHeader {
+struct LLVM_CLASS_ABI DefRangeRegisterHeader {
   ulittle16_t Register;
   ulittle16_t MayHaveNoName;
 };
 
 // S_DEFRANGE_REGISTER
-class DefRangeRegisterSym : public SymbolRecord {
+class LLVM_CLASS_ABI DefRangeRegisterSym : public SymbolRecord {
 public:
   explicit DefRangeRegisterSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit DefRangeRegisterSym(uint32_t RecordOffset)
@@ -498,14 +498,14 @@ class DefRangeRegisterSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-struct DefRangeSubfieldRegisterHeader {
+struct LLVM_CLASS_ABI DefRangeSubfieldRegisterHeader {
   ulittle16_t Register;
   ulittle16_t MayHaveNoName;
   ulittle32_t OffsetInParent;
 };
 
 // S_DEFRANGE_SUBFIELD_REGISTER
-class DefRangeSubfieldRegisterSym : public SymbolRecord {
+class LLVM_CLASS_ABI DefRangeSubfieldRegisterSym : public SymbolRecord {
 public:
   explicit DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
       : SymbolRecord(Kind) {}
@@ -522,12 +522,12 @@ class DefRangeSubfieldRegisterSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-struct DefRangeFramePointerRelHeader {
+struct LLVM_CLASS_ABI DefRangeFramePointerRelHeader {
   little32_t Offset;
 };
 
 // S_DEFRANGE_FRAMEPOINTER_REL
-class DefRangeFramePointerRelSym : public SymbolRecord {
+class LLVM_CLASS_ABI DefRangeFramePointerRelSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 8;
 
 public:
@@ -548,14 +548,14 @@ class DefRangeFramePointerRelSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-struct DefRangeRegisterRelHeader {
+struct LLVM_CLASS_ABI DefRangeRegisterRelHeader {
   ulittle16_t Register;
   ulittle16_t Flags;
   little32_t BasePointerOffset;
 };
 
 // S_DEFRANGE_REGISTER_REL
-class DefRangeRegisterRelSym : public SymbolRecord {
+class LLVM_CLASS_ABI DefRangeRegisterRelSym : public SymbolRecord {
 public:
   explicit DefRangeRegisterRelSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit DefRangeRegisterRelSym(uint32_t RecordOffset)
@@ -584,7 +584,7 @@ class DefRangeRegisterRelSym : public SymbolRecord {
 };
 
 // S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE
-class DefRangeFramePointerRelFullScopeSym : public SymbolRecord {
+class LLVM_CLASS_ABI DefRangeFramePointerRelFullScopeSym : public SymbolRecord {
 public:
   explicit DefRangeFramePointerRelFullScopeSym(SymbolRecordKind Kind)
       : SymbolRecord(Kind) {}
@@ -598,7 +598,7 @@ class DefRangeFramePointerRelFullScopeSym : public SymbolRecord {
 };
 
 // S_BLOCK32
-class BlockSym : public SymbolRecord {
+class LLVM_CLASS_ABI BlockSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 16;
 
 public:
@@ -621,7 +621,7 @@ class BlockSym : public SymbolRecord {
 };
 
 // S_LABEL32
-class LabelSym : public SymbolRecord {
+class LLVM_CLASS_ABI LabelSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 4;
 
 public:
@@ -642,7 +642,7 @@ class LabelSym : public SymbolRecord {
 };
 
 // S_OBJNAME
-class ObjNameSym : public SymbolRecord {
+class LLVM_CLASS_ABI ObjNameSym : public SymbolRecord {
 public:
   explicit ObjNameSym() : SymbolRecord(SymbolRecordKind::ObjNameSym) {}
   explicit ObjNameSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
@@ -657,7 +657,7 @@ class ObjNameSym : public SymbolRecord {
 };
 
 // S_ENVBLOCK
-class EnvBlockSym : public SymbolRecord {
+class LLVM_CLASS_ABI EnvBlockSym : public SymbolRecord {
 public:
   explicit EnvBlockSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit EnvBlockSym(uint32_t RecordOffset)
@@ -670,7 +670,7 @@ class EnvBlockSym : public SymbolRecord {
 };
 
 // S_EXPORT
-class ExportSym : public SymbolRecord {
+class LLVM_CLASS_ABI ExportSym : public SymbolRecord {
 public:
   explicit ExportSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit ExportSym(uint32_t RecordOffset)
@@ -684,7 +684,7 @@ class ExportSym : public SymbolRecord {
 };
 
 // S_FILESTATIC
-class FileStaticSym : public SymbolRecord {
+class LLVM_CLASS_ABI FileStaticSym : public SymbolRecord {
 public:
   explicit FileStaticSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit FileStaticSym(uint32_t RecordOffset)
@@ -700,7 +700,7 @@ class FileStaticSym : public SymbolRecord {
 };
 
 // S_COMPILE2
-class Compile2Sym : public SymbolRecord {
+class LLVM_CLASS_ABI Compile2Sym : public SymbolRecord {
 public:
   explicit Compile2Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit Compile2Sym(uint32_t RecordOffset)
@@ -725,7 +725,7 @@ class Compile2Sym : public SymbolRecord {
 };
 
 // S_COMPILE3
-class Compile3Sym : public SymbolRecord {
+class LLVM_CLASS_ABI Compile3Sym : public SymbolRecord {
 public:
   Compile3Sym() : SymbolRecord(SymbolRecordKind::Compile3Sym) {}
   explicit Compile3Sym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
@@ -765,7 +765,7 @@ class Compile3Sym : public SymbolRecord {
 };
 
 // S_FRAMEPROC
-class FrameProcSym : public SymbolRecord {
+class LLVM_CLASS_ABI FrameProcSym : public SymbolRecord {
 public:
   explicit FrameProcSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit FrameProcSym(uint32_t RecordOffset)
@@ -798,7 +798,7 @@ class FrameProcSym : public SymbolRecord {
 };
 
 // S_CALLSITEINFO
-class CallSiteInfoSym : public SymbolRecord {
+class LLVM_CLASS_ABI CallSiteInfoSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 4;
 
 public:
@@ -818,7 +818,7 @@ class CallSiteInfoSym : public SymbolRecord {
 };
 
 // S_HEAPALLOCSITE
-class HeapAllocationSiteSym : public SymbolRecord {
+class LLVM_CLASS_ABI HeapAllocationSiteSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 4;
 
 public:
@@ -840,7 +840,7 @@ class HeapAllocationSiteSym : public SymbolRecord {
 };
 
 // S_FRAMECOOKIE
-class FrameCookieSym : public SymbolRecord {
+class LLVM_CLASS_ABI FrameCookieSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 4;
 
 public:
@@ -861,7 +861,7 @@ class FrameCookieSym : public SymbolRecord {
 };
 
 // S_UDT, S_COBOLUDT
-class UDTSym : public SymbolRecord {
+class LLVM_CLASS_ABI UDTSym : public SymbolRecord {
 public:
   explicit UDTSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit UDTSym(uint32_t RecordOffset)
@@ -874,7 +874,7 @@ class UDTSym : public SymbolRecord {
 };
 
 // S_BUILDINFO
-class BuildInfoSym : public SymbolRecord {
+class LLVM_CLASS_ABI BuildInfoSym : public SymbolRecord {
 public:
   explicit BuildInfoSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit BuildInfoSym(uint32_t RecordOffset)
@@ -887,7 +887,7 @@ class BuildInfoSym : public SymbolRecord {
 };
 
 // S_BPREL32
-class BPRelativeSym : public SymbolRecord {
+class LLVM_CLASS_ABI BPRelativeSym : public SymbolRecord {
 public:
   explicit BPRelativeSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit BPRelativeSym(uint32_t RecordOffset)
@@ -902,7 +902,7 @@ class BPRelativeSym : public SymbolRecord {
 };
 
 // S_REGREL32
-class RegRelativeSym : public SymbolRecord {
+class LLVM_CLASS_ABI RegRelativeSym : public SymbolRecord {
 public:
   explicit RegRelativeSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit RegRelativeSym(uint32_t RecordOffset)
@@ -918,7 +918,7 @@ class RegRelativeSym : public SymbolRecord {
 };
 
 // S_CONSTANT, S_MANCONSTANT
-class ConstantSym : public SymbolRecord {
+class LLVM_CLASS_ABI ConstantSym : public SymbolRecord {
 public:
   explicit ConstantSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit ConstantSym(uint32_t RecordOffset)
@@ -933,7 +933,7 @@ class ConstantSym : public SymbolRecord {
 };
 
 // S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA
-class DataSym : public SymbolRecord {
+class LLVM_CLASS_ABI DataSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 8;
 
 public:
@@ -954,7 +954,7 @@ class DataSym : public SymbolRecord {
 };
 
 // S_LTHREAD32, S_GTHREAD32
-class ThreadLocalDataSym : public SymbolRecord {
+class LLVM_CLASS_ABI ThreadLocalDataSym : public SymbolRecord {
   static constexpr uint32_t RelocationOffset = 8;
 
 public:
@@ -976,7 +976,7 @@ class ThreadLocalDataSym : public SymbolRecord {
 };
 
 // S_UNAMESPACE
-class UsingNamespaceSym : public SymbolRecord {
+class LLVM_CLASS_ABI UsingNamespaceSym : public SymbolRecord {
 public:
   explicit UsingNamespaceSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit UsingNamespaceSym(uint32_t RecordOffset)
@@ -989,7 +989,7 @@ class UsingNamespaceSym : public SymbolRecord {
 };
 
 // S_ANNOTATION
-class AnnotationSym : public SymbolRecord {
+class LLVM_CLASS_ABI AnnotationSym : public SymbolRecord {
 public:
   explicit AnnotationSym(SymbolRecordKind Kind) : SymbolRecord(Kind) {}
   explicit AnnotationSym(uint32_t RecordOffset)
@@ -1003,7 +1003,7 @@ class AnnotationSym : public SymbolRecord {
   uint32_t RecordOffset = 0;
 };
 
-Expected<CVSymbol> readSymbolFromStream(BinaryStreamRef Stream,
+LLVM_FUNC_ABI Expected<CVSymbol> readSymbolFromStream(BinaryStreamRef Stream,
                                         uint32_t Offset);
 
 } // end namespace codeview
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
index 87ba1d62411a2cb..5f57781fb6a1aaf 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordHelpers.h
@@ -51,10 +51,10 @@ inline bool symbolEndsScope(SymbolKind Kind) {
 
 /// Given a symbol P for which symbolOpensScope(P) == true, return the
 /// corresponding end offset.
-uint32_t getScopeEndOffset(const CVSymbol &Symbol);
-uint32_t getScopeParentOffset(const CVSymbol &Symbol);
+LLVM_FUNC_ABI uint32_t getScopeEndOffset(const CVSymbol &Symbol);
+LLVM_FUNC_ABI uint32_t getScopeParentOffset(const CVSymbol &Symbol);
 
-CVSymbolArray limitSymbolArrayToScope(const CVSymbolArray &Symbols,
+LLVM_FUNC_ABI CVSymbolArray limitSymbolArrayToScope(const CVSymbolArray &Symbols,
                                       uint32_t ScopeBegin);
 
 } // namespace codeview
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
index daf77f2097b78cf..e5375d54aca75b8 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
@@ -18,7 +18,7 @@ class BinaryStreamReader;
 class BinaryStreamWriter;
 
 namespace codeview {
-class SymbolRecordMapping : public SymbolVisitorCallbacks {
+class LLVM_CLASS_ABI SymbolRecordMapping : public SymbolVisitorCallbacks {
 public:
   explicit SymbolRecordMapping(BinaryStreamReader &Reader,
                                CodeViewContainer Container)
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
index 7f9935e5d85d2b1..4ac2525d566446c 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
@@ -26,7 +26,7 @@
 namespace llvm {
 namespace codeview {
 
-class SymbolSerializer : public SymbolVisitorCallbacks {
+class LLVM_CLASS_ABI SymbolSerializer : public SymbolVisitorCallbacks {
   BumpPtrAllocator &Storage;
   // Since this is a fixed size buffer, use a stack allocated buffer.  This
   // yields measurable performance increase over the repeated heap allocations
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
index 17e32083e33bd93..b2d01900792ae99 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace codeview {
 
-class SymbolVisitorCallbackPipeline : public SymbolVisitorCallbacks {
+class LLVM_CLASS_ABI SymbolVisitorCallbackPipeline : public SymbolVisitorCallbacks {
 public:
   SymbolVisitorCallbackPipeline() = default;
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
index 9171e7db37cf10e..0b688391162858c 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
@@ -16,7 +16,7 @@
 namespace llvm {
 namespace codeview {
 
-class SymbolVisitorCallbacks {
+class LLVM_CLASS_ABI SymbolVisitorCallbacks {
   friend class CVSymbolVisitor;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
index 688f0b7eb22b21b..c3642668587a2de 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
@@ -21,7 +21,7 @@ namespace codeview {
 
 class DebugStringTableSubsectionRef;
 
-class SymbolVisitorDelegate {
+class LLVM_CLASS_ABI SymbolVisitorDelegate {
 public:
   virtual ~SymbolVisitorDelegate() = default;
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h b/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h
index a61b3cda11de70e..82382dc2e3af91f 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeCollection.h
@@ -16,7 +16,7 @@
 
 namespace llvm {
 namespace codeview {
-class TypeCollection {
+class LLVM_CLASS_ABI TypeCollection {
 public:
   virtual ~TypeCollection() = default;
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h b/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
index cc97aca3e46df8e..a6403ea45dd00e2 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
@@ -26,7 +26,7 @@
 namespace llvm {
 namespace codeview {
 
-class TypeDeserializer : public TypeVisitorCallbacks {
+class LLVM_CLASS_ABI TypeDeserializer : public TypeVisitorCallbacks {
   struct MappingInfo {
     explicit MappingInfo(ArrayRef<uint8_t> RecordData)
         : Stream(RecordData, llvm::support::little), Reader(Stream),
@@ -100,7 +100,7 @@ class TypeDeserializer : public TypeVisitorCallbacks {
   std::unique_ptr<MappingInfo> Mapping;
 };
 
-class FieldListDeserializer : public TypeVisitorCallbacks {
+class LLVM_CLASS_ABI FieldListDeserializer : public TypeVisitorCallbacks {
   struct MappingInfo {
     explicit MappingInfo(BinaryStreamReader &R)
         : Reader(R), Mapping(Reader), StartOffset(0) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h b/llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
index 8d50e5019b43b54..74dde837ebfbce6 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
@@ -26,7 +26,7 @@ struct MemberAttributes;
 class TypeCollection;
 
 /// Dumper for CodeView type streams found in COFF object files and PDB files.
-class TypeDumpVisitor : public TypeVisitorCallbacks {
+class LLVM_CLASS_ABI TypeDumpVisitor : public TypeVisitorCallbacks {
 public:
   TypeDumpVisitor(TypeCollection &TpiTypes, ScopedPrinter *W,
                   bool PrintRecordBytes)
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h b/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
index 07b0ffdb61f661e..15fdddcf356398c 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h
@@ -32,7 +32,7 @@ namespace codeview {
 /// records within a single sequence of types, because if two records both have
 /// a back-reference to the same type in the same stream, they will both have
 /// the same numeric value for the TypeIndex of the back reference.
-struct LocallyHashedType {
+struct LLVM_CLASS_ABI LocallyHashedType {
   hash_code Hash;
   ArrayRef<uint8_t> RecordData;
 
@@ -78,7 +78,7 @@ enum class GlobalTypeHashAlg : uint16_t {
 /// is considered "as good as" the original type.  Since type records can be
 /// quite large, this makes the equality comparison of the hash much faster than
 /// equality comparison of a full record.
-struct GloballyHashedType {
+struct LLVM_CLASS_ABI GloballyHashedType {
   GloballyHashedType() = default;
   GloballyHashedType(StringRef H)
       : GloballyHashedType(ArrayRef<uint8_t>(H.bytes_begin(), H.bytes_end())) {}
@@ -181,7 +181,7 @@ static_assert(std::is_trivially_copyable<GloballyHashedType>::value,
               "GloballyHashedType");
 } // namespace codeview
 
-template <> struct DenseMapInfo<codeview::LocallyHashedType> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<codeview::LocallyHashedType> {
   static codeview::LocallyHashedType Empty;
   static codeview::LocallyHashedType Tombstone;
 
@@ -201,7 +201,7 @@ template <> struct DenseMapInfo<codeview::LocallyHashedType> {
   }
 };
 
-template <> struct DenseMapInfo<codeview::GloballyHashedType> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<codeview::GloballyHashedType> {
   static codeview::GloballyHashedType Empty;
   static codeview::GloballyHashedType Tombstone;
 
@@ -219,7 +219,7 @@ template <> struct DenseMapInfo<codeview::GloballyHashedType> {
   }
 };
 
-template <> struct format_provider<codeview::LocallyHashedType> {
+template <> struct LLVM_CLASS_ABI format_provider<codeview::LocallyHashedType> {
 public:
   static void format(const codeview::LocallyHashedType &V,
                      llvm::raw_ostream &Stream, StringRef Style) {
@@ -227,7 +227,7 @@ template <> struct format_provider<codeview::LocallyHashedType> {
   }
 };
 
-template <> struct format_provider<codeview::GloballyHashedType> {
+template <> struct LLVM_CLASS_ABI format_provider<codeview::GloballyHashedType> {
 public:
   static void format(const codeview::GloballyHashedType &V,
                      llvm::raw_ostream &Stream, StringRef Style) {
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h b/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
index 2c5f9b63da31d62..4baf1211b29f9e0 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h
@@ -94,7 +94,7 @@ enum class SimpleTypeMode : uint32_t {
 /// A 32-bit type reference. Types are indexed by their order of appearance in
 /// .debug$T plus 0x1000. Type indices less than 0x1000 are "simple" types,
 /// composed of a SimpleTypeMode byte followed by a SimpleTypeKind byte.
-class TypeIndex {
+class LLVM_CLASS_ABI TypeIndex {
 public:
   static const uint32_t FirstNonSimpleIndex = 0x1000;
   static const uint32_t SimpleKindMask = 0x000000ff;
@@ -280,16 +280,16 @@ class TypeIndex {
 // Used for pseudo-indexing an array of type records.  An array of such records
 // sorted by TypeIndex can allow log(N) lookups even though such a type record
 // stream does not provide random access.
-struct TypeIndexOffset {
+struct LLVM_CLASS_ABI TypeIndexOffset {
   TypeIndex Type;
   support::ulittle32_t Offset;
 };
 
-void printTypeIndex(ScopedPrinter &Printer, StringRef FieldName, TypeIndex TI,
+LLVM_FUNC_ABI void printTypeIndex(ScopedPrinter &Printer, StringRef FieldName, TypeIndex TI,
                     TypeCollection &Types);
 }
 
-template <> struct DenseMapInfo<codeview::TypeIndex> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<codeview::TypeIndex> {
   static inline codeview::TypeIndex getEmptyKey() {
     return codeview::TypeIndex{DenseMapInfo<uint32_t>::getEmptyKey()};
   }
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h b/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
index e9cfadf0586ff50..9d052bf2732c18c 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeIndexDiscovery.h
@@ -18,28 +18,28 @@ template <typename T> class SmallVectorImpl;
 namespace codeview {
 class TypeIndex;
 enum class TiRefKind { TypeRef, IndexRef };
-struct TiReference {
+struct LLVM_CLASS_ABI TiReference {
   TiRefKind Kind;
   uint32_t Offset;
   uint32_t Count;
 };
 
-void discoverTypeIndices(ArrayRef<uint8_t> RecordData,
+LLVM_FUNC_ABI void discoverTypeIndices(ArrayRef<uint8_t> RecordData,
                          SmallVectorImpl<TiReference> &Refs);
-void discoverTypeIndices(const CVType &Type,
+LLVM_FUNC_ABI void discoverTypeIndices(const CVType &Type,
                          SmallVectorImpl<TiReference> &Refs);
-void discoverTypeIndices(const CVType &Type,
+LLVM_FUNC_ABI void discoverTypeIndices(const CVType &Type,
                          SmallVectorImpl<TypeIndex> &Indices);
-void discoverTypeIndices(ArrayRef<uint8_t> RecordData,
+LLVM_FUNC_ABI void discoverTypeIndices(ArrayRef<uint8_t> RecordData,
                          SmallVectorImpl<TypeIndex> &Indices);
 
 /// Discover type indices in symbol records. Returns false if this is an unknown
 /// record.
-bool discoverTypeIndicesInSymbol(const CVSymbol &Symbol,
+LLVM_FUNC_ABI bool discoverTypeIndicesInSymbol(const CVSymbol &Symbol,
                                  SmallVectorImpl<TiReference> &Refs);
-bool discoverTypeIndicesInSymbol(ArrayRef<uint8_t> RecordData,
+LLVM_FUNC_ABI bool discoverTypeIndicesInSymbol(ArrayRef<uint8_t> RecordData,
                                  SmallVectorImpl<TiReference> &Refs);
-bool discoverTypeIndicesInSymbol(ArrayRef<uint8_t> RecordData,
+LLVM_FUNC_ABI bool discoverTypeIndicesInSymbol(ArrayRef<uint8_t> RecordData,
                                  SmallVectorImpl<TypeIndex> &Indices);
 }
 }
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h b/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
index b69cda6303794fa..0d3f2c26fe464ea 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
@@ -32,13 +32,13 @@ using support::little32_t;
 using support::ulittle16_t;
 using support::ulittle32_t;
 
-struct CVMemberRecord {
+struct LLVM_CLASS_ABI CVMemberRecord {
   TypeLeafKind Kind;
   ArrayRef<uint8_t> Data;
 };
 
 /// Equvalent to CV_fldattr_t in cvinfo.h.
-struct MemberAttributes {
+struct LLVM_CLASS_ABI MemberAttributes {
   uint16_t Attrs = 0;
 
   enum {
@@ -98,7 +98,7 @@ struct MemberAttributes {
 
 // Does not correspond to any tag, this is the tail of an LF_POINTER record
 // if it represents a member pointer.
-class MemberPointerInfo {
+class LLVM_CLASS_ABI MemberPointerInfo {
 public:
   MemberPointerInfo() = default;
 
@@ -116,7 +116,7 @@ class MemberPointerInfo {
       PointerToMemberRepresentation::Unknown;
 };
 
-class TypeRecord {
+class LLVM_CLASS_ABI TypeRecord {
 protected:
   TypeRecord() = default;
   explicit TypeRecord(TypeRecordKind Kind) : Kind(Kind) {}
@@ -128,7 +128,7 @@ class TypeRecord {
 };
 
 // LF_MODIFIER
-class ModifierRecord : public TypeRecord {
+class LLVM_CLASS_ABI ModifierRecord : public TypeRecord {
 public:
   ModifierRecord() = default;
   explicit ModifierRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -144,7 +144,7 @@ class ModifierRecord : public TypeRecord {
 };
 
 // LF_PROCEDURE
-class ProcedureRecord : public TypeRecord {
+class LLVM_CLASS_ABI ProcedureRecord : public TypeRecord {
 public:
   ProcedureRecord() = default;
   explicit ProcedureRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -169,7 +169,7 @@ class ProcedureRecord : public TypeRecord {
 };
 
 // LF_MFUNCTION
-class MemberFunctionRecord : public TypeRecord {
+class LLVM_CLASS_ABI MemberFunctionRecord : public TypeRecord {
 public:
   MemberFunctionRecord() = default;
   explicit MemberFunctionRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -204,7 +204,7 @@ class MemberFunctionRecord : public TypeRecord {
 };
 
 // LF_LABEL
-class LabelRecord : public TypeRecord {
+class LLVM_CLASS_ABI LabelRecord : public TypeRecord {
 public:
   LabelRecord() = default;
   explicit LabelRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -215,7 +215,7 @@ class LabelRecord : public TypeRecord {
 };
 
 // LF_MFUNC_ID
-class MemberFuncIdRecord : public TypeRecord {
+class LLVM_CLASS_ABI MemberFuncIdRecord : public TypeRecord {
 public:
   MemberFuncIdRecord() = default;
   explicit MemberFuncIdRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -234,7 +234,7 @@ class MemberFuncIdRecord : public TypeRecord {
 };
 
 // LF_ARGLIST
-class ArgListRecord : public TypeRecord {
+class LLVM_CLASS_ABI ArgListRecord : public TypeRecord {
 public:
   ArgListRecord() = default;
   explicit ArgListRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -248,7 +248,7 @@ class ArgListRecord : public TypeRecord {
 };
 
 // LF_SUBSTR_LIST
-class StringListRecord : public TypeRecord {
+class LLVM_CLASS_ABI StringListRecord : public TypeRecord {
 public:
   StringListRecord() = default;
   explicit StringListRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -262,7 +262,7 @@ class StringListRecord : public TypeRecord {
 };
 
 // LF_POINTER
-class PointerRecord : public TypeRecord {
+class LLVM_CLASS_ABI PointerRecord : public TypeRecord {
 public:
   // ---------------------------XXXXX
   static const uint32_t PointerKindShift = 0;
@@ -368,7 +368,7 @@ class PointerRecord : public TypeRecord {
 };
 
 // LF_NESTTYPE
-class NestedTypeRecord : public TypeRecord {
+class LLVM_CLASS_ABI NestedTypeRecord : public TypeRecord {
 public:
   NestedTypeRecord() = default;
   explicit NestedTypeRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -383,7 +383,7 @@ class NestedTypeRecord : public TypeRecord {
 };
 
 // LF_FIELDLIST
-class FieldListRecord : public TypeRecord {
+class LLVM_CLASS_ABI FieldListRecord : public TypeRecord {
 public:
   FieldListRecord() = default;
   explicit FieldListRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -394,7 +394,7 @@ class FieldListRecord : public TypeRecord {
 };
 
 // LF_ARRAY
-class ArrayRecord : public TypeRecord {
+class LLVM_CLASS_ABI ArrayRecord : public TypeRecord {
 public:
   ArrayRecord() = default;
   explicit ArrayRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -414,7 +414,7 @@ class ArrayRecord : public TypeRecord {
   StringRef Name;
 };
 
-class TagRecord : public TypeRecord {
+class LLVM_CLASS_ABI TagRecord : public TypeRecord {
 protected:
   TagRecord() = default;
   explicit TagRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -463,7 +463,7 @@ class TagRecord : public TypeRecord {
 };
 
 // LF_CLASS, LF_STRUCTURE, LF_INTERFACE
-class ClassRecord : public TagRecord {
+class LLVM_CLASS_ABI ClassRecord : public TagRecord {
 public:
   ClassRecord() = default;
   explicit ClassRecord(TypeRecordKind Kind) : TagRecord(Kind) {}
@@ -496,7 +496,7 @@ class ClassRecord : public TagRecord {
 };
 
 // LF_UNION
-struct UnionRecord : public TagRecord {
+struct LLVM_CLASS_ABI UnionRecord : public TagRecord {
   UnionRecord() = default;
   explicit UnionRecord(TypeRecordKind Kind) : TagRecord(Kind) {}
   UnionRecord(uint16_t MemberCount, ClassOptions Options, TypeIndex FieldList,
@@ -517,7 +517,7 @@ struct UnionRecord : public TagRecord {
 };
 
 // LF_ENUM
-class EnumRecord : public TagRecord {
+class LLVM_CLASS_ABI EnumRecord : public TagRecord {
 public:
   EnumRecord() = default;
   explicit EnumRecord(TypeRecordKind Kind) : TagRecord(Kind) {}
@@ -533,7 +533,7 @@ class EnumRecord : public TagRecord {
 };
 
 // LF_BITFIELD
-class BitFieldRecord : public TypeRecord {
+class LLVM_CLASS_ABI BitFieldRecord : public TypeRecord {
 public:
   BitFieldRecord() = default;
   explicit BitFieldRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -551,7 +551,7 @@ class BitFieldRecord : public TypeRecord {
 };
 
 // LF_VTSHAPE
-class VFTableShapeRecord : public TypeRecord {
+class LLVM_CLASS_ABI VFTableShapeRecord : public TypeRecord {
 public:
   VFTableShapeRecord() = default;
   explicit VFTableShapeRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -573,7 +573,7 @@ class VFTableShapeRecord : public TypeRecord {
 };
 
 // LF_TYPESERVER2
-class TypeServer2Record : public TypeRecord {
+class LLVM_CLASS_ABI TypeServer2Record : public TypeRecord {
 public:
   TypeServer2Record() = default;
   explicit TypeServer2Record(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -593,7 +593,7 @@ class TypeServer2Record : public TypeRecord {
 };
 
 // LF_STRING_ID
-class StringIdRecord : public TypeRecord {
+class LLVM_CLASS_ABI StringIdRecord : public TypeRecord {
 public:
   StringIdRecord() = default;
   explicit StringIdRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -608,7 +608,7 @@ class StringIdRecord : public TypeRecord {
 };
 
 // LF_FUNC_ID
-class FuncIdRecord : public TypeRecord {
+class LLVM_CLASS_ABI FuncIdRecord : public TypeRecord {
 public:
   FuncIdRecord() = default;
   explicit FuncIdRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -626,7 +626,7 @@ class FuncIdRecord : public TypeRecord {
 };
 
 // LF_UDT_SRC_LINE
-class UdtSourceLineRecord : public TypeRecord {
+class LLVM_CLASS_ABI UdtSourceLineRecord : public TypeRecord {
 public:
   UdtSourceLineRecord() = default;
   explicit UdtSourceLineRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -644,7 +644,7 @@ class UdtSourceLineRecord : public TypeRecord {
 };
 
 // LF_UDT_MOD_SRC_LINE
-class UdtModSourceLineRecord : public TypeRecord {
+class LLVM_CLASS_ABI UdtModSourceLineRecord : public TypeRecord {
 public:
   UdtModSourceLineRecord() = default;
   explicit UdtModSourceLineRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -665,7 +665,7 @@ class UdtModSourceLineRecord : public TypeRecord {
 };
 
 // LF_BUILDINFO
-class BuildInfoRecord : public TypeRecord {
+class LLVM_CLASS_ABI BuildInfoRecord : public TypeRecord {
 public:
   BuildInfoRecord() = default;
   explicit BuildInfoRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -689,7 +689,7 @@ class BuildInfoRecord : public TypeRecord {
 };
 
 // LF_VFTABLE
-class VFTableRecord : public TypeRecord {
+class LLVM_CLASS_ABI VFTableRecord : public TypeRecord {
 public:
   VFTableRecord() = default;
   explicit VFTableRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -718,7 +718,7 @@ class VFTableRecord : public TypeRecord {
 };
 
 // LF_ONEMETHOD
-class OneMethodRecord : public TypeRecord {
+class LLVM_CLASS_ABI OneMethodRecord : public TypeRecord {
 public:
   OneMethodRecord() = default;
   explicit OneMethodRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -750,7 +750,7 @@ class OneMethodRecord : public TypeRecord {
 };
 
 // LF_METHODLIST
-class MethodOverloadListRecord : public TypeRecord {
+class LLVM_CLASS_ABI MethodOverloadListRecord : public TypeRecord {
 public:
   MethodOverloadListRecord() = default;
   explicit MethodOverloadListRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -763,7 +763,7 @@ class MethodOverloadListRecord : public TypeRecord {
 };
 
 /// For method overload sets.  LF_METHOD
-class OverloadedMethodRecord : public TypeRecord {
+class LLVM_CLASS_ABI OverloadedMethodRecord : public TypeRecord {
 public:
   OverloadedMethodRecord() = default;
   explicit OverloadedMethodRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -782,7 +782,7 @@ class OverloadedMethodRecord : public TypeRecord {
 };
 
 // LF_MEMBER
-class DataMemberRecord : public TypeRecord {
+class LLVM_CLASS_ABI DataMemberRecord : public TypeRecord {
 public:
   DataMemberRecord() = default;
   explicit DataMemberRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -807,7 +807,7 @@ class DataMemberRecord : public TypeRecord {
 };
 
 // LF_STMEMBER
-class StaticDataMemberRecord : public TypeRecord {
+class LLVM_CLASS_ABI StaticDataMemberRecord : public TypeRecord {
 public:
   StaticDataMemberRecord() = default;
   explicit StaticDataMemberRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -828,7 +828,7 @@ class StaticDataMemberRecord : public TypeRecord {
 };
 
 // LF_ENUMERATE
-class EnumeratorRecord : public TypeRecord {
+class LLVM_CLASS_ABI EnumeratorRecord : public TypeRecord {
 public:
   EnumeratorRecord() = default;
   explicit EnumeratorRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -849,7 +849,7 @@ class EnumeratorRecord : public TypeRecord {
 };
 
 // LF_VFUNCTAB
-class VFPtrRecord : public TypeRecord {
+class LLVM_CLASS_ABI VFPtrRecord : public TypeRecord {
 public:
   VFPtrRecord() = default;
   explicit VFPtrRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -862,7 +862,7 @@ class VFPtrRecord : public TypeRecord {
 };
 
 // LF_BCLASS, LF_BINTERFACE
-class BaseClassRecord : public TypeRecord {
+class LLVM_CLASS_ABI BaseClassRecord : public TypeRecord {
 public:
   BaseClassRecord() = default;
   explicit BaseClassRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -883,7 +883,7 @@ class BaseClassRecord : public TypeRecord {
 };
 
 // LF_VBCLASS, LF_IVBCLASS
-class VirtualBaseClassRecord : public TypeRecord {
+class LLVM_CLASS_ABI VirtualBaseClassRecord : public TypeRecord {
 public:
   VirtualBaseClassRecord() = default;
   explicit VirtualBaseClassRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -913,7 +913,7 @@ class VirtualBaseClassRecord : public TypeRecord {
 
 /// LF_INDEX - Used to chain two large LF_FIELDLIST or LF_METHODLIST records
 /// together. The first will end in an LF_INDEX record that points to the next.
-class ListContinuationRecord : public TypeRecord {
+class LLVM_CLASS_ABI ListContinuationRecord : public TypeRecord {
 public:
   ListContinuationRecord() = default;
   explicit ListContinuationRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -927,7 +927,7 @@ class ListContinuationRecord : public TypeRecord {
 };
 
 // LF_PRECOMP
-class PrecompRecord : public TypeRecord {
+class LLVM_CLASS_ABI PrecompRecord : public TypeRecord {
 public:
   PrecompRecord() = default;
   explicit PrecompRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
@@ -944,7 +944,7 @@ class PrecompRecord : public TypeRecord {
 };
 
 // LF_ENDPRECOMP
-class EndPrecompRecord : public TypeRecord {
+class LLVM_CLASS_ABI EndPrecompRecord : public TypeRecord {
 public:
   EndPrecompRecord() = default;
   explicit EndPrecompRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h b/llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
index d28e40bfbe5e529..312cc5029dfc3f0 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeRecordHelpers.h
@@ -19,11 +19,11 @@ namespace codeview {
 /// Given an arbitrary codeview type, determine if it is an LF_STRUCTURE,
 /// LF_CLASS, LF_INTERFACE, LF_UNION, or LF_ENUM with the forward ref class
 /// option.
-bool isUdtForwardRef(CVType CVT);
+LLVM_FUNC_ABI bool isUdtForwardRef(CVType CVT);
 
 /// Given a CVType which is assumed to be an LF_MODIFIER, return the
 /// TypeIndex of the type that the LF_MODIFIER modifies.
-TypeIndex getModifiedType(const CVType &CVT);
+LLVM_FUNC_ABI TypeIndex getModifiedType(const CVType &CVT);
 
 /// Return true if this record should be in the IPI stream of a PDB. In an
 /// object file, these record kinds will appear mixed into the .debug$T section.
@@ -57,11 +57,11 @@ inline bool isAggregate(CVType CVT) {
 }
 
 /// Given an arbitrary codeview type index, determine its size.
-uint64_t getSizeInBytesForTypeIndex(TypeIndex TI);
+LLVM_FUNC_ABI uint64_t getSizeInBytesForTypeIndex(TypeIndex TI);
 
 /// Given an arbitrary codeview type, return the type's size in the case
 /// of aggregate (LF_STRUCTURE, LF_CLASS, LF_INTERFACE, LF_UNION).
-uint64_t getSizeInBytesForTypeRecord(CVType CVT);
+LLVM_FUNC_ABI uint64_t getSizeInBytesForTypeRecord(CVType CVT);
 
 } // namespace codeview
 } // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h b/llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
index 070243f8532dd02..c093c7639420293 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
@@ -24,7 +24,7 @@ class BinaryStreamWriter;
 namespace codeview {
 class TypeIndex;
 struct CVMemberRecord;
-class TypeRecordMapping : public TypeVisitorCallbacks {
+class LLVM_CLASS_ABI TypeRecordMapping : public TypeVisitorCallbacks {
 public:
   explicit TypeRecordMapping(BinaryStreamReader &Reader) : IO(Reader) {}
   explicit TypeRecordMapping(BinaryStreamWriter &Writer) : IO(Writer) {}
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h b/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
index 4e565319737f43b..8f3af9178e158e6 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeStreamMerger.h
@@ -25,7 +25,7 @@ class MergingTypeTableBuilder;
 
 /// Used to forward information about PCH.OBJ (precompiled) files, when
 /// applicable.
-struct PCHMergerInfo {
+struct LLVM_CLASS_ABI PCHMergerInfo {
   uint32_t PCHSignature{};
   uint32_t EndPrecompIndex = ~0U;
 };
@@ -43,7 +43,7 @@ struct PCHMergerInfo {
 ///
 /// \returns Error::success() if the operation succeeded, otherwise an
 /// appropriate error code.
-Error mergeTypeRecords(MergingTypeTableBuilder &Dest,
+LLVM_FUNC_ABI Error mergeTypeRecords(MergingTypeTableBuilder &Dest,
                        SmallVectorImpl<TypeIndex> &SourceToDest,
                        const CVTypeArray &Types);
 
@@ -68,7 +68,7 @@ Error mergeTypeRecords(MergingTypeTableBuilder &Dest,
 ///
 /// \returns Error::success() if the operation succeeded, otherwise an
 /// appropriate error code.
-Error mergeIdRecords(MergingTypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
+LLVM_FUNC_ABI Error mergeIdRecords(MergingTypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
                      SmallVectorImpl<TypeIndex> &SourceToDest,
                      const CVTypeArray &Ids);
 
@@ -87,26 +87,26 @@ Error mergeIdRecords(MergingTypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
 ///
 /// \returns Error::success() if the operation succeeded, otherwise an
 /// appropriate error code.
-Error mergeTypeAndIdRecords(MergingTypeTableBuilder &DestIds,
+LLVM_FUNC_ABI Error mergeTypeAndIdRecords(MergingTypeTableBuilder &DestIds,
                             MergingTypeTableBuilder &DestTypes,
                             SmallVectorImpl<TypeIndex> &SourceToDest,
                             const CVTypeArray &IdsAndTypes,
                             std::optional<PCHMergerInfo> &PCHInfo);
 
-Error mergeTypeAndIdRecords(GlobalTypeTableBuilder &DestIds,
+LLVM_FUNC_ABI Error mergeTypeAndIdRecords(GlobalTypeTableBuilder &DestIds,
                             GlobalTypeTableBuilder &DestTypes,
                             SmallVectorImpl<TypeIndex> &SourceToDest,
                             const CVTypeArray &IdsAndTypes,
                             ArrayRef<GloballyHashedType> Hashes,
                             std::optional<PCHMergerInfo> &PCHInfo);
 
-Error mergeTypeRecords(GlobalTypeTableBuilder &Dest,
+LLVM_FUNC_ABI Error mergeTypeRecords(GlobalTypeTableBuilder &Dest,
                        SmallVectorImpl<TypeIndex> &SourceToDest,
                        const CVTypeArray &Types,
                        ArrayRef<GloballyHashedType> Hashes,
                        std::optional<PCHMergerInfo> &PCHInfo);
 
-Error mergeIdRecords(GlobalTypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
+LLVM_FUNC_ABI Error mergeIdRecords(GlobalTypeTableBuilder &Dest, ArrayRef<TypeIndex> Types,
                      SmallVectorImpl<TypeIndex> &SourceToDest,
                      const CVTypeArray &Ids,
                      ArrayRef<GloballyHashedType> Hashes);
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h b/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
index 1b11dbe28332f5f..d2e7777b8eaa4a7 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeTableCollection.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace codeview {
 
-class TypeTableCollection : public TypeCollection {
+class LLVM_CLASS_ABI TypeTableCollection : public TypeCollection {
 public:
   explicit TypeTableCollection(ArrayRef<ArrayRef<uint8_t>> Records);
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h b/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
index ebf90fff1d98e41..7f01b0d418f8bdd 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
@@ -19,7 +19,7 @@
 namespace llvm {
 namespace codeview {
 
-class TypeVisitorCallbackPipeline : public TypeVisitorCallbacks {
+class LLVM_CLASS_ABI TypeVisitorCallbackPipeline : public TypeVisitorCallbacks {
 public:
   TypeVisitorCallbackPipeline() = default;
 
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h b/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
index 75a137ca1b0f5be..5172c1fd43257cb 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
@@ -16,7 +16,7 @@
 namespace llvm {
 namespace codeview {
 
-class TypeVisitorCallbacks {
+class LLVM_CLASS_ABI TypeVisitorCallbacks {
 public:
   virtual ~TypeVisitorCallbacks() = default;
 
diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h
index 9cf727151800fd9..34f04c29a10e0c9 100644
--- a/llvm/include/llvm/DebugInfo/DIContext.h
+++ b/llvm/include/llvm/DebugInfo/DIContext.h
@@ -30,7 +30,7 @@
 namespace llvm {
 
 /// A format-neutral container for source line information.
-struct DILineInfo {
+struct LLVM_CLASS_ABI DILineInfo {
   // DILineInfo contains "<invalid>" for function/filename it cannot fetch.
   static constexpr const char *const BadString = "<invalid>";
   // Use "??" instead of "<invalid>" to make our output closer to addr2line.
@@ -86,7 +86,7 @@ struct DILineInfo {
 using DILineInfoTable = SmallVector<std::pair<uint64_t, DILineInfo>, 16>;
 
 /// A format-neutral container for inlined code description.
-class DIInliningInfo {
+class LLVM_CLASS_ABI DIInliningInfo {
   SmallVector<DILineInfo, 4> Frames;
 
 public:
@@ -112,7 +112,7 @@ class DIInliningInfo {
 };
 
 /// Container for description of a global variable.
-struct DIGlobal {
+struct LLVM_CLASS_ABI DIGlobal {
   std::string Name;
   uint64_t Start = 0;
   uint64_t Size = 0;
@@ -122,7 +122,7 @@ struct DIGlobal {
   DIGlobal() : Name(DILineInfo::BadString) {}
 };
 
-struct DILocal {
+struct LLVM_CLASS_ABI DILocal {
   std::string FunctionName;
   std::string Name;
   std::string DeclFile;
@@ -138,7 +138,7 @@ enum class DINameKind { None, ShortName, LinkageName };
 
 /// Controls which fields of DILineInfo container should be filled
 /// with data.
-struct DILineInfoSpecifier {
+struct LLVM_CLASS_ABI DILineInfoSpecifier {
   enum class FileLineInfoKind {
     None,
     // RawValue is whatever the compiler stored in the filename table.  Could be
@@ -187,7 +187,7 @@ enum DIDumpType : unsigned {
 
 /// Container for dump options that control which debug information will be
 /// dumped.
-struct DIDumpOptions {
+struct LLVM_CLASS_ABI DIDumpOptions {
   unsigned DumpType = DIDT_All;
   unsigned ChildRecurseDepth = -1U;
   unsigned ParentRecurseDepth = -1U;
@@ -227,7 +227,7 @@ struct DIDumpOptions {
   std::function<void(Error)> WarningHandler = WithColor::defaultWarningHandler;
 };
 
-class DIContext {
+class LLVM_CLASS_ABI DIContext {
 public:
   enum DIContextKind { CK_DWARF, CK_PDB };
 
@@ -265,7 +265,7 @@ class DIContext {
 /// An inferface for inquiring the load address of a loaded object file
 /// to be used by the DIContext implementations when applying relocations
 /// on the fly.
-class LoadedObjectInfo {
+class LLVM_CLASS_ABI LoadedObjectInfo {
 protected:
   LoadedObjectInfo() = default;
   LoadedObjectInfo(const LoadedObjectInfo &) = default;
@@ -308,7 +308,7 @@ class LoadedObjectInfo {
 };
 
 template <typename Derived, typename Base = LoadedObjectInfo>
-struct LoadedObjectInfoHelper : Base {
+struct LLVM_CLASS_ABI LoadedObjectInfoHelper : Base {
 protected:
   LoadedObjectInfoHelper(const LoadedObjectInfoHelper &) = default;
   LoadedObjectInfoHelper() = default;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
index 15279728e039a48..763573d3490161b 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h
@@ -24,7 +24,7 @@ class DataExtractor;
 class DWARFUnit;
 class raw_ostream;
 
-class DWARFAbbreviationDeclaration {
+class LLVM_CLASS_ABI DWARFAbbreviationDeclaration {
 public:
   enum class ExtractState { Complete, MoreItems };
   struct AttributeSpec {
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
index 4581a0d9e36d6f6..a2ce86e8f1c68f1 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
@@ -30,7 +30,7 @@ class ScopedPrinter;
 /// DWARF 5 accelerator tables.
 /// TODO: Generalize the rest of the AppleAcceleratorTable interface and move it
 /// to this class.
-class DWARFAcceleratorTable {
+class LLVM_CLASS_ABI DWARFAcceleratorTable {
 protected:
   DWARFDataExtractor AccelSection;
   DataExtractor StringSection;
@@ -82,7 +82,7 @@ class DWARFAcceleratorTable {
 
 /// This implements the Apple accelerator table format, a precursor of the
 /// DWARF 5 accelerator table format.
-class AppleAcceleratorTable : public DWARFAcceleratorTable {
+class LLVM_CLASS_ABI AppleAcceleratorTable : public DWARFAcceleratorTable {
   struct Header {
     uint32_t Magic;
     uint16_t Version;
@@ -365,7 +365,7 @@ class AppleAcceleratorTable : public DWARFAcceleratorTable {
 /// The last segment consists of a list of entries, which is a 0-terminated list
 /// referenced by the name table and interpreted with the help of the
 /// abbreviation table.
-class DWARFDebugNames : public DWARFAcceleratorTable {
+class LLVM_CLASS_ABI DWARFDebugNames : public DWARFAcceleratorTable {
 public:
   class NameIndex;
   class NameIterator;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
index 1bbbe329ce590e6..e0cf9400e88612f 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAddressRange.h
@@ -23,7 +23,7 @@ namespace llvm {
 class raw_ostream;
 class DWARFObject;
 
-struct DWARFAddressRange {
+struct LLVM_CLASS_ABI DWARFAddressRange {
   uint64_t LowPC;
   uint64_t HighPC;
   uint64_t SectionIndex;
@@ -83,7 +83,7 @@ inline bool operator==(const DWARFAddressRange &LHS,
   return std::tie(LHS.SectionIndex, LHS.LowPC, LHS.HighPC) == std::tie(RHS.SectionIndex, RHS.LowPC, RHS.HighPC);
 }
 
-raw_ostream &operator<<(raw_ostream &OS, const DWARFAddressRange &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const DWARFAddressRange &R);
 
 /// DWARFAddressRangesVector - represents a set of absolute address ranges.
 using DWARFAddressRangesVector = std::vector<DWARFAddressRange>;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
index 35cd164ece3f73d..58086861c2a3339 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFAttribute.h
@@ -22,7 +22,7 @@ namespace llvm {
 ///
 /// This class is designed to be used by clients that want to iterate across all
 /// attributes in a DWARFDie.
-struct DWARFAttribute {
+struct LLVM_CLASS_ABI DWARFAttribute {
   /// The debug info/types offset for this attribute.
   uint64_t Offset = 0;
   /// The debug info/types section byte size of the data for this attribute.
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
index c7484374cef21e1..56918accc7687a5 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFCompileUnit.h
@@ -20,7 +20,7 @@ class raw_ostream;
 struct DIDumpOptions;
 struct DWARFSection;
 
-class DWARFCompileUnit : public DWARFUnit {
+class LLVM_CLASS_ABI DWARFCompileUnit : public DWARFUnit {
 public:
   DWARFCompileUnit(DWARFContext &Context, const DWARFSection &Section,
                    const DWARFUnitHeader &Header, const DWARFDebugAbbrev *DA,
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
index ef5fa72ac819b52..403c7da87560dd9 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
@@ -45,7 +45,7 @@ class DWARFUnitIndex;
 /// DWARFContext
 /// This data structure is the top level entity that deals with dwarf debug
 /// information parsing. The actual data is supplied through DWARFObj.
-class DWARFContext : public DIContext {
+class LLVM_CLASS_ABI DWARFContext : public DIContext {
   DWARFUnitVector NormalUnits;
   std::optional<DenseMap<uint64_t, DWARFTypeUnit *>> NormalTypeUnits;
   std::unique_ptr<DWARFUnitIndex> CUIndex;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
index 814d506840b490b..299d0eb32bade74 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h
@@ -19,7 +19,7 @@ class DWARFObject;
 
 /// A DataExtractor (typically for an in-memory copy of an object-file section)
 /// plus a relocation map for that section, if there is one.
-class DWARFDataExtractor : public DataExtractor {
+class LLVM_CLASS_ABI DWARFDataExtractor : public DataExtractor {
   const DWARFObject *Obj = nullptr;
   const DWARFSection *Section = nullptr;
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
index 79bfadefc3b5f47..e8bef461864ffdc 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h
@@ -20,7 +20,7 @@ namespace llvm {
 
 class raw_ostream;
 
-class DWARFAbbreviationDeclarationSet {
+class LLVM_CLASS_ABI DWARFAbbreviationDeclarationSet {
   uint64_t Offset;
   /// Code of the first abbreviation, if all abbreviations in the set have
   /// consecutive codes. UINT32_MAX otherwise.
@@ -56,7 +56,7 @@ class DWARFAbbreviationDeclarationSet {
   void clear();
 };
 
-class DWARFDebugAbbrev {
+class LLVM_CLASS_ABI DWARFDebugAbbrev {
   using DWARFAbbreviationDeclarationSetMap =
       std::map<uint64_t, DWARFAbbreviationDeclarationSet>;
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
index 39a5e77257ad227..350c4578309caff 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h
@@ -24,7 +24,7 @@ class DWARFDataExtractor;
 /// A class representing an address table as specified in DWARF v5.
 /// The table consists of a header followed by an array of address values from
 /// .debug_addr section.
-class DWARFDebugAddrTable {
+class LLVM_CLASS_ABI DWARFDebugAddrTable {
   dwarf::DwarfFormat Format;
   uint64_t Offset;
   /// The total length of the entries for this table, not including the length
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
index dd9d6709a61f400..f4e03984bd77b62 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h
@@ -21,7 +21,7 @@ namespace llvm {
 class raw_ostream;
 class DWARFDataExtractor;
 
-class DWARFDebugArangeSet {
+class LLVM_CLASS_ABI DWARFDebugArangeSet {
 public:
   struct Header {
     /// The total length of the entries for that set, not including the length
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
index 5090fbc380d53a7..827316c95b2c0de 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAranges.h
@@ -21,7 +21,7 @@ class Error;
 
 class DWARFContext;
 
-class DWARFDebugAranges {
+class LLVM_CLASS_ABI DWARFDebugAranges {
 public:
   void generate(DWARFContext *CTX);
   uint64_t findAddress(uint64_t Address) const;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
index 84094eda6361a70..ad1ad2057ce4796 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h
@@ -34,7 +34,7 @@ constexpr uint32_t InvalidRegisterNumber = UINT32_MAX;
 /// A class that represents a location for the Call Frame Address (CFA) or a
 /// register. This is decoded from the DWARF Call Frame Information
 /// instructions and put into an UnwindRow.
-class UnwindLocation {
+class LLVM_CLASS_ABI UnwindLocation {
 public:
   enum Location {
     /// Not specified.
@@ -170,7 +170,7 @@ class UnwindLocation {
   bool operator==(const UnwindLocation &RHS) const;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const UnwindLocation &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const UnwindLocation &R);
 
 /// A class that can track all registers with locations in a UnwindRow object.
 ///
@@ -180,7 +180,7 @@ raw_ostream &operator<<(raw_ostream &OS, const UnwindLocation &R);
 /// The register maps are put into a class so that all register locations can
 /// be copied when parsing the unwind opcodes DW_CFA_remember_state and
 /// DW_CFA_restore_state.
-class RegisterLocations {
+class LLVM_CLASS_ABI RegisterLocations {
   std::map<uint32_t, UnwindLocation> Locations;
 
 public:
@@ -235,7 +235,7 @@ class RegisterLocations {
   }
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const RegisterLocations &RL);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const RegisterLocations &RL);
 
 /// A class that represents a single row in the unwind table that is decoded by
 /// parsing the DWARF Call Frame Information opcodes.
@@ -253,7 +253,7 @@ raw_ostream &operator<<(raw_ostream &OS, const RegisterLocations &RL);
 /// needed for the address, CFA value, and register locations as the opcodes
 /// encode a state machine that produces a sorted array of UnwindRow objects
 /// \see UnwindTable.
-class UnwindRow {
+class LLVM_CLASS_ABI UnwindRow {
   /// The address will be valid when parsing the instructions in a FDE. If
   /// invalid, this object represents the initial instructions of a CIE.
   std::optional<uint64_t> Address; ///< Address for row in FDE, invalid for CIE.
@@ -308,7 +308,7 @@ class UnwindRow {
             unsigned IndentLevel = 0) const;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const UnwindRow &Row);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const UnwindRow &Row);
 
 class CFIProgram;
 class CIE;
@@ -319,7 +319,7 @@ class FDE;
 /// address, can be searched to find the UnwindRow with the lowest starting
 /// address that is greater than or equal to the address that is being looked
 /// up.
-class UnwindTable {
+class LLVM_CLASS_ABI UnwindTable {
 public:
   using RowContainer = std::vector<UnwindRow>;
   using iterator = RowContainer::iterator;
@@ -397,7 +397,7 @@ class UnwindTable {
                   const RegisterLocations *InitialLocs);
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const UnwindTable &Rows);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const UnwindTable &Rows);
 
 /// Represent a sequence of Call Frame Information instructions that, when read
 /// in order, construct a table mapping PC to frame state. This can also be
@@ -405,7 +405,7 @@ raw_ostream &operator<<(raw_ostream &OS, const UnwindTable &Rows);
 /// computer programs in the broader sense, and in this context each instruction
 /// would be a rule to establish the mapping. Refer to pg. 172 in the DWARF5
 /// manual, "6.4.1 Structure of Call Frame Information".
-class CFIProgram {
+class LLVM_CLASS_ABI CFIProgram {
 public:
   static constexpr size_t MaxOperands = 3;
   typedef SmallVector<uint64_t, MaxOperands> Operands;
@@ -530,7 +530,7 @@ class CFIProgram {
 
 /// An entry in either debug_frame or eh_frame. This entry can be a CIE or an
 /// FDE.
-class FrameEntry {
+class LLVM_CLASS_ABI FrameEntry {
 public:
   enum FrameKind { FK_CIE, FK_FDE };
 
@@ -565,7 +565,7 @@ class FrameEntry {
 };
 
 /// DWARF Common Information Entry (CIE)
-class CIE : public FrameEntry {
+class LLVM_CLASS_ABI CIE : public FrameEntry {
 public:
   // CIEs (and FDEs) are simply container classes, so the only sensible way to
   // create them is by providing the full parsed contents in the constructor.
@@ -627,7 +627,7 @@ class CIE : public FrameEntry {
 };
 
 /// DWARF Frame Description Entry (FDE)
-class FDE : public FrameEntry {
+class LLVM_CLASS_ABI FDE : public FrameEntry {
 public:
   FDE(bool IsDWARF64, uint64_t Offset, uint64_t Length, uint64_t CIEPointer,
       uint64_t InitialLocation, uint64_t AddressRange, CIE *Cie,
@@ -665,7 +665,7 @@ class FDE : public FrameEntry {
 } // end namespace dwarf
 
 /// A parsed .debug_frame or .eh_frame section
-class DWARFDebugFrame {
+class LLVM_CLASS_ABI DWARFDebugFrame {
   const Triple::ArchType Arch;
   // True if this is parsing an eh_frame section.
   const bool IsEH;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
index 759607e71e72769..93bcd7def539bbb 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h
@@ -20,7 +20,7 @@ class DWARFUnit;
 class DWARFDataExtractor;
 
 /// DWARFDebugInfoEntry - A DIE with only the minimum required data.
-class DWARFDebugInfoEntry {
+class LLVM_CLASS_ABI DWARFDebugInfoEntry {
   /// Offset within the .debug_info of the start of this entry.
   uint64_t Offset = 0;
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
index dc950bd9f796ebe..3012e93ddac4859 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
@@ -26,7 +26,7 @@ namespace llvm {
 
 class raw_ostream;
 
-class DWARFDebugLine {
+class LLVM_CLASS_ABI DWARFDebugLine {
 public:
   struct FileNameEntry {
     FileNameEntry() = default;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
index 7205a2b52e27185..51d2bb9fc2e0a71 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h
@@ -28,7 +28,7 @@ struct SectionedAddress;
 
 /// A single location within a location list. Entries are stored in the DWARF5
 /// form even if they originally come from a DWARF<=4 location list.
-struct DWARFLocationEntry {
+struct LLVM_CLASS_ABI DWARFLocationEntry {
   /// The entry kind (DW_LLE_***).
   uint8_t Kind;
 
@@ -47,7 +47,7 @@ struct DWARFLocationEntry {
 
 /// An abstract base class for various kinds of location tables (.debug_loc,
 /// .debug_loclists, and their dwo variants).
-class DWARFLocationTable {
+class LLVM_CLASS_ABI DWARFLocationTable {
 public:
   DWARFLocationTable(DWARFDataExtractor Data) : Data(std::move(Data)) {}
   virtual ~DWARFLocationTable() = default;
@@ -86,7 +86,7 @@ class DWARFLocationTable {
                             const DWARFObject &Obj) const = 0;
 };
 
-class DWARFDebugLoc final : public DWARFLocationTable {
+class LLVM_CLASS_ABI DWARFDebugLoc final : public DWARFLocationTable {
 public:
   /// A list of locations that contain one variable.
   struct LocationList {
@@ -122,7 +122,7 @@ class DWARFDebugLoc final : public DWARFLocationTable {
                     const DWARFObject &Obj) const override;
 };
 
-class DWARFDebugLoclists final : public DWARFLocationTable {
+class LLVM_CLASS_ABI DWARFDebugLoclists final : public DWARFLocationTable {
 public:
   DWARFDebugLoclists(DWARFDataExtractor Data, uint16_t Version)
       : DWARFLocationTable(std::move(Data)), Version(Version) {}
@@ -144,7 +144,7 @@ class DWARFDebugLoclists final : public DWARFLocationTable {
   uint16_t Version;
 };
 
-class ResolverError : public ErrorInfo<ResolverError> {
+class LLVM_CLASS_ABI ResolverError : public ErrorInfo<ResolverError> {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
index a9270c7eefdb975..99591fa0e2c7e4b 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h
@@ -21,7 +21,7 @@ namespace llvm {
 class raw_ostream;
 class DwarfStreamer;
 
-class DWARFDebugMacro {
+class LLVM_CLASS_ABI DWARFDebugMacro {
   friend DwarfStreamer;
 
   /// DWARFv5 section 6.3.1 Macro Information Header.
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
index 1faa336099a3a00..e344a2d780f167a 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugPubTable.h
@@ -24,7 +24,7 @@ class DWARFDataExtractor;
 class Error;
 
 /// Represents structure for holding and parsing .debug_pub* tables.
-class DWARFDebugPubTable {
+class LLVM_CLASS_ABI DWARFDebugPubTable {
 public:
   struct Entry {
     /// Section offset from the beginning of the compilation unit.
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
index 8eb4f592820d922..76f1b38b8d3db5b 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRangeList.h
@@ -22,7 +22,7 @@ namespace object {
 struct SectionedAddress;
 }
 
-class DWARFDebugRangeList {
+class LLVM_CLASS_ABI DWARFDebugRangeList {
 public:
   struct RangeListEntry {
     /// A beginning address offset. This address offset has the size of an
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
index b12d807bcb8d1a0..036e7eb5156900c 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
@@ -28,7 +28,7 @@ struct SectionedAddress;
 }
 
 /// A class representing a single range list entry.
-struct RangeListEntry : public DWARFListEntryBase {
+struct LLVM_CLASS_ABI RangeListEntry : public DWARFListEntryBase {
   /// The values making up the range list entry. Most represent a range with
   /// a start and end address or a start address and a length. Others are
   /// single value base addresses or end-of-list with no values. The unneeded
@@ -46,7 +46,7 @@ struct RangeListEntry : public DWARFListEntryBase {
 };
 
 /// A class representing a single rangelist.
-class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
+class LLVM_CLASS_ABI DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
 public:
   /// Build a DWARFAddressRangesVector from a rangelist.
   DWARFAddressRangesVector getAbsoluteRanges(
@@ -60,7 +60,7 @@ class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
                     DWARFUnit &U) const;
 };
 
-class DWARFDebugRnglistTable : public DWARFListTableBase<DWARFDebugRnglist> {
+class LLVM_CLASS_ABI DWARFDebugRnglistTable : public DWARFListTableBase<DWARFDebugRnglist> {
 public:
   DWARFDebugRnglistTable()
       : DWARFListTableBase(/* SectionName    = */ ".debug_rnglists",
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
index 048ef08ab57ded8..11389eecdb7e509 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
@@ -40,7 +40,7 @@ class raw_ostream;
 /// relative offset. This class helps to ensure that this doesn't happen and
 /// also simplifies the attribute extraction calls by not having to specify the
 /// DWARFUnit for each call.
-class DWARFDie {
+class LLVM_CLASS_ABI DWARFDie {
   DWARFUnit *U = nullptr;
   const DWARFDebugInfoEntry *Die = nullptr;
 
@@ -308,7 +308,7 @@ class DWARFDie::attribute_iterator
   /// The attribute index within the abbreviation declaration in Die.
   uint32_t Index;
 
-  friend bool operator==(const attribute_iterator &LHS,
+  friend LLVM_FUNC_ABI bool operator==(const attribute_iterator &LHS,
                          const attribute_iterator &RHS);
 
   /// Update the attribute index and attempt to read the attribute value. If the
@@ -357,7 +357,7 @@ class DWARFDie::iterator
   DWARFDie Die;
 
   friend std::reverse_iterator<llvm::DWARFDie::iterator>;
-  friend bool operator==(const DWARFDie::iterator &LHS,
+  friend LLVM_FUNC_ABI bool operator==(const DWARFDie::iterator &LHS,
                          const DWARFDie::iterator &RHS);
 
 public:
@@ -402,7 +402,7 @@ inline iterator_range<DWARFDie::iterator> DWARFDie::children() const {
 namespace std {
 
 template <>
-class reverse_iterator<llvm::DWARFDie::iterator>
+class LLVM_CLASS_ABI reverse_iterator<llvm::DWARFDie::iterator>
     : public llvm::iterator_facade_base<
           reverse_iterator<llvm::DWARFDie::iterator>,
           bidirectional_iterator_tag, const llvm::DWARFDie> {
@@ -477,8 +477,8 @@ inline std::reverse_iterator<DWARFDie::iterator> DWARFDie::rend() const {
   return std::make_reverse_iterator(begin());
 }
 
-void dumpTypeQualifiedName(const DWARFDie &DIE, raw_ostream &OS);
-void dumpTypeUnqualifiedName(const DWARFDie &DIE, raw_ostream &OS,
+LLVM_FUNC_ABI void dumpTypeQualifiedName(const DWARFDie &DIE, raw_ostream &OS);
+LLVM_FUNC_ABI void dumpTypeUnqualifiedName(const DWARFDie &DIE, raw_ostream &OS,
                              std::string *OriginalFullName = nullptr);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
index 1a7c354c0a768a8..65d0f0198eb9a2c 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
@@ -21,7 +21,7 @@ struct DIDumpOptions;
 class MCRegisterInfo;
 class raw_ostream;
 
-class DWARFExpression {
+class LLVM_CLASS_ABI DWARFExpression {
 public:
   class iterator;
 
@@ -141,7 +141,7 @@ class DWARFExpression {
     }
 
     // Comparison operators are provided out of line.
-    friend bool operator==(const iterator &, const iterator &);
+    friend LLVM_FUNC_ABI bool operator==(const iterator &, const iterator &);
   };
 
   DWARFExpression(DataExtractor Data, uint8_t AddressSize,
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
index b9d1331ec800066..d5c9dd7a92e15db 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h
@@ -24,7 +24,7 @@ class DWARFDataExtractor;
 class DWARFUnit;
 class raw_ostream;
 
-class DWARFFormValue {
+class LLVM_CLASS_ABI DWARFFormValue {
 public:
   enum FormClass {
     FC_Unknown,
@@ -358,7 +358,7 @@ toBlock(const std::optional<DWARFFormValue> &V) {
 /// \param FC an attribute form class to check.
 /// \param DwarfVersion the version of DWARF debug info keeping the attribute.
 /// \returns true if specified \p Form belongs to the \p FC class.
-bool doesFormBelongToClass(dwarf::Form Form, DWARFFormValue::FormClass FC,
+LLVM_FUNC_ABI bool doesFormBelongToClass(dwarf::Form Form, DWARFFormValue::FormClass FC,
                            uint16_t DwarfVersion);
 
 } // end namespace dwarf
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
index 7e7e9052dc1339a..0c14e4e9b948a4b 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
@@ -20,7 +20,7 @@ namespace llvm {
 class raw_ostream;
 class DataExtractor;
 
-class DWARFGdbIndex {
+class LLVM_CLASS_ABI DWARFGdbIndex {
   uint32_t Version;
 
   uint32_t CuListOffset;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
index a0303da25313b40..a6b5479bc582613 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
@@ -24,7 +24,7 @@ namespace llvm {
 
 /// A base class for DWARF list entries, such as range or location list
 /// entries.
-struct DWARFListEntryBase {
+struct LLVM_CLASS_ABI DWARFListEntryBase {
   /// The offset at which the entry is located in the section.
   uint64_t Offset;
   /// The DWARF encoding (DW_RLE_* or DW_LLE_*).
@@ -35,7 +35,7 @@ struct DWARFListEntryBase {
 
 /// A base class for lists of entries that are extracted from a particular
 /// section, such as range lists or location lists.
-template <typename ListEntryType> class DWARFListType {
+template <typename ListEntryType> class LLVM_CLASS_ABI DWARFListType {
   using EntryType = ListEntryType;
   using ListEntries = std::vector<EntryType>;
 
@@ -53,7 +53,7 @@ template <typename ListEntryType> class DWARFListType {
 
 /// A class representing the header of a list table such as the range list
 /// table in the .debug_rnglists section.
-class DWARFListTableHeader {
+class LLVM_CLASS_ABI DWARFListTableHeader {
   struct Header {
     /// The total length of the entries for this table, not including the length
     /// field itself.
@@ -145,7 +145,7 @@ class DWARFListTableHeader {
 /// followed by an array of offsets into a DWARF section, followed by zero or
 /// more list entries. The list entries are kept in a map where the keys are
 /// the lists' section offsets.
-template <typename DWARFListType> class DWARFListTableBase {
+template <typename DWARFListType> class LLVM_CLASS_ABI DWARFListTableBase {
   DWARFListTableHeader Header;
   /// A mapping between file offsets and lists. It is used to find a particular
   /// list based on an offset (obtained from DW_AT_ranges, for example).
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h
index 9884cbbbe2161b4..8730f2c1d55ec8d 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h
@@ -19,7 +19,7 @@ class raw_ostream;
 /// Represents a single DWARF expression, whose value is location-dependent.
 /// Typically used in DW_AT_location attributes to describe the location of
 /// objects.
-struct DWARFLocationExpression {
+struct LLVM_CLASS_ABI DWARFLocationExpression {
   /// The address range in which this expression is valid. std::nullopt denotes a
   /// default entry which is valid in addresses not covered by other location
   /// expressions, or everywhere if there are no other expressions.
@@ -39,7 +39,7 @@ inline bool operator!=(const DWARFLocationExpression &L,
   return !(L == R);
 }
 
-raw_ostream &operator<<(raw_ostream &OS, const DWARFLocationExpression &Loc);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const DWARFLocationExpression &Loc);
 
 /// Represents a set of absolute location expressions.
 using DWARFLocationExpressionsVector = std::vector<DWARFLocationExpression>;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h
index 6e886abad627d5f..28314484f5c5705 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h
@@ -24,7 +24,7 @@ namespace llvm {
 // ones they need. We can't use unreachable for as many cases because the parser
 // implementation is eager and will call some of these methods even if the
 // result is not used.
-class DWARFObject {
+class LLVM_CLASS_ABI DWARFObject {
   DWARFSection Dummy;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
index 0a8571ec711d737..9bdd93fbfdb6062 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h
@@ -19,7 +19,7 @@ namespace llvm {
 
 /// RelocAddrEntry contains relocated value and section index.
 /// Section index is -1LL if relocation points to absolute symbol.
-struct RelocAddrEntry {
+struct LLVM_CLASS_ABI RelocAddrEntry {
   uint64_t SectionIndex;
   object::RelocationRef Reloc;
   uint64_t SymbolValue;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h
index d0b221165c3a64b..45cb78b9b460df2 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFSection.h
@@ -14,12 +14,12 @@
 
 namespace llvm {
 
-struct DWARFSection {
+struct LLVM_CLASS_ABI DWARFSection {
   StringRef Data;
   uint64_t Address = 0;
 };
 
-struct SectionName {
+struct LLVM_CLASS_ABI SectionName {
   StringRef Name;
   bool IsNameUnique;
 };
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
index 19212ead6626488..1c04087abf12aff 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h
@@ -22,7 +22,7 @@ class raw_ostream;
 
 // FIXME: We should have pretty printers per language. Currently we print
 // everything as if it was C++ and fall back to the TAG type name.
-struct DWARFTypePrinter {
+struct LLVM_CLASS_ABI DWARFTypePrinter {
   raw_ostream &OS;
   bool Word = true;
   bool EndedWithTemplate = false;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
index afbc3d52c3224b6..62485a46c663d8b 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h
@@ -22,7 +22,7 @@ class DWARFDebugAbbrev;
 struct DWARFSection;
 class raw_ostream;
 
-class DWARFTypeUnit : public DWARFUnit {
+class LLVM_CLASS_ABI DWARFTypeUnit : public DWARFUnit {
 public:
   DWARFTypeUnit(DWARFContext &Context, const DWARFSection &Section,
                 const DWARFUnitHeader &Header, const DWARFDebugAbbrev *DA,
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
index e70af0309bd904c..a4f1df9053ed5ac 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
@@ -51,7 +51,7 @@ class CompileUnit;
 /// Base class describing the header of any kind of "unit."  Some information
 /// is specific to certain unit types.  We separate this class out so we can
 /// parse the header before deciding what specific kind of unit to construct.
-class DWARFUnitHeader {
+class LLVM_CLASS_ABI DWARFUnitHeader {
   // Offset within section.
   uint64_t Offset = 0;
   // Version, address size, and DWARF format.
@@ -117,14 +117,14 @@ class DWARFUnitHeader {
   }
 };
 
-const DWARFUnitIndex &getDWARFUnitIndex(DWARFContext &Context,
+LLVM_FUNC_ABI const DWARFUnitIndex &getDWARFUnitIndex(DWARFContext &Context,
                                         DWARFSectionKind Kind);
 
-bool isCompileUnit(const std::unique_ptr<DWARFUnit> &U);
+LLVM_FUNC_ABI bool isCompileUnit(const std::unique_ptr<DWARFUnit> &U);
 
 /// Describe a collection of units. Intended to hold all units either from
 /// .debug_info and .debug_types, or from .debug_info.dwo and .debug_types.dwo.
-class DWARFUnitVector final : public SmallVector<std::unique_ptr<DWARFUnit>, 1> {
+class LLVM_CLASS_ABI DWARFUnitVector final : public SmallVector<std::unique_ptr<DWARFUnit>, 1> {
   std::function<std::unique_ptr<DWARFUnit>(uint64_t, DWARFSectionKind,
                                            const DWARFSection *,
                                            const DWARFUnitIndex::Entry *)>
@@ -183,7 +183,7 @@ class DWARFUnitVector final : public SmallVector<std::unique_ptr<DWARFUnit>, 1>
 
 /// Represents base address of the CU.
 /// Represents a unit's contribution to the string offsets table.
-struct StrOffsetsContributionDescriptor {
+struct LLVM_CLASS_ABI StrOffsetsContributionDescriptor {
   uint64_t Base = 0;
   /// The contribution size not including the header.
   uint64_t Size = 0;
@@ -207,7 +207,7 @@ struct StrOffsetsContributionDescriptor {
   validateContributionSize(DWARFDataExtractor &DA);
 };
 
-class DWARFUnit {
+class LLVM_CLASS_ABI DWARFUnit {
   DWARFContext &Context;
   /// Section containing this DWARFUnit.
   const DWARFSection &InfoSection;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
index 2a0dcf5e750b08d..05954def8edd90d 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h
@@ -89,15 +89,15 @@ inline const char *toString(DWARFSectionKind Kind) {
 /// The conversion depends on the version of the index section.
 /// IndexVersion is expected to be either 2 for pre-standard GNU proposal
 /// or 5 for DWARFv5 package file.
-uint32_t serializeSectionKind(DWARFSectionKind Kind, unsigned IndexVersion);
+LLVM_FUNC_ABI uint32_t serializeSectionKind(DWARFSectionKind Kind, unsigned IndexVersion);
 
 /// Convert a value read from an index section to the internal representation.
 ///
 /// The conversion depends on the index section version, which is expected
 /// to be either 2 for pre-standard GNU proposal or 5 for DWARFv5 package file.
-DWARFSectionKind deserializeSectionKind(uint32_t Value, unsigned IndexVersion);
+LLVM_FUNC_ABI DWARFSectionKind deserializeSectionKind(uint32_t Value, unsigned IndexVersion);
 
-class DWARFUnitIndex {
+class LLVM_CLASS_ABI DWARFUnitIndex {
   struct Header {
     uint32_t Version;
     uint32_t NumColumns;
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
index b57ad1d65122835..49021a9de39d3b0 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
@@ -32,7 +32,7 @@ class DataExtractor;
 struct DWARFSection;
 
 /// A class that verifies DWARF debug information given a DWARF Context.
-class DWARFVerifier {
+class LLVM_CLASS_ABI DWARFVerifier {
 public:
   /// A class that keeps the address range information for a single DIE.
   struct DieRangeInfo {
diff --git a/llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h b/llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h
index ee0241dcb11112a..b4c07eb882c2a8a 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/DwarfTransformer.h
@@ -30,7 +30,7 @@ class GsymCreator;
 /// gsym::FunctionInfo objects that includes line table information and inline
 /// function information. Creating a separate class to transform this data
 /// allows this class to be unit tested.
-class DwarfTransformer {
+class LLVM_CLASS_ABI DwarfTransformer {
 public:
 
   /// Create a DWARF transformer.
diff --git a/llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h b/llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h
index b33fcb1d204e079..b33a477c11c2359 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h
@@ -38,9 +38,9 @@ class FileWriter;
 /// encoded addresses easy to relocate as we just need to relocate one base
 /// address.
 /// @{
-AddressRange decodeRange(DataExtractor &Data, uint64_t BaseAddr,
+LLVM_FUNC_ABI AddressRange decodeRange(DataExtractor &Data, uint64_t BaseAddr,
                          uint64_t &Offset);
-void encodeRange(const AddressRange &Range, FileWriter &O, uint64_t BaseAddr);
+LLVM_FUNC_ABI void encodeRange(const AddressRange &Range, FileWriter &O, uint64_t BaseAddr);
 /// @}
 
 /// Skip an address range object in the specified data a the specified
@@ -49,15 +49,15 @@ void encodeRange(const AddressRange &Range, FileWriter &O, uint64_t BaseAddr);
 /// \param Data The binary stream to read the data from.
 ///
 /// \param Offset The byte offset within \a Data.
-void skipRange(DataExtractor &Data, uint64_t &Offset);
+LLVM_FUNC_ABI void skipRange(DataExtractor &Data, uint64_t &Offset);
 
 /// Address ranges are decoded and encoded to be relative to a base address.
 /// See the AddressRange comment for the encode and decode methods for full
 /// details.
 /// @{
-void decodeRanges(AddressRanges &Ranges, DataExtractor &Data, uint64_t BaseAddr,
+LLVM_FUNC_ABI void decodeRanges(AddressRanges &Ranges, DataExtractor &Data, uint64_t BaseAddr,
                   uint64_t &Offset);
-void encodeRanges(const AddressRanges &Ranges, FileWriter &O,
+LLVM_FUNC_ABI void encodeRanges(const AddressRanges &Ranges, FileWriter &O,
                   uint64_t BaseAddr);
 /// @}
 
@@ -69,13 +69,13 @@ void encodeRanges(const AddressRanges &Ranges, FileWriter &O,
 /// \param Offset The byte offset within \a Data.
 ///
 /// \returns The number of address ranges that were skipped.
-uint64_t skipRanges(DataExtractor &Data, uint64_t &Offset);
+LLVM_FUNC_ABI uint64_t skipRanges(DataExtractor &Data, uint64_t &Offset);
 
 } // namespace gsym
 
-raw_ostream &operator<<(raw_ostream &OS, const AddressRange &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const AddressRange &R);
 
-raw_ostream &operator<<(raw_ostream &OS, const AddressRanges &AR);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const AddressRanges &AR);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/DebugInfo/GSYM/FileEntry.h b/llvm/include/llvm/DebugInfo/GSYM/FileEntry.h
index ee27995735a68a9..ff50e4afef4ae68 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/FileEntry.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/FileEntry.h
@@ -22,7 +22,7 @@ namespace gsym {
 /// directory and basename into two different strings in the string
 /// table. This allows paths to shared commont directory and filename
 /// strings and saves space.
-struct FileEntry {
+struct LLVM_CLASS_ABI FileEntry {
 
   /// Offsets in the string table.
   /// @{
@@ -45,7 +45,7 @@ struct FileEntry {
 
 } // namespace gsym
 
-template <> struct DenseMapInfo<gsym::FileEntry> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<gsym::FileEntry> {
   static inline gsym::FileEntry getEmptyKey() {
     uint32_t key = DenseMapInfo<uint32_t>::getEmptyKey();
     return gsym::FileEntry(key, key);
diff --git a/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h b/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
index 402cef8491ae9a9..5a8d63388839ad4 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/FileWriter.h
@@ -27,7 +27,7 @@ namespace gsym {
 /// libraries to be enabled via the build process. This class needs the ability
 /// to seek to different spots in the binary stream that is produces to fixup
 /// offsets and sizes.
-class FileWriter {
+class LLVM_CLASS_ABI FileWriter {
   llvm::raw_pwrite_stream &OS;
   llvm::support::endianness ByteOrder;
 public:
diff --git a/llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h b/llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
index cfbdfe78c7ca1e2..d141541626025d8 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
@@ -87,7 +87,7 @@ class GsymReader;
 /// }
 ///
 /// Where "N" is the number of tuples.
-struct FunctionInfo {
+struct LLVM_CLASS_ABI FunctionInfo {
   AddressRange Range;
   uint32_t Name; ///< String table offset in the string table.
   std::optional<LineTable> OptLineTable;
@@ -220,7 +220,7 @@ inline bool operator<(const FunctionInfo &LHS, const FunctionInfo &RHS) {
   return LHS.OptLineTable < RHS.OptLineTable;
 }
 
-raw_ostream &operator<<(raw_ostream &OS, const FunctionInfo &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const FunctionInfo &R);
 
 } // namespace gsym
 } // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h b/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
index 5e5f6287bfdd417..34f68a5c1c6e569 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
@@ -131,7 +131,7 @@ class FileWriter;
 /// FunctionInfo objects. Each encoded FunctionInfo's data is pointed to by an
 /// entry in the Function Info Offsets Table. For details on the exact encoding
 /// of FunctionInfo objects, see "llvm/DebugInfo/GSYM/FunctionInfo.h".
-class GsymCreator {
+class LLVM_CLASS_ABI GsymCreator {
   // Private member variables require Mutex protections
   mutable std::mutex Mutex;
   std::vector<FunctionInfo> Funcs;
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h b/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
index 885b6297de07865..1a940252c4a315e 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/GsymReader.h
@@ -42,7 +42,7 @@ namespace gsym {
 /// GsymReader objects must use one of the static functions to create an
 /// instance: GsymReader::openFile(...) and GsymReader::copyBuffer(...).
 
-class GsymReader {
+class LLVM_CLASS_ABI GsymReader {
   GsymReader(std::unique_ptr<MemoryBuffer> Buffer);
   llvm::Error parse();
 
diff --git a/llvm/include/llvm/DebugInfo/GSYM/Header.h b/llvm/include/llvm/DebugInfo/GSYM/Header.h
index 1198ef73cb2bd92..b34f91bbdfa629f 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/Header.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/Header.h
@@ -43,7 +43,7 @@ constexpr size_t GSYM_MAX_UUID_SIZE = 20;
 /// of the file (stand alone GSYM file) or section data (GSYM in a section).
 /// When endianness is swapped, the Header::decode() function should be used to
 /// decode the header.
-struct Header {
+struct LLVM_CLASS_ABI Header {
   /// The magic bytes should be set to GSYM_MAGIC. This helps detect if a file
   /// is a GSYM file by scanning the first 4 bytes of a file or section.
   /// This value might appear byte swapped
@@ -121,8 +121,8 @@ struct Header {
   llvm::Error encode(FileWriter &O) const;
 };
 
-bool operator==(const Header &LHS, const Header &RHS);
-raw_ostream &operator<<(raw_ostream &OS, const llvm::gsym::Header &H);
+LLVM_FUNC_ABI bool operator==(const Header &LHS, const Header &RHS);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const llvm::gsym::Header &H);
 
 } // namespace gsym
 } // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h b/llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h
index f414665c2155e55..73b8b61fd6c4dde 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h
@@ -57,7 +57,7 @@ class GsymReader;
 /// - if this object has children, enocode each child InlineInfo using the
 ///   the first address range's start address as the base address.
 ///
-struct InlineInfo {
+struct LLVM_CLASS_ABI InlineInfo {
 
   uint32_t Name; ///< String table offset in the string table.
   uint32_t CallFile; ///< 1 based file index in the file table.
@@ -173,7 +173,7 @@ inline bool operator==(const InlineInfo &LHS, const InlineInfo &RHS) {
          LHS.Children == RHS.Children;
 }
 
-raw_ostream &operator<<(raw_ostream &OS, const InlineInfo &FI);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const InlineInfo &FI);
 
 } // namespace gsym
 } // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/GSYM/LineEntry.h b/llvm/include/llvm/DebugInfo/GSYM/LineEntry.h
index 968fdebb8b0b6d0..8b574a829cfb10a 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/LineEntry.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/LineEntry.h
@@ -20,7 +20,7 @@ namespace gsym {
 /// address, file and line of the line table row for a given address. The
 /// size of a line table entry is calculated by looking at the next entry
 /// in the FunctionInfo's vector of entries.
-struct LineEntry {
+struct LLVM_CLASS_ABI LineEntry {
   uint64_t Addr; ///< Start address of this line entry.
   uint32_t File; ///< 1 based index of file in FileTable
   uint32_t Line; ///< Source line number.
diff --git a/llvm/include/llvm/DebugInfo/GSYM/LineTable.h b/llvm/include/llvm/DebugInfo/GSYM/LineTable.h
index b3232f077779bb3..f3cc6ebfe1c891d 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/LineTable.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/LineTable.h
@@ -116,7 +116,7 @@ class FileWriter;
 /// Opcodes that will push "Row" onto the LineEntry.Lines include the
 /// LTOC_AdvancePC opcode and all special opcodes. All other opcodes
 /// only modify the current "Row", or cause the line table to end.
-class LineTable {
+class LLVM_CLASS_ABI LineTable {
   typedef std::vector<gsym::LineEntry> Collection;
   Collection Lines; ///< All line entries in the line table.
 public:
@@ -226,7 +226,7 @@ class LineTable {
 
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const gsym::LineTable &LT);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const gsym::LineTable &LT);
 
 } // namespace gsym
 } // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h b/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h
index bf64998c9e84ede..94d852d477f2ddf 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h
@@ -19,7 +19,7 @@ namespace llvm {
 class raw_ostream;
 namespace gsym {
 
-struct SourceLocation {
+struct LLVM_CLASS_ABI SourceLocation {
   StringRef Name;      ///< Function or symbol name.
   StringRef Dir;       ///< Line entry source file directory path.
   StringRef Base;      ///< Line entry source file basename.
@@ -32,11 +32,11 @@ inline bool operator==(const SourceLocation &LHS, const SourceLocation &RHS) {
          LHS.Line == RHS.Line && LHS.Offset == RHS.Offset;
 }
 
-raw_ostream &operator<<(raw_ostream &OS, const SourceLocation &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SourceLocation &R);
 
 using SourceLocations = std::vector<SourceLocation>;
 
-struct LookupResult {
+struct LLVM_CLASS_ABI LookupResult {
   uint64_t LookupAddr = 0; ///< The address that this lookup pertains to.
   AddressRange FuncRange;  ///< The concrete function address range.
   StringRef FuncName; ///< The concrete function name that contains LookupAddr.
@@ -63,7 +63,7 @@ inline bool operator==(const LookupResult &LHS, const LookupResult &RHS) {
   return LHS.Locations == RHS.Locations;
 }
 
-raw_ostream &operator<<(raw_ostream &OS, const LookupResult &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const LookupResult &R);
 
 } // namespace gsym
 } // namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h b/llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h
index 600fc531b8ba8ac..ad9739587781e4a 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/ObjectFileTransformer.h
@@ -24,7 +24,7 @@ namespace gsym {
 
 class GsymCreator;
 
-class ObjectFileTransformer {
+class LLVM_CLASS_ABI ObjectFileTransformer {
 public:
   /// Extract any object file data that is needed by the GsymCreator.
   ///
diff --git a/llvm/include/llvm/DebugInfo/GSYM/StringTable.h b/llvm/include/llvm/DebugInfo/GSYM/StringTable.h
index 3ad4db78a0feab4..79f81ceb6a1da12 100644
--- a/llvm/include/llvm/DebugInfo/GSYM/StringTable.h
+++ b/llvm/include/llvm/DebugInfo/GSYM/StringTable.h
@@ -19,7 +19,7 @@ namespace gsym {
 
 /// String tables in GSYM files are required to start with an empty
 /// string at offset zero. Strings must be UTF8 NULL terminated strings.
-struct StringTable {
+struct LLVM_CLASS_ABI StringTable {
   StringRef Data;
   StringTable() = default;
   StringTable(StringRef D) : Data(D) {}
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h
index 677c91b616c0f1f..9f7d711dd86b879 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVCompare.h
@@ -26,7 +26,7 @@ class LVReader;
 using LVPassEntry = std::tuple<LVReader *, LVElement *, LVComparePass>;
 using LVPassTable = std::vector<LVPassEntry>;
 
-class LVCompare final {
+class LLVM_CLASS_ABI LVCompare final {
   raw_ostream &OS;
   LVScopes ScopeStack;
 
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
index 21bf3234d9e8a5b..321b1838ecd2418 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h
@@ -65,7 +65,7 @@ using LVElementKindSet = std::set<LVElementKind>;
 using LVElementDispatch = std::map<LVElementKind, LVElementGetFunction>;
 using LVElementRequest = std::vector<LVElementGetFunction>;
 
-class LVElement : public LVObject {
+class LLVM_CLASS_ABI LVElement : public LVObject {
   enum class Property {
     IsLine,   // A logical line.
     IsScope,  // A logical scope.
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h
index a57a1e4da49c28e..600bec099f31ec4 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h
@@ -38,7 +38,7 @@ using LVLineDispatch = std::map<LVLineKind, LVLineGetFunction>;
 using LVLineRequest = std::vector<LVLineGetFunction>;
 
 // Class to represent a logical line.
-class LVLine : public LVElement {
+class LLVM_CLASS_ABI LVLine : public LVElement {
   // Typed bitvector with kinds for this line.
   LVProperties<LVLineKind> Kinds;
   static LVLineDispatch Dispatch;
@@ -112,7 +112,7 @@ class LVLine : public LVElement {
 };
 
 // Class to represent a DWARF line record object.
-class LVLineDebug final : public LVLine {
+class LLVM_CLASS_ABI LVLineDebug final : public LVLine {
   // Discriminator value (DW_LNE_set_discriminator). The DWARF standard
   // defines the discriminator as an unsigned LEB128 integer.
   uint32_t Discriminator = 0;
@@ -141,7 +141,7 @@ class LVLineDebug final : public LVLine {
 };
 
 // Class to represent an assembler line extracted from the text section.
-class LVLineAssembler final : public LVLine {
+class LLVM_CLASS_ABI LVLineAssembler final : public LVLine {
 public:
   LVLineAssembler() : LVLine() { setIsLineAssembler(); }
   LVLineAssembler(const LVLineAssembler &) = delete;
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h
index a552b2cb44ac108..5212d59199aeb68 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h
@@ -25,7 +25,7 @@ using LVLineRange = std::pair<LVLine *, LVLine *>;
 // The DW_AT_data_member_location attribute is a simple member offset.
 const LVSmall LVLocationMemberOffset = 0;
 
-class LVOperation final {
+class LLVM_CLASS_ABI LVOperation final {
   // To describe an operation:
   // OpCode
   // Operands[0]: First operand.
@@ -55,7 +55,7 @@ class LVOperation final {
 #endif
 };
 
-class LVLocation : public LVObject {
+class LLVM_CLASS_ABI LVLocation : public LVObject {
   enum class Property {
     IsAddressRange,
     IsBaseClassOffset,
@@ -165,7 +165,7 @@ class LVLocation : public LVObject {
 #endif
 };
 
-class LVLocationSymbol final : public LVLocation {
+class LLVM_CLASS_ABI LVLocationSymbol final : public LVLocation {
   // Location descriptors for the active range.
   std::unique_ptr<LVOperations> Entries;
 
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
index b34c60994e952ab..ddbb9423a885c45 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
@@ -56,11 +56,11 @@ class LVType;
 class LVOptions;
 class LVPatterns;
 
-StringRef typeNone();
-StringRef typeVoid();
-StringRef typeInt();
-StringRef typeUnknown();
-StringRef emptyString();
+LLVM_FUNC_ABI StringRef typeNone();
+LLVM_FUNC_ABI StringRef typeVoid();
+LLVM_FUNC_ABI StringRef typeInt();
+LLVM_FUNC_ABI StringRef typeUnknown();
+LLVM_FUNC_ABI StringRef emptyString();
 
 using LVElementSetFunction = void (LVElement::*)();
 using LVElementGetFunction = bool (LVElement::*)() const;
@@ -94,7 +94,7 @@ enum class LVComparePass { Missing, Added };
 using LVValidLocation = bool (LVLocation::*)();
 
 // Keep counters of objects.
-struct LVCounter {
+struct LLVM_CLASS_ABI LVCounter {
   unsigned Lines = 0;
   unsigned Scopes = 0;
   unsigned Symbols = 0;
@@ -107,7 +107,7 @@ struct LVCounter {
   }
 };
 
-class LVObject {
+class LLVM_CLASS_ABI LVObject {
   enum class Property {
     IsLocation,          // Location.
     IsGlobalReference,   // This object is being referenced from another CU.
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
index 7a8c00957db9d7e..5627018e056ed60 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVOptions.h
@@ -195,7 +195,7 @@ using LVInternalKindSet = std::set<LVInternalKind>;
 // members that in very few cases point to a command option (see associated
 // comment). Other cases for 'bool' refers to internal values derivated from
 // the command options.
-class LVOptions {
+class LLVM_CLASS_ABI LVOptions {
   class LVAttribute {
   public:
     LVAttributeKindSet Kinds; // --attribute=<Kind>
@@ -446,7 +446,7 @@ class LVOptions {
 inline LVOptions &options() { return (*LVOptions::getOptions()); }
 inline void setOptions(LVOptions *Options) { LVOptions::setOptions(Options); }
 
-class LVPatterns final {
+class LLVM_CLASS_ABI LVPatterns final {
   // Pattern Mode.
   enum class LVMatchMode {
     None = 0, // No given pattern.
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h
index 6e41cd9fc76cb63..f96162410c52914 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h
@@ -23,7 +23,7 @@ namespace logicalview {
 
 using LVAddressRange = std::pair<LVAddress, LVAddress>;
 
-class LVRangeEntry final {
+class LLVM_CLASS_ABI LVRangeEntry final {
   LVAddress Lower = 0;
   LVAddress Upper = 0;
   LVScope *Scope = nullptr;
@@ -47,7 +47,7 @@ class LVRangeEntry final {
 // scope; the addresses are stored in ascending order and can overlap.
 using LVRangeEntries = std::vector<LVRangeEntry>;
 
-class LVRange final : public LVObject {
+class LLVM_CLASS_ABI LVRange final : public LVObject {
   /// Map of where a user value is live, and its location.
   using LVRangesTree = IntervalTree<LVAddress, LVScope *>;
   using LVAllocator = LVRangesTree::Allocator;
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h
index 213419d1a22c7d0..7d4cadc757de38e 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVReader.h
@@ -31,7 +31,7 @@ constexpr LVSectionIndex UndefinedSectionIndex = 0;
 class LVScopeCompileUnit;
 class LVObject;
 
-class LVSplitContext final {
+class LLVM_CLASS_ABI LVSplitContext final {
   std::unique_ptr<ToolOutputFile> OutputFile;
   std::string Location;
 
@@ -58,7 +58,7 @@ class LVSplitContext final {
 /// The logical reader owns of all the logical elements created during
 /// the debug information parsing. For its creation it uses a specific
 ///  bump allocator for each type of logical element.
-class LVReader {
+class LLVM_CLASS_ABI LVReader {
   LVBinaryType BinaryType;
 
   // Context used by '--output=split' command line option.
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
index 058e4f3e6dd5126..7b45e38488fc419 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
@@ -71,7 +71,7 @@ using LVOffsetSymbolMap = std::map<LVOffset, LVSymbol *>;
 using LVTagOffsetsMap = std::map<dwarf::Tag, LVOffsets>;
 
 // Class to represent a DWARF Scope.
-class LVScope : public LVElement {
+class LLVM_CLASS_ABI LVScope : public LVElement {
   enum class Property {
     HasDiscriminator,
     CanHaveRanges,
@@ -324,7 +324,7 @@ class LVScope : public LVElement {
 };
 
 // Class to represent a DWARF Union/Structure/Class.
-class LVScopeAggregate final : public LVScope {
+class LLVM_CLASS_ABI LVScopeAggregate final : public LVScope {
   LVScope *Reference = nullptr; // DW_AT_specification, DW_AT_abstract_origin.
   size_t EncodedArgsIndex = 0;  // Template encoded arguments.
 
@@ -362,7 +362,7 @@ class LVScopeAggregate final : public LVScope {
 };
 
 // Class to represent a DWARF Template alias.
-class LVScopeAlias final : public LVScope {
+class LLVM_CLASS_ABI LVScopeAlias final : public LVScope {
 public:
   LVScopeAlias() : LVScope() {
     setIsTemplateAlias();
@@ -379,7 +379,7 @@ class LVScopeAlias final : public LVScope {
 };
 
 // Class to represent a DWARF array (DW_TAG_array_type).
-class LVScopeArray final : public LVScope {
+class LLVM_CLASS_ABI LVScopeArray final : public LVScope {
 public:
   LVScopeArray() : LVScope() { setIsArray(); }
   LVScopeArray(const LVScopeArray &) = delete;
@@ -395,7 +395,7 @@ class LVScopeArray final : public LVScope {
 };
 
 // Class to represent a DWARF Compilation Unit (CU).
-class LVScopeCompileUnit final : public LVScope {
+class LLVM_CLASS_ABI LVScopeCompileUnit final : public LVScope {
   // Names (files and directories) used by the Compile Unit.
   std::vector<size_t> Filenames;
 
@@ -615,7 +615,7 @@ class LVScopeCompileUnit final : public LVScope {
 };
 
 // Class to represent a DWARF enumerator (DW_TAG_enumeration_type).
-class LVScopeEnumeration final : public LVScope {
+class LLVM_CLASS_ABI LVScopeEnumeration final : public LVScope {
 public:
   LVScopeEnumeration() : LVScope() { setIsEnumeration(); }
   LVScopeEnumeration(const LVScopeEnumeration &) = delete;
@@ -630,7 +630,7 @@ class LVScopeEnumeration final : public LVScope {
 
 // Class to represent a DWARF formal parameter pack
 // (DW_TAG_GNU_formal_parameter_pack).
-class LVScopeFormalPack final : public LVScope {
+class LLVM_CLASS_ABI LVScopeFormalPack final : public LVScope {
 public:
   LVScopeFormalPack() : LVScope() { setIsTemplatePack(); }
   LVScopeFormalPack(const LVScopeFormalPack &) = delete;
@@ -644,7 +644,7 @@ class LVScopeFormalPack final : public LVScope {
 };
 
 // Class to represent a DWARF Function.
-class LVScopeFunction : public LVScope {
+class LLVM_CLASS_ABI LVScopeFunction : public LVScope {
   LVScope *Reference = nullptr; // DW_AT_specification, DW_AT_abstract_origin.
   size_t LinkageNameIndex = 0;  // Function DW_AT_linkage_name attribute.
   size_t EncodedArgsIndex = 0;  // Template encoded arguments.
@@ -696,7 +696,7 @@ class LVScopeFunction : public LVScope {
 };
 
 // Class to represent a DWARF inlined function.
-class LVScopeFunctionInlined final : public LVScopeFunction {
+class LLVM_CLASS_ABI LVScopeFunctionInlined final : public LVScopeFunction {
   size_t CallFilenameIndex = 0;
   uint32_t CallLineNumber = 0;
   uint32_t Discriminator = 0;
@@ -739,7 +739,7 @@ class LVScopeFunctionInlined final : public LVScopeFunction {
 };
 
 // Class to represent a DWARF subroutine type.
-class LVScopeFunctionType final : public LVScopeFunction {
+class LLVM_CLASS_ABI LVScopeFunctionType final : public LVScopeFunction {
 public:
   LVScopeFunctionType() : LVScopeFunction() { setIsFunctionType(); }
   LVScopeFunctionType(const LVScopeFunctionType &) = delete;
@@ -750,7 +750,7 @@ class LVScopeFunctionType final : public LVScopeFunction {
 };
 
 // Class to represent a DWARF Namespace.
-class LVScopeNamespace final : public LVScope {
+class LLVM_CLASS_ABI LVScopeNamespace final : public LVScope {
   LVScope *Reference = nullptr; // Reference to DW_AT_extension attribute.
 
 public:
@@ -780,7 +780,7 @@ class LVScopeNamespace final : public LVScope {
 };
 
 // Class to represent the binary file being analyzed.
-class LVScopeRoot final : public LVScope {
+class LLVM_CLASS_ABI LVScopeRoot final : public LVScope {
   size_t FileFormatNameIndex = 0;
 
 public:
@@ -814,7 +814,7 @@ class LVScopeRoot final : public LVScope {
 
 // Class to represent a DWARF template parameter pack
 // (DW_TAG_GNU_template_parameter_pack).
-class LVScopeTemplatePack final : public LVScope {
+class LLVM_CLASS_ABI LVScopeTemplatePack final : public LVScope {
 public:
   LVScopeTemplatePack() : LVScope() { setIsTemplatePack(); }
   LVScopeTemplatePack(const LVScopeTemplatePack &) = delete;
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h
index 2086d08eab84c5d..cf33705d72a4fba 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSort.h
@@ -35,17 +35,17 @@ using LVSortFunction = LVSortValue (*)(const LVObject *LHS,
                                        const LVObject *RHS);
 
 // Get the comparator function, based on the command line options.
-LVSortFunction getSortFunction();
+LLVM_FUNC_ABI LVSortFunction getSortFunction();
 
 // Comparator functions that can be used for sorting.
-LVSortValue compareKind(const LVObject *LHS, const LVObject *RHS);
-LVSortValue compareLine(const LVObject *LHS, const LVObject *RHS);
-LVSortValue compareName(const LVObject *LHS, const LVObject *RHS);
-LVSortValue compareOffset(const LVObject *LHS, const LVObject *RHS);
-LVSortValue compareRange(const LVObject *LHS, const LVObject *RHS);
-LVSortValue sortByKind(const LVObject *LHS, const LVObject *RHS);
-LVSortValue sortByLine(const LVObject *LHS, const LVObject *RHS);
-LVSortValue sortByName(const LVObject *LHS, const LVObject *RHS);
+LLVM_FUNC_ABI LVSortValue compareKind(const LVObject *LHS, const LVObject *RHS);
+LLVM_FUNC_ABI LVSortValue compareLine(const LVObject *LHS, const LVObject *RHS);
+LLVM_FUNC_ABI LVSortValue compareName(const LVObject *LHS, const LVObject *RHS);
+LLVM_FUNC_ABI LVSortValue compareOffset(const LVObject *LHS, const LVObject *RHS);
+LLVM_FUNC_ABI LVSortValue compareRange(const LVObject *LHS, const LVObject *RHS);
+LLVM_FUNC_ABI LVSortValue sortByKind(const LVObject *LHS, const LVObject *RHS);
+LLVM_FUNC_ABI LVSortValue sortByLine(const LVObject *LHS, const LVObject *RHS);
+LLVM_FUNC_ABI LVSortValue sortByName(const LVObject *LHS, const LVObject *RHS);
 
 } // end namespace logicalview
 } // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
index e10b99730a7ab03..778613cc5fa6aab 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h
@@ -26,7 +26,7 @@
 namespace llvm {
 namespace logicalview {
 
-class LVStringPool {
+class LLVM_CLASS_ABI LVStringPool {
   static constexpr size_t BadIndex = std::numeric_limits<size_t>::max();
   using TableType = StringMap<size_t, BumpPtrAllocator>;
   using ValueType = TableType::value_type;
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
index c3ee07a2b244e38..577e51510f02de6 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h
@@ -30,7 +30,7 @@ namespace llvm {
 namespace logicalview {
 
 // Returns the unique string pool instance.
-LVStringPool &getStringPool();
+LLVM_FUNC_ABI LVStringPool &getStringPool();
 
 using LVStringRefs = std::vector<StringRef>;
 using LVLexicalComponent = std::tuple<StringRef, StringRef>;
@@ -38,7 +38,7 @@ using LVLexicalIndex =
     std::tuple<LVStringRefs::size_type, LVStringRefs::size_type>;
 
 // Used to record specific characteristics about the objects.
-template <typename T> class LVProperties {
+template <typename T> class LLVM_CLASS_ABI LVProperties {
   SmallBitVector Bits = SmallBitVector(static_cast<unsigned>(T::LastEntry) + 1);
 
 public:
@@ -142,7 +142,7 @@ void addItem(MapType *Map, KeyType Key, ValueType Value) {
 
 // Double map data structure.
 template <typename FirstKeyType, typename SecondKeyType, typename ValueType>
-class LVDoubleMap {
+class LLVM_CLASS_ABI LVDoubleMap {
   static_assert(std::is_pointer<ValueType>::value,
                 "ValueType must be a pointer.");
   using LVSecondMapType = std::map<SecondKeyType, ValueType>;
@@ -212,8 +212,8 @@ class LVDoubleMap {
 };
 
 // Unified and flattened pathnames.
-std::string transformPath(StringRef Path);
-std::string flattenedFilePath(StringRef Path);
+LLVM_FUNC_ABI std::string transformPath(StringRef Path);
+LLVM_FUNC_ABI std::string flattenedFilePath(StringRef Path);
 
 inline std::string formattedKind(StringRef Kind) {
   return (Twine("{") + Twine(Kind) + Twine("}")).str();
@@ -231,9 +231,9 @@ inline std::string formattedNames(StringRef Name1, StringRef Name2) {
 // scopes, such as: name, name<..>, scope::name, scope::..::name, etc.
 // The string can have multiple references to template instantiations.
 // It returns the inner most component.
-LVLexicalComponent getInnerComponent(StringRef Name);
-LVStringRefs getAllLexicalComponents(StringRef Name);
-std::string getScopedName(const LVStringRefs &Components,
+LLVM_FUNC_ABI LVLexicalComponent getInnerComponent(StringRef Name);
+LLVM_FUNC_ABI LVStringRefs getAllLexicalComponents(StringRef Name);
+LLVM_FUNC_ABI std::string getScopedName(const LVStringRefs &Components,
                           StringRef BaseName = {});
 
 // These are the values assigned to the debug location record IDs.
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h
index 5ab45e2fa5678f9..4a268bc8d7564be 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h
@@ -34,7 +34,7 @@ using LVSymbolKindSet = std::set<LVSymbolKind>;
 using LVSymbolDispatch = std::map<LVSymbolKind, LVSymbolGetFunction>;
 using LVSymbolRequest = std::vector<LVSymbolGetFunction>;
 
-class LVSymbol final : public LVElement {
+class LLVM_CLASS_ABI LVSymbol final : public LVElement {
   enum class Property { HasLocation, FillGaps, LastEntry };
 
   // Typed bitvector with kinds and properties for this symbol.
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h
index b2d2702b2e229fe..0436f36ce1fc9d4 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h
@@ -49,7 +49,7 @@ using LVTypeDispatch = std::map<LVTypeKind, LVTypeGetFunction>;
 using LVTypeRequest = std::vector<LVTypeGetFunction>;
 
 // Class to represent a DWARF Type.
-class LVType : public LVElement {
+class LLVM_CLASS_ABI LVType : public LVElement {
   enum class Property { IsSubrangeCount, LastEntry };
 
   // Typed bitvector with kinds and properties for this type.
@@ -146,7 +146,7 @@ class LVType : public LVElement {
 };
 
 // Class to represent DW_TAG_typedef_type.
-class LVTypeDefinition final : public LVType {
+class LLVM_CLASS_ABI LVTypeDefinition final : public LVType {
 public:
   LVTypeDefinition() : LVType() {
     setIsTypedef();
@@ -169,7 +169,7 @@ class LVTypeDefinition final : public LVType {
 };
 
 // Class to represent a DW_TAG_enumerator.
-class LVTypeEnumerator final : public LVType {
+class LLVM_CLASS_ABI LVTypeEnumerator final : public LVType {
   // Index in the String pool representing any initial value.
   size_t ValueIndex = 0;
 
@@ -198,7 +198,7 @@ class LVTypeEnumerator final : public LVType {
 };
 
 // Class to represent DW_TAG_imported_module / DW_TAG_imported_declaration.
-class LVTypeImport final : public LVType {
+class LLVM_CLASS_ABI LVTypeImport final : public LVType {
 public:
   LVTypeImport() : LVType() { setIncludeInPrint(); }
   LVTypeImport(const LVTypeImport &) = delete;
@@ -212,7 +212,7 @@ class LVTypeImport final : public LVType {
 };
 
 // Class to represent a DWARF Template parameter holder (type or param).
-class LVTypeParam final : public LVType {
+class LLVM_CLASS_ABI LVTypeParam final : public LVType {
   // Index in the String pool representing any initial value.
   size_t ValueIndex = 0;
 
@@ -241,7 +241,7 @@ class LVTypeParam final : public LVType {
 };
 
 // Class to represent a DW_TAG_subrange_type.
-class LVTypeSubrange final : public LVType {
+class LLVM_CLASS_ABI LVTypeSubrange final : public LVType {
   // Values describing the subrange bounds.
   int64_t LowerBound = 0; // DW_AT_lower_bound or DW_AT_count value.
   int64_t UpperBound = 0; // DW_AT_upper_bound value.
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h b/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h
index 9a8a6fd4a4095d3..620df35e6c4dd5b 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h
@@ -39,7 +39,7 @@ using PdbOrObj = PointerUnion<object::ObjectFile *, pdb::PDBFile *>;
 // - Prints and compares the logical views.
 //
 // The supported binary formats are: ELF, Mach-O and CodeView.
-class LVReaderHandler {
+class LLVM_CLASS_ABI LVReaderHandler {
   ArgVector &Objects;
   ScopedPrinter &W;
   raw_ostream &OS;
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
index 911af0e7891bbd3..41286f33185ae5c 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h
@@ -34,7 +34,7 @@ namespace logicalview {
 constexpr bool UpdateHighAddress = false;
 
 // Logical scope, Section address, Section index, IsComdat.
-struct LVSymbolTableEntry final {
+struct LLVM_CLASS_ABI LVSymbolTableEntry final {
   LVScope *Scope = nullptr;
   LVAddress Address = 0;
   LVSectionIndex SectionIndex = 0;
@@ -47,7 +47,7 @@ struct LVSymbolTableEntry final {
 };
 
 // Function names extracted from the object symbol table.
-class LVSymbolTable final {
+class LLVM_CLASS_ABI LVSymbolTable final {
   using LVSymbolNames = std::map<std::string, LVSymbolTableEntry>;
   LVSymbolNames SymbolNames;
 
@@ -67,7 +67,7 @@ class LVSymbolTable final {
   void print(raw_ostream &OS);
 };
 
-class LVBinaryReader : public LVReader {
+class LLVM_CLASS_ABI LVBinaryReader : public LVReader {
   // Function names extracted from the object symbol table.
   LVSymbolTable SymbolTable;
 
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h
index f419b348f08a6f5..3700fb3ca8d3537 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h
@@ -29,7 +29,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-template <> struct BinaryItemTraits<codeview::CVType> {
+template <> struct LLVM_CLASS_ABI BinaryItemTraits<codeview::CVType> {
   static size_t length(const codeview::CVType &Item) { return Item.length(); }
   static ArrayRef<uint8_t> bytes(const codeview::CVType &Item) {
     return Item.data();
@@ -65,7 +65,7 @@ using LVNames = SmallVector<StringRef, 16>;
 // As the CodeView constants are different to the DWARF constants, the
 // CodeView reader will map them to the DWARF ones.
 
-class LVCodeViewReader final : public LVBinaryReader {
+class LLVM_CLASS_ABI LVCodeViewReader final : public LVBinaryReader {
   friend class LVTypeVisitor;
   friend class LVSymbolVisitor;
   friend class LVSymbolVisitorDelegate;
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h
index d23ff9d64310929..ac1ef19740e105c 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.h
@@ -38,7 +38,7 @@ class LVCodeViewReader;
 class LVLogicalVisitor;
 struct LVShared;
 
-class LVTypeVisitor final : public TypeVisitorCallbacks {
+class LLVM_CLASS_ABI LVTypeVisitor final : public TypeVisitorCallbacks {
   ScopedPrinter &W;
   LVLogicalVisitor *LogicalVisitor;
   LazyRandomTypeCollection &Types;
@@ -84,7 +84,7 @@ class LVTypeVisitor final : public TypeVisitorCallbacks {
   Error visitUnknownType(CVType &Record) override;
 };
 
-class LVSymbolVisitorDelegate final : public SymbolVisitorDelegate {
+class LLVM_CLASS_ABI LVSymbolVisitorDelegate final : public SymbolVisitorDelegate {
   LVCodeViewReader *Reader;
   const llvm::object::coff_section *CoffSection;
   StringRef SectionContents;
@@ -123,7 +123,7 @@ class LVSymbol;
 class LVType;
 
 // Visitor for CodeView symbol streams found in COFF object files and PDB files.
-class LVSymbolVisitor final : public SymbolVisitorCallbacks {
+class LLVM_CLASS_ABI LVSymbolVisitor final : public SymbolVisitorCallbacks {
   LVCodeViewReader *Reader;
   ScopedPrinter &W;
   LVLogicalVisitor *LogicalVisitor;
@@ -229,7 +229,7 @@ class LVSymbolVisitor final : public SymbolVisitorCallbacks {
 };
 
 // Visitor for CodeView types and symbols to populate elements.
-class LVLogicalVisitor final {
+class LLVM_CLASS_ABI LVLogicalVisitor final {
   LVCodeViewReader *Reader;
   ScopedPrinter &W;
 
diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h
index da210ec1ee19007..d562b18329dfac4 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Readers/LVELFReader.h
@@ -31,7 +31,7 @@ class LVType;
 
 using AttributeSpec = DWARFAbbreviationDeclaration::AttributeSpec;
 
-class LVELFReader final : public LVBinaryReader {
+class LLVM_CLASS_ABI LVELFReader final : public LVBinaryReader {
   object::ObjectFile &Obj;
 
   // Indicates if ranges data are available; in the case of split DWARF any
diff --git a/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h b/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h
index 9e096f7c15b90b7..3ec2d2f2d39c1e5 100644
--- a/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h
+++ b/llvm/include/llvm/DebugInfo/MSF/IMSFFile.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace msf {
 
-class IMSFFile {
+class LLVM_CLASS_ABI IMSFFile {
 public:
   virtual ~IMSFFile() = default;
 
diff --git a/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h b/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h
index ae18bc5ea728aa9..dfd25d15df3913b 100644
--- a/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h
+++ b/llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h
@@ -25,7 +25,7 @@ namespace msf {
 
 struct MSFLayout;
 
-class MSFBuilder {
+class LLVM_CLASS_ABI MSFBuilder {
 public:
   /// Create a new `MSFBuilder`.
   ///
diff --git a/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h b/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h
index 3009532608dc65d..520dd1ec179dce2 100644
--- a/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h
+++ b/llvm/include/llvm/DebugInfo/MSF/MSFCommon.h
@@ -29,7 +29,7 @@ static const char Magic[] = {'M',  'i',  'c',    'r', 'o', 's',  'o',  'f',
 // The superblock is overlaid at the beginning of the file (offset 0).
 // It starts with a magic header and is followed by information which
 // describes the layout of the file system.
-struct SuperBlock {
+struct LLVM_CLASS_ABI SuperBlock {
   char MagicBytes[sizeof(Magic)];
   // The file system is split into a variable number of fixed size elements.
   // These elements are referred to as blocks.  The size of a block may vary
@@ -49,7 +49,7 @@ struct SuperBlock {
   support::ulittle32_t BlockMapAddr;
 };
 
-struct MSFLayout {
+struct LLVM_CLASS_ABI MSFLayout {
   MSFLayout() = default;
 
   uint32_t mainFpmBlock() const {
@@ -75,7 +75,7 @@ struct MSFLayout {
 /// from a particular MSF Stream, we fill out a stream layout structure and the
 /// reader uses it to determine which blocks in the underlying MSF file contain
 /// the data, so that it can be pieced together in the right order.
-class MSFStreamLayout {
+class LLVM_CLASS_ABI MSFStreamLayout {
 public:
   uint32_t Length;
   std::vector<support::ulittle32_t> Blocks;
@@ -84,7 +84,7 @@ class MSFStreamLayout {
 /// Determine the layout of the FPM stream, given the MSF layout.  An FPM
 /// stream spans 1 or more blocks, each at equally spaced intervals throughout
 /// the file.
-MSFStreamLayout getFpmStreamLayout(const MSFLayout &Msf,
+LLVM_FUNC_ABI MSFStreamLayout getFpmStreamLayout(const MSFLayout &Msf,
                                    bool IncludeUnusedFpmData = false,
                                    bool AltFpm = false);
 
@@ -177,7 +177,7 @@ inline uint32_t getNumFpmIntervals(const MSFLayout &L,
                             AltFpm ? L.alternateFpmBlock() : L.mainFpmBlock());
 }
 
-Error validateSuperBlock(const SuperBlock &SB);
+LLVM_FUNC_ABI Error validateSuperBlock(const SuperBlock &SB);
 
 } // end namespace msf
 } // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/MSF/MSFError.h b/llvm/include/llvm/DebugInfo/MSF/MSFError.h
index 8360073508228f2..01deff5828fe060 100644
--- a/llvm/include/llvm/DebugInfo/MSF/MSFError.h
+++ b/llvm/include/llvm/DebugInfo/MSF/MSFError.h
@@ -32,19 +32,19 @@ enum class msf_error_code {
 
 namespace std {
 template <>
-struct is_error_code_enum<llvm::msf::msf_error_code> : std::true_type {};
+struct LLVM_CLASS_ABI is_error_code_enum<llvm::msf::msf_error_code> : std::true_type {};
 } // namespace std
 
 namespace llvm {
 namespace msf {
-const std::error_category &MSFErrCategory();
+LLVM_FUNC_ABI const std::error_category &MSFErrCategory();
 
 inline std::error_code make_error_code(msf_error_code E) {
   return std::error_code(static_cast<int>(E), MSFErrCategory());
 }
 
 /// Base class for errors originating when parsing raw PDB files
-class MSFError : public ErrorInfo<MSFError, StringError> {
+class LLVM_CLASS_ABI MSFError : public ErrorInfo<MSFError, StringError> {
 public:
   using ErrorInfo<MSFError, StringError>::ErrorInfo; // inherit constructors
   MSFError(const Twine &S) : ErrorInfo(S, msf_error_code::unspecified) {}
diff --git a/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h b/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h
index 5ac36a0e53bee29..b87de8482065e8f 100644
--- a/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h
+++ b/llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h
@@ -35,7 +35,7 @@ namespace msf {
 /// the MSF.  MappedBlockStream provides methods for reading from and writing
 /// to one of these streams transparently, as if it were a contiguous sequence
 /// of bytes.
-class MappedBlockStream : public BinaryStream {
+class LLVM_CLASS_ABI MappedBlockStream : public BinaryStream {
   friend class WritableMappedBlockStream;
 
 public:
@@ -103,7 +103,7 @@ class MappedBlockStream : public BinaryStream {
   DenseMap<uint32_t, std::vector<CacheEntry>> CacheMap;
 };
 
-class WritableMappedBlockStream : public WritableBinaryStream {
+class LLVM_CLASS_ABI WritableMappedBlockStream : public WritableBinaryStream {
 public:
   static std::unique_ptr<WritableMappedBlockStream>
   createStream(uint32_t BlockSize, const MSFStreamLayout &Layout,
diff --git a/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h b/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
index cf09d3f5992bee3..07a07388cf96da8 100644
--- a/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
+++ b/llvm/include/llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h
@@ -21,7 +21,7 @@ namespace llvm {
 namespace pdb {
 
 template <typename ChildType>
-class ConcreteSymbolEnumerator : public IPDBEnumChildren<ChildType> {
+class LLVM_CLASS_ABI ConcreteSymbolEnumerator : public IPDBEnumChildren<ChildType> {
 public:
   ConcreteSymbolEnumerator(std::unique_ptr<IPDBEnumSymbols> SymbolEnumerator)
       : Enumerator(std::move(SymbolEnumerator)) {}
diff --git a/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h b/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h
index cffdf90dbf2fd49..97e0ee227b9752d 100644
--- a/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h
+++ b/llvm/include/llvm/DebugInfo/PDB/DIA/DIAError.h
@@ -28,19 +28,19 @@ enum class dia_error_code {
 
 namespace std {
 template <>
-struct is_error_code_enum<llvm::pdb::dia_error_code> : std::true_type {};
+struct LLVM_CLASS_ABI is_error_code_enum<llvm::pdb::dia_error_code> : std::true_type {};
 } // namespace std
 
 namespace llvm {
 namespace pdb {
-const std::error_category &DIAErrCategory();
+LLVM_FUNC_ABI const std::error_category &DIAErrCategory();
 
 inline std::error_code make_error_code(dia_error_code E) {
   return std::error_code(static_cast<int>(E), DIAErrCategory());
 }
 
 /// Base class for errors originating in DIA SDK, e.g. COM calls
-class DIAError : public ErrorInfo<DIAError, StringError> {
+class LLVM_CLASS_ABI DIAError : public ErrorInfo<DIAError, StringError> {
 public:
   using ErrorInfo<DIAError, StringError>::ErrorInfo;
   DIAError(const Twine &S) : ErrorInfo(S, dia_error_code::unspecified) {}
diff --git a/llvm/include/llvm/DebugInfo/PDB/GenericError.h b/llvm/include/llvm/DebugInfo/PDB/GenericError.h
index 48c2480b6cfbad4..12047e4e2e091b2 100644
--- a/llvm/include/llvm/DebugInfo/PDB/GenericError.h
+++ b/llvm/include/llvm/DebugInfo/PDB/GenericError.h
@@ -28,19 +28,19 @@ enum class pdb_error_code {
 
 namespace std {
 template <>
-struct is_error_code_enum<llvm::pdb::pdb_error_code> : std::true_type {};
+struct LLVM_CLASS_ABI is_error_code_enum<llvm::pdb::pdb_error_code> : std::true_type {};
 } // namespace std
 
 namespace llvm {
 namespace pdb {
-const std::error_category &PDBErrCategory();
+LLVM_FUNC_ABI const std::error_category &PDBErrCategory();
 
 inline std::error_code make_error_code(pdb_error_code E) {
   return std::error_code(static_cast<int>(E), PDBErrCategory());
 }
 
 /// Base class for errors originating when parsing raw PDB files
-class PDBError : public ErrorInfo<PDBError, StringError> {
+class LLVM_CLASS_ABI PDBError : public ErrorInfo<PDBError, StringError> {
 public:
   using ErrorInfo<PDBError, StringError>::ErrorInfo; // inherit constructors
   PDBError(const Twine &S) : ErrorInfo(S, pdb_error_code::unspecified) {}
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h b/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h
index 7f4f5e92cb8690a..7d8877c429ad55c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBDataStream.h
@@ -21,7 +21,7 @@ namespace pdb {
 /// IPDBDataStream defines an interface used to represent a stream consisting
 /// of a name and a series of records whose formats depend on the particular
 /// stream type.
-class IPDBDataStream {
+class LLVM_CLASS_ABI IPDBDataStream {
 public:
   using RecordType = SmallVector<uint8_t, 32>;
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h b/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
index f7de588bee3190a..367df505e8eec24 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace pdb {
 
-template <typename ChildType> class IPDBEnumChildren {
+template <typename ChildType> class LLVM_CLASS_ABI IPDBEnumChildren {
 public:
   using ChildTypePtr = std::unique_ptr<ChildType>;
   using MyType = IPDBEnumChildren<ChildType>;
@@ -32,7 +32,7 @@ template <typename ChildType> class IPDBEnumChildren {
 };
 
 template <typename ChildType>
-class NullEnumerator : public IPDBEnumChildren<ChildType> {
+class LLVM_CLASS_ABI NullEnumerator : public IPDBEnumChildren<ChildType> {
   uint32_t getChildCount() const override { return 0; }
   std::unique_ptr<ChildType> getChildAtIndex(uint32_t Index) const override {
     return nullptr;
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h b/llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h
index d8dd3b8c3fff095..bbdb4dfc0751721 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBFrameData.h
@@ -18,7 +18,7 @@ namespace pdb {
 
 /// IPDBFrameData defines an interface used to represent a frame data of some
 /// code block.
-class IPDBFrameData {
+class LLVM_CLASS_ABI IPDBFrameData {
 public:
   virtual ~IPDBFrameData();
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h b/llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
index cbda789ddab48aa..f0ce33f2b6aad41 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBInjectedSource.h
@@ -19,7 +19,7 @@ namespace pdb {
 /// which were injected directly into the PDB file during the compilation
 /// process.  This is used, for example, to add natvis files to a PDB, but
 /// in theory could be used to add arbitrary source code.
-class IPDBInjectedSource {
+class LLVM_CLASS_ABI IPDBInjectedSource {
 public:
   virtual ~IPDBInjectedSource();
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h b/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
index f7c7d70020f6085..49b59e76b3160ec 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBLineNumber.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 namespace pdb {
-class IPDBLineNumber {
+class LLVM_CLASS_ABI IPDBLineNumber {
 public:
   virtual ~IPDBLineNumber();
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h b/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
index 6aa33e13a9a865c..a4eae087beaa981 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
@@ -33,7 +33,7 @@ enum class PdbSymbolIdField : uint32_t {
   LLVM_MARK_AS_BITMASK_ENUM(/* LargestValue = */ All)
 };
 
-void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value,
+LLVM_FUNC_ABI void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value,
                        int Indent, const IPDBSession &Session,
                        PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags,
                        PdbSymbolIdField RecurseFlags);
@@ -43,7 +43,7 @@ void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value,
 /// all properties that are valid for any symbol type.  This interface is then
 /// wrapped by a concrete class which exposes only those set of methods valid
 /// for this particular symbol type.  See PDBSymbol.h for more details.
-class IPDBRawSymbol {
+class LLVM_CLASS_ABI IPDBRawSymbol {
 public:
   virtual ~IPDBRawSymbol();
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h b/llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
index 6065459c40527ea..480fb765718a7d5 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBSectionContrib.h
@@ -17,7 +17,7 @@ namespace pdb {
 
 /// IPDBSectionContrib defines an interface used to represent section
 /// contributions whose information are stored in the PDB.
-class IPDBSectionContrib {
+class LLVM_CLASS_ABI IPDBSectionContrib {
 public:
   virtual ~IPDBSectionContrib();
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h b/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h
index 32e454a65ef98f6..f54397f80c5ee38 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBSession.h
@@ -23,7 +23,7 @@ class PDBSymbolExe;
 
 /// IPDBSession defines an interface used to provide a context for querying
 /// debug information from a debug data source (for example, a PDB).
-class IPDBSession {
+class LLVM_CLASS_ABI IPDBSession {
 public:
   virtual ~IPDBSession();
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h b/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
index 52d8ba87f27bb44..d2525c30b3cb837 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBSourceFile.h
@@ -21,7 +21,7 @@ namespace pdb {
 
 /// IPDBSourceFile defines an interface used to represent source files whose
 /// information are stored in the PDB.
-class IPDBSourceFile {
+class LLVM_CLASS_ABI IPDBSourceFile {
 public:
   virtual ~IPDBSourceFile();
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h b/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h
index 1ed2e00d9f6843f..ef2a444505b8e38 100644
--- a/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h
+++ b/llvm/include/llvm/DebugInfo/PDB/IPDBTable.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 namespace pdb {
-class IPDBTable {
+class LLVM_CLASS_ABI IPDBTable {
 public:
   virtual ~IPDBTable();
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
index f34ecee173a8b5c..b7056387ec68603 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
@@ -21,7 +21,7 @@ template <typename T> struct VarStreamArrayExtractor;
 namespace pdb {
 struct ModuleInfoHeader;
 struct SectionContrib;
-class DbiModuleDescriptor {
+class LLVM_CLASS_ABI DbiModuleDescriptor {
   friend class DbiStreamBuilder;
 
 public:
@@ -56,7 +56,7 @@ class DbiModuleDescriptor {
 
 } // end namespace pdb
 
-template <> struct VarStreamArrayExtractor<pdb::DbiModuleDescriptor> {
+template <> struct LLVM_CLASS_ABI VarStreamArrayExtractor<pdb::DbiModuleDescriptor> {
   Error operator()(BinaryStreamRef Stream, uint32_t &Length,
                    pdb::DbiModuleDescriptor &Info) {
     if (auto EC = pdb::DbiModuleDescriptor::initialize(Stream, Info))
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
index 71826df8fb33c08..71c2ab65e83ad9e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h
@@ -36,7 +36,7 @@ namespace pdb {
 // Represents merged or unmerged symbols. Merged symbols can be written to the
 // output file as is, but unmerged symbols must be rewritten first. In either
 // case, the size must be known up front.
-struct SymbolListWrapper {
+struct LLVM_CLASS_ABI SymbolListWrapper {
   explicit SymbolListWrapper(ArrayRef<uint8_t> Syms)
       : SymPtr(const_cast<uint8_t *>(Syms.data())), SymSize(Syms.size()),
         NeedsToBeMerged(false) {}
@@ -56,12 +56,12 @@ struct SymbolListWrapper {
 
 /// Represents a string table reference at some offset in the module symbol
 /// stream.
-struct StringTableFixup {
+struct LLVM_CLASS_ABI StringTableFixup {
   uint32_t StrTabOffset = 0;
   uint32_t SymOffsetOfReference = 0;
 };
 
-class DbiModuleDescriptorBuilder {
+class LLVM_CLASS_ABI DbiModuleDescriptorBuilder {
   friend class DbiStreamBuilder;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
index d8d6e2935b60018..3f7bf50d70f1cb2 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h
@@ -29,7 +29,7 @@ namespace pdb {
 class DbiModuleList;
 struct FileInfoSubstreamHeader;
 
-class DbiModuleSourceFilesIterator
+class LLVM_CLASS_ABI DbiModuleSourceFilesIterator
     : public iterator_facade_base<DbiModuleSourceFilesIterator,
                                   std::random_access_iterator_tag, StringRef> {
   using BaseType = typename DbiModuleSourceFilesIterator::iterator_facade_base;
@@ -65,7 +65,7 @@ class DbiModuleSourceFilesIterator
   uint16_t Filei{0};
 };
 
-class DbiModuleList {
+class LLVM_CLASS_ABI DbiModuleList {
   friend DbiModuleSourceFilesIterator;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h
index aa7509b25641516..ecf1ab7a3f27f53 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h
@@ -37,7 +37,7 @@ struct SectionContrib;
 class PDBFile;
 class ISectionContribVisitor;
 
-class DbiStream {
+class LLVM_CLASS_ABI DbiStream {
   friend class DbiStreamBuilder;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
index df1883693067ac3..eb63109f38a1b0d 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
@@ -38,7 +38,7 @@ struct MSFLayout;
 namespace pdb {
 class DbiModuleDescriptorBuilder;
 
-class DbiStreamBuilder {
+class LLVM_CLASS_ABI DbiStreamBuilder {
 public:
   DbiStreamBuilder(msf::MSFBuilder &Msf);
   ~DbiStreamBuilder();
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h b/llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h
index 6ecdc2034bb6bc8..9bca61a6c71b33a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/EnumTables.h
@@ -15,7 +15,7 @@
 namespace llvm {
 template <typename T> struct EnumEntry;
 namespace pdb {
-ArrayRef<EnumEntry<uint16_t>> getOMFSegMapDescFlagNames();
+LLVM_FUNC_ABI ArrayRef<EnumEntry<uint16_t>> getOMFSegMapDescFlagNames();
 }
 }
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h b/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h
index 0371d899792e87a..2017819c157e381 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h
@@ -39,27 +39,27 @@ template <typename T> std::string formatUnknownEnum(T Value) {
       .str();
 }
 
-std::string formatSegmentOffset(uint16_t Segment, uint32_t Offset);
+LLVM_FUNC_ABI std::string formatSegmentOffset(uint16_t Segment, uint32_t Offset);
 
 enum class CharacteristicStyle {
   HeaderDefinition, // format as windows header definition
   Descriptive,      // format as human readable words
 };
-std::string formatSectionCharacteristics(
+LLVM_FUNC_ABI std::string formatSectionCharacteristics(
     uint32_t IndentLevel, uint32_t C, uint32_t FlagsPerLine,
     StringRef Separator,
     CharacteristicStyle Style = CharacteristicStyle::HeaderDefinition);
 
-std::string typesetItemList(ArrayRef<std::string> Opts, uint32_t IndentLevel,
+LLVM_FUNC_ABI std::string typesetItemList(ArrayRef<std::string> Opts, uint32_t IndentLevel,
                             uint32_t GroupSize, StringRef Sep);
 
-std::string typesetStringList(uint32_t IndentLevel,
+LLVM_FUNC_ABI std::string typesetStringList(uint32_t IndentLevel,
                               ArrayRef<StringRef> Strings);
 
-std::string formatChunkKind(codeview::DebugSubsectionKind Kind,
+LLVM_FUNC_ABI std::string formatChunkKind(codeview::DebugSubsectionKind Kind,
                             bool Friendly = true);
-std::string formatSymbolKind(codeview::SymbolKind K);
-std::string formatTypeLeafKind(codeview::TypeLeafKind K);
+LLVM_FUNC_ABI std::string formatSymbolKind(codeview::SymbolKind K);
+LLVM_FUNC_ABI std::string formatTypeLeafKind(codeview::TypeLeafKind K);
 
 /// Returns the number of digits in the given integer.
 inline int NumDigits(uint64_t N) {
@@ -106,7 +106,7 @@ inline int NumDigits(uint64_t N) {
 
 namespace detail {
 template <typename T>
-struct EndianAdapter final
+struct LLVM_CLASS_ABI EndianAdapter final
     : public FormatAdapter<support::detail::packed_endian_specific_integral<
           T, support::little, support::unaligned>> {
   using EndianType =
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
index 6387f9333086e49..b917fdf8f492729 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
@@ -26,7 +26,7 @@ class ProcRefSym;
 } // namespace codeview
 template <typename T> struct BinaryItemTraits;
 
-template <> struct BinaryItemTraits<codeview::CVSymbol> {
+template <> struct LLVM_CLASS_ABI BinaryItemTraits<codeview::CVSymbol> {
   static size_t length(const codeview::CVSymbol &Item) {
     return Item.RecordData.size();
   }
@@ -44,7 +44,7 @@ struct GSIHashStreamBuilder;
 struct BulkPublic;
 struct SymbolDenseMapInfo;
 
-class GSIStreamBuilder {
+class LLVM_CLASS_ABI GSIStreamBuilder {
 
 public:
   explicit GSIStreamBuilder(msf::MSFBuilder &Msf);
@@ -106,7 +106,7 @@ class GSIStreamBuilder {
 /// This struct is equivalent to codeview::PublicSym32, but it has been
 /// optimized for size to speed up bulk serialization and sorting operations
 /// during PDB writing.
-struct BulkPublic {
+struct LLVM_CLASS_ABI BulkPublic {
   BulkPublic() : Flags(0), BucketIdx(0) {}
 
   const char *Name = nullptr;
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
index e2210b278bd5e4d..2c9af66f0e7103c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
@@ -27,7 +27,7 @@ class SymbolStream;
 
 /// Iterator over hash records producing symbol record offsets. Abstracts away
 /// the fact that symbol record offsets on disk are off-by-one.
-class GSIHashIterator
+class LLVM_CLASS_ABI GSIHashIterator
     : public iterator_adaptor_base<
           GSIHashIterator, FixedStreamArrayIterator<PSHashRecord>,
           std::random_access_iterator_tag, const uint32_t> {
@@ -48,7 +48,7 @@ enum : unsigned { IPHR_HASH = 4096 };
 /// A readonly view of a hash table used in the globals and publics streams.
 /// Most clients will only want to iterate this to get symbol record offsets
 /// into the PDB symbol stream.
-class GSIHashTable {
+class LLVM_CLASS_ABI GSIHashTable {
 public:
   const GSIHashHeader *HashHdr;
   FixedStreamArray<PSHashRecord> HashRecords;
@@ -68,7 +68,7 @@ class GSIHashTable {
   GSIHashIterator end() const { return GSIHashIterator(HashRecords.end()); }
 };
 
-class GlobalsStream {
+class LLVM_CLASS_ABI GlobalsStream {
 public:
   explicit GlobalsStream(std::unique_ptr<msf::MappedBlockStream> Stream);
   ~GlobalsStream();
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/Hash.h b/llvm/include/llvm/DebugInfo/PDB/Native/Hash.h
index 9186a99afdaf0c6..4d22a05ba6fa3c9 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/Hash.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/Hash.h
@@ -17,9 +17,9 @@
 namespace llvm {
 namespace pdb {
 
-uint32_t hashStringV1(StringRef Str);
-uint32_t hashStringV2(StringRef Str);
-uint32_t hashBufferV8(ArrayRef<uint8_t> Data);
+LLVM_FUNC_ABI uint32_t hashStringV1(StringRef Str);
+LLVM_FUNC_ABI uint32_t hashStringV2(StringRef Str);
+LLVM_FUNC_ABI uint32_t hashBufferV8(ArrayRef<uint8_t> Data);
 
 } // end namespace pdb
 } // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h b/llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
index 71c4045db11d421..0a081f558b71f33 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
@@ -26,13 +26,13 @@ namespace llvm {
 
 namespace pdb {
 
-Error readSparseBitVector(BinaryStreamReader &Stream, SparseBitVector<> &V);
-Error writeSparseBitVector(BinaryStreamWriter &Writer, SparseBitVector<> &Vec);
+LLVM_FUNC_ABI Error readSparseBitVector(BinaryStreamReader &Stream, SparseBitVector<> &V);
+LLVM_FUNC_ABI Error writeSparseBitVector(BinaryStreamWriter &Writer, SparseBitVector<> &Vec);
 
 template <typename ValueT> class HashTable;
 
 template <typename ValueT>
-class HashTableIterator
+class LLVM_CLASS_ABI HashTableIterator
     : public iterator_facade_base<HashTableIterator<ValueT>,
                                   std::forward_iterator_tag,
                                   const std::pair<uint32_t, ValueT>> {
@@ -97,7 +97,7 @@ class HashTableIterator
 };
 
 template <typename ValueT>
-class HashTable {
+class LLVM_CLASS_ABI HashTable {
   struct Header {
     support::ulittle32_t Size;
     support::ulittle32_t Capacity;
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h b/llvm/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
index 503e63317848ac5..8b2a806cc880239 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/ISectionContribVisitor.h
@@ -17,7 +17,7 @@ namespace pdb {
 struct SectionContrib;
 struct SectionContrib2;
 
-class ISectionContribVisitor {
+class LLVM_CLASS_ABI ISectionContribVisitor {
 public:
   virtual ~ISectionContribVisitor() = default;
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h
index c8779c19fac568c..842f75cd42fe8ec 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/InfoStream.h
@@ -22,7 +22,7 @@
 namespace llvm {
 namespace pdb {
 struct InfoStreamHeader;
-class InfoStream {
+class LLVM_CLASS_ABI InfoStream {
   friend class InfoStreamBuilder;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
index 3b42e248c4da6e1..ac39e8df100d01d 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
@@ -25,7 +25,7 @@ struct MSFLayout;
 namespace pdb {
 class NamedStreamMap;
 
-class InfoStreamBuilder {
+class LLVM_CLASS_ABI InfoStreamBuilder {
 public:
   InfoStreamBuilder(msf::MSFBuilder &Msf, NamedStreamMap &NamedStreams);
   InfoStreamBuilder(const InfoStreamBuilder &) = delete;
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h
index 905cf8d31ea1429..d6590ae9fce0466 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/InjectedSourceStream.h
@@ -20,7 +20,7 @@ struct SrcHeaderBlockEntry;
 struct SrcHeaderBlockHeader;
 class PDBStringTable;
 
-class InjectedSourceStream {
+class LLVM_CLASS_ABI InjectedSourceStream {
 public:
   InjectedSourceStream(std::unique_ptr<msf::MappedBlockStream> Stream);
   Error reload(const PDBStringTable &Strings);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h b/llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h
index 51a73ca6f53d359..e087f52aa55c7e4 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h
@@ -37,7 +37,7 @@ class NativeSession;
 class SymbolGroupIterator;
 class SymbolGroup;
 
-class InputFile {
+class LLVM_CLASS_ABI InputFile {
   InputFile();
 
   std::unique_ptr<NativeSession> PdbSession;
@@ -88,7 +88,7 @@ class InputFile {
   bool isUnknown() const;
 };
 
-class SymbolGroup {
+class LLVM_CLASS_ABI SymbolGroup {
   friend class SymbolGroupIterator;
 
 public:
@@ -129,7 +129,7 @@ class SymbolGroup {
   StringMap<codeview::FileChecksumEntry> ChecksumsByFile;
 };
 
-class SymbolGroupIterator
+class LLVM_CLASS_ABI SymbolGroupIterator
     : public iterator_facade_base<SymbolGroupIterator,
                                   std::forward_iterator_tag, SymbolGroup> {
 public:
@@ -153,12 +153,12 @@ class SymbolGroupIterator
   SymbolGroup Value;
 };
 
-Expected<ModuleDebugStreamRef>
+LLVM_FUNC_ABI Expected<ModuleDebugStreamRef>
 getModuleDebugStream(PDBFile &File, StringRef &ModuleName, uint32_t Index);
-Expected<ModuleDebugStreamRef> getModuleDebugStream(PDBFile &File,
+LLVM_FUNC_ABI Expected<ModuleDebugStreamRef> getModuleDebugStream(PDBFile &File,
                                                     uint32_t Index);
 
-bool shouldDumpSymbolGroup(uint32_t Idx, const SymbolGroup &Group,
+LLVM_FUNC_ABI bool shouldDumpSymbolGroup(uint32_t Idx, const SymbolGroup &Group,
                            const FilterOptions &Filters);
 
 // TODO: Change these callbacks to be function_refs (de-templatify them).
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h b/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
index ce4375959848759..56e46e019214bd2 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h
@@ -22,7 +22,7 @@
 #include <list>
 
 // Container for filter options to control which elements will be printed.
-struct FilterOptions {
+struct LLVM_CLASS_ABI FilterOptions {
   std::list<std::string> ExcludeTypes;
   std::list<std::string> ExcludeSymbols;
   std::list<std::string> ExcludeCompilands;
@@ -48,7 +48,7 @@ class ClassLayout;
 class PDBFile;
 class SymbolGroup;
 
-class LinePrinter {
+class LLVM_CLASS_ABI LinePrinter {
   friend class WithColor;
 
 public:
@@ -115,7 +115,7 @@ class LinePrinter {
   std::list<Regex> IncludeSymbolFilters;
 };
 
-struct PrintScope {
+struct LLVM_CLASS_ABI PrintScope {
   explicit PrintScope(LinePrinter &P, uint32_t IndentLevel)
       : P(P), IndentLevel(IndentLevel) {}
   explicit PrintScope(const PrintScope &Other, uint32_t LabelWidth)
@@ -130,7 +130,7 @@ inline PrintScope withLabelWidth(const PrintScope &Scope, uint32_t W) {
   return PrintScope{Scope, W};
 }
 
-struct AutoIndent {
+struct LLVM_CLASS_ABI AutoIndent {
   explicit AutoIndent(LinePrinter &L, uint32_t Amount = 0)
       : L(&L), Amount(Amount) {
     L.Indent(Amount);
@@ -168,7 +168,7 @@ enum class PDB_ColorItem {
   Register,
 };
 
-class WithColor {
+class LLVM_CLASS_ABI WithColor {
 public:
   WithColor(LinePrinter &P, PDB_ColorItem C);
   ~WithColor();
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
index 7b14adc41c8fece..990f0505bbf82a2 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
@@ -29,7 +29,7 @@ class MappedBlockStream;
 }
 namespace pdb {
 
-class ModuleDebugStreamRef {
+class LLVM_CLASS_ABI ModuleDebugStreamRef {
   using DebugSubsectionIterator = codeview::DebugSubsectionArray::Iterator;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h b/llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
index 78f24522e8f674c..336f03efa2cd4ba 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
@@ -25,7 +25,7 @@ namespace pdb {
 
 class NamedStreamMap;
 
-struct NamedStreamMapTraits {
+struct LLVM_CLASS_ABI NamedStreamMapTraits {
   NamedStreamMap *NS;
 
   explicit NamedStreamMapTraits(NamedStreamMap &NS);
@@ -34,7 +34,7 @@ struct NamedStreamMapTraits {
   uint32_t lookupKeyToStorageKey(StringRef S);
 };
 
-class NamedStreamMap {
+class LLVM_CLASS_ABI NamedStreamMap {
   friend class NamedStreamMapBuilder;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
index 0ec2302a25098fb..4e5f20261126352 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h
@@ -16,7 +16,7 @@
 namespace llvm {
 namespace pdb {
 
-class NativeCompilandSymbol : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeCompilandSymbol : public NativeRawSymbol {
 public:
   NativeCompilandSymbol(NativeSession &Session, SymIndexId SymbolId,
                         DbiModuleDescriptor MI);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
index 7efe7bf76ceadee..89f4e6230fdcf45 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h
@@ -21,7 +21,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeEnumGlobals : public IPDBEnumChildren<PDBSymbol> {
+class LLVM_CLASS_ABI NativeEnumGlobals : public IPDBEnumChildren<PDBSymbol> {
 public:
   NativeEnumGlobals(NativeSession &Session,
                     std::vector<codeview::SymbolKind> Kinds);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h
index 93a4623942c3966..5175b5c07f63d0a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumInjectedSources.h
@@ -21,7 +21,7 @@ class InjectedSourceStream;
 class PDBFile;
 class PDBStringTable;
 
-class NativeEnumInjectedSources : public IPDBEnumChildren<IPDBInjectedSource> {
+class LLVM_CLASS_ABI NativeEnumInjectedSources : public IPDBEnumChildren<IPDBInjectedSource> {
 public:
   NativeEnumInjectedSources(PDBFile &File, const InjectedSourceStream &IJS,
                             const PDBStringTable &Strings);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h
index 90f5a7d01a3b729..9ddb03bd8afeaab 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumLineNumbers.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace pdb {
 
-class NativeEnumLineNumbers : public IPDBEnumChildren<IPDBLineNumber> {
+class LLVM_CLASS_ABI NativeEnumLineNumbers : public IPDBEnumChildren<IPDBLineNumber> {
 public:
   explicit NativeEnumLineNumbers(std::vector<NativeLineNumber> LineNums);
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
index 2d76f180e9a4202..d1bf0f5dccd7b1c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h
@@ -17,7 +17,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeEnumModules : public IPDBEnumChildren<PDBSymbol> {
+class LLVM_CLASS_ABI NativeEnumModules : public IPDBEnumChildren<PDBSymbol> {
 public:
   NativeEnumModules(NativeSession &Session, uint32_t Index = 0);
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h
index 7aee9d8e7acfcae..1a461372dc61422 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h
@@ -21,7 +21,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeEnumSymbols : public IPDBEnumChildren<PDBSymbol> {
+class LLVM_CLASS_ABI NativeEnumSymbols : public IPDBEnumChildren<PDBSymbol> {
 public:
   NativeEnumSymbols(NativeSession &Session, std::vector<SymIndexId> Symbols);
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
index ea461064fa4fd5e..9365f4d7aba6d9a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeEnumTypes.h
@@ -25,7 +25,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeEnumTypes : public IPDBEnumChildren<PDBSymbol> {
+class LLVM_CLASS_ABI NativeEnumTypes : public IPDBEnumChildren<PDBSymbol> {
 public:
   NativeEnumTypes(NativeSession &Session,
                   codeview::LazyRandomTypeCollection &TypeCollection,
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
index 31e61e8318193ca..8536f72e0b97927 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h
@@ -21,7 +21,7 @@ class NativeSession;
 
 class DbiStream;
 
-class NativeExeSymbol : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeExeSymbol : public NativeRawSymbol {
   // EXE symbol is the authority on the various symbol types.
   DbiStream *Dbi = nullptr;
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h
index 53d4f747c9e1849..e2389c3a5736931 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h
@@ -21,7 +21,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeFunctionSymbol : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeFunctionSymbol : public NativeRawSymbol {
 public:
   NativeFunctionSymbol(NativeSession &Session, SymIndexId Id,
                        const codeview::ProcSym &Sym, uint32_t RecordOffset);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h
index a702c2edd8ce950..369ae2b37bec870 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h
@@ -20,7 +20,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeInlineSiteSymbol : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeInlineSiteSymbol : public NativeRawSymbol {
 public:
   NativeInlineSiteSymbol(NativeSession &Session, SymIndexId Id,
                          const codeview::InlineSiteSym &Sym,
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h
index df793616ee50361..6d67cbaa1e24f72 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h
@@ -18,7 +18,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeLineNumber : public IPDBLineNumber {
+class LLVM_CLASS_ABI NativeLineNumber : public IPDBLineNumber {
 public:
   explicit NativeLineNumber(const NativeSession &Session,
                             const codeview::LineInfo Line,
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h
index e9ae293cf1e603b..cbe9dec79b21376 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativePublicSymbol.h
@@ -19,7 +19,7 @@ class raw_ostream;
 namespace pdb {
 class NativeSession;
 
-class NativePublicSymbol : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativePublicSymbol : public NativeRawSymbol {
 public:
   NativePublicSymbol(NativeSession &Session, SymIndexId Id,
                      const codeview::PublicSym32 &Sym);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
index 699e2d78fc8cbd8..d5bd307e6b67822 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
@@ -19,7 +19,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeRawSymbol : public IPDBRawSymbol {
+class LLVM_CLASS_ABI NativeRawSymbol : public IPDBRawSymbol {
   friend class SymbolCache;
   virtual void initialize() {}
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h
index 01207800d8fa6de..3e098ca9182b4d9 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h
@@ -30,7 +30,7 @@ class PDBSymbolCompiland;
 class PDBSymbolExe;
 template <typename ChildType> class IPDBEnumChildren;
 
-class NativeSession : public IPDBSession {
+class LLVM_CLASS_ABI NativeSession : public IPDBSession {
   struct PdbSearchOptions {
     StringRef ExePath;
     // FIXME: Add other PDB search options (_NT_SYMBOL_PATH, symsrv)
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h
index 087849116dc69f9..331deee03448563 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSourceFile.h
@@ -20,7 +20,7 @@ class PDBSymbolCompiland;
 template <typename ChildType> class IPDBEnumChildren;
 class NativeSession;
 
-class NativeSourceFile : public IPDBSourceFile {
+class LLVM_CLASS_ABI NativeSourceFile : public IPDBSourceFile {
 public:
   explicit NativeSourceFile(NativeSession &Session, uint32_t FileId,
                             const codeview::FileChecksumEntry &Checksum);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
index d6c5027db993783..0b7098c8cde7ab6 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeSymbolEnumerator.h
@@ -22,7 +22,7 @@ namespace pdb {
 class NativeSession;
 class NativeTypeEnum;
 
-class NativeSymbolEnumerator : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeSymbolEnumerator : public NativeRawSymbol {
 public:
   NativeSymbolEnumerator(NativeSession &Session, SymIndexId Id,
                          const NativeTypeEnum &Parent,
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
index 126cd14c0e3074c..527fccfaa349249 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeArray.h
@@ -20,7 +20,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeTypeArray : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeTypeArray : public NativeRawSymbol {
 public:
   NativeTypeArray(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
                   codeview::ArrayRecord Record);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
index e7e16b31bd28a8f..4bd2519bbb88018 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeBuiltin.h
@@ -19,7 +19,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeTypeBuiltin : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeTypeBuiltin : public NativeRawSymbol {
 public:
   NativeTypeBuiltin(NativeSession &PDBSession, SymIndexId Id,
                     codeview::ModifierOptions Mods, PDB_BuiltinType T,
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
index a10a0f1cde41c11..b523f74fa063a01 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeEnum.h
@@ -22,7 +22,7 @@ namespace pdb {
 
 class NativeTypeBuiltin;
 
-class NativeTypeEnum : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeTypeEnum : public NativeRawSymbol {
 public:
   NativeTypeEnum(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
                  codeview::EnumRecord Record);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
index dd5603d2da05a27..7ac1f39f408ac75 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeFunctionSig.h
@@ -19,7 +19,7 @@
 namespace llvm {
 namespace pdb {
 
-class NativeTypeFunctionSig : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeTypeFunctionSig : public NativeRawSymbol {
 protected:
   void initialize() override;
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
index d0503d942dafbe3..7213143c25276c7 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypePointer.h
@@ -19,7 +19,7 @@
 namespace llvm {
 namespace pdb {
 
-class NativeTypePointer : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeTypePointer : public NativeRawSymbol {
 public:
   // Create a pointer record for a simple type.
   NativeTypePointer(NativeSession &Session, SymIndexId Id,
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
index b05b5d12f2562c5..321ccd1d9770d9a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h
@@ -23,7 +23,7 @@ namespace pdb {
 
 class NativeSession;
 
-class NativeTypeTypedef : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeTypeTypedef : public NativeRawSymbol {
 public:
   // Create a pointer record for a non-simple type.
   NativeTypeTypedef(NativeSession &Session, SymIndexId Id,
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
index e9d808205e43abd..43ffe5f80df682e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeUDT.h
@@ -22,7 +22,7 @@ class raw_ostream;
 namespace pdb {
 class NativeSession;
 
-class NativeTypeUDT : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeTypeUDT : public NativeRawSymbol {
 public:
   NativeTypeUDT(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI,
                 codeview::ClassRecord Class);
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
index 41a898d6f1a66ca..42c7b20053f40a0 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h
@@ -20,7 +20,7 @@ namespace llvm {
 namespace pdb {
 class NativeSession;
 
-class NativeTypeVTShape : public NativeRawSymbol {
+class LLVM_CLASS_ABI NativeTypeVTShape : public NativeRawSymbol {
 public:
   // Create a pointer record for a non-simple type.
   NativeTypeVTShape(NativeSession &Session, SymIndexId Id,
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h
index 76be171cac0b0d8..e2d730a0b0fc714 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h
@@ -38,7 +38,7 @@ class PublicsStream;
 class SymbolStream;
 class TpiStream;
 
-class PDBFile : public msf::IMSFFile {
+class LLVM_CLASS_ABI PDBFile : public msf::IMSFFile {
   friend PDBFileBuilder;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
index f678b2be20e6928..fb8cf8582932d57 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBFileBuilder.h
@@ -37,7 +37,7 @@ class InfoStreamBuilder;
 class GSIStreamBuilder;
 class TpiStreamBuilder;
 
-class PDBFileBuilder {
+class LLVM_CLASS_ABI PDBFileBuilder {
 public:
   explicit PDBFileBuilder(BumpPtrAllocator &Allocator);
   ~PDBFileBuilder();
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
index daacd778f8c5b16..7a81a9e658ef642 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTable.h
@@ -24,7 +24,7 @@ namespace pdb {
 
 struct PDBStringTableHeader;
 
-class PDBStringTable {
+class LLVM_CLASS_ABI PDBStringTable {
 public:
   Error reload(BinaryStreamReader &Reader);
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
index e60bd547697ccdb..88906c3983e035f 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PDBStringTableBuilder.h
@@ -32,7 +32,7 @@ namespace pdb {
 class PDBFileBuilder;
 class PDBStringTableBuilder;
 
-struct StringTableHashTraits {
+struct LLVM_CLASS_ABI StringTableHashTraits {
   PDBStringTableBuilder *Table;
 
   explicit StringTableHashTraits(PDBStringTableBuilder &Table);
@@ -41,7 +41,7 @@ struct StringTableHashTraits {
   uint32_t lookupKeyToStorageKey(StringRef S);
 };
 
-class PDBStringTableBuilder {
+class LLVM_CLASS_ABI PDBStringTableBuilder {
 public:
   // If string S does not exist in the string table, insert it.
   // Returns the ID for S.
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
index 2159bba18f3115c..326059834b87be4 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
@@ -22,7 +22,7 @@ namespace pdb {
 struct PublicsStreamHeader;
 struct SectionOffset;
 
-class PublicsStream {
+class LLVM_CLASS_ABI PublicsStream {
 public:
   PublicsStream(std::unique_ptr<msf::MappedBlockStream> Stream);
   ~PublicsStream();
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/RawError.h b/llvm/include/llvm/DebugInfo/PDB/Native/RawError.h
index d61e0f009e8b9c5..02ad38004622a68 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/RawError.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/RawError.h
@@ -34,19 +34,19 @@ enum class raw_error_code {
 
 namespace std {
 template <>
-struct is_error_code_enum<llvm::pdb::raw_error_code> : std::true_type {};
+struct LLVM_CLASS_ABI is_error_code_enum<llvm::pdb::raw_error_code> : std::true_type {};
 } // namespace std
 
 namespace llvm {
 namespace pdb {
-const std::error_category &RawErrCategory();
+LLVM_FUNC_ABI const std::error_category &RawErrCategory();
 
 inline std::error_code make_error_code(raw_error_code E) {
   return std::error_code(static_cast<int>(E), RawErrCategory());
 }
 
 /// Base class for errors originating when parsing raw PDB files
-class RawError : public ErrorInfo<RawError, StringError> {
+class LLVM_CLASS_ABI RawError : public ErrorInfo<RawError, StringError> {
 public:
   using ErrorInfo<RawError, StringError>::ErrorInfo; // inherit constructors
   RawError(const Twine &S) : ErrorInfo(S, raw_error_code::unspecified) {}
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h b/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
index f02cb4a88d69a21..f5e1b91737e6b36 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/RawTypes.h
@@ -17,7 +17,7 @@
 namespace llvm {
 namespace pdb {
 // This struct is defined as "SO" in langapi/include/pdb.h.
-struct SectionOffset {
+struct LLVM_CLASS_ABI SectionOffset {
   support::ulittle32_t Off;
   support::ulittle16_t Isect;
   char Padding[2];
@@ -26,7 +26,7 @@ struct SectionOffset {
 /// Header of the hash tables found in the globals and publics sections.
 /// Based on GSIHashHdr in
 /// https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.h
-struct GSIHashHeader {
+struct LLVM_CLASS_ABI GSIHashHeader {
   enum : unsigned {
     HdrSignature = ~0U,
     HdrVersion = 0xeffe0000 + 19990810,
@@ -38,13 +38,13 @@ struct GSIHashHeader {
 };
 
 // This is HRFile.
-struct PSHashRecord {
+struct LLVM_CLASS_ABI PSHashRecord {
   support::ulittle32_t Off; // Offset in the symbol record stream
   support::ulittle32_t CRef;
 };
 
 // This struct is defined as `SC` in include/dbicommon.h
-struct SectionContrib {
+struct LLVM_CLASS_ABI SectionContrib {
   support::ulittle16_t ISect;
   char Padding[2];
   support::little32_t Off;
@@ -57,14 +57,14 @@ struct SectionContrib {
 };
 
 // This struct is defined as `SC2` in include/dbicommon.h
-struct SectionContrib2 {
+struct LLVM_CLASS_ABI SectionContrib2 {
   // To guarantee SectionContrib2 is standard layout, we cannot use inheritance.
   SectionContrib Base;
   support::ulittle32_t ISectCoff;
 };
 
 // This corresponds to the `OMFSegMap` structure.
-struct SecMapHeader {
+struct LLVM_CLASS_ABI SecMapHeader {
   support::ulittle16_t SecCount;    // Number of segment descriptors in table
   support::ulittle16_t SecCountLog; // Number of logical segment descriptors
 };
@@ -72,7 +72,7 @@ struct SecMapHeader {
 // This corresponds to the `OMFSegMapDesc` structure.  The definition is not
 // present in the reference implementation, but the layout is derived from
 // code that accesses the fields.
-struct SecMapEntry {
+struct LLVM_CLASS_ABI SecMapEntry {
   support::ulittle16_t Flags; // Descriptor flags.  See OMFSegDescFlags
   support::ulittle16_t Ovl;   // Logical overlay number.
   support::ulittle16_t Group; // Group index into descriptor array.
@@ -92,7 +92,7 @@ struct SecMapEntry {
 /// across compilers and architectures (big / little endian in particular) we
 /// can't use the actual structures below, but must instead do the shifting
 /// and masking ourselves.  The struct definitions are provided for reference.
-struct DbiFlags {
+struct LLVM_CLASS_ABI DbiFlags {
   ///  uint16_t IncrementalLinking : 1; // True if linked incrementally
   ///  uint16_t IsStripped : 1;         // True if private symbols were
   ///  stripped.
@@ -103,7 +103,7 @@ struct DbiFlags {
   static const uint16_t FlagHasCTypesMask = 0x0004;
 };
 
-struct DbiBuildNo {
+struct LLVM_CLASS_ABI DbiBuildNo {
   ///  uint16_t MinorVersion : 8;
   ///  uint16_t MajorVersion : 7;
   ///  uint16_t NewVersionFormat : 1;
@@ -117,7 +117,7 @@ struct DbiBuildNo {
 };
 
 /// The fixed size header that appears at the beginning of the DBI Stream.
-struct DbiStreamHeader {
+struct LLVM_CLASS_ABI DbiStreamHeader {
   support::little32_t VersionSignature;
   support::ulittle32_t VersionHeader;
 
@@ -178,7 +178,7 @@ struct DbiStreamHeader {
 static_assert(sizeof(DbiStreamHeader) == 64, "Invalid DbiStreamHeader size!");
 
 /// The header preceding the File Info Substream of the DBI stream.
-struct FileInfoSubstreamHeader {
+struct LLVM_CLASS_ABI FileInfoSubstreamHeader {
   /// Total # of modules, should match number of records in the ModuleInfo
   /// substream.
   support::ulittle16_t NumModules;
@@ -197,7 +197,7 @@ struct FileInfoSubstreamHeader {
   /// it is computed by summing the `ModFileCounts` array.
 };
 
-struct ModInfoFlags {
+struct LLVM_CLASS_ABI ModInfoFlags {
   ///  uint16_t fWritten : 1;   // True if DbiModuleDescriptor is dirty
   ///  uint16_t fECEnabled : 1; // Is EC symbolic info present?  (What is EC?)
   ///  uint16_t unused : 6;     // Reserved
@@ -210,7 +210,7 @@ struct ModInfoFlags {
 
 /// The header preceding each entry in the Module Info substream of the DBI
 /// stream.  Corresponds to the type MODI in the reference implementation.
-struct ModuleInfoHeader {
+struct LLVM_CLASS_ABI ModuleInfoHeader {
   /// Currently opened module. This field is a pointer in the reference
   /// implementation, but that won't work on 64-bit systems, and anyway it
   /// doesn't make sense to read a pointer from a file. For now it is unused,
@@ -262,7 +262,7 @@ struct ModuleInfoHeader {
 
 // This is PSGSIHDR struct defined in
 // https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/dbi/gsi.h
-struct PublicsStreamHeader {
+struct LLVM_CLASS_ABI PublicsStreamHeader {
   support::ulittle32_t SymHash;
   support::ulittle32_t AddrMap;
   support::ulittle32_t NumThunks;
@@ -275,7 +275,7 @@ struct PublicsStreamHeader {
 
 // The header preceding the global TPI stream.
 // This corresponds to `HDR` in PDB/dbi/tpi.h.
-struct TpiStreamHeader {
+struct LLVM_CLASS_ABI TpiStreamHeader {
   struct EmbeddedBuf {
     support::little32_t Off;
     support::ulittle32_t Length;
@@ -302,7 +302,7 @@ const uint32_t MinTpiHashBuckets = 0x1000;
 const uint32_t MaxTpiHashBuckets = 0x40000;
 
 /// The header preceding the global PDB Stream (Stream 1)
-struct InfoStreamHeader {
+struct LLVM_CLASS_ABI InfoStreamHeader {
   support::ulittle32_t Version;
   support::ulittle32_t Signature;
   support::ulittle32_t Age;
@@ -310,7 +310,7 @@ struct InfoStreamHeader {
 };
 
 /// The header preceding the /names stream.
-struct PDBStringTableHeader {
+struct LLVM_CLASS_ABI PDBStringTableHeader {
   support::ulittle32_t Signature;   // PDBStringTableSignature
   support::ulittle32_t HashVersion; // 1 or 2
   support::ulittle32_t ByteSize;    // Number of bytes of names buffer.
@@ -319,7 +319,7 @@ struct PDBStringTableHeader {
 const uint32_t PDBStringTableSignature = 0xEFFEEFFE;
 
 /// The header preceding the /src/headerblock stream.
-struct SrcHeaderBlockHeader {
+struct LLVM_CLASS_ABI SrcHeaderBlockHeader {
   support::ulittle32_t Version; // PdbRaw_SrcHeaderBlockVer enumeration.
   support::ulittle32_t Size;    // Size of entire stream.
   uint64_t FileTime;            // Time stamp (Windows FILETIME format).
@@ -329,7 +329,7 @@ struct SrcHeaderBlockHeader {
 static_assert(sizeof(SrcHeaderBlockHeader) == 64, "Incorrect struct size!");
 
 /// A single file record entry within the /src/headerblock stream.
-struct SrcHeaderBlockEntry {
+struct LLVM_CLASS_ABI SrcHeaderBlockEntry {
   support::ulittle32_t Size;     // Record Length.
   support::ulittle32_t Version;  // PdbRaw_SrcHeaderBlockVer enumeration.
   support::ulittle32_t CRC;      // CRC of the original file contents.
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h b/llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
index 714e796a9b9e7ee..56efcee3e014984 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
@@ -35,7 +35,7 @@ class PDBSymbol;
 class PDBSymbolCompiland;
 class DbiStream;
 
-class SymbolCache {
+class LLVM_CLASS_ABI SymbolCache {
   NativeSession &Session;
   DbiStream *Dbi = nullptr;
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
index e72d9d37db94a83..f34baddc2db8a4c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/SymbolStream.h
@@ -20,7 +20,7 @@ class MappedBlockStream;
 }
 namespace pdb {
 
-class SymbolStream {
+class LLVM_CLASS_ABI SymbolStream {
 public:
   SymbolStream(std::unique_ptr<msf::MappedBlockStream> Stream);
   ~SymbolStream();
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h b/llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
index 303356cc7d04e94..a6bb05f362ef132 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
@@ -16,9 +16,9 @@
 namespace llvm {
 namespace pdb {
 
-Expected<uint32_t> hashTypeRecord(const llvm::codeview::CVType &Type);
+LLVM_FUNC_ABI Expected<uint32_t> hashTypeRecord(const llvm::codeview::CVType &Type);
 
-struct TagRecordHash {
+struct LLVM_CLASS_ABI TagRecordHash {
   explicit TagRecordHash(codeview::ClassRecord CR, uint32_t Full,
                          uint32_t Forward)
       : FullRecordHash(Full), ForwardDeclHash(Forward), Class(std::move(CR)) {
@@ -64,7 +64,7 @@ struct TagRecordHash {
 
 /// Given a CVType referring to a class, structure, union, or enum, compute
 /// the hash of its forward decl and full decl.
-Expected<TagRecordHash> hashTagRecord(const codeview::CVType &Type);
+LLVM_FUNC_ABI Expected<TagRecordHash> hashTagRecord(const codeview::CVType &Type);
 
 } // end namespace pdb
 } // end namespace llvm
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h b/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
index 6c8a8200b613bfa..e0bf23037dd4d0a 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
@@ -32,7 +32,7 @@ namespace pdb {
 struct TpiStreamHeader;
 class PDBFile;
 
-class TpiStream {
+class LLVM_CLASS_ABI TpiStream {
   friend class TpiStreamBuilder;
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h b/llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
index 4852dfa04840724..ac37513c652757c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
+++ b/llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
@@ -23,7 +23,7 @@ namespace llvm {
 class BinaryByteStream;
 template <typename T> struct BinaryItemTraits;
 
-template <> struct BinaryItemTraits<llvm::codeview::CVType> {
+template <> struct LLVM_CLASS_ABI BinaryItemTraits<llvm::codeview::CVType> {
   static size_t length(const codeview::CVType &Item) { return Item.length(); }
   static ArrayRef<uint8_t> bytes(const codeview::CVType &Item) {
     return Item.data();
@@ -37,7 +37,7 @@ struct MSFLayout;
 namespace pdb {
 struct TpiStreamHeader;
 
-class TpiStreamBuilder {
+class LLVM_CLASS_ABI TpiStreamBuilder {
 public:
   explicit TpiStreamBuilder(msf::MSFBuilder &Msf, uint32_t StreamIdx);
   ~TpiStreamBuilder();
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDB.h b/llvm/include/llvm/DebugInfo/PDB/PDB.h
index 0803af881392b2b..e405d39792f1709 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDB.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDB.h
@@ -20,10 +20,10 @@ namespace pdb {
 
 class IPDBSession;
 
-Error loadDataForPDB(PDB_ReaderType Type, StringRef Path,
+LLVM_FUNC_ABI Error loadDataForPDB(PDB_ReaderType Type, StringRef Path,
                      std::unique_ptr<IPDBSession> &Session);
 
-Error loadDataForEXE(PDB_ReaderType Type, StringRef Path,
+LLVM_FUNC_ABI Error loadDataForEXE(PDB_ReaderType Type, StringRef Path,
                      std::unique_ptr<IPDBSession> &Session);
 
 } // end namespace pdb
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBContext.h b/llvm/include/llvm/DebugInfo/PDB/PDBContext.h
index fbcae9763e66e4f..1b50b6fdb076a65 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBContext.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBContext.h
@@ -30,7 +30,7 @@ namespace pdb {
   /// need for a transparent interface to different debug information formats
   /// (e.g. PDB and DWARF).  More control and power over the debug information
   /// access can be had by using the PDB interfaces directly.
-  class PDBContext : public DIContext {
+  class LLVM_CLASS_ABI PDBContext : public DIContext {
   public:
     PDBContext(const object::COFFObjectFile &Object,
                std::unique_ptr<IPDBSession> PDBSession);
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h b/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h
index 4d7e30b6a7190fc..bf8adaf052964f3 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBExtras.h
@@ -23,26 +23,26 @@ namespace pdb {
 
 using TagStats = std::unordered_map<PDB_SymType, int>;
 
-raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_BuiltinType &Type);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_BuiltinType &Type);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         const llvm::codeview::CPURegister &CpuReg);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
-raw_ostream &operator<<(raw_ostream &OS, const codeview::ThunkOrdinal &Thunk);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_Checksum &Checksum);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_Lang &Lang);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_SymType &Tag);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_MemberAccess &Access);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_UdtType &Type);
-raw_ostream &operator<<(raw_ostream &OS, const PDB_Machine &Machine);
-
-raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);
-raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
-raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
-
-raw_ostream& dumpPDBSourceCompression(raw_ostream& OS, uint32_t Compression);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const codeview::ThunkOrdinal &Thunk);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_Checksum &Checksum);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_Lang &Lang);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_SymType &Tag);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_MemberAccess &Access);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_UdtType &Type);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PDB_Machine &Machine);
+
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
+
+LLVM_FUNC_ABI raw_ostream& dumpPDBSourceCompression(raw_ostream& OS, uint32_t Compression);
 
 template <typename T>
 void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent) {
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h
index 8e2915f3b718bc3..2638a08a73177bf 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymDumper.h
@@ -17,7 +17,7 @@ namespace llvm {
 class raw_ostream;
 namespace pdb {
 
-class PDBSymDumper {
+class LLVM_CLASS_ABI PDBSymDumper {
 public:
   PDBSymDumper(bool ShouldRequireImpl);
   virtual ~PDBSymDumper();
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h
index 8253f10f654ca0d..60ef2f01eb30f8f 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h
@@ -69,7 +69,7 @@ public:                                                                        \
 /// valid for that particular symbol type, as described in the Microsoft
 /// reference "Lexical and Class Hierarchy of Symbol Types":
 /// https://msdn.microsoft.com/en-us/library/370hs6k4.aspx
-class PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbol {
   static std::unique_ptr<PDBSymbol> createSymbol(const IPDBSession &PDBSession,
                                                  PDB_SymType Tag);
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
index fc9f017435e471b..084bd8bad8f5a67 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolAnnotation.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolAnnotation : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolAnnotation : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Annotation)
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
index 30c708a2831c10e..35471f3475ff382 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolBlock : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolBlock : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Block)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
index d804b499e0399bf..2e8f6b2fdf2e527 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompiland.h
@@ -19,7 +19,7 @@ class raw_ostream;
 
 namespace pdb {
 
-class PDBSymbolCompiland : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolCompiland : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Compiland)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
index b1fcd0994d3c83a..0e7682599e75922 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolCompilandDetails : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolCompilandDetails : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CompilandDetails)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
index edebb38707de9fb..d79ab839d833a1c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h
@@ -16,7 +16,7 @@
 namespace llvm {
 
 namespace pdb {
-class PDBSymbolCompilandEnv : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolCompilandEnv : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CompilandEnv)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
index 661c079937e3377..9388dba7f6ecb8d 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h
@@ -20,7 +20,7 @@ namespace pdb {
 /// PDBSymbolCustom represents symbols that are compiler-specific and do not
 /// fit anywhere else in the lexical hierarchy.
 /// https://msdn.microsoft.com/en-us/library/d88sf09h.aspx
-class PDBSymbolCustom : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolCustom : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Custom)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h
index d629046d13d77d5..83d16c4be3a11ec 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h
@@ -20,7 +20,7 @@ namespace pdb {
 
 class PDBSymDumper;
 
-class PDBSymbolData : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolData : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Data)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
index e523d980c18be9c..e5be323d0f9e34e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
@@ -19,7 +19,7 @@ class raw_ostream;
 
 namespace pdb {
 
-class PDBSymbolExe : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolExe : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Exe)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
index 15c2762591de6ae..cffb42a41bba999 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h
@@ -24,7 +24,7 @@ class PDBSymbolData;
 class PDBSymbolTypeFunctionSig;
 template <typename ChildType> class IPDBEnumChildren;
 
-class PDBSymbolFunc : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolFunc : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Function)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
index 775b4bf7663f443..89c72c949ded966 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolFuncDebugEnd : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolFuncDebugEnd : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugEnd)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
index d7be5099f06e104..4c6e8d6fa4c15a2 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolFuncDebugStart : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolFuncDebugStart : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FuncDebugStart)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
index 2396a88498577af..35653142bfc2b87 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolLabel : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolLabel : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Label)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
index 240d98d763a1936..3416d4db5724da2 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolPublicSymbol : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolPublicSymbol : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PublicSymbol)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
index 0e141ead88eec51..8b28c3f8aea1a8d 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolThunk : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolThunk : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Thunk)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
index 75583ec16c10e65..25fc01265b50248 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeArray.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeArray : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeArray : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ArrayType)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
index 83221b654d90ce6..cb6c511cbc632bf 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
@@ -21,7 +21,7 @@ namespace pdb {
 
 class PDBSymDumper;
 
-class PDBSymbolTypeBaseClass : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeBaseClass : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::BaseClass)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
index 83e6c8174ccda6e..46410f8e1ac1e7f 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeBuiltin : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeBuiltin : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::BuiltinType)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
index cdef3fa869d0d08..c88efb742bff36c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeCustom : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeCustom : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::CustomType)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
index 0a0d7bb3e285c5e..394213d5c2abded 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeDimension : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeDimension : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Dimension)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
index 99b42f5aa58ca1a..ca21d9267ef2a25 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h
@@ -22,7 +22,7 @@ namespace pdb {
 class PDBSymDumper;
 class PDBSymbolTypeBuiltin;
 
-class PDBSymbolTypeEnum : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeEnum : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Enum)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
index ca8a613c5080e54..3003053812d7f5c 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeFriend : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeFriend : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Friend)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
index b1cb4c4b7a5db11..e2173cf38bb1a3e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeFunctionArg : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeFunctionArg : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FunctionArg)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
index fcca9e4a5f1f04f..1f5ebb6b0882a89 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h
@@ -18,7 +18,7 @@ namespace llvm {
 class raw_ostream;
 namespace pdb {
 
-class PDBSymbolTypeFunctionSig : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeFunctionSig : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::FunctionSig)
 public:
   std::unique_ptr<IPDBEnumSymbols> getArguments() const;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
index ae568811f092cae..129f28e34c191c7 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeManaged : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeManaged : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::ManagedType)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
index feb9a3856653943..6389ed902d9aef4 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypePointer.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypePointer : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypePointer : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::PointerType)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
index 5654b60c1f5a198..c49491cf930d0f0 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeTypedef : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeTypedef : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::Typedef)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
index 2f99f251e080179..c9796bb6a5ab25d 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
@@ -21,7 +21,7 @@ namespace pdb {
 
 class PDBSymDumper;
 
-class PDBSymbolTypeUDT : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeUDT : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::UDT)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
index 6cee234c9fdfd24..25525c433e55c82 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeVTable : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeVTable : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::VTable)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
index a17d0f1d793132a..acc1a5e4281845e 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolTypeVTableShape : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolTypeVTableShape : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::VTableShape)
 public:
   void dump(PDBSymDumper &Dumper) const override;
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
index 400299e8bc4b003..671f39a973a42c1 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolUnknown : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolUnknown : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CUSTOM_TYPE(S->getSymTag() == PDB_SymType::None ||
                                  S->getSymTag() >= PDB_SymType::Max)
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
index 28ff189234112da..56efa019a45a113 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 namespace pdb {
 
-class PDBSymbolUsingNamespace : public PDBSymbol {
+class LLVM_CLASS_ABI PDBSymbolUsingNamespace : public PDBSymbol {
   DECLARE_PDB_SYMBOL_CONCRETE_TYPE(PDB_SymType::UsingNamespace)
 
 public:
diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
index 3b04fc780ac97ae..c224ff1be43b9bf 100644
--- a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
+++ b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h
@@ -152,7 +152,7 @@ enum class PDB_Machine {
 // A struct with an inner unnamed enum with explicit underlying type resuls
 // in an enum class that can implicitly convert to the underlying type, which
 // is convenient for this enum.
-struct PDB_SourceCompression {
+struct LLVM_CLASS_ABI PDB_SourceCompression {
   enum : uint32_t {
     // No compression. Produced e.g. by `link.exe /natvis:foo.natvis`.
     None,
@@ -385,7 +385,7 @@ enum PDB_UndnameFlags : uint32_t {
 
 enum class PDB_MemberAccess { Private = 1, Protected = 2, Public = 3 };
 
-struct VersionInfo {
+struct LLVM_CLASS_ABI VersionInfo {
   uint32_t Major;
   uint32_t Minor;
   uint32_t Build;
@@ -409,7 +409,7 @@ enum PDB_VariantType {
   String
 };
 
-struct Variant {
+struct LLVM_CLASS_ABI Variant {
   Variant() = default;
 
   explicit Variant(bool V) : Type(PDB_VariantType::Bool) { Value.Bool = V; }
@@ -598,7 +598,7 @@ struct Variant {
 
 namespace std {
 
-template <> struct hash<llvm::pdb::PDB_SymType> {
+template <> struct LLVM_CLASS_ABI hash<llvm::pdb::PDB_SymType> {
   using argument_type = llvm::pdb::PDB_SymType;
   using result_type = std::size_t;
 
diff --git a/llvm/include/llvm/DebugInfo/PDB/UDTLayout.h b/llvm/include/llvm/DebugInfo/PDB/UDTLayout.h
index 3c24b957a35a648..67e93ed65c820d2 100644
--- a/llvm/include/llvm/DebugInfo/PDB/UDTLayout.h
+++ b/llvm/include/llvm/DebugInfo/PDB/UDTLayout.h
@@ -31,7 +31,7 @@ class BaseClassLayout;
 class ClassLayout;
 class UDTLayoutBase;
 
-class LayoutItemBase {
+class LLVM_CLASS_ABI LayoutItemBase {
 public:
   LayoutItemBase(const UDTLayoutBase *Parent, const PDBSymbol *Symbol,
                  const std::string &Name, uint32_t OffsetInParent,
@@ -69,7 +69,7 @@ class LayoutItemBase {
   bool IsElided = false;
 };
 
-class VBPtrLayoutItem : public LayoutItemBase {
+class LLVM_CLASS_ABI VBPtrLayoutItem : public LayoutItemBase {
 public:
   VBPtrLayoutItem(const UDTLayoutBase &Parent,
                   std::unique_ptr<PDBSymbolTypeBuiltin> Sym, uint32_t Offset,
@@ -81,7 +81,7 @@ class VBPtrLayoutItem : public LayoutItemBase {
   std::unique_ptr<PDBSymbolTypeBuiltin> Type;
 };
 
-class DataMemberLayoutItem : public LayoutItemBase {
+class LLVM_CLASS_ABI DataMemberLayoutItem : public LayoutItemBase {
 public:
   DataMemberLayoutItem(const UDTLayoutBase &Parent,
                        std::unique_ptr<PDBSymbolData> DataMember);
@@ -95,7 +95,7 @@ class DataMemberLayoutItem : public LayoutItemBase {
   std::unique_ptr<ClassLayout> UdtLayout;
 };
 
-class VTableLayoutItem : public LayoutItemBase {
+class LLVM_CLASS_ABI VTableLayoutItem : public LayoutItemBase {
 public:
   VTableLayoutItem(const UDTLayoutBase &Parent,
                    std::unique_ptr<PDBSymbolTypeVTable> VTable);
@@ -107,7 +107,7 @@ class VTableLayoutItem : public LayoutItemBase {
   std::unique_ptr<PDBSymbolTypeVTable> VTable;
 };
 
-class UDTLayoutBase : public LayoutItemBase {
+class LLVM_CLASS_ABI UDTLayoutBase : public LayoutItemBase {
   template <typename T> using UniquePtrVector = std::vector<std::unique_ptr<T>>;
 
 public:
@@ -145,7 +145,7 @@ class UDTLayoutBase : public LayoutItemBase {
   VBPtrLayoutItem *VBPtr = nullptr;
 };
 
-class BaseClassLayout : public UDTLayoutBase {
+class LLVM_CLASS_ABI BaseClassLayout : public UDTLayoutBase {
 public:
   BaseClassLayout(const UDTLayoutBase &Parent, uint32_t OffsetInParent,
                   bool Elide, std::unique_ptr<PDBSymbolTypeBaseClass> Base);
@@ -159,7 +159,7 @@ class BaseClassLayout : public UDTLayoutBase {
   bool IsVirtualBase;
 };
 
-class ClassLayout : public UDTLayoutBase {
+class LLVM_CLASS_ABI ClassLayout : public UDTLayoutBase {
 public:
   explicit ClassLayout(const PDBSymbolTypeUDT &UDT);
   explicit ClassLayout(std::unique_ptr<PDBSymbolTypeUDT> UDT);
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h b/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
index 0a2dfdb07f2fa20..164f06db246d776 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/DIPrinter.h
@@ -32,12 +32,12 @@ namespace symbolize {
 
 class SourceCode;
 
-struct Request {
+struct LLVM_CLASS_ABI Request {
   StringRef ModuleName;
   std::optional<uint64_t> Address;
 };
 
-class DIPrinter {
+class LLVM_CLASS_ABI DIPrinter {
 public:
   DIPrinter() = default;
   virtual ~DIPrinter() = default;
@@ -58,7 +58,7 @@ class DIPrinter {
   virtual void listEnd() = 0;
 };
 
-struct PrinterConfig {
+struct LLVM_CLASS_ABI PrinterConfig {
   bool PrintAddress;
   bool PrintFunctions;
   bool Pretty;
@@ -68,7 +68,7 @@ struct PrinterConfig {
 
 using ErrorHandler = function_ref<void(const ErrorInfoBase &, StringRef)>;
 
-class PlainPrinterBase : public DIPrinter {
+class LLVM_CLASS_ABI PlainPrinterBase : public DIPrinter {
 protected:
   raw_ostream &OS;
   ErrorHandler ErrHandler;
@@ -105,7 +105,7 @@ class PlainPrinterBase : public DIPrinter {
   void listEnd() override {}
 };
 
-class LLVMPrinter : public PlainPrinterBase {
+class LLVM_CLASS_ABI LLVMPrinter : public PlainPrinterBase {
 private:
   void printSimpleLocation(StringRef Filename, const DILineInfo &Info) override;
   void printStartAddress(const DILineInfo &Info) override;
@@ -116,7 +116,7 @@ class LLVMPrinter : public PlainPrinterBase {
       : PlainPrinterBase(OS, EH, Config) {}
 };
 
-class GNUPrinter : public PlainPrinterBase {
+class LLVM_CLASS_ABI GNUPrinter : public PlainPrinterBase {
 private:
   void printSimpleLocation(StringRef Filename, const DILineInfo &Info) override;
 
@@ -126,7 +126,7 @@ class GNUPrinter : public PlainPrinterBase {
 
 };
 
-class JSONPrinter : public DIPrinter {
+class LLVM_CLASS_ABI JSONPrinter : public DIPrinter {
 private:
   raw_ostream &OS;
   PrinterConfig Config;
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Markup.h b/llvm/include/llvm/DebugInfo/Symbolize/Markup.h
index d3698a440daea88..0a96e03a08e5cb1 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/Markup.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/Markup.h
@@ -31,7 +31,7 @@ namespace symbolize {
 /// markup element. ANSI SGR control codes are also reported this way; if
 /// detected, then the control code will be the entirety of the Text field, and
 /// any surrounding text will be reported as preceding and following nodes.
-struct MarkupNode {
+struct LLVM_CLASS_ABI MarkupNode {
   /// The full text of this node in the input.
   StringRef Text;
 
@@ -49,7 +49,7 @@ struct MarkupNode {
 };
 
 /// Parses a log containing symbolizer markup into a sequence of nodes.
-class MarkupParser {
+class LLVM_CLASS_ABI MarkupParser {
 public:
   MarkupParser(StringSet<> MultilineTags = {});
 
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h b/llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h
index 1e722319e8dbcce..cfa7a4368fd7ce8 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h
@@ -30,7 +30,7 @@ class LLVMSymbolizer;
 
 /// Filter to convert parsed log symbolizer markup elements into human-readable
 /// text.
-class MarkupFilter {
+class LLVM_CLASS_ABI MarkupFilter {
 public:
   MarkupFilter(raw_ostream &OS, LLVMSymbolizer &Symbolizer,
                std::optional<bool> ColorsEnabled = std::nullopt);
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
index 7037afa26893053..bf0758276821e63 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableModule.h
@@ -21,7 +21,7 @@ namespace symbolize {
 
 using FunctionNameKind = DILineInfoSpecifier::FunctionNameKind;
 
-class SymbolizableModule {
+class LLVM_CLASS_ABI SymbolizableModule {
 public:
   virtual ~SymbolizableModule() = default;
 
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
index 1db5746907c2f12..5524b7f50ac6028 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h
@@ -29,7 +29,7 @@ class DataExtractor;
 
 namespace symbolize {
 
-class SymbolizableObjectFile : public SymbolizableModule {
+class LLVM_CLASS_ABI SymbolizableObjectFile : public SymbolizableModule {
 public:
   static Expected<std::unique_ptr<SymbolizableObjectFile>>
   create(const object::ObjectFile *Obj, std::unique_ptr<DIContext> DICtx,
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
index 31bda033ae57216..a466f9031f0c50d 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
@@ -48,7 +48,7 @@ using FileLineInfoKind = DILineInfoSpecifier::FileLineInfoKind;
 
 class CachedBinary;
 
-class LLVMSymbolizer {
+class LLVM_CLASS_ABI LLVMSymbolizer {
 public:
   struct Options {
     FunctionNameKind PrintFunctions = FunctionNameKind::LinkageName;
@@ -219,7 +219,7 @@ class LLVMSymbolizer {
 // A binary intrusively linked into a LRU cache list. If the binary is empty,
 // then the entry marks that an error occurred, and it is not part of the LRU
 // list.
-class CachedBinary : public ilist_node<CachedBinary> {
+class LLVM_CLASS_ABI CachedBinary : public ilist_node<CachedBinary> {
 public:
   CachedBinary() = default;
   CachedBinary(OwningBinary<Binary> Bin) : Bin(std::move(Bin)) {}
diff --git a/llvm/include/llvm/Debuginfod/BuildIDFetcher.h b/llvm/include/llvm/Debuginfod/BuildIDFetcher.h
index 264e43ac22a221e..9e3dba5548352f5 100644
--- a/llvm/include/llvm/Debuginfod/BuildIDFetcher.h
+++ b/llvm/include/llvm/Debuginfod/BuildIDFetcher.h
@@ -21,7 +21,7 @@
 
 namespace llvm {
 
-class DebuginfodFetcher : public object::BuildIDFetcher {
+class LLVM_CLASS_ABI DebuginfodFetcher : public object::BuildIDFetcher {
 public:
   DebuginfodFetcher(std::vector<std::string> DebugFileDirectories)
       : BuildIDFetcher(std::move(DebugFileDirectories)) {}
diff --git a/llvm/include/llvm/Debuginfod/Debuginfod.h b/llvm/include/llvm/Debuginfod/Debuginfod.h
index 33831bd4535a20c..d5f8b5774e0b970 100644
--- a/llvm/include/llvm/Debuginfod/Debuginfod.h
+++ b/llvm/include/llvm/Debuginfod/Debuginfod.h
@@ -41,54 +41,54 @@ namespace llvm {
 
 /// Returns false if a debuginfod lookup can be determined to have no chance of
 /// succeeding.
-bool canUseDebuginfod();
+LLVM_FUNC_ABI bool canUseDebuginfod();
 
 /// Finds default array of Debuginfod server URLs by checking DEBUGINFOD_URLS
 /// environment variable.
-SmallVector<StringRef> getDefaultDebuginfodUrls();
+LLVM_FUNC_ABI SmallVector<StringRef> getDefaultDebuginfodUrls();
 
 /// Finds a default local file caching directory for the debuginfod client,
 /// first checking DEBUGINFOD_CACHE_PATH.
-Expected<std::string> getDefaultDebuginfodCacheDirectory();
+LLVM_FUNC_ABI Expected<std::string> getDefaultDebuginfodCacheDirectory();
 
 /// Finds a default timeout for debuginfod HTTP requests. Checks
 /// DEBUGINFOD_TIMEOUT environment variable, default is 90 seconds (90000 ms).
-std::chrono::milliseconds getDefaultDebuginfodTimeout();
+LLVM_FUNC_ABI std::chrono::milliseconds getDefaultDebuginfodTimeout();
 
 /// Fetches a specified source file by searching the default local cache
 /// directory and server URLs.
-Expected<std::string> getCachedOrDownloadSource(object::BuildIDRef ID,
+LLVM_FUNC_ABI Expected<std::string> getCachedOrDownloadSource(object::BuildIDRef ID,
                                                 StringRef SourceFilePath);
 
 /// Fetches an executable by searching the default local cache directory and
 /// server URLs.
-Expected<std::string> getCachedOrDownloadExecutable(object::BuildIDRef ID);
+LLVM_FUNC_ABI Expected<std::string> getCachedOrDownloadExecutable(object::BuildIDRef ID);
 
 /// Fetches a debug binary by searching the default local cache directory and
 /// server URLs.
-Expected<std::string> getCachedOrDownloadDebuginfo(object::BuildIDRef ID);
+LLVM_FUNC_ABI Expected<std::string> getCachedOrDownloadDebuginfo(object::BuildIDRef ID);
 
 /// Fetches any debuginfod artifact using the default local cache directory and
 /// server URLs.
-Expected<std::string> getCachedOrDownloadArtifact(StringRef UniqueKey,
+LLVM_FUNC_ABI Expected<std::string> getCachedOrDownloadArtifact(StringRef UniqueKey,
                                                   StringRef UrlPath);
 
 /// Fetches any debuginfod artifact using the specified local cache directory,
 /// server URLs, and request timeout (in milliseconds). If the artifact is
 /// found, uses the UniqueKey for the local cache file.
-Expected<std::string> getCachedOrDownloadArtifact(
+LLVM_FUNC_ABI Expected<std::string> getCachedOrDownloadArtifact(
     StringRef UniqueKey, StringRef UrlPath, StringRef CacheDirectoryPath,
     ArrayRef<StringRef> DebuginfodUrls, std::chrono::milliseconds Timeout);
 
 class ThreadPool;
 
-struct DebuginfodLogEntry {
+struct LLVM_CLASS_ABI DebuginfodLogEntry {
   std::string Message;
   DebuginfodLogEntry() = default;
   DebuginfodLogEntry(const Twine &Message);
 };
 
-class DebuginfodLog {
+class LLVM_CLASS_ABI DebuginfodLog {
   std::mutex QueueMutex;
   std::condition_variable QueueCondition;
   std::queue<DebuginfodLogEntry> LogEntryQueue;
@@ -104,7 +104,7 @@ class DebuginfodLog {
 };
 
 /// Tracks a collection of debuginfod artifacts on the local filesystem.
-class DebuginfodCollection {
+class LLVM_CLASS_ABI DebuginfodCollection {
   SmallVector<std::string, 1> Paths;
   sys::RWMutex BinariesMutex;
   StringMap<std::string> Binaries;
@@ -135,7 +135,7 @@ class DebuginfodCollection {
   Expected<std::string> findBinaryPath(object::BuildIDRef);
 };
 
-struct DebuginfodServer {
+struct LLVM_CLASS_ABI DebuginfodServer {
   HTTPServer Server;
   DebuginfodLog &Log;
   DebuginfodCollection &Collection;
diff --git a/llvm/include/llvm/Debuginfod/HTTPClient.h b/llvm/include/llvm/Debuginfod/HTTPClient.h
index a382727d99057dd..1a12279a4dfdefe 100644
--- a/llvm/include/llvm/Debuginfod/HTTPClient.h
+++ b/llvm/include/llvm/Debuginfod/HTTPClient.h
@@ -28,7 +28,7 @@ namespace llvm {
 enum class HTTPMethod { GET };
 
 /// A stateless description of an outbound HTTP request.
-struct HTTPRequest {
+struct LLVM_CLASS_ABI HTTPRequest {
   SmallString<128> Url;
   SmallVector<std::string, 0> Headers;
   HTTPMethod Method = HTTPMethod::GET;
@@ -36,12 +36,12 @@ struct HTTPRequest {
   HTTPRequest(StringRef Url);
 };
 
-bool operator==(const HTTPRequest &A, const HTTPRequest &B);
+LLVM_FUNC_ABI bool operator==(const HTTPRequest &A, const HTTPRequest &B);
 
 /// A handler for state updates occurring while an HTTPRequest is performed.
 /// Can trigger the client to abort the request by returning an Error from any
 /// of its methods.
-class HTTPResponseHandler {
+class LLVM_CLASS_ABI HTTPResponseHandler {
 public:
   /// Processes an additional chunk of bytes of the HTTP response body.
   virtual Error handleBodyChunk(StringRef BodyChunk) = 0;
@@ -51,7 +51,7 @@ class HTTPResponseHandler {
 };
 
 /// A reusable client that can perform HTTPRequests through a network socket.
-class HTTPClient {
+class LLVM_CLASS_ABI HTTPClient {
 #ifdef LLVM_ENABLE_CURL
   void *Curl = nullptr;
 #endif
diff --git a/llvm/include/llvm/Debuginfod/HTTPServer.h b/llvm/include/llvm/Debuginfod/HTTPServer.h
index 4ef2fc1def3589c..04f5e2413fca1e2 100644
--- a/llvm/include/llvm/Debuginfod/HTTPServer.h
+++ b/llvm/include/llvm/Debuginfod/HTTPServer.h
@@ -35,7 +35,7 @@ struct HTTPResponse;
 struct StreamingHTTPResponse;
 class HTTPServer;
 
-class HTTPServerRequest {
+class LLVM_CLASS_ABI HTTPServerRequest {
   friend HTTPServer;
 
 #ifdef LLVM_ENABLE_HTTPLIB
@@ -56,7 +56,7 @@ class HTTPServerRequest {
   void setResponse(HTTPResponse Response);
 };
 
-struct HTTPResponse {
+struct LLVM_CLASS_ABI HTTPResponse {
   unsigned Code;
   const char *ContentType;
   StringRef Body;
@@ -71,7 +71,7 @@ typedef std::function<StringRef(size_t /*Offset*/, size_t /*Length*/)>
     HTTPContentProvider;
 
 /// Wraps the content provider with HTTP Status code and headers.
-struct StreamingHTTPResponse {
+struct LLVM_CLASS_ABI StreamingHTTPResponse {
   unsigned Code;
   const char *ContentType;
   size_t ContentLength;
@@ -83,11 +83,11 @@ struct StreamingHTTPResponse {
 
 /// Sets the response to stream the file at FilePath, if available, and
 /// otherwise an HTTP 404 error response.
-bool streamFile(HTTPServerRequest &Request, StringRef FilePath);
+LLVM_FUNC_ABI bool streamFile(HTTPServerRequest &Request, StringRef FilePath);
 
 /// An HTTP server which can listen on a single TCP/IP port for HTTP
 /// requests and delgate them to the appropriate registered handler.
-class HTTPServer {
+class LLVM_CLASS_ABI HTTPServer {
 #ifdef LLVM_ENABLE_HTTPLIB
   std::unique_ptr<httplib::Server> Server;
   unsigned Port = 0;
diff --git a/llvm/include/llvm/Demangle/Demangle.h b/llvm/include/llvm/Demangle/Demangle.h
index 59d8828b6607143..9326c809719e6cc 100644
--- a/llvm/include/llvm/Demangle/Demangle.h
+++ b/llvm/include/llvm/Demangle/Demangle.h
@@ -33,7 +33,7 @@ enum : int {
 /// Returns a non-NULL pointer to a NUL-terminated C style string
 /// that should be explicitly freed, if successful. Otherwise, may return
 /// nullptr if mangled_name is not a valid mangling or is nullptr.
-char *itaniumDemangle(std::string_view mangled_name);
+LLVM_FUNC_ABI char *itaniumDemangle(std::string_view mangled_name);
 
 enum MSDemangleFlags {
   MSDF_None = 0,
@@ -52,28 +52,28 @@ enum MSDemangleFlags {
 /// bytes of the input string were consumed.
 /// status receives one of the demangle_ enum entries above if it's not nullptr.
 /// Flags controls various details of the demangled representation.
-char *microsoftDemangle(std::string_view mangled_name, size_t *n_read,
+LLVM_FUNC_ABI char *microsoftDemangle(std::string_view mangled_name, size_t *n_read,
                         int *status, MSDemangleFlags Flags = MSDF_None);
 
 // Demangles a Rust v0 mangled symbol.
-char *rustDemangle(std::string_view MangledName);
+LLVM_FUNC_ABI char *rustDemangle(std::string_view MangledName);
 
 // Demangles a D mangled symbol.
-char *dlangDemangle(std::string_view MangledName);
+LLVM_FUNC_ABI char *dlangDemangle(std::string_view MangledName);
 
 /// Attempt to demangle a string using different demangling schemes.
 /// The function uses heuristics to determine which demangling scheme to use.
 /// \param MangledName - reference to string to demangle.
 /// \returns - the demangled string, or a copy of the input string if no
 /// demangling occurred.
-std::string demangle(std::string_view MangledName);
+LLVM_FUNC_ABI std::string demangle(std::string_view MangledName);
 
-bool nonMicrosoftDemangle(std::string_view MangledName, std::string &Result);
+LLVM_FUNC_ABI bool nonMicrosoftDemangle(std::string_view MangledName, std::string &Result);
 
 /// "Partial" demangler. This supports demangling a string into an AST
 /// (typically an intermediate stage in itaniumDemangle) and querying certain
 /// properties or partially printing the demangled name.
-struct ItaniumPartialDemangler {
+struct LLVM_CLASS_ABI ItaniumPartialDemangler {
   ItaniumPartialDemangler();
 
   ItaniumPartialDemangler(ItaniumPartialDemangler &&Other);
diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index 398d02f10e4945c..e0fd46e56871275 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -34,7 +34,7 @@
 
 DEMANGLE_NAMESPACE_BEGIN
 
-template <class T, size_t N> class PODSmallVector {
+template <class T, size_t N> class LLVM_CLASS_ABI PODSmallVector {
   static_assert(std::is_pod<T>::value,
                 "T is required to be a plain old data type");
 
@@ -156,7 +156,7 @@ template <class T, size_t N> class PODSmallVector {
 
 // Base class of all AST nodes. The AST is built by the parser, then is
 // traversed by the printLeft/Right functions to produce a demangled string.
-class Node {
+class LLVM_CLASS_ABI Node {
 public:
   enum Kind : unsigned char {
 #define NODE(NodeKind) K##NodeKind,
@@ -299,7 +299,7 @@ class Node {
 #endif
 };
 
-class NodeArray {
+class LLVM_CLASS_ABI NodeArray {
   Node **Elements;
   size_t NumElements;
 
@@ -337,7 +337,7 @@ class NodeArray {
   }
 };
 
-struct NodeArrayNode : Node {
+struct LLVM_CLASS_ABI NodeArrayNode : Node {
   NodeArray Array;
   NodeArrayNode(NodeArray Array_) : Node(KNodeArrayNode), Array(Array_) {}
 
@@ -346,7 +346,7 @@ struct NodeArrayNode : Node {
   void printLeft(OutputBuffer &OB) const override { Array.printWithComma(OB); }
 };
 
-class DotSuffix final : public Node {
+class LLVM_CLASS_ABI DotSuffix final : public Node {
   const Node *Prefix;
   const std::string_view Suffix;
 
@@ -364,7 +364,7 @@ class DotSuffix final : public Node {
   }
 };
 
-class VendorExtQualType final : public Node {
+class LLVM_CLASS_ABI VendorExtQualType final : public Node {
   const Node *Ty;
   std::string_view Ext;
   const Node *TA;
@@ -405,7 +405,7 @@ inline Qualifiers operator|=(Qualifiers &Q1, Qualifiers Q2) {
   return Q1 = static_cast<Qualifiers>(Q1 | Q2);
 }
 
-class QualType final : public Node {
+class LLVM_CLASS_ABI QualType final : public Node {
 protected:
   const Qualifiers Quals;
   const Node *Child;
@@ -448,7 +448,7 @@ class QualType final : public Node {
   void printRight(OutputBuffer &OB) const override { Child->printRight(OB); }
 };
 
-class ConversionOperatorType final : public Node {
+class LLVM_CLASS_ABI ConversionOperatorType final : public Node {
   const Node *Ty;
 
 public:
@@ -463,7 +463,7 @@ class ConversionOperatorType final : public Node {
   }
 };
 
-class PostfixQualifiedType final : public Node {
+class LLVM_CLASS_ABI PostfixQualifiedType final : public Node {
   const Node *Ty;
   const std::string_view Postfix;
 
@@ -479,7 +479,7 @@ class PostfixQualifiedType final : public Node {
   }
 };
 
-class NameType final : public Node {
+class LLVM_CLASS_ABI NameType final : public Node {
   const std::string_view Name;
 
 public:
@@ -493,7 +493,7 @@ class NameType final : public Node {
   void printLeft(OutputBuffer &OB) const override { OB += Name; }
 };
 
-class BitIntType final : public Node {
+class LLVM_CLASS_ABI BitIntType final : public Node {
   const Node *Size;
   bool Signed;
 
@@ -513,7 +513,7 @@ class BitIntType final : public Node {
   }
 };
 
-class ElaboratedTypeSpefType : public Node {
+class LLVM_CLASS_ABI ElaboratedTypeSpefType : public Node {
   std::string_view Kind;
   Node *Child;
 public:
@@ -529,7 +529,7 @@ class ElaboratedTypeSpefType : public Node {
   }
 };
 
-struct AbiTagAttr : Node {
+struct LLVM_CLASS_ABI AbiTagAttr : Node {
   Node *Base;
   std::string_view Tag;
 
@@ -550,7 +550,7 @@ struct AbiTagAttr : Node {
   }
 };
 
-class EnableIfAttr : public Node {
+class LLVM_CLASS_ABI EnableIfAttr : public Node {
   NodeArray Conditions;
 public:
   EnableIfAttr(NodeArray Conditions_)
@@ -565,7 +565,7 @@ class EnableIfAttr : public Node {
   }
 };
 
-class ObjCProtoName : public Node {
+class LLVM_CLASS_ABI ObjCProtoName : public Node {
   const Node *Ty;
   std::string_view Protocol;
 
@@ -590,7 +590,7 @@ class ObjCProtoName : public Node {
   }
 };
 
-class PointerType final : public Node {
+class LLVM_CLASS_ABI PointerType final : public Node {
   const Node *Pointee;
 
 public:
@@ -640,7 +640,7 @@ enum class ReferenceKind {
 };
 
 // Represents either a LValue or an RValue reference type.
-class ReferenceType : public Node {
+class LLVM_CLASS_ABI ReferenceType : public Node {
   const Node *Pointee;
   ReferenceKind RK;
 
@@ -716,7 +716,7 @@ class ReferenceType : public Node {
   }
 };
 
-class PointerToMemberType final : public Node {
+class LLVM_CLASS_ABI PointerToMemberType final : public Node {
   const Node *ClassType;
   const Node *MemberType;
 
@@ -748,7 +748,7 @@ class PointerToMemberType final : public Node {
   }
 };
 
-class ArrayType final : public Node {
+class LLVM_CLASS_ABI ArrayType final : public Node {
   const Node *Base;
   Node *Dimension;
 
@@ -777,7 +777,7 @@ class ArrayType final : public Node {
   }
 };
 
-class FunctionType final : public Node {
+class LLVM_CLASS_ABI FunctionType final : public Node {
   const Node *Ret;
   NodeArray Params;
   Qualifiers CVQuals;
@@ -837,7 +837,7 @@ class FunctionType final : public Node {
   }
 };
 
-class NoexceptSpec : public Node {
+class LLVM_CLASS_ABI NoexceptSpec : public Node {
   const Node *E;
 public:
   NoexceptSpec(const Node *E_) : Node(KNoexceptSpec), E(E_) {}
@@ -852,7 +852,7 @@ class NoexceptSpec : public Node {
   }
 };
 
-class DynamicExceptionSpec : public Node {
+class LLVM_CLASS_ABI DynamicExceptionSpec : public Node {
   NodeArray Types;
 public:
   DynamicExceptionSpec(NodeArray Types_)
@@ -868,7 +868,7 @@ class DynamicExceptionSpec : public Node {
   }
 };
 
-class FunctionEncoding final : public Node {
+class LLVM_CLASS_ABI FunctionEncoding final : public Node {
   const Node *Ret;
   const Node *Name;
   NodeArray Params;
@@ -933,7 +933,7 @@ class FunctionEncoding final : public Node {
   }
 };
 
-class LiteralOperator : public Node {
+class LLVM_CLASS_ABI LiteralOperator : public Node {
   const Node *OpName;
 
 public:
@@ -948,7 +948,7 @@ class LiteralOperator : public Node {
   }
 };
 
-class SpecialName final : public Node {
+class LLVM_CLASS_ABI SpecialName final : public Node {
   const std::string_view Special;
   const Node *Child;
 
@@ -964,7 +964,7 @@ class SpecialName final : public Node {
   }
 };
 
-class CtorVtableSpecialName final : public Node {
+class LLVM_CLASS_ABI CtorVtableSpecialName final : public Node {
   const Node *FirstType;
   const Node *SecondType;
 
@@ -983,7 +983,7 @@ class CtorVtableSpecialName final : public Node {
   }
 };
 
-struct NestedName : Node {
+struct LLVM_CLASS_ABI NestedName : Node {
   Node *Qual;
   Node *Name;
 
@@ -1001,7 +1001,7 @@ struct NestedName : Node {
   }
 };
 
-struct ModuleName : Node {
+struct LLVM_CLASS_ABI ModuleName : Node {
   ModuleName *Parent;
   Node *Name;
   bool IsPartition;
@@ -1023,7 +1023,7 @@ struct ModuleName : Node {
   }
 };
 
-struct ModuleEntity : Node {
+struct LLVM_CLASS_ABI ModuleEntity : Node {
   ModuleName *Module;
   Node *Name;
 
@@ -1041,7 +1041,7 @@ struct ModuleEntity : Node {
   }
 };
 
-struct LocalName : Node {
+struct LLVM_CLASS_ABI LocalName : Node {
   Node *Encoding;
   Node *Entity;
 
@@ -1057,7 +1057,7 @@ struct LocalName : Node {
   }
 };
 
-class QualifiedName final : public Node {
+class LLVM_CLASS_ABI QualifiedName final : public Node {
   // qualifier::name
   const Node *Qualifier;
   const Node *Name;
@@ -1077,7 +1077,7 @@ class QualifiedName final : public Node {
   }
 };
 
-class VectorType final : public Node {
+class LLVM_CLASS_ABI VectorType final : public Node {
   const Node *BaseType;
   const Node *Dimension;
 
@@ -1099,7 +1099,7 @@ class VectorType final : public Node {
   }
 };
 
-class PixelVectorType final : public Node {
+class LLVM_CLASS_ABI PixelVectorType final : public Node {
   const Node *Dimension;
 
 public:
@@ -1116,7 +1116,7 @@ class PixelVectorType final : public Node {
   }
 };
 
-class BinaryFPType final : public Node {
+class LLVM_CLASS_ABI BinaryFPType final : public Node {
   const Node *Dimension;
 
 public:
@@ -1139,7 +1139,7 @@ enum class TemplateParamKind { Type, NonType, Template };
 /// This node is created when parsing the <lambda-sig> for a lambda with
 /// explicit template arguments, which might be referenced in the parameter
 /// types appearing later in the <lambda-sig>.
-class SyntheticTemplateParamName final : public Node {
+class LLVM_CLASS_ABI SyntheticTemplateParamName final : public Node {
   TemplateParamKind Kind;
   unsigned Index;
 
@@ -1167,7 +1167,7 @@ class SyntheticTemplateParamName final : public Node {
 };
 
 /// A template type parameter declaration, 'typename T'.
-class TypeTemplateParamDecl final : public Node {
+class LLVM_CLASS_ABI TypeTemplateParamDecl final : public Node {
   Node *Name;
 
 public:
@@ -1182,7 +1182,7 @@ class TypeTemplateParamDecl final : public Node {
 };
 
 /// A non-type template parameter declaration, 'int N'.
-class NonTypeTemplateParamDecl final : public Node {
+class LLVM_CLASS_ABI NonTypeTemplateParamDecl final : public Node {
   Node *Name;
   Node *Type;
 
@@ -1206,7 +1206,7 @@ class NonTypeTemplateParamDecl final : public Node {
 
 /// A template template parameter declaration,
 /// 'template<typename T> typename N'.
-class TemplateTemplateParamDecl final : public Node {
+class LLVM_CLASS_ABI TemplateTemplateParamDecl final : public Node {
   Node *Name;
   NodeArray Params;
 
@@ -1228,7 +1228,7 @@ class TemplateTemplateParamDecl final : public Node {
 };
 
 /// A template parameter pack declaration, 'typename ...T'.
-class TemplateParamPackDecl final : public Node {
+class LLVM_CLASS_ABI TemplateParamPackDecl final : public Node {
   Node *Param;
 
 public:
@@ -1253,7 +1253,7 @@ class TemplateParamPackDecl final : public Node {
 /// <encoding>, and is stored in the TemplateParams table. In order for this to
 /// appear in the final AST, it has to referenced via a <template-param> (ie,
 /// T_).
-class ParameterPack final : public Node {
+class LLVM_CLASS_ABI ParameterPack final : public Node {
   NodeArray Data;
 
   // Setup OutputBuffer for a pack expansion, unless we're already expanding
@@ -1324,7 +1324,7 @@ class ParameterPack final : public Node {
 /// one of it's Elements is. The parser inserts a ParameterPack into the
 /// TemplateParams table if the <template-args> this pack belongs to apply to an
 /// <encoding>.
-class TemplateArgumentPack final : public Node {
+class LLVM_CLASS_ABI TemplateArgumentPack final : public Node {
   NodeArray Elements;
 public:
   TemplateArgumentPack(NodeArray Elements_)
@@ -1341,7 +1341,7 @@ class TemplateArgumentPack final : public Node {
 
 /// A pack expansion. Below this node, there are some unexpanded ParameterPacks
 /// which each have Child->ParameterPackSize elements.
-class ParameterPackExpansion final : public Node {
+class LLVM_CLASS_ABI ParameterPackExpansion final : public Node {
   const Node *Child;
 
 public:
@@ -1385,7 +1385,7 @@ class ParameterPackExpansion final : public Node {
   }
 };
 
-class TemplateArgs final : public Node {
+class LLVM_CLASS_ABI TemplateArgs final : public Node {
   NodeArray Params;
 
 public:
@@ -1421,7 +1421,7 @@ class TemplateArgs final : public Node {
 /// for the corresponding argument while parsing. Instead, we create a
 /// \c ForwardTemplateReference node that is resolved after we parse the
 /// template arguments.
-struct ForwardTemplateReference : Node {
+struct LLVM_CLASS_ABI ForwardTemplateReference : Node {
   size_t Index;
   Node *Ref = nullptr;
 
@@ -1480,7 +1480,7 @@ struct ForwardTemplateReference : Node {
   }
 };
 
-struct NameWithTemplateArgs : Node {
+struct LLVM_CLASS_ABI NameWithTemplateArgs : Node {
   // name<template_args>
   Node *Name;
   Node *TemplateArgs;
@@ -1498,7 +1498,7 @@ struct NameWithTemplateArgs : Node {
   }
 };
 
-class GlobalQualifiedName final : public Node {
+class LLVM_CLASS_ABI GlobalQualifiedName final : public Node {
   Node *Child;
 
 public:
@@ -1525,7 +1525,7 @@ enum class SpecialSubKind {
 };
 
 class SpecialSubstitution;
-class ExpandedSpecialSubstitution : public Node {
+class LLVM_CLASS_ABI ExpandedSpecialSubstitution : public Node {
 protected:
   SpecialSubKind SSK;
 
@@ -1573,7 +1573,7 @@ class ExpandedSpecialSubstitution : public Node {
   }
 };
 
-class SpecialSubstitution final : public ExpandedSpecialSubstitution {
+class LLVM_CLASS_ABI SpecialSubstitution final : public ExpandedSpecialSubstitution {
 public:
   SpecialSubstitution(SpecialSubKind SSK_)
       : ExpandedSpecialSubstitution(SSK_, KSpecialSubstitution) {}
@@ -1599,7 +1599,7 @@ inline ExpandedSpecialSubstitution::ExpandedSpecialSubstitution(
     SpecialSubstitution const *SS)
     : ExpandedSpecialSubstitution(SS->SSK) {}
 
-class CtorDtorName final : public Node {
+class LLVM_CLASS_ABI CtorDtorName final : public Node {
   const Node *Basename;
   const bool IsDtor;
   const int Variant;
@@ -1618,7 +1618,7 @@ class CtorDtorName final : public Node {
   }
 };
 
-class DtorName : public Node {
+class LLVM_CLASS_ABI DtorName : public Node {
   const Node *Base;
 
 public:
@@ -1632,7 +1632,7 @@ class DtorName : public Node {
   }
 };
 
-class UnnamedTypeName : public Node {
+class LLVM_CLASS_ABI UnnamedTypeName : public Node {
   const std::string_view Count;
 
 public:
@@ -1648,7 +1648,7 @@ class UnnamedTypeName : public Node {
   }
 };
 
-class ClosureTypeName : public Node {
+class LLVM_CLASS_ABI ClosureTypeName : public Node {
   NodeArray TemplateParams;
   NodeArray Params;
   std::string_view Count;
@@ -1683,7 +1683,7 @@ class ClosureTypeName : public Node {
   }
 };
 
-class StructuredBindingName : public Node {
+class LLVM_CLASS_ABI StructuredBindingName : public Node {
   NodeArray Bindings;
 public:
   StructuredBindingName(NodeArray Bindings_)
@@ -1700,7 +1700,7 @@ class StructuredBindingName : public Node {
 
 // -- Expression Nodes --
 
-class BinaryExpr : public Node {
+class LLVM_CLASS_ABI BinaryExpr : public Node {
   const Node *LHS;
   const std::string_view InfixOperator;
   const Node *RHS;
@@ -1734,7 +1734,7 @@ class BinaryExpr : public Node {
   }
 };
 
-class ArraySubscriptExpr : public Node {
+class LLVM_CLASS_ABI ArraySubscriptExpr : public Node {
   const Node *Op1;
   const Node *Op2;
 
@@ -1754,7 +1754,7 @@ class ArraySubscriptExpr : public Node {
   }
 };
 
-class PostfixExpr : public Node {
+class LLVM_CLASS_ABI PostfixExpr : public Node {
   const Node *Child;
   const std::string_view Operator;
 
@@ -1772,7 +1772,7 @@ class PostfixExpr : public Node {
   }
 };
 
-class ConditionalExpr : public Node {
+class LLVM_CLASS_ABI ConditionalExpr : public Node {
   const Node *Cond;
   const Node *Then;
   const Node *Else;
@@ -1795,7 +1795,7 @@ class ConditionalExpr : public Node {
   }
 };
 
-class MemberExpr : public Node {
+class LLVM_CLASS_ABI MemberExpr : public Node {
   const Node *LHS;
   const std::string_view Kind;
   const Node *RHS;
@@ -1816,7 +1816,7 @@ class MemberExpr : public Node {
   }
 };
 
-class SubobjectExpr : public Node {
+class LLVM_CLASS_ABI SubobjectExpr : public Node {
   const Node *Type;
   const Node *SubExpr;
   std::string_view Offset;
@@ -1851,7 +1851,7 @@ class SubobjectExpr : public Node {
   }
 };
 
-class EnclosingExpr : public Node {
+class LLVM_CLASS_ABI EnclosingExpr : public Node {
   const std::string_view Prefix;
   const Node *Infix;
   const std::string_view Postfix;
@@ -1874,7 +1874,7 @@ class EnclosingExpr : public Node {
   }
 };
 
-class CastExpr : public Node {
+class LLVM_CLASS_ABI CastExpr : public Node {
   // cast_kind<to>(from)
   const std::string_view CastKind;
   const Node *To;
@@ -1903,7 +1903,7 @@ class CastExpr : public Node {
   }
 };
 
-class SizeofParamPackExpr : public Node {
+class LLVM_CLASS_ABI SizeofParamPackExpr : public Node {
   const Node *Pack;
 
 public:
@@ -1921,7 +1921,7 @@ class SizeofParamPackExpr : public Node {
   }
 };
 
-class CallExpr : public Node {
+class LLVM_CLASS_ABI CallExpr : public Node {
   const Node *Callee;
   NodeArray Args;
 
@@ -1941,7 +1941,7 @@ class CallExpr : public Node {
   }
 };
 
-class NewExpr : public Node {
+class LLVM_CLASS_ABI NewExpr : public Node {
   // new (expr_list) type(init_list)
   NodeArray ExprList;
   Node *Type;
@@ -1979,7 +1979,7 @@ class NewExpr : public Node {
   }
 };
 
-class DeleteExpr : public Node {
+class LLVM_CLASS_ABI DeleteExpr : public Node {
   Node *Op;
   bool IsGlobal;
   bool IsArray;
@@ -2004,7 +2004,7 @@ class DeleteExpr : public Node {
   }
 };
 
-class PrefixExpr : public Node {
+class LLVM_CLASS_ABI PrefixExpr : public Node {
   std::string_view Prefix;
   Node *Child;
 
@@ -2022,7 +2022,7 @@ class PrefixExpr : public Node {
   }
 };
 
-class FunctionParam : public Node {
+class LLVM_CLASS_ABI FunctionParam : public Node {
   std::string_view Number;
 
 public:
@@ -2037,7 +2037,7 @@ class FunctionParam : public Node {
   }
 };
 
-class ConversionExpr : public Node {
+class LLVM_CLASS_ABI ConversionExpr : public Node {
   const Node *Type;
   NodeArray Expressions;
 
@@ -2059,7 +2059,7 @@ class ConversionExpr : public Node {
   }
 };
 
-class PointerToMemberConversionExpr : public Node {
+class LLVM_CLASS_ABI PointerToMemberConversionExpr : public Node {
   const Node *Type;
   const Node *SubExpr;
   std::string_view Offset;
@@ -2084,7 +2084,7 @@ class PointerToMemberConversionExpr : public Node {
   }
 };
 
-class InitListExpr : public Node {
+class LLVM_CLASS_ABI InitListExpr : public Node {
   const Node *Ty;
   NodeArray Inits;
 public:
@@ -2102,7 +2102,7 @@ class InitListExpr : public Node {
   }
 };
 
-class BracedExpr : public Node {
+class LLVM_CLASS_ABI BracedExpr : public Node {
   const Node *Elem;
   const Node *Init;
   bool IsArray;
@@ -2127,7 +2127,7 @@ class BracedExpr : public Node {
   }
 };
 
-class BracedRangeExpr : public Node {
+class LLVM_CLASS_ABI BracedRangeExpr : public Node {
   const Node *First;
   const Node *Last;
   const Node *Init;
@@ -2149,7 +2149,7 @@ class BracedRangeExpr : public Node {
   }
 };
 
-class FoldExpr : public Node {
+class LLVM_CLASS_ABI FoldExpr : public Node {
   const Node *Pack, *Init;
   std::string_view OperatorName;
   bool IsLeftFold;
@@ -2196,7 +2196,7 @@ class FoldExpr : public Node {
   }
 };
 
-class ThrowExpr : public Node {
+class LLVM_CLASS_ABI ThrowExpr : public Node {
   const Node *Op;
 
 public:
@@ -2210,7 +2210,7 @@ class ThrowExpr : public Node {
   }
 };
 
-class BoolExpr : public Node {
+class LLVM_CLASS_ABI BoolExpr : public Node {
   bool Value;
 
 public:
@@ -2223,7 +2223,7 @@ class BoolExpr : public Node {
   }
 };
 
-class StringLiteral : public Node {
+class LLVM_CLASS_ABI StringLiteral : public Node {
   const Node *Type;
 
 public:
@@ -2238,7 +2238,7 @@ class StringLiteral : public Node {
   }
 };
 
-class LambdaExpr : public Node {
+class LLVM_CLASS_ABI LambdaExpr : public Node {
   const Node *Type;
 
 public:
@@ -2254,7 +2254,7 @@ class LambdaExpr : public Node {
   }
 };
 
-class EnumLiteral : public Node {
+class LLVM_CLASS_ABI EnumLiteral : public Node {
   // ty(integer)
   const Node *Ty;
   std::string_view Integer;
@@ -2277,7 +2277,7 @@ class EnumLiteral : public Node {
   }
 };
 
-class IntegerLiteral : public Node {
+class LLVM_CLASS_ABI IntegerLiteral : public Node {
   std::string_view Type;
   std::string_view Value;
 
@@ -2318,7 +2318,7 @@ constexpr Node::Kind getFloatLiteralKind(long double *) {
 }
 }
 
-template <class Float> class FloatLiteralImpl : public Node {
+template <class Float> class LLVM_CLASS_ABI FloatLiteralImpl : public Node {
   const std::string_view Contents;
 
   static constexpr Kind KindForClass =
@@ -2384,7 +2384,7 @@ template<typename NodeT> struct NodeKind;
   };
 #include "ItaniumNodes.def"
 
-template <typename Derived, typename Alloc> struct AbstractManglingParser {
+template <typename Derived, typename Alloc> struct LLVM_CLASS_ABI AbstractManglingParser {
   const char *First;
   const char *Last;
 
@@ -2662,7 +2662,7 @@ template <typename Derived, typename Alloc> struct AbstractManglingParser {
   Node *parse();
 };
 
-const char* parse_discriminator(const char* first, const char* last);
+LLVM_FUNC_ABI const char* parse_discriminator(const char* first, const char* last);
 
 // <name> ::= <nested-name> // N
 //        ::= <local-name> # See Scope Encoding below  // Z
@@ -5029,7 +5029,7 @@ template <typename Derived, typename Alloc>
 Node *AbstractManglingParser<Derived, Alloc>::parseEncoding() {
   // The template parameters of an encoding are unrelated to those of the
   // enclosing context.
-  class SaveTemplateParams {
+  class LLVM_CLASS_ABI SaveTemplateParams {
     AbstractManglingParser *Parser;
     decltype(TemplateParams) OldParams;
     decltype(OuterTemplateParams) OldOuterParams;
@@ -5112,7 +5112,7 @@ template <class Float>
 struct FloatData;
 
 template <>
-struct FloatData<float>
+struct LLVM_CLASS_ABI FloatData<float>
 {
     static const size_t mangled_size = 8;
     static const size_t max_demangled_size = 24;
@@ -5120,7 +5120,7 @@ struct FloatData<float>
 };
 
 template <>
-struct FloatData<double>
+struct LLVM_CLASS_ABI FloatData<double>
 {
     static const size_t mangled_size = 16;
     static const size_t max_demangled_size = 32;
@@ -5128,7 +5128,7 @@ struct FloatData<double>
 };
 
 template <>
-struct FloatData<long double>
+struct LLVM_CLASS_ABI FloatData<long double>
 {
 #if defined(__mips__) && defined(__mips_n64) || defined(__aarch64__) || \
     defined(__wasm__) || defined(__riscv) || defined(__loongarch__)
@@ -5503,7 +5503,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parse() {
 }
 
 template <typename Alloc>
-struct ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {
+struct LLVM_CLASS_ABI ManglingParser : AbstractManglingParser<ManglingParser<Alloc>, Alloc> {
   using AbstractManglingParser<ManglingParser<Alloc>,
                                Alloc>::AbstractManglingParser;
 };
diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangle.h b/llvm/include/llvm/Demangle/MicrosoftDemangle.h
index d76e2de83a50ff1..369f2494107c8f7 100644
--- a/llvm/include/llvm/Demangle/MicrosoftDemangle.h
+++ b/llvm/include/llvm/Demangle/MicrosoftDemangle.h
@@ -25,7 +25,7 @@ namespace ms_demangle {
 // STL containers.
 constexpr size_t AllocUnit = 4096;
 
-class ArenaAllocator {
+class LLVM_CLASS_ABI ArenaAllocator {
   struct AllocatorNode {
     uint8_t *Buf = nullptr;
     size_t Used = 0;
@@ -112,7 +112,7 @@ class ArenaAllocator {
   AllocatorNode *Head = nullptr;
 };
 
-struct BackrefContext {
+struct LLVM_CLASS_ABI BackrefContext {
   static constexpr size_t Max = 10;
 
   TypeNode *FunctionParams[Max];
@@ -137,7 +137,7 @@ enum class FunctionIdentifierCodeGroup { Basic, Under, DoubleUnder };
 // Demangler class takes the main role in demangling symbols.
 // It has a set of functions to parse mangled symbols into Type instances.
 // It also has a set of functions to convert Type instances to strings.
-class Demangler {
+class LLVM_CLASS_ABI Demangler {
 public:
   Demangler() = default;
   virtual ~Demangler() = default;
diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
index 53dc23217fde10b..171c5de62f18490 100644
--- a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
+++ b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
@@ -255,7 +255,7 @@ enum class NodeKind {
   SpecialTableSymbol
 };
 
-struct Node {
+struct LLVM_CLASS_ABI Node {
   explicit Node(NodeKind K) : Kind(K) {}
   virtual ~Node() = default;
 
@@ -295,7 +295,7 @@ struct FunctionSymbolNode;
 struct VariableSymbolNode;
 struct SpecialTableSymbolNode;
 
-struct TypeNode : public Node {
+struct LLVM_CLASS_ABI TypeNode : public Node {
   explicit TypeNode(NodeKind K) : Node(K) {}
 
   virtual void outputPre(OutputBuffer &OB, OutputFlags Flags) const = 0;
@@ -309,7 +309,7 @@ struct TypeNode : public Node {
   Qualifiers Quals = Q_None;
 };
 
-struct PrimitiveTypeNode : public TypeNode {
+struct LLVM_CLASS_ABI PrimitiveTypeNode : public TypeNode {
   explicit PrimitiveTypeNode(PrimitiveKind K)
       : TypeNode(NodeKind::PrimitiveType), PrimKind(K) {}
 
@@ -319,7 +319,7 @@ struct PrimitiveTypeNode : public TypeNode {
   PrimitiveKind PrimKind;
 };
 
-struct FunctionSignatureNode : public TypeNode {
+struct LLVM_CLASS_ABI FunctionSignatureNode : public TypeNode {
   explicit FunctionSignatureNode(NodeKind K) : TypeNode(K) {}
   FunctionSignatureNode() : TypeNode(NodeKind::FunctionSignature) {}
 
@@ -351,7 +351,7 @@ struct FunctionSignatureNode : public TypeNode {
   bool IsNoexcept = false;
 };
 
-struct IdentifierNode : public Node {
+struct LLVM_CLASS_ABI IdentifierNode : public Node {
   explicit IdentifierNode(NodeKind K) : Node(K) {}
 
   NodeArrayNode *TemplateParams = nullptr;
@@ -360,7 +360,7 @@ struct IdentifierNode : public Node {
   void outputTemplateParameters(OutputBuffer &OB, OutputFlags Flags) const;
 };
 
-struct VcallThunkIdentifierNode : public IdentifierNode {
+struct LLVM_CLASS_ABI VcallThunkIdentifierNode : public IdentifierNode {
   VcallThunkIdentifierNode() : IdentifierNode(NodeKind::VcallThunkIdentifier) {}
 
   void output(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -368,7 +368,7 @@ struct VcallThunkIdentifierNode : public IdentifierNode {
   uint64_t OffsetInVTable = 0;
 };
 
-struct DynamicStructorIdentifierNode : public IdentifierNode {
+struct LLVM_CLASS_ABI DynamicStructorIdentifierNode : public IdentifierNode {
   DynamicStructorIdentifierNode()
       : IdentifierNode(NodeKind::DynamicStructorIdentifier) {}
 
@@ -379,7 +379,7 @@ struct DynamicStructorIdentifierNode : public IdentifierNode {
   bool IsDestructor = false;
 };
 
-struct NamedIdentifierNode : public IdentifierNode {
+struct LLVM_CLASS_ABI NamedIdentifierNode : public IdentifierNode {
   NamedIdentifierNode() : IdentifierNode(NodeKind::NamedIdentifier) {}
 
   void output(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -387,7 +387,7 @@ struct NamedIdentifierNode : public IdentifierNode {
   std::string_view Name;
 };
 
-struct IntrinsicFunctionIdentifierNode : public IdentifierNode {
+struct LLVM_CLASS_ABI IntrinsicFunctionIdentifierNode : public IdentifierNode {
   explicit IntrinsicFunctionIdentifierNode(IntrinsicFunctionKind Operator)
       : IdentifierNode(NodeKind::IntrinsicFunctionIdentifier),
         Operator(Operator) {}
@@ -397,7 +397,7 @@ struct IntrinsicFunctionIdentifierNode : public IdentifierNode {
   IntrinsicFunctionKind Operator;
 };
 
-struct LiteralOperatorIdentifierNode : public IdentifierNode {
+struct LLVM_CLASS_ABI LiteralOperatorIdentifierNode : public IdentifierNode {
   LiteralOperatorIdentifierNode()
       : IdentifierNode(NodeKind::LiteralOperatorIdentifier) {}
 
@@ -406,7 +406,7 @@ struct LiteralOperatorIdentifierNode : public IdentifierNode {
   std::string_view Name;
 };
 
-struct LocalStaticGuardIdentifierNode : public IdentifierNode {
+struct LLVM_CLASS_ABI LocalStaticGuardIdentifierNode : public IdentifierNode {
   LocalStaticGuardIdentifierNode()
       : IdentifierNode(NodeKind::LocalStaticGuardIdentifier) {}
 
@@ -416,7 +416,7 @@ struct LocalStaticGuardIdentifierNode : public IdentifierNode {
   uint32_t ScopeIndex = 0;
 };
 
-struct ConversionOperatorIdentifierNode : public IdentifierNode {
+struct LLVM_CLASS_ABI ConversionOperatorIdentifierNode : public IdentifierNode {
   ConversionOperatorIdentifierNode()
       : IdentifierNode(NodeKind::ConversionOperatorIdentifier) {}
 
@@ -426,7 +426,7 @@ struct ConversionOperatorIdentifierNode : public IdentifierNode {
   TypeNode *TargetType = nullptr;
 };
 
-struct StructorIdentifierNode : public IdentifierNode {
+struct LLVM_CLASS_ABI StructorIdentifierNode : public IdentifierNode {
   StructorIdentifierNode() : IdentifierNode(NodeKind::StructorIdentifier) {}
   explicit StructorIdentifierNode(bool IsDestructor)
       : IdentifierNode(NodeKind::StructorIdentifier),
@@ -439,7 +439,7 @@ struct StructorIdentifierNode : public IdentifierNode {
   bool IsDestructor = false;
 };
 
-struct ThunkSignatureNode : public FunctionSignatureNode {
+struct LLVM_CLASS_ABI ThunkSignatureNode : public FunctionSignatureNode {
   ThunkSignatureNode() : FunctionSignatureNode(NodeKind::ThunkSignature) {}
 
   void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -455,7 +455,7 @@ struct ThunkSignatureNode : public FunctionSignatureNode {
   ThisAdjustor ThisAdjust;
 };
 
-struct PointerTypeNode : public TypeNode {
+struct LLVM_CLASS_ABI PointerTypeNode : public TypeNode {
   PointerTypeNode() : TypeNode(NodeKind::PointerType) {}
   void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
   void outputPost(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -471,7 +471,7 @@ struct PointerTypeNode : public TypeNode {
   TypeNode *Pointee = nullptr;
 };
 
-struct TagTypeNode : public TypeNode {
+struct LLVM_CLASS_ABI TagTypeNode : public TypeNode {
   explicit TagTypeNode(TagKind Tag) : TypeNode(NodeKind::TagType), Tag(Tag) {}
 
   void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -481,7 +481,7 @@ struct TagTypeNode : public TypeNode {
   TagKind Tag;
 };
 
-struct ArrayTypeNode : public TypeNode {
+struct LLVM_CLASS_ABI ArrayTypeNode : public TypeNode {
   ArrayTypeNode() : TypeNode(NodeKind::ArrayType) {}
 
   void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -497,12 +497,12 @@ struct ArrayTypeNode : public TypeNode {
   TypeNode *ElementType = nullptr;
 };
 
-struct IntrinsicNode : public TypeNode {
+struct LLVM_CLASS_ABI IntrinsicNode : public TypeNode {
   IntrinsicNode() : TypeNode(NodeKind::IntrinsicType) {}
   void output(OutputBuffer &OB, OutputFlags Flags) const override {}
 };
 
-struct CustomTypeNode : public TypeNode {
+struct LLVM_CLASS_ABI CustomTypeNode : public TypeNode {
   CustomTypeNode() : TypeNode(NodeKind::Custom) {}
 
   void outputPre(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -511,7 +511,7 @@ struct CustomTypeNode : public TypeNode {
   IdentifierNode *Identifier = nullptr;
 };
 
-struct NodeArrayNode : public Node {
+struct LLVM_CLASS_ABI NodeArrayNode : public Node {
   NodeArrayNode() : Node(NodeKind::NodeArray) {}
 
   void output(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -523,7 +523,7 @@ struct NodeArrayNode : public Node {
   size_t Count = 0;
 };
 
-struct QualifiedNameNode : public Node {
+struct LLVM_CLASS_ABI QualifiedNameNode : public Node {
   QualifiedNameNode() : Node(NodeKind::QualifiedName) {}
 
   void output(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -536,7 +536,7 @@ struct QualifiedNameNode : public Node {
   }
 };
 
-struct TemplateParameterReferenceNode : public Node {
+struct LLVM_CLASS_ABI TemplateParameterReferenceNode : public Node {
   TemplateParameterReferenceNode()
       : Node(NodeKind::TemplateParameterReference) {}
 
@@ -550,7 +550,7 @@ struct TemplateParameterReferenceNode : public Node {
   bool IsMemberPointer = false;
 };
 
-struct IntegerLiteralNode : public Node {
+struct LLVM_CLASS_ABI IntegerLiteralNode : public Node {
   IntegerLiteralNode() : Node(NodeKind::IntegerLiteral) {}
   IntegerLiteralNode(uint64_t Value, bool IsNegative)
       : Node(NodeKind::IntegerLiteral), Value(Value), IsNegative(IsNegative) {}
@@ -561,7 +561,7 @@ struct IntegerLiteralNode : public Node {
   bool IsNegative = false;
 };
 
-struct RttiBaseClassDescriptorNode : public IdentifierNode {
+struct LLVM_CLASS_ABI RttiBaseClassDescriptorNode : public IdentifierNode {
   RttiBaseClassDescriptorNode()
       : IdentifierNode(NodeKind::RttiBaseClassDescriptor) {}
 
@@ -573,13 +573,13 @@ struct RttiBaseClassDescriptorNode : public IdentifierNode {
   uint32_t Flags = 0;
 };
 
-struct SymbolNode : public Node {
+struct LLVM_CLASS_ABI SymbolNode : public Node {
   explicit SymbolNode(NodeKind K) : Node(K) {}
   void output(OutputBuffer &OB, OutputFlags Flags) const override;
   QualifiedNameNode *Name = nullptr;
 };
 
-struct SpecialTableSymbolNode : public SymbolNode {
+struct LLVM_CLASS_ABI SpecialTableSymbolNode : public SymbolNode {
   explicit SpecialTableSymbolNode()
       : SymbolNode(NodeKind::SpecialTableSymbol) {}
 
@@ -588,7 +588,7 @@ struct SpecialTableSymbolNode : public SymbolNode {
   Qualifiers Quals = Qualifiers::Q_None;
 };
 
-struct LocalStaticGuardVariableNode : public SymbolNode {
+struct LLVM_CLASS_ABI LocalStaticGuardVariableNode : public SymbolNode {
   LocalStaticGuardVariableNode()
       : SymbolNode(NodeKind::LocalStaticGuardVariable) {}
 
@@ -597,7 +597,7 @@ struct LocalStaticGuardVariableNode : public SymbolNode {
   bool IsVisible = false;
 };
 
-struct EncodedStringLiteralNode : public SymbolNode {
+struct LLVM_CLASS_ABI EncodedStringLiteralNode : public SymbolNode {
   EncodedStringLiteralNode() : SymbolNode(NodeKind::EncodedStringLiteral) {}
 
   void output(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -607,7 +607,7 @@ struct EncodedStringLiteralNode : public SymbolNode {
   CharKind Char = CharKind::Char;
 };
 
-struct VariableSymbolNode : public SymbolNode {
+struct LLVM_CLASS_ABI VariableSymbolNode : public SymbolNode {
   VariableSymbolNode() : SymbolNode(NodeKind::VariableSymbol) {}
 
   void output(OutputBuffer &OB, OutputFlags Flags) const override;
@@ -616,7 +616,7 @@ struct VariableSymbolNode : public SymbolNode {
   TypeNode *Type = nullptr;
 };
 
-struct FunctionSymbolNode : public SymbolNode {
+struct LLVM_CLASS_ABI FunctionSymbolNode : public SymbolNode {
   FunctionSymbolNode() : SymbolNode(NodeKind::FunctionSymbol) {}
 
   void output(OutputBuffer &OB, OutputFlags Flags) const override;
diff --git a/llvm/include/llvm/Demangle/Utility.h b/llvm/include/llvm/Demangle/Utility.h
index fa6ab2d04bf27fb..961afd17cd0cb3b 100644
--- a/llvm/include/llvm/Demangle/Utility.h
+++ b/llvm/include/llvm/Demangle/Utility.h
@@ -32,7 +32,7 @@ DEMANGLE_NAMESPACE_BEGIN
 
 // Stream that AST nodes write their string representation into after the AST
 // has been parsed.
-class OutputBuffer {
+class LLVM_CLASS_ABI OutputBuffer {
   char *Buffer = nullptr;
   size_t CurrentPosition = 0;
   size_t BufferCapacity = 0;
@@ -185,7 +185,7 @@ class OutputBuffer {
   size_t getBufferCapacity() const { return BufferCapacity; }
 };
 
-template <class T> class ScopedOverride {
+template <class T> class LLVM_CLASS_ABI ScopedOverride {
   T &Loc;
   T Original;
 
diff --git a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
index 087814c1ca107ea..b6e7ec51e9e7003 100644
--- a/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
+++ b/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h
@@ -62,7 +62,7 @@ class ObjectFile;
 
 /// Helper class for helping synchronize access to the global address map
 /// table.  Access to this class should be serialized under a mutex.
-class ExecutionEngineState {
+class LLVM_CLASS_ABI ExecutionEngineState {
 public:
   using GlobalAddressMapTy = StringMap<uint64_t>;
 
@@ -97,7 +97,7 @@ using FunctionCreator = std::function<void *(const std::string &)>;
 /// Abstract interface for implementation execution of LLVM modules,
 /// designed to support both interpreter and just-in-time (JIT) compiler
 /// implementations.
-class ExecutionEngine {
+class LLVM_CLASS_ABI ExecutionEngine {
   /// The state object holding the global address mapping, which must be
   /// accessed synchronously.
   //
@@ -532,7 +532,7 @@ namespace EngineKind {
 /// Builder class for ExecutionEngines. Use this by stack-allocating a builder,
 /// chaining the various set* methods, and terminating it with a .create()
 /// call.
-class EngineBuilder {
+class LLVM_CLASS_ABI EngineBuilder {
 private:
   std::unique_ptr<Module> M;
   EngineKind::Kind WhichEngine;
diff --git a/llvm/include/llvm/ExecutionEngine/GenericValue.h b/llvm/include/llvm/ExecutionEngine/GenericValue.h
index 347f7fcbc481bcf..491b7a5b454d1d2 100644
--- a/llvm/include/llvm/ExecutionEngine/GenericValue.h
+++ b/llvm/include/llvm/ExecutionEngine/GenericValue.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 using PointerTy = void *;
 
-struct GenericValue {
+struct LLVM_CLASS_ABI GenericValue {
   struct IntPair {
     unsigned int first;
     unsigned int second;
diff --git a/llvm/include/llvm/ExecutionEngine/Interpreter.h b/llvm/include/llvm/ExecutionEngine/Interpreter.h
index 0749409766e390d..5ad84469ccc396e 100644
--- a/llvm/include/llvm/ExecutionEngine/Interpreter.h
+++ b/llvm/include/llvm/ExecutionEngine/Interpreter.h
@@ -19,7 +19,7 @@
 extern "C" void LLVMLinkInInterpreter();
 
 namespace {
-  struct ForceInterpreterLinking {
+  struct LLVM_CLASS_ABI ForceInterpreterLinking {
     ForceInterpreterLinking() { LLVMLinkInInterpreter(); }
   } ForceInterpreterLinking;
 }
diff --git a/llvm/include/llvm/ExecutionEngine/JITEventListener.h b/llvm/include/llvm/ExecutionEngine/JITEventListener.h
index 230b971d0b3a1da..7e83036c5413afd 100644
--- a/llvm/include/llvm/ExecutionEngine/JITEventListener.h
+++ b/llvm/include/llvm/ExecutionEngine/JITEventListener.h
@@ -38,7 +38,7 @@ class ObjectFile;
 /// profilers and debuggers that need to know where functions have been emitted.
 ///
 /// The default implementation of each method does nothing.
-class JITEventListener {
+class LLVM_CLASS_ABI JITEventListener {
 public:
   using ObjectKey = uint64_t;
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/COFF.h b/llvm/include/llvm/ExecutionEngine/JITLink/COFF.h
index 6f9780cbeb15d33..6718117bcd7b64d 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/COFF.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/COFF.h
@@ -24,14 +24,14 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromCOFFObject(MemoryBufferRef ObjectBuffer);
 
 /// Link the given graph.
 ///
 /// Uses conservative defaults for GOT and stub handling based on the target
 /// platform.
-void link_COFF(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_COFF(std::unique_ptr<LinkGraph> G,
                std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h b/llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h
index 3c7558d42db7108..bfdd2caa82b7d38 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/COFF_x86_64.h
@@ -24,15 +24,15 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromCOFFObject_x86_64(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be a COFF x86-64 object file.
-void link_COFF_x86_64(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_COFF_x86_64(std::unique_ptr<LinkGraph> G,
                       std::unique_ptr<JITLinkContext> Ctx);
 
 /// Return the string name of the given COFF x86-64 edge kind.
-const char *getCOFFX86RelocationKindName(Edge::Kind R);
+LLVM_FUNC_ABI const char *getCOFFX86RelocationKindName(Edge::Kind R);
 } // end namespace jitlink
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h b/llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h
index 50c43890b020efc..ab410078c2fcc03 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h
@@ -19,7 +19,7 @@ namespace jitlink {
 /// Record format into sub-blocks where each header gets its own block.
 /// When splitting EHFrames, DWARFRecordSectionSplitter should not be run
 /// without EHFrameEdgeFixer, which is responsible for adding FDE-to-CIE edges.
-class DWARFRecordSectionSplitter {
+class LLVM_CLASS_ABI DWARFRecordSectionSplitter {
 public:
   DWARFRecordSectionSplitter(StringRef SectionName);
   Error operator()(LinkGraph &G);
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h b/llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h
index 1552fbed964abfe..7b5b7ef16423159 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h
@@ -23,7 +23,7 @@ namespace llvm {
 namespace jitlink {
 
 /// Inspect an eh-frame CFI record.
-class EHFrameCFIBlockInspector {
+class LLVM_CLASS_ABI EHFrameCFIBlockInspector {
 public:
   /// Identify CFI record type and edges based on number and order of edges
   /// in the given block only. This assumes that the block contains one CFI
@@ -85,7 +85,7 @@ class EHFrameCFIBlockInspector {
 };
 
 /// Supports registration/deregistration of EH-frames in a target process.
-class EHFrameRegistrar {
+class LLVM_CLASS_ABI EHFrameRegistrar {
 public:
   virtual ~EHFrameRegistrar();
   virtual Error registerEHFrames(orc::ExecutorAddrRange EHFrameSection) = 0;
@@ -93,7 +93,7 @@ class EHFrameRegistrar {
 };
 
 /// Registers / Deregisters EH-frames in the current process.
-class InProcessEHFrameRegistrar final : public EHFrameRegistrar {
+class LLVM_CLASS_ABI InProcessEHFrameRegistrar final : public EHFrameRegistrar {
 public:
   Error registerEHFrames(orc::ExecutorAddrRange EHFrameSection) override;
 
@@ -110,7 +110,7 @@ using StoreFrameRangeFunction = std::function<void(
 /// Authors of JITLinkContexts can use this function to register a post-fixup
 /// pass that records the range of the eh-frame section. This range can
 /// be used after finalization to register and deregister the frame.
-LinkGraphPassFunction
+LLVM_FUNC_ABI LinkGraphPassFunction
 createEHFrameRecorderPass(const Triple &TT,
                           StoreFrameRangeFunction StoreFrameRange);
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF.h
index 89c83d3eea261fb..60e22072e6c80cb 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF.h
@@ -24,14 +24,14 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject(MemoryBufferRef ObjectBuffer);
 
 /// Link the given graph.
 ///
 /// Uses conservative defaults for GOT and stub handling based on the target
 /// platform.
-void link_ELF(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF(std::unique_ptr<LinkGraph> G,
               std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
index 81d2e429b315ff7..cfeb580d107f58a 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
@@ -25,12 +25,12 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject_aarch32(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be an ELF arm/thumb object
 /// file.
-void link_ELF_aarch32(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF_aarch32(std::unique_ptr<LinkGraph> G,
                       std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
index d6496247f132794..a32a51b2694d2a6 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
@@ -26,12 +26,12 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject_aarch64(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be a ELF aarch64 relocatable
 /// object file.
-void link_ELF_aarch64(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF_aarch64(std::unique_ptr<LinkGraph> G,
                       std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h
index 3bdf64a4b1c66f6..8f1fa70ea94e7fe 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_i386.h
@@ -26,12 +26,12 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject_i386(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be a ELF i386 relocatable
 /// object file.
-void link_ELF_i386(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF_i386(std::unique_ptr<LinkGraph> G,
                    std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h
index 82ea5f2cdd10f27..c02c65c6840ad03 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_loongarch.h
@@ -26,12 +26,12 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject_loongarch(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be an ELF loongarch object
 /// file.
-void link_ELF_loongarch(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF_loongarch(std::unique_ptr<LinkGraph> G,
                         std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h
index ab2d1f8a76404d3..57c846475e6df98 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_ppc64.h
@@ -25,7 +25,7 @@ namespace llvm::jitlink {
 /// outlives the graph.
 ///
 /// WARNING: The big-endian backend has not been tested yet.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject_ppc64(MemoryBufferRef ObjectBuffer);
 
 /// Create a LinkGraph from an ELF/ppc64le relocatable object.
@@ -33,17 +33,17 @@ createLinkGraphFromELFObject_ppc64(MemoryBufferRef ObjectBuffer);
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject_ppc64le(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be a ELF ppc64le object file.
 ///
 /// WARNING: The big-endian backend has not been tested yet.
-void link_ELF_ppc64(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF_ppc64(std::unique_ptr<LinkGraph> G,
                     std::unique_ptr<JITLinkContext> Ctx);
 
 /// jit-link the given object buffer, which must be a ELF ppc64le object file.
-void link_ELF_ppc64le(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF_ppc64le(std::unique_ptr<LinkGraph> G,
                       std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace llvm::jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h
index 8dada6381640540..fb05bf77a8317da 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_riscv.h
@@ -26,16 +26,16 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject_riscv(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be a ELF riscv object file.
-void link_ELF_riscv(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF_riscv(std::unique_ptr<LinkGraph> G,
                     std::unique_ptr<JITLinkContext> Ctx);
 
 /// Returns a pass that performs linker relaxation. Should be added to
 /// PostAllocationPasses.
-LinkGraphPassFunction createRelaxationPass_ELF_riscv();
+LLVM_FUNC_ABI LinkGraphPassFunction createRelaxationPass_ELF_riscv();
 
 } // end namespace jitlink
 } // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h
index fa5471427528765..db3986dd0eb985f 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_x86_64.h
@@ -24,11 +24,11 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromELFObject_x86_64(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be a ELF x86-64 object file.
-void link_ELF_x86_64(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_ELF_x86_64(std::unique_ptr<LinkGraph> G,
                      std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
index cb50e8c586a7be6..b6419f883a8734c 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
@@ -47,7 +47,7 @@ class Section;
 
 /// Base class for errors originating in JIT linker, e.g. missing relocation
 /// support.
-class JITLinkError : public ErrorInfo<JITLinkError> {
+class LLVM_CLASS_ABI JITLinkError : public ErrorInfo<JITLinkError> {
 public:
   static char ID;
 
@@ -62,7 +62,7 @@ class JITLinkError : public ErrorInfo<JITLinkError> {
 };
 
 /// Represents fixups and constraints in the LinkGraph.
-class Edge {
+class LLVM_CLASS_ABI Edge {
 public:
   using Kind = uint8_t;
 
@@ -103,10 +103,10 @@ class Edge {
 
 /// Returns the string name of the given generic edge kind, or "unknown"
 /// otherwise. Useful for debugging.
-const char *getGenericEdgeKindName(Edge::Kind K);
+LLVM_FUNC_ABI const char *getGenericEdgeKindName(Edge::Kind K);
 
 /// Base class for Addressable entities (externals, absolutes, blocks).
-class Addressable {
+class LLVM_CLASS_ABI Addressable {
   friend class LinkGraph;
 
 protected:
@@ -153,7 +153,7 @@ class Addressable {
 using SectionOrdinal = unsigned;
 
 /// An Addressable with content and edges.
-class Block : public Addressable {
+class LLVM_CLASS_ABI Block : public Addressable {
   friend class LinkGraph;
 
 private:
@@ -369,7 +369,7 @@ inline orc::ExecutorAddr alignToBlock(orc::ExecutorAddr Addr, const Block &B) {
 // Returns true if the given blocks contains exactly one valid c-string.
 // Zero-fill blocks of size 1 count as valid empty strings. Content blocks
 // must end with a zero, and contain no zeros before the end.
-bool isCStringBlock(Block &B);
+LLVM_FUNC_ABI bool isCStringBlock(Block &B);
 
 /// Describes symbol linkage. This can be used to resolve definition clashes.
 enum class Linkage : uint8_t {
@@ -381,7 +381,7 @@ enum class Linkage : uint8_t {
 using TargetFlagsType = uint8_t;
 
 /// For errors and debugging output.
-const char *getLinkageName(Linkage L);
+LLVM_FUNC_ABI const char *getLinkageName(Linkage L);
 
 /// Defines the scope in which this symbol should be visible:
 ///   Default -- Visible in the public interface of the linkage unit.
@@ -394,9 +394,9 @@ enum class Scope : uint8_t {
 };
 
 /// For debugging output.
-const char *getScopeName(Scope S);
+LLVM_FUNC_ABI const char *getScopeName(Scope S);
 
-raw_ostream &operator<<(raw_ostream &OS, const Block &B);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Block &B);
 
 /// Symbol representation.
 ///
@@ -411,7 +411,7 @@ raw_ostream &operator<<(raw_ostream &OS, const Block &B);
 ///   - External: Has neither linkage nor visibility, points to an external
 ///     Addressable.
 ///
-class Symbol {
+class LLVM_CLASS_ABI Symbol {
   friend class LinkGraph;
 
 private:
@@ -683,13 +683,13 @@ class Symbol {
   size_t Size = 0;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const Symbol &A);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Symbol &A);
 
-void printEdge(raw_ostream &OS, const Block &B, const Edge &E,
+LLVM_FUNC_ABI void printEdge(raw_ostream &OS, const Block &B, const Edge &E,
                StringRef EdgeKindName);
 
 /// Represents an object file section.
-class Section {
+class LLVM_CLASS_ABI Section {
   friend class LinkGraph;
 
 private:
@@ -803,7 +803,7 @@ class Section {
 
 /// Represents a section address range via a pair of Block pointers
 /// to the first and last Blocks in the section.
-class SectionRange {
+class LLVM_CLASS_ABI SectionRange {
 public:
   SectionRange() = default;
   SectionRange(const Section &Sec) {
@@ -846,7 +846,7 @@ class SectionRange {
   Block *Last = nullptr;
 };
 
-class LinkGraph {
+class LLVM_CLASS_ABI LinkGraph {
 private:
   using SectionMap = DenseMap<StringRef, std::unique_ptr<Section>>;
   using ExternalSymbolSet = DenseSet<Symbol *>;
@@ -1536,7 +1536,7 @@ inline MutableArrayRef<char> Block::getMutableContent(LinkGraph &G) {
 }
 
 /// Enables easy lookup of blocks by addresses.
-class BlockAddressMap {
+class LLVM_CLASS_ABI BlockAddressMap {
 public:
   using AddrToBlockMap = std::map<orc::ExecutorAddr, Block *>;
   using const_iterator = AddrToBlockMap::const_iterator;
@@ -1646,7 +1646,7 @@ class BlockAddressMap {
 };
 
 /// A map of addresses to Symbols.
-class SymbolAddressMap {
+class LLVM_CLASS_ABI SymbolAddressMap {
 public:
   using SymbolVector = SmallVector<Symbol *, 1>;
 
@@ -1683,7 +1683,7 @@ using LinkGraphPassList = std::vector<LinkGraphPassFunction>;
 
 /// An LinkGraph pass configuration, consisting of a list of pre-prune,
 /// post-prune, and post-fixup passes.
-struct PassConfiguration {
+struct LLVM_CLASS_ABI PassConfiguration {
 
   /// Pre-prune passes.
   ///
@@ -1743,14 +1743,14 @@ struct PassConfiguration {
 ///        the two types once we have an OrcSupport library.
 enum class SymbolLookupFlags { RequiredSymbol, WeaklyReferencedSymbol };
 
-raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupFlags &LF);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupFlags &LF);
 
 /// A map of symbol names to resolved addresses.
 using AsyncLookupResult = DenseMap<StringRef, orc::ExecutorSymbolDef>;
 
 /// A function object to call with a resolved symbol map (See AsyncLookupResult)
 /// or an error if resolution failed.
-class JITLinkAsyncLookupContinuation {
+class LLVM_CLASS_ABI JITLinkAsyncLookupContinuation {
 public:
   virtual ~JITLinkAsyncLookupContinuation() = default;
   virtual void run(Expected<AsyncLookupResult> LR) = 0;
@@ -1764,7 +1764,7 @@ template <typename Continuation>
 std::unique_ptr<JITLinkAsyncLookupContinuation>
 createLookupContinuation(Continuation Cont) {
 
-  class Impl final : public JITLinkAsyncLookupContinuation {
+  class LLVM_CLASS_ABI Impl final : public JITLinkAsyncLookupContinuation {
   public:
     Impl(Continuation C) : C(std::move(C)) {}
     void run(Expected<AsyncLookupResult> LR) override { C(std::move(LR)); }
@@ -1777,7 +1777,7 @@ createLookupContinuation(Continuation Cont) {
 }
 
 /// Holds context for a single jitLink invocation.
-class JITLinkContext {
+class LLVM_CLASS_ABI JITLinkContext {
 public:
   using LookupMap = DenseMap<StringRef, SymbolLookupFlags>;
 
@@ -1843,13 +1843,13 @@ class JITLinkContext {
 
 /// Marks all symbols in a graph live. This can be used as a default,
 /// conservative mark-live implementation.
-Error markAllSymbolsLive(LinkGraph &G);
+LLVM_FUNC_ABI Error markAllSymbolsLive(LinkGraph &G);
 
 /// Create an out of range error for the given edge in the given block.
-Error makeTargetOutOfRangeError(const LinkGraph &G, const Block &B,
+LLVM_FUNC_ABI Error makeTargetOutOfRangeError(const LinkGraph &G, const Block &B,
                                 const Edge &E);
 
-Error makeAlignmentError(llvm::orc::ExecutorAddr Loc, uint64_t Value, int N,
+LLVM_FUNC_ABI Error makeAlignmentError(llvm::orc::ExecutorAddr Loc, uint64_t Value, int N,
                          const Edge &E);
 
 /// Base case for edge-visitors where the visitor-list is empty.
@@ -1887,11 +1887,11 @@ void visitExistingEdges(LinkGraph &G, VisitorTs &&...Vs) {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromObject(MemoryBufferRef ObjectBuffer);
 
 /// Link the given graph.
-void link(std::unique_ptr<LinkGraph> G, std::unique_ptr<JITLinkContext> Ctx);
+LLVM_FUNC_ABI void link(std::unique_ptr<LinkGraph> G, std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
 } // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
index 3ee4300d9d57aa0..67c4c0d03a72086 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkDylib.h
@@ -19,7 +19,7 @@
 namespace llvm {
 namespace jitlink {
 
-class JITLinkDylib {
+class LLVM_CLASS_ABI JITLinkDylib {
 public:
   JITLinkDylib(std::string Name) : Name(std::move(Name)) {}
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
index b13e4ea96bb717a..22ff59a1d2de35a 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
@@ -41,7 +41,7 @@ class Section;
 ///
 /// Instances of this class may be accessed concurrently from multiple threads
 /// and their implemetations should include any necessary synchronization.
-class JITLinkMemoryManager {
+class LLVM_CLASS_ABI JITLinkMemoryManager {
 public:
 
   /// Represents a finalized allocation.
@@ -208,7 +208,7 @@ class JITLinkMemoryManager {
 /// from a Graph, and then assign working memory and addresses to each of the
 /// Segments. These addreses will be mapped back onto the Graph blocks in
 /// the apply method.
-class BasicLayout {
+class LLVM_CLASS_ABI BasicLayout {
 public:
   /// The Alignment, ContentSize and ZeroFillSize of each segment will be
   /// pre-filled from the Graph. Clients must set the Addr and WorkingMem fields
@@ -295,7 +295,7 @@ class BasicLayout {
 ///
 /// Note: Segments with MemLifetimePolicy::NoAlloc are not permitted, since
 /// they would not be useful, and their presence is likely to indicate a bug.
-class SimpleSegmentAlloc {
+class LLVM_CLASS_ABI SimpleSegmentAlloc {
 public:
   /// Describes a segment to be allocated.
   struct Segment {
@@ -356,7 +356,7 @@ class SimpleSegmentAlloc {
 };
 
 /// A JITLinkMemoryManager that allocates in-process memory.
-class InProcessMemoryManager : public JITLinkMemoryManager {
+class LLVM_CLASS_ABI InProcessMemoryManager : public JITLinkMemoryManager {
 public:
   class IPInFlightAlloc;
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/MachO.h b/llvm/include/llvm/ExecutionEngine/JITLink/MachO.h
index 68239bf9b546674..251e9e0725cea3e 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/MachO.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/MachO.h
@@ -24,14 +24,14 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromMachOObject(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given ObjBuffer, which must be a MachO object file.
 ///
 /// Uses conservative defaults for GOT and stub handling based on the target
 /// platform.
-void link_MachO(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_MachO(std::unique_ptr<LinkGraph> G,
                 std::unique_ptr<JITLinkContext> Ctx);
 
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h b/llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h
index a8263e29bc076c6..7217a92b948ff08 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h
@@ -24,7 +24,7 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromMachOObject_arm64(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given object buffer, which must be a MachO arm64 object file.
@@ -36,16 +36,16 @@ createLinkGraphFromMachOObject_arm64(MemoryBufferRef ObjectBuffer);
 /// If PostPrunePasses is empty then a default GOT-and-stubs insertion pass will
 /// be inserted. If PostPrunePasses is not empty then the caller is responsible
 /// for including a pass to insert GOT and stub edges.
-void link_MachO_arm64(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_MachO_arm64(std::unique_ptr<LinkGraph> G,
                       std::unique_ptr<JITLinkContext> Ctx);
 
 /// Returns a pass suitable for splitting __eh_frame sections in MachO/x86-64
 /// objects.
-LinkGraphPassFunction createEHFrameSplitterPass_MachO_arm64();
+LLVM_FUNC_ABI LinkGraphPassFunction createEHFrameSplitterPass_MachO_arm64();
 
 /// Returns a pass suitable for fixing missing edges in an __eh_frame section
 /// in a MachO/x86-64 object.
-LinkGraphPassFunction createEHFrameEdgeFixerPass_MachO_arm64();
+LLVM_FUNC_ABI LinkGraphPassFunction createEHFrameEdgeFixerPass_MachO_arm64();
 
 } // end namespace jitlink
 } // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h b/llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h
index 693adf5a074ed22..fc0c1d5e0ad40c7 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/MachO_x86_64.h
@@ -24,7 +24,7 @@ namespace jitlink {
 /// Note: The graph does not take ownership of the underlying buffer, nor copy
 /// its contents. The caller is responsible for ensuring that the object buffer
 /// outlives the graph.
-Expected<std::unique_ptr<LinkGraph>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LinkGraph>>
 createLinkGraphFromMachOObject_x86_64(MemoryBufferRef ObjectBuffer);
 
 /// jit-link the given LinkGraph.
@@ -36,16 +36,16 @@ createLinkGraphFromMachOObject_x86_64(MemoryBufferRef ObjectBuffer);
 /// If PostPrunePasses is empty then a default GOT-and-stubs insertion pass will
 /// be inserted. If PostPrunePasses is not empty then the caller is responsible
 /// for including a pass to insert GOT and stub edges.
-void link_MachO_x86_64(std::unique_ptr<LinkGraph> G,
+LLVM_FUNC_ABI void link_MachO_x86_64(std::unique_ptr<LinkGraph> G,
                        std::unique_ptr<JITLinkContext> Ctx);
 
 /// Returns a pass suitable for splitting __eh_frame sections in MachO/x86-64
 /// objects.
-LinkGraphPassFunction createEHFrameSplitterPass_MachO_x86_64();
+LLVM_FUNC_ABI LinkGraphPassFunction createEHFrameSplitterPass_MachO_x86_64();
 
 /// Returns a pass suitable for fixing missing edges in an __eh_frame section
 /// in a MachO/x86-64 object.
-LinkGraphPassFunction createEHFrameEdgeFixerPass_MachO_x86_64();
+LLVM_FUNC_ABI LinkGraphPassFunction createEHFrameEdgeFixerPass_MachO_x86_64();
 
 } // end namespace jitlink
 } // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h b/llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h
index 150ff1411986cc7..f5cce3b3f51e3e6 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/TableManager.h
@@ -25,7 +25,7 @@ namespace jitlink {
 /// The getEntyrForTarget function returns the table entry corresponding to the
 /// given target, calling down to the implementation class to build an entry if
 /// one does not already exist.
-template <typename TableManagerImplT> class TableManager {
+template <typename TableManagerImplT> class LLVM_CLASS_ABI TableManager {
 public:
   /// Return the constructed entry
   ///
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
index 6368a04665235db..7d5f8c015b60d1c 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
@@ -78,10 +78,10 @@ enum TargetFlags_aarch32 : TargetFlagsType {
 };
 
 /// Human-readable name for a given CPU architecture kind
-const char *getCPUArchName(ARMBuildAttrs::CPUArch K);
+LLVM_FUNC_ABI const char *getCPUArchName(ARMBuildAttrs::CPUArch K);
 
 /// Get a human-readable name for the given AArch32 edge kind.
-const char *getEdgeKindName(Edge::Kind K);
+LLVM_FUNC_ABI const char *getEdgeKindName(Edge::Kind K);
 
 /// AArch32 uses stubs for a number of purposes, like branch range extension
 /// or interworking between Arm and Thumb instruction subsets.
@@ -100,7 +100,7 @@ enum StubsFlavor {
 };
 
 /// JITLink sub-arch configuration for Arm CPU models
-struct ArmConfig {
+struct LLVM_CLASS_ABI ArmConfig {
   bool J1J2BranchEncoding = false;
   StubsFlavor Stubs = Unsupported;
 };
@@ -125,7 +125,7 @@ inline ArmConfig getArmConfigForCPUArch(ARMBuildAttrs::CPUArch CPUArch) {
 }
 
 /// Immutable pair of halfwords, Hi and Lo, with overflow check
-struct HalfWords {
+struct LLVM_CLASS_ABI HalfWords {
   constexpr HalfWords() : Hi(0), Lo(0) {}
   constexpr HalfWords(uint32_t Hi, uint32_t Lo) : Hi(Hi), Lo(Lo) {
     assert(isUInt<16>(Hi) && "Overflow in first half-word");
@@ -144,16 +144,16 @@ struct HalfWords {
 ///   ImmMask     - Mask with all bits set that encode the immediate value
 ///   RegMask     - Mask with all bits set that encode the register
 ///
-template <EdgeKind_aarch32 Kind> struct FixupInfo {};
+template <EdgeKind_aarch32 Kind> struct LLVM_CLASS_ABI FixupInfo {};
 
-template <> struct FixupInfo<Thumb_Jump24> {
+template <> struct LLVM_CLASS_ABI FixupInfo<Thumb_Jump24> {
   static constexpr HalfWords Opcode{0xf000, 0x8000};
   static constexpr HalfWords OpcodeMask{0xf800, 0x8000};
   static constexpr HalfWords ImmMask{0x07ff, 0x2fff};
   static constexpr uint16_t LoBitConditional = 0x1000;
 };
 
-template <> struct FixupInfo<Thumb_Call> {
+template <> struct LLVM_CLASS_ABI FixupInfo<Thumb_Call> {
   static constexpr HalfWords Opcode{0xf000, 0xc000};
   static constexpr HalfWords OpcodeMask{0xf800, 0xc000};
   static constexpr HalfWords ImmMask{0x07ff, 0x2fff};
@@ -161,7 +161,7 @@ template <> struct FixupInfo<Thumb_Call> {
   static constexpr uint16_t LoBitNoBlx = 0x1000;
 };
 
-template <> struct FixupInfo<Thumb_MovtAbs> {
+template <> struct LLVM_CLASS_ABI FixupInfo<Thumb_MovtAbs> {
   static constexpr HalfWords Opcode{0xf2c0, 0x0000};
   static constexpr HalfWords OpcodeMask{0xfbf0, 0x8000};
   static constexpr HalfWords ImmMask{0x040f, 0x70ff};
@@ -169,18 +169,18 @@ template <> struct FixupInfo<Thumb_MovtAbs> {
 };
 
 template <>
-struct FixupInfo<Thumb_MovwAbsNC> : public FixupInfo<Thumb_MovtAbs> {
+struct LLVM_CLASS_ABI FixupInfo<Thumb_MovwAbsNC> : public FixupInfo<Thumb_MovtAbs> {
   static constexpr HalfWords Opcode{0xf240, 0x0000};
 };
 
 /// Helper function to read the initial addend for Data-class relocations.
-Expected<int64_t> readAddendData(LinkGraph &G, Block &B, const Edge &E);
+LLVM_FUNC_ABI Expected<int64_t> readAddendData(LinkGraph &G, Block &B, const Edge &E);
 
 /// Helper function to read the initial addend for Arm-class relocations.
-Expected<int64_t> readAddendArm(LinkGraph &G, Block &B, const Edge &E);
+LLVM_FUNC_ABI Expected<int64_t> readAddendArm(LinkGraph &G, Block &B, const Edge &E);
 
 /// Helper function to read the initial addend for Thumb-class relocations.
-Expected<int64_t> readAddendThumb(LinkGraph &G, Block &B, const Edge &E,
+LLVM_FUNC_ABI Expected<int64_t> readAddendThumb(LinkGraph &G, Block &B, const Edge &E,
                                   const ArmConfig &ArmCfg);
 
 /// Read the initial addend for a REL-type relocation. It's the value encoded
@@ -201,13 +201,13 @@ inline Expected<int64_t> readAddend(LinkGraph &G, Block &B, const Edge &E,
 }
 
 /// Helper function to apply the fixup for Data-class relocations.
-Error applyFixupData(LinkGraph &G, Block &B, const Edge &E);
+LLVM_FUNC_ABI Error applyFixupData(LinkGraph &G, Block &B, const Edge &E);
 
 /// Helper function to apply the fixup for Arm-class relocations.
-Error applyFixupArm(LinkGraph &G, Block &B, const Edge &E);
+LLVM_FUNC_ABI Error applyFixupArm(LinkGraph &G, Block &B, const Edge &E);
 
 /// Helper function to apply the fixup for Thumb-class relocations.
-Error applyFixupThumb(LinkGraph &G, Block &B, const Edge &E,
+LLVM_FUNC_ABI Error applyFixupThumb(LinkGraph &G, Block &B, const Edge &E,
                       const ArmConfig &ArmCfg);
 
 /// Apply fixup expression for edge to block content.
@@ -236,7 +236,7 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
 /// Let's keep it simple for the moment and not wire this through a GOT.
 ///
 template <StubsFlavor Flavor>
-class StubsManager : public TableManager<StubsManager<Flavor>> {
+class LLVM_CLASS_ABI StubsManager : public TableManager<StubsManager<Flavor>> {
 public:
   StubsManager() = default;
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h b/llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
index c578bd836ed6df2..0d7b959a6768afd 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
@@ -350,7 +350,7 @@ enum EdgeKind_aarch64 : Edge::Kind {
 
 /// Returns a string name for the given aarch64 edge. For debugging purposes
 /// only
-const char *getEdgeKindName(Edge::Kind K);
+LLVM_FUNC_ABI const char *getEdgeKindName(Edge::Kind K);
 
 // Returns whether the Instr is LD/ST (imm12)
 inline bool isLoadStoreImm12(uint32_t Instr) {
@@ -607,7 +607,7 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E) {
 constexpr uint64_t PointerSize = 8;
 
 /// AArch64 null pointer content.
-extern const char NullPointerContent[PointerSize];
+LLVM_FUNC_ABI extern const char NullPointerContent[PointerSize];
 
 /// AArch64 pointer jump stub content.
 ///
@@ -616,7 +616,7 @@ extern const char NullPointerContent[PointerSize];
 ///   ADRP x16, ptr at page21
 ///   LDR  x16, [x16, ptr at pageoff12]
 ///   BR   x16
-extern const char PointerJumpStubContent[12];
+LLVM_FUNC_ABI extern const char PointerJumpStubContent[12];
 
 /// Creates a new pointer block in the given section and returns an
 /// Anonymous symobl pointing to it.
@@ -666,7 +666,7 @@ inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G,
 }
 
 /// Global Offset Table Builder.
-class GOTTableManager : public TableManager<GOTTableManager> {
+class LLVM_CLASS_ABI GOTTableManager : public TableManager<GOTTableManager> {
 public:
   static StringRef getSectionName() { return "$__GOT"; }
 
@@ -727,7 +727,7 @@ class GOTTableManager : public TableManager<GOTTableManager> {
 };
 
 /// Procedure Linkage Table Builder.
-class PLTTableManager : public TableManager<PLTTableManager> {
+class LLVM_CLASS_ABI PLTTableManager : public TableManager<PLTTableManager> {
 public:
   PLTTableManager(GOTTableManager &GOT) : GOT(GOT) {}
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/i386.h b/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
index 3f244d62827ab5c..4cb28bc1e99cc87 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/i386.h
@@ -192,7 +192,7 @@ enum EdgeKind_i386 : Edge::Kind {
 
 /// Returns a string name for the given i386 edge. For debugging purposes
 /// only
-const char *getEdgeKindName(Edge::Kind K);
+LLVM_FUNC_ABI const char *getEdgeKindName(Edge::Kind K);
 
 /// Returns true if the given uint32_t value is in range for a uint16_t.
 inline bool isInRangeForImmU16(uint32_t Value) {
@@ -294,14 +294,14 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
 constexpr uint32_t PointerSize = 4;
 
 /// i386 null pointer content.
-extern const char NullPointerContent[PointerSize];
+LLVM_FUNC_ABI extern const char NullPointerContent[PointerSize];
 
 /// i386 pointer jump stub content.
 ///
 /// Contains the instruction sequence for an indirect jump via an in-memory
 /// pointer:
 ///   jmpq *ptr
-extern const char PointerJumpStubContent[6];
+LLVM_FUNC_ABI extern const char PointerJumpStubContent[6];
 
 /// Creates a new pointer block in the given section and returns an anonymous
 /// symbol pointing to it.
@@ -354,7 +354,7 @@ inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G,
 }
 
 /// Global Offset Table Builder.
-class GOTTableManager : public TableManager<GOTTableManager> {
+class LLVM_CLASS_ABI GOTTableManager : public TableManager<GOTTableManager> {
 public:
   static StringRef getSectionName() { return "$__GOT"; }
 
@@ -400,7 +400,7 @@ class GOTTableManager : public TableManager<GOTTableManager> {
 };
 
 /// Procedure Linkage Table Builder.
-class PLTTableManager : public TableManager<PLTTableManager> {
+class LLVM_CLASS_ABI PLTTableManager : public TableManager<PLTTableManager> {
 public:
   PLTTableManager(GOTTableManager &GOT) : GOT(GOT) {}
 
@@ -445,7 +445,7 @@ class PLTTableManager : public TableManager<PLTTableManager> {
 /// 2. BranchPCRel32ToPtrJumpStubRelaxable. For this edge kind, if the target is
 /// in range, replace a indirect jump by plt stub with a direct jump to the
 /// target
-Error optimizeGOTAndStubAccesses(LinkGraph &G);
+LLVM_FUNC_ABI Error optimizeGOTAndStubAccesses(LinkGraph &G);
 
 } // namespace llvm::jitlink::i386
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h b/llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h
index 9919fbd8ae87193..77a2fddc7e3288e 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/loongarch.h
@@ -163,7 +163,7 @@ enum EdgeKind_loongarch : Edge::Kind {
 
 /// Returns a string name for the given loongarch edge. For debugging purposes
 /// only.
-const char *getEdgeKindName(Edge::Kind K);
+LLVM_FUNC_ABI const char *getEdgeKindName(Edge::Kind K);
 
 // Returns extract bits Val[Hi:Lo].
 inline uint32_t extractBits(uint32_t Val, unsigned Hi, unsigned Lo) {
@@ -258,7 +258,7 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E) {
 }
 
 /// loongarch null pointer content.
-extern const char NullPointerContent[8];
+LLVM_FUNC_ABI extern const char NullPointerContent[8];
 inline ArrayRef<char> getGOTEntryBlockContent(LinkGraph &G) {
   return {reinterpret_cast<const char *>(NullPointerContent),
           G.getPointerSize()};
@@ -272,8 +272,8 @@ inline ArrayRef<char> getGOTEntryBlockContent(LinkGraph &G) {
 ///   ld.[w/d]  $t8, %pageoff12(ptr)
 ///   jr        $t8
 constexpr size_t StubEntrySize = 12;
-extern const uint8_t LA64StubContent[StubEntrySize];
-extern const uint8_t LA32StubContent[StubEntrySize];
+LLVM_FUNC_ABI extern const uint8_t LA64StubContent[StubEntrySize];
+LLVM_FUNC_ABI extern const uint8_t LA32StubContent[StubEntrySize];
 inline ArrayRef<char> getStubBlockContent(LinkGraph &G) {
   auto StubContent =
       G.getPointerSize() == 8 ? LA64StubContent : LA32StubContent;
@@ -313,7 +313,7 @@ inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G,
 }
 
 /// Global Offset Table Builder.
-class GOTTableManager : public TableManager<GOTTableManager> {
+class LLVM_CLASS_ABI GOTTableManager : public TableManager<GOTTableManager> {
 public:
   static StringRef getSectionName() { return "$__GOT"; }
 
@@ -357,7 +357,7 @@ class GOTTableManager : public TableManager<GOTTableManager> {
 };
 
 /// Procedure Linkage Table Builder.
-class PLTTableManager : public TableManager<PLTTableManager> {
+class LLVM_CLASS_ABI PLTTableManager : public TableManager<PLTTableManager> {
 public:
   PLTTableManager(GOTTableManager &GOT) : GOT(GOT) {}
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h b/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
index c158db261b7abf7..f93cdef5a9486c7 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ppc64.h
@@ -43,9 +43,9 @@ enum EdgeKind_ppc64 : Edge::Kind {
   RequestPLTCallStubSaveTOC,
 };
 
-extern const char NullPointerContent[8];
-extern const char PointerJumpStubContent_big[20];
-extern const char PointerJumpStubContent_little[20];
+LLVM_FUNC_ABI extern const char NullPointerContent[8];
+LLVM_FUNC_ABI extern const char PointerJumpStubContent_big[20];
+LLVM_FUNC_ABI extern const char PointerJumpStubContent_little[20];
 
 inline Symbol &createAnonymousPointer(LinkGraph &G, Section &PointerSection,
                                       Symbol *InitialTarget = nullptr,
@@ -90,7 +90,7 @@ createAnonymousPointerJumpStub(LinkGraph &G, Section &StubSection,
 }
 
 template <support::endianness Endianness>
-class TOCTableManager : public TableManager<TOCTableManager<Endianness>> {
+class LLVM_CLASS_ABI TOCTableManager : public TableManager<TOCTableManager<Endianness>> {
 public:
   // FIXME: `llvm-jitlink -check` relies this name to be $__GOT.
   static StringRef getSectionName() { return "$__GOT"; }
@@ -129,7 +129,7 @@ class TOCTableManager : public TableManager<TOCTableManager<Endianness>> {
 };
 
 template <support::endianness Endianness>
-class PLTTableManager : public TableManager<PLTTableManager<Endianness>> {
+class LLVM_CLASS_ABI PLTTableManager : public TableManager<PLTTableManager<Endianness>> {
 public:
   PLTTableManager(TOCTableManager<Endianness> &TOC) : TOC(TOC) {}
 
@@ -174,7 +174,7 @@ class PLTTableManager : public TableManager<PLTTableManager<Endianness>> {
 
 /// Returns a string name for the given ppc64 edge. For debugging purposes
 /// only.
-const char *getEdgeKindName(Edge::Kind K);
+LLVM_FUNC_ABI const char *getEdgeKindName(Edge::Kind K);
 
 inline static uint16_t ha16(uint64_t x) { return (x + 0x8000) >> 16; }
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/riscv.h b/llvm/include/llvm/ExecutionEngine/JITLink/riscv.h
index 53802112dc1e5a2..533deb8a628af65 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/riscv.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/riscv.h
@@ -219,7 +219,7 @@ enum EdgeKind_riscv : Edge::Kind {
 
 /// Returns a string name for the given riscv edge. For debugging purposes
 /// only
-const char *getEdgeKindName(Edge::Kind K);
+LLVM_FUNC_ABI const char *getEdgeKindName(Edge::Kind K);
 } // namespace riscv
 } // namespace jitlink
 } // namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h b/llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h
index 1d1b63f2a3df83e..9cae286c218e4ed 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h
@@ -391,7 +391,7 @@ enum EdgeKind_x86_64 : Edge::Kind {
 
 /// Returns a string name for the given x86-64 edge. For debugging purposes
 /// only.
-const char *getEdgeKindName(Edge::Kind K);
+LLVM_FUNC_ABI const char *getEdgeKindName(Edge::Kind K);
 
 /// Returns true if the given uint64_t value is in range for a uint32_t.
 inline bool isInRangeForImmU32(uint64_t Value) {
@@ -522,14 +522,14 @@ inline Error applyFixup(LinkGraph &G, Block &B, const Edge &E,
 constexpr uint64_t PointerSize = 8;
 
 /// x86-64 null pointer content.
-extern const char NullPointerContent[PointerSize];
+LLVM_FUNC_ABI extern const char NullPointerContent[PointerSize];
 
 /// x86-64 pointer jump stub content.
 ///
 /// Contains the instruction sequence for an indirect jump via an in-memory
 /// pointer:
 ///   jmpq *ptr(%rip)
-extern const char PointerJumpStubContent[6];
+LLVM_FUNC_ABI extern const char PointerJumpStubContent[6];
 
 /// Creates a new pointer block in the given section and returns an anonymous
 /// symbol pointing to it.
@@ -578,7 +578,7 @@ inline Symbol &createAnonymousPointerJumpStub(LinkGraph &G,
 }
 
 /// Global Offset Table Builder.
-class GOTTableManager : public TableManager<GOTTableManager> {
+class LLVM_CLASS_ABI GOTTableManager : public TableManager<GOTTableManager> {
 public:
   static StringRef getSectionName() { return "$__GOT"; }
 
@@ -636,7 +636,7 @@ class GOTTableManager : public TableManager<GOTTableManager> {
 };
 
 /// Procedure Linkage Table Builder.
-class PLTTableManager : public TableManager<PLTTableManager> {
+class LLVM_CLASS_ABI PLTTableManager : public TableManager<PLTTableManager> {
 public:
   PLTTableManager(GOTTableManager &GOT) : GOT(GOT) {}
 
@@ -681,7 +681,7 @@ class PLTTableManager : public TableManager<PLTTableManager> {
 /// 2. BranchPCRel32ToPtrJumpStubRelaxable. For this edge kind, if the target is
 /// in range, replace a indirect jump by plt stub with a direct jump to the
 /// target
-Error optimizeGOTAndStubAccesses(LinkGraph &G);
+LLVM_FUNC_ABI Error optimizeGOTAndStubAccesses(LinkGraph &G);
 
 } // namespace x86_64
 } // end namespace jitlink
diff --git a/llvm/include/llvm/ExecutionEngine/JITSymbol.h b/llvm/include/llvm/ExecutionEngine/JITSymbol.h
index e096fec62d1d9bf..f16783361702094 100644
--- a/llvm/include/llvm/ExecutionEngine/JITSymbol.h
+++ b/llvm/include/llvm/ExecutionEngine/JITSymbol.h
@@ -72,7 +72,7 @@ template <typename T> JITTargetAddress pointerToJITTargetAddress(T *Ptr) {
 }
 
 /// Flags for symbols in the JIT.
-class JITSymbolFlags {
+class LLVM_CLASS_ABI JITSymbolFlags {
 public:
   using UnderlyingType = uint8_t;
   using TargetFlagsType = uint8_t;
@@ -209,7 +209,7 @@ inline JITSymbolFlags operator|(const JITSymbolFlags &LHS,
 
 /// ARM-specific JIT symbol flags.
 /// FIXME: This should be moved into a target-specific header.
-class ARMJITSymbolFlags {
+class LLVM_CLASS_ABI ARMJITSymbolFlags {
 public:
   ARMJITSymbolFlags() = default;
 
@@ -227,7 +227,7 @@ class ARMJITSymbolFlags {
 };
 
 /// Represents a symbol that has been evaluated to an address already.
-class JITEvaluatedSymbol {
+class LLVM_CLASS_ABI JITEvaluatedSymbol {
 public:
   JITEvaluatedSymbol() = default;
 
@@ -263,7 +263,7 @@ class JITEvaluatedSymbol {
 };
 
 /// Represents a symbol in the JIT.
-class JITSymbol {
+class LLVM_CLASS_ABI JITSymbol {
 public:
   using GetAddressFtor = unique_function<Expected<JITTargetAddress>()>;
 
@@ -369,7 +369,7 @@ class JITSymbol {
 /// Symbol queries are done in bulk (i.e. you request resolution of a set of
 /// symbols, rather than a single one) to reduce IPC overhead in the case of
 /// remote JITing, and expose opportunities for parallel compilation.
-class JITSymbolResolver {
+class LLVM_CLASS_ABI JITSymbolResolver {
 public:
   using LookupSet = std::set<StringRef>;
   using LookupResult = std::map<StringRef, JITEvaluatedSymbol>;
@@ -399,7 +399,7 @@ class JITSymbolResolver {
 };
 
 /// Legacy symbol resolution interface.
-class LegacyJITSymbolResolver : public JITSymbolResolver {
+class LLVM_CLASS_ABI LegacyJITSymbolResolver : public JITSymbolResolver {
 public:
   /// Performs lookup by, for each symbol, first calling
   ///        findSymbolInLogicalDylib and if that fails calling
diff --git a/llvm/include/llvm/ExecutionEngine/MCJIT.h b/llvm/include/llvm/ExecutionEngine/MCJIT.h
index a94fa40cad80b04..3666ca05f83459a 100644
--- a/llvm/include/llvm/ExecutionEngine/MCJIT.h
+++ b/llvm/include/llvm/ExecutionEngine/MCJIT.h
@@ -21,7 +21,7 @@
 extern "C" void LLVMLinkInMCJIT();
 
 namespace {
-  struct ForceMCJITLinking {
+  struct LLVM_CLASS_ABI ForceMCJITLinking {
     ForceMCJITLinking() {
       // We must reference MCJIT in such a way that compilers will not
       // delete it all as dead code, even with whole program optimization,
diff --git a/llvm/include/llvm/ExecutionEngine/ObjectCache.h b/llvm/include/llvm/ExecutionEngine/ObjectCache.h
index 64512747cfad00b..2f171ff93281e84 100644
--- a/llvm/include/llvm/ExecutionEngine/ObjectCache.h
+++ b/llvm/include/llvm/ExecutionEngine/ObjectCache.h
@@ -21,7 +21,7 @@ class Module;
 /// This is the base ObjectCache type which can be provided to an
 /// ExecutionEngine for the purpose of avoiding compilation for Modules that
 /// have already been compiled and an object file is available.
-class ObjectCache {
+class LLVM_CLASS_ABI ObjectCache {
   virtual void anchor();
 
 public:
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
index b01520d26b04a6b..ad8f40366e22fbd 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/COFFPlatform.h
@@ -31,7 +31,7 @@ namespace llvm {
 namespace orc {
 
 /// Mediates between COFF initialization and ExecutionSession state.
-class COFFPlatform : public Platform {
+class LLVM_CLASS_ABI COFFPlatform : public Platform {
 public:
   /// A function that will be called with the name of dll file that must be
   /// loaded.
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h b/llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h
index b317a971a268d4f..d15cd840a9c1956 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/COFFVCRuntimeSupport.h
@@ -29,7 +29,7 @@ namespace llvm {
 namespace orc {
 
 /// Bootstraps the vc runtime within jitdylibs.
-class COFFVCRuntimeBootstrapper {
+class LLVM_CLASS_ABI COFFVCRuntimeBootstrapper {
 public:
   /// Try to create a COFFVCRuntimeBootstrapper instance. An optional
   /// RuntimePath can be given to specify the location of directory that
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
index 6c8a08659ea3e59..eda16254ade764a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
@@ -54,7 +54,7 @@
 namespace llvm {
 namespace orc {
 
-class CompileOnDemandLayer : public IRLayer {
+class LLVM_CLASS_ABI CompileOnDemandLayer : public IRLayer {
   friend class PartitioningIRMaterializationUnit;
 
 public:
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h
index 8c9b35349d338bd..806c2fa2917c92b 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h
@@ -28,13 +28,13 @@ class TargetMachine;
 
 namespace orc {
 
-IRSymbolMapper::ManglingOptions
+LLVM_FUNC_ABI IRSymbolMapper::ManglingOptions
 irManglingOptionsFromTargetOptions(const TargetOptions &Opts);
 
 /// Simple compile functor: Takes a single IR module and returns an ObjectFile.
 /// This compiler supports a single compilation thread and LLVMContext only.
 /// For multithreaded compilation, use ConcurrentIRCompiler below.
-class SimpleCompiler : public IRCompileLayer::IRCompiler {
+class LLVM_CLASS_ABI SimpleCompiler : public IRCompileLayer::IRCompiler {
 public:
   using CompileResult = std::unique_ptr<MemoryBuffer>;
 
@@ -64,7 +64,7 @@ class SimpleCompiler : public IRCompileLayer::IRCompiler {
 ///
 /// This convenient for clients who don't want to own their TargetMachines,
 /// e.g. LLJIT.
-class TMOwningSimpleCompiler : public SimpleCompiler {
+class LLVM_CLASS_ABI TMOwningSimpleCompiler : public SimpleCompiler {
 public:
   TMOwningSimpleCompiler(std::unique_ptr<TargetMachine> TM,
                          ObjectCache *ObjCache = nullptr)
@@ -80,7 +80,7 @@ class TMOwningSimpleCompiler : public SimpleCompiler {
 ///
 /// This class creates a new TargetMachine and SimpleCompiler instance for each
 /// compile.
-class ConcurrentIRCompiler : public IRCompileLayer::IRCompiler {
+class LLVM_CLASS_ABI ConcurrentIRCompiler : public IRCompileLayer::IRCompiler {
 public:
   ConcurrentIRCompiler(JITTargetMachineBuilder JTMB,
                        ObjectCache *ObjCache = nullptr);
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
index 612092b55ef83a7..929ba96785a6d32 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -53,7 +53,7 @@ using JITDylibSP = IntrusiveRefCntPtr<JITDylib>;
 using ResourceKey = uintptr_t;
 
 /// API to remove / transfer ownership of JIT resources.
-class ResourceTracker : public ThreadSafeRefCountedBase<ResourceTracker> {
+class LLVM_CLASS_ABI ResourceTracker : public ThreadSafeRefCountedBase<ResourceTracker> {
 private:
   friend class ExecutionSession;
   friend class JITDylib;
@@ -101,7 +101,7 @@ class ResourceTracker : public ThreadSafeRefCountedBase<ResourceTracker> {
 };
 
 /// Listens for ResourceTracker operations.
-class ResourceManager {
+class LLVM_CLASS_ABI ResourceManager {
 public:
   virtual ~ResourceManager();
   virtual Error handleRemoveResources(JITDylib &JD, ResourceKey K) = 0;
@@ -180,7 +180,7 @@ inline JITDylibSearchOrder makeJITDylibSearchOrder(
 /// deletion and iteration. It does not guarantee a stable order between
 /// operations, and will not automatically detect duplicate elements (they
 /// can be manually checked by calling the validate method).
-class SymbolLookupSet {
+class LLVM_CLASS_ABI SymbolLookupSet {
 public:
   using value_type = std::pair<SymbolStringPtr, SymbolLookupFlags>;
   using UnderlyingVector = std::vector<value_type>;
@@ -383,7 +383,7 @@ class SymbolLookupSet {
   UnderlyingVector Symbols;
 };
 
-struct SymbolAliasMapEntry {
+struct LLVM_CLASS_ABI SymbolAliasMapEntry {
   SymbolAliasMapEntry() = default;
   SymbolAliasMapEntry(SymbolStringPtr Aliasee, JITSymbolFlags AliasFlags)
       : Aliasee(std::move(Aliasee)), AliasFlags(AliasFlags) {}
@@ -404,9 +404,9 @@ using RegisterDependenciesFunction =
 
 /// This can be used as the value for a RegisterDependenciesFunction if there
 /// are no dependants to register with.
-extern RegisterDependenciesFunction NoDependenciesToRegister;
+LLVM_FUNC_ABI extern RegisterDependenciesFunction NoDependenciesToRegister;
 
-class ResourceTrackerDefunct : public ErrorInfo<ResourceTrackerDefunct> {
+class LLVM_CLASS_ABI ResourceTrackerDefunct : public ErrorInfo<ResourceTrackerDefunct> {
 public:
   static char ID;
 
@@ -420,7 +420,7 @@ class ResourceTrackerDefunct : public ErrorInfo<ResourceTrackerDefunct> {
 
 /// Used to notify a JITDylib that the given set of symbols failed to
 /// materialize.
-class FailedToMaterialize : public ErrorInfo<FailedToMaterialize> {
+class LLVM_CLASS_ABI FailedToMaterialize : public ErrorInfo<FailedToMaterialize> {
 public:
   static char ID;
 
@@ -437,7 +437,7 @@ class FailedToMaterialize : public ErrorInfo<FailedToMaterialize> {
 };
 
 /// Used to notify clients when symbols can not be found during a lookup.
-class SymbolsNotFound : public ErrorInfo<SymbolsNotFound> {
+class LLVM_CLASS_ABI SymbolsNotFound : public ErrorInfo<SymbolsNotFound> {
 public:
   static char ID;
 
@@ -455,7 +455,7 @@ class SymbolsNotFound : public ErrorInfo<SymbolsNotFound> {
 };
 
 /// Used to notify clients that a set of symbols could not be removed.
-class SymbolsCouldNotBeRemoved : public ErrorInfo<SymbolsCouldNotBeRemoved> {
+class LLVM_CLASS_ABI SymbolsCouldNotBeRemoved : public ErrorInfo<SymbolsCouldNotBeRemoved> {
 public:
   static char ID;
 
@@ -475,7 +475,7 @@ class SymbolsCouldNotBeRemoved : public ErrorInfo<SymbolsCouldNotBeRemoved> {
 /// definitions that are claimed by the module's associated
 /// MaterializationResponsibility. If this error is returned it is indicative of
 /// a broken transformation / compiler / object cache.
-class MissingSymbolDefinitions : public ErrorInfo<MissingSymbolDefinitions> {
+class LLVM_CLASS_ABI MissingSymbolDefinitions : public ErrorInfo<MissingSymbolDefinitions> {
 public:
   static char ID;
 
@@ -498,7 +498,7 @@ class MissingSymbolDefinitions : public ErrorInfo<MissingSymbolDefinitions> {
 /// symbols that are not claimed by the module's associated
 /// MaterializationResponsibility. If this error is returned it is indicative of
 /// a broken transformation / compiler / object cache.
-class UnexpectedSymbolDefinitions : public ErrorInfo<UnexpectedSymbolDefinitions> {
+class LLVM_CLASS_ABI UnexpectedSymbolDefinitions : public ErrorInfo<UnexpectedSymbolDefinitions> {
 public:
   static char ID;
 
@@ -524,7 +524,7 @@ class UnexpectedSymbolDefinitions : public ErrorInfo<UnexpectedSymbolDefinitions
 /// materialize method is called. It allows MaterializationUnits to resolve and
 /// emit symbols, or abandon materialization by notifying any unmaterialized
 /// symbols of an error.
-class MaterializationResponsibility {
+class LLVM_CLASS_ABI MaterializationResponsibility {
   friend class ExecutionSession;
   friend class JITDylib;
 
@@ -659,7 +659,7 @@ class MaterializationResponsibility {
 /// JITDylibs. The JITDylib will call materialize when the address of a symbol
 /// is requested via the lookup method. The JITDylib will call discard if a
 /// stronger definition is added or already present.
-class MaterializationUnit {
+class LLVM_CLASS_ABI MaterializationUnit {
   friend class ExecutionSession;
   friend class JITDylib;
 
@@ -732,7 +732,7 @@ class MaterializationUnit {
 ///
 /// All symbols will be resolved and marked ready as soon as the unit is
 /// materialized.
-class AbsoluteSymbolsMaterializationUnit : public MaterializationUnit {
+class LLVM_CLASS_ABI AbsoluteSymbolsMaterializationUnit : public MaterializationUnit {
 public:
   AbsoluteSymbolsMaterializationUnit(SymbolMap Symbols);
 
@@ -764,7 +764,7 @@ absoluteSymbols(SymbolMap Symbols) {
 
 /// A materialization unit for symbol aliases. Allows existing symbols to be
 /// aliased with alternate flags.
-class ReExportsMaterializationUnit : public MaterializationUnit {
+class LLVM_CLASS_ABI ReExportsMaterializationUnit : public MaterializationUnit {
 public:
   /// SourceJD is allowed to be nullptr, in which case the source JITDylib is
   /// taken to be whatever JITDylib these definitions are materialized in (and
@@ -821,7 +821,7 @@ reexports(JITDylib &SourceJD, SymbolAliasMap Aliases,
 
 /// Build a SymbolAliasMap for the common case where you want to re-export
 /// symbols from another JITDylib with the same linkage/flags.
-Expected<SymbolAliasMap>
+LLVM_FUNC_ABI Expected<SymbolAliasMap>
 buildSimpleReexportsAliasMap(JITDylib &SourceJD, const SymbolNameSet &Symbols);
 
 /// Represents the state that a symbol has reached during materialization.
@@ -838,7 +838,7 @@ enum class SymbolState : uint8_t {
 ///        ready.
 ///
 /// makes a callback when all symbols are available.
-class AsynchronousSymbolQuery {
+class LLVM_CLASS_ABI AsynchronousSymbolQuery {
   friend class ExecutionSession;
   friend class InProgressFullLookupState;
   friend class JITDylib;
@@ -887,7 +887,7 @@ class AsynchronousSymbolQuery {
 /// Wraps state for a lookup-in-progress.
 /// DefinitionGenerators can optionally take ownership of a LookupState object
 /// to suspend a lookup-in-progress while they search for definitions.
-class LookupState {
+class LLVM_CLASS_ABI LookupState {
   friend class OrcV2CAPIHelper;
   friend class ExecutionSession;
 
@@ -912,7 +912,7 @@ class LookupState {
 
 /// Definition generators can be attached to JITDylibs to generate new
 /// definitions for otherwise unresolved symbols during lookup.
-class DefinitionGenerator {
+class LLVM_CLASS_ABI DefinitionGenerator {
 public:
   virtual ~DefinitionGenerator();
 
@@ -947,7 +947,7 @@ class DefinitionGenerator {
 ///
 /// JITDylibs cannot be moved or copied. Their address is stable, and useful as
 /// a key in some JIT data structures.
-class JITDylib : public ThreadSafeRefCountedBase<JITDylib>,
+class LLVM_CLASS_ABI JITDylib : public ThreadSafeRefCountedBase<JITDylib>,
                  public jitlink::JITLinkDylib {
   friend class AsynchronousSymbolQuery;
   friend class ExecutionSession;
@@ -1306,7 +1306,7 @@ class JITDylib : public ThreadSafeRefCountedBase<JITDylib>,
 /// initializers (e.g. C++ static constructors) and ExecutionSession state.
 /// Note that Platforms do not automatically run initializers: clients are still
 /// responsible for doing this.
-class Platform {
+class LLVM_CLASS_ABI Platform {
 public:
   virtual ~Platform();
 
@@ -1346,7 +1346,7 @@ class Platform {
 };
 
 /// A materialization task.
-class MaterializationTask : public RTTIExtends<MaterializationTask, Task> {
+class LLVM_CLASS_ABI MaterializationTask : public RTTIExtends<MaterializationTask, Task> {
 public:
   static char ID;
 
@@ -1362,7 +1362,7 @@ class MaterializationTask : public RTTIExtends<MaterializationTask, Task> {
 };
 
 /// An ExecutionSession represents a running JIT program.
-class ExecutionSession {
+class LLVM_CLASS_ABI ExecutionSession {
   friend class InProgressLookupFlagsState;
   friend class InProgressFullLookupState;
   friend class JITDylib;
@@ -1891,7 +1891,7 @@ Error JITDylib::define(std::unique_ptr<MaterializationUnitType> &MU,
 
 /// ReexportsGenerator can be used with JITDylib::addGenerator to automatically
 /// re-export a subset of the source JITDylib's symbols in the target.
-class ReexportsGenerator : public DefinitionGenerator {
+class LLVM_CLASS_ABI ReexportsGenerator : public DefinitionGenerator {
 public:
   using SymbolPredicate = std::function<bool(SymbolStringPtr)>;
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h b/llvm/include/llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h
index 75badc0b7f29b38..5499d0e61fd6ab0 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/DebugObjectManagerPlugin.h
@@ -46,7 +46,7 @@ class DebugObject;
 /// DebugObjectRegistrar is notified. Ownership of DebugObjects remains with the
 /// plugin.
 ///
-class DebugObjectManagerPlugin : public ObjectLinkingLayer::Plugin {
+class LLVM_CLASS_ABI DebugObjectManagerPlugin : public ObjectLinkingLayer::Plugin {
 public:
   // DEPRECATED - Please specify options explicitly
   DebugObjectManagerPlugin(ExecutionSession &ES,
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h
index 48c1b8d8bcd58c2..ffd2f258569c8cb 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h
@@ -31,74 +31,74 @@ namespace orc {
 // --raw_ostream operators for ORC types--
 
 /// Render a SymbolStringPtr.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPtr &Sym);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPtr &Sym);
 
 /// Render a SymbolNameSet.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolNameSet &Symbols);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolNameSet &Symbols);
 
 /// Render a SymbolNameVector.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolNameVector &Symbols);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolNameVector &Symbols);
 
 /// Render an array of SymbolStringPtrs.
-raw_ostream &operator<<(raw_ostream &OS, ArrayRef<SymbolStringPtr> Symbols);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, ArrayRef<SymbolStringPtr> Symbols);
 
 /// Render JITSymbolFlags.
-raw_ostream &operator<<(raw_ostream &OS, const JITSymbolFlags &Flags);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const JITSymbolFlags &Flags);
 
 /// Render a SymbolFlagsMap entry.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolFlagsMap::value_type &KV);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolFlagsMap::value_type &KV);
 
 /// Render a SymbolMap entry.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolMap::value_type &KV);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolMap::value_type &KV);
 
 /// Render a SymbolFlagsMap.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolFlagsMap &SymbolFlags);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolFlagsMap &SymbolFlags);
 
 /// Render a SymbolMap.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolMap &Symbols);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolMap &Symbols);
 
 /// Render a SymbolDependenceMap entry.
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         const SymbolDependenceMap::value_type &KV);
 
 /// Render a SymbolDependendeMap.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolDependenceMap &Deps);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolDependenceMap &Deps);
 
 /// Render a MaterializationUnit.
-raw_ostream &operator<<(raw_ostream &OS, const MaterializationUnit &MU);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const MaterializationUnit &MU);
 
 //// Render a JITDylibLookupFlags instance.
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         const JITDylibLookupFlags &JDLookupFlags);
 
 /// Rendar a SymbolLookupFlags instance.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupFlags &LookupFlags);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupFlags &LookupFlags);
 
 /// Render a SymbolLookupSet entry.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupSet::value_type &KV);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupSet::value_type &KV);
 
 /// Render a SymbolLookupSet.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupSet &LookupSet);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolLookupSet &LookupSet);
 
 /// Render a JITDylibSearchOrder.
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         const JITDylibSearchOrder &SearchOrder);
 
 /// Render a SymbolAliasMap.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolAliasMap &Aliases);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolAliasMap &Aliases);
 
 /// Render a SymbolState.
-raw_ostream &operator<<(raw_ostream &OS, const SymbolState &S);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolState &S);
 
 /// Render a LookupKind.
-raw_ostream &operator<<(raw_ostream &OS, const LookupKind &K);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const LookupKind &K);
 
 /// Dump a SymbolStringPool. Useful for debugging dangling-pointer crashes.
 raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPool &SSP);
 
 /// A function object that can be used as an ObjectTransformLayer transform
 /// to dump object files to disk at a specified path.
-class DumpObjects {
+class LLVM_CLASS_ABI DumpObjects {
 public:
   /// Construct a DumpObjects transform that will dump objects to disk.
   ///
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h b/llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h
index 2a222b57af13605..21b61cdd33b5865 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/DebuggerSupportPlugin.h
@@ -26,7 +26,7 @@ namespace orc {
 ///
 /// Currently MachO only. For ELF use DebugObjectManagerPlugin. These two
 /// plugins will be merged in the near future.
-class GDBJITDebugInfoRegistrationPlugin : public ObjectLinkingLayer::Plugin {
+class LLVM_CLASS_ABI GDBJITDebugInfoRegistrationPlugin : public ObjectLinkingLayer::Plugin {
 public:
   class DebugSectionSynthesizer {
   public:
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
index 94793eeefb8a821..56eb002f2669ecd 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ELFNixPlatform.h
@@ -27,12 +27,12 @@
 namespace llvm {
 namespace orc {
 
-struct ELFPerObjectSectionsToRegister {
+struct LLVM_CLASS_ABI ELFPerObjectSectionsToRegister {
   ExecutorAddrRange EHFrameSection;
   ExecutorAddrRange ThreadDataSection;
 };
 
-struct ELFNixJITDylibInitializers {
+struct LLVM_CLASS_ABI ELFNixJITDylibInitializers {
   using SectionList = std::vector<ExecutorAddrRange>;
 
   ELFNixJITDylibInitializers(std::string Name, ExecutorAddr DSOHandleAddress)
@@ -44,7 +44,7 @@ struct ELFNixJITDylibInitializers {
   StringMap<SectionList> InitSections;
 };
 
-class ELFNixJITDylibDeinitializers {};
+class LLVM_CLASS_ABI ELFNixJITDylibDeinitializers {};
 
 using ELFNixJITDylibInitializerSequence =
     std::vector<ELFNixJITDylibInitializers>;
@@ -53,7 +53,7 @@ using ELFNixJITDylibDeinitializerSequence =
     std::vector<ELFNixJITDylibDeinitializers>;
 
 /// Mediates between ELFNix initialization and ExecutionSession state.
-class ELFNixPlatform : public Platform {
+class LLVM_CLASS_ABI ELFNixPlatform : public Platform {
 public:
   /// Try to create a ELFNixPlatform instance, adding the ORC runtime to the
   /// given JITDylib.
@@ -252,7 +252,7 @@ using SPSELFPerObjectSectionsToRegister =
     SPSTuple<SPSExecutorAddrRange, SPSExecutorAddrRange>;
 
 template <>
-class SPSSerializationTraits<SPSELFPerObjectSectionsToRegister,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSELFPerObjectSectionsToRegister,
                              ELFPerObjectSectionsToRegister> {
 
 public:
@@ -285,7 +285,7 @@ using SPSELFNixJITDylibInitializerSequence =
 
 /// Serialization traits for ELFNixJITDylibInitializers.
 template <>
-class SPSSerializationTraits<SPSELFNixJITDylibInitializers,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSELFNixJITDylibInitializers,
                              ELFNixJITDylibInitializers> {
 public:
   static size_t size(const ELFNixJITDylibInitializers &MOJDIs) {
@@ -312,7 +312,7 @@ using SPSELFJITDylibDeinitializerSequence =
     SPSSequence<SPSELFJITDylibDeinitializers>;
 
 template <>
-class SPSSerializationTraits<SPSELFJITDylibDeinitializers,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSELFJITDylibDeinitializers,
                              ELFNixJITDylibDeinitializers> {
 public:
   static size_t size(const ELFNixJITDylibDeinitializers &MOJDDs) { return 0; }
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
index 7de36f91bc13c37..54da3b9681a457d 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCDebugObjectRegistrar.h
@@ -30,7 +30,7 @@ namespace orc {
 class ExecutionSession;
 
 /// Abstract interface for registering debug objects in the executor process.
-class DebugObjectRegistrar {
+class LLVM_CLASS_ABI DebugObjectRegistrar {
 public:
   virtual Error registerDebugObject(ExecutorAddrRange TargetMem,
                                     bool AutoRegisterCode) = 0;
@@ -39,7 +39,7 @@ class DebugObjectRegistrar {
 
 /// Use ExecutorProcessControl to register debug objects locally or in a remote
 /// executor process.
-class EPCDebugObjectRegistrar : public DebugObjectRegistrar {
+class LLVM_CLASS_ABI EPCDebugObjectRegistrar : public DebugObjectRegistrar {
 public:
   EPCDebugObjectRegistrar(ExecutionSession &ES, ExecutorAddr RegisterFn)
       : ES(ES), RegisterFn(RegisterFn) {}
@@ -59,7 +59,7 @@ class EPCDebugObjectRegistrar : public DebugObjectRegistrar {
 /// If RegistrationFunctionsDylib is non-None then it will be searched to find
 /// the registration functions. If it is None then the process dylib will be
 /// loaded to find the registration functions.
-Expected<std::unique_ptr<EPCDebugObjectRegistrar>> createJITLoaderGDBRegistrar(
+LLVM_FUNC_ABI Expected<std::unique_ptr<EPCDebugObjectRegistrar>> createJITLoaderGDBRegistrar(
     ExecutionSession &ES,
     std::optional<ExecutorAddr> RegistrationFunctionDylib = std::nullopt);
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h
index 6da14b2cdb7d160..9a67d17095ba987 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCDynamicLibrarySearchGenerator.h
@@ -23,7 +23,7 @@ namespace orc {
 
 class ExecutorProcessControl;
 
-class EPCDynamicLibrarySearchGenerator : public DefinitionGenerator {
+class LLVM_CLASS_ABI EPCDynamicLibrarySearchGenerator : public DefinitionGenerator {
 public:
   using SymbolPredicate = unique_function<bool(const SymbolStringPtr &)>;
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
index 3277986f4e3d8f0..e39948e6ea96a1e 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
@@ -24,7 +24,7 @@ class ExecutionSession;
 
 /// Register/Deregisters EH frames in a remote process via a
 /// ExecutorProcessControl instance.
-class EPCEHFrameRegistrar : public jitlink::EHFrameRegistrar {
+class LLVM_CLASS_ABI EPCEHFrameRegistrar : public jitlink::EHFrameRegistrar {
 public:
   /// Create from a ExecutorProcessControl instance alone. This will use
   /// the EPC's lookupSymbols method to find the registration/deregistration
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h
index 4e018393849f80a..dd89ee2973b2dcb 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericDylibManager.h
@@ -27,7 +27,7 @@ namespace orc {
 
 class SymbolLookupSet;
 
-class EPCGenericDylibManager {
+class LLVM_CLASS_ABI EPCGenericDylibManager {
 public:
   /// Function addresses for memory access.
   struct SymbolAddrs {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h
index 977b2f10562af9e..6d4a13a56766fe1 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericJITLinkMemoryManager.h
@@ -25,7 +25,7 @@
 namespace llvm {
 namespace orc {
 
-class EPCGenericJITLinkMemoryManager : public jitlink::JITLinkMemoryManager {
+class LLVM_CLASS_ABI EPCGenericJITLinkMemoryManager : public jitlink::JITLinkMemoryManager {
 public:
   /// Function addresses for memory access.
   struct SymbolAddrs {
@@ -67,7 +67,7 @@ namespace shared {
 /// FIXME: This specialization should be moved into TargetProcessControlTypes.h
 ///        (or whereever those types get merged to) once ORC depends on JITLink.
 template <>
-class SPSSerializationTraits<SPSExecutorAddr,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSExecutorAddr,
                              jitlink::JITLinkMemoryManager::FinalizedAlloc> {
 public:
   static size_t size(const jitlink::JITLinkMemoryManager::FinalizedAlloc &FA) {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h
index 3449b5c37f14d18..e37bc64f1e6da2e 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericMemoryAccess.h
@@ -24,7 +24,7 @@
 namespace llvm {
 namespace orc {
 
-class EPCGenericMemoryAccess : public ExecutorProcessControl::MemoryAccess {
+class LLVM_CLASS_ABI EPCGenericMemoryAccess : public ExecutorProcessControl::MemoryAccess {
 public:
   /// Function addresses for memory access.
   struct FuncAddrs {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h
index 0ba4c9bddc54e11..48ee552ea3cf2dd 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCGenericRTDyldMemoryManager.h
@@ -24,7 +24,7 @@ namespace llvm {
 namespace orc {
 
 /// Remote-mapped RuntimeDyld-compatible memory manager.
-class EPCGenericRTDyldMemoryManager : public RuntimeDyld::MemoryManager {
+class LLVM_CLASS_ABI EPCGenericRTDyldMemoryManager : public RuntimeDyld::MemoryManager {
 public:
   /// Symbol addresses for memory access.
   struct SymbolAddrs {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h
index 26a97751724e8c4..6c463b70e46c08d 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h
@@ -28,7 +28,7 @@ class ExecutorProcessControl;
 
 /// Provides ExecutorProcessControl based indirect stubs, trampoline pool and
 /// lazy call through manager.
-class EPCIndirectionUtils {
+class LLVM_CLASS_ABI EPCIndirectionUtils {
   friend class EPCIndirectionUtilsAccess;
 
 public:
@@ -171,12 +171,12 @@ class EPCIndirectionUtils {
 /// called.
 ///
 /// This function is experimental and likely subject to revision.
-Error setUpInProcessLCTMReentryViaEPCIU(EPCIndirectionUtils &EPCIU);
+LLVM_FUNC_ABI Error setUpInProcessLCTMReentryViaEPCIU(EPCIndirectionUtils &EPCIU);
 
 namespace detail {
 
 template <typename ORCABI>
-class ABISupportImpl : public EPCIndirectionUtils::ABISupport {
+class LLVM_CLASS_ABI ABISupportImpl : public EPCIndirectionUtils::ABISupport {
 public:
   ABISupportImpl()
       : ABISupport(ORCABI::PointerSize, ORCABI::TrampolineSize,
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
index 949b5a066cbe3ce..c1fce4498946b22 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h
@@ -50,7 +50,7 @@ class ObjectLayer;
 ///
 ///   The easiest way to get hold of instances of this class is to use the
 /// getConstructors/getDestructors functions.
-class CtorDtorIterator {
+class LLVM_CLASS_ABI CtorDtorIterator {
 public:
   /// Accessor for an element of the global_ctors/global_dtors array.
   ///
@@ -92,15 +92,15 @@ class CtorDtorIterator {
 
 /// Create an iterator range over the entries of the llvm.global_ctors
 ///        array.
-iterator_range<CtorDtorIterator> getConstructors(const Module &M);
+LLVM_FUNC_ABI iterator_range<CtorDtorIterator> getConstructors(const Module &M);
 
 /// Create an iterator range over the entries of the llvm.global_ctors
 ///        array.
-iterator_range<CtorDtorIterator> getDestructors(const Module &M);
+LLVM_FUNC_ABI iterator_range<CtorDtorIterator> getDestructors(const Module &M);
 
 /// This iterator provides a convenient way to iterate over GlobalValues that
 /// have initialization effects.
-class StaticInitGVIterator {
+class LLVM_CLASS_ABI StaticInitGVIterator {
 public:
   StaticInitGVIterator() = default;
 
@@ -145,7 +145,7 @@ inline iterator_range<StaticInitGVIterator> getStaticInitGVs(Module &M) {
   return make_range(StaticInitGVIterator(M), StaticInitGVIterator());
 }
 
-class CtorDtorRunner {
+class LLVM_CLASS_ABI CtorDtorRunner {
 public:
   CtorDtorRunner(JITDylib &JD) : JD(JD) {}
   void add(iterator_range<CtorDtorIterator> CtorDtors);
@@ -174,7 +174,7 @@ class CtorDtorRunner {
 /// the client determines that destructors should be run (generally at JIT
 /// teardown or after a return from main), the runDestructors method should be
 /// called.
-class LocalCXXRuntimeOverridesBase {
+class LLVM_CLASS_ABI LocalCXXRuntimeOverridesBase {
 public:
   /// Run any destructors recorded by the overriden __cxa_atexit function
   /// (CXAAtExitOverride).
@@ -189,13 +189,13 @@ class LocalCXXRuntimeOverridesBase {
                                void *DSOHandle);
 };
 
-class LocalCXXRuntimeOverrides : public LocalCXXRuntimeOverridesBase {
+class LLVM_CLASS_ABI LocalCXXRuntimeOverrides : public LocalCXXRuntimeOverridesBase {
 public:
   Error enable(JITDylib &JD, MangleAndInterner &Mangler);
 };
 
 /// An interface for Itanium __cxa_atexit interposer implementations.
-class ItaniumCXAAtExitSupport {
+class LLVM_CLASS_ABI ItaniumCXAAtExitSupport {
 public:
   struct AtExitRecord {
     void (*F)(void *);
@@ -215,7 +215,7 @@ class ItaniumCXAAtExitSupport {
 /// If an instance of this class is attached to a JITDylib as a fallback
 /// definition generator, then any symbol found in the given DynamicLibrary that
 /// passes the 'Allow' predicate will be added to the JITDylib.
-class DynamicLibrarySearchGenerator : public DefinitionGenerator {
+class LLVM_CLASS_ABI DynamicLibrarySearchGenerator : public DefinitionGenerator {
 public:
   using SymbolPredicate = std::function<bool(const SymbolStringPtr &)>;
 
@@ -258,7 +258,7 @@ class DynamicLibrarySearchGenerator : public DefinitionGenerator {
 /// If an instance of this class is attached to a JITDylib as a fallback
 /// definition generator, then any symbol found in the archive will result in
 /// the containing object being added to the JITDylib.
-class StaticLibraryDefinitionGenerator : public DefinitionGenerator {
+class LLVM_CLASS_ABI StaticLibraryDefinitionGenerator : public DefinitionGenerator {
 public:
   // Interface builder function for objects loaded from this archive.
   using GetObjectFileInterface =
@@ -329,7 +329,7 @@ class StaticLibraryDefinitionGenerator : public DefinitionGenerator {
 /// definition generator, PLT stubs and dllimport __imp_ symbols will be
 /// generated for external symbols found outside the given jitdylib. Currently
 /// only supports x86_64 architecture.
-class DLLImportDefinitionGenerator : public DefinitionGenerator {
+class LLVM_CLASS_ABI DLLImportDefinitionGenerator : public DefinitionGenerator {
 public:
   /// Creates a DLLImportDefinitionGenerator instance.
   static std::unique_ptr<DLLImportDefinitionGenerator>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h b/llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h
index 74fd51d0bce2778..dd93995e652e595 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h
@@ -36,7 +36,7 @@ class ExecutionSession;
 class SymbolLookupSet;
 
 /// ExecutorProcessControl supports interaction with a JIT target process.
-class ExecutorProcessControl {
+class LLVM_CLASS_ABI ExecutorProcessControl {
   friend class ExecutionSession;
 public:
 
@@ -407,7 +407,7 @@ class ExecutorProcessControl {
 /// A ExecutorProcessControl instance that asserts if any of its methods are
 /// used. Suitable for use is unit tests, and by ORC clients who haven't moved
 /// to ExecutorProcessControl-based APIs yet.
-class UnsupportedExecutorProcessControl : public ExecutorProcessControl {
+class LLVM_CLASS_ABI UnsupportedExecutorProcessControl : public ExecutorProcessControl {
 public:
   UnsupportedExecutorProcessControl(
       std::shared_ptr<SymbolStringPool> SSP = nullptr,
@@ -453,7 +453,7 @@ class UnsupportedExecutorProcessControl : public ExecutorProcessControl {
 };
 
 /// A ExecutorProcessControl implementation targeting the current process.
-class SelfExecutorProcessControl
+class LLVM_CLASS_ABI SelfExecutorProcessControl
     : public ExecutorProcessControl,
       private ExecutorProcessControl::MemoryAccess {
 public:
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
index b39d26b21ec6e4e..9d80fee9d461895 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
@@ -29,7 +29,7 @@ class Module;
 
 namespace orc {
 
-class IRCompileLayer : public IRLayer {
+class LLVM_CLASS_ABI IRCompileLayer : public IRLayer {
 public:
   class IRCompiler {
   public:
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
index bd3f598a1a3cc5f..7c2f0a0e498c021 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/IRTransformLayer.h
@@ -25,7 +25,7 @@ namespace orc {
 /// A layer that applies a transform to emitted modules.
 /// The transform function is responsible for locking the ThreadSafeContext
 /// before operating on the module.
-class IRTransformLayer : public IRLayer {
+class LLVM_CLASS_ABI IRTransformLayer : public IRLayer {
 public:
   using TransformFunction = unique_function<Expected<ThreadSafeModule>(
       ThreadSafeModule, MaterializationResponsibility &R)>;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
index e632885bfe554fe..c934f708b16b56e 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
@@ -61,7 +61,7 @@ namespace orc {
 /// before calling a supplied function to return the trampoline landing
 /// address, then restore all state before jumping to that address. They
 /// are used by various ORC APIs to support lazy compilation
-class TrampolinePool {
+class LLVM_CLASS_ABI TrampolinePool {
 public:
   using NotifyLandingResolvedFunction =
       unique_function<void(ExecutorAddr) const>;
@@ -100,7 +100,7 @@ class TrampolinePool {
 };
 
 /// A trampoline pool for trampolines within the current process.
-template <typename ORCABI> class LocalTrampolinePool : public TrampolinePool {
+template <typename ORCABI> class LLVM_CLASS_ABI LocalTrampolinePool : public TrampolinePool {
 public:
   /// Creates a LocalTrampolinePool with the given RunCallback function.
   /// Returns an error if this function is unable to correctly allocate, write
@@ -201,7 +201,7 @@ template <typename ORCABI> class LocalTrampolinePool : public TrampolinePool {
 };
 
 /// Target-independent base class for compile callback management.
-class JITCompileCallbackManager {
+class LLVM_CLASS_ABI JITCompileCallbackManager {
 public:
   using CompileFunction = std::function<ExecutorAddr()>;
 
@@ -239,7 +239,7 @@ class JITCompileCallbackManager {
 
 /// Manage compile callbacks for in-process JITs.
 template <typename ORCABI>
-class LocalJITCompileCallbackManager : public JITCompileCallbackManager {
+class LLVM_CLASS_ABI LocalJITCompileCallbackManager : public JITCompileCallbackManager {
 public:
   /// Create a new LocalJITCompileCallbackManager.
   static Expected<std::unique_ptr<LocalJITCompileCallbackManager>>
@@ -279,7 +279,7 @@ class LocalJITCompileCallbackManager : public JITCompileCallbackManager {
 };
 
 /// Base class for managing collections of named indirect stubs.
-class IndirectStubsManager {
+class LLVM_CLASS_ABI IndirectStubsManager {
 public:
   /// Map type for initializing the manager. See init.
   using StubInitsMap = StringMap<std::pair<ExecutorAddr, JITSymbolFlags>>;
@@ -310,7 +310,7 @@ class IndirectStubsManager {
   virtual void anchor();
 };
 
-template <typename ORCABI> class LocalIndirectStubsInfo {
+template <typename ORCABI> class LLVM_CLASS_ABI LocalIndirectStubsInfo {
 public:
   LocalIndirectStubsInfo(unsigned NumStubs, sys::OwningMemoryBlock StubsMem)
       : NumStubs(NumStubs), StubsMem(std::move(StubsMem)) {}
@@ -368,7 +368,7 @@ template <typename ORCABI> class LocalIndirectStubsInfo {
 /// IndirectStubsManager implementation for the host architecture, e.g.
 ///        OrcX86_64. (See OrcArchitectureSupport.h).
 template <typename TargetT>
-class LocalIndirectStubsManager : public IndirectStubsManager {
+class LLVM_CLASS_ABI LocalIndirectStubsManager : public IndirectStubsManager {
 public:
   Error createStub(StringRef StubName, ExecutorAddr StubAddr,
                    JITSymbolFlags StubFlags) override {
@@ -472,14 +472,14 @@ class LocalIndirectStubsManager : public IndirectStubsManager {
 /// The given target triple will determine the ABI, and the given
 /// ErrorHandlerAddress will be used by the resulting compile callback
 /// manager if a compile callback fails.
-Expected<std::unique_ptr<JITCompileCallbackManager>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<JITCompileCallbackManager>>
 createLocalCompileCallbackManager(const Triple &T, ExecutionSession &ES,
                                   ExecutorAddr ErrorHandlerAddress);
 
 /// Create a local indriect stubs manager builder.
 ///
 /// The given target triple will determine the ABI.
-std::function<std::unique_ptr<IndirectStubsManager>()>
+LLVM_FUNC_ABI std::function<std::unique_ptr<IndirectStubsManager>()>
 createLocalIndirectStubsManagerBuilder(const Triple &T);
 
 /// Build a function pointer of FunctionType with the given constant
@@ -487,21 +487,21 @@ createLocalIndirectStubsManagerBuilder(const Triple &T);
 ///
 ///   Usage example: Turn a trampoline address into a function pointer constant
 /// for use in a stub.
-Constant *createIRTypedAddress(FunctionType &FT, ExecutorAddr Addr);
+LLVM_FUNC_ABI Constant *createIRTypedAddress(FunctionType &FT, ExecutorAddr Addr);
 
 /// Create a function pointer with the given type, name, and initializer
 ///        in the given Module.
-GlobalVariable *createImplPointer(PointerType &PT, Module &M, const Twine &Name,
+LLVM_FUNC_ABI GlobalVariable *createImplPointer(PointerType &PT, Module &M, const Twine &Name,
                                   Constant *Initializer);
 
 /// Turn a function declaration into a stub function that makes an
 ///        indirect call using the given function pointer.
-void makeStub(Function &F, Value &ImplPointer);
+LLVM_FUNC_ABI void makeStub(Function &F, Value &ImplPointer);
 
 /// Promotes private symbols to global hidden, and renames to prevent clashes
 /// with other promoted symbols. The same SymbolPromoter instance should be
 /// used for all symbols to be added to a single JITDylib.
-class SymbolLinkagePromoter {
+class LLVM_CLASS_ABI SymbolLinkagePromoter {
 public:
   /// Promote symbols in the given module. Returns the set of global values
   /// that have been renamed/promoted.
@@ -523,15 +523,15 @@ class SymbolLinkagePromoter {
 /// modules with these utilities, all decls should be cloned (and added to a
 /// single VMap) before any bodies are moved. This will ensure that references
 /// between functions all refer to the versions in the new module.
-Function *cloneFunctionDecl(Module &Dst, const Function &F,
+LLVM_FUNC_ABI Function *cloneFunctionDecl(Module &Dst, const Function &F,
                             ValueToValueMapTy *VMap = nullptr);
 
 /// Clone a global variable declaration into a new module.
-GlobalVariable *cloneGlobalVariableDecl(Module &Dst, const GlobalVariable &GV,
+LLVM_FUNC_ABI GlobalVariable *cloneGlobalVariableDecl(Module &Dst, const GlobalVariable &GV,
                                         ValueToValueMapTy *VMap = nullptr);
 
 /// Clone a global alias declaration into a new module.
-GlobalAlias *cloneGlobalAliasDecl(Module &Dst, const GlobalAlias &OrigA,
+LLVM_FUNC_ABI GlobalAlias *cloneGlobalAliasDecl(Module &Dst, const GlobalAlias &OrigA,
                                   ValueToValueMapTy &VMap);
 
 /// Introduce relocations to \p Sym in its own definition if there are any
@@ -556,7 +556,7 @@ GlobalAlias *cloneGlobalAliasDecl(Module &Dst, const GlobalAlias &OrigA,
 ///
 /// This is based on disassembly and should be considered "best effort". It may
 /// silently fail to add relocations.
-Error addFunctionPointerRelocationsToCurrentSymbol(jitlink::Symbol &Sym,
+LLVM_FUNC_ABI Error addFunctionPointerRelocationsToCurrentSymbol(jitlink::Symbol &Sym,
                                                    jitlink::LinkGraph &G,
                                                    MCDisassembler &Disassembler,
                                                    MCInstrAnalysis &MIA);
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h b/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
index 3b0b10c2f7b2ee6..1de0775d04da4fa 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
@@ -32,7 +32,7 @@ class raw_ostream;
 namespace orc {
 
 /// A utility class for building TargetMachines for JITs.
-class JITTargetMachineBuilder {
+class LLVM_CLASS_ABI JITTargetMachineBuilder {
 #ifndef NDEBUG
   friend class JITTargetMachineBuilderPrinter;
 #endif
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
index 5a02ca17bc130fb..65ab1d39ef10051 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
@@ -36,10 +36,10 @@ class ExecutorProcessControl;
 /// A pre-fabricated ORC JIT stack that can serve as an alternative to MCJIT.
 ///
 /// Create instances using LLJITBuilder.
-class LLJIT {
+class LLVM_CLASS_ABI LLJIT {
   template <typename, typename, typename> friend class LLJITBuilderSetters;
 
-  friend Expected<JITDylibSP> setUpGenericLLVMIRPlatform(LLJIT &J);
+  friend LLVM_FUNC_ABI Expected<JITDylibSP> setUpGenericLLVMIRPlatform(LLJIT &J);
 
 public:
   /// Initializer support for LLJIT.
@@ -266,7 +266,7 @@ class LLJIT {
 
 /// An extended version of LLJIT that supports lazy function-at-a-time
 /// compilation of LLVM IR.
-class LLLazyJIT : public LLJIT {
+class LLVM_CLASS_ABI LLLazyJIT : public LLJIT {
   template <typename, typename, typename> friend class LLJITBuilderSetters;
 
 public:
@@ -297,7 +297,7 @@ class LLLazyJIT : public LLJIT {
   std::unique_ptr<CompileOnDemandLayer> CODLayer;
 };
 
-class LLJITBuilderState {
+class LLVM_CLASS_ABI LLJITBuilderState {
 public:
   using ObjectLinkingLayerCreator =
       std::function<Expected<std::unique_ptr<ObjectLayer>>(ExecutionSession &,
@@ -329,7 +329,7 @@ class LLJITBuilderState {
 };
 
 template <typename JITType, typename SetterImpl, typename State>
-class LLJITBuilderSetters {
+class LLVM_CLASS_ABI LLJITBuilderSetters {
 public:
   /// Set a ExecutorProcessControl for this instance.
   /// This should not be called if ExecutionSession has already been set.
@@ -476,11 +476,11 @@ class LLJITBuilderSetters {
 };
 
 /// Constructs LLJIT instances.
-class LLJITBuilder
+class LLVM_CLASS_ABI LLJITBuilder
     : public LLJITBuilderState,
       public LLJITBuilderSetters<LLJIT, LLJITBuilder, LLJITBuilderState> {};
 
-class LLLazyJITBuilderState : public LLJITBuilderState {
+class LLVM_CLASS_ABI LLLazyJITBuilderState : public LLJITBuilderState {
   friend class LLLazyJIT;
 
 public:
@@ -496,7 +496,7 @@ class LLLazyJITBuilderState : public LLJITBuilderState {
 };
 
 template <typename JITType, typename SetterImpl, typename State>
-class LLLazyJITBuilderSetters
+class LLVM_CLASS_ABI LLLazyJITBuilderSetters
     : public LLJITBuilderSetters<JITType, SetterImpl, State> {
 public:
   /// Set the address in the target address to call if a lazy compile fails.
@@ -529,18 +529,18 @@ class LLLazyJITBuilderSetters
 };
 
 /// Constructs LLLazyJIT instances.
-class LLLazyJITBuilder
+class LLVM_CLASS_ABI LLLazyJITBuilder
     : public LLLazyJITBuilderState,
       public LLLazyJITBuilderSetters<LLLazyJIT, LLLazyJITBuilder,
                                      LLLazyJITBuilderState> {};
 
 /// Configure the LLJIT instance to use orc runtime support. This overload
 /// assumes that the client has manually configured a Platform object.
-Error setUpOrcPlatformManually(LLJIT &J);
+LLVM_FUNC_ABI Error setUpOrcPlatformManually(LLJIT &J);
 
 /// Configure the LLJIT instance to use the ORC runtime and the detected
 /// native target for the executor.
-class ExecutorNativePlatform {
+class LLVM_CLASS_ABI ExecutorNativePlatform {
 public:
   /// Set up using path to Orc runtime.
   ExecutorNativePlatform(std::string OrcRuntimePath)
@@ -570,13 +570,13 @@ class ExecutorNativePlatform {
 /// llvm.global_dtors variables and (if present) build initialization and
 /// deinitialization functions. Platform specific initialization configurations
 /// should be preferred where available.
-Expected<JITDylibSP> setUpGenericLLVMIRPlatform(LLJIT &J);
+LLVM_FUNC_ABI Expected<JITDylibSP> setUpGenericLLVMIRPlatform(LLJIT &J);
 
 /// Configure the LLJIT instance to disable platform support explicitly. This is
 /// useful in two cases: for platforms that don't have such requirements and for
 /// platforms, that we have no explicit support yet and that don't work well
 /// with the generic IR platform.
-Expected<JITDylibSP> setUpInactivePlatform(LLJIT &J);
+LLVM_FUNC_ABI Expected<JITDylibSP> setUpInactivePlatform(LLJIT &J);
 
 } // End namespace orc
 } // End namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Layer.h b/llvm/include/llvm/ExecutionEngine/Orc/Layer.h
index 8e9c43492852141..18b24f2b06efe82 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Layer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Layer.h
@@ -29,7 +29,7 @@ namespace orc {
 /// wrapping LLVM IR. Represents materialization responsibility for all symbols
 /// in the given module. If symbols are overridden by other definitions, then
 /// their linkage is changed to available-externally.
-class IRMaterializationUnit : public MaterializationUnit {
+class LLVM_CLASS_ABI IRMaterializationUnit : public MaterializationUnit {
 public:
   using SymbolNameToDefinitionMap = std::map<SymbolStringPtr, GlobalValue *>;
 
@@ -65,7 +65,7 @@ class IRMaterializationUnit : public MaterializationUnit {
 };
 
 /// Interface for layers that accept LLVM IR.
-class IRLayer {
+class LLVM_CLASS_ABI IRLayer {
 public:
   IRLayer(ExecutionSession &ES, const IRSymbolMapper::ManglingOptions *&MO)
       : ES(ES), MO(MO) {}
@@ -118,7 +118,7 @@ class IRLayer {
 
 /// MaterializationUnit that materializes modules by calling the 'emit' method
 /// on the given IRLayer.
-class BasicIRLayerMaterializationUnit : public IRMaterializationUnit {
+class LLVM_CLASS_ABI BasicIRLayerMaterializationUnit : public IRMaterializationUnit {
 public:
   BasicIRLayerMaterializationUnit(IRLayer &L,
                                   const IRSymbolMapper::ManglingOptions &MO,
@@ -131,7 +131,7 @@ class BasicIRLayerMaterializationUnit : public IRMaterializationUnit {
 };
 
 /// Interface for Layers that accept object files.
-class ObjectLayer : public RTTIExtends<ObjectLayer, RTTIRoot> {
+class LLVM_CLASS_ABI ObjectLayer : public RTTIExtends<ObjectLayer, RTTIRoot> {
 public:
   static char ID;
 
@@ -173,7 +173,7 @@ class ObjectLayer : public RTTIExtends<ObjectLayer, RTTIRoot> {
 
 /// Materializes the given object file (represented by a MemoryBuffer
 /// instance) by calling 'emit' on the given ObjectLayer.
-class BasicObjectLayerMaterializationUnit : public MaterializationUnit {
+class LLVM_CLASS_ABI BasicObjectLayerMaterializationUnit : public MaterializationUnit {
 public:
   /// Create using the default object interface builder function.
   static Expected<std::unique_ptr<BasicObjectLayerMaterializationUnit>>
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h b/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
index 4abe704ebb14de0..7b50f0c2d3c07d6 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
@@ -36,7 +36,7 @@ namespace orc {
 ///
 /// The easiest way to construct these call-throughs is using the lazyReexport
 /// function.
-class LazyCallThroughManager {
+class LLVM_CLASS_ABI LazyCallThroughManager {
 public:
   using NotifyResolvedFunction =
       unique_function<Error(ExecutorAddr ResolvedAddr)>;
@@ -84,7 +84,7 @@ class LazyCallThroughManager {
 };
 
 /// A lazy call-through manager that builds trampolines in the current process.
-class LocalLazyCallThroughManager : public LazyCallThroughManager {
+class LLVM_CLASS_ABI LocalLazyCallThroughManager : public LazyCallThroughManager {
 private:
   using NotifyTargetResolved = unique_function<void(ExecutorAddr)>;
 
@@ -129,7 +129,7 @@ class LocalLazyCallThroughManager : public LazyCallThroughManager {
 
 /// Create a LocalLazyCallThroughManager from the given triple and execution
 /// session.
-Expected<std::unique_ptr<LazyCallThroughManager>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<LazyCallThroughManager>>
 createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES,
                                   ExecutorAddr ErrorHandlerAddr);
 
@@ -138,7 +138,7 @@ createLocalLazyCallThroughManager(const Triple &T, ExecutionSession &ES,
 /// Unlike a 'true' re-export, the address of the lazy re-export will not
 /// match the address of the re-exported symbol, but calling it will behave
 /// the same as calling the re-exported symbol.
-class LazyReexportsMaterializationUnit : public MaterializationUnit {
+class LLVM_CLASS_ABI LazyReexportsMaterializationUnit : public MaterializationUnit {
 public:
   LazyReexportsMaterializationUnit(LazyCallThroughManager &LCTManager,
                                    IndirectStubsManager &ISManager,
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h b/llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h
index 93425d83b7c698a..31527ccb879b0d7 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/LookupAndRecordAddrs.h
@@ -42,7 +42,7 @@ namespace orc {
 /// addresses before using them).
 ///
 /// Asynchronous version.
-void lookupAndRecordAddrs(
+LLVM_FUNC_ABI void lookupAndRecordAddrs(
     unique_function<void(Error)> OnRecorded, ExecutionSession &ES, LookupKind K,
     const JITDylibSearchOrder &SearchOrder,
     std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,
@@ -51,7 +51,7 @@ void lookupAndRecordAddrs(
 /// Record addresses of the given symbols in the given ExecutorAddrs.
 ///
 /// Blocking version.
-Error lookupAndRecordAddrs(
+LLVM_FUNC_ABI Error lookupAndRecordAddrs(
     ExecutionSession &ES, LookupKind K, const JITDylibSearchOrder &SearchOrder,
     std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,
     SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol);
@@ -60,7 +60,7 @@ Error lookupAndRecordAddrs(
 ///
 /// ExecutorProcessControl lookup version. Lookups are always implicitly
 /// weak.
-Error lookupAndRecordAddrs(
+LLVM_FUNC_ABI Error lookupAndRecordAddrs(
     ExecutorProcessControl &EPC, tpctypes::DylibHandle H,
     std::vector<std::pair<SymbolStringPtr, ExecutorAddr *>> Pairs,
     SymbolLookupFlags LookupFlags = SymbolLookupFlags::RequiredSymbol);
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h b/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
index c5645169aa9dd91..f0e064065fae361 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
@@ -28,7 +28,7 @@ namespace llvm {
 namespace orc {
 
 /// Mediates between MachO initialization and ExecutionSession state.
-class MachOPlatform : public Platform {
+class LLVM_CLASS_ABI MachOPlatform : public Platform {
 public:
   // Used internally by MachOPlatform, but made public to enable serialization.
   struct MachOJITDylibDepInfo {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Mangling.h b/llvm/include/llvm/ExecutionEngine/Orc/Mangling.h
index d02875af38cb1d0..b6098e4ff113439 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Mangling.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Mangling.h
@@ -24,7 +24,7 @@ namespace orc {
 
 /// Mangles symbol names then uniques them in the context of an
 /// ExecutionSession.
-class MangleAndInterner {
+class LLVM_CLASS_ABI MangleAndInterner {
 public:
   MangleAndInterner(ExecutionSession &ES, const DataLayout &DL);
   SymbolStringPtr operator()(StringRef Name);
@@ -37,7 +37,7 @@ class MangleAndInterner {
 /// Maps IR global values to their linker symbol names / flags.
 ///
 /// This utility can be used when adding new IR globals in the JIT.
-class IRSymbolMapper {
+class LLVM_CLASS_ABI IRSymbolMapper {
 public:
   struct ManglingOptions {
     bool EmulatedTLS = false;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h b/llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h
index 1ffd23d58540d5d..2af5f0010f9583b 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h
@@ -21,7 +21,7 @@
 namespace llvm {
 namespace orc {
 
-class MapperJITLinkMemoryManager : public jitlink::JITLinkMemoryManager {
+class LLVM_CLASS_ABI MapperJITLinkMemoryManager : public jitlink::JITLinkMemoryManager {
 public:
   MapperJITLinkMemoryManager(size_t ReservationGranularity,
                              std::unique_ptr<MemoryMapper> Mapper);
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h b/llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h
index 5ed7d21bfae9ac4..e2f1a2840ef90ee 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h
@@ -24,7 +24,7 @@ namespace llvm {
 namespace orc {
 
 /// Manages mapping, content transfer and protections for JIT memory
-class MemoryMapper {
+class LLVM_CLASS_ABI MemoryMapper {
 public:
   /// Represents a single allocation containing multiple segments and
   /// initialization and deinitialization actions
@@ -80,7 +80,7 @@ class MemoryMapper {
   virtual ~MemoryMapper();
 };
 
-class InProcessMemoryMapper : public MemoryMapper {
+class LLVM_CLASS_ABI InProcessMemoryMapper : public MemoryMapper {
 public:
   InProcessMemoryMapper(size_t PageSize);
 
@@ -122,7 +122,7 @@ class InProcessMemoryMapper : public MemoryMapper {
   size_t PageSize;
 };
 
-class SharedMemoryMapper final : public MemoryMapper {
+class LLVM_CLASS_ABI SharedMemoryMapper final : public MemoryMapper {
 public:
   struct SymbolAddrs {
     ExecutorAddr Instance;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h
index 93a285bf76dfa5d..5e7d63d971035c0 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h
@@ -24,13 +24,13 @@ namespace orc {
 /// Adds an initializer symbol to the given MU interface.
 /// The init symbol's name is guaranteed to be unique within I, and will be of
 /// the form $.<ObjFileName>.__inits.<N>, where N is some integer.
-void addInitSymbol(MaterializationUnit::Interface &I, ExecutionSession &ES,
+LLVM_FUNC_ABI void addInitSymbol(MaterializationUnit::Interface &I, ExecutionSession &ES,
                    StringRef ObjFileName);
 
 /// Returns a MaterializationUnit::Interface for the object file contained in
 /// the given buffer, or an error if the buffer does not contain a valid object
 /// file.
-Expected<MaterializationUnit::Interface>
+LLVM_FUNC_ABI Expected<MaterializationUnit::Interface>
 getObjectFileInterface(ExecutionSession &ES, MemoryBufferRef ObjBuffer);
 
 } // End namespace orc
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
index b2399f0e12dd4c9..14358713272e7d7 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
@@ -48,7 +48,7 @@ class ObjectLinkingLayerJITLinkContext;
 /// Clients can use this class to add relocatable object files to an
 /// ExecutionSession, and it typically serves as the base layer (underneath
 /// a compiling layer like IRCompileLayer) for the rest of the JIT.
-class ObjectLinkingLayer : public RTTIExtends<ObjectLinkingLayer, ObjectLayer>,
+class LLVM_CLASS_ABI ObjectLinkingLayer : public RTTIExtends<ObjectLinkingLayer, ObjectLayer>,
                            private ResourceManager {
   friend class ObjectLinkingLayerJITLinkContext;
 
@@ -203,7 +203,7 @@ class ObjectLinkingLayer : public RTTIExtends<ObjectLinkingLayer, ObjectLayer>,
   std::vector<std::unique_ptr<Plugin>> Plugins;
 };
 
-class EHFrameRegistrationPlugin : public ObjectLinkingLayer::Plugin {
+class LLVM_CLASS_ABI EHFrameRegistrationPlugin : public ObjectLinkingLayer::Plugin {
 public:
   EHFrameRegistrationPlugin(
       ExecutionSession &ES,
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
index 36a6dbb6333d4bd..731b94181654a4b 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ObjectTransformLayer.h
@@ -22,7 +22,7 @@
 namespace llvm {
 namespace orc {
 
-class ObjectTransformLayer
+class LLVM_CLASS_ABI ObjectTransformLayer
     : public RTTIExtends<ObjectTransformLayer, ObjectLayer> {
 public:
   static char ID;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h b/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
index 6ad4a0e2dd4b501..bc9d9a4cd2fc95c 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h
@@ -27,7 +27,7 @@
 namespace llvm {
 namespace orc {
 
-struct IndirectStubsAllocationSizes {
+struct LLVM_CLASS_ABI IndirectStubsAllocationSizes {
   uint64_t StubBytes = 0;
   uint64_t PointerBytes = 0;
   unsigned NumStubs = 0;
@@ -53,7 +53,7 @@ getIndirectStubsBlockSizes(unsigned MinStubs, unsigned RoundToMultipleOf = 0) {
 /// ORC templates that require one (e.g. IndirectStubsManagers). It does not
 /// support lazy JITing however, and any attempt to use that functionality
 /// will result in execution of an llvm_unreachable.
-class OrcGenericABI {
+class LLVM_CLASS_ABI OrcGenericABI {
 public:
   static constexpr unsigned PointerSize = sizeof(uintptr_t);
   static constexpr unsigned TrampolineSize = 1;
@@ -87,7 +87,7 @@ class OrcGenericABI {
   }
 };
 
-class OrcAArch64 {
+class LLVM_CLASS_ABI OrcAArch64 {
 public:
   static constexpr unsigned PointerSize = 8;
   static constexpr unsigned TrampolineSize = 12;
@@ -128,7 +128,7 @@ class OrcAArch64 {
 /// X86_64 code that's common to all ABIs.
 ///
 /// X86_64 supports lazy JITing.
-class OrcX86_64_Base {
+class LLVM_CLASS_ABI OrcX86_64_Base {
 public:
   static constexpr unsigned PointerSize = 8;
   static constexpr unsigned TrampolineSize = 8;
@@ -156,7 +156,7 @@ class OrcX86_64_Base {
 /// X86_64 support for SysV ABI (Linux, MacOSX).
 ///
 /// X86_64_SysV supports lazy JITing.
-class OrcX86_64_SysV : public OrcX86_64_Base {
+class LLVM_CLASS_ABI OrcX86_64_SysV : public OrcX86_64_Base {
 public:
   static constexpr unsigned ResolverCodeSize = 0x6C;
 
@@ -176,7 +176,7 @@ class OrcX86_64_SysV : public OrcX86_64_Base {
 /// X86_64 support for Win32.
 ///
 /// X86_64_Win32 supports lazy JITing.
-class OrcX86_64_Win32 : public OrcX86_64_Base {
+class LLVM_CLASS_ABI OrcX86_64_Win32 : public OrcX86_64_Base {
 public:
   static constexpr unsigned ResolverCodeSize = 0x74;
 
@@ -196,7 +196,7 @@ class OrcX86_64_Win32 : public OrcX86_64_Base {
 /// I386 support.
 ///
 /// I386 supports lazy JITing.
-class OrcI386 {
+class LLVM_CLASS_ABI OrcI386 {
 public:
   static constexpr unsigned PointerSize = 4;
   static constexpr unsigned TrampolineSize = 8;
@@ -237,7 +237,7 @@ class OrcI386 {
 // @brief Mips32 support.
 //
 // Mips32 supports lazy JITing.
-class OrcMips32_Base {
+class LLVM_CLASS_ABI OrcMips32_Base {
 public:
   static constexpr unsigned PointerSize = 4;
   static constexpr unsigned TrampolineSize = 20;
@@ -274,7 +274,7 @@ class OrcMips32_Base {
                                       unsigned NumStubs);
 };
 
-class OrcMips32Le : public OrcMips32_Base {
+class LLVM_CLASS_ABI OrcMips32Le : public OrcMips32_Base {
 public:
   static void writeResolverCode(char *ResolverWorkingMem,
                                 ExecutorAddr ResolverTargetAddress,
@@ -285,7 +285,7 @@ class OrcMips32Le : public OrcMips32_Base {
   }
 };
 
-class OrcMips32Be : public OrcMips32_Base {
+class LLVM_CLASS_ABI OrcMips32Be : public OrcMips32_Base {
 public:
   static void writeResolverCode(char *ResolverWorkingMem,
                                 ExecutorAddr ResolverTargetAddress,
@@ -299,7 +299,7 @@ class OrcMips32Be : public OrcMips32_Base {
 // @brief Mips64 support.
 //
 // Mips64 supports lazy JITing.
-class OrcMips64 {
+class LLVM_CLASS_ABI OrcMips64 {
 public:
   static constexpr unsigned PointerSize = 8;
   static constexpr unsigned TrampolineSize = 40;
@@ -339,7 +339,7 @@ class OrcMips64 {
 // @brief riscv64 support.
 //
 // RISC-V 64 supports lazy JITing.
-class OrcRiscv64 {
+class LLVM_CLASS_ABI OrcRiscv64 {
 public:
   static constexpr unsigned PointerSize = 8;
   static constexpr unsigned TrampolineSize = 16;
@@ -379,7 +379,7 @@ class OrcRiscv64 {
 // @brief loongarch64 support.
 //
 // LoongArch 64 supports lazy JITing.
-class OrcLoongArch64 {
+class LLVM_CLASS_ABI OrcLoongArch64 {
 public:
   static constexpr unsigned PointerSize = 8;
   static constexpr unsigned TrampolineSize = 16;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
index 7d394321c8b2a2a..86cbb9b1563a9a7 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
@@ -35,7 +35,7 @@
 namespace llvm {
 namespace orc {
 
-class RTDyldObjectLinkingLayer
+class LLVM_CLASS_ABI RTDyldObjectLinkingLayer
     : public RTTIExtends<RTDyldObjectLinkingLayer, ObjectLayer>,
       private ResourceManager {
 public:
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/AllocationActions.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/AllocationActions.h
index 7102c603d4d66f3..77d3d8904705c48 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/AllocationActions.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/AllocationActions.h
@@ -33,7 +33,7 @@ namespace shared {
 ///
 /// For unpaired operations one or the other member can be left unused, as
 /// AllocationActionCalls with an FnAddr of zero will be skipped.
-struct AllocActionCallPair {
+struct LLVM_CLASS_ABI AllocActionCallPair {
   WrapperFunctionCall Finalize;
   WrapperFunctionCall Dealloc;
 };
@@ -63,19 +63,19 @@ inline size_t numDeallocActions(const AllocActions &AAs) {
 /// be returned. The dealloc actions should be run by calling
 /// runDeallocationActions. If this function succeeds then the AA argument will
 /// be cleared before the function returns.
-Expected<std::vector<WrapperFunctionCall>>
+LLVM_FUNC_ABI Expected<std::vector<WrapperFunctionCall>>
 runFinalizeActions(AllocActions &AAs);
 
 /// Run deallocation actions.
 /// Dealloc actions will be run in reverse order (from last element of DAs to
 /// first).
-Error runDeallocActions(ArrayRef<WrapperFunctionCall> DAs);
+LLVM_FUNC_ABI Error runDeallocActions(ArrayRef<WrapperFunctionCall> DAs);
 
 using SPSAllocActionCallPair =
     SPSTuple<SPSWrapperFunctionCall, SPSWrapperFunctionCall>;
 
 template <>
-class SPSSerializationTraits<SPSAllocActionCallPair,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSAllocActionCallPair,
                              AllocActionCallPair> {
   using AL = SPSAllocActionCallPair::AsArgList;
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
index f439b449cb4d46b..552eb646641b4c0 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
@@ -29,7 +29,7 @@ namespace orc {
 using ExecutorAddrDiff = uint64_t;
 
 /// Represents an address in the executor process.
-class ExecutorAddr {
+class LLVM_CLASS_ABI ExecutorAddr {
 public:
   /// A wrap/unwrap function that leaves pointers unmodified.
   template <typename T> using rawPtr = llvm::identity<T *>;
@@ -189,7 +189,7 @@ inline ExecutorAddrDiff operator%(const ExecutorAddr &LHS,
 }
 
 /// Represents an address range in the exceutor process.
-struct ExecutorAddrRange {
+struct LLVM_CLASS_ABI ExecutorAddrRange {
   ExecutorAddrRange() = default;
   ExecutorAddrRange(ExecutorAddr Start, ExecutorAddr End)
       : Start(Start), End(End) {}
@@ -247,10 +247,10 @@ inline raw_ostream &operator<<(raw_ostream &OS, const ExecutorAddrRange &R) {
 
 namespace shared {
 
-class SPSExecutorAddr {};
+class LLVM_CLASS_ABI SPSExecutorAddr {};
 
 /// SPS serializatior for ExecutorAddr.
-template <> class SPSSerializationTraits<SPSExecutorAddr, ExecutorAddr> {
+template <> class LLVM_CLASS_ABI SPSSerializationTraits<SPSExecutorAddr, ExecutorAddr> {
 public:
   static size_t size(const ExecutorAddr &EA) {
     return SPSArgList<uint64_t>::size(EA.getValue());
@@ -273,7 +273,7 @@ using SPSExecutorAddrRange = SPSTuple<SPSExecutorAddr, SPSExecutorAddr>;
 
 /// Serialization traits for address ranges.
 template <>
-class SPSSerializationTraits<SPSExecutorAddrRange, ExecutorAddrRange> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSExecutorAddrRange, ExecutorAddrRange> {
 public:
   static size_t size(const ExecutorAddrRange &Value) {
     return SPSArgList<SPSExecutorAddr, SPSExecutorAddr>::size(Value.Start,
@@ -297,7 +297,7 @@ using SPSExecutorAddrRangeSequence = SPSSequence<SPSExecutorAddrRange>;
 } // End namespace orc.
 
 // Provide DenseMapInfo for ExecutorAddrs.
-template <> struct DenseMapInfo<orc::ExecutorAddr> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<orc::ExecutorAddr> {
   static inline orc::ExecutorAddr getEmptyKey() {
     return orc::ExecutorAddr(DenseMapInfo<uint64_t>::getEmptyKey());
   }
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h
index d860f6a293ab74f..fff1f2227c2f2fb 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h
@@ -21,7 +21,7 @@ namespace llvm {
 namespace orc {
 
 /// Represents a defining location for a JIT symbol.
-class ExecutorSymbolDef {
+class LLVM_CLASS_ABI ExecutorSymbolDef {
 public:
   ExecutorSymbolDef() = default;
   ExecutorSymbolDef(ExecutorAddr Addr, JITSymbolFlags Flags)
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h
index 7e75bc7bba6219c..eef69577caba1ea 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/MemoryFlags.h
@@ -108,7 +108,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, MemLifetimePolicy MLP) {
 /// A pair of memory protections and allocation policies.
 ///
 /// Optimized for use as a small map key.
-class AllocGroup {
+class LLVM_CLASS_ABI AllocGroup {
   friend struct llvm::DenseMapInfo<AllocGroup>;
 
   using underlying_type = uint8_t;
@@ -163,7 +163,7 @@ class AllocGroup {
 /// A specialized small-map for AllocGroups.
 ///
 /// Iteration order is guaranteed to match key ordering.
-template <typename T> class AllocGroupSmallMap {
+template <typename T> class LLVM_CLASS_ABI AllocGroupSmallMap {
 private:
   using ElemT = std::pair<AllocGroup, T>;
   using VectorTy = SmallVector<ElemT, 4>;
@@ -210,7 +210,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, AllocGroup AG) {
 
 } // end namespace orc
 
-template <> struct DenseMapInfo<orc::MemProt> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<orc::MemProt> {
   static inline orc::MemProt getEmptyKey() { return orc::MemProt(~uint8_t(0)); }
   static inline orc::MemProt getTombstoneKey() {
     return orc::MemProt(~uint8_t(0) - 1);
@@ -224,7 +224,7 @@ template <> struct DenseMapInfo<orc::MemProt> {
   }
 };
 
-template <> struct DenseMapInfo<orc::AllocGroup> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<orc::AllocGroup> {
   static inline orc::AllocGroup getEmptyKey() {
     return orc::AllocGroup(~uint8_t(0));
   }
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h
index b4ca812c51812c9..de5601fcd59f1b5 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h
@@ -21,48 +21,48 @@ namespace orc {
 
 // MachO section names.
 
-extern StringRef MachODataCommonSectionName;
-extern StringRef MachODataDataSectionName;
-extern StringRef MachOEHFrameSectionName;
-extern StringRef MachOCompactUnwindInfoSectionName;
-extern StringRef MachOModInitFuncSectionName;
-extern StringRef MachOObjCCatListSectionName;
-extern StringRef MachOObjCCatList2SectionName;
-extern StringRef MachOObjCClassListSectionName;
-extern StringRef MachOObjCClassNameSectionName;
-extern StringRef MachOObjCClassRefsSectionName;
-extern StringRef MachOObjCConstSectionName;
-extern StringRef MachOObjCDataSectionName;
-extern StringRef MachOObjCImageInfoSectionName;
-extern StringRef MachOObjCMethNameSectionName;
-extern StringRef MachOObjCMethTypeSectionName;
-extern StringRef MachOObjCNLCatListSectionName;
-extern StringRef MachOObjCSelRefsSectionName;
-extern StringRef MachOSwift5ProtoSectionName;
-extern StringRef MachOSwift5ProtosSectionName;
-extern StringRef MachOSwift5TypesSectionName;
-extern StringRef MachOSwift5TypeRefSectionName;
-extern StringRef MachOSwift5FieldMetadataSectionName;
-extern StringRef MachOSwift5EntrySectionName;
-extern StringRef MachOThreadBSSSectionName;
-extern StringRef MachOThreadDataSectionName;
-extern StringRef MachOThreadVarsSectionName;
+LLVM_FUNC_ABI extern StringRef MachODataCommonSectionName;
+LLVM_FUNC_ABI extern StringRef MachODataDataSectionName;
+LLVM_FUNC_ABI extern StringRef MachOEHFrameSectionName;
+LLVM_FUNC_ABI extern StringRef MachOCompactUnwindInfoSectionName;
+LLVM_FUNC_ABI extern StringRef MachOModInitFuncSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCCatListSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCCatList2SectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCClassListSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCClassNameSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCClassRefsSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCConstSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCDataSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCImageInfoSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCMethNameSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCMethTypeSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCNLCatListSectionName;
+LLVM_FUNC_ABI extern StringRef MachOObjCSelRefsSectionName;
+LLVM_FUNC_ABI extern StringRef MachOSwift5ProtoSectionName;
+LLVM_FUNC_ABI extern StringRef MachOSwift5ProtosSectionName;
+LLVM_FUNC_ABI extern StringRef MachOSwift5TypesSectionName;
+LLVM_FUNC_ABI extern StringRef MachOSwift5TypeRefSectionName;
+LLVM_FUNC_ABI extern StringRef MachOSwift5FieldMetadataSectionName;
+LLVM_FUNC_ABI extern StringRef MachOSwift5EntrySectionName;
+LLVM_FUNC_ABI extern StringRef MachOThreadBSSSectionName;
+LLVM_FUNC_ABI extern StringRef MachOThreadDataSectionName;
+LLVM_FUNC_ABI extern StringRef MachOThreadVarsSectionName;
 
-extern StringRef MachOInitSectionNames[19];
+LLVM_FUNC_ABI extern StringRef MachOInitSectionNames[19];
 
 // ELF section names.
-extern StringRef ELFEHFrameSectionName;
-extern StringRef ELFInitArrayFuncSectionName;
+LLVM_FUNC_ABI extern StringRef ELFEHFrameSectionName;
+LLVM_FUNC_ABI extern StringRef ELFInitArrayFuncSectionName;
 
-extern StringRef ELFThreadBSSSectionName;
-extern StringRef ELFThreadDataSectionName;
+LLVM_FUNC_ABI extern StringRef ELFThreadBSSSectionName;
+LLVM_FUNC_ABI extern StringRef ELFThreadDataSectionName;
 
-bool isMachOInitializerSection(StringRef SegName, StringRef SecName);
-bool isMachOInitializerSection(StringRef QualifiedName);
+LLVM_FUNC_ABI bool isMachOInitializerSection(StringRef SegName, StringRef SecName);
+LLVM_FUNC_ABI bool isMachOInitializerSection(StringRef QualifiedName);
 
-bool isELFInitializerSection(StringRef SecName);
+LLVM_FUNC_ABI bool isELFInitializerSection(StringRef SecName);
 
-bool isCOFFInitializerSection(StringRef Name);
+LLVM_FUNC_ABI bool isCOFFInitializerSection(StringRef Name);
 
 } // end namespace orc
 } // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h
index b80ead3ea034700..6992d3ddac6bc0e 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcError.h
@@ -43,9 +43,9 @@ enum class OrcErrorCode : int {
   UnexpectedSymbolDefinitions,
 };
 
-std::error_code orcError(OrcErrorCode ErrCode);
+LLVM_FUNC_ABI std::error_code orcError(OrcErrorCode ErrCode);
 
-class DuplicateDefinition : public ErrorInfo<DuplicateDefinition> {
+class LLVM_CLASS_ABI DuplicateDefinition : public ErrorInfo<DuplicateDefinition> {
 public:
   static char ID;
 
@@ -57,7 +57,7 @@ class DuplicateDefinition : public ErrorInfo<DuplicateDefinition> {
   std::string SymbolName;
 };
 
-class JITSymbolNotFound : public ErrorInfo<JITSymbolNotFound> {
+class LLVM_CLASS_ABI JITSymbolNotFound : public ErrorInfo<JITSymbolNotFound> {
 public:
   static char ID;
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h
index b2633579c4fd301..c4694567a53d967 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h
@@ -22,33 +22,33 @@ namespace llvm {
 namespace orc {
 namespace rt {
 
-extern const char *SimpleExecutorDylibManagerInstanceName;
-extern const char *SimpleExecutorDylibManagerOpenWrapperName;
-extern const char *SimpleExecutorDylibManagerLookupWrapperName;
+LLVM_FUNC_ABI extern const char *SimpleExecutorDylibManagerInstanceName;
+LLVM_FUNC_ABI extern const char *SimpleExecutorDylibManagerOpenWrapperName;
+LLVM_FUNC_ABI extern const char *SimpleExecutorDylibManagerLookupWrapperName;
 
-extern const char *SimpleExecutorMemoryManagerInstanceName;
-extern const char *SimpleExecutorMemoryManagerReserveWrapperName;
-extern const char *SimpleExecutorMemoryManagerFinalizeWrapperName;
-extern const char *SimpleExecutorMemoryManagerDeallocateWrapperName;
+LLVM_FUNC_ABI extern const char *SimpleExecutorMemoryManagerInstanceName;
+LLVM_FUNC_ABI extern const char *SimpleExecutorMemoryManagerReserveWrapperName;
+LLVM_FUNC_ABI extern const char *SimpleExecutorMemoryManagerFinalizeWrapperName;
+LLVM_FUNC_ABI extern const char *SimpleExecutorMemoryManagerDeallocateWrapperName;
 
-extern const char *ExecutorSharedMemoryMapperServiceInstanceName;
-extern const char *ExecutorSharedMemoryMapperServiceReserveWrapperName;
-extern const char *ExecutorSharedMemoryMapperServiceInitializeWrapperName;
-extern const char *ExecutorSharedMemoryMapperServiceDeinitializeWrapperName;
-extern const char *ExecutorSharedMemoryMapperServiceReleaseWrapperName;
+LLVM_FUNC_ABI extern const char *ExecutorSharedMemoryMapperServiceInstanceName;
+LLVM_FUNC_ABI extern const char *ExecutorSharedMemoryMapperServiceReserveWrapperName;
+LLVM_FUNC_ABI extern const char *ExecutorSharedMemoryMapperServiceInitializeWrapperName;
+LLVM_FUNC_ABI extern const char *ExecutorSharedMemoryMapperServiceDeinitializeWrapperName;
+LLVM_FUNC_ABI extern const char *ExecutorSharedMemoryMapperServiceReleaseWrapperName;
 
-extern const char *MemoryWriteUInt8sWrapperName;
-extern const char *MemoryWriteUInt16sWrapperName;
-extern const char *MemoryWriteUInt32sWrapperName;
-extern const char *MemoryWriteUInt64sWrapperName;
-extern const char *MemoryWriteBuffersWrapperName;
+LLVM_FUNC_ABI extern const char *MemoryWriteUInt8sWrapperName;
+LLVM_FUNC_ABI extern const char *MemoryWriteUInt16sWrapperName;
+LLVM_FUNC_ABI extern const char *MemoryWriteUInt32sWrapperName;
+LLVM_FUNC_ABI extern const char *MemoryWriteUInt64sWrapperName;
+LLVM_FUNC_ABI extern const char *MemoryWriteBuffersWrapperName;
 
-extern const char *RegisterEHFrameSectionWrapperName;
-extern const char *DeregisterEHFrameSectionWrapperName;
+LLVM_FUNC_ABI extern const char *RegisterEHFrameSectionWrapperName;
+LLVM_FUNC_ABI extern const char *DeregisterEHFrameSectionWrapperName;
 
-extern const char *RunAsMainWrapperName;
-extern const char *RunAsVoidFunctionWrapperName;
-extern const char *RunAsIntFunctionWrapperName;
+LLVM_FUNC_ABI extern const char *RunAsMainWrapperName;
+LLVM_FUNC_ABI extern const char *RunAsVoidFunctionWrapperName;
+LLVM_FUNC_ABI extern const char *RunAsIntFunctionWrapperName;
 
 using SPSSimpleExecutorDylibManagerOpenSignature =
     shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr,
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h
index 8d1e061471e2235..1eeb89caf51b5fb 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h
@@ -53,7 +53,7 @@ namespace orc {
 namespace shared {
 
 /// Output char buffer with overflow check.
-class SPSOutputBuffer {
+class LLVM_CLASS_ABI SPSOutputBuffer {
 public:
   SPSOutputBuffer(char *Buffer, size_t Remaining)
       : Buffer(Buffer), Remaining(Remaining) {}
@@ -73,7 +73,7 @@ class SPSOutputBuffer {
 };
 
 /// Input char buffer with underflow check.
-class SPSInputBuffer {
+class LLVM_CLASS_ABI SPSInputBuffer {
 public:
   SPSInputBuffer() = default;
   SPSInputBuffer(const char *Buffer, size_t Remaining)
@@ -110,7 +110,7 @@ class SPSSerializationTraits;
 template <typename... ArgTs> class SPSArgList;
 
 // Empty list specialization for SPSArgList.
-template <> class SPSArgList<> {
+template <> class LLVM_CLASS_ABI SPSArgList<> {
 public:
   static size_t size() { return 0; }
 
@@ -126,7 +126,7 @@ template <> class SPSArgList<> {
 
 // Non-empty list specialization for SPSArgList.
 template <typename SPSTagT, typename... SPSTagTs>
-class SPSArgList<SPSTagT, SPSTagTs...> {
+class LLVM_CLASS_ABI SPSArgList<SPSTagT, SPSTagTs...> {
 public:
   // FIXME: This typedef is here to enable SPS arg serialization from
   // JITLink. It can be removed once JITLink can access SPS directly.
@@ -154,7 +154,7 @@ class SPSArgList<SPSTagT, SPSTagTs...> {
 
 /// SPS serialization for integral types, bool, and char.
 template <typename SPSTagT>
-class SPSSerializationTraits<
+class LLVM_CLASS_ABI SPSSerializationTraits<
     SPSTagT, SPSTagT,
     std::enable_if_t<std::is_same<SPSTagT, bool>::value ||
                      std::is_same<SPSTagT, char>::value ||
@@ -188,13 +188,13 @@ class SPSSerializationTraits<
 };
 
 // Any empty placeholder suitable as a substitute for void when deserializing
-class SPSEmpty {};
+class LLVM_CLASS_ABI SPSEmpty {};
 
 /// SPS tag type for tuples.
 ///
 /// A blob tuple should be serialized by serializing each of the elements in
 /// sequence.
-template <typename... SPSTagTs> class SPSTuple {
+template <typename... SPSTagTs> class LLVM_CLASS_ABI SPSTuple {
 public:
   /// Convenience typedef of the corresponding arg list.
   typedef SPSArgList<SPSTagTs...> AsArgList;
@@ -206,7 +206,7 @@ template <typename... SPSTagTs> class SPSTuple {
 /// SPSTagT value is present, and false indicating that there is no value.
 /// If the boolean is true then the serialized SPSTagT will follow immediately
 /// after it.
-template <typename SPSTagT> class SPSOptional {};
+template <typename SPSTagT> class LLVM_CLASS_ABI SPSOptional {};
 
 /// SPS tag type for sequences.
 ///
@@ -224,7 +224,7 @@ template <typename SPSTagT1, typename SPSTagT2>
 using SPSMap = SPSSequence<SPSTuple<SPSTagT1, SPSTagT2>>;
 
 /// Serialization for SPSEmpty type.
-template <> class SPSSerializationTraits<SPSEmpty, SPSEmpty> {
+template <> class LLVM_CLASS_ABI SPSSerializationTraits<SPSEmpty, SPSEmpty> {
 public:
   static size_t size(const SPSEmpty &EP) { return 0; }
   static bool serialize(SPSOutputBuffer &OB, const SPSEmpty &BE) {
@@ -243,7 +243,7 @@ template <> class SPSSerializationTraits<SPSEmpty, SPSEmpty> {
 /// Specializing this template class means that you do not need to provide a
 /// specialization of SPSSerializationTraits for your type.
 template <typename SPSElementTagT, typename ConcreteSequenceT>
-class TrivialSPSSequenceSerialization {
+class LLVM_CLASS_ABI TrivialSPSSequenceSerialization {
 public:
   static constexpr bool available = false;
 };
@@ -259,19 +259,19 @@ class TrivialSPSSequenceSerialization {
 /// Specializing this template class means that you do not need to provide a
 /// specialization of SPSSerializationTraits for your type.
 template <typename SPSElementTagT, typename ConcreteSequenceT>
-class TrivialSPSSequenceDeserialization {
+class LLVM_CLASS_ABI TrivialSPSSequenceDeserialization {
 public:
   static constexpr bool available = false;
 };
 
 /// Trivial std::string -> SPSSequence<char> serialization.
-template <> class TrivialSPSSequenceSerialization<char, std::string> {
+template <> class LLVM_CLASS_ABI TrivialSPSSequenceSerialization<char, std::string> {
 public:
   static constexpr bool available = true;
 };
 
 /// Trivial SPSSequence<char> -> std::string deserialization.
-template <> class TrivialSPSSequenceDeserialization<char, std::string> {
+template <> class LLVM_CLASS_ABI TrivialSPSSequenceDeserialization<char, std::string> {
 public:
   static constexpr bool available = true;
 
@@ -286,14 +286,14 @@ template <> class TrivialSPSSequenceDeserialization<char, std::string> {
 
 /// Trivial std::vector<T> -> SPSSequence<SPSElementTagT> serialization.
 template <typename SPSElementTagT, typename T>
-class TrivialSPSSequenceSerialization<SPSElementTagT, std::vector<T>> {
+class LLVM_CLASS_ABI TrivialSPSSequenceSerialization<SPSElementTagT, std::vector<T>> {
 public:
   static constexpr bool available = true;
 };
 
 /// Trivial SPSSequence<SPSElementTagT> -> std::vector<T> deserialization.
 template <typename SPSElementTagT, typename T>
-class TrivialSPSSequenceDeserialization<SPSElementTagT, std::vector<T>> {
+class LLVM_CLASS_ABI TrivialSPSSequenceDeserialization<SPSElementTagT, std::vector<T>> {
 public:
   static constexpr bool available = true;
 
@@ -308,14 +308,14 @@ class TrivialSPSSequenceDeserialization<SPSElementTagT, std::vector<T>> {
 
 /// Trivial SmallVectorImpl<T> -> SPSSequence<char> serialization.
 template <typename SPSElementTagT, typename T>
-class TrivialSPSSequenceSerialization<SPSElementTagT, SmallVectorImpl<T>> {
+class LLVM_CLASS_ABI TrivialSPSSequenceSerialization<SPSElementTagT, SmallVectorImpl<T>> {
 public:
   static constexpr bool available = true;
 };
 
 /// Trivial SPSSequence<SPSElementTagT> -> SmallVectorImpl<T> deserialization.
 template <typename SPSElementTagT, typename T>
-class TrivialSPSSequenceDeserialization<SPSElementTagT, SmallVectorImpl<T>> {
+class LLVM_CLASS_ABI TrivialSPSSequenceDeserialization<SPSElementTagT, SmallVectorImpl<T>> {
 public:
   static constexpr bool available = true;
 
@@ -330,19 +330,19 @@ class TrivialSPSSequenceDeserialization<SPSElementTagT, SmallVectorImpl<T>> {
 
 /// Trivial SmallVectorImpl<T> -> SPSSequence<char> serialization.
 template <typename SPSElementTagT, typename T, unsigned N>
-class TrivialSPSSequenceSerialization<SPSElementTagT, SmallVector<T, N>>
+class LLVM_CLASS_ABI TrivialSPSSequenceSerialization<SPSElementTagT, SmallVector<T, N>>
     : public TrivialSPSSequenceSerialization<SPSElementTagT,
                                              SmallVectorImpl<T>> {};
 
 /// Trivial SPSSequence<SPSElementTagT> -> SmallVectorImpl<T> deserialization.
 template <typename SPSElementTagT, typename T, unsigned N>
-class TrivialSPSSequenceDeserialization<SPSElementTagT, SmallVector<T, N>>
+class LLVM_CLASS_ABI TrivialSPSSequenceDeserialization<SPSElementTagT, SmallVector<T, N>>
     : public TrivialSPSSequenceDeserialization<SPSElementTagT,
                                                SmallVectorImpl<T>> {};
 
 /// Trivial ArrayRef<T> -> SPSSequence<SPSElementTagT> serialization.
 template <typename SPSElementTagT, typename T>
-class TrivialSPSSequenceSerialization<SPSElementTagT, ArrayRef<T>> {
+class LLVM_CLASS_ABI TrivialSPSSequenceSerialization<SPSElementTagT, ArrayRef<T>> {
 public:
   static constexpr bool available = true;
 };
@@ -350,7 +350,7 @@ class TrivialSPSSequenceSerialization<SPSElementTagT, ArrayRef<T>> {
 /// Specialized SPSSequence<char> -> ArrayRef<char> serialization.
 ///
 /// On deserialize, points directly into the input buffer.
-template <> class SPSSerializationTraits<SPSSequence<char>, ArrayRef<char>> {
+template <> class LLVM_CLASS_ABI SPSSerializationTraits<SPSSequence<char>, ArrayRef<char>> {
 public:
   static size_t size(const ArrayRef<char> &A) {
     return SPSArgList<uint64_t>::size(static_cast<uint64_t>(A.size())) +
@@ -380,7 +380,7 @@ template <> class SPSSerializationTraits<SPSSequence<char>, ArrayRef<char>> {
 /// followed by a for-earch loop over the elements of the sequence to serialize
 /// each of them.
 template <typename SPSElementTagT, typename SequenceT>
-class SPSSerializationTraits<SPSSequence<SPSElementTagT>, SequenceT,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSSequence<SPSElementTagT>, SequenceT,
                              std::enable_if_t<TrivialSPSSequenceSerialization<
                                  SPSElementTagT, SequenceT>::available>> {
 public:
@@ -419,7 +419,7 @@ class SPSSerializationTraits<SPSSequence<SPSElementTagT>, SequenceT,
 
 /// SPSTuple serialization for std::tuple.
 template <typename... SPSTagTs, typename... Ts>
-class SPSSerializationTraits<SPSTuple<SPSTagTs...>, std::tuple<Ts...>> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSTuple<SPSTagTs...>, std::tuple<Ts...>> {
 private:
   using TupleArgList = typename SPSTuple<SPSTagTs...>::AsArgList;
   using ArgIndices = std::make_index_sequence<sizeof...(Ts)>;
@@ -457,7 +457,7 @@ class SPSSerializationTraits<SPSTuple<SPSTagTs...>, std::tuple<Ts...>> {
 
 /// SPSTuple serialization for std::pair.
 template <typename SPSTagT1, typename SPSTagT2, typename T1, typename T2>
-class SPSSerializationTraits<SPSTuple<SPSTagT1, SPSTagT2>, std::pair<T1, T2>> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSTuple<SPSTagT1, SPSTagT2>, std::pair<T1, T2>> {
 public:
   static size_t size(const std::pair<T1, T2> &P) {
     return SPSArgList<SPSTagT1>::size(P.first) +
@@ -477,7 +477,7 @@ class SPSSerializationTraits<SPSTuple<SPSTagT1, SPSTagT2>, std::pair<T1, T2>> {
 
 /// SPSOptional serialization for std::optional.
 template <typename SPSTagT, typename T>
-class SPSSerializationTraits<SPSOptional<SPSTagT>, std::optional<T>> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSOptional<SPSTagT>, std::optional<T>> {
 public:
   static size_t size(const std::optional<T> &Value) {
     size_t Size = SPSArgList<bool>::size(!!Value);
@@ -511,7 +511,7 @@ class SPSSerializationTraits<SPSOptional<SPSTagT>, std::optional<T>> {
 ///
 /// Serialization is as for regular strings. Deserialization points directly
 /// into the blob.
-template <> class SPSSerializationTraits<SPSString, StringRef> {
+template <> class LLVM_CLASS_ABI SPSSerializationTraits<SPSString, StringRef> {
 public:
   static size_t size(const StringRef &S) {
     return SPSArgList<uint64_t>::size(static_cast<uint64_t>(S.size())) +
@@ -541,7 +541,7 @@ template <> class SPSSerializationTraits<SPSString, StringRef> {
 
 /// Serialization for StringMap<ValueT>s.
 template <typename SPSValueT, typename ValueT>
-class SPSSerializationTraits<SPSSequence<SPSTuple<SPSString, SPSValueT>>,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSSequence<SPSTuple<SPSString, SPSValueT>>,
                              StringMap<ValueT>> {
 public:
   static size_t size(const StringMap<ValueT> &M) {
@@ -600,7 +600,7 @@ namespace detail {
 ///
 /// The SPSSerializableError type is a helper that can be
 /// constructed from an llvm::Error, but inspected more than once.
-struct SPSSerializableError {
+struct LLVM_CLASS_ABI SPSSerializableError {
   bool HasError = false;
   std::string ErrMsg;
 };
@@ -610,7 +610,7 @@ struct SPSSerializableError {
 /// See SPSSerializableError for more details.
 ///
 // FIXME: Use std::variant for storage once we have c++17.
-template <typename T> struct SPSSerializableExpected {
+template <typename T> struct LLVM_CLASS_ABI SPSSerializableExpected {
   bool HasValue = false;
   T Value{};
   std::string ErrMsg;
@@ -648,7 +648,7 @@ Expected<T> fromSPSSerializable(SPSSerializableExpected<T> BSE) {
 
 /// Serialize to a SPSError from a detail::SPSSerializableError.
 template <>
-class SPSSerializationTraits<SPSError, detail::SPSSerializableError> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSError, detail::SPSSerializableError> {
 public:
   static size_t size(const detail::SPSSerializableError &BSE) {
     size_t Size = SPSArgList<bool>::size(BSE.HasError);
@@ -682,7 +682,7 @@ class SPSSerializationTraits<SPSError, detail::SPSSerializableError> {
 /// Serialize to a SPSExpected<SPSTagT> from a
 /// detail::SPSSerializableExpected<T>.
 template <typename SPSTagT, typename T>
-class SPSSerializationTraits<SPSExpected<SPSTagT>,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSExpected<SPSTagT>,
                              detail::SPSSerializableExpected<T>> {
 public:
   static size_t size(const detail::SPSSerializableExpected<T> &BSE) {
@@ -719,7 +719,7 @@ class SPSSerializationTraits<SPSExpected<SPSTagT>,
 
 /// Serialize to a SPSExpected<SPSTagT> from a detail::SPSSerializableError.
 template <typename SPSTagT>
-class SPSSerializationTraits<SPSExpected<SPSTagT>,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSExpected<SPSTagT>,
                              detail::SPSSerializableError> {
 public:
   static size_t size(const detail::SPSSerializableError &BSE) {
@@ -739,7 +739,7 @@ class SPSSerializationTraits<SPSExpected<SPSTagT>,
 
 /// Serialize to a SPSExpected<SPSTagT> from a T.
 template <typename SPSTagT, typename T>
-class SPSSerializationTraits<SPSExpected<SPSTagT>, T> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSExpected<SPSTagT>, T> {
 public:
   static size_t size(const T &Value) {
     return SPSArgList<bool>::size(true) + SPSArgList<SPSTagT>::size(Value);
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h
index bded4ea10ae3039..a4ac7334558f63d 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h
@@ -31,8 +31,8 @@ namespace llvm {
 namespace orc {
 
 namespace SimpleRemoteEPCDefaultBootstrapSymbolNames {
-extern const char *ExecutorSessionObjectName;
-extern const char *DispatchFnName;
+LLVM_FUNC_ABI extern const char *ExecutorSessionObjectName;
+LLVM_FUNC_ABI extern const char *DispatchFnName;
 } // end namespace SimpleRemoteEPCDefaultBootstrapSymbolNames
 
 enum class SimpleRemoteEPCOpcode : uint8_t {
@@ -43,7 +43,7 @@ enum class SimpleRemoteEPCOpcode : uint8_t {
   LastOpC = CallWrapper
 };
 
-struct SimpleRemoteEPCExecutorInfo {
+struct LLVM_CLASS_ABI SimpleRemoteEPCExecutorInfo {
   std::string TargetTriple;
   uint64_t PageSize;
   StringMap<std::vector<char>> BootstrapMap;
@@ -52,7 +52,7 @@ struct SimpleRemoteEPCExecutorInfo {
 
 using SimpleRemoteEPCArgBytesVector = SmallVector<char, 128>;
 
-class SimpleRemoteEPCTransportClient {
+class LLVM_CLASS_ABI SimpleRemoteEPCTransportClient {
 public:
   enum HandleMessageAction { ContinueSession, EndSession };
 
@@ -76,7 +76,7 @@ class SimpleRemoteEPCTransportClient {
   virtual void handleDisconnect(Error Err) = 0;
 };
 
-class SimpleRemoteEPCTransport {
+class LLVM_CLASS_ABI SimpleRemoteEPCTransport {
 public:
   virtual ~SimpleRemoteEPCTransport();
 
@@ -101,7 +101,7 @@ class SimpleRemoteEPCTransport {
 };
 
 /// Uses read/write on FileDescriptors for transport.
-class FDSimpleRemoteEPCTransport : public SimpleRemoteEPCTransport {
+class LLVM_CLASS_ABI FDSimpleRemoteEPCTransport : public SimpleRemoteEPCTransport {
 public:
   /// Create a FDSimpleRemoteEPCTransport using the given FDs for
   /// reading (InFD) and writing (OutFD).
@@ -140,14 +140,14 @@ class FDSimpleRemoteEPCTransport : public SimpleRemoteEPCTransport {
   std::atomic<bool> Disconnected{false};
 };
 
-struct RemoteSymbolLookupSetElement {
+struct LLVM_CLASS_ABI RemoteSymbolLookupSetElement {
   std::string Name;
   bool Required;
 };
 
 using RemoteSymbolLookupSet = std::vector<RemoteSymbolLookupSetElement>;
 
-struct RemoteSymbolLookup {
+struct LLVM_CLASS_ABI RemoteSymbolLookup {
   uint64_t H;
   RemoteSymbolLookupSet Symbols;
 };
@@ -167,7 +167,7 @@ using SPSSimpleRemoteEPCExecutorInfo =
              SPSSequence<SPSTuple<SPSString, SPSExecutorAddr>>>;
 
 template <>
-class SPSSerializationTraits<SPSRemoteSymbolLookupSetElement,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSRemoteSymbolLookupSetElement,
                              RemoteSymbolLookupSetElement> {
 public:
   static size_t size(const RemoteSymbolLookupSetElement &V) {
@@ -186,7 +186,7 @@ class SPSSerializationTraits<SPSRemoteSymbolLookupSetElement,
 };
 
 template <>
-class SPSSerializationTraits<SPSRemoteSymbolLookup, RemoteSymbolLookup> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSRemoteSymbolLookup, RemoteSymbolLookup> {
 public:
   static size_t size(const RemoteSymbolLookup &V) {
     return SPSArgList<uint64_t, SPSRemoteSymbolLookupSet>::size(V.H, V.Symbols);
@@ -204,7 +204,7 @@ class SPSSerializationTraits<SPSRemoteSymbolLookup, RemoteSymbolLookup> {
 };
 
 template <>
-class SPSSerializationTraits<SPSSimpleRemoteEPCExecutorInfo,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSSimpleRemoteEPCExecutorInfo,
                              SimpleRemoteEPCExecutorInfo> {
 public:
   static size_t size(const SimpleRemoteEPCExecutorInfo &SI) {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
index 98d7eacb6c81961..ea15aeca549c7c0 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
@@ -31,7 +31,7 @@ namespace llvm {
 namespace orc {
 namespace tpctypes {
 
-struct RemoteAllocGroup {
+struct LLVM_CLASS_ABI RemoteAllocGroup {
   RemoteAllocGroup() = default;
   RemoteAllocGroup(MemProt Prot) : Prot(Prot) {}
   RemoteAllocGroup(MemProt Prot, bool FinalizeLifetime)
@@ -47,30 +47,30 @@ struct RemoteAllocGroup {
   bool FinalizeLifetime = false;
 };
 
-struct SegFinalizeRequest {
+struct LLVM_CLASS_ABI SegFinalizeRequest {
   RemoteAllocGroup RAG;
   ExecutorAddr Addr;
   uint64_t Size;
   ArrayRef<char> Content;
 };
 
-struct FinalizeRequest {
+struct LLVM_CLASS_ABI FinalizeRequest {
   std::vector<SegFinalizeRequest> Segments;
   shared::AllocActions Actions;
 };
 
-struct SharedMemorySegFinalizeRequest {
+struct LLVM_CLASS_ABI SharedMemorySegFinalizeRequest {
   RemoteAllocGroup RAG;
   ExecutorAddr Addr;
   uint64_t Size;
 };
 
-struct SharedMemoryFinalizeRequest {
+struct LLVM_CLASS_ABI SharedMemoryFinalizeRequest {
   std::vector<SharedMemorySegFinalizeRequest> Segments;
   shared::AllocActions Actions;
 };
 
-template <typename T> struct UIntWrite {
+template <typename T> struct LLVM_CLASS_ABI UIntWrite {
   UIntWrite() = default;
   UIntWrite(ExecutorAddr Addr, T Value) : Addr(Addr), Value(Value) {}
 
@@ -92,7 +92,7 @@ using UInt64Write = UIntWrite<uint64_t>;
 
 /// Describes a write to a buffer.
 /// For use with TargetProcessControl::MemoryAccess objects.
-struct BufferWrite {
+struct LLVM_CLASS_ABI BufferWrite {
   BufferWrite() = default;
   BufferWrite(ExecutorAddr Addr, StringRef Buffer)
       : Addr(Addr), Buffer(Buffer) {}
@@ -136,7 +136,7 @@ using SPSMemoryAccessUInt64Write = SPSMemoryAccessUIntWrite<uint64_t>;
 using SPSMemoryAccessBufferWrite = SPSTuple<SPSExecutorAddr, SPSSequence<char>>;
 
 template <>
-class SPSSerializationTraits<SPSRemoteAllocGroup, tpctypes::RemoteAllocGroup> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSRemoteAllocGroup, tpctypes::RemoteAllocGroup> {
   enum WireBits {
     ReadBit = 1 << 0,
     WriteBit = 1 << 1,
@@ -182,7 +182,7 @@ class SPSSerializationTraits<SPSRemoteAllocGroup, tpctypes::RemoteAllocGroup> {
 };
 
 template <>
-class SPSSerializationTraits<SPSSegFinalizeRequest,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSSegFinalizeRequest,
                              tpctypes::SegFinalizeRequest> {
   using SFRAL = SPSSegFinalizeRequest::AsArgList;
 
@@ -203,7 +203,7 @@ class SPSSerializationTraits<SPSSegFinalizeRequest,
 };
 
 template <>
-class SPSSerializationTraits<SPSFinalizeRequest, tpctypes::FinalizeRequest> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSFinalizeRequest, tpctypes::FinalizeRequest> {
   using FRAL = SPSFinalizeRequest::AsArgList;
 
 public:
@@ -222,7 +222,7 @@ class SPSSerializationTraits<SPSFinalizeRequest, tpctypes::FinalizeRequest> {
 };
 
 template <>
-class SPSSerializationTraits<SPSSharedMemorySegFinalizeRequest,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSSharedMemorySegFinalizeRequest,
                              tpctypes::SharedMemorySegFinalizeRequest> {
   using SFRAL = SPSSharedMemorySegFinalizeRequest::AsArgList;
 
@@ -243,7 +243,7 @@ class SPSSerializationTraits<SPSSharedMemorySegFinalizeRequest,
 };
 
 template <>
-class SPSSerializationTraits<SPSSharedMemoryFinalizeRequest,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSSharedMemoryFinalizeRequest,
                              tpctypes::SharedMemoryFinalizeRequest> {
   using FRAL = SPSSharedMemoryFinalizeRequest::AsArgList;
 
@@ -264,7 +264,7 @@ class SPSSerializationTraits<SPSSharedMemoryFinalizeRequest,
 };
 
 template <typename T>
-class SPSSerializationTraits<SPSMemoryAccessUIntWrite<T>,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSMemoryAccessUIntWrite<T>,
                              tpctypes::UIntWrite<T>> {
 public:
   static size_t size(const tpctypes::UIntWrite<T> &W) {
@@ -283,7 +283,7 @@ class SPSSerializationTraits<SPSMemoryAccessUIntWrite<T>,
 };
 
 template <>
-class SPSSerializationTraits<SPSMemoryAccessBufferWrite,
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSMemoryAccessBufferWrite,
                              tpctypes::BufferWrite> {
 public:
   static size_t size(const tpctypes::BufferWrite &W) {
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h
index 39b2a54d06a536d..37b1d626462f04a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h
@@ -31,14 +31,14 @@ union CWrapperFunctionResultDataUnion {
 };
 
 // Must be kept in-sync with compiler-rt/lib/orc/c-api.h.
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   CWrapperFunctionResultDataUnion Data;
   size_t Size;
 } CWrapperFunctionResult;
 
 /// C++ wrapper function result: Same as CWrapperFunctionResult but
 /// auto-releases memory.
-class WrapperFunctionResult {
+class LLVM_CLASS_ABI WrapperFunctionResult {
 public:
   /// Create a default WrapperFunctionResult.
   WrapperFunctionResult() { init(R); }
@@ -180,7 +180,7 @@ serializeViaSPSToWrapperFunctionResult(const ArgTs &...Args) {
   return Result;
 }
 
-template <typename RetT> class WrapperFunctionHandlerCaller {
+template <typename RetT> class LLVM_CLASS_ABI WrapperFunctionHandlerCaller {
 public:
   template <typename HandlerT, typename ArgTupleT, std::size_t... I>
   static decltype(auto) call(HandlerT &&H, ArgTupleT &Args,
@@ -189,7 +189,7 @@ template <typename RetT> class WrapperFunctionHandlerCaller {
   }
 };
 
-template <> class WrapperFunctionHandlerCaller<void> {
+template <> class LLVM_CLASS_ABI WrapperFunctionHandlerCaller<void> {
 public:
   template <typename HandlerT, typename ArgTupleT, std::size_t... I>
   static SPSEmpty call(HandlerT &&H, ArgTupleT &Args,
@@ -201,14 +201,14 @@ template <> class WrapperFunctionHandlerCaller<void> {
 
 template <typename WrapperFunctionImplT,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionHandlerHelper
+class LLVM_CLASS_ABI WrapperFunctionHandlerHelper
     : public WrapperFunctionHandlerHelper<
           decltype(&std::remove_reference_t<WrapperFunctionImplT>::operator()),
           ResultSerializer, SPSTagTs...> {};
 
 template <typename RetT, typename... ArgTs,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionHandlerHelper<RetT(ArgTs...), ResultSerializer,
+class LLVM_CLASS_ABI WrapperFunctionHandlerHelper<RetT(ArgTs...), ResultSerializer,
                                    SPSTagTs...> {
 public:
   using ArgTuple = std::tuple<std::decay_t<ArgTs>...>;
@@ -241,7 +241,7 @@ class WrapperFunctionHandlerHelper<RetT(ArgTs...), ResultSerializer,
 // Map function pointers to function types.
 template <typename RetT, typename... ArgTs,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionHandlerHelper<RetT (*)(ArgTs...), ResultSerializer,
+class LLVM_CLASS_ABI WrapperFunctionHandlerHelper<RetT (*)(ArgTs...), ResultSerializer,
                                    SPSTagTs...>
     : public WrapperFunctionHandlerHelper<RetT(ArgTs...), ResultSerializer,
                                           SPSTagTs...> {};
@@ -249,7 +249,7 @@ class WrapperFunctionHandlerHelper<RetT (*)(ArgTs...), ResultSerializer,
 // Map non-const member function types to function types.
 template <typename ClassT, typename RetT, typename... ArgTs,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionHandlerHelper<RetT (ClassT::*)(ArgTs...), ResultSerializer,
+class LLVM_CLASS_ABI WrapperFunctionHandlerHelper<RetT (ClassT::*)(ArgTs...), ResultSerializer,
                                    SPSTagTs...>
     : public WrapperFunctionHandlerHelper<RetT(ArgTs...), ResultSerializer,
                                           SPSTagTs...> {};
@@ -257,21 +257,21 @@ class WrapperFunctionHandlerHelper<RetT (ClassT::*)(ArgTs...), ResultSerializer,
 // Map const member function types to function types.
 template <typename ClassT, typename RetT, typename... ArgTs,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionHandlerHelper<RetT (ClassT::*)(ArgTs...) const,
+class LLVM_CLASS_ABI WrapperFunctionHandlerHelper<RetT (ClassT::*)(ArgTs...) const,
                                    ResultSerializer, SPSTagTs...>
     : public WrapperFunctionHandlerHelper<RetT(ArgTs...), ResultSerializer,
                                           SPSTagTs...> {};
 
 template <typename WrapperFunctionImplT,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionAsyncHandlerHelper
+class LLVM_CLASS_ABI WrapperFunctionAsyncHandlerHelper
     : public WrapperFunctionAsyncHandlerHelper<
           decltype(&std::remove_reference_t<WrapperFunctionImplT>::operator()),
           ResultSerializer, SPSTagTs...> {};
 
 template <typename RetT, typename SendResultT, typename... ArgTs,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionAsyncHandlerHelper<RetT(SendResultT, ArgTs...),
+class LLVM_CLASS_ABI WrapperFunctionAsyncHandlerHelper<RetT(SendResultT, ArgTs...),
                                         ResultSerializer, SPSTagTs...> {
 public:
   using ArgTuple = std::tuple<std::decay_t<ArgTs>...>;
@@ -320,7 +320,7 @@ class WrapperFunctionAsyncHandlerHelper<RetT(SendResultT, ArgTs...),
 // Map function pointers to function types.
 template <typename RetT, typename... ArgTs,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionAsyncHandlerHelper<RetT (*)(ArgTs...), ResultSerializer,
+class LLVM_CLASS_ABI WrapperFunctionAsyncHandlerHelper<RetT (*)(ArgTs...), ResultSerializer,
                                         SPSTagTs...>
     : public WrapperFunctionAsyncHandlerHelper<RetT(ArgTs...), ResultSerializer,
                                                SPSTagTs...> {};
@@ -328,7 +328,7 @@ class WrapperFunctionAsyncHandlerHelper<RetT (*)(ArgTs...), ResultSerializer,
 // Map non-const member function types to function types.
 template <typename ClassT, typename RetT, typename... ArgTs,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionAsyncHandlerHelper<RetT (ClassT::*)(ArgTs...),
+class LLVM_CLASS_ABI WrapperFunctionAsyncHandlerHelper<RetT (ClassT::*)(ArgTs...),
                                         ResultSerializer, SPSTagTs...>
     : public WrapperFunctionAsyncHandlerHelper<RetT(ArgTs...), ResultSerializer,
                                                SPSTagTs...> {};
@@ -336,12 +336,12 @@ class WrapperFunctionAsyncHandlerHelper<RetT (ClassT::*)(ArgTs...),
 // Map const member function types to function types.
 template <typename ClassT, typename RetT, typename... ArgTs,
           template <typename> class ResultSerializer, typename... SPSTagTs>
-class WrapperFunctionAsyncHandlerHelper<RetT (ClassT::*)(ArgTs...) const,
+class LLVM_CLASS_ABI WrapperFunctionAsyncHandlerHelper<RetT (ClassT::*)(ArgTs...) const,
                                         ResultSerializer, SPSTagTs...>
     : public WrapperFunctionAsyncHandlerHelper<RetT(ArgTs...), ResultSerializer,
                                                SPSTagTs...> {};
 
-template <typename SPSRetTagT, typename RetT> class ResultSerializer {
+template <typename SPSRetTagT, typename RetT> class LLVM_CLASS_ABI ResultSerializer {
 public:
   static WrapperFunctionResult serialize(RetT Result) {
     return serializeViaSPSToWrapperFunctionResult<SPSArgList<SPSRetTagT>>(
@@ -349,7 +349,7 @@ template <typename SPSRetTagT, typename RetT> class ResultSerializer {
   }
 };
 
-template <typename SPSRetTagT> class ResultSerializer<SPSRetTagT, Error> {
+template <typename SPSRetTagT> class LLVM_CLASS_ABI ResultSerializer<SPSRetTagT, Error> {
 public:
   static WrapperFunctionResult serialize(Error Err) {
     return serializeViaSPSToWrapperFunctionResult<SPSArgList<SPSRetTagT>>(
@@ -358,7 +358,7 @@ template <typename SPSRetTagT> class ResultSerializer<SPSRetTagT, Error> {
 };
 
 template <typename SPSRetTagT>
-class ResultSerializer<SPSRetTagT, ErrorSuccess> {
+class LLVM_CLASS_ABI ResultSerializer<SPSRetTagT, ErrorSuccess> {
 public:
   static WrapperFunctionResult serialize(ErrorSuccess Err) {
     return serializeViaSPSToWrapperFunctionResult<SPSArgList<SPSRetTagT>>(
@@ -367,7 +367,7 @@ class ResultSerializer<SPSRetTagT, ErrorSuccess> {
 };
 
 template <typename SPSRetTagT, typename T>
-class ResultSerializer<SPSRetTagT, Expected<T>> {
+class LLVM_CLASS_ABI ResultSerializer<SPSRetTagT, Expected<T>> {
 public:
   static WrapperFunctionResult serialize(Expected<T> E) {
     return serializeViaSPSToWrapperFunctionResult<SPSArgList<SPSRetTagT>>(
@@ -375,7 +375,7 @@ class ResultSerializer<SPSRetTagT, Expected<T>> {
   }
 };
 
-template <typename SPSRetTagT, typename RetT> class ResultDeserializer {
+template <typename SPSRetTagT, typename RetT> class LLVM_CLASS_ABI ResultDeserializer {
 public:
   static RetT makeValue() { return RetT(); }
   static void makeSafe(RetT &Result) {}
@@ -390,7 +390,7 @@ template <typename SPSRetTagT, typename RetT> class ResultDeserializer {
   }
 };
 
-template <> class ResultDeserializer<SPSError, Error> {
+template <> class LLVM_CLASS_ABI ResultDeserializer<SPSError, Error> {
 public:
   static Error makeValue() { return Error::success(); }
   static void makeSafe(Error &Err) { cantFail(std::move(Err)); }
@@ -408,7 +408,7 @@ template <> class ResultDeserializer<SPSError, Error> {
 };
 
 template <typename SPSTagT, typename T>
-class ResultDeserializer<SPSExpected<SPSTagT>, Expected<T>> {
+class LLVM_CLASS_ABI ResultDeserializer<SPSExpected<SPSTagT>, Expected<T>> {
 public:
   static Expected<T> makeValue() { return T(); }
   static void makeSafe(Expected<T> &E) { cantFail(E.takeError()); }
@@ -426,7 +426,7 @@ class ResultDeserializer<SPSExpected<SPSTagT>, Expected<T>> {
   }
 };
 
-template <typename SPSRetTagT, typename RetT> class AsyncCallResultHelper {
+template <typename SPSRetTagT, typename RetT> class LLVM_CLASS_ABI AsyncCallResultHelper {
   // Did you forget to use Error / Expected in your handler?
 };
 
@@ -435,7 +435,7 @@ template <typename SPSRetTagT, typename RetT> class AsyncCallResultHelper {
 template <typename SPSSignature> class WrapperFunction;
 
 template <typename SPSRetTagT, typename... SPSTagTs>
-class WrapperFunction<SPSRetTagT(SPSTagTs...)> {
+class LLVM_CLASS_ABI WrapperFunction<SPSRetTagT(SPSTagTs...)> {
 private:
   template <typename RetT>
   using ResultSerializer = detail::ResultSerializer<SPSRetTagT, RetT>;
@@ -549,7 +549,7 @@ class WrapperFunction<SPSRetTagT(SPSTagTs...)> {
 };
 
 template <typename... SPSTagTs>
-class WrapperFunction<void(SPSTagTs...)>
+class LLVM_CLASS_ABI WrapperFunction<void(SPSTagTs...)>
     : private WrapperFunction<SPSEmpty(SPSTagTs...)> {
 
 public:
@@ -600,7 +600,7 @@ class WrapperFunction<void(SPSTagTs...)>
 ///   @endcode
 ///
 template <typename RetT, typename ClassT, typename... ArgTs>
-class MethodWrapperHandler {
+class LLVM_CLASS_ABI MethodWrapperHandler {
 public:
   using MethodT = RetT (ClassT::*)(ArgTs...);
   MethodWrapperHandler(MethodT M) : M(M) {}
@@ -626,7 +626,7 @@ makeMethodWrapperHandler(RetT (ClassT::*Method)(ArgTs...)) {
 /// The motivating use-case for this API is JITLink allocation actions, where
 /// we want to run multiple functions to finalize linked memory without having
 /// to make separate IPC calls for each one.
-class WrapperFunctionCall {
+class LLVM_CLASS_ABI WrapperFunctionCall {
 public:
   using ArgDataBufferType = SmallVector<char, 24>;
 
@@ -709,7 +709,7 @@ class WrapperFunctionCall {
 using SPSWrapperFunctionCall = SPSTuple<SPSExecutorAddr, SPSSequence<char>>;
 
 template <>
-class SPSSerializationTraits<SPSWrapperFunctionCall, WrapperFunctionCall> {
+class LLVM_CLASS_ABI SPSSerializationTraits<SPSWrapperFunctionCall, WrapperFunctionCall> {
 public:
   static size_t size(const WrapperFunctionCall &WFC) {
     return SPSWrapperFunctionCall::AsArgList::size(WFC.getCallee(),
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h b/llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
index a1ddf4ccb0ae883..a233187e857c298 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SimpleRemoteEPC.h
@@ -29,7 +29,7 @@
 namespace llvm {
 namespace orc {
 
-class SimpleRemoteEPC : public ExecutorProcessControl,
+class LLVM_CLASS_ABI SimpleRemoteEPC : public ExecutorProcessControl,
                         public SimpleRemoteEPCTransportClient {
 public:
   /// A setup object containing callbacks to construct a memory manager and
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h b/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
index fad9dc5c0b9d377..ae0ef6ba115943f 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
@@ -25,7 +25,7 @@ namespace llvm {
 namespace orc {
 
 // Provides common code.
-class SpeculateQuery {
+class LLVM_CLASS_ABI SpeculateQuery {
 protected:
   void findCalles(const BasicBlock *, DenseSet<StringRef> &);
   bool isStraightLine(const Function &F);
@@ -35,7 +35,7 @@ class SpeculateQuery {
 };
 
 // Direct calls in high frequency basic blocks are extracted.
-class BlockFreqQuery : public SpeculateQuery {
+class LLVM_CLASS_ABI BlockFreqQuery : public SpeculateQuery {
   size_t numBBToGet(size_t);
 
 public:
@@ -47,7 +47,7 @@ class BlockFreqQuery : public SpeculateQuery {
 // execution.
 // A handful of BB with higher block frequencies are taken, then path to entry
 // and end BB are discovered by traversing up & down the CFG.
-class SequenceBBQuery : public SpeculateQuery {
+class LLVM_CLASS_ABI SequenceBBQuery : public SpeculateQuery {
   struct WalkDirection {
     bool Upward = true, Downward = true;
     // the block associated contain a call
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h b/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
index 54ba127bb8b3695..964c09e4872745a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
@@ -32,7 +32,7 @@ class Speculator;
 // trampolines are created. Operations are guarded by locks tp ensure that Imap
 // stays in consistent state after read/write
 
-class ImplSymbolMap {
+class LLVM_CLASS_ABI ImplSymbolMap {
   friend class Speculator;
 
 public:
@@ -58,7 +58,7 @@ class ImplSymbolMap {
 };
 
 // Defines Speculator Concept,
-class Speculator {
+class LLVM_CLASS_ABI Speculator {
 public:
   using TargetFAddr = ExecutorAddr;
   using FunctionCandidatesMap = DenseMap<SymbolStringPtr, SymbolNameSet>;
@@ -169,7 +169,7 @@ class Speculator {
   StubAddrLikelies GlobalSpecMap;
 };
 
-class IRSpeculationLayer : public IRLayer {
+class LLVM_CLASS_ABI IRSpeculationLayer : public IRLayer {
 public:
   using IRlikiesStrRef =
       std::optional<DenseMap<StringRef, DenseSet<StringRef>>>;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
index 7395f47a7e3c884..7c8dd0b029cf58a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
@@ -30,12 +30,12 @@ class SymbolStringPtr;
 class NonOwningSymbolStringPtr;
 
 /// String pool for symbol names used by the JIT.
-class SymbolStringPool {
+class LLVM_CLASS_ABI SymbolStringPool {
   friend class SymbolStringPoolTest;
   friend class SymbolStringPtrBase;
 
   // Implemented in DebugUtils.h.
-  friend raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPool &SSP);
+  friend LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SymbolStringPool &SSP);
 
 public:
   /// Destroy a SymbolStringPool.
@@ -67,7 +67,7 @@ class SymbolStringPool {
 ///
 /// SymbolStringPtrBases are default-constructible and constructible
 /// from nullptr to enable comparison with these values.
-class SymbolStringPtrBase {
+class LLVM_CLASS_ABI SymbolStringPtrBase {
   friend class SymbolStringPool;
   friend struct DenseMapInfo<SymbolStringPtr>;
   friend struct DenseMapInfo<NonOwningSymbolStringPtr>;
@@ -134,7 +134,7 @@ class SymbolStringPtrBase {
 };
 
 /// Pointer to a pooled string representing a symbol name.
-class SymbolStringPtr : public SymbolStringPtrBase {
+class LLVM_CLASS_ABI SymbolStringPtr : public SymbolStringPtrBase {
   friend class OrcV2CAPIHelper;
   friend class SymbolStringPool;
   friend struct DenseMapInfo<SymbolStringPtr>;
@@ -202,7 +202,7 @@ class SymbolStringPtr : public SymbolStringPtrBase {
 /// represented by SymbolStringPtrs the edges can be represented by pairs of
 /// NonOwningSymbolStringPtrs and this will make the introduction of deletion
 /// of edges cheaper.
-class NonOwningSymbolStringPtr : public SymbolStringPtrBase {
+class LLVM_CLASS_ABI NonOwningSymbolStringPtr : public SymbolStringPtrBase {
   friend struct DenseMapInfo<orc::NonOwningSymbolStringPtr>;
 
 public:
@@ -272,7 +272,7 @@ SymbolStringPool::getRefCount(const SymbolStringPtrBase &S) const {
 } // end namespace orc
 
 template <>
-struct DenseMapInfo<orc::SymbolStringPtr> {
+struct LLVM_CLASS_ABI DenseMapInfo<orc::SymbolStringPtr> {
 
   static orc::SymbolStringPtr getEmptyKey() {
     return orc::SymbolStringPtr::getEmptyVal();
@@ -292,7 +292,7 @@ struct DenseMapInfo<orc::SymbolStringPtr> {
   }
 };
 
-template <> struct DenseMapInfo<orc::NonOwningSymbolStringPtr> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<orc::NonOwningSymbolStringPtr> {
 
   static orc::NonOwningSymbolStringPtr getEmptyKey() {
     return orc::NonOwningSymbolStringPtr::getEmptyVal();
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h
index 1dd604566661269..66eab6ae1bba651 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorBootstrapService.h
@@ -22,7 +22,7 @@
 namespace llvm {
 namespace orc {
 
-class ExecutorBootstrapService {
+class LLVM_CLASS_ABI ExecutorBootstrapService {
 public:
   virtual ~ExecutorBootstrapService();
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h
index e63d68b43d29868..525b52320d40792 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h
@@ -25,7 +25,7 @@ namespace llvm {
 namespace orc {
 namespace rt_bootstrap {
 
-class ExecutorSharedMemoryMapperService final
+class LLVM_CLASS_ABI ExecutorSharedMemoryMapperService final
     : public ExecutorBootstrapService {
 public:
   ~ExecutorSharedMemoryMapperService(){};
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h
index e6cdee0e535d7e1..6a4306c89f4e510 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h
@@ -17,10 +17,10 @@
 #include "llvm/Support/Compiler.h"
 #include <cstdint>
 
-extern "C" llvm::orc::shared::CWrapperFunctionResult
+extern "C" LLVM_FUNC_ABI llvm::orc::shared::CWrapperFunctionResult
 llvm_orc_registerJITLoaderGDBWrapper(const char *Data, uint64_t Size);
 
-extern "C" llvm::orc::shared::CWrapperFunctionResult
+extern "C" LLVM_FUNC_ABI llvm::orc::shared::CWrapperFunctionResult
 llvm_orc_registerJITLoaderGDBAllocAction(const char *Data, size_t Size);
 
 #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
index 2421c8e54f4ad75..c36bb88471546b7 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h
@@ -24,20 +24,20 @@ namespace llvm {
 namespace orc {
 
 /// Register frames in the given eh-frame section with libunwind.
-Error registerEHFrameSection(const void *EHFrameSectionAddr,
+LLVM_FUNC_ABI Error registerEHFrameSection(const void *EHFrameSectionAddr,
                              size_t EHFrameSectionSize);
 
 /// Unregister frames in the given eh-frame section with libunwind.
-Error deregisterEHFrameSection(const void *EHFrameSectionAddr,
+LLVM_FUNC_ABI Error deregisterEHFrameSection(const void *EHFrameSectionAddr,
                                size_t EHFrameSectionSize);
 
 } // end namespace orc
 } // end namespace llvm
 
-extern "C" llvm::orc::shared::CWrapperFunctionResult
+extern "C" LLVM_FUNC_ABI llvm::orc::shared::CWrapperFunctionResult
 llvm_orc_registerEHFrameSectionWrapper(const char *Data, uint64_t Size);
 
-extern "C" llvm::orc::shared::CWrapperFunctionResult
+extern "C" LLVM_FUNC_ABI llvm::orc::shared::CWrapperFunctionResult
 llvm_orc_deregisterEHFrameSectionWrapper(const char *Data, uint64_t Size);
 
 #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h
index 1e2107c9bd69f2a..a903f0c553fc3db 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorDylibManager.h
@@ -33,7 +33,7 @@ namespace orc {
 namespace rt_bootstrap {
 
 /// Simple page-based allocator.
-class SimpleExecutorDylibManager : public ExecutorBootstrapService {
+class LLVM_CLASS_ABI SimpleExecutorDylibManager : public ExecutorBootstrapService {
 public:
   virtual ~SimpleExecutorDylibManager();
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h
index 2d99a8ac76c36b1..e1c2bd51d2a94e6 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleExecutorMemoryManager.h
@@ -30,7 +30,7 @@ namespace orc {
 namespace rt_bootstrap {
 
 /// Simple page-based allocator.
-class SimpleExecutorMemoryManager : public ExecutorBootstrapService {
+class LLVM_CLASS_ABI SimpleExecutorMemoryManager : public ExecutorBootstrapService {
 public:
   virtual ~SimpleExecutorMemoryManager();
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
index d19c26f206789b6..762c2a66548b773 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/SimpleRemoteEPCServer.h
@@ -34,7 +34,7 @@ namespace llvm {
 namespace orc {
 
 /// A simple EPC server implementation.
-class SimpleRemoteEPCServer : public SimpleRemoteEPCTransportClient {
+class LLVM_CLASS_ABI SimpleRemoteEPCServer : public SimpleRemoteEPCTransportClient {
 public:
   using ReportErrorFunction = unique_function<void(Error)>;
 
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
index f8449aae2864625..de5d590fe6e2997 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.h
@@ -29,11 +29,11 @@ namespace orc {
 /// It is legal to have an empty argument list and no program name, however
 /// many main functions will expect a name argument at least, and will fail
 /// if none is provided.
-int runAsMain(int (*Main)(int, char *[]), ArrayRef<std::string> Args,
+LLVM_FUNC_ABI int runAsMain(int (*Main)(int, char *[]), ArrayRef<std::string> Args,
               std::optional<StringRef> ProgramName = std::nullopt);
 
-int runAsVoidFunction(int (*Func)(void));
-int runAsIntFunction(int (*Func)(int), int Arg);
+LLVM_FUNC_ABI int runAsVoidFunction(int (*Func)(void));
+LLVM_FUNC_ABI int runAsIntFunction(int (*Func)(int), int Arg);
 
 } // end namespace orc
 } // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
index bd5d98d9f4f2e8b..4734888ad9b61fd 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/TaskDispatch.h
@@ -32,7 +32,7 @@ namespace llvm {
 namespace orc {
 
 /// Represents an abstract task for ORC to run.
-class Task : public RTTIExtends<Task, RTTIRoot> {
+class LLVM_CLASS_ABI Task : public RTTIExtends<Task, RTTIRoot> {
 public:
   static char ID;
 
@@ -49,14 +49,14 @@ class Task : public RTTIExtends<Task, RTTIRoot> {
 };
 
 /// Base class for generic tasks.
-class GenericNamedTask : public RTTIExtends<GenericNamedTask, Task> {
+class LLVM_CLASS_ABI GenericNamedTask : public RTTIExtends<GenericNamedTask, Task> {
 public:
   static char ID;
   static const char *DefaultDescription;
 };
 
 /// Generic task implementation.
-template <typename FnT> class GenericNamedTaskImpl : public GenericNamedTask {
+template <typename FnT> class LLVM_CLASS_ABI GenericNamedTaskImpl : public GenericNamedTask {
 public:
   GenericNamedTaskImpl(FnT &&Fn, std::string DescBuffer)
       : Fn(std::forward<FnT>(Fn)), Desc(DescBuffer.c_str()),
@@ -93,7 +93,7 @@ makeGenericNamedTask(FnT &&Fn, const char *Desc = nullptr) {
 }
 
 /// Abstract base for classes that dispatch ORC Tasks.
-class TaskDispatcher {
+class LLVM_CLASS_ABI TaskDispatcher {
 public:
   virtual ~TaskDispatcher();
 
@@ -105,7 +105,7 @@ class TaskDispatcher {
 };
 
 /// Runs all tasks on the current thread.
-class InPlaceTaskDispatcher : public TaskDispatcher {
+class LLVM_CLASS_ABI InPlaceTaskDispatcher : public TaskDispatcher {
 public:
   void dispatch(std::unique_ptr<Task> T) override;
   void shutdown() override;
@@ -113,7 +113,7 @@ class InPlaceTaskDispatcher : public TaskDispatcher {
 
 #if LLVM_ENABLE_THREADS
 
-class DynamicThreadPoolTaskDispatcher : public TaskDispatcher {
+class LLVM_CLASS_ABI DynamicThreadPoolTaskDispatcher : public TaskDispatcher {
 public:
   void dispatch(std::unique_ptr<Task> T) override;
   void shutdown() override;
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h b/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h
index 8ebbf8b3123ab50..b6d446f9217d4aa 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h
@@ -26,7 +26,7 @@ namespace orc {
 
 /// An LLVMContext together with an associated mutex that can be used to lock
 /// the context to prevent concurrent access by other threads.
-class ThreadSafeContext {
+class LLVM_CLASS_ABI ThreadSafeContext {
 private:
   struct State {
     State(std::unique_ptr<LLVMContext> Ctx) : Ctx(std::move(Ctx)) {}
@@ -74,7 +74,7 @@ class ThreadSafeContext {
 };
 
 /// An LLVM Module together with a shared ThreadSafeContext.
-class ThreadSafeModule {
+class LLVM_CLASS_ABI ThreadSafeModule {
 public:
   /// Default construct a ThreadSafeModule. This results in a null module and
   /// null context.
@@ -170,7 +170,7 @@ using GVPredicate = std::function<bool(const GlobalValue &)>;
 using GVModifier = std::function<void(GlobalValue &)>;
 
 /// Clones the given module on to a new context.
-ThreadSafeModule
+LLVM_FUNC_ABI ThreadSafeModule
 cloneToNewContext(const ThreadSafeModule &TSMW,
                   GVPredicate ShouldCloneDef = GVPredicate(),
                   GVModifier UpdateClonedDefSource = GVModifier());
diff --git a/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h b/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
index d71fb82d85d2b96..d01e1565bd677cf 100644
--- a/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/RTDyldMemoryManager.h
@@ -30,7 +30,7 @@ namespace object {
   class ObjectFile;
 } // end namespace object
 
-class MCJITMemoryManager : public RuntimeDyld::MemoryManager {
+class LLVM_CLASS_ABI MCJITMemoryManager : public RuntimeDyld::MemoryManager {
 public:
   // Don't hide the notifyObjectLoaded method from RuntimeDyld::MemoryManager.
   using RuntimeDyld::MemoryManager::notifyObjectLoaded;
@@ -58,7 +58,7 @@ class MCJITMemoryManager : public RuntimeDyld::MemoryManager {
 //
 // FIXME: As the RuntimeDyld fills out, additional routines will be needed
 //        for the varying types of objects to be allocated.
-class RTDyldMemoryManager : public MCJITMemoryManager,
+class LLVM_CLASS_ABI RTDyldMemoryManager : public MCJITMemoryManager,
                             public LegacyJITSymbolResolver {
 public:
   RTDyldMemoryManager() = default;
diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
index 1248205f8f54a7d..f07aafd31ce8975 100644
--- a/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
+++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
@@ -40,7 +40,7 @@ template <typename T> class OwningBinary;
 
 /// Base class for errors originating in RuntimeDyld, e.g. missing relocation
 /// support.
-class RuntimeDyldError : public ErrorInfo<RuntimeDyldError> {
+class LLVM_CLASS_ABI RuntimeDyldError : public ErrorInfo<RuntimeDyldError> {
 public:
   static char ID;
 
@@ -56,7 +56,7 @@ class RuntimeDyldError : public ErrorInfo<RuntimeDyldError> {
 
 class RuntimeDyldImpl;
 
-class RuntimeDyld {
+class LLVM_CLASS_ABI RuntimeDyld {
 public:
   // Change the address associated with a section when resolving relocations.
   // Any relocations already associated with the symbol will be re-resolved.
@@ -285,7 +285,7 @@ class RuntimeDyld {
   void finalizeWithMemoryManagerLocking();
 
 private:
-  friend void jitLinkForORC(
+  friend LLVM_FUNC_ABI void jitLinkForORC(
       object::OwningBinary<object::ObjectFile> O,
       RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver,
       bool ProcessAllSections,
@@ -311,7 +311,7 @@ class RuntimeDyld {
 // but ORC's RTDyldObjectLinkingLayer2. Internally it constructs a RuntimeDyld
 // instance and uses continuation passing to perform the fix-up and finalize
 // steps asynchronously.
-void jitLinkForORC(
+LLVM_FUNC_ABI void jitLinkForORC(
     object::OwningBinary<object::ObjectFile> O,
     RuntimeDyld::MemoryManager &MemMgr, JITSymbolResolver &Resolver,
     bool ProcessAllSections,
diff --git a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
index f4cc4fb6deca85a..f79c4a0cce36b03 100644
--- a/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
+++ b/llvm/include/llvm/ExecutionEngine/RuntimeDyldChecker.h
@@ -72,7 +72,7 @@ class raw_ostream;
 ///             | expr '<<' expr
 ///             | expr '>>' expr
 ///
-class RuntimeDyldChecker {
+class LLVM_CLASS_ABI RuntimeDyldChecker {
 public:
   class MemoryRegionInfo {
   public:
diff --git a/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h b/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h
index e1e0f8f4cb1f08b..b097eb929cccbc5 100644
--- a/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h
+++ b/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h
@@ -37,7 +37,7 @@ namespace llvm {
 /// in the JITed object.  Permissions can be applied either by calling
 /// MCJIT::finalizeObject or by calling SectionMemoryManager::finalizeMemory
 /// directly.  Clients of MCJIT should call MCJIT::finalizeObject.
-class SectionMemoryManager : public RTDyldMemoryManager {
+class LLVM_CLASS_ABI SectionMemoryManager : public RTDyldMemoryManager {
 public:
   /// This enum describes the various reasons to allocate pages from
   /// allocateMappedMemory.
diff --git a/llvm/include/llvm/FileCheck/FileCheck.h b/llvm/include/llvm/FileCheck/FileCheck.h
index 018f20dec22e6bf..3ccdfa1cea6d1f9 100644
--- a/llvm/include/llvm/FileCheck/FileCheck.h
+++ b/llvm/include/llvm/FileCheck/FileCheck.h
@@ -28,7 +28,7 @@ class SourceMgr;
 template <typename T> class SmallVectorImpl;
 
 /// Contains info about various FileCheck options.
-struct FileCheckRequest {
+struct LLVM_CLASS_ABI FileCheckRequest {
   std::vector<StringRef> CheckPrefixes;
   std::vector<StringRef> CommentPrefixes;
   bool NoCanonicalizeWhiteSpace = false;
@@ -78,7 +78,7 @@ enum FileCheckKindModifier {
   Size
 };
 
-class FileCheckType {
+class LLVM_CLASS_ABI FileCheckType {
   FileCheckKind Kind;
   int Count; ///< optional Count for some checks
   /// Modifers for the check directive.
@@ -111,7 +111,7 @@ class FileCheckType {
 } // namespace Check
 
 /// Summary of a FileCheck diagnostic.
-struct FileCheckDiag {
+struct LLVM_CLASS_ABI FileCheckDiag {
   /// What is the FileCheck directive for this diagnostic?
   Check::FileCheckType CheckTy;
   /// Where is the FileCheck directive for this diagnostic?
@@ -178,7 +178,7 @@ struct FileCheckString;
 
 /// FileCheck class takes the request and exposes various methods that
 /// use information from the request.
-class FileCheck {
+class LLVM_CLASS_ABI FileCheck {
   FileCheckRequest Req;
   std::unique_ptr<FileCheckPatternContext> PatternContext;
   // C++17 TODO: make this a plain std::vector.
diff --git a/llvm/include/llvm/Frontend/HLSL/HLSLResource.h b/llvm/include/llvm/Frontend/HLSL/HLSLResource.h
index 121a969de429a87..dc5d9f7b2a517ba 100644
--- a/llvm/include/llvm/Frontend/HLSL/HLSLResource.h
+++ b/llvm/include/llvm/Frontend/HLSL/HLSLResource.h
@@ -55,7 +55,7 @@ enum class ResourceKind : uint32_t {
   NumEntries,
 };
 
-class FrontendResource {
+class LLVM_CLASS_ABI FrontendResource {
   MDNode *Entry;
 
 public:
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPContext.h b/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
index 47f621a84ed4381..9e5a1029454f6a2 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
@@ -50,54 +50,54 @@ enum class TraitProperty {
 };
 
 /// Parse \p Str and return the trait set it matches or TraitSet::invalid.
-TraitSet getOpenMPContextTraitSetKind(StringRef Str);
+LLVM_FUNC_ABI TraitSet getOpenMPContextTraitSetKind(StringRef Str);
 
 /// Return the trait set for which \p Selector is a selector.
-TraitSet getOpenMPContextTraitSetForSelector(TraitSelector Selector);
+LLVM_FUNC_ABI TraitSet getOpenMPContextTraitSetForSelector(TraitSelector Selector);
 
 /// Return the trait set for which \p Property is a property.
-TraitSet getOpenMPContextTraitSetForProperty(TraitProperty Property);
+LLVM_FUNC_ABI TraitSet getOpenMPContextTraitSetForProperty(TraitProperty Property);
 
 /// Return a textual representation of the trait set \p Kind.
-StringRef getOpenMPContextTraitSetName(TraitSet Kind);
+LLVM_FUNC_ABI StringRef getOpenMPContextTraitSetName(TraitSet Kind);
 
 /// Parse \p Str and return the trait set it matches or
 /// TraitSelector::invalid.
-TraitSelector getOpenMPContextTraitSelectorKind(StringRef Str);
+LLVM_FUNC_ABI TraitSelector getOpenMPContextTraitSelectorKind(StringRef Str);
 
 /// Return the trait selector for which \p Property is a property.
-TraitSelector getOpenMPContextTraitSelectorForProperty(TraitProperty Property);
+LLVM_FUNC_ABI TraitSelector getOpenMPContextTraitSelectorForProperty(TraitProperty Property);
 
 /// Return a textual representation of the trait selector \p Kind.
-StringRef getOpenMPContextTraitSelectorName(TraitSelector Kind);
+LLVM_FUNC_ABI StringRef getOpenMPContextTraitSelectorName(TraitSelector Kind);
 
 /// Parse \p Str and return the trait property it matches in the set \p Set and
 /// selector \p Selector or TraitProperty::invalid.
-TraitProperty getOpenMPContextTraitPropertyKind(TraitSet Set,
+LLVM_FUNC_ABI TraitProperty getOpenMPContextTraitPropertyKind(TraitSet Set,
                                                 TraitSelector Selector,
                                                 StringRef Str);
 
 /// Return the trait property for a singleton selector \p Selector.
-TraitProperty getOpenMPContextTraitPropertyForSelector(TraitSelector Selector);
+LLVM_FUNC_ABI TraitProperty getOpenMPContextTraitPropertyForSelector(TraitSelector Selector);
 
 /// Return a textual representation of the trait property \p Kind, which might
 /// be the raw string we parsed (\p RawString) if we do not translate the
 /// property into a (distinct) enum.
-StringRef getOpenMPContextTraitPropertyName(TraitProperty Kind,
+LLVM_FUNC_ABI StringRef getOpenMPContextTraitPropertyName(TraitProperty Kind,
                                             StringRef RawString);
 
 /// Return a textual representation of the trait property \p Kind with selector
 /// and set name included.
-StringRef getOpenMPContextTraitPropertyFullName(TraitProperty Kind);
+LLVM_FUNC_ABI StringRef getOpenMPContextTraitPropertyFullName(TraitProperty Kind);
 
 /// Return a string listing all trait sets.
-std::string listOpenMPContextTraitSets();
+LLVM_FUNC_ABI std::string listOpenMPContextTraitSets();
 
 /// Return a string listing all trait selectors for \p Set.
-std::string listOpenMPContextTraitSelectors(TraitSet Set);
+LLVM_FUNC_ABI std::string listOpenMPContextTraitSelectors(TraitSet Set);
 
 /// Return a string listing all trait properties for \p Set and \p Selector.
-std::string listOpenMPContextTraitProperties(TraitSet Set,
+LLVM_FUNC_ABI std::string listOpenMPContextTraitProperties(TraitSet Set,
                                              TraitSelector Selector);
 ///}
 
@@ -105,19 +105,19 @@ std::string listOpenMPContextTraitProperties(TraitSet Set,
 /// \p AllowsTraitScore and \p RequiresProperty to true/false if the user can
 /// specify a score for properties in \p Selector and if the \p Selector
 /// requires at least one property.
-bool isValidTraitSelectorForTraitSet(TraitSelector Selector, TraitSet Set,
+LLVM_FUNC_ABI bool isValidTraitSelectorForTraitSet(TraitSelector Selector, TraitSet Set,
                                      bool &AllowsTraitScore,
                                      bool &RequiresProperty);
 
 /// Return true if \p Property can be nested in \p Selector and \p Set.
-bool isValidTraitPropertyForTraitSetAndSelector(TraitProperty Property,
+LLVM_FUNC_ABI bool isValidTraitPropertyForTraitSetAndSelector(TraitProperty Property,
                                                 TraitSelector Selector,
                                                 TraitSet Set);
 
 /// Variant match information describes the required traits and how they are
 /// scored (via the ScoresMap). In addition, the required consturct nesting is
 /// decribed as well.
-struct VariantMatchInfo {
+struct LLVM_CLASS_ABI VariantMatchInfo {
   /// Add the trait \p Property to the required trait set. \p RawString is the
   /// string we parsed and derived \p Property from. If \p Score is not null, it
   /// recorded as well. If \p Property is in the `construct` set it is recorded
@@ -155,7 +155,7 @@ struct VariantMatchInfo {
 /// The context for a source location is made up of active property traits,
 /// e.g., device={kind(host)}, and constructs traits which describe the nesting
 /// in OpenMP constructs at the location.
-struct OMPContext {
+struct LLVM_CLASS_ABI OMPContext {
   OMPContext(bool IsDeviceCompilation, Triple TargetTriple);
   virtual ~OMPContext() = default;
 
@@ -181,18 +181,18 @@ struct OMPContext {
 /// by \p VMI are available in the OpenMP context \p Ctx. If \p DeviceSetOnly is
 /// true, only the device selector set, if present, are checked. Note that we
 /// still honor extension traits provided by the user.
-bool isVariantApplicableInContext(const VariantMatchInfo &VMI,
+LLVM_FUNC_ABI bool isVariantApplicableInContext(const VariantMatchInfo &VMI,
                                   const OMPContext &Ctx,
                                   bool DeviceSetOnly = false);
 
 /// Return the index (into \p VMIs) of the variant with the highest score
 /// from the ones applicble in \p Ctx. See llvm::isVariantApplicableInContext.
-int getBestVariantMatchForContext(const SmallVectorImpl<VariantMatchInfo> &VMIs,
+LLVM_FUNC_ABI int getBestVariantMatchForContext(const SmallVectorImpl<VariantMatchInfo> &VMIs,
                                   const OMPContext &Ctx);
 
 } // namespace omp
 
-template <> struct DenseMapInfo<omp::TraitProperty> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<omp::TraitProperty> {
   static inline omp::TraitProperty getEmptyKey() {
     return omp::TraitProperty(-1);
   }
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
index 37fc8be39f08a63..006a007c5a1b350 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+++ b/llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
@@ -38,14 +38,14 @@ class OpenMPIRBuilder;
 /// \p New will be added such that there is no semantic change. Otherwise, the
 /// \p IP insert block remains degenerate and it is up to the caller to insert a
 /// terminator.
-void spliceBB(IRBuilderBase::InsertPoint IP, BasicBlock *New,
+LLVM_FUNC_ABI void spliceBB(IRBuilderBase::InsertPoint IP, BasicBlock *New,
               bool CreateBranch);
 
 /// Splice a BasicBlock at an IRBuilder's current insertion point. Its new
 /// insert location will stick to after the instruction before the insertion
 /// point (instead of moving with the instruction the InsertPoint stores
 /// internally).
-void spliceBB(IRBuilder<> &Builder, BasicBlock *New, bool CreateBranch);
+LLVM_FUNC_ABI void spliceBB(IRBuilder<> &Builder, BasicBlock *New, bool CreateBranch);
 
 /// Split a BasicBlock at an InsertPoint, even if the block is degenerate
 /// (missing the terminator).
@@ -56,24 +56,24 @@ void spliceBB(IRBuilder<> &Builder, BasicBlock *New, bool CreateBranch);
 /// semantically there is no change; otherwise the block of the insertion point
 /// remains degenerate and it is the caller's responsibility to insert a
 /// terminator. Returns the new successor block.
-BasicBlock *splitBB(IRBuilderBase::InsertPoint IP, bool CreateBranch,
+LLVM_FUNC_ABI BasicBlock *splitBB(IRBuilderBase::InsertPoint IP, bool CreateBranch,
                     llvm::Twine Name = {});
 
 /// Split a BasicBlock at \p Builder's insertion point, even if the block is
 /// degenerate (missing the terminator).  Its new insert location will stick to
 /// after the instruction before the insertion point (instead of moving with the
 /// instruction the InsertPoint stores internally).
-BasicBlock *splitBB(IRBuilderBase &Builder, bool CreateBranch,
+LLVM_FUNC_ABI BasicBlock *splitBB(IRBuilderBase &Builder, bool CreateBranch,
                     llvm::Twine Name = {});
 
 /// Split a BasicBlock at \p Builder's insertion point, even if the block is
 /// degenerate (missing the terminator).  Its new insert location will stick to
 /// after the instruction before the insertion point (instead of moving with the
 /// instruction the InsertPoint stores internally).
-BasicBlock *splitBB(IRBuilder<> &Builder, bool CreateBranch, llvm::Twine Name);
+LLVM_FUNC_ABI BasicBlock *splitBB(IRBuilder<> &Builder, bool CreateBranch, llvm::Twine Name);
 
 /// Like splitBB, but reuses the current block's name for the new name.
-BasicBlock *splitBBWithSuffix(IRBuilderBase &Builder, bool CreateBranch,
+LLVM_FUNC_ABI BasicBlock *splitBBWithSuffix(IRBuilderBase &Builder, bool CreateBranch,
                               llvm::Twine Suffix = ".split");
 
 /// Captures attributes that affect generating LLVM-IR using the
@@ -81,7 +81,7 @@ BasicBlock *splitBBWithSuffix(IRBuilderBase &Builder, bool CreateBranch,
 /// required for all classes or functions. In some use cases the configuration
 /// is not necessary at all, because because the only functions that are called
 /// are ones that are not dependent on the configuration.
-class OpenMPIRBuilderConfig {
+class LLVM_CLASS_ABI OpenMPIRBuilderConfig {
 public:
   /// Flag for specifying if the compilation is done for embedded device code
   /// or host code.
@@ -163,7 +163,7 @@ class OpenMPIRBuilderConfig {
 
 /// Data structure to contain the information needed to uniquely identify
 /// a target entry.
-struct TargetRegionEntryInfo {
+struct LLVM_CLASS_ABI TargetRegionEntryInfo {
   std::string ParentName;
   unsigned DeviceID;
   unsigned FileID;
@@ -189,7 +189,7 @@ struct TargetRegionEntryInfo {
 };
 
 /// Class that manages information about offload code regions and data
-class OffloadEntriesInfoManager {
+class LLVM_CLASS_ABI OffloadEntriesInfoManager {
   /// Number of entries registered so far.
   OpenMPIRBuilder *OMPBuilder;
   unsigned OffloadingEntriesNum = 0;
@@ -428,7 +428,7 @@ class OffloadEntriesInfoManager {
 /// An interface to create LLVM-IR for OpenMP directives.
 ///
 /// Each OpenMP directive has a corresponding public generator method.
-class OpenMPIRBuilder {
+class LLVM_CLASS_ABI OpenMPIRBuilder {
 public:
   /// Create a new OpenMPIRBuilder operating on the given module \p M. This will
   /// not have an effect on \p M (see initialize)
@@ -2586,7 +2586,7 @@ class OpenMPIRBuilder {
 ///
 /// Defined outside OpenMPIRBuilder because nested classes cannot be
 /// forward-declared, e.g. to avoid having to include the entire OMPIRBuilder.h.
-class CanonicalLoopInfo {
+class LLVM_CLASS_ABI CanonicalLoopInfo {
   friend class OpenMPIRBuilder;
 
 private:
diff --git a/llvm/include/llvm/FuzzMutate/FuzzerCLI.h b/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
index 8a0eaba9eb3b459..d6b325d5b188401 100644
--- a/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
+++ b/llvm/include/llvm/FuzzMutate/FuzzerCLI.h
@@ -25,7 +25,7 @@ class StringRef;
 /// Parse cl::opts from a fuzz target commandline.
 ///
 /// This handles all arguments after -ignore_remaining_args=1 as cl::opts.
-void parseFuzzerCLOpts(int ArgC, char *ArgV[]);
+LLVM_FUNC_ABI void parseFuzzerCLOpts(int ArgC, char *ArgV[]);
 
 /// Handle backend options that are encoded in the executable name.
 ///
@@ -36,11 +36,11 @@ void parseFuzzerCLOpts(int ArgC, char *ArgV[]);
 ///
 /// This is meant to be used for environments like OSS-Fuzz that aren't capable
 /// of passing in command line arguments in the normal way.
-void handleExecNameEncodedBEOpts(StringRef ExecName);
+LLVM_FUNC_ABI void handleExecNameEncodedBEOpts(StringRef ExecName);
 
 /// Handle optimizer options which are encoded in the executable name.
 /// Same semantics as in 'handleExecNameEncodedBEOpts'.
-void handleExecNameEncodedOptimizerOpts(StringRef ExecName);
+LLVM_FUNC_ABI void handleExecNameEncodedOptimizerOpts(StringRef ExecName);
 
 using FuzzerTestFun = int (*)(const uint8_t *Data, size_t Size);
 using FuzzerInitFun = int (*)(int *argc, char ***argv);
@@ -49,7 +49,7 @@ using FuzzerInitFun = int (*)(int *argc, char ***argv);
 ///
 /// Useful for testing fuzz targets without linking to libFuzzer. Finds inputs
 /// in the argument list in a libFuzzer compatible way.
-int runFuzzerOnInputs(
+LLVM_FUNC_ABI int runFuzzerOnInputs(
     int ArgC, char *ArgV[], FuzzerTestFun TestOne,
     FuzzerInitFun Init = [](int *, char ***) { return 0; });
 
diff --git a/llvm/include/llvm/FuzzMutate/IRMutator.h b/llvm/include/llvm/FuzzMutate/IRMutator.h
index 1c954601c3b64d2..39bb2364f88751d 100644
--- a/llvm/include/llvm/FuzzMutate/IRMutator.h
+++ b/llvm/include/llvm/FuzzMutate/IRMutator.h
@@ -33,7 +33,7 @@ struct RandomIRBuilder;
 
 /// Base class for describing how to mutate a module. mutation functions for
 /// each IR unit forward to the contained unit.
-class IRMutationStrategy {
+class LLVM_CLASS_ABI IRMutationStrategy {
 public:
   virtual ~IRMutationStrategy() = default;
 
@@ -61,7 +61,7 @@ class IRMutationStrategy {
 using TypeGetter = std::function<Type *(LLVMContext &)>;
 
 /// Entry point for configuring and running IR mutations.
-class IRMutator {
+class LLVM_CLASS_ABI IRMutator {
   std::vector<TypeGetter> AllowedTypes;
   std::vector<std::unique_ptr<IRMutationStrategy>> Strategies;
 
@@ -87,7 +87,7 @@ class IRMutator {
 };
 
 /// Strategy that injects operations into the function.
-class InjectorIRStrategy : public IRMutationStrategy {
+class LLVM_CLASS_ABI InjectorIRStrategy : public IRMutationStrategy {
   std::vector<fuzzerop::OpDescriptor> Operations;
 
   std::optional<fuzzerop::OpDescriptor> chooseOperation(Value *Src,
@@ -110,7 +110,7 @@ class InjectorIRStrategy : public IRMutationStrategy {
 };
 
 /// Strategy that deletes instructions when the Module is too large.
-class InstDeleterIRStrategy : public IRMutationStrategy {
+class LLVM_CLASS_ABI InstDeleterIRStrategy : public IRMutationStrategy {
 public:
   uint64_t getWeight(size_t CurrentSize, size_t MaxSize,
                      uint64_t CurrentWeight) override;
@@ -121,7 +121,7 @@ class InstDeleterIRStrategy : public IRMutationStrategy {
 };
 
 /// Strategy that modifies instruction attributes and operands.
-class InstModificationIRStrategy : public IRMutationStrategy {
+class LLVM_CLASS_ABI InstModificationIRStrategy : public IRMutationStrategy {
 public:
   uint64_t getWeight(size_t CurrentSize, size_t MaxSize,
                      uint64_t CurrentWeight) override {
@@ -135,7 +135,7 @@ class InstModificationIRStrategy : public IRMutationStrategy {
 /// Strategy that generates new function calls and inserts function signatures
 /// to the modules. If any signatures are present in the module it will be
 /// called.
-class InsertFunctionStrategy : public IRMutationStrategy {
+class LLVM_CLASS_ABI InsertFunctionStrategy : public IRMutationStrategy {
 public:
   uint64_t getWeight(size_t CurrentSize, size_t MaxSize,
                      uint64_t CurrentWeight) override {
@@ -147,7 +147,7 @@ class InsertFunctionStrategy : public IRMutationStrategy {
 };
 
 /// Strategy to split a random block and insert a random CFG in between.
-class InsertCFGStrategy : public IRMutationStrategy {
+class LLVM_CLASS_ABI InsertCFGStrategy : public IRMutationStrategy {
 private:
   uint64_t MaxNumCases;
   enum CFGToSink { Return, DirectSink, SinkOrSelfLoop, EndOfCFGToLink };
@@ -167,7 +167,7 @@ class InsertCFGStrategy : public IRMutationStrategy {
 };
 
 /// Strategy to insert PHI Nodes at the head of each basic block.
-class InsertPHIStrategy : public IRMutationStrategy {
+class LLVM_CLASS_ABI InsertPHIStrategy : public IRMutationStrategy {
 public:
   uint64_t getWeight(size_t CurrentSize, size_t MaxSize,
                      uint64_t CurrentWeight) override {
@@ -179,7 +179,7 @@ class InsertPHIStrategy : public IRMutationStrategy {
 
 /// Strategy to select a random instruction and add a new sink (user) to it to
 /// increate data dependency.
-class SinkInstructionStrategy : public IRMutationStrategy {
+class LLVM_CLASS_ABI SinkInstructionStrategy : public IRMutationStrategy {
 public:
   uint64_t getWeight(size_t CurrentSize, size_t MaxSize,
                      uint64_t CurrentWeight) override {
@@ -192,7 +192,7 @@ class SinkInstructionStrategy : public IRMutationStrategy {
 
 /// Strategy to randomly select a block and shuffle the operations without
 /// affecting data dependency.
-class ShuffleBlockStrategy : public IRMutationStrategy {
+class LLVM_CLASS_ABI ShuffleBlockStrategy : public IRMutationStrategy {
 public:
   uint64_t getWeight(size_t CurrentSize, size_t MaxSize,
                      uint64_t CurrentWeight) override {
@@ -207,7 +207,7 @@ class ShuffleBlockStrategy : public IRMutationStrategy {
 /// \param Data Bitcode we are going to parse
 /// \param Size Size of the 'Data' in bytes
 /// \return New module or nullptr in case of error
-std::unique_ptr<Module> parseModule(const uint8_t *Data, size_t Size,
+LLVM_FUNC_ABI std::unique_ptr<Module> parseModule(const uint8_t *Data, size_t Size,
                                     LLVMContext &Context);
 
 /// Fuzzer friendly interface for the llvm bitcode printer.
@@ -217,12 +217,12 @@ std::unique_ptr<Module> parseModule(const uint8_t *Data, size_t Size,
 /// \param MaxSize Size of the destination buffer
 /// \return Number of bytes that were written. When module size exceeds MaxSize
 ///         returns 0 and leaves Dest unchanged.
-size_t writeModule(const Module &M, uint8_t *Dest, size_t MaxSize);
+LLVM_FUNC_ABI size_t writeModule(const Module &M, uint8_t *Dest, size_t MaxSize);
 
 /// Try to parse module and verify it. May output verification errors to the
 /// errs().
 /// \return New module or nullptr in case of error.
-std::unique_ptr<Module> parseAndVerify(const uint8_t *Data, size_t Size,
+LLVM_FUNC_ABI std::unique_ptr<Module> parseAndVerify(const uint8_t *Data, size_t Size,
                                        LLVMContext &Context);
 
 } // namespace llvm
diff --git a/llvm/include/llvm/FuzzMutate/OpDescriptor.h b/llvm/include/llvm/FuzzMutate/OpDescriptor.h
index 1f9dce121df8a3b..1e8a9b52e5beee1 100644
--- a/llvm/include/llvm/FuzzMutate/OpDescriptor.h
+++ b/llvm/include/llvm/FuzzMutate/OpDescriptor.h
@@ -30,8 +30,8 @@ namespace fuzzerop {
 
 /// @{
 /// Populate a small list of potentially interesting constants of a given type.
-void makeConstantsWithType(Type *T, std::vector<Constant *> &Cs);
-std::vector<Constant *> makeConstantsWithType(Type *T);
+LLVM_FUNC_ABI void makeConstantsWithType(Type *T, std::vector<Constant *> &Cs);
+LLVM_FUNC_ABI std::vector<Constant *> makeConstantsWithType(Type *T);
 /// @}
 
 /// A matcher/generator for finding suitable values for the next source in an
@@ -41,7 +41,7 @@ std::vector<Constant *> makeConstantsWithType(Type *T);
 /// subset of its operands, this predicate determines if some value New is
 /// suitable for the next operand or generates a set of values that are
 /// suitable.
-class SourcePred {
+class LLVM_CLASS_ABI SourcePred {
 public:
   /// Given a list of already selected operands, returns whether a given new
   /// operand is suitable for the next operand.
@@ -87,7 +87,7 @@ class SourcePred {
 };
 
 /// A description of some operation we can build while fuzzing IR.
-struct OpDescriptor {
+struct LLVM_CLASS_ABI OpDescriptor {
   unsigned Weight;
   SmallVector<SourcePred, 2> SourcePreds;
   std::function<Value *(ArrayRef<Value *>, Instruction *)> BuilderFunc;
diff --git a/llvm/include/llvm/FuzzMutate/Operations.h b/llvm/include/llvm/FuzzMutate/Operations.h
index c92a84bd867d072..0c12fc6495f462e 100644
--- a/llvm/include/llvm/FuzzMutate/Operations.h
+++ b/llvm/include/llvm/FuzzMutate/Operations.h
@@ -23,32 +23,32 @@ namespace llvm {
 
 /// Getters for the default sets of operations, per general category.
 /// @{
-void describeFuzzerIntOps(std::vector<fuzzerop::OpDescriptor> &Ops);
-void describeFuzzerFloatOps(std::vector<fuzzerop::OpDescriptor> &Ops);
-void describeFuzzerControlFlowOps(std::vector<fuzzerop::OpDescriptor> &Ops);
-void describeFuzzerPointerOps(std::vector<fuzzerop::OpDescriptor> &Ops);
-void describeFuzzerAggregateOps(std::vector<fuzzerop::OpDescriptor> &Ops);
-void describeFuzzerVectorOps(std::vector<fuzzerop::OpDescriptor> &Ops);
-void describeFuzzerUnaryOperations(std::vector<fuzzerop::OpDescriptor> &Ops);
-void describeFuzzerOtherOps(std::vector<fuzzerop::OpDescriptor> &Ops);
+LLVM_FUNC_ABI void describeFuzzerIntOps(std::vector<fuzzerop::OpDescriptor> &Ops);
+LLVM_FUNC_ABI void describeFuzzerFloatOps(std::vector<fuzzerop::OpDescriptor> &Ops);
+LLVM_FUNC_ABI void describeFuzzerControlFlowOps(std::vector<fuzzerop::OpDescriptor> &Ops);
+LLVM_FUNC_ABI void describeFuzzerPointerOps(std::vector<fuzzerop::OpDescriptor> &Ops);
+LLVM_FUNC_ABI void describeFuzzerAggregateOps(std::vector<fuzzerop::OpDescriptor> &Ops);
+LLVM_FUNC_ABI void describeFuzzerVectorOps(std::vector<fuzzerop::OpDescriptor> &Ops);
+LLVM_FUNC_ABI void describeFuzzerUnaryOperations(std::vector<fuzzerop::OpDescriptor> &Ops);
+LLVM_FUNC_ABI void describeFuzzerOtherOps(std::vector<fuzzerop::OpDescriptor> &Ops);
 /// @}
 
 namespace fuzzerop {
 
 /// Descriptors for individual operations.
 /// @{
-OpDescriptor selectDescriptor(unsigned Weight);
-OpDescriptor fnegDescriptor(unsigned Weight);
-OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op);
-OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp,
+LLVM_FUNC_ABI OpDescriptor selectDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor fnegDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op);
+LLVM_FUNC_ABI OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp,
                              CmpInst::Predicate Pred);
-OpDescriptor splitBlockDescriptor(unsigned Weight);
-OpDescriptor gepDescriptor(unsigned Weight);
-OpDescriptor extractValueDescriptor(unsigned Weight);
-OpDescriptor insertValueDescriptor(unsigned Weight);
-OpDescriptor extractElementDescriptor(unsigned Weight);
-OpDescriptor insertElementDescriptor(unsigned Weight);
-OpDescriptor shuffleVectorDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor splitBlockDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor gepDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor extractValueDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor insertValueDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor extractElementDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor insertElementDescriptor(unsigned Weight);
+LLVM_FUNC_ABI OpDescriptor shuffleVectorDescriptor(unsigned Weight);
 
 /// @}
 
diff --git a/llvm/include/llvm/FuzzMutate/Random.h b/llvm/include/llvm/FuzzMutate/Random.h
index 3b14a1afe0b26bf..d0636b7b1fafbd9 100644
--- a/llvm/include/llvm/FuzzMutate/Random.h
+++ b/llvm/include/llvm/FuzzMutate/Random.h
@@ -31,7 +31,7 @@ template <typename T, typename GenT> T uniform(GenT &Gen) {
 
 /// Randomly selects an item by sampling into a set with an unknown number of
 /// elements, which may each be weighted to be more likely choices.
-template <typename T, typename GenT> class ReservoirSampler {
+template <typename T, typename GenT> class LLVM_CLASS_ABI ReservoirSampler {
   GenT &RandGen;
   std::remove_const_t<T> Selection = {};
   uint64_t TotalWeight = 0;
diff --git a/llvm/include/llvm/FuzzMutate/RandomIRBuilder.h b/llvm/include/llvm/FuzzMutate/RandomIRBuilder.h
index a3c5d9a9396d248..134a1f8871d0637 100644
--- a/llvm/include/llvm/FuzzMutate/RandomIRBuilder.h
+++ b/llvm/include/llvm/FuzzMutate/RandomIRBuilder.h
@@ -35,7 +35,7 @@ class SourcePred;
 
 using RandomEngine = std::mt19937;
 
-struct RandomIRBuilder {
+struct LLVM_CLASS_ABI RandomIRBuilder {
   RandomEngine Rand;
   SmallVector<Type *, 16> KnownTypes;
 
diff --git a/llvm/include/llvm/IR/AbstractCallSite.h b/llvm/include/llvm/IR/AbstractCallSite.h
index 74334af55a437ae..bf3308afad89f95 100644
--- a/llvm/include/llvm/IR/AbstractCallSite.h
+++ b/llvm/include/llvm/IR/AbstractCallSite.h
@@ -48,7 +48,7 @@ class Use;
 /// to note that the mapping is often partial. Thus, some arguments of the
 /// call/invoke instruction are mapped to parameters of the callee while others
 /// are not.
-class AbstractCallSite {
+class LLVM_CLASS_ABI AbstractCallSite {
 public:
 
   /// The encoding of a callback with regards to the underlying instruction.
diff --git a/llvm/include/llvm/IR/Argument.h b/llvm/include/llvm/IR/Argument.h
index 9f46a7f05f5b62c..f9b8535ad48ab60 100644
--- a/llvm/include/llvm/IR/Argument.h
+++ b/llvm/include/llvm/IR/Argument.h
@@ -26,7 +26,7 @@ namespace llvm {
 /// for a specific function. When used in the body of said function, the
 /// argument of course represents the value of the actual argument that the
 /// function was called with.
-class Argument final : public Value {
+class LLVM_CLASS_ABI Argument final : public Value {
   Function *Parent;
   unsigned ArgNo;
 
diff --git a/llvm/include/llvm/IR/AssemblyAnnotationWriter.h b/llvm/include/llvm/IR/AssemblyAnnotationWriter.h
index b7ca692cec58856..d8e71c4653a4105 100644
--- a/llvm/include/llvm/IR/AssemblyAnnotationWriter.h
+++ b/llvm/include/llvm/IR/AssemblyAnnotationWriter.h
@@ -26,7 +26,7 @@ class Instruction;
 class Value;
 class formatted_raw_ostream;
 
-class AssemblyAnnotationWriter {
+class LLVM_CLASS_ABI AssemblyAnnotationWriter {
 public:
   virtual ~AssemblyAnnotationWriter();
 
diff --git a/llvm/include/llvm/IR/Assumptions.h b/llvm/include/llvm/IR/Assumptions.h
index 2b29fae7d1cbe8d..241640cd17571b0 100644
--- a/llvm/include/llvm/IR/Assumptions.h
+++ b/llvm/include/llvm/IR/Assumptions.h
@@ -30,11 +30,11 @@ constexpr StringRef AssumptionAttrKey = "llvm.assume";
 
 /// A set of known assumption strings that are accepted without warning and
 /// which can be recommended as typo correction.
-extern StringSet<> KnownAssumptionStrings;
+LLVM_FUNC_ABI extern StringSet<> KnownAssumptionStrings;
 
 /// Helper that allows to insert a new assumption string in the known assumption
 /// set by creating a (static) object.
-struct KnownAssumptionString {
+struct LLVM_CLASS_ABI KnownAssumptionString {
   KnownAssumptionString(const char *AssumptionStr)
       : AssumptionStr(AssumptionStr) {
     KnownAssumptionStrings.insert(AssumptionStr);
@@ -50,25 +50,25 @@ struct KnownAssumptionString {
 };
 
 /// Return true if \p F has the assumption \p AssumptionStr attached.
-bool hasAssumption(const Function &F,
+LLVM_FUNC_ABI bool hasAssumption(const Function &F,
                    const KnownAssumptionString &AssumptionStr);
 
 /// Return true if \p CB or the callee has the assumption \p AssumptionStr
 /// attached.
-bool hasAssumption(const CallBase &CB,
+LLVM_FUNC_ABI bool hasAssumption(const CallBase &CB,
                    const KnownAssumptionString &AssumptionStr);
 
 /// Return the set of all assumptions for the function \p F.
-DenseSet<StringRef> getAssumptions(const Function &F);
+LLVM_FUNC_ABI DenseSet<StringRef> getAssumptions(const Function &F);
 
 /// Return the set of all assumptions for the call \p CB.
-DenseSet<StringRef> getAssumptions(const CallBase &CB);
+LLVM_FUNC_ABI DenseSet<StringRef> getAssumptions(const CallBase &CB);
 
 /// Appends the set of assumptions \p Assumptions to \F.
-bool addAssumptions(Function &F, const DenseSet<StringRef> &Assumptions);
+LLVM_FUNC_ABI bool addAssumptions(Function &F, const DenseSet<StringRef> &Assumptions);
 
 /// Appends the set of assumptions \p Assumptions to \CB.
-bool addAssumptions(CallBase &CB, const DenseSet<StringRef> &Assumptions);
+LLVM_FUNC_ABI bool addAssumptions(CallBase &CB, const DenseSet<StringRef> &Assumptions);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/IR/AttributeMask.h b/llvm/include/llvm/IR/AttributeMask.h
index b534e15460ae027..dd1832fbfe2cf05 100644
--- a/llvm/include/llvm/IR/AttributeMask.h
+++ b/llvm/include/llvm/IR/AttributeMask.h
@@ -27,7 +27,7 @@ namespace llvm {
 /// \class
 /// This class stores enough information to efficiently remove some attributes
 /// from an existing AttrBuilder, AttributeSet or AttributeList.
-class AttributeMask {
+class LLVM_CLASS_ABI AttributeMask {
   std::bitset<Attribute::EndAttrKinds> Attrs;
   std::set<SmallString<32>, std::less<>> TargetDepAttrs;
 
diff --git a/llvm/include/llvm/IR/Attributes.h b/llvm/include/llvm/IR/Attributes.h
index 0ebee35d6978ed0..e2ec18975cf67e5 100644
--- a/llvm/include/llvm/IR/Attributes.h
+++ b/llvm/include/llvm/IR/Attributes.h
@@ -63,7 +63,7 @@ enum class AllocFnKind : uint64_t {
 /// to indicate how they should be treated by optimizations and code
 /// generation. This class represents one of those attributes. It's light-weight
 /// and should be passed around by-value.
-class Attribute {
+class LLVM_CLASS_ABI Attribute {
 public:
   /// This enumeration lists the attributes that can be associated with
   /// parameters, function results, or the function itself.
@@ -295,7 +295,7 @@ inline Attribute unwrap(LLVMAttributeRef Attr) {
 /// function, or return value. It is an immutable value type that is cheap to
 /// copy. Adding and removing enum attributes is intended to be fast, but adding
 /// and removing string or integer attributes involves a FoldingSet lookup.
-class AttributeSet {
+class LLVM_CLASS_ABI AttributeSet {
   friend AttributeListImpl;
   template <typename Ty, typename Enable> friend struct DenseMapInfo;
 
@@ -404,7 +404,7 @@ class AttributeSet {
 //===----------------------------------------------------------------------===//
 /// \class
 /// Provide DenseMapInfo for AttributeSet.
-template <> struct DenseMapInfo<AttributeSet, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<AttributeSet, void> {
   static AttributeSet getEmptyKey() {
     auto Val = static_cast<uintptr_t>(-1);
     Val <<= PointerLikeTypeTraits<void *>::NumLowBitsAvailable;
@@ -433,7 +433,7 @@ template <> struct DenseMapInfo<AttributeSet, void> {
 /// `AttributeList::FunctionIndex', the return value is at index
 /// `AttributeList::ReturnIndex', and the attributes for the parameters start at
 /// index `AttributeList::FirstArgIndex'.
-class AttributeList {
+class LLVM_CLASS_ABI AttributeList {
 public:
   enum AttrIndex : unsigned {
     ReturnIndex = 0U,
@@ -959,7 +959,7 @@ class AttributeList {
 //===----------------------------------------------------------------------===//
 /// \class
 /// Provide DenseMapInfo for AttributeList.
-template <> struct DenseMapInfo<AttributeList, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<AttributeList, void> {
   static AttributeList getEmptyKey() {
     auto Val = static_cast<uintptr_t>(-1);
     Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
@@ -988,7 +988,7 @@ template <> struct DenseMapInfo<AttributeList, void> {
 /// create an Attribute object. The object itself is uniquified. The Builder's
 /// value, however, is not. So this can be used as a quick way to test for
 /// equality, presence of attributes, etc.
-class AttrBuilder {
+class LLVM_CLASS_ABI AttrBuilder {
   LLVMContext &Ctx;
   SmallVector<Attribute, 8> Attrs;
 
@@ -1206,24 +1206,24 @@ enum AttributeSafetyKind : uint8_t {
 
 /// Returns true if this is a type legal for the 'nofpclass' attribute. This
 /// follows the same type rules as FPMathOperator.
-bool isNoFPClassCompatibleType(Type *Ty);
+LLVM_FUNC_ABI bool isNoFPClassCompatibleType(Type *Ty);
 
 /// Which attributes cannot be applied to a type. The argument \p ASK indicates,
 /// if only attributes that are known to be safely droppable are contained in
 /// the mask; only attributes that might be unsafe to drop (e.g., ABI-related
 /// attributes) are in the mask; or both.
-AttributeMask typeIncompatible(Type *Ty, AttributeSafetyKind ASK = ASK_ALL);
+LLVM_FUNC_ABI AttributeMask typeIncompatible(Type *Ty, AttributeSafetyKind ASK = ASK_ALL);
 
 /// Get param/return attributes which imply immediate undefined behavior if an
 /// invalid value is passed. For example, this includes noundef (where undef
 /// implies UB), but not nonnull (where null implies poison). It also does not
 /// include attributes like nocapture, which constrain the function
 /// implementation rather than the passed value.
-AttributeMask getUBImplyingAttributes();
+LLVM_FUNC_ABI AttributeMask getUBImplyingAttributes();
 
 /// \returns Return true if the two functions have compatible target-independent
 /// attributes for inlining purposes.
-bool areInlineCompatible(const Function &Caller, const Function &Callee);
+LLVM_FUNC_ABI bool areInlineCompatible(const Function &Caller, const Function &Callee);
 
 
 /// Checks  if there are any incompatible function attributes between
@@ -1232,19 +1232,19 @@ bool areInlineCompatible(const Function &Caller, const Function &Callee);
 /// \param [in] A - The first function to be compared with.
 /// \param [in] B - The second function to be compared with.
 /// \returns true if the functions have compatible attributes.
-bool areOutlineCompatible(const Function &A, const Function &B);
+LLVM_FUNC_ABI bool areOutlineCompatible(const Function &A, const Function &B);
 
 /// Merge caller's and callee's attributes.
-void mergeAttributesForInlining(Function &Caller, const Function &Callee);
+LLVM_FUNC_ABI void mergeAttributesForInlining(Function &Caller, const Function &Callee);
 
 /// Merges the functions attributes from \p ToMerge into function \p Base.
 ///
 /// \param [in,out] Base - The function being merged into.
 /// \param [in] ToMerge - The function to merge attributes from.
-void mergeAttributesForOutlining(Function &Base, const Function &ToMerge);
+LLVM_FUNC_ABI void mergeAttributesForOutlining(Function &Base, const Function &ToMerge);
 
 /// Update min-legal-vector-width if it is in Attribute and less than Width.
-void updateMinLegalVectorWidthAttr(Function &Fn, uint64_t Width);
+LLVM_FUNC_ABI void updateMinLegalVectorWidthAttr(Function &Fn, uint64_t Width);
 
 } // end namespace AttributeFuncs
 
diff --git a/llvm/include/llvm/IR/AutoUpgrade.h b/llvm/include/llvm/IR/AutoUpgrade.h
index 36ff6f025ab3cea..12978a4ef9088eb 100644
--- a/llvm/include/llvm/IR/AutoUpgrade.h
+++ b/llvm/include/llvm/IR/AutoUpgrade.h
@@ -37,57 +37,57 @@ namespace llvm {
   /// for upgrading, and returns true if it requires upgrading. It may return
   /// null in NewFn if the all calls to the original intrinsic function
   /// should be transformed to non-function-call instructions.
-  bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn);
+  LLVM_FUNC_ABI bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn);
 
   /// This is the complement to the above, replacing a specific call to an
   /// intrinsic function with a call to the specified new function.
-  void UpgradeIntrinsicCall(CallBase *CB, Function *NewFn);
+  LLVM_FUNC_ABI void UpgradeIntrinsicCall(CallBase *CB, Function *NewFn);
 
   // This upgrades the comment for objc retain release markers in inline asm
   // calls
-  void UpgradeInlineAsmString(std::string *AsmStr);
+  LLVM_FUNC_ABI void UpgradeInlineAsmString(std::string *AsmStr);
 
   /// This is an auto-upgrade hook for any old intrinsic function syntaxes
   /// which need to have both the function updated as well as all calls updated
   /// to the new function. This should only be run in a post-processing fashion
   /// so that it can update all calls to the old function.
-  void UpgradeCallsToIntrinsic(Function* F);
+  LLVM_FUNC_ABI void UpgradeCallsToIntrinsic(Function* F);
 
   /// This checks for global variables which should be upgraded. It it requires
   /// upgrading, returns a pointer to the upgraded variable.
-  GlobalVariable *UpgradeGlobalVariable(GlobalVariable *GV);
+  LLVM_FUNC_ABI GlobalVariable *UpgradeGlobalVariable(GlobalVariable *GV);
 
   /// This checks for module flags which should be upgraded. It returns true if
   /// module is modified.
-  bool UpgradeModuleFlags(Module &M);
+  LLVM_FUNC_ABI bool UpgradeModuleFlags(Module &M);
 
   /// Convert calls to ARC runtime functions to intrinsic calls and upgrade the
   /// old retain release marker to new module flag format.
-  void UpgradeARCRuntime(Module &M);
+  LLVM_FUNC_ABI void UpgradeARCRuntime(Module &M);
 
-  void UpgradeSectionAttributes(Module &M);
+  LLVM_FUNC_ABI void UpgradeSectionAttributes(Module &M);
 
   /// Correct any IR that is relying on old function attribute behavior.
-  void UpgradeFunctionAttributes(Function &F);
+  LLVM_FUNC_ABI void UpgradeFunctionAttributes(Function &F);
 
   /// If the given TBAA tag uses the scalar TBAA format, create a new node
   /// corresponding to the upgrade to the struct-path aware TBAA format.
   /// Otherwise return the \p TBAANode itself.
-  MDNode *UpgradeTBAANode(MDNode &TBAANode);
+  LLVM_FUNC_ABI MDNode *UpgradeTBAANode(MDNode &TBAANode);
 
   /// This is an auto-upgrade for bitcast between pointers with different
   /// address spaces: the instruction is replaced by a pair ptrtoint+inttoptr.
-  Instruction *UpgradeBitCastInst(unsigned Opc, Value *V, Type *DestTy,
+  LLVM_FUNC_ABI Instruction *UpgradeBitCastInst(unsigned Opc, Value *V, Type *DestTy,
                                   Instruction *&Temp);
 
   /// This is an auto-upgrade for bitcast constant expression between pointers
   /// with different address spaces: the instruction is replaced by a pair
   /// ptrtoint+inttoptr.
-  Constant *UpgradeBitCastExpr(unsigned Opc, Constant *C, Type *DestTy);
+  LLVM_FUNC_ABI Constant *UpgradeBitCastExpr(unsigned Opc, Constant *C, Type *DestTy);
 
   /// Check the debug info version number, if it is out-dated, drop the debug
   /// info. Return true if module is modified.
-  bool UpgradeDebugInfo(Module &M);
+  LLVM_FUNC_ABI bool UpgradeDebugInfo(Module &M);
 
   /// Check whether a string looks like an old loop attachment tag.
   inline bool mayBeOldLoopAttachmentTag(StringRef Name) {
@@ -95,17 +95,17 @@ namespace llvm {
   }
 
   /// Upgrade the loop attachment metadata node.
-  MDNode *upgradeInstructionLoopAttachment(MDNode &N);
+  LLVM_FUNC_ABI MDNode *upgradeInstructionLoopAttachment(MDNode &N);
 
   /// Upgrade the datalayout string by adding a section for address space
   /// pointers.
-  std::string UpgradeDataLayoutString(StringRef DL, StringRef Triple);
+  LLVM_FUNC_ABI std::string UpgradeDataLayoutString(StringRef DL, StringRef Triple);
 
   /// Upgrade attributes that changed format or kind.
-  void UpgradeAttributes(AttrBuilder &B);
+  LLVM_FUNC_ABI void UpgradeAttributes(AttrBuilder &B);
 
   /// Upgrade operand bundles (without knowing about their user instruction).
-  void UpgradeOperandBundles(std::vector<OperandBundleDef> &OperandBundles);
+  LLVM_FUNC_ABI void UpgradeOperandBundles(std::vector<OperandBundleDef> &OperandBundles);
 
 } // End llvm namespace
 
diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index d577afb69c44a0e..68e2bee29bdbdcb 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -53,7 +53,7 @@ class ValueSymbolTable;
 /// because it may be useful in the intermediate stage of constructing or
 /// modifying a program. However, the verifier will ensure that basic blocks are
 /// "well formed".
-class BasicBlock final : public Value, // Basic blocks are data objects also
+class LLVM_CLASS_ABI BasicBlock final : public Value, // Basic blocks are data objects also
                          public ilist_node_with_parent<BasicBlock, Function> {
 public:
   using InstListType = SymbolTableList<Instruction>;
@@ -635,7 +635,7 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef)
 
 /// Advance \p It while it points to a debug instruction and return the result.
 /// This assumes that \p It is not at the end of a block.
-BasicBlock::iterator skipDebugIntrinsics(BasicBlock::iterator It);
+LLVM_FUNC_ABI BasicBlock::iterator skipDebugIntrinsics(BasicBlock::iterator It);
 
 #ifdef NDEBUG
 /// In release builds, this is a no-op. For !NDEBUG builds, the checks are
diff --git a/llvm/include/llvm/IR/BuiltinGCs.h b/llvm/include/llvm/IR/BuiltinGCs.h
index 208b6c76c476caa..abe8c740572ee83 100644
--- a/llvm/include/llvm/IR/BuiltinGCs.h
+++ b/llvm/include/llvm/IR/BuiltinGCs.h
@@ -22,13 +22,13 @@ namespace llvm {
 ///        serve any purpose except to link in the plugins.
 
 /// Ensure the definition of the builtin GCs gets linked in
-void linkAllBuiltinGCs();
+LLVM_FUNC_ABI void linkAllBuiltinGCs();
 
 /// Creates an ocaml-compatible metadata printer.
-void linkOcamlGCPrinter();
+LLVM_FUNC_ABI void linkOcamlGCPrinter();
 
 /// Creates an erlang-compatible metadata printer.
-void linkErlangGCPrinter();
+LLVM_FUNC_ABI void linkErlangGCPrinter();
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/IR/CFG.h b/llvm/include/llvm/IR/CFG.h
index 6c294bbb682febb..37577bbcb21b1f3 100644
--- a/llvm/include/llvm/IR/CFG.h
+++ b/llvm/include/llvm/IR/CFG.h
@@ -40,7 +40,7 @@ class Use;
 //===----------------------------------------------------------------------===//
 
 template <class Ptr, class USE_iterator> // Predecessor Iterator
-class PredIterator {
+class LLVM_CLASS_ABI PredIterator {
 public:
   using iterator_category = std::forward_iterator_tag;
   using value_type = Ptr;
@@ -136,7 +136,7 @@ inline const_pred_range predecessors(const BasicBlock *BB) {
 //===----------------------------------------------------------------------===//
 
 template <class InstructionT, class BlockT>
-class SuccIterator
+class LLVM_CLASS_ABI SuccIterator
     : public iterator_facade_base<SuccIterator<InstructionT, BlockT>,
                                   std::random_access_iterator_tag, BlockT, int,
                                   BlockT *, BlockT *> {
@@ -298,7 +298,7 @@ inline const_succ_range successors(const BasicBlock *BB) {
 // Provide specializations of GraphTraits to be able to treat a function as a
 // graph of basic blocks...
 
-template <> struct GraphTraits<BasicBlock*> {
+template <> struct LLVM_CLASS_ABI GraphTraits<BasicBlock*> {
   using NodeRef = BasicBlock *;
   using ChildIteratorType = succ_iterator;
 
@@ -307,7 +307,7 @@ template <> struct GraphTraits<BasicBlock*> {
   static ChildIteratorType child_end(NodeRef N) { return succ_end(N); }
 };
 
-template <> struct GraphTraits<const BasicBlock*> {
+template <> struct LLVM_CLASS_ABI GraphTraits<const BasicBlock*> {
   using NodeRef = const BasicBlock *;
   using ChildIteratorType = const_succ_iterator;
 
@@ -322,7 +322,7 @@ template <> struct GraphTraits<const BasicBlock*> {
 // a function is considered to be when traversing the predecessor edges of a BB
 // instead of the successor edges.
 //
-template <> struct GraphTraits<Inverse<BasicBlock*>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<BasicBlock*>> {
   using NodeRef = BasicBlock *;
   using ChildIteratorType = pred_iterator;
 
@@ -331,7 +331,7 @@ template <> struct GraphTraits<Inverse<BasicBlock*>> {
   static ChildIteratorType child_end(NodeRef N) { return pred_end(N); }
 };
 
-template <> struct GraphTraits<Inverse<const BasicBlock*>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<const BasicBlock*>> {
   using NodeRef = const BasicBlock *;
   using ChildIteratorType = const_pred_iterator;
 
@@ -348,7 +348,7 @@ template <> struct GraphTraits<Inverse<const BasicBlock*>> {
 // graph of basic blocks... these are the same as the basic block iterators,
 // except that the root node is implicitly the first node of the function.
 //
-template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
   static NodeRef getEntryNode(Function *F) { return &F->getEntryBlock(); }
 
   // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
@@ -364,7 +364,7 @@ template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
 
   static size_t size(Function *F) { return F->size(); }
 };
-template <> struct GraphTraits<const Function*> :
+template <> struct LLVM_CLASS_ABI GraphTraits<const Function*> :
   public GraphTraits<const BasicBlock*> {
   static NodeRef getEntryNode(const Function *F) { return &F->getEntryBlock(); }
 
@@ -387,13 +387,13 @@ template <> struct GraphTraits<const Function*> :
 // a function is considered to be when traversing the predecessor edges of a BB
 // instead of the successor edges.
 //
-template <> struct GraphTraits<Inverse<Function*>> :
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<Function*>> :
   public GraphTraits<Inverse<BasicBlock*>> {
   static NodeRef getEntryNode(Inverse<Function *> G) {
     return &G.Graph->getEntryBlock();
   }
 };
-template <> struct GraphTraits<Inverse<const Function*>> :
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<const Function*>> :
   public GraphTraits<Inverse<const BasicBlock*>> {
   static NodeRef getEntryNode(Inverse<const Function *> G) {
     return &G.Graph->getEntryBlock();
diff --git a/llvm/include/llvm/IR/Comdat.h b/llvm/include/llvm/IR/Comdat.h
index e461153cd770ad9..00575111b63ba73 100644
--- a/llvm/include/llvm/IR/Comdat.h
+++ b/llvm/include/llvm/IR/Comdat.h
@@ -31,7 +31,7 @@ template <typename ValueTy> class StringMapEntry;
 // independent object instead of just adding the name and the SelectionKind
 // to a GlobalObject is that it is invalid to have two Comdats with the same
 // name but different SelectionKind. This structure makes that unrepresentable.
-class Comdat {
+class LLVM_CLASS_ABI Comdat {
 public:
   enum SelectionKind {
     Any,           ///< The linker may choose any COMDAT.
diff --git a/llvm/include/llvm/IR/Constant.h b/llvm/include/llvm/IR/Constant.h
index 2f9d44e93990829..404986c38c06521 100644
--- a/llvm/include/llvm/IR/Constant.h
+++ b/llvm/include/llvm/IR/Constant.h
@@ -39,7 +39,7 @@ class APInt;
 /// Constants are created on demand as needed and never deleted: thus clients
 /// don't have to worry about the lifetime of the objects.
 /// LLVM Constant Representation
-class Constant : public User {
+class LLVM_CLASS_ABI Constant : public User {
 protected:
   Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
     : User(ty, vty, Ops, NumOps) {}
diff --git a/llvm/include/llvm/IR/ConstantFold.h b/llvm/include/llvm/IR/ConstantFold.h
index ccd3cb7701df887..9c9f80fe19bdf22 100644
--- a/llvm/include/llvm/IR/ConstantFold.h
+++ b/llvm/include/llvm/IR/ConstantFold.h
@@ -32,28 +32,28 @@ namespace llvm {
   class Type;
 
   // Constant fold various types of instruction...
-  Constant *ConstantFoldCastInstruction(
+  LLVM_FUNC_ABI Constant *ConstantFoldCastInstruction(
     unsigned opcode,     ///< The opcode of the cast
     Constant *V,         ///< The source constant
     Type *DestTy   ///< The destination type
   );
-  Constant *ConstantFoldSelectInstruction(Constant *Cond,
+  LLVM_FUNC_ABI Constant *ConstantFoldSelectInstruction(Constant *Cond,
                                           Constant *V1, Constant *V2);
-  Constant *ConstantFoldExtractElementInstruction(Constant *Val, Constant *Idx);
-  Constant *ConstantFoldInsertElementInstruction(Constant *Val, Constant *Elt,
+  LLVM_FUNC_ABI Constant *ConstantFoldExtractElementInstruction(Constant *Val, Constant *Idx);
+  LLVM_FUNC_ABI Constant *ConstantFoldInsertElementInstruction(Constant *Val, Constant *Elt,
                                                  Constant *Idx);
-  Constant *ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
+  LLVM_FUNC_ABI Constant *ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2,
                                                  ArrayRef<int> Mask);
-  Constant *ConstantFoldExtractValueInstruction(Constant *Agg,
+  LLVM_FUNC_ABI Constant *ConstantFoldExtractValueInstruction(Constant *Agg,
                                                 ArrayRef<unsigned> Idxs);
-  Constant *ConstantFoldInsertValueInstruction(Constant *Agg, Constant *Val,
+  LLVM_FUNC_ABI Constant *ConstantFoldInsertValueInstruction(Constant *Agg, Constant *Val,
                                                ArrayRef<unsigned> Idxs);
-  Constant *ConstantFoldUnaryInstruction(unsigned Opcode, Constant *V);
-  Constant *ConstantFoldBinaryInstruction(unsigned Opcode, Constant *V1,
+  LLVM_FUNC_ABI Constant *ConstantFoldUnaryInstruction(unsigned Opcode, Constant *V);
+  LLVM_FUNC_ABI Constant *ConstantFoldBinaryInstruction(unsigned Opcode, Constant *V1,
                                           Constant *V2);
-  Constant *ConstantFoldCompareInstruction(CmpInst::Predicate Predicate,
+  LLVM_FUNC_ABI Constant *ConstantFoldCompareInstruction(CmpInst::Predicate Predicate,
                                            Constant *C1, Constant *C2);
-  Constant *ConstantFoldGetElementPtr(Type *Ty, Constant *C, bool InBounds,
+  LLVM_FUNC_ABI Constant *ConstantFoldGetElementPtr(Type *Ty, Constant *C, bool InBounds,
                                       std::optional<unsigned> InRangeIndex,
                                       ArrayRef<Value *> Idxs);
 } // End llvm namespace
diff --git a/llvm/include/llvm/IR/ConstantFolder.h b/llvm/include/llvm/IR/ConstantFolder.h
index 3583ec1d3ae3b93..eed4fa622651f3e 100644
--- a/llvm/include/llvm/IR/ConstantFolder.h
+++ b/llvm/include/llvm/IR/ConstantFolder.h
@@ -28,7 +28,7 @@
 namespace llvm {
 
 /// ConstantFolder - Create constants with minimum, target independent, folding.
-class ConstantFolder final : public IRBuilderFolder {
+class LLVM_CLASS_ABI ConstantFolder final : public IRBuilderFolder {
   virtual void anchor();
 
 public:
diff --git a/llvm/include/llvm/IR/ConstantRange.h b/llvm/include/llvm/IR/ConstantRange.h
index ca36732e4e2e8c2..02888848adc434f 100644
--- a/llvm/include/llvm/IR/ConstantRange.h
+++ b/llvm/include/llvm/IR/ConstantRange.h
@@ -44,7 +44,7 @@ class raw_ostream;
 struct KnownBits;
 
 /// This class represents a range of values.
-class [[nodiscard]] ConstantRange {
+class LLVM_CLASS_ABI [[nodiscard]] ConstantRange {
   APInt Lower, Upper;
 
   /// Create empty constant range with same bitwidth.
@@ -576,7 +576,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const ConstantRange &CR) {
 /// Parse out a conservative ConstantRange from !range metadata.
 ///
 /// E.g. if RangeMD is !{i32 0, i32 10, i32 15, i32 20} then return [0, 20).
-ConstantRange getConstantRangeFromMetadata(const MDNode &RangeMD);
+LLVM_FUNC_ABI ConstantRange getConstantRangeFromMetadata(const MDNode &RangeMD);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
index 94940c816179eaa..e43b0b4e0c6c3fd 100644
--- a/llvm/include/llvm/IR/Constants.h
+++ b/llvm/include/llvm/IR/Constants.h
@@ -47,7 +47,7 @@ template <class ConstantClass> struct ConstantAggrKeyType;
 /// These constants have no operands; they represent their data directly.
 /// Since they can be in use by unrelated modules (and are never based on
 /// GlobalValues), it never makes sense to RAUW them.
-class ConstantData : public Constant {
+class LLVM_CLASS_ABI ConstantData : public Constant {
   friend class Constant;
 
   Value *handleOperandChangeImpl(Value *From, Value *To) {
@@ -75,7 +75,7 @@ class ConstantData : public Constant {
 /// This is the shared class of boolean and integer constants. This class
 /// represents both boolean and integral constants.
 /// Class for constant integers.
-class ConstantInt final : public ConstantData {
+class LLVM_CLASS_ABI ConstantInt final : public ConstantData {
   friend class Constant;
 
   APInt Val;
@@ -257,7 +257,7 @@ class ConstantInt final : public ConstantData {
 //===----------------------------------------------------------------------===//
 /// ConstantFP - Floating Point Values [float, double]
 ///
-class ConstantFP final : public ConstantData {
+class LLVM_CLASS_ABI ConstantFP final : public ConstantData {
   friend class Constant;
 
   APFloat Val;
@@ -332,7 +332,7 @@ class ConstantFP final : public ConstantData {
 //===----------------------------------------------------------------------===//
 /// All zero aggregate value
 ///
-class ConstantAggregateZero final : public ConstantData {
+class LLVM_CLASS_ABI ConstantAggregateZero final : public ConstantData {
   friend class Constant;
 
   explicit ConstantAggregateZero(Type *Ty)
@@ -381,7 +381,7 @@ class ConstantAggregateZero final : public ConstantData {
 /// \note Some subclasses of \a ConstantData are semantically aggregates --
 /// such as \a ConstantDataArray -- but are not subclasses of this because they
 /// use operands.
-class ConstantAggregate : public Constant {
+class LLVM_CLASS_ABI ConstantAggregate : public Constant {
 protected:
   ConstantAggregate(Type *T, ValueTy VT, ArrayRef<Constant *> V);
 
@@ -397,7 +397,7 @@ class ConstantAggregate : public Constant {
 };
 
 template <>
-struct OperandTraits<ConstantAggregate>
+struct LLVM_CLASS_ABI OperandTraits<ConstantAggregate>
     : public VariadicOperandTraits<ConstantAggregate> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantAggregate, Constant)
@@ -405,7 +405,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantAggregate, Constant)
 //===----------------------------------------------------------------------===//
 /// ConstantArray - Constant Array Declarations
 ///
-class ConstantArray final : public ConstantAggregate {
+class LLVM_CLASS_ABI ConstantArray final : public ConstantAggregate {
   friend struct ConstantAggrKeyType<ConstantArray>;
   friend class Constant;
 
@@ -437,7 +437,7 @@ class ConstantArray final : public ConstantAggregate {
 //===----------------------------------------------------------------------===//
 // Constant Struct Declarations
 //
-class ConstantStruct final : public ConstantAggregate {
+class LLVM_CLASS_ABI ConstantStruct final : public ConstantAggregate {
   friend struct ConstantAggrKeyType<ConstantStruct>;
   friend class Constant;
 
@@ -489,7 +489,7 @@ class ConstantStruct final : public ConstantAggregate {
 //===----------------------------------------------------------------------===//
 /// Constant Vector Declarations
 ///
-class ConstantVector final : public ConstantAggregate {
+class LLVM_CLASS_ABI ConstantVector final : public ConstantAggregate {
   friend struct ConstantAggrKeyType<ConstantVector>;
   friend class Constant;
 
@@ -530,7 +530,7 @@ class ConstantVector final : public ConstantAggregate {
 //===----------------------------------------------------------------------===//
 /// A constant pointer value that points to null
 ///
-class ConstantPointerNull final : public ConstantData {
+class LLVM_CLASS_ABI ConstantPointerNull final : public ConstantData {
   friend class Constant;
 
   explicit ConstantPointerNull(PointerType *T)
@@ -565,7 +565,7 @@ class ConstantPointerNull final : public ConstantData {
 ///
 /// This is the common base class of ConstantDataArray and ConstantDataVector.
 ///
-class ConstantDataSequential : public ConstantData {
+class LLVM_CLASS_ABI ConstantDataSequential : public ConstantData {
   friend class LLVMContextImpl;
   friend class Constant;
 
@@ -674,7 +674,7 @@ class ConstantDataSequential : public ConstantData {
 /// (i.e. ConstantInt/ConstantFP). This Constant node has no operands because it
 /// stores all of the elements of the constant as densely packed data, instead
 /// of as Value*'s.
-class ConstantDataArray final : public ConstantDataSequential {
+class LLVM_CLASS_ABI ConstantDataArray final : public ConstantDataSequential {
   friend class ConstantDataSequential;
 
   explicit ConstantDataArray(Type *ty, const char *Data)
@@ -748,7 +748,7 @@ class ConstantDataArray final : public ConstantDataSequential {
 /// (i.e. ConstantInt/ConstantFP). This Constant node has no operands because it
 /// stores all of the elements of the constant as densely packed data, instead
 /// of as Value*'s.
-class ConstantDataVector final : public ConstantDataSequential {
+class LLVM_CLASS_ABI ConstantDataVector final : public ConstantDataSequential {
   friend class ConstantDataSequential;
 
   explicit ConstantDataVector(Type *ty, const char *Data)
@@ -822,7 +822,7 @@ class ConstantDataVector final : public ConstantDataSequential {
 //===----------------------------------------------------------------------===//
 /// A constant token which is empty
 ///
-class ConstantTokenNone final : public ConstantData {
+class LLVM_CLASS_ABI ConstantTokenNone final : public ConstantData {
   friend class Constant;
 
   explicit ConstantTokenNone(LLVMContext &Context)
@@ -843,7 +843,7 @@ class ConstantTokenNone final : public ConstantData {
 };
 
 /// A constant target extension type default initializer
-class ConstantTargetNone final : public ConstantData {
+class LLVM_CLASS_ABI ConstantTargetNone final : public ConstantData {
   friend class Constant;
 
   explicit ConstantTargetNone(TargetExtType *T)
@@ -871,7 +871,7 @@ class ConstantTargetNone final : public ConstantData {
 
 /// The address of a basic block.
 ///
-class BlockAddress final : public Constant {
+class LLVM_CLASS_ABI BlockAddress final : public Constant {
   friend class Constant;
 
   BlockAddress(Function *F, BasicBlock *BB);
@@ -909,7 +909,7 @@ class BlockAddress final : public Constant {
 };
 
 template <>
-struct OperandTraits<BlockAddress>
+struct LLVM_CLASS_ABI OperandTraits<BlockAddress>
     : public FixedNumOperandTraits<BlockAddress, 2> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BlockAddress, Value)
@@ -917,7 +917,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BlockAddress, Value)
 /// Wrapper for a function that represents a value that
 /// functionally represents the original function. This can be a function,
 /// global alias to a function, or an ifunc.
-class DSOLocalEquivalent final : public Constant {
+class LLVM_CLASS_ABI DSOLocalEquivalent final : public Constant {
   friend class Constant;
 
   DSOLocalEquivalent(GlobalValue *GV);
@@ -947,14 +947,14 @@ class DSOLocalEquivalent final : public Constant {
 };
 
 template <>
-struct OperandTraits<DSOLocalEquivalent>
+struct LLVM_CLASS_ABI OperandTraits<DSOLocalEquivalent>
     : public FixedNumOperandTraits<DSOLocalEquivalent, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(DSOLocalEquivalent, Value)
 
 /// Wrapper for a value that won't be replaced with a CFI jump table
 /// pointer in LowerTypeTestsModule.
-class NoCFIValue final : public Constant {
+class LLVM_CLASS_ABI NoCFIValue final : public Constant {
   friend class Constant;
 
   NoCFIValue(GlobalValue *GV);
@@ -982,7 +982,7 @@ class NoCFIValue final : public Constant {
 };
 
 template <>
-struct OperandTraits<NoCFIValue> : public FixedNumOperandTraits<NoCFIValue, 1> {
+struct LLVM_CLASS_ABI OperandTraits<NoCFIValue> : public FixedNumOperandTraits<NoCFIValue, 1> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(NoCFIValue, Value)
@@ -994,7 +994,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(NoCFIValue, Value)
 /// This class uses the standard Instruction opcodes to define the various
 /// constant expressions.  The Opcode field for the ConstantExpr class is
 /// maintained in the Value::SubclassData field.
-class ConstantExpr : public Constant {
+class LLVM_CLASS_ABI ConstantExpr : public Constant {
   friend struct ConstantExprKeyType;
   friend class Constant;
 
@@ -1352,7 +1352,7 @@ class ConstantExpr : public Constant {
 };
 
 template <>
-struct OperandTraits<ConstantExpr>
+struct LLVM_CLASS_ABI OperandTraits<ConstantExpr>
     : public VariadicOperandTraits<ConstantExpr, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantExpr, Constant)
@@ -1367,7 +1367,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantExpr, Constant)
 /// can appear to have different bit patterns at each use. See
 /// LangRef.html#undefvalues for details.
 ///
-class UndefValue : public ConstantData {
+class LLVM_CLASS_ABI UndefValue : public ConstantData {
   friend class Constant;
 
   explicit UndefValue(Type *T) : ConstantData(T, UndefValueVal) {}
@@ -1415,7 +1415,7 @@ class UndefValue : public ConstantData {
 ///
 /// see LangRef.html#poisonvalues for details.
 ///
-class PoisonValue final : public UndefValue {
+class LLVM_CLASS_ABI PoisonValue final : public UndefValue {
   friend class Constant;
 
   explicit PoisonValue(Type *T) : UndefValue(T, PoisonValueVal) {}
diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h
index 3a594efb5df5128..85bba1d92791f2b 100644
--- a/llvm/include/llvm/IR/DIBuilder.h
+++ b/llvm/include/llvm/IR/DIBuilder.h
@@ -40,7 +40,7 @@ namespace llvm {
   class Value;
   class DbgAssignIntrinsic;
 
-  class DIBuilder {
+  class LLVM_CLASS_ABI DIBuilder {
     Module &M;
     LLVMContext &VMContext;
 
diff --git a/llvm/include/llvm/IR/DataLayout.h b/llvm/include/llvm/IR/DataLayout.h
index 7d92ac6c64fb96a..538c9293b28001b 100644
--- a/llvm/include/llvm/IR/DataLayout.h
+++ b/llvm/include/llvm/IR/DataLayout.h
@@ -69,7 +69,7 @@ enum AlignTypeEnum {
 ///
 /// \note The unusual order of elements in the structure attempts to reduce
 /// padding and make the structure slightly more cache friendly.
-struct LayoutAlignElem {
+struct LLVM_CLASS_ABI LayoutAlignElem {
   uint32_t TypeBitWidth;
   Align ABIAlign;
   Align PrefAlign;
@@ -86,7 +86,7 @@ struct LayoutAlignElem {
 ///
 /// \note The unusual order of elements in the structure attempts to reduce
 /// padding and make the structure slightly more cache friendly.
-struct PointerAlignElem {
+struct LLVM_CLASS_ABI PointerAlignElem {
   Align ABIAlign;
   Align PrefAlign;
   uint32_t TypeBitWidth;
@@ -107,7 +107,7 @@ struct PointerAlignElem {
 /// The target data layout string is specified *by the target* - a frontend
 /// generating LLVM IR is required to generate the right target data for the
 /// target being codegen'd to.
-class DataLayout {
+class LLVM_CLASS_ABI DataLayout {
 public:
   enum class FunctionPtrAlignType {
     /// The function pointer alignment is independent of the function alignment.
@@ -615,7 +615,7 @@ inline LLVMTargetDataRef wrap(const DataLayout *P) {
 
 /// Used to lazily calculate structure layout information for a target machine,
 /// based on the DataLayout structure.
-class StructLayout final : public TrailingObjects<StructLayout, TypeSize> {
+class LLVM_CLASS_ABI StructLayout final : public TrailingObjects<StructLayout, TypeSize> {
   TypeSize StructSize;
   Align StructAlignment;
   unsigned IsPadded : 1;
diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h
index 0ee67a803863617..5352ec8f1c5767c 100644
--- a/llvm/include/llvm/IR/DebugInfo.h
+++ b/llvm/include/llvm/IR/DebugInfo.h
@@ -38,28 +38,28 @@ class Module;
 
 /// Finds dbg.declare intrinsics declaring local variables as living in the
 /// memory that 'V' points to.
-TinyPtrVector<DbgDeclareInst *> FindDbgDeclareUses(Value *V);
+LLVM_FUNC_ABI TinyPtrVector<DbgDeclareInst *> FindDbgDeclareUses(Value *V);
 
 /// Finds the llvm.dbg.value intrinsics describing a value.
-void findDbgValues(SmallVectorImpl<DbgValueInst *> &DbgValues, Value *V);
+LLVM_FUNC_ABI void findDbgValues(SmallVectorImpl<DbgValueInst *> &DbgValues, Value *V);
 
 /// Finds the debug info intrinsics describing a value.
-void findDbgUsers(SmallVectorImpl<DbgVariableIntrinsic *> &DbgInsts, Value *V);
+LLVM_FUNC_ABI void findDbgUsers(SmallVectorImpl<DbgVariableIntrinsic *> &DbgInsts, Value *V);
 
 /// Find subprogram that is enclosing this scope.
-DISubprogram *getDISubprogram(const MDNode *Scope);
+LLVM_FUNC_ABI DISubprogram *getDISubprogram(const MDNode *Scope);
 
 /// Produce a DebugLoc to use for each dbg.declare that is promoted to a
 /// dbg.value.
-DebugLoc getDebugValueLoc(DbgVariableIntrinsic *DII);
+LLVM_FUNC_ABI DebugLoc getDebugValueLoc(DbgVariableIntrinsic *DII);
 
 /// Strip debug info in the module if it exists.
 ///
 /// To do this, we remove all calls to the debugger intrinsics and any named
 /// metadata for debugging. We also remove debug locations for instructions.
 /// Return true if module is modified.
-bool StripDebugInfo(Module &M);
-bool stripDebugInfo(Function &F);
+LLVM_FUNC_ABI bool StripDebugInfo(Module &M);
+LLVM_FUNC_ABI bool stripDebugInfo(Function &F);
 
 /// Downgrade the debug info in a module to contain only line table information.
 ///
@@ -71,17 +71,17 @@ bool stripDebugInfo(Function &F);
 ///   4) Create a new CU debug info, and similarly for every metadata node
 ///      that's reachable from the CU debug info.
 ///   All debug type metadata nodes are unreachable and garbage collected.
-bool stripNonLineTableDebugInfo(Module &M);
+LLVM_FUNC_ABI bool stripNonLineTableDebugInfo(Module &M);
 
 /// Update the debug locations contained within the MD_loop metadata attached
 /// to the instruction \p I, if one exists. \p Updater is applied to Metadata
 /// operand in the MD_loop metadata: the returned value is included in the
 /// updated loop metadata node if it is non-null.
-void updateLoopMetadataDebugLocations(
+LLVM_FUNC_ABI void updateLoopMetadataDebugLocations(
     Instruction &I, function_ref<Metadata *(Metadata *)> Updater);
 
 /// Return Debug Info Metadata Version by checking module flags.
-unsigned getDebugMetadataVersionFromModule(const Module &M);
+LLVM_FUNC_ABI unsigned getDebugMetadataVersionFromModule(const Module &M);
 
 /// Utility to find all debug info in a module.
 ///
@@ -91,7 +91,7 @@ unsigned getDebugMetadataVersionFromModule(const Module &M);
 /// DbgValueInst and DbgLoc attached to instructions. processModule will go
 /// through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
 /// used by the CUs.
-class DebugInfoFinder {
+class LLVM_CLASS_ABI DebugInfoFinder {
 public:
   /// Process entire module and collect debug info anchors.
   void processModule(const Module &M);
@@ -175,7 +175,7 @@ using AssignmentInstRange =
 /// as an attachment.
 /// Iterators invalidated by adding or removing DIAssignID metadata to/from any
 /// instruction (including by deleting or cloning instructions).
-AssignmentInstRange getAssignmentInsts(DIAssignID *ID);
+LLVM_FUNC_ABI AssignmentInstRange getAssignmentInsts(DIAssignID *ID);
 /// Return a range of instructions (typically just one) that perform the
 /// assignment that \p DAI encodes.
 /// Iterators invalidated by adding or removing DIAssignID metadata to/from any
@@ -190,7 +190,7 @@ inline AssignmentInstRange getAssignmentInsts(const DbgAssignIntrinsic *DAI) {
 /// High level: this is an iterator for llvm.dbg.assign intrinsics.
 /// Implementation details: this is a wrapper around Value's User iterator that
 /// dereferences to a DbgAssignIntrinsic ptr rather than a User ptr.
-class DbgAssignIt
+class LLVM_CLASS_ABI DbgAssignIt
     : public iterator_adaptor_base<DbgAssignIt, Value::user_iterator,
                                    typename std::iterator_traits<
                                        Value::user_iterator>::iterator_category,
@@ -205,7 +205,7 @@ class DbgAssignIt
 using AssignmentMarkerRange = iterator_range<DbgAssignIt>;
 /// Return a range of dbg.assign intrinsics which use \ID as an operand.
 /// Iterators invalidated by deleting an intrinsic contained in this range.
-AssignmentMarkerRange getAssignmentMarkers(DIAssignID *ID);
+LLVM_FUNC_ABI AssignmentMarkerRange getAssignmentMarkers(DIAssignID *ID);
 /// Return a range of dbg.assign intrinsics for which \p Inst performs the
 /// assignment they encode.
 /// Iterators invalidated by deleting an intrinsic contained in this range.
@@ -217,13 +217,13 @@ inline AssignmentMarkerRange getAssignmentMarkers(const Instruction *Inst) {
 }
 
 /// Delete the llvm.dbg.assign intrinsics linked to \p Inst.
-void deleteAssignmentMarkers(const Instruction *Inst);
+LLVM_FUNC_ABI void deleteAssignmentMarkers(const Instruction *Inst);
 
 /// Replace all uses (and attachments) of \p Old with \p New.
-void RAUW(DIAssignID *Old, DIAssignID *New);
+LLVM_FUNC_ABI void RAUW(DIAssignID *Old, DIAssignID *New);
 
 /// Remove all Assignment Tracking related intrinsics and metadata from \p F.
-void deleteAll(Function *F);
+LLVM_FUNC_ABI void deleteAll(Function *F);
 
 /// Calculate the fragment of the variable in \p DAI covered
 /// from (Dest + SliceOffsetInBits) to
@@ -234,7 +234,7 @@ void deleteAll(Function *F);
 /// variable size) in DAI.
 ///
 /// Result contains a zero-sized fragment if there's no intersect.
-bool calculateFragmentIntersect(
+LLVM_FUNC_ABI bool calculateFragmentIntersect(
     const DataLayout &DL, const Value *Dest, uint64_t SliceOffsetInBits,
     uint64_t SliceSizeInBits, const DbgAssignIntrinsic *DAI,
     std::optional<DIExpression::FragmentInfo> &Result);
@@ -245,7 +245,7 @@ bool calculateFragmentIntersect(
 /// explicit using types. In addition, eventually we will want to understand
 /// expressions that modify the base address too, which a DebugVariable doesn't
 /// capture.
-struct VarRecord {
+struct LLVM_CLASS_ABI VarRecord {
   DILocalVariable *Var;
   DILocation *DL;
 
@@ -268,13 +268,13 @@ using StorageToVarsMap = DenseMap<const AllocaInst *, SmallSet<VarRecord, 2>>;
 
 /// Track assignments to \p Vars between \p Start and \p End.
 
-void trackAssignments(Function::iterator Start, Function::iterator End,
+LLVM_FUNC_ABI void trackAssignments(Function::iterator Start, Function::iterator End,
                       const StorageToVarsMap &Vars, const DataLayout &DL,
                       bool DebugPrints = false);
 
 /// Describes properties of a store that has a static size and offset into a
 /// some base storage. Used by the getAssignmentInfo functions.
-struct AssignmentInfo {
+struct LLVM_CLASS_ABI AssignmentInfo {
   AllocaInst const *Base;  ///< Base storage.
   uint64_t OffsetInBits;   ///< Offset into Base.
   uint64_t SizeInBits;     ///< Number of bits stored.
@@ -288,11 +288,11 @@ struct AssignmentInfo {
             SizeInBits == DL.getTypeSizeInBits(Base->getAllocatedType())) {}
 };
 
-std::optional<AssignmentInfo> getAssignmentInfo(const DataLayout &DL,
+LLVM_FUNC_ABI std::optional<AssignmentInfo> getAssignmentInfo(const DataLayout &DL,
                                                 const MemIntrinsic *I);
-std::optional<AssignmentInfo> getAssignmentInfo(const DataLayout &DL,
+LLVM_FUNC_ABI std::optional<AssignmentInfo> getAssignmentInfo(const DataLayout &DL,
                                                 const StoreInst *SI);
-std::optional<AssignmentInfo> getAssignmentInfo(const DataLayout &DL,
+LLVM_FUNC_ABI std::optional<AssignmentInfo> getAssignmentInfo(const DataLayout &DL,
                                                 const AllocaInst *AI);
 
 } // end namespace at
@@ -303,7 +303,7 @@ std::optional<AssignmentInfo> getAssignmentInfo(const DataLayout &DL,
 /// be left with their dbg.declare intrinsics.
 /// The pass sets the debug-info-assignment-tracking module flag to true to
 /// indicate assignment tracking has been enabled.
-class AssignmentTrackingPass : public PassInfoMixin<AssignmentTrackingPass> {
+class LLVM_CLASS_ABI AssignmentTrackingPass : public PassInfoMixin<AssignmentTrackingPass> {
   /// Note: this method does not set the debug-info-assignment-tracking module
   /// flag.
   bool runOnFunction(Function &F);
@@ -314,7 +314,7 @@ class AssignmentTrackingPass : public PassInfoMixin<AssignmentTrackingPass> {
 };
 
 /// Return true if assignment tracking is enabled for module \p M.
-bool isAssignmentTrackingEnabled(const Module &M);
+LLVM_FUNC_ABI bool isAssignmentTrackingEnabled(const Module &M);
 } // end namespace llvm
 
 #endif // LLVM_IR_DEBUGINFO_H
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index 5f071d254a10053..710825a6b6490a0 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -66,9 +66,9 @@ enum Tag : uint16_t;
 
 class DbgVariableIntrinsic;
 
-extern cl::opt<bool> EnableFSDiscriminator;
+LLVM_FUNC_ABI extern cl::opt<bool> EnableFSDiscriminator;
 
-class DITypeRefArray {
+class LLVM_CLASS_ABI DITypeRefArray {
   const MDTuple *N = nullptr;
 
 public:
@@ -128,7 +128,7 @@ class DITypeRefArray {
 /// A metadata node with a DWARF tag (i.e., a constant named \c DW_TAG_*,
 /// defined in llvm/BinaryFormat/Dwarf.h).  Called \a DINode because it's
 /// potentially used for non-DWARF output.
-class DINode : public MDNode {
+class LLVM_CLASS_ABI DINode : public MDNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -227,7 +227,7 @@ class DINode : public MDNode {
 /// (possibly empty) null-separated \a MDString header that contains arbitrary
 /// fields.  The remaining operands are \a dwarf_operands(), and are pointers
 /// to other metadata.
-class GenericDINode : public DINode {
+class LLVM_CLASS_ABI GenericDINode : public DINode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -300,7 +300,7 @@ class GenericDINode : public DINode {
 /// Used to link stores (as an attachment) and dbg.assigns (as an operand).
 /// DIAssignID metadata is never uniqued as we compare instances using
 /// referential equality (the instance/address is the ID).
-class DIAssignID : public MDNode {
+class LLVM_CLASS_ABI DIAssignID : public MDNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -335,7 +335,7 @@ class DIAssignID : public MDNode {
 ///
 /// TODO: Merge into node for DW_TAG_array_type, which should have a custom
 /// type.
-class DISubrange : public DINode {
+class LLVM_CLASS_ABI DISubrange : public DINode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -398,7 +398,7 @@ class DISubrange : public DINode {
   }
 };
 
-class DIGenericSubrange : public DINode {
+class LLVM_CLASS_ABI DIGenericSubrange : public DINode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -446,7 +446,7 @@ class DIGenericSubrange : public DINode {
 ///
 /// TODO: Add a pointer to the context (DW_TAG_enumeration_type) once that no
 /// longer creates a type cycle.
-class DIEnumerator : public DINode {
+class LLVM_CLASS_ABI DIEnumerator : public DINode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -506,7 +506,7 @@ class DIEnumerator : public DINode {
 /// contexts).
 ///
 /// TODO: Separate the concepts of declaration contexts and lexical scopes.
-class DIScope : public DINode {
+class LLVM_CLASS_ABI DIScope : public DINode {
 protected:
   DIScope(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag,
           ArrayRef<Metadata *> Ops)
@@ -560,7 +560,7 @@ class DIScope : public DINode {
 ///
 /// TODO: Merge with directory/file node (including users).
 /// TODO: Canonicalize paths on creation.
-class DIFile : public DIScope {
+class LLVM_CLASS_ABI DIFile : public DIScope {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -695,7 +695,7 @@ std::optional<StringRef> DIScope::getSource() const {
 /// TODO: Remove the hardcoded name and context, since many types don't use
 /// them.
 /// TODO: Split up flags.
-class DIType : public DIScope {
+class LLVM_CLASS_ABI DIType : public DIScope {
   unsigned Line;
   DIFlags Flags;
   uint64_t SizeInBits;
@@ -801,7 +801,7 @@ class DIType : public DIScope {
 ///
 /// TODO: Split out DW_TAG_unspecified_type.
 /// TODO: Drop unused accessors.
-class DIBasicType : public DIType {
+class LLVM_CLASS_ABI DIBasicType : public DIType {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -869,7 +869,7 @@ class DIBasicType : public DIType {
 };
 
 /// String type, Fortran CHARACTER(n)
-class DIStringType : public DIType {
+class LLVM_CLASS_ABI DIStringType : public DIType {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -961,7 +961,7 @@ class DIStringType : public DIType {
 /// class members.
 ///
 /// TODO: Split out members (inheritance, fields, methods, etc.).
-class DIDerivedType : public DIType {
+class LLVM_CLASS_ABI DIDerivedType : public DIType {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -1081,7 +1081,7 @@ class DIDerivedType : public DIType {
 ///
 /// TODO: Detach from DerivedTypeBase (split out MDEnumType?).
 /// TODO: Create a custom, unrelated node for DW_TAG_array_type.
-class DICompositeType : public DIType {
+class LLVM_CLASS_ABI DICompositeType : public DIType {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -1304,7 +1304,7 @@ class DICompositeType : public DIType {
 /// Type array for a subprogram.
 ///
 /// TODO: Fold the array of types in directly as operands.
-class DISubroutineType : public DIType {
+class LLVM_CLASS_ABI DISubroutineType : public DIType {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -1361,7 +1361,7 @@ class DISubroutineType : public DIType {
 };
 
 /// Compile unit.
-class DICompileUnit : public DIScope {
+class LLVM_CLASS_ABI DICompileUnit : public DIScope {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -1567,7 +1567,7 @@ class DICompileUnit : public DIScope {
 /// A legal scope for lexical blocks, local variables, and debug info
 /// locations.  Subclasses are \a DISubprogram, \a DILexicalBlock, and \a
 /// DILexicalBlockFile.
-class DILocalScope : public DIScope {
+class LLVM_CLASS_ABI DILocalScope : public DIScope {
 protected:
   DILocalScope(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag,
                ArrayRef<Metadata *> Ops)
@@ -1602,7 +1602,7 @@ class DILocalScope : public DIScope {
 };
 
 /// Subprogram description.
-class DISubprogram : public DILocalScope {
+class LLVM_CLASS_ABI DISubprogram : public DILocalScope {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -1875,7 +1875,7 @@ class DISubprogram : public DILocalScope {
 /// Debug location.
 ///
 /// A debug location in source code, used for debug info and otherwise.
-class DILocation : public MDNode {
+class LLVM_CLASS_ABI DILocation : public MDNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -2130,7 +2130,7 @@ class DILocation : public MDNode {
   }
 };
 
-class DILexicalBlockBase : public DILocalScope {
+class LLVM_CLASS_ABI DILexicalBlockBase : public DILocalScope {
 protected:
   DILexicalBlockBase(LLVMContext &C, unsigned ID, StorageType Storage,
                      ArrayRef<Metadata *> Ops);
@@ -2152,7 +2152,7 @@ class DILexicalBlockBase : public DILocalScope {
   }
 };
 
-class DILexicalBlock : public DILexicalBlockBase {
+class LLVM_CLASS_ABI DILexicalBlock : public DILexicalBlockBase {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -2205,7 +2205,7 @@ class DILexicalBlock : public DILexicalBlockBase {
   }
 };
 
-class DILexicalBlockFile : public DILexicalBlockBase {
+class LLVM_CLASS_ABI DILexicalBlockFile : public DILexicalBlockBase {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -2329,7 +2329,7 @@ DILocation::cloneByMultiplyingDuplicationFactor(unsigned DF) const {
   return std::nullopt;
 }
 
-class DINamespace : public DIScope {
+class LLVM_CLASS_ABI DINamespace : public DIScope {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -2378,7 +2378,7 @@ class DINamespace : public DIScope {
 
 /// Represents a module in the programming language, for example, a Clang
 /// module, or a Fortran module.
-class DIModule : public DIScope {
+class LLVM_CLASS_ABI DIModule : public DIScope {
   friend class LLVMContextImpl;
   friend class MDNode;
   unsigned LineNo;
@@ -2451,7 +2451,7 @@ class DIModule : public DIScope {
 };
 
 /// Base class for template parameters.
-class DITemplateParameter : public DINode {
+class LLVM_CLASS_ABI DITemplateParameter : public DINode {
 protected:
   bool IsDefault;
 
@@ -2474,7 +2474,7 @@ class DITemplateParameter : public DINode {
   }
 };
 
-class DITemplateTypeParameter : public DITemplateParameter {
+class LLVM_CLASS_ABI DITemplateTypeParameter : public DITemplateParameter {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -2513,7 +2513,7 @@ class DITemplateTypeParameter : public DITemplateParameter {
   }
 };
 
-class DITemplateValueParameter : public DITemplateParameter {
+class LLVM_CLASS_ABI DITemplateValueParameter : public DITemplateParameter {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -2563,7 +2563,7 @@ class DITemplateValueParameter : public DITemplateParameter {
 };
 
 /// Base class for variables.
-class DIVariable : public DINode {
+class LLVM_CLASS_ABI DIVariable : public DINode {
   unsigned Line;
   uint32_t AlignInBits;
 
@@ -2629,7 +2629,7 @@ class DIVariable : public DINode {
 /// TODO: Co-allocate the expression elements.
 /// TODO: Separate from MDNode, or otherwise drop Distinct and Temporary
 /// storage types.
-class DIExpression : public MDNode {
+class LLVM_CLASS_ABI DIExpression : public MDNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3039,7 +3039,7 @@ inline bool operator<(const DIExpression::FragmentInfo &A,
          std::tie(B.SizeInBits, B.OffsetInBits);
 }
 
-template <> struct DenseMapInfo<DIExpression::FragmentInfo> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<DIExpression::FragmentInfo> {
   using FragInfo = DIExpression::FragmentInfo;
   static const uint64_t MaxVal = std::numeric_limits<uint64_t>::max();
 
@@ -3057,7 +3057,7 @@ template <> struct DenseMapInfo<DIExpression::FragmentInfo> {
 /// Global variables.
 ///
 /// TODO: Remove DisplayName.  It's always equal to Name.
-class DIGlobalVariable : public DIVariable {
+class LLVM_CLASS_ABI DIGlobalVariable : public DIVariable {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3142,7 +3142,7 @@ class DIGlobalVariable : public DIVariable {
   }
 };
 
-class DICommonBlock : public DIScope {
+class LLVM_CLASS_ABI DICommonBlock : public DIScope {
   unsigned LineNo;
 
   friend class LLVMContextImpl;
@@ -3201,7 +3201,7 @@ class DICommonBlock : public DIScope {
 /// Local variable.
 ///
 /// TODO: Split up flags.
-class DILocalVariable : public DIVariable {
+class LLVM_CLASS_ABI DILocalVariable : public DIVariable {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3291,7 +3291,7 @@ class DILocalVariable : public DIVariable {
 
 /// Label.
 ///
-class DILabel : public DINode {
+class LLVM_CLASS_ABI DILabel : public DINode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3356,7 +3356,7 @@ class DILabel : public DINode {
   }
 };
 
-class DIObjCProperty : public DINode {
+class LLVM_CLASS_ABI DIObjCProperty : public DINode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3436,7 +3436,7 @@ class DIObjCProperty : public DINode {
 };
 
 /// An imported module (C++ using directive or similar).
-class DIImportedEntity : public DINode {
+class LLVM_CLASS_ABI DIImportedEntity : public DINode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3501,7 +3501,7 @@ class DIImportedEntity : public DINode {
 };
 
 /// A pair of DIGlobalVariable and DIExpression.
-class DIGlobalVariableExpression : public MDNode {
+class LLVM_CLASS_ABI DIGlobalVariableExpression : public MDNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3548,7 +3548,7 @@ class DIGlobalVariableExpression : public MDNode {
 /// \c DW_MACINFO_*, defined in llvm/BinaryFormat/Dwarf.h).  Called \a
 /// DIMacroNode
 /// because it's potentially used for non-DWARF output.
-class DIMacroNode : public MDNode {
+class LLVM_CLASS_ABI DIMacroNode : public MDNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3592,7 +3592,7 @@ class DIMacroNode : public MDNode {
   }
 };
 
-class DIMacro : public DIMacroNode {
+class LLVM_CLASS_ABI DIMacro : public DIMacroNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3643,7 +3643,7 @@ class DIMacro : public DIMacroNode {
   }
 };
 
-class DIMacroFile : public DIMacroNode {
+class LLVM_CLASS_ABI DIMacroFile : public DIMacroNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -3709,7 +3709,7 @@ class DIMacroFile : public DIMacroNode {
 
 /// List of ValueAsMetadata, to be used as an argument to a dbg.value
 /// intrinsic.
-class DIArgList : public MDNode {
+class LLVM_CLASS_ABI DIArgList : public MDNode {
   friend class LLVMContextImpl;
   friend class MDNode;
   using iterator = SmallVectorImpl<ValueAsMetadata *>::iterator;
@@ -3764,7 +3764,7 @@ class DIArgList : public MDNode {
 /// possible that a DebugVariable with different parameters may point to the
 /// same variable instance, but not that one DebugVariable points to multiple
 /// variable instances.
-class DebugVariable {
+class LLVM_CLASS_ABI DebugVariable {
   using FragmentInfo = DIExpression::FragmentInfo;
 
   const DILocalVariable *Variable;
@@ -3812,7 +3812,7 @@ class DebugVariable {
   }
 };
 
-template <> struct DenseMapInfo<DebugVariable> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<DebugVariable> {
   using FragmentInfo = DIExpression::FragmentInfo;
 
   /// Empty key: no key should be generated that has no DILocalVariable.
@@ -3841,7 +3841,7 @@ template <> struct DenseMapInfo<DebugVariable> {
 
 /// Identifies a unique instance of a whole variable (discards/ignores fragment
 /// information).
-class DebugVariableAggregate : public DebugVariable {
+class LLVM_CLASS_ABI DebugVariableAggregate : public DebugVariable {
 public:
   DebugVariableAggregate(const DbgVariableIntrinsic *DVI);
   DebugVariableAggregate(const DebugVariable &V)
@@ -3849,7 +3849,7 @@ class DebugVariableAggregate : public DebugVariable {
 };
 
 template <>
-struct DenseMapInfo<DebugVariableAggregate>
+struct LLVM_CLASS_ABI DenseMapInfo<DebugVariableAggregate>
     : public DenseMapInfo<DebugVariable> {};
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/IR/DebugLoc.h b/llvm/include/llvm/IR/DebugLoc.h
index 63b9d789e14a22f..364a60576c74d1d 100644
--- a/llvm/include/llvm/IR/DebugLoc.h
+++ b/llvm/include/llvm/IR/DebugLoc.h
@@ -31,7 +31,7 @@ namespace llvm {
   ///
   /// To avoid extra includes, \a DebugLoc doubles the \a DILocation API with a
   /// one based on relatively opaque \a MDNode pointers.
-  class DebugLoc {
+  class LLVM_CLASS_ABI DebugLoc {
     TrackingMDNodeRef Loc;
 
   public:
diff --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h
index 4f8c9e65ff9347c..8c7e8becb0ee9f6 100644
--- a/llvm/include/llvm/IR/DerivedTypes.h
+++ b/llvm/include/llvm/IR/DerivedTypes.h
@@ -37,7 +37,7 @@ class LLVMContext;
 /// represent the built-in integer types: Int1Ty, Int8Ty, Int16Ty, Int32Ty and
 /// Int64Ty.
 /// Integer representation type
-class IntegerType : public Type {
+class LLVM_CLASS_ABI IntegerType : public Type {
   friend class LLVMContextImpl;
 
 protected:
@@ -100,7 +100,7 @@ unsigned Type::getIntegerBitWidth() const {
 
 /// Class to represent function types
 ///
-class FunctionType : public Type {
+class LLVM_CLASS_ABI FunctionType : public Type {
   FunctionType(Type *Result, ArrayRef<Type*> Params, bool IsVarArgs);
 
 public:
@@ -162,7 +162,7 @@ unsigned Type::getFunctionNumParams() const {
 /// passed around as a single entity. This assists in replacing the use of
 /// PointerType::getElementType() to access the function's type, since that's
 /// slated for removal as part of the [opaque pointer types] project.
-class FunctionCallee {
+class LLVM_CLASS_ABI FunctionCallee {
 public:
   // Allow implicit conversion from types which have a getFunctionType member
   // (e.g. Function and InlineAsm).
@@ -210,7 +210,7 @@ class FunctionCallee {
 /// elements as defined by DataLayout (which is required to match what the code
 /// generator for a target expects).
 ///
-class StructType : public Type {
+class LLVM_CLASS_ABI StructType : public Type {
   StructType(LLVMContext &C) : Type(C, StructTyID) {}
 
   enum {
@@ -365,7 +365,7 @@ Type *Type::getStructElementType(unsigned N) const {
 }
 
 /// Class to represent array types.
-class ArrayType : public Type {
+class LLVM_CLASS_ABI ArrayType : public Type {
   /// The element type of the array.
   Type *ContainedType;
   /// Number of elements in the array.
@@ -397,7 +397,7 @@ uint64_t Type::getArrayNumElements() const {
 }
 
 /// Base class of all SIMD vector types
-class VectorType : public Type {
+class LLVM_CLASS_ABI VectorType : public Type {
   /// A fully specified VectorType is of the form <vscale x n x Ty>. 'n' is the
   /// minimum number of elements of type Ty contained within the vector, and
   /// 'vscale x' indicates that the total element count is an integer multiple
@@ -533,7 +533,7 @@ class VectorType : public Type {
 };
 
 /// Class to represent fixed width SIMD vectors
-class FixedVectorType : public VectorType {
+class LLVM_CLASS_ABI FixedVectorType : public VectorType {
 protected:
   FixedVectorType(Type *ElTy, unsigned NumElts)
       : VectorType(ElTy, NumElts, FixedVectorTyID) {}
@@ -580,7 +580,7 @@ class FixedVectorType : public VectorType {
 };
 
 /// Class to represent scalable SIMD vectors
-class ScalableVectorType : public VectorType {
+class LLVM_CLASS_ABI ScalableVectorType : public VectorType {
 protected:
   ScalableVectorType(Type *ElTy, unsigned MinNumElts)
       : VectorType(ElTy, MinNumElts, ScalableVectorTyID) {}
@@ -640,7 +640,7 @@ inline ElementCount VectorType::getElementCount() const {
 }
 
 /// Class to represent pointers.
-class PointerType : public Type {
+class LLVM_CLASS_ABI PointerType : public Type {
   explicit PointerType(Type *ElType, unsigned AddrSpace);
   explicit PointerType(LLVMContext &C, unsigned AddrSpace);
 
@@ -747,7 +747,7 @@ unsigned Type::getPointerAddressSpace() const {
 /// Target extension types have a string name, and optionally have type and/or
 /// integer parameters. The exact meaning of any parameters is dependent on the
 /// target.
-class TargetExtType : public Type {
+class LLVM_CLASS_ABI TargetExtType : public Type {
   TargetExtType(LLVMContext &C, StringRef Name, ArrayRef<Type *> Types,
                 ArrayRef<unsigned> Ints);
 
diff --git a/llvm/include/llvm/IR/DerivedUser.h b/llvm/include/llvm/IR/DerivedUser.h
index 248535f81350974..0e9c08b86496213 100644
--- a/llvm/include/llvm/IR/DerivedUser.h
+++ b/llvm/include/llvm/IR/DerivedUser.h
@@ -25,7 +25,7 @@ class Use;
 /// that can't be extended by code outside of lib/IR. This class creates a
 /// loophole that allows classes outside of lib/IR to extend User to leverage
 /// its use/def list machinery.
-class DerivedUser : public User {
+class LLVM_CLASS_ABI DerivedUser : public User {
 protected:
   using  DeleteValueTy = void (*)(DerivedUser *);
 
diff --git a/llvm/include/llvm/IR/DiagnosticHandler.h b/llvm/include/llvm/IR/DiagnosticHandler.h
index da324750f134ef6..61c03a28daf08fe 100644
--- a/llvm/include/llvm/IR/DiagnosticHandler.h
+++ b/llvm/include/llvm/IR/DiagnosticHandler.h
@@ -22,7 +22,7 @@ class DiagnosticInfo;
 /// The handleDiagnostics method must be overriden by the subclasses to handle
 /// diagnostic. The *RemarkEnabled methods can be overriden to control
 /// which remarks are enabled.
-struct DiagnosticHandler {
+struct LLVM_CLASS_ABI DiagnosticHandler {
   void *DiagnosticContext = nullptr;
   DiagnosticHandler(void *DiagContext = nullptr)
       : DiagnosticContext(DiagContext) {}
diff --git a/llvm/include/llvm/IR/DiagnosticInfo.h b/llvm/include/llvm/IR/DiagnosticInfo.h
index 7aecf56f905379f..2f9e94bf96a41af 100644
--- a/llvm/include/llvm/IR/DiagnosticInfo.h
+++ b/llvm/include/llvm/IR/DiagnosticInfo.h
@@ -99,14 +99,14 @@ enum DiagnosticKind {
 /// The returned ID will be greater than or equal to DK_FirstPluginKind.
 /// Thus, the plugin identifiers will not conflict with the
 /// DiagnosticKind values.
-int getNextAvailablePluginDiagnosticKind();
+LLVM_FUNC_ABI int getNextAvailablePluginDiagnosticKind();
 
 /// This is the base abstract class for diagnostic reporting in
 /// the backend.
 /// The print method must be overloaded by the subclasses to print a
 /// user-friendly message in the client of the backend (let us call it a
 /// frontend).
-class DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfo {
 private:
   /// Kind defines the kind of report this is about.
   const /* DiagnosticKind */ int Kind;
@@ -136,7 +136,7 @@ using DiagnosticHandlerFunction = std::function<void(const DiagnosticInfo &)>;
 
 /// Diagnostic information for inline asm reporting.
 /// This is basically a message and an optional location.
-class DiagnosticInfoInlineAsm : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoInlineAsm : public DiagnosticInfo {
 private:
   /// Optional line information. 0 if not set.
   uint64_t LocCookie = 0;
@@ -184,7 +184,7 @@ class DiagnosticInfoInlineAsm : public DiagnosticInfo {
 
 /// Diagnostic information for debug metadata version reporting.
 /// This is basically a module and a version.
-class DiagnosticInfoDebugMetadataVersion : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoDebugMetadataVersion : public DiagnosticInfo {
 private:
   /// The module that is concerned by this debug metadata version diagnostic.
   const Module &M;
@@ -211,7 +211,7 @@ class DiagnosticInfoDebugMetadataVersion : public DiagnosticInfo {
 };
 
 /// Diagnostic information for stripping invalid debug metadata.
-class DiagnosticInfoIgnoringInvalidDebugMetadata : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoIgnoringInvalidDebugMetadata : public DiagnosticInfo {
 private:
   /// The module that is concerned by this debug metadata version diagnostic.
   const Module &M;
@@ -233,7 +233,7 @@ class DiagnosticInfoIgnoringInvalidDebugMetadata : public DiagnosticInfo {
 };
 
 /// Diagnostic information for the sample profiler.
-class DiagnosticInfoSampleProfile : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoSampleProfile : public DiagnosticInfo {
 public:
   DiagnosticInfoSampleProfile(StringRef FileName, unsigned LineNum,
                               const Twine &Msg,
@@ -272,7 +272,7 @@ class DiagnosticInfoSampleProfile : public DiagnosticInfo {
 };
 
 /// Diagnostic information for the PGO profiler.
-class DiagnosticInfoPGOProfile : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoPGOProfile : public DiagnosticInfo {
 public:
   DiagnosticInfoPGOProfile(const char *FileName, const Twine &Msg,
                            DiagnosticSeverity Severity = DS_Error)
@@ -296,7 +296,7 @@ class DiagnosticInfoPGOProfile : public DiagnosticInfo {
   const Twine &Msg;
 };
 
-class DiagnosticLocation {
+class LLVM_CLASS_ABI DiagnosticLocation {
   DIFile *File = nullptr;
   unsigned Line = 0;
   unsigned Column = 0;
@@ -316,7 +316,7 @@ class DiagnosticLocation {
 };
 
 /// Common features for diagnostics with an associated location.
-class DiagnosticInfoWithLocationBase : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoWithLocationBase : public DiagnosticInfo {
   void anchor() override;
 public:
   /// \p Fn is the function where the diagnostic is being emitted. \p Loc is
@@ -356,7 +356,7 @@ class DiagnosticInfoWithLocationBase : public DiagnosticInfo {
 
 /// Diagnostic information for stack size etc. reporting.
 /// This is basically a function and a size.
-class DiagnosticInfoResourceLimit : public DiagnosticInfoWithLocationBase {
+class LLVM_CLASS_ABI DiagnosticInfoResourceLimit : public DiagnosticInfoWithLocationBase {
 private:
   /// The function that is concerned by this resource limit diagnostic.
   const Function &Fn;
@@ -391,7 +391,7 @@ class DiagnosticInfoResourceLimit : public DiagnosticInfoWithLocationBase {
   }
 };
 
-class DiagnosticInfoStackSize : public DiagnosticInfoResourceLimit {
+class LLVM_CLASS_ABI DiagnosticInfoStackSize : public DiagnosticInfoResourceLimit {
   void anchor() override;
 
 public:
@@ -411,7 +411,7 @@ class DiagnosticInfoStackSize : public DiagnosticInfoResourceLimit {
 
 /// Common features for diagnostics dealing with optimization remarks
 /// that are used by both IR and MIR passes.
-class DiagnosticInfoOptimizationBase : public DiagnosticInfoWithLocationBase {
+class LLVM_CLASS_ABI DiagnosticInfoOptimizationBase : public DiagnosticInfoWithLocationBase {
 public:
   /// Used to set IsVerbose via the stream interface.
   struct setIsVerbose {};
@@ -620,7 +620,7 @@ operator<<(RemarkT &R,
 
 /// Common features for diagnostics dealing with optimization remarks
 /// that are used by IR passes.
-class DiagnosticInfoIROptimization : public DiagnosticInfoOptimizationBase {
+class LLVM_CLASS_ABI DiagnosticInfoIROptimization : public DiagnosticInfoOptimizationBase {
   void anchor() override;
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. \p
@@ -687,7 +687,7 @@ class DiagnosticInfoIROptimization : public DiagnosticInfoOptimizationBase {
 };
 
 /// Diagnostic information for applied optimization remarks.
-class OptimizationRemark : public DiagnosticInfoIROptimization {
+class LLVM_CLASS_ABI OptimizationRemark : public DiagnosticInfoIROptimization {
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass=, then the diagnostic will
@@ -732,7 +732,7 @@ class OptimizationRemark : public DiagnosticInfoIROptimization {
 };
 
 /// Diagnostic information for missed-optimization remarks.
-class OptimizationRemarkMissed : public DiagnosticInfoIROptimization {
+class LLVM_CLASS_ABI OptimizationRemarkMissed : public DiagnosticInfoIROptimization {
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass-missed=, then the
@@ -778,7 +778,7 @@ class OptimizationRemarkMissed : public DiagnosticInfoIROptimization {
 };
 
 /// Diagnostic information for optimization analysis remarks.
-class OptimizationRemarkAnalysis : public DiagnosticInfoIROptimization {
+class LLVM_CLASS_ABI OptimizationRemarkAnalysis : public DiagnosticInfoIROptimization {
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass-analysis=, then the
@@ -851,7 +851,7 @@ class OptimizationRemarkAnalysis : public DiagnosticInfoIROptimization {
 
 /// Diagnostic information for optimization analysis remarks related to
 /// floating-point non-commutativity.
-class OptimizationRemarkAnalysisFPCommute : public OptimizationRemarkAnalysis {
+class LLVM_CLASS_ABI OptimizationRemarkAnalysisFPCommute : public OptimizationRemarkAnalysis {
   void anchor() override;
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
@@ -893,7 +893,7 @@ class OptimizationRemarkAnalysisFPCommute : public OptimizationRemarkAnalysis {
 
 /// Diagnostic information for optimization analysis remarks related to
 /// pointer aliasing.
-class OptimizationRemarkAnalysisAliasing : public OptimizationRemarkAnalysis {
+class LLVM_CLASS_ABI OptimizationRemarkAnalysisAliasing : public OptimizationRemarkAnalysis {
   void anchor() override;
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
@@ -934,7 +934,7 @@ class OptimizationRemarkAnalysisAliasing : public OptimizationRemarkAnalysis {
 
 /// Diagnostic information for machine IR parser.
 // FIXME: Remove this, use DiagnosticInfoSrcMgr instead.
-class DiagnosticInfoMIRParser : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoMIRParser : public DiagnosticInfo {
   const SMDiagnostic &Diagnostic;
 
 public:
@@ -952,7 +952,7 @@ class DiagnosticInfoMIRParser : public DiagnosticInfo {
 };
 
 /// Diagnostic information for ISel fallback path.
-class DiagnosticInfoISelFallback : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoISelFallback : public DiagnosticInfo {
   /// The function that is concerned by this diagnostic.
   const Function &Fn;
 
@@ -974,7 +974,7 @@ class DiagnosticInfoISelFallback : public DiagnosticInfo {
 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(DiagnosticInfo, LLVMDiagnosticInfoRef)
 
 /// Diagnostic information for optimization failures.
-class DiagnosticInfoOptimizationFailure : public DiagnosticInfoIROptimization {
+class LLVM_CLASS_ABI DiagnosticInfoOptimizationFailure : public DiagnosticInfoIROptimization {
 public:
   /// \p Fn is the function where the diagnostic is being emitted. \p Loc is
   /// the location information to use in the diagnostic. If line table
@@ -1006,7 +1006,7 @@ class DiagnosticInfoOptimizationFailure : public DiagnosticInfoIROptimization {
 };
 
 /// Diagnostic information for unsupported feature in backend.
-class DiagnosticInfoUnsupported : public DiagnosticInfoWithLocationBase {
+class LLVM_CLASS_ABI DiagnosticInfoUnsupported : public DiagnosticInfoWithLocationBase {
 private:
   Twine Msg;
 
@@ -1034,7 +1034,7 @@ class DiagnosticInfoUnsupported : public DiagnosticInfoWithLocationBase {
 };
 
 /// Diagnostic information for MisExpect analysis.
-class DiagnosticInfoMisExpect : public DiagnosticInfoWithLocationBase {
+class LLVM_CLASS_ABI DiagnosticInfoMisExpect : public DiagnosticInfoWithLocationBase {
 public:
   DiagnosticInfoMisExpect(const Instruction *Inst, Twine &Msg);
 
@@ -1071,7 +1071,7 @@ static DiagnosticSeverity getDiagnosticSeverity(SourceMgr::DiagKind DK) {
 }
 
 /// Diagnostic information for SMDiagnostic reporting.
-class DiagnosticInfoSrcMgr : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoSrcMgr : public DiagnosticInfo {
   const SMDiagnostic &Diagnostic;
   StringRef ModName;
 
@@ -1097,9 +1097,9 @@ class DiagnosticInfoSrcMgr : public DiagnosticInfo {
   }
 };
 
-void diagnoseDontCall(const CallInst &CI);
+LLVM_FUNC_ABI void diagnoseDontCall(const CallInst &CI);
 
-class DiagnosticInfoDontCall : public DiagnosticInfo {
+class LLVM_CLASS_ABI DiagnosticInfoDontCall : public DiagnosticInfo {
   StringRef CalleeName;
   StringRef Note;
   unsigned LocCookie;
diff --git a/llvm/include/llvm/IR/DiagnosticPrinter.h b/llvm/include/llvm/IR/DiagnosticPrinter.h
index 84149bd3fc1cf4a..7d1fe96782e68b7 100644
--- a/llvm/include/llvm/IR/DiagnosticPrinter.h
+++ b/llvm/include/llvm/IR/DiagnosticPrinter.h
@@ -29,7 +29,7 @@ class Twine;
 class Value;
 
 /// Interface for custom diagnostic printing.
-class DiagnosticPrinter {
+class LLVM_CLASS_ABI DiagnosticPrinter {
 public:
   virtual ~DiagnosticPrinter() = default;
 
@@ -59,7 +59,7 @@ class DiagnosticPrinter {
 };
 
 /// Basic diagnostic printer that uses an underlying raw_ostream.
-class DiagnosticPrinterRawOStream : public DiagnosticPrinter {
+class LLVM_CLASS_ABI DiagnosticPrinterRawOStream : public DiagnosticPrinter {
 protected:
   raw_ostream &Stream;
 
diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h
index a4f37501c7248b8..74aca8ab7afca05 100644
--- a/llvm/include/llvm/IR/Dominators.h
+++ b/llvm/include/llvm/IR/Dominators.h
@@ -96,7 +96,7 @@ extern template bool Verify<BBPostDomTree>(const BBPostDomTree &DT,
 
 using DomTreeNode = DomTreeNodeBase<BasicBlock>;
 
-class BasicBlockEdge {
+class LLVM_CLASS_ABI BasicBlockEdge {
   const BasicBlock *Start;
   const BasicBlock *End;
 
@@ -122,7 +122,7 @@ class BasicBlockEdge {
   bool isSingleEdge() const;
 };
 
-template <> struct DenseMapInfo<BasicBlockEdge> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<BasicBlockEdge> {
   using BBInfo = DenseMapInfo<const BasicBlock *>;
 
   static unsigned getHashValue(const BasicBlockEdge *V);
@@ -164,7 +164,7 @@ template <> struct DenseMapInfo<BasicBlockEdge> {
 /// the dominator tree is initially constructed may still exist in the tree,
 /// even if the tree is properly updated. Calling code should not rely on the
 /// preceding statements; this is stated only to assist human understanding.
-class DominatorTree : public DominatorTreeBase<BasicBlock, false> {
+class LLVM_CLASS_ABI DominatorTree : public DominatorTreeBase<BasicBlock, false> {
  public:
   using Base = DominatorTreeBase<BasicBlock, false>;
 
@@ -237,7 +237,7 @@ class DominatorTree : public DominatorTreeBase<BasicBlock, false> {
 // DominatorTree GraphTraits specializations so the DominatorTree can be
 // iterable by generic graph iterators.
 
-template <class Node, class ChildIterator> struct DomTreeGraphTraitsBase {
+template <class Node, class ChildIterator> struct LLVM_CLASS_ABI DomTreeGraphTraitsBase {
   using NodeRef = Node *;
   using ChildIteratorType = ChildIterator;
   using nodes_iterator = df_iterator<Node *, df_iterator_default_set<Node*>>;
@@ -254,16 +254,16 @@ template <class Node, class ChildIterator> struct DomTreeGraphTraitsBase {
 };
 
 template <>
-struct GraphTraits<DomTreeNode *>
+struct LLVM_CLASS_ABI GraphTraits<DomTreeNode *>
     : public DomTreeGraphTraitsBase<DomTreeNode, DomTreeNode::const_iterator> {
 };
 
 template <>
-struct GraphTraits<const DomTreeNode *>
+struct LLVM_CLASS_ABI GraphTraits<const DomTreeNode *>
     : public DomTreeGraphTraitsBase<const DomTreeNode,
                                     DomTreeNode::const_iterator> {};
 
-template <> struct GraphTraits<DominatorTree*>
+template <> struct LLVM_CLASS_ABI GraphTraits<DominatorTree*>
   : public GraphTraits<DomTreeNode*> {
   static NodeRef getEntryNode(DominatorTree *DT) { return DT->getRootNode(); }
 
@@ -277,7 +277,7 @@ template <> struct GraphTraits<DominatorTree*>
 };
 
 /// Analysis pass which computes a \c DominatorTree.
-class DominatorTreeAnalysis : public AnalysisInfoMixin<DominatorTreeAnalysis> {
+class LLVM_CLASS_ABI DominatorTreeAnalysis : public AnalysisInfoMixin<DominatorTreeAnalysis> {
   friend AnalysisInfoMixin<DominatorTreeAnalysis>;
   static AnalysisKey Key;
 
@@ -290,7 +290,7 @@ class DominatorTreeAnalysis : public AnalysisInfoMixin<DominatorTreeAnalysis> {
 };
 
 /// Printer pass for the \c DominatorTree.
-class DominatorTreePrinterPass
+class LLVM_CLASS_ABI DominatorTreePrinterPass
     : public PassInfoMixin<DominatorTreePrinterPass> {
   raw_ostream &OS;
 
@@ -301,7 +301,7 @@ class DominatorTreePrinterPass
 };
 
 /// Verifier pass for the \c DominatorTree.
-struct DominatorTreeVerifierPass : PassInfoMixin<DominatorTreeVerifierPass> {
+struct LLVM_CLASS_ABI DominatorTreeVerifierPass : PassInfoMixin<DominatorTreeVerifierPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
@@ -309,10 +309,10 @@ struct DominatorTreeVerifierPass : PassInfoMixin<DominatorTreeVerifierPass> {
 ///
 /// This check is expensive and is disabled by default.  `-verify-dom-info`
 /// allows selectively enabling the check without needing to recompile.
-extern bool VerifyDomInfo;
+LLVM_FUNC_ABI extern bool VerifyDomInfo;
 
 /// Legacy analysis pass which computes a \c DominatorTree.
-class DominatorTreeWrapperPass : public FunctionPass {
+class LLVM_CLASS_ABI DominatorTreeWrapperPass : public FunctionPass {
   DominatorTree DT;
 
 public:
diff --git a/llvm/include/llvm/IR/EHPersonalities.h b/llvm/include/llvm/IR/EHPersonalities.h
index 1f426bb4c82a6cb..be34857626fa042 100644
--- a/llvm/include/llvm/IR/EHPersonalities.h
+++ b/llvm/include/llvm/IR/EHPersonalities.h
@@ -39,11 +39,11 @@ enum class EHPersonality {
 /// See if the given exception handling personality function is one
 /// that we understand.  If so, return a description of it; otherwise return
 /// Unknown.
-EHPersonality classifyEHPersonality(const Value *Pers);
+LLVM_FUNC_ABI EHPersonality classifyEHPersonality(const Value *Pers);
 
-StringRef getEHPersonalityName(EHPersonality Pers);
+LLVM_FUNC_ABI StringRef getEHPersonalityName(EHPersonality Pers);
 
-EHPersonality getDefaultEHPersonality(const Triple &T);
+LLVM_FUNC_ABI EHPersonality getDefaultEHPersonality(const Triple &T);
 
 /// Returns true if this personality function catches asynchronous
 /// exceptions.
@@ -104,7 +104,7 @@ inline bool isNoOpWithoutInvoke(EHPersonality Pers) {
   llvm_unreachable("invalid enum");
 }
 
-bool canSimplifyInvokeNoUnwind(const Function *F);
+LLVM_FUNC_ABI bool canSimplifyInvokeNoUnwind(const Function *F);
 
 typedef TinyPtrVector<BasicBlock *> ColorVector;
 
@@ -112,7 +112,7 @@ typedef TinyPtrVector<BasicBlock *> ColorVector;
 /// this will recompute which blocks are in which funclet. It is possible that
 /// some blocks are in multiple funclets. Consider this analysis to be
 /// expensive.
-DenseMap<BasicBlock *, ColorVector> colorEHFunclets(Function &F);
+LLVM_FUNC_ABI DenseMap<BasicBlock *, ColorVector> colorEHFunclets(Function &F);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/IR/FMF.h b/llvm/include/llvm/IR/FMF.h
index 753d1a6f224d05e..7420dd7d63ab52d 100644
--- a/llvm/include/llvm/IR/FMF.h
+++ b/llvm/include/llvm/IR/FMF.h
@@ -19,7 +19,7 @@ namespace llvm {
 class raw_ostream;
 
 /// Convenience struct for specifying and reasoning about fast-math flags.
-class FastMathFlags {
+class LLVM_CLASS_ABI FastMathFlags {
 private:
   friend class FPMathOperator;
 
diff --git a/llvm/include/llvm/IR/FPEnv.h b/llvm/include/llvm/IR/FPEnv.h
index fdf7667dd99ec9d..12faf4a3be5eab8 100644
--- a/llvm/include/llvm/IR/FPEnv.h
+++ b/llvm/include/llvm/IR/FPEnv.h
@@ -47,19 +47,19 @@ enum ExceptionBehavior : uint8_t {
 /// Returns a valid RoundingMode enumerator when given a string
 /// that is valid as input in constrained intrinsic rounding mode
 /// metadata.
-std::optional<RoundingMode> convertStrToRoundingMode(StringRef);
+LLVM_FUNC_ABI std::optional<RoundingMode> convertStrToRoundingMode(StringRef);
 
 /// For any RoundingMode enumerator, returns a string valid as input in
 /// constrained intrinsic rounding mode metadata.
-std::optional<StringRef> convertRoundingModeToStr(RoundingMode);
+LLVM_FUNC_ABI std::optional<StringRef> convertRoundingModeToStr(RoundingMode);
 
 /// Returns a valid ExceptionBehavior enumerator when given a string
 /// valid as input in constrained intrinsic exception behavior metadata.
-std::optional<fp::ExceptionBehavior> convertStrToExceptionBehavior(StringRef);
+LLVM_FUNC_ABI std::optional<fp::ExceptionBehavior> convertStrToExceptionBehavior(StringRef);
 
 /// For any ExceptionBehavior enumerator, returns a string valid as
 /// input in constrained intrinsic exception behavior metadata.
-std::optional<StringRef> convertExceptionBehaviorToStr(fp::ExceptionBehavior);
+LLVM_FUNC_ABI std::optional<StringRef> convertExceptionBehaviorToStr(fp::ExceptionBehavior);
 
 /// Returns true if the exception handling behavior and rounding mode
 /// match what is used in the default floating point environment.
@@ -71,7 +71,7 @@ inline bool isDefaultFPEnvironment(fp::ExceptionBehavior EB, RoundingMode RM) {
 /// strictfp function. If the instruction is already a constrained intrinsic or
 /// does not have a constrained intrinsic counterpart, the function returns
 /// zero.
-Intrinsic::ID getConstrainedIntrinsicID(const Instruction &Instr);
+LLVM_FUNC_ABI Intrinsic::ID getConstrainedIntrinsicID(const Instruction &Instr);
 
 /// Returns true if the rounding mode RM may be QRM at compile time or
 /// at run time.
diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h
index 135d6828cdb02d6..75efa59afad050c 100644
--- a/llvm/include/llvm/IR/Function.h
+++ b/llvm/include/llvm/IR/Function.h
@@ -944,10 +944,10 @@ class LLVM_EXTERNAL_VISIBILITY Function : public GlobalObject,
 /// Null pointer access in non-zero address space is not considered undefined.
 /// Return value: false => null pointer dereference is undefined.
 /// Return value: true =>  null pointer dereference is not undefined.
-bool NullPointerIsDefined(const Function *F, unsigned AS = 0);
+LLVM_FUNC_ABI bool NullPointerIsDefined(const Function *F, unsigned AS = 0);
 
 template <>
-struct OperandTraits<Function> : public HungoffOperandTraits<3> {};
+struct LLVM_CLASS_ABI OperandTraits<Function> : public HungoffOperandTraits<3> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(Function, Value)
 
diff --git a/llvm/include/llvm/IR/GCStrategy.h b/llvm/include/llvm/IR/GCStrategy.h
index dee159e76f01894..28480bf54111435 100644
--- a/llvm/include/llvm/IR/GCStrategy.h
+++ b/llvm/include/llvm/IR/GCStrategy.h
@@ -61,7 +61,7 @@ class Type;
 /// be abstractly described.  GCStrategy objects must be looked up through
 /// the Function.  The objects themselves are owned by the Context and must
 /// be immutable.
-class GCStrategy {
+class LLVM_CLASS_ABI GCStrategy {
 private:
   friend class GCModuleInfo;
 
@@ -143,7 +143,7 @@ class GCStrategy {
 using GCRegistry = Registry<GCStrategy>;
 
 /// Lookup the GCStrategy object associated with the given gc name.
-std::unique_ptr<GCStrategy> getGCStrategy(const StringRef Name);
+LLVM_FUNC_ABI std::unique_ptr<GCStrategy> getGCStrategy(const StringRef Name);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/IR/GVMaterializer.h b/llvm/include/llvm/IR/GVMaterializer.h
index 6ed6b8dcf9ee398..9728a41b4baa5ab 100644
--- a/llvm/include/llvm/IR/GVMaterializer.h
+++ b/llvm/include/llvm/IR/GVMaterializer.h
@@ -26,7 +26,7 @@ class Error;
 class GlobalValue;
 class StructType;
 
-class GVMaterializer {
+class LLVM_CLASS_ABI GVMaterializer {
 protected:
   GVMaterializer() = default;
 
diff --git a/llvm/include/llvm/IR/GetElementPtrTypeIterator.h b/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
index 5f95ecbbe82c5f2..194454023d42bf3 100644
--- a/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
+++ b/llvm/include/llvm/IR/GetElementPtrTypeIterator.h
@@ -29,7 +29,7 @@
 namespace llvm {
 
 template <typename ItTy = User::const_op_iterator>
-class generic_gep_type_iterator {
+class LLVM_CLASS_ABI generic_gep_type_iterator {
 
   ItTy OpIt;
   PointerUnion<StructType *, Type *> CurTy;
diff --git a/llvm/include/llvm/IR/GlobalAlias.h b/llvm/include/llvm/IR/GlobalAlias.h
index 33365a26640ceeb..8c07f764f4d35a1 100644
--- a/llvm/include/llvm/IR/GlobalAlias.h
+++ b/llvm/include/llvm/IR/GlobalAlias.h
@@ -26,7 +26,7 @@ class Twine;
 class Module;
 template <typename ValueSubClass> class SymbolTableListTraits;
 
-class GlobalAlias : public GlobalValue, public ilist_node<GlobalAlias> {
+class LLVM_CLASS_ABI GlobalAlias : public GlobalValue, public ilist_node<GlobalAlias> {
   friend class SymbolTableListTraits<GlobalAlias>;
 
   GlobalAlias(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage,
@@ -105,7 +105,7 @@ class GlobalAlias : public GlobalValue, public ilist_node<GlobalAlias> {
 };
 
 template <>
-struct OperandTraits<GlobalAlias>
+struct LLVM_CLASS_ABI OperandTraits<GlobalAlias>
     : public FixedNumOperandTraits<GlobalAlias, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GlobalAlias, Constant)
diff --git a/llvm/include/llvm/IR/GlobalIFunc.h b/llvm/include/llvm/IR/GlobalIFunc.h
index 23465293f74204f..663ffa2a9cbabaf 100644
--- a/llvm/include/llvm/IR/GlobalIFunc.h
+++ b/llvm/include/llvm/IR/GlobalIFunc.h
@@ -32,7 +32,7 @@ class Module;
 // Traits class for using GlobalIFunc in symbol table in Module.
 template <typename ValueSubClass> class SymbolTableListTraits;
 
-class GlobalIFunc final : public GlobalObject, public ilist_node<GlobalIFunc> {
+class LLVM_CLASS_ABI GlobalIFunc final : public GlobalObject, public ilist_node<GlobalIFunc> {
   friend class SymbolTableListTraits<GlobalIFunc>;
 
   GlobalIFunc(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage,
@@ -103,7 +103,7 @@ class GlobalIFunc final : public GlobalObject, public ilist_node<GlobalIFunc> {
 };
 
 template <>
-struct OperandTraits<GlobalIFunc>
+struct LLVM_CLASS_ABI OperandTraits<GlobalIFunc>
     : public FixedNumOperandTraits<GlobalIFunc, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GlobalIFunc, Constant)
diff --git a/llvm/include/llvm/IR/GlobalObject.h b/llvm/include/llvm/IR/GlobalObject.h
index d40fc0c7dfb810f..bed01c1541991d6 100644
--- a/llvm/include/llvm/IR/GlobalObject.h
+++ b/llvm/include/llvm/IR/GlobalObject.h
@@ -25,7 +25,7 @@ namespace llvm {
 class Comdat;
 class Metadata;
 
-class GlobalObject : public GlobalValue {
+class LLVM_CLASS_ABI GlobalObject : public GlobalValue {
 public:
   // VCallVisibility - values for visibility metadata attached to vtables. This
   // describes the scope in which a virtual call could end up being dispatched
diff --git a/llvm/include/llvm/IR/GlobalValue.h b/llvm/include/llvm/IR/GlobalValue.h
index 883592e730b1353..b1f12b0da4b82e5 100644
--- a/llvm/include/llvm/IR/GlobalValue.h
+++ b/llvm/include/llvm/IR/GlobalValue.h
@@ -42,7 +42,7 @@ namespace Intrinsic {
 typedef unsigned ID;
 } // end namespace Intrinsic
 
-class GlobalValue : public Constant {
+class LLVM_CLASS_ABI GlobalValue : public Constant {
 public:
   /// An enumeration for the kinds of linkage for global values.
   enum LinkageTypes {
diff --git a/llvm/include/llvm/IR/GlobalVariable.h b/llvm/include/llvm/IR/GlobalVariable.h
index f8233a240b10ddc..8f96dae174e8860 100644
--- a/llvm/include/llvm/IR/GlobalVariable.h
+++ b/llvm/include/llvm/IR/GlobalVariable.h
@@ -37,7 +37,7 @@ class Module;
 template <typename ValueSubClass> class SymbolTableListTraits;
 class DIGlobalVariableExpression;
 
-class GlobalVariable : public GlobalObject, public ilist_node<GlobalVariable> {
+class LLVM_CLASS_ABI GlobalVariable : public GlobalObject, public ilist_node<GlobalVariable> {
   friend class SymbolTableListTraits<GlobalVariable>;
 
   AttributeSet Attrs;
@@ -254,7 +254,7 @@ class GlobalVariable : public GlobalObject, public ilist_node<GlobalVariable> {
 };
 
 template <>
-struct OperandTraits<GlobalVariable> :
+struct LLVM_CLASS_ABI OperandTraits<GlobalVariable> :
   public OptionalOperandTraits<GlobalVariable> {
 };
 
diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index 4d570f6cf05d874..3dcbec53a1ecf8f 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -59,7 +59,7 @@ class Use;
 /// IRBuilder and needs to be inserted.
 ///
 /// By default, this inserts the instruction at the insertion point.
-class IRBuilderDefaultInserter {
+class LLVM_CLASS_ABI IRBuilderDefaultInserter {
 public:
   virtual ~IRBuilderDefaultInserter();
 
@@ -74,7 +74,7 @@ class IRBuilderDefaultInserter {
 
 /// Provides an 'InsertHelper' that calls a user-provided callback after
 /// performing the default insertion.
-class IRBuilderCallbackInserter : public IRBuilderDefaultInserter {
+class LLVM_CLASS_ABI IRBuilderCallbackInserter : public IRBuilderDefaultInserter {
   std::function<void(Instruction *)> Callback;
 
 public:
@@ -92,7 +92,7 @@ class IRBuilderCallbackInserter : public IRBuilderDefaultInserter {
 };
 
 /// Common base class shared among various IRBuilders.
-class IRBuilderBase {
+class LLVM_CLASS_ABI IRBuilderBase {
   /// Pairs of (metadata kind, MDNode *) that should be added to all newly
   /// created instructions, like !dbg metadata.
   SmallVector<std::pair<unsigned, MDNode *>, 2> MetadataToCopy;
@@ -2595,7 +2595,7 @@ class IRBuilderBase {
 /// every newly created insertion.
 template <typename FolderTy = ConstantFolder,
           typename InserterTy = IRBuilderDefaultInserter>
-class IRBuilder : public IRBuilderBase {
+class LLVM_CLASS_ABI IRBuilder : public IRBuilderBase {
 private:
   FolderTy Folder;
   InserterTy Inserter;
@@ -2661,16 +2661,16 @@ class IRBuilder : public IRBuilderBase {
 template <typename FolderTy, typename InserterTy>
 IRBuilder(LLVMContext &, FolderTy, InserterTy, MDNode *,
           ArrayRef<OperandBundleDef>) -> IRBuilder<FolderTy, InserterTy>;
-IRBuilder(LLVMContext &, MDNode *, ArrayRef<OperandBundleDef>) -> IRBuilder<>;
+LLVM_FUNC_ABI IRBuilder(LLVMContext &, MDNode *, ArrayRef<OperandBundleDef>) -> IRBuilder<>;
 template <typename FolderTy>
 IRBuilder(BasicBlock *, FolderTy, MDNode *, ArrayRef<OperandBundleDef>)
     -> IRBuilder<FolderTy>;
-IRBuilder(BasicBlock *, MDNode *, ArrayRef<OperandBundleDef>) -> IRBuilder<>;
-IRBuilder(Instruction *, MDNode *, ArrayRef<OperandBundleDef>) -> IRBuilder<>;
+LLVM_FUNC_ABI IRBuilder(BasicBlock *, MDNode *, ArrayRef<OperandBundleDef>) -> IRBuilder<>;
+LLVM_FUNC_ABI IRBuilder(Instruction *, MDNode *, ArrayRef<OperandBundleDef>) -> IRBuilder<>;
 template <typename FolderTy>
 IRBuilder(BasicBlock *, BasicBlock::iterator, FolderTy, MDNode *,
           ArrayRef<OperandBundleDef>) -> IRBuilder<FolderTy>;
-IRBuilder(BasicBlock *, BasicBlock::iterator, MDNode *,
+LLVM_FUNC_ABI IRBuilder(BasicBlock *, BasicBlock::iterator, MDNode *,
           ArrayRef<OperandBundleDef>) -> IRBuilder<>;
 
 
diff --git a/llvm/include/llvm/IR/IRBuilderFolder.h b/llvm/include/llvm/IR/IRBuilderFolder.h
index beb4be8aa7cfb42..4a5fa78657972ff 100644
--- a/llvm/include/llvm/IR/IRBuilderFolder.h
+++ b/llvm/include/llvm/IR/IRBuilderFolder.h
@@ -22,7 +22,7 @@
 namespace llvm {
 
 /// IRBuilderFolder - Interface for constant folding in IRBuilder.
-class IRBuilderFolder {
+class LLVM_CLASS_ABI IRBuilderFolder {
 public:
   virtual ~IRBuilderFolder();
 
diff --git a/llvm/include/llvm/IR/IRPrintingPasses.h b/llvm/include/llvm/IR/IRPrintingPasses.h
index f6bea67988c536a..d8ae9454a20c261 100644
--- a/llvm/include/llvm/IR/IRPrintingPasses.h
+++ b/llvm/include/llvm/IR/IRPrintingPasses.h
@@ -27,23 +27,23 @@ class Pass;
 
 /// Create and return a pass that writes the module to the specified
 /// \c raw_ostream.
-ModulePass *createPrintModulePass(raw_ostream &OS,
+LLVM_FUNC_ABI ModulePass *createPrintModulePass(raw_ostream &OS,
                                   const std::string &Banner = "",
                                   bool ShouldPreserveUseListOrder = false);
 
 /// Create and return a pass that prints functions to the specified
 /// \c raw_ostream as they are processed.
-FunctionPass *createPrintFunctionPass(raw_ostream &OS,
+LLVM_FUNC_ABI FunctionPass *createPrintFunctionPass(raw_ostream &OS,
                                       const std::string &Banner = "");
 
 /// Print out a name of an LLVM value without any prefixes.
 ///
 /// The name is surrounded with ""'s and escaped if it has any special or
 /// non-printable characters in it.
-void printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name);
+LLVM_FUNC_ABI void printLLVMNameWithoutPrefix(raw_ostream &OS, StringRef Name);
 
 /// Return true if a pass is for IR printing.
-bool isIRPrintingPass(Pass *P);
+LLVM_FUNC_ABI bool isIRPrintingPass(Pass *P);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/IR/InlineAsm.h b/llvm/include/llvm/IR/InlineAsm.h
index 5251815b9b12dc7..669d36bde048cd2 100644
--- a/llvm/include/llvm/IR/InlineAsm.h
+++ b/llvm/include/llvm/IR/InlineAsm.h
@@ -31,7 +31,7 @@ class FunctionType;
 class PointerType;
 template <class ConstantClass> class ConstantUniqueMap;
 
-class InlineAsm final : public Value {
+class LLVM_CLASS_ABI InlineAsm final : public Value {
 public:
   enum AsmDialect {
     AD_ATT,
diff --git a/llvm/include/llvm/IR/InstIterator.h b/llvm/include/llvm/IR/InstIterator.h
index 6da72254304d0ce..957150daff3e958 100644
--- a/llvm/include/llvm/IR/InstIterator.h
+++ b/llvm/include/llvm/IR/InstIterator.h
@@ -30,7 +30,7 @@ namespace llvm {
 // This class implements inst_begin() & inst_end() for
 // inst_iterator and const_inst_iterator's.
 //
-template <class BB_t, class BB_i_t, class BI_t, class II_t> class InstIterator {
+template <class BB_t, class BB_i_t, class BI_t, class II_t> class LLVM_CLASS_ABI InstIterator {
   using BBty = BB_t;
   using BBIty = BB_i_t;
   using BIty = BI_t;
diff --git a/llvm/include/llvm/IR/InstVisitor.h b/llvm/include/llvm/IR/InstVisitor.h
index 48dac110be2beda..ebd7e912199e0e1 100644
--- a/llvm/include/llvm/IR/InstVisitor.h
+++ b/llvm/include/llvm/IR/InstVisitor.h
@@ -76,7 +76,7 @@ namespace llvm {
 /// as efficient as having your own switch statement over the instruction
 /// opcode.
 template<typename SubClass, typename RetTy=void>
-class InstVisitor {
+class LLVM_CLASS_ABI InstVisitor {
   //===--------------------------------------------------------------------===//
   // Interface code - This is the public interface of the InstVisitor that you
   // use to visit instructions...
diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h
index cdf7253dfa00057..da0a8ede5cda88c 100644
--- a/llvm/include/llvm/IR/InstrTypes.h
+++ b/llvm/include/llvm/IR/InstrTypes.h
@@ -53,7 +53,7 @@ typedef unsigned ID;
 //                          UnaryInstruction Class
 //===----------------------------------------------------------------------===//
 
-class UnaryInstruction : public Instruction {
+class LLVM_CLASS_ABI UnaryInstruction : public Instruction {
 protected:
   UnaryInstruction(Type *Ty, unsigned iType, Value *V,
                    Instruction *IB = nullptr)
@@ -88,7 +88,7 @@ class UnaryInstruction : public Instruction {
 };
 
 template <>
-struct OperandTraits<UnaryInstruction> :
+struct LLVM_CLASS_ABI OperandTraits<UnaryInstruction> :
   public FixedNumOperandTraits<UnaryInstruction, 1> {
 };
 
@@ -98,7 +98,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(UnaryInstruction, Value)
 //                                UnaryOperator Class
 //===----------------------------------------------------------------------===//
 
-class UnaryOperator : public UnaryInstruction {
+class LLVM_CLASS_ABI UnaryOperator : public UnaryInstruction {
   void AssertOK();
 
 protected:
@@ -185,7 +185,7 @@ class UnaryOperator : public UnaryInstruction {
 //                           BinaryOperator Class
 //===----------------------------------------------------------------------===//
 
-class BinaryOperator : public Instruction {
+class LLVM_CLASS_ABI BinaryOperator : public Instruction {
   void AssertOK();
 
 protected:
@@ -410,7 +410,7 @@ class BinaryOperator : public Instruction {
 };
 
 template <>
-struct OperandTraits<BinaryOperator> :
+struct LLVM_CLASS_ABI OperandTraits<BinaryOperator> :
   public FixedNumOperandTraits<BinaryOperator, 2> {
 };
 
@@ -426,7 +426,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryOperator, Value)
 ///
 /// if (isa<CastInst>(Instr)) { ... }
 /// Base class of casting instructions.
-class CastInst : public UnaryInstruction {
+class LLVM_CLASS_ABI CastInst : public UnaryInstruction {
 protected:
   /// Constructor with insert-before-instruction semantics for subclasses
   CastInst(Type *Ty, unsigned iType, Value *S,
@@ -699,7 +699,7 @@ class CastInst : public UnaryInstruction {
 
 /// This class is the base class for the comparison instructions.
 /// Abstract base class of comparison instructions.
-class CmpInst : public Instruction {
+class LLVM_CLASS_ABI CmpInst : public Instruction {
 public:
   /// This enumeration lists the possible predicates for CmpInst subclasses.
   /// Values in the range 0-31 are reserved for FCmpInst, while values in the
@@ -1074,16 +1074,16 @@ class CmpInst : public Instruction {
 
 // FIXME: these are redundant if CmpInst < BinaryOperator
 template <>
-struct OperandTraits<CmpInst> : public FixedNumOperandTraits<CmpInst, 2> {
+struct LLVM_CLASS_ABI OperandTraits<CmpInst> : public FixedNumOperandTraits<CmpInst, 2> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CmpInst, Value)
 
-raw_ostream &operator<<(raw_ostream &OS, CmpInst::Predicate Pred);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, CmpInst::Predicate Pred);
 
 /// A lightweight accessor for an operand bundle meant to be passed
 /// around by value.
-struct OperandBundleUse {
+struct LLVM_CLASS_ABI OperandBundleUse {
   ArrayRef<Use> Inputs;
 
   OperandBundleUse() = default;
@@ -1141,7 +1141,7 @@ struct OperandBundleUse {
 /// Unlike OperandBundleUse, OperandBundleDefT owns the memory it carries, and
 /// so it is possible to create and pass around "self-contained" instances of
 /// OperandBundleDef and ConstOperandBundleDef.
-template <typename InputTy> class OperandBundleDefT {
+template <typename InputTy> class LLVM_CLASS_ABI OperandBundleDefT {
   std::string Tag;
   std::vector<InputTy> Inputs;
 
@@ -1188,7 +1188,7 @@ using ConstOperandBundleDef = OperandBundleDefT<const Value *>;
 /// start of the arguments without knowing how many other operands a particular
 /// subclass requires. Note that accessing the end of the argument list isn't
 /// as cheap as most other operations on the base class.
-class CallBase : public Instruction {
+class LLVM_CLASS_ABI CallBase : public Instruction {
 protected:
   // The first two bits are reserved by CallInst for fast retrieval,
   using CallInstReservedField = Bitfield::Element<unsigned, 0, 2>;
@@ -2313,14 +2313,14 @@ class CallBase : public Instruction {
 };
 
 template <>
-struct OperandTraits<CallBase> : public VariadicOperandTraits<CallBase, 1> {};
+struct LLVM_CLASS_ABI OperandTraits<CallBase> : public VariadicOperandTraits<CallBase, 1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CallBase, Value)
 
 //===----------------------------------------------------------------------===//
 //                           FuncletPadInst Class
 //===----------------------------------------------------------------------===//
-class FuncletPadInst : public Instruction {
+class LLVM_CLASS_ABI FuncletPadInst : public Instruction {
 private:
   FuncletPadInst(const FuncletPadInst &CPI);
 
@@ -2382,7 +2382,7 @@ class FuncletPadInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<FuncletPadInst>
+struct LLVM_CLASS_ABI OperandTraits<FuncletPadInst>
     : public VariadicOperandTraits<FuncletPadInst, /*MINARITY=*/1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(FuncletPadInst, Value)
diff --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h
index 0b9c8eb9b64743d..ec282fa54d6f523 100644
--- a/llvm/include/llvm/IR/Instruction.h
+++ b/llvm/include/llvm/IR/Instruction.h
@@ -35,11 +35,11 @@ class MDNode;
 class Module;
 struct AAMDNodes;
 
-template <> struct ilist_alloc_traits<Instruction> {
+template <> struct LLVM_CLASS_ABI ilist_alloc_traits<Instruction> {
   static inline void deleteNode(Instruction *V);
 };
 
-class Instruction : public User,
+class LLVM_CLASS_ABI Instruction : public User,
                     public ilist_node_with_parent<Instruction, BasicBlock> {
   BasicBlock *Parent;
   DebugLoc DbgLoc;                         // 'dbg' Metadata cache.
diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h
index ba2426e570dc25e..54d83a117fdf0d5 100644
--- a/llvm/include/llvm/IR/Instructions.h
+++ b/llvm/include/llvm/IR/Instructions.h
@@ -56,7 +56,7 @@ class Value;
 //===----------------------------------------------------------------------===//
 
 /// an instruction to allocate memory on the stack
-class AllocaInst : public UnaryInstruction {
+class LLVM_CLASS_ABI AllocaInst : public UnaryInstruction {
   Type *AllocatedType;
 
   using AlignmentField = AlignmentBitfieldElementT<0>;
@@ -175,7 +175,7 @@ class AllocaInst : public UnaryInstruction {
 
 /// An instruction for reading from memory. This uses the SubclassData field in
 /// Value to store whether or not the load is volatile.
-class LoadInst : public UnaryInstruction {
+class LLVM_CLASS_ABI LoadInst : public UnaryInstruction {
   using VolatileField = BoolBitfieldElementT<0>;
   using AlignmentField = AlignmentBitfieldElementT<VolatileField::NextBit>;
   using OrderingField = AtomicOrderingBitfieldElementT<AlignmentField::NextBit>;
@@ -299,7 +299,7 @@ class LoadInst : public UnaryInstruction {
 //===----------------------------------------------------------------------===//
 
 /// An instruction for storing to memory.
-class StoreInst : public Instruction {
+class LLVM_CLASS_ABI StoreInst : public Instruction {
   using VolatileField = BoolBitfieldElementT<0>;
   using AlignmentField = AlignmentBitfieldElementT<VolatileField::NextBit>;
   using OrderingField = AtomicOrderingBitfieldElementT<AlignmentField::NextBit>;
@@ -424,7 +424,7 @@ class StoreInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<StoreInst> : public FixedNumOperandTraits<StoreInst, 2> {
+struct LLVM_CLASS_ABI OperandTraits<StoreInst> : public FixedNumOperandTraits<StoreInst, 2> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(StoreInst, Value)
@@ -434,7 +434,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(StoreInst, Value)
 //===----------------------------------------------------------------------===//
 
 /// An instruction for ordering other memory operations.
-class FenceInst : public Instruction {
+class LLVM_CLASS_ABI FenceInst : public Instruction {
   using OrderingField = AtomicOrderingBitfieldElementT<0>;
 
   void Init(AtomicOrdering Ordering, SyncScope::ID SSID);
@@ -511,7 +511,7 @@ class FenceInst : public Instruction {
 /// original value as first element, and an i1 indicating success (true) or
 /// failure (false) as second element.
 ///
-class AtomicCmpXchgInst : public Instruction {
+class LLVM_CLASS_ABI AtomicCmpXchgInst : public Instruction {
   void Init(Value *Ptr, Value *Cmp, Value *NewVal, Align Align,
             AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering,
             SyncScope::ID SSID);
@@ -702,7 +702,7 @@ class AtomicCmpXchgInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<AtomicCmpXchgInst> :
+struct LLVM_CLASS_ABI OperandTraits<AtomicCmpXchgInst> :
     public FixedNumOperandTraits<AtomicCmpXchgInst, 3> {
 };
 
@@ -716,7 +716,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(AtomicCmpXchgInst, Value)
 /// combines it with another value, and then stores the result back.  Returns
 /// the old value.
 ///
-class AtomicRMWInst : public Instruction {
+class LLVM_CLASS_ABI AtomicRMWInst : public Instruction {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -917,7 +917,7 @@ class AtomicRMWInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<AtomicRMWInst>
+struct LLVM_CLASS_ABI OperandTraits<AtomicRMWInst>
     : public FixedNumOperandTraits<AtomicRMWInst,2> {
 };
 
@@ -938,7 +938,7 @@ inline Type *checkGEPType(Type *Ty) {
 /// an instruction for type-safe pointer arithmetic to
 /// access elements of arrays and structs
 ///
-class GetElementPtrInst : public Instruction {
+class LLVM_CLASS_ABI GetElementPtrInst : public Instruction {
   Type *SourceElementType;
   Type *ResultElementType;
 
@@ -1153,7 +1153,7 @@ class GetElementPtrInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<GetElementPtrInst> :
+struct LLVM_CLASS_ABI OperandTraits<GetElementPtrInst> :
   public VariadicOperandTraits<GetElementPtrInst, 1> {
 };
 
@@ -1195,7 +1195,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrInst, Value)
 /// to the constructor. It only operates on integers or pointers. The operands
 /// must be identical types.
 /// Represent an integer comparison operator.
-class ICmpInst: public CmpInst {
+class LLVM_CLASS_ABI ICmpInst: public CmpInst {
   void AssertOK() {
     assert(isIntPredicate() &&
            "Invalid ICmp predicate value");
@@ -1369,7 +1369,7 @@ class ICmpInst: public CmpInst {
 /// to the constructor. It only operates on floating point values or packed
 /// vectors of floating point values. The operands must be identical types.
 /// Represents a floating point comparison operator.
-class FCmpInst: public CmpInst {
+class LLVM_CLASS_ABI FCmpInst: public CmpInst {
   void AssertOK() {
     assert(isFPPredicate() && "Invalid FCmp predicate value");
     assert(getOperand(0)->getType() == getOperand(1)->getType() &&
@@ -1483,7 +1483,7 @@ class FCmpInst: public CmpInst {
 /// field to indicate whether or not this is a tail call.  The rest of the bits
 /// hold the calling convention of the call.
 ///
-class CallInst : public CallBase {
+class LLVM_CLASS_ABI CallInst : public CallBase {
   CallInst(const CallInst &CI);
 
   /// Construct a CallInst given a range of arguments.
@@ -1744,7 +1744,7 @@ CallInst::CallInst(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
 
 /// This class represents the LLVM 'select' instruction.
 ///
-class SelectInst : public Instruction {
+class LLVM_CLASS_ABI SelectInst : public Instruction {
   SelectInst(Value *C, Value *S1, Value *S2, const Twine &NameStr,
              Instruction *InsertBefore)
     : Instruction(S1->getType(), Instruction::Select,
@@ -1827,7 +1827,7 @@ class SelectInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<SelectInst> : public FixedNumOperandTraits<SelectInst, 3> {
+struct LLVM_CLASS_ABI OperandTraits<SelectInst> : public FixedNumOperandTraits<SelectInst, 3> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectInst, Value)
@@ -1839,7 +1839,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectInst, Value)
 /// This class represents the va_arg llvm instruction, which returns
 /// an argument of the specified type given a va_list and increments that list
 ///
-class VAArgInst : public UnaryInstruction {
+class LLVM_CLASS_ABI VAArgInst : public UnaryInstruction {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -1879,7 +1879,7 @@ class VAArgInst : public UnaryInstruction {
 /// This instruction extracts a single (scalar)
 /// element from a VectorType value
 ///
-class ExtractElementInst : public Instruction {
+class LLVM_CLASS_ABI ExtractElementInst : public Instruction {
   ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr = "",
                      Instruction *InsertBefore = nullptr);
   ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr,
@@ -1930,7 +1930,7 @@ class ExtractElementInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<ExtractElementInst> :
+struct LLVM_CLASS_ABI OperandTraits<ExtractElementInst> :
   public FixedNumOperandTraits<ExtractElementInst, 2> {
 };
 
@@ -1943,7 +1943,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractElementInst, Value)
 /// This instruction inserts a single (scalar)
 /// element into a VectorType value
 ///
-class InsertElementInst : public Instruction {
+class LLVM_CLASS_ABI InsertElementInst : public Instruction {
   InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
                     const Twine &NameStr = "",
                     Instruction *InsertBefore = nullptr);
@@ -1993,7 +1993,7 @@ class InsertElementInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<InsertElementInst> :
+struct LLVM_CLASS_ABI OperandTraits<InsertElementInst> :
   public FixedNumOperandTraits<InsertElementInst, 3> {
 };
 
@@ -2015,7 +2015,7 @@ constexpr int PoisonMaskElem = -1;
 ///
 /// For scalable vectors, all the elements of the mask must be 0 or -1. This
 /// requirement may be relaxed in the future.
-class ShuffleVectorInst : public Instruction {
+class LLVM_CLASS_ABI ShuffleVectorInst : public Instruction {
   SmallVector<int, 4> ShuffleMask;
   Constant *ShuffleMaskForBitcode;
 
@@ -2472,7 +2472,7 @@ class ShuffleVectorInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<ShuffleVectorInst>
+struct LLVM_CLASS_ABI OperandTraits<ShuffleVectorInst>
     : public FixedNumOperandTraits<ShuffleVectorInst, 2> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorInst, Value)
@@ -2484,7 +2484,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorInst, Value)
 /// This instruction extracts a struct member or array
 /// element value from an aggregate value.
 ///
-class ExtractValueInst : public UnaryInstruction {
+class LLVM_CLASS_ABI ExtractValueInst : public UnaryInstruction {
   SmallVector<unsigned, 4> Indices;
 
   ExtractValueInst(const ExtractValueInst &EVI);
@@ -2595,7 +2595,7 @@ ExtractValueInst::ExtractValueInst(Value *Agg,
 /// This instruction inserts a struct field of array element
 /// value into an aggregate value.
 ///
-class InsertValueInst : public Instruction {
+class LLVM_CLASS_ABI InsertValueInst : public Instruction {
   SmallVector<unsigned, 4> Indices;
 
   InsertValueInst(const InsertValueInst &IVI);
@@ -2701,7 +2701,7 @@ class InsertValueInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<InsertValueInst> :
+struct LLVM_CLASS_ABI OperandTraits<InsertValueInst> :
   public FixedNumOperandTraits<InsertValueInst, 2> {
 };
 
@@ -2737,7 +2737,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueInst, Value)
 // node, that can not exist in nature, but can be synthesized in a computer
 // scientist's overactive imagination.
 //
-class PHINode : public Instruction {
+class LLVM_CLASS_ABI PHINode : public Instruction {
   /// The number of operands actually allocated.  NumOperands is
   /// the number actually in use.
   unsigned ReservedSpace;
@@ -2968,7 +2968,7 @@ class PHINode : public Instruction {
 };
 
 template <>
-struct OperandTraits<PHINode> : public HungoffOperandTraits<2> {
+struct LLVM_CLASS_ABI OperandTraits<PHINode> : public HungoffOperandTraits<2> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value)
@@ -2985,7 +2985,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value)
 /// SubclassData field in Value to store whether or not the landingpad is a
 /// cleanup.
 ///
-class LandingPadInst : public Instruction {
+class LLVM_CLASS_ABI LandingPadInst : public Instruction {
   using CleanupField = BoolBitfieldElementT<0>;
 
   /// The number of operands actually allocated.  NumOperands is
@@ -3073,7 +3073,7 @@ class LandingPadInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<LandingPadInst> : public HungoffOperandTraits<1> {
+struct LLVM_CLASS_ABI OperandTraits<LandingPadInst> : public HungoffOperandTraits<1> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(LandingPadInst, Value)
@@ -3086,7 +3086,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(LandingPadInst, Value)
 /// Return a value (possibly void), from a function.  Execution
 /// does not continue in this function any longer.
 ///
-class ReturnInst : public Instruction {
+class LLVM_CLASS_ABI ReturnInst : public Instruction {
   ReturnInst(const ReturnInst &RI);
 
 private:
@@ -3156,7 +3156,7 @@ class ReturnInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<ReturnInst> : public VariadicOperandTraits<ReturnInst> {
+struct LLVM_CLASS_ABI OperandTraits<ReturnInst> : public VariadicOperandTraits<ReturnInst> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ReturnInst, Value)
@@ -3168,7 +3168,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ReturnInst, Value)
 //===---------------------------------------------------------------------------
 /// Conditional or Unconditional Branch instruction.
 ///
-class BranchInst : public Instruction {
+class LLVM_CLASS_ABI BranchInst : public Instruction {
   /// Ops list - Branches are strange.  The operands are ordered:
   ///  [Cond, FalseDest,] TrueDest.  This makes some accessors faster because
   /// they don't have to check for cond/uncond branchness. These are mostly
@@ -3300,7 +3300,7 @@ class BranchInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<BranchInst> : public VariadicOperandTraits<BranchInst, 1> {
+struct LLVM_CLASS_ABI OperandTraits<BranchInst> : public VariadicOperandTraits<BranchInst, 1> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BranchInst, Value)
@@ -3312,7 +3312,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BranchInst, Value)
 //===---------------------------------------------------------------------------
 /// Multiway switch
 ///
-class SwitchInst : public Instruction {
+class LLVM_CLASS_ABI SwitchInst : public Instruction {
   unsigned ReservedSpace;
 
   // Operand[0]    = Value to switch on
@@ -3654,7 +3654,7 @@ class SwitchInst : public Instruction {
 
 /// A wrapper class to simplify modification of SwitchInst cases along with
 /// their prof branch_weights metadata.
-class SwitchInstProfUpdateWrapper {
+class LLVM_CLASS_ABI SwitchInstProfUpdateWrapper {
   SwitchInst &SI;
   std::optional<SmallVector<uint32_t, 8>> Weights;
   bool Changed = false;
@@ -3696,7 +3696,7 @@ class SwitchInstProfUpdateWrapper {
 };
 
 template <>
-struct OperandTraits<SwitchInst> : public HungoffOperandTraits<2> {
+struct LLVM_CLASS_ABI OperandTraits<SwitchInst> : public HungoffOperandTraits<2> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)
@@ -3708,7 +3708,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)
 //===---------------------------------------------------------------------------
 /// Indirect Branch Instruction.
 ///
-class IndirectBrInst : public Instruction {
+class LLVM_CLASS_ABI IndirectBrInst : public Instruction {
   unsigned ReservedSpace;
 
   // Operand[0]   = Address to jump to
@@ -3831,7 +3831,7 @@ class IndirectBrInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<IndirectBrInst> : public HungoffOperandTraits<1> {
+struct LLVM_CLASS_ABI OperandTraits<IndirectBrInst> : public HungoffOperandTraits<1> {
 };
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(IndirectBrInst, Value)
@@ -3843,7 +3843,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(IndirectBrInst, Value)
 /// Invoke instruction.  The SubclassData field is used to hold the
 /// calling convention of the call.
 ///
-class InvokeInst : public CallBase {
+class LLVM_CLASS_ABI InvokeInst : public CallBase {
   /// The number of operands for this call beyond the called function,
   /// arguments, and operand bundles.
   static constexpr int NumExtraOperands = 2;
@@ -4052,7 +4052,7 @@ InvokeInst::InvokeInst(FunctionType *Ty, Value *Func, BasicBlock *IfNormal,
 /// instead transfer it to a third location. The SubclassData field is used to
 /// hold the calling convention of the call.
 ///
-class CallBrInst : public CallBase {
+class LLVM_CLASS_ABI CallBrInst : public CallBase {
 
   unsigned NumIndirectDests;
 
@@ -4285,7 +4285,7 @@ CallBrInst::CallBrInst(FunctionType *Ty, Value *Func, BasicBlock *DefaultDest,
 //===---------------------------------------------------------------------------
 /// Resume the propagation of an exception.
 ///
-class ResumeInst : public Instruction {
+class LLVM_CLASS_ABI ResumeInst : public Instruction {
   ResumeInst(const ResumeInst &RI);
 
   explicit ResumeInst(Value *Exn, Instruction *InsertBefore=nullptr);
@@ -4333,7 +4333,7 @@ class ResumeInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<ResumeInst> :
+struct LLVM_CLASS_ABI OperandTraits<ResumeInst> :
     public FixedNumOperandTraits<ResumeInst, 1> {
 };
 
@@ -4342,7 +4342,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ResumeInst, Value)
 //===----------------------------------------------------------------------===//
 //                         CatchSwitchInst Class
 //===----------------------------------------------------------------------===//
-class CatchSwitchInst : public Instruction {
+class LLVM_CLASS_ABI CatchSwitchInst : public Instruction {
   using UnwindDestField = BoolBitfieldElementT<0>;
 
   /// The number of operands actually allocated.  NumOperands is
@@ -4513,14 +4513,14 @@ class CatchSwitchInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<CatchSwitchInst> : public HungoffOperandTraits<2> {};
+struct LLVM_CLASS_ABI OperandTraits<CatchSwitchInst> : public HungoffOperandTraits<2> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CatchSwitchInst, Value)
 
 //===----------------------------------------------------------------------===//
 //                               CleanupPadInst Class
 //===----------------------------------------------------------------------===//
-class CleanupPadInst : public FuncletPadInst {
+class LLVM_CLASS_ABI CleanupPadInst : public FuncletPadInst {
 private:
   explicit CleanupPadInst(Value *ParentPad, ArrayRef<Value *> Args,
                           unsigned Values, const Twine &NameStr,
@@ -4562,7 +4562,7 @@ class CleanupPadInst : public FuncletPadInst {
 //===----------------------------------------------------------------------===//
 //                               CatchPadInst Class
 //===----------------------------------------------------------------------===//
-class CatchPadInst : public FuncletPadInst {
+class LLVM_CLASS_ABI CatchPadInst : public FuncletPadInst {
 private:
   explicit CatchPadInst(Value *CatchSwitch, ArrayRef<Value *> Args,
                         unsigned Values, const Twine &NameStr,
@@ -4613,7 +4613,7 @@ class CatchPadInst : public FuncletPadInst {
 //                               CatchReturnInst Class
 //===----------------------------------------------------------------------===//
 
-class CatchReturnInst : public Instruction {
+class LLVM_CLASS_ABI CatchReturnInst : public Instruction {
   CatchReturnInst(const CatchReturnInst &RI);
   CatchReturnInst(Value *CatchPad, BasicBlock *BB, Instruction *InsertBefore);
   CatchReturnInst(Value *CatchPad, BasicBlock *BB, BasicBlock *InsertAtEnd);
@@ -4685,7 +4685,7 @@ class CatchReturnInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<CatchReturnInst>
+struct LLVM_CLASS_ABI OperandTraits<CatchReturnInst>
     : public FixedNumOperandTraits<CatchReturnInst, 2> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CatchReturnInst, Value)
@@ -4694,7 +4694,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CatchReturnInst, Value)
 //                               CleanupReturnInst Class
 //===----------------------------------------------------------------------===//
 
-class CleanupReturnInst : public Instruction {
+class LLVM_CLASS_ABI CleanupReturnInst : public Instruction {
   using UnwindDestField = BoolBitfieldElementT<0>;
 
 private:
@@ -4788,7 +4788,7 @@ class CleanupReturnInst : public Instruction {
 };
 
 template <>
-struct OperandTraits<CleanupReturnInst>
+struct LLVM_CLASS_ABI OperandTraits<CleanupReturnInst>
     : public VariadicOperandTraits<CleanupReturnInst, /*MINARITY=*/1> {};
 
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CleanupReturnInst, Value)
@@ -4802,7 +4802,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CleanupReturnInst, Value)
 /// presence of this instruction indicates some higher level knowledge that the
 /// end of the block cannot be reached.
 ///
-class UnreachableInst : public Instruction {
+class LLVM_CLASS_ABI UnreachableInst : public Instruction {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -4842,7 +4842,7 @@ class UnreachableInst : public Instruction {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a truncation of integer types.
-class TruncInst : public CastInst {
+class LLVM_CLASS_ABI TruncInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -4881,7 +4881,7 @@ class TruncInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents zero extension of integer types.
-class ZExtInst : public CastInst {
+class LLVM_CLASS_ABI ZExtInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -4920,7 +4920,7 @@ class ZExtInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a sign extension of integer types.
-class SExtInst : public CastInst {
+class LLVM_CLASS_ABI SExtInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -4959,7 +4959,7 @@ class SExtInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a truncation of floating point types.
-class FPTruncInst : public CastInst {
+class LLVM_CLASS_ABI FPTruncInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -4998,7 +4998,7 @@ class FPTruncInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents an extension of floating point types.
-class FPExtInst : public CastInst {
+class LLVM_CLASS_ABI FPExtInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5037,7 +5037,7 @@ class FPExtInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a cast unsigned integer to floating point.
-class UIToFPInst : public CastInst {
+class LLVM_CLASS_ABI UIToFPInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5076,7 +5076,7 @@ class UIToFPInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a cast from signed integer to floating point.
-class SIToFPInst : public CastInst {
+class LLVM_CLASS_ABI SIToFPInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5115,7 +5115,7 @@ class SIToFPInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a cast from floating point to unsigned integer
-class FPToUIInst  : public CastInst {
+class LLVM_CLASS_ABI FPToUIInst  : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5154,7 +5154,7 @@ class FPToUIInst  : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a cast from floating point to signed integer.
-class FPToSIInst  : public CastInst {
+class LLVM_CLASS_ABI FPToSIInst  : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5193,7 +5193,7 @@ class FPToSIInst  : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a cast from an integer to a pointer.
-class IntToPtrInst : public CastInst {
+class LLVM_CLASS_ABI IntToPtrInst : public CastInst {
 public:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5236,7 +5236,7 @@ class IntToPtrInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a cast from a pointer to an integer.
-class PtrToIntInst : public CastInst {
+class LLVM_CLASS_ABI PtrToIntInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5287,7 +5287,7 @@ class PtrToIntInst : public CastInst {
 //===----------------------------------------------------------------------===//
 
 /// This class represents a no-op cast from one type to another.
-class BitCastInst : public CastInst {
+class LLVM_CLASS_ABI BitCastInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5327,7 +5327,7 @@ class BitCastInst : public CastInst {
 
 /// This class represents a conversion between pointers from one address space
 /// to another.
-class AddrSpaceCastInst : public CastInst {
+class LLVM_CLASS_ABI AddrSpaceCastInst : public CastInst {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
@@ -5469,7 +5469,7 @@ inline std::optional<SyncScope::ID> getAtomicSyncScopeID(const Instruction *I) {
 
 /// This class represents a freeze function that returns random concrete
 /// value if an operand is either a poison value or an undef value
-class FreezeInst : public UnaryInstruction {
+class LLVM_CLASS_ABI FreezeInst : public UnaryInstruction {
 protected:
   // Note: Instruction needs to be a friend here to call cloneImpl.
   friend class Instruction;
diff --git a/llvm/include/llvm/IR/IntrinsicInst.h b/llvm/include/llvm/IR/IntrinsicInst.h
index ada326d91a581ea..ce04781702d80ed 100644
--- a/llvm/include/llvm/IR/IntrinsicInst.h
+++ b/llvm/include/llvm/IR/IntrinsicInst.h
@@ -45,7 +45,7 @@ class Metadata;
 /// A wrapper class for inspecting calls to intrinsic functions.
 /// This allows the standard isa/dyncast/cast functionality to work with calls
 /// to intrinsic functions.
-class IntrinsicInst : public CallInst {
+class LLVM_CLASS_ABI IntrinsicInst : public CallInst {
 public:
   IntrinsicInst() = delete;
   IntrinsicInst(const IntrinsicInst &) = delete;
@@ -137,7 +137,7 @@ static inline bool isLifetimeIntrinsic(Intrinsic::ID ID) {
 }
 
 /// This is the common base class for lifetime intrinsics.
-class LifetimeIntrinsic : public IntrinsicInst {
+class LLVM_CLASS_ABI LifetimeIntrinsic : public IntrinsicInst {
 public:
   /// \name Casting methods
   /// @{
@@ -164,7 +164,7 @@ static inline bool isDbgInfoIntrinsic(Intrinsic::ID ID) {
 }
 
 /// This is the common base class for debug info intrinsics.
-class DbgInfoIntrinsic : public IntrinsicInst {
+class LLVM_CLASS_ABI DbgInfoIntrinsic : public IntrinsicInst {
 public:
   /// \name Casting methods
   /// @{
@@ -180,7 +180,7 @@ class DbgInfoIntrinsic : public IntrinsicInst {
 // Iterator for ValueAsMetadata that internally uses direct pointer iteration
 // over either a ValueAsMetadata* or a ValueAsMetadata**, dereferencing to the
 // ValueAsMetadata .
-class location_op_iterator
+class LLVM_CLASS_ABI location_op_iterator
     : public iterator_facade_base<location_op_iterator,
                                   std::bidirectional_iterator_tag, Value *> {
   PointerUnion<ValueAsMetadata *, ValueAsMetadata **> I;
@@ -226,7 +226,7 @@ class location_op_iterator
 /// Lightweight class that wraps the location operand metadata of a debug
 /// intrinsic. The raw location may be a ValueAsMetadata, an empty MDTuple,
 /// or a DIArgList.
-class RawLocationWrapper {
+class LLVM_CLASS_ABI RawLocationWrapper {
   Metadata *RawLocation = nullptr;
 
 public:
@@ -291,7 +291,7 @@ class RawLocationWrapper {
 };
 
 /// This is the common base class for debug info intrinsics for variables.
-class DbgVariableIntrinsic : public DbgInfoIntrinsic {
+class LLVM_CLASS_ABI DbgVariableIntrinsic : public DbgInfoIntrinsic {
 public:
   /// Get the locations corresponding to the variable referenced by the debug
   /// info intrinsic.  Depending on the intrinsic, this could be the
@@ -422,7 +422,7 @@ class DbgVariableIntrinsic : public DbgInfoIntrinsic {
 };
 
 /// This represents the llvm.dbg.declare instruction.
-class DbgDeclareInst : public DbgVariableIntrinsic {
+class LLVM_CLASS_ABI DbgDeclareInst : public DbgVariableIntrinsic {
 public:
   Value *getAddress() const {
     assert(getNumVariableLocationOps() == 1 &&
@@ -442,7 +442,7 @@ class DbgDeclareInst : public DbgVariableIntrinsic {
 };
 
 /// This represents the llvm.dbg.value instruction.
-class DbgValueInst : public DbgVariableIntrinsic {
+class LLVM_CLASS_ABI DbgValueInst : public DbgVariableIntrinsic {
 public:
   // The default argument should only be used in ISel, and the default option
   // should be removed once ISel support for multiple location ops is complete.
@@ -466,7 +466,7 @@ class DbgValueInst : public DbgVariableIntrinsic {
 };
 
 /// This represents the llvm.dbg.assign instruction.
-class DbgAssignIntrinsic : public DbgValueInst {
+class LLVM_CLASS_ABI DbgAssignIntrinsic : public DbgValueInst {
   enum Operands {
     OpValue,
     OpVar,
@@ -517,7 +517,7 @@ class DbgAssignIntrinsic : public DbgValueInst {
 };
 
 /// This represents the llvm.dbg.label instruction.
-class DbgLabelInst : public DbgInfoIntrinsic {
+class LLVM_CLASS_ABI DbgLabelInst : public DbgInfoIntrinsic {
 public:
   DILabel *getLabel() const { return cast<DILabel>(getRawLabel()); }
 
@@ -537,7 +537,7 @@ class DbgLabelInst : public DbgInfoIntrinsic {
 };
 
 /// This is the common base class for vector predication intrinsics.
-class VPIntrinsic : public IntrinsicInst {
+class LLVM_CLASS_ABI VPIntrinsic : public IntrinsicInst {
 public:
   /// \brief Declares a llvm.vp.* intrinsic in \p M that matches the parameters
   /// \p Params. Additionally, the load and gather intrinsics require
@@ -611,7 +611,7 @@ class VPIntrinsic : public IntrinsicInst {
 };
 
 /// This represents vector predication reduction intrinsics.
-class VPReductionIntrinsic : public VPIntrinsic {
+class LLVM_CLASS_ABI VPReductionIntrinsic : public VPIntrinsic {
 public:
   static bool isVPReduction(Intrinsic::ID ID);
 
@@ -632,7 +632,7 @@ class VPReductionIntrinsic : public VPIntrinsic {
   /// @}
 };
 
-class VPCastIntrinsic : public VPIntrinsic {
+class LLVM_CLASS_ABI VPCastIntrinsic : public VPIntrinsic {
 public:
   static bool isVPCast(Intrinsic::ID ID);
 
@@ -647,7 +647,7 @@ class VPCastIntrinsic : public VPIntrinsic {
   /// @}
 };
 
-class VPCmpIntrinsic : public VPIntrinsic {
+class LLVM_CLASS_ABI VPCmpIntrinsic : public VPIntrinsic {
 public:
   static bool isVPCmp(Intrinsic::ID ID);
 
@@ -665,7 +665,7 @@ class VPCmpIntrinsic : public VPIntrinsic {
 };
 
 /// This is the common base class for constrained floating point intrinsics.
-class ConstrainedFPIntrinsic : public IntrinsicInst {
+class LLVM_CLASS_ABI ConstrainedFPIntrinsic : public IntrinsicInst {
 public:
   bool isUnaryOp() const;
   bool isTernaryOp() const;
@@ -681,7 +681,7 @@ class ConstrainedFPIntrinsic : public IntrinsicInst {
 };
 
 /// Constrained floating point compare intrinsics.
-class ConstrainedFPCmpIntrinsic : public ConstrainedFPIntrinsic {
+class LLVM_CLASS_ABI ConstrainedFPCmpIntrinsic : public ConstrainedFPIntrinsic {
 public:
   FCmpInst::Predicate getPredicate() const;
   bool isSignaling() const {
@@ -704,7 +704,7 @@ class ConstrainedFPCmpIntrinsic : public ConstrainedFPIntrinsic {
 };
 
 /// This class represents min/max intrinsics.
-class MinMaxIntrinsic : public IntrinsicInst {
+class LLVM_CLASS_ABI MinMaxIntrinsic : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -796,7 +796,7 @@ class MinMaxIntrinsic : public IntrinsicInst {
 
 /// This class represents an intrinsic that is based on a binary operation.
 /// This includes op.with.overflow and saturating add/sub intrinsics.
-class BinaryOpIntrinsic : public IntrinsicInst {
+class LLVM_CLASS_ABI BinaryOpIntrinsic : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -833,7 +833,7 @@ class BinaryOpIntrinsic : public IntrinsicInst {
 };
 
 /// Represents an op.with.overflow intrinsic.
-class WithOverflowInst : public BinaryOpIntrinsic {
+class LLVM_CLASS_ABI WithOverflowInst : public BinaryOpIntrinsic {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -854,7 +854,7 @@ class WithOverflowInst : public BinaryOpIntrinsic {
 };
 
 /// Represents a saturating add/sub intrinsic.
-class SaturatingInst : public BinaryOpIntrinsic {
+class LLVM_CLASS_ABI SaturatingInst : public BinaryOpIntrinsic {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -876,7 +876,7 @@ class SaturatingInst : public BinaryOpIntrinsic {
 /// common methods.
 /// Written as CRTP to avoid a common base class amongst the
 /// three atomicity hierarchies.
-template <typename Derived> class MemIntrinsicBase : public IntrinsicInst {
+template <typename Derived> class LLVM_CLASS_ABI MemIntrinsicBase : public IntrinsicInst {
 private:
   enum { ARG_DEST = 0, ARG_LENGTH = 2 };
 
@@ -940,7 +940,7 @@ template <typename Derived> class MemIntrinsicBase : public IntrinsicInst {
 
 /// Common base class for all memory transfer intrinsics. Simply provides
 /// common methods.
-template <class BaseCL> class MemTransferBase : public BaseCL {
+template <class BaseCL> class LLVM_CLASS_ABI MemTransferBase : public BaseCL {
 private:
   enum { ARG_SOURCE = 1 };
 
@@ -998,7 +998,7 @@ template <class BaseCL> class MemTransferBase : public BaseCL {
 
 /// Common base class for all memset intrinsics. Simply provides
 /// common methods.
-template <class BaseCL> class MemSetBase : public BaseCL {
+template <class BaseCL> class LLVM_CLASS_ABI MemSetBase : public BaseCL {
 private:
   enum { ARG_VALUE = 1 };
 
@@ -1018,7 +1018,7 @@ template <class BaseCL> class MemSetBase : public BaseCL {
 
 // The common base class for the atomic memset/memmove/memcpy intrinsics
 // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove
-class AtomicMemIntrinsic : public MemIntrinsicBase<AtomicMemIntrinsic> {
+class LLVM_CLASS_ABI AtomicMemIntrinsic : public MemIntrinsicBase<AtomicMemIntrinsic> {
 private:
   enum { ARG_ELEMENTSIZE = 3 };
 
@@ -1058,7 +1058,7 @@ class AtomicMemIntrinsic : public MemIntrinsicBase<AtomicMemIntrinsic> {
 
 /// This class represents atomic memset intrinsic
 // i.e. llvm.element.unordered.atomic.memset
-class AtomicMemSetInst : public MemSetBase<AtomicMemIntrinsic> {
+class LLVM_CLASS_ABI AtomicMemSetInst : public MemSetBase<AtomicMemIntrinsic> {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::memset_element_unordered_atomic;
@@ -1070,7 +1070,7 @@ class AtomicMemSetInst : public MemSetBase<AtomicMemIntrinsic> {
 
 // This class wraps the atomic memcpy/memmove intrinsics
 // i.e. llvm.element.unordered.atomic.memcpy/memmove
-class AtomicMemTransferInst : public MemTransferBase<AtomicMemIntrinsic> {
+class LLVM_CLASS_ABI AtomicMemTransferInst : public MemTransferBase<AtomicMemIntrinsic> {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -1088,7 +1088,7 @@ class AtomicMemTransferInst : public MemTransferBase<AtomicMemIntrinsic> {
 
 /// This class represents the atomic memcpy intrinsic
 /// i.e. llvm.element.unordered.atomic.memcpy
-class AtomicMemCpyInst : public AtomicMemTransferInst {
+class LLVM_CLASS_ABI AtomicMemCpyInst : public AtomicMemTransferInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::memcpy_element_unordered_atomic;
@@ -1100,7 +1100,7 @@ class AtomicMemCpyInst : public AtomicMemTransferInst {
 
 /// This class represents the atomic memmove intrinsic
 /// i.e. llvm.element.unordered.atomic.memmove
-class AtomicMemMoveInst : public AtomicMemTransferInst {
+class LLVM_CLASS_ABI AtomicMemMoveInst : public AtomicMemTransferInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::memmove_element_unordered_atomic;
@@ -1111,7 +1111,7 @@ class AtomicMemMoveInst : public AtomicMemTransferInst {
 };
 
 /// This is the common base class for memset/memcpy/memmove.
-class MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
+class LLVM_CLASS_ABI MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
 private:
   enum { ARG_VOLATILE = 3 };
 
@@ -1143,7 +1143,7 @@ class MemIntrinsic : public MemIntrinsicBase<MemIntrinsic> {
 };
 
 /// This class wraps the llvm.memset and llvm.memset.inline intrinsics.
-class MemSetInst : public MemSetBase<MemIntrinsic> {
+class LLVM_CLASS_ABI MemSetInst : public MemSetBase<MemIntrinsic> {
 public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static bool classof(const IntrinsicInst *I) {
@@ -1161,7 +1161,7 @@ class MemSetInst : public MemSetBase<MemIntrinsic> {
 };
 
 /// This class wraps the llvm.memset.inline intrinsic.
-class MemSetInlineInst : public MemSetInst {
+class LLVM_CLASS_ABI MemSetInlineInst : public MemSetInst {
 public:
   ConstantInt *getLength() const {
     return cast<ConstantInt>(MemSetInst::getLength());
@@ -1176,7 +1176,7 @@ class MemSetInlineInst : public MemSetInst {
 };
 
 /// This class wraps the llvm.memcpy/memmove intrinsics.
-class MemTransferInst : public MemTransferBase<MemIntrinsic> {
+class LLVM_CLASS_ABI MemTransferInst : public MemTransferBase<MemIntrinsic> {
 public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static bool classof(const IntrinsicInst *I) {
@@ -1195,7 +1195,7 @@ class MemTransferInst : public MemTransferBase<MemIntrinsic> {
 };
 
 /// This class wraps the llvm.memcpy intrinsic.
-class MemCpyInst : public MemTransferInst {
+class LLVM_CLASS_ABI MemCpyInst : public MemTransferInst {
 public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static bool classof(const IntrinsicInst *I) {
@@ -1208,7 +1208,7 @@ class MemCpyInst : public MemTransferInst {
 };
 
 /// This class wraps the llvm.memmove intrinsic.
-class MemMoveInst : public MemTransferInst {
+class LLVM_CLASS_ABI MemMoveInst : public MemTransferInst {
 public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static bool classof(const IntrinsicInst *I) {
@@ -1220,7 +1220,7 @@ class MemMoveInst : public MemTransferInst {
 };
 
 /// This class wraps the llvm.memcpy.inline intrinsic.
-class MemCpyInlineInst : public MemCpyInst {
+class LLVM_CLASS_ABI MemCpyInlineInst : public MemCpyInst {
 public:
   ConstantInt *getLength() const {
     return cast<ConstantInt>(MemCpyInst::getLength());
@@ -1238,7 +1238,7 @@ class MemCpyInlineInst : public MemCpyInst {
 // whether they be atomic or non-atomic.
 // i.e. llvm.element.unordered.atomic.memset/memcpy/memmove
 //  and llvm.memset/memcpy/memmove
-class AnyMemIntrinsic : public MemIntrinsicBase<AnyMemIntrinsic> {
+class LLVM_CLASS_ABI AnyMemIntrinsic : public MemIntrinsicBase<AnyMemIntrinsic> {
 public:
   bool isVolatile() const {
     // Only the non-atomic intrinsics can be volatile
@@ -1270,7 +1270,7 @@ class AnyMemIntrinsic : public MemIntrinsicBase<AnyMemIntrinsic> {
 /// This class represents any memset intrinsic
 // i.e. llvm.element.unordered.atomic.memset
 // and  llvm.memset
-class AnyMemSetInst : public MemSetBase<AnyMemIntrinsic> {
+class LLVM_CLASS_ABI AnyMemSetInst : public MemSetBase<AnyMemIntrinsic> {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -1290,7 +1290,7 @@ class AnyMemSetInst : public MemSetBase<AnyMemIntrinsic> {
 // This class wraps any memcpy/memmove intrinsics
 // i.e. llvm.element.unordered.atomic.memcpy/memmove
 // and  llvm.memcpy/memmove
-class AnyMemTransferInst : public MemTransferBase<AnyMemIntrinsic> {
+class LLVM_CLASS_ABI AnyMemTransferInst : public MemTransferBase<AnyMemIntrinsic> {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -1312,7 +1312,7 @@ class AnyMemTransferInst : public MemTransferBase<AnyMemIntrinsic> {
 /// This class represents any memcpy intrinsic
 /// i.e. llvm.element.unordered.atomic.memcpy
 ///  and llvm.memcpy
-class AnyMemCpyInst : public AnyMemTransferInst {
+class LLVM_CLASS_ABI AnyMemCpyInst : public AnyMemTransferInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -1332,7 +1332,7 @@ class AnyMemCpyInst : public AnyMemTransferInst {
 /// This class represents any memmove intrinsic
 /// i.e. llvm.element.unordered.atomic.memmove
 ///  and llvm.memmove
-class AnyMemMoveInst : public AnyMemTransferInst {
+class LLVM_CLASS_ABI AnyMemMoveInst : public AnyMemTransferInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     switch (I->getIntrinsicID()) {
@@ -1349,7 +1349,7 @@ class AnyMemMoveInst : public AnyMemTransferInst {
 };
 
 /// This represents the llvm.va_start intrinsic.
-class VAStartInst : public IntrinsicInst {
+class LLVM_CLASS_ABI VAStartInst : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::vastart;
@@ -1362,7 +1362,7 @@ class VAStartInst : public IntrinsicInst {
 };
 
 /// This represents the llvm.va_end intrinsic.
-class VAEndInst : public IntrinsicInst {
+class LLVM_CLASS_ABI VAEndInst : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::vaend;
@@ -1375,7 +1375,7 @@ class VAEndInst : public IntrinsicInst {
 };
 
 /// This represents the llvm.va_copy intrinsic.
-class VACopyInst : public IntrinsicInst {
+class LLVM_CLASS_ABI VACopyInst : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::vacopy;
@@ -1389,7 +1389,7 @@ class VACopyInst : public IntrinsicInst {
 };
 
 /// A base class for all instrprof intrinsics.
-class InstrProfInstBase : public IntrinsicInst {
+class LLVM_CLASS_ABI InstrProfInstBase : public IntrinsicInst {
 public:
   // The name of the instrumented function.
   GlobalVariable *getName() const {
@@ -1407,7 +1407,7 @@ class InstrProfInstBase : public IntrinsicInst {
 };
 
 /// This represents the llvm.instrprof.cover intrinsic.
-class InstrProfCoverInst : public InstrProfInstBase {
+class LLVM_CLASS_ABI InstrProfCoverInst : public InstrProfInstBase {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::instrprof_cover;
@@ -1418,7 +1418,7 @@ class InstrProfCoverInst : public InstrProfInstBase {
 };
 
 /// This represents the llvm.instrprof.increment intrinsic.
-class InstrProfIncrementInst : public InstrProfInstBase {
+class LLVM_CLASS_ABI InstrProfIncrementInst : public InstrProfInstBase {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::instrprof_increment ||
@@ -1431,7 +1431,7 @@ class InstrProfIncrementInst : public InstrProfInstBase {
 };
 
 /// This represents the llvm.instrprof.increment.step intrinsic.
-class InstrProfIncrementInstStep : public InstrProfIncrementInst {
+class LLVM_CLASS_ABI InstrProfIncrementInstStep : public InstrProfIncrementInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::instrprof_increment_step;
@@ -1442,7 +1442,7 @@ class InstrProfIncrementInstStep : public InstrProfIncrementInst {
 };
 
 /// This represents the llvm.instrprof.timestamp intrinsic.
-class InstrProfTimestampInst : public InstrProfInstBase {
+class LLVM_CLASS_ABI InstrProfTimestampInst : public InstrProfInstBase {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::instrprof_timestamp;
@@ -1453,7 +1453,7 @@ class InstrProfTimestampInst : public InstrProfInstBase {
 };
 
 /// This represents the llvm.instrprof.value.profile intrinsic.
-class InstrProfValueProfileInst : public InstrProfInstBase {
+class LLVM_CLASS_ABI InstrProfValueProfileInst : public InstrProfInstBase {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::instrprof_value_profile;
@@ -1476,7 +1476,7 @@ class InstrProfValueProfileInst : public InstrProfInstBase {
   }
 };
 
-class PseudoProbeInst : public IntrinsicInst {
+class LLVM_CLASS_ABI PseudoProbeInst : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::pseudoprobe;
@@ -1503,7 +1503,7 @@ class PseudoProbeInst : public IntrinsicInst {
   }
 };
 
-class NoAliasScopeDeclInst : public IntrinsicInst {
+class LLVM_CLASS_ABI NoAliasScopeDeclInst : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::experimental_noalias_scope_decl;
@@ -1527,7 +1527,7 @@ class NoAliasScopeDeclInst : public IntrinsicInst {
 
 /// Common base class for representing values projected from a statepoint.
 /// Currently, the only projections available are gc.result and gc.relocate.
-class GCProjectionInst : public IntrinsicInst {
+class LLVM_CLASS_ABI GCProjectionInst : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate ||
@@ -1551,7 +1551,7 @@ class GCProjectionInst : public IntrinsicInst {
 };
 
 /// Represents calls to the gc.relocate intrinsic.
-class GCRelocateInst : public GCProjectionInst {
+class LLVM_CLASS_ABI GCRelocateInst : public GCProjectionInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate;
@@ -1579,7 +1579,7 @@ class GCRelocateInst : public GCProjectionInst {
 };
 
 /// Represents calls to the gc.result intrinsic.
-class GCResultInst : public GCProjectionInst {
+class LLVM_CLASS_ABI GCResultInst : public GCProjectionInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::experimental_gc_result;
@@ -1592,7 +1592,7 @@ class GCResultInst : public GCProjectionInst {
 
 
 /// This represents the llvm.assume intrinsic.
-class AssumeInst : public IntrinsicInst {
+class LLVM_CLASS_ABI AssumeInst : public IntrinsicInst {
 public:
   static bool classof(const IntrinsicInst *I) {
     return I->getIntrinsicID() == Intrinsic::assume;
diff --git a/llvm/include/llvm/IR/Intrinsics.h b/llvm/include/llvm/IR/Intrinsics.h
index fbadd753df5d51f..5861ca952b38ee4 100644
--- a/llvm/include/llvm/IR/Intrinsics.h
+++ b/llvm/include/llvm/IR/Intrinsics.h
@@ -53,11 +53,11 @@ namespace Intrinsic {
   /// Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
   /// Note, this version is for intrinsics with no overloads.  Use the other
   /// version of getName if overloads are required.
-  StringRef getName(ID id);
+  LLVM_FUNC_ABI StringRef getName(ID id);
 
   /// Return the LLVM name for an intrinsic, without encoded types for
   /// overloading, such as "llvm.ssa.copy".
-  StringRef getBaseName(ID id);
+  LLVM_FUNC_ABI StringRef getBaseName(ID id);
 
   /// Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx" or
   /// "llvm.ssa.copy.p0s_s.1". Note, this version of getName supports overloads.
@@ -65,23 +65,23 @@ namespace Intrinsic {
   /// overloads are required, it is safe to use this version, but better to use
   /// the StringRef version. If one of the types is based on an unnamed type, a
   /// function type will be computed. Providing FT will avoid this computation.
-  std::string getName(ID Id, ArrayRef<Type *> Tys, Module *M,
+  LLVM_FUNC_ABI std::string getName(ID Id, ArrayRef<Type *> Tys, Module *M,
                       FunctionType *FT = nullptr);
 
   /// Return the LLVM name for an intrinsic. This is a special version only to
   /// be used by LLVMIntrinsicCopyOverloadedName. It only supports overloads
   /// based on named types.
-  std::string getNameNoUnnamedTypes(ID Id, ArrayRef<Type *> Tys);
+  LLVM_FUNC_ABI std::string getNameNoUnnamedTypes(ID Id, ArrayRef<Type *> Tys);
 
   /// Return the function type for an intrinsic.
-  FunctionType *getType(LLVMContext &Context, ID id,
+  LLVM_FUNC_ABI FunctionType *getType(LLVMContext &Context, ID id,
                         ArrayRef<Type *> Tys = std::nullopt);
 
   /// Returns true if the intrinsic can be overloaded.
-  bool isOverloaded(ID id);
+  LLVM_FUNC_ABI bool isOverloaded(ID id);
 
   /// Return the attributes for an intrinsic.
-  AttributeList getAttributes(LLVMContext &C, ID id);
+  LLVM_FUNC_ABI AttributeList getAttributes(LLVMContext &C, ID id);
 
   /// Create or insert an LLVM Function declaration for an intrinsic, and return
   /// it.
@@ -90,25 +90,25 @@ namespace Intrinsic {
   /// using iAny, fAny, vAny, or iPTRAny).  For a declaration of an overloaded
   /// intrinsic, Tys must provide exactly one type for each overloaded type in
   /// the intrinsic.
-  Function *getDeclaration(Module *M, ID id,
+  LLVM_FUNC_ABI Function *getDeclaration(Module *M, ID id,
                            ArrayRef<Type *> Tys = std::nullopt);
 
   /// Looks up Name in NameTable via binary search. NameTable must be sorted
   /// and all entries must start with "llvm.".  If NameTable contains an exact
   /// match for Name or a prefix of Name followed by a dot, its index in
   /// NameTable is returned. Otherwise, -1 is returned.
-  int lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable,
+  LLVM_FUNC_ABI int lookupLLVMIntrinsicByName(ArrayRef<const char *> NameTable,
                                 StringRef Name);
 
   /// Map a Clang builtin name to an intrinsic ID.
-  ID getIntrinsicForClangBuiltin(const char *Prefix, StringRef BuiltinName);
+  LLVM_FUNC_ABI ID getIntrinsicForClangBuiltin(const char *Prefix, StringRef BuiltinName);
 
   /// Map a MS builtin name to an intrinsic ID.
-  ID getIntrinsicForMSBuiltin(const char *Prefix, StringRef BuiltinName);
+  LLVM_FUNC_ABI ID getIntrinsicForMSBuiltin(const char *Prefix, StringRef BuiltinName);
 
   /// This is a type descriptor which explains the type requirements of an
   /// intrinsic. This is returned by getIntrinsicInfoTableEntries.
-  struct IITDescriptor {
+  struct LLVM_CLASS_ABI IITDescriptor {
     enum IITDescriptorKind {
       Void,
       VarArg,
@@ -209,7 +209,7 @@ namespace Intrinsic {
 
   /// Return the IIT table descriptor for the specified intrinsic into an array
   /// of IITDescriptors.
-  void getIntrinsicInfoTableEntries(ID id, SmallVectorImpl<IITDescriptor> &T);
+  LLVM_FUNC_ABI void getIntrinsicInfoTableEntries(ID id, SmallVectorImpl<IITDescriptor> &T);
 
   enum MatchIntrinsicTypesResult {
     MatchIntrinsicTypes_Match = 0,
@@ -223,7 +223,7 @@ namespace Intrinsic {
   ///
   /// Returns false if the given type matches with the constraints, true
   /// otherwise.
-  MatchIntrinsicTypesResult
+  LLVM_FUNC_ABI MatchIntrinsicTypesResult
   matchIntrinsicSignature(FunctionType *FTy, ArrayRef<IITDescriptor> &Infos,
                           SmallVectorImpl<Type *> &ArgTys);
 
@@ -231,20 +231,20 @@ namespace Intrinsic {
   /// be called after all the fixed arguments have been matched first.
   ///
   /// This method returns true on error.
-  bool matchIntrinsicVarArg(bool isVarArg, ArrayRef<IITDescriptor> &Infos);
+  LLVM_FUNC_ABI bool matchIntrinsicVarArg(bool isVarArg, ArrayRef<IITDescriptor> &Infos);
 
   /// Gets the type arguments of an intrinsic call by matching type contraints
   /// specified by the .td file. The overloaded types are pushed into the
   /// AgTys vector.
   ///
   /// Returns false if the given function is not a valid intrinsic call.
-  bool getIntrinsicSignature(Function *F, SmallVectorImpl<Type *> &ArgTys);
+  LLVM_FUNC_ABI bool getIntrinsicSignature(Function *F, SmallVectorImpl<Type *> &ArgTys);
 
   // Checks if the intrinsic name matches with its signature and if not
   // returns the declaration with the same signature and remangled name.
   // An existing GlobalValue with the wanted name but with a wrong prototype
   // or of the wrong kind will be renamed by adding ".renamed" to the name.
-  std::optional<Function *> remangleIntrinsicFunction(Function *F);
+  LLVM_FUNC_ABI std::optional<Function *> remangleIntrinsicFunction(Function *F);
 
 } // End Intrinsic namespace
 
diff --git a/llvm/include/llvm/IR/LLVMContext.h b/llvm/include/llvm/IR/LLVMContext.h
index 2f243bb0fcc4822..ccc7431ea139db7 100644
--- a/llvm/include/llvm/IR/LLVMContext.h
+++ b/llvm/include/llvm/IR/LLVMContext.h
@@ -65,7 +65,7 @@ enum {
 /// infrastructure, including the type and constant uniquing tables.
 /// LLVMContext itself provides no locking guarantees, so you should be careful
 /// to have one context per thread.
-class LLVMContext {
+class LLVM_CLASS_ABI LLVMContext {
 public:
   LLVMContextImpl *const pImpl;
   LLVMContext();
diff --git a/llvm/include/llvm/IR/LLVMRemarkStreamer.h b/llvm/include/llvm/IR/LLVMRemarkStreamer.h
index 6710a61e6c3255b..36e3a355368750c 100644
--- a/llvm/include/llvm/IR/LLVMRemarkStreamer.h
+++ b/llvm/include/llvm/IR/LLVMRemarkStreamer.h
@@ -32,7 +32,7 @@ class RemarkStreamer;
 
 /// Streamer for LLVM remarks which has logic for dealing with DiagnosticInfo
 /// objects.
-class LLVMRemarkStreamer {
+class LLVM_CLASS_ABI LLVMRemarkStreamer {
   remarks::RemarkStreamer &RS;
   /// Convert diagnostics into remark objects.
   /// The lifetime of the members of the result is bound to the lifetime of
@@ -46,7 +46,7 @@ class LLVMRemarkStreamer {
 };
 
 template <typename ThisError>
-struct LLVMRemarkSetupErrorInfo : public ErrorInfo<ThisError> {
+struct LLVM_CLASS_ABI LLVMRemarkSetupErrorInfo : public ErrorInfo<ThisError> {
   std::string Msg;
   std::error_code EC;
 
@@ -61,21 +61,21 @@ struct LLVMRemarkSetupErrorInfo : public ErrorInfo<ThisError> {
   std::error_code convertToErrorCode() const override { return EC; }
 };
 
-struct LLVMRemarkSetupFileError
+struct LLVM_CLASS_ABI LLVMRemarkSetupFileError
     : LLVMRemarkSetupErrorInfo<LLVMRemarkSetupFileError> {
   static char ID;
   using LLVMRemarkSetupErrorInfo<
       LLVMRemarkSetupFileError>::LLVMRemarkSetupErrorInfo;
 };
 
-struct LLVMRemarkSetupPatternError
+struct LLVM_CLASS_ABI LLVMRemarkSetupPatternError
     : LLVMRemarkSetupErrorInfo<LLVMRemarkSetupPatternError> {
   static char ID;
   using LLVMRemarkSetupErrorInfo<
       LLVMRemarkSetupPatternError>::LLVMRemarkSetupErrorInfo;
 };
 
-struct LLVMRemarkSetupFormatError
+struct LLVM_CLASS_ABI LLVMRemarkSetupFormatError
     : LLVMRemarkSetupErrorInfo<LLVMRemarkSetupFormatError> {
   static char ID;
   using LLVMRemarkSetupErrorInfo<
@@ -83,7 +83,7 @@ struct LLVMRemarkSetupFormatError
 };
 
 /// Setup optimization remarks that output to a file.
-Expected<std::unique_ptr<ToolOutputFile>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<ToolOutputFile>>
 setupLLVMOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename,
                              StringRef RemarksPasses, StringRef RemarksFormat,
                              bool RemarksWithHotness,
@@ -92,7 +92,7 @@ setupLLVMOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename,
 /// Setup optimization remarks that output directly to a raw_ostream.
 /// \p OS is managed by the caller and should be open for writing as long as \p
 /// Context is streaming remarks to it.
-Error setupLLVMOptimizationRemarks(
+LLVM_FUNC_ABI Error setupLLVMOptimizationRemarks(
     LLVMContext &Context, raw_ostream &OS, StringRef RemarksPasses,
     StringRef RemarksFormat, bool RemarksWithHotness,
     std::optional<uint64_t> RemarksHotnessThreshold = 0);
diff --git a/llvm/include/llvm/IR/LegacyPassManager.h b/llvm/include/llvm/IR/LegacyPassManager.h
index 5163bb1f67f9039..c9969a4d19a6c7d 100644
--- a/llvm/include/llvm/IR/LegacyPassManager.h
+++ b/llvm/include/llvm/IR/LegacyPassManager.h
@@ -29,7 +29,7 @@ namespace legacy {
 
 // Whether or not -debug-pass has been specified. For use to check if it's
 // specified alongside the new PM.
-bool debugPassSpecified();
+LLVM_FUNC_ABI bool debugPassSpecified();
 
 class PassManagerImpl;
 class FunctionPassManagerImpl;
@@ -37,7 +37,7 @@ class FunctionPassManagerImpl;
 /// PassManagerBase - An abstract interface to allow code to add passes to
 /// a pass manager without having to hard-code what kind of pass manager
 /// it is.
-class PassManagerBase {
+class LLVM_CLASS_ABI PassManagerBase {
 public:
   virtual ~PassManagerBase();
 
@@ -50,7 +50,7 @@ class PassManagerBase {
 };
 
 /// PassManager manages ModulePassManagers
-class PassManager : public PassManagerBase {
+class LLVM_CLASS_ABI PassManager : public PassManagerBase {
 public:
 
   PassManager();
@@ -69,7 +69,7 @@ class PassManager : public PassManagerBase {
 };
 
 /// FunctionPassManager manages FunctionPasses.
-class FunctionPassManager : public PassManagerBase {
+class LLVM_CLASS_ABI FunctionPassManager : public PassManagerBase {
 public:
   /// FunctionPassManager ctor - This initializes the pass manager.  It needs,
   /// but does not take ownership of, the specified Module.
diff --git a/llvm/include/llvm/IR/LegacyPassManagers.h b/llvm/include/llvm/IR/LegacyPassManagers.h
index 0ab95fa03d77e0f..75be8fc9afa7947 100644
--- a/llvm/include/llvm/IR/LegacyPassManagers.h
+++ b/llvm/include/llvm/IR/LegacyPassManagers.h
@@ -107,7 +107,7 @@ enum PassDebuggingString {
 
 /// PassManagerPrettyStackEntry - This is used to print informative information
 /// about what pass is running when/if a stack trace is generated.
-class PassManagerPrettyStackEntry : public PrettyStackTraceEntry {
+class LLVM_CLASS_ABI PassManagerPrettyStackEntry : public PrettyStackTraceEntry {
   Pass *P;
   Value *V;
   Module *M;
@@ -134,7 +134,7 @@ class PassManagerPrettyStackEntry : public PrettyStackTraceEntry {
 /// using PMStack. Each Pass implements assignPassManager() to connect itself
 /// with appropriate manager. assignPassManager() walks PMStack to find
 /// suitable manager.
-class PMStack {
+class LLVM_CLASS_ABI PMStack {
 public:
   typedef std::vector<PMDataManager *>::const_reverse_iterator iterator;
   iterator begin() const { return S.rbegin(); }
@@ -156,7 +156,7 @@ class PMStack {
 //
 /// PMTopLevelManager manages LastUser info and collects common APIs used by
 /// top level pass managers.
-class PMTopLevelManager {
+class LLVM_CLASS_ABI PMTopLevelManager {
 protected:
   explicit PMTopLevelManager(PMDataManager *PMDM);
 
@@ -293,7 +293,7 @@ class PMTopLevelManager {
 
 /// PMDataManager provides the common place to manage the analysis data
 /// used by pass managers.
-class PMDataManager {
+class LLVM_CLASS_ABI PMDataManager {
 public:
   explicit PMDataManager() { initializeAnalysisInfo(); }
 
@@ -455,7 +455,7 @@ class PMDataManager {
 /// It batches all function passes and basic block pass managers together and
 /// sequence them to process one function at a time before processing next
 /// function.
-class FPPassManager : public ModulePass, public PMDataManager {
+class LLVM_CLASS_ABI FPPassManager : public ModulePass, public PMDataManager {
 public:
   static char ID;
   explicit FPPassManager() : ModulePass(ID) {}
diff --git a/llvm/include/llvm/IR/LegacyPassNameParser.h b/llvm/include/llvm/IR/LegacyPassNameParser.h
index fca6d16405da519..f88e5dc74efc610 100644
--- a/llvm/include/llvm/IR/LegacyPassNameParser.h
+++ b/llvm/include/llvm/IR/LegacyPassNameParser.h
@@ -39,7 +39,7 @@ namespace llvm {
 // PassNameParser class - Make use of the pass registration mechanism to
 // automatically add a command line argument to opt for each pass.
 //
-class PassNameParser : public PassRegistrationListener,
+class LLVM_CLASS_ABI PassNameParser : public PassRegistrationListener,
                        public cl::parser<const PassInfo*> {
 public:
   PassNameParser(cl::Option &O);
diff --git a/llvm/include/llvm/IR/MDBuilder.h b/llvm/include/llvm/IR/MDBuilder.h
index 213be47c49f98f6..2a95fafeb80fdad 100644
--- a/llvm/include/llvm/IR/MDBuilder.h
+++ b/llvm/include/llvm/IR/MDBuilder.h
@@ -34,7 +34,7 @@ class MDNode;
 class MDString;
 class Metadata;
 
-class MDBuilder {
+class LLVM_CLASS_ABI MDBuilder {
   LLVMContext &Context;
 
 public:
diff --git a/llvm/include/llvm/IR/Mangler.h b/llvm/include/llvm/IR/Mangler.h
index f3380a279f28ead..2b1e2b25156eb5e 100644
--- a/llvm/include/llvm/IR/Mangler.h
+++ b/llvm/include/llvm/IR/Mangler.h
@@ -25,7 +25,7 @@ class Triple;
 class Twine;
 class raw_ostream;
 
-class Mangler {
+class LLVM_CLASS_ABI Mangler {
   /// We need to give global values the same name every time they are mangled.
   /// This keeps track of the number we give to anonymous ones.
   mutable DenseMap<const GlobalValue*, unsigned> AnonGlobalIDs;
@@ -47,10 +47,10 @@ class Mangler {
                                 const Twine &GVName, const DataLayout &DL);
 };
 
-void emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
+LLVM_FUNC_ABI void emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
                                   const Triple &TT, Mangler &Mangler);
 
-void emitLinkerFlagsForUsedCOFF(raw_ostream &OS, const GlobalValue *GV,
+LLVM_FUNC_ABI void emitLinkerFlagsForUsedCOFF(raw_ostream &OS, const GlobalValue *GV,
                                 const Triple &T, Mangler &M);
 
 } // End llvm namespace
diff --git a/llvm/include/llvm/IR/MatrixBuilder.h b/llvm/include/llvm/IR/MatrixBuilder.h
index 694a1b7a8e9194e..deead6095129d60 100644
--- a/llvm/include/llvm/IR/MatrixBuilder.h
+++ b/llvm/include/llvm/IR/MatrixBuilder.h
@@ -31,7 +31,7 @@ class Function;
 class Twine;
 class Module;
 
-class MatrixBuilder {
+class LLVM_CLASS_ABI MatrixBuilder {
   IRBuilderBase &B;
   Module *getModule() { return B.GetInsertBlock()->getParent()->getParent(); }
 
diff --git a/llvm/include/llvm/IR/Metadata.h b/llvm/include/llvm/IR/Metadata.h
index 9890a6518187883..8c946e2fd132762 100644
--- a/llvm/include/llvm/IR/Metadata.h
+++ b/llvm/include/llvm/IR/Metadata.h
@@ -59,7 +59,7 @@ const uint64_t NOMORE_ICP_MAGICNUM = -1;
 /// Root of the metadata hierarchy.
 ///
 /// This is a root class for typeless data in the IR.
-class Metadata {
+class LLVM_CLASS_ABI Metadata {
   friend class ReplaceableMetadataImpl;
 
   /// RTTI.
@@ -173,7 +173,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const Metadata &MD) {
 ///
 /// Notably, this is the only thing in either hierarchy that is allowed to
 /// reference \a LocalAsMetadata.
-class MetadataAsValue : public Value {
+class LLVM_CLASS_ABI MetadataAsValue : public Value {
   friend class ReplaceableMetadataImpl;
   friend class LLVMContextImpl;
 
@@ -209,7 +209,7 @@ class MetadataAsValue : public Value {
 ///
 /// This API is not meant to be used directly.  See \a TrackingMDRef for a
 /// user-friendly tracking reference.
-class MetadataTracking {
+class LLVM_CLASS_ABI MetadataTracking {
 public:
   /// Track the reference to metadata.
   ///
@@ -278,7 +278,7 @@ class MetadataTracking {
 /// Most metadata cannot be RAUW'ed.  This is a shared implementation of
 /// use-lists and associated API for the two that support it (\a ValueAsMetadata
 /// and \a TempMDNode).
-class ReplaceableMetadataImpl {
+class LLVM_CLASS_ABI ReplaceableMetadataImpl {
   friend class MetadataTracking;
 
 public:
@@ -342,7 +342,7 @@ class ReplaceableMetadataImpl {
 /// Because of full uniquing support, each value is only wrapped by a single \a
 /// ValueAsMetadata object, so the lookup maps are far more efficient than
 /// those using ValueHandleBase.
-class ValueAsMetadata : public Metadata, ReplaceableMetadataImpl {
+class LLVM_CLASS_ABI ValueAsMetadata : public Metadata, ReplaceableMetadataImpl {
   friend class ReplaceableMetadataImpl;
   friend class LLVMContextImpl;
 
@@ -410,7 +410,7 @@ class ValueAsMetadata : public Metadata, ReplaceableMetadataImpl {
   }
 };
 
-class ConstantAsMetadata : public ValueAsMetadata {
+class LLVM_CLASS_ABI ConstantAsMetadata : public ValueAsMetadata {
   friend class ValueAsMetadata;
 
   ConstantAsMetadata(Constant *C)
@@ -434,7 +434,7 @@ class ConstantAsMetadata : public ValueAsMetadata {
   }
 };
 
-class LocalAsMetadata : public ValueAsMetadata {
+class LLVM_CLASS_ABI LocalAsMetadata : public ValueAsMetadata {
   friend class ValueAsMetadata;
 
   LocalAsMetadata(Value *Local)
@@ -509,7 +509,7 @@ namespace mdconst {
 namespace detail {
 
 template <class T> T &make();
-template <class T, class Result> struct HasDereference {
+template <class T, class Result> struct LLVM_CLASS_ABI HasDereference {
   using Yes = char[1];
   using No = char[2];
   template <size_t N> struct SFINAE {};
@@ -521,11 +521,11 @@ template <class T, class Result> struct HasDereference {
   static const bool value =
       sizeof(hasDereference<T, Result>(nullptr)) == sizeof(Yes);
 };
-template <class V, class M> struct IsValidPointer {
+template <class V, class M> struct LLVM_CLASS_ABI IsValidPointer {
   static const bool value = std::is_base_of<Constant, V>::value &&
                             HasDereference<M, const Metadata &>::value;
 };
-template <class V, class M> struct IsValidReference {
+template <class V, class M> struct LLVM_CLASS_ABI IsValidReference {
   static const bool value = std::is_base_of<Constant, V>::value &&
                             std::is_convertible<M, const Metadata &>::value;
 };
@@ -609,7 +609,7 @@ dyn_extract_or_null(Y &&MD) {
 ///
 /// These are used to efficiently contain a byte sequence for metadata.
 /// MDString is always unnamed.
-class MDString : public Metadata {
+class LLVM_CLASS_ABI MDString : public Metadata {
   friend class StringMapEntryStorage<MDString>;
 
   StringMapEntry<MDString> *Entry = nullptr;
@@ -649,7 +649,7 @@ class MDString : public Metadata {
 
 /// A collection of metadata nodes that might be associated with a
 /// memory access used by the alias-analysis infrastructure.
-struct AAMDNodes {
+struct LLVM_CLASS_ABI AAMDNodes {
   explicit AAMDNodes() = default;
   explicit AAMDNodes(MDNode *T, MDNode *TS, MDNode *S, MDNode *N)
       : TBAA(T), TBAAStruct(TS), Scope(S), NoAlias(N) {}
@@ -740,7 +740,7 @@ struct AAMDNodes {
 
 // Specialize DenseMapInfo for AAMDNodes.
 template<>
-struct DenseMapInfo<AAMDNodes> {
+struct LLVM_CLASS_ABI DenseMapInfo<AAMDNodes> {
   static inline AAMDNodes getEmptyKey() {
     return AAMDNodes(DenseMapInfo<MDNode *>::getEmptyKey(),
                      nullptr, nullptr, nullptr);
@@ -770,7 +770,7 @@ struct DenseMapInfo<AAMDNodes> {
 /// re-unique itself.
 ///
 /// In particular, this is used by \a MDNode.
-class MDOperand {
+class LLVM_CLASS_ABI MDOperand {
   Metadata *MD = nullptr;
 
 public:
@@ -831,13 +831,13 @@ class MDOperand {
   }
 };
 
-template <> struct simplify_type<MDOperand> {
+template <> struct LLVM_CLASS_ABI simplify_type<MDOperand> {
   using SimpleType = Metadata *;
 
   static SimpleType getSimplifiedValue(MDOperand &MD) { return MD.get(); }
 };
 
-template <> struct simplify_type<const MDOperand> {
+template <> struct LLVM_CLASS_ABI simplify_type<const MDOperand> {
   using SimpleType = Metadata *;
 
   static SimpleType getSimplifiedValue(const MDOperand &MD) { return MD.get(); }
@@ -847,7 +847,7 @@ template <> struct simplify_type<const MDOperand> {
 ///
 /// Either a raw (non-null) pointer to the \a LLVMContext, or an owned pointer
 /// to \a ReplaceableMetadataImpl (which has a reference to \a LLVMContext).
-class ContextAndReplaceableUses {
+class LLVM_CLASS_ABI ContextAndReplaceableUses {
   PointerUnion<LLVMContext *, ReplaceableMetadataImpl *> Ptr;
 
 public:
@@ -916,7 +916,7 @@ class ContextAndReplaceableUses {
   }
 };
 
-struct TempMDNodeDeleter {
+struct LLVM_CLASS_ABI TempMDNodeDeleter {
   inline void operator()(MDNode *Node) const;
 };
 
@@ -948,7 +948,7 @@ struct TempMDNodeDeleter {
 /// MDnodes are resizable, but only MDTuples support this capability.
 ///
 /// Clients can add operands to resizable MDNodes using push_back().
-class MDNode : public Metadata {
+class LLVM_CLASS_ABI MDNode : public Metadata {
   friend class ReplaceableMetadataImpl;
   friend class LLVMContextImpl;
   friend class DIArgList;
@@ -1343,7 +1343,7 @@ class MDNode : public Metadata {
 ///
 /// This is the simple \a MDNode arbitrary tuple.  Nodes are uniqued by
 /// default based on their operands.
-class MDTuple : public MDNode {
+class LLVM_CLASS_ABI MDTuple : public MDNode {
   friend class LLVMContextImpl;
   friend class MDNode;
 
@@ -1438,7 +1438,7 @@ void TempMDNodeDeleter::operator()(MDNode *Node) const {
 /// This is a simple wrapper around an MDNode which provides a higher-level
 /// interface by hiding the details of how alias analysis information is encoded
 /// in its operands.
-class AliasScopeNode {
+class LLVM_CLASS_ABI AliasScopeNode {
   const MDNode *Node = nullptr;
 
 public:
@@ -1466,7 +1466,7 @@ class AliasScopeNode {
 ///
 /// An iterator that transforms an \a MDNode::iterator into an iterator over a
 /// particular Metadata subclass.
-template <class T> class TypedMDOperandIterator {
+template <class T> class LLVM_CLASS_ABI TypedMDOperandIterator {
   MDNode::op_iterator I = nullptr;
 
 public:
@@ -1500,7 +1500,7 @@ template <class T> class TypedMDOperandIterator {
 ///
 /// This is a wrapper for \a MDTuple that makes it act like an array holding a
 /// particular type of metadata.
-template <class T> class MDTupleTypedArrayWrapper {
+template <class T> class LLVM_CLASS_ABI MDTupleTypedArrayWrapper {
   const MDTuple *N = nullptr;
 
 public:
@@ -1557,7 +1557,7 @@ template <class T> class MDTupleTypedArrayWrapper {
 /// While it would be possible to implement move operators, they would be
 /// fairly expensive.  Leave them unimplemented to discourage their use
 /// (clients can use std::deque, std::list, BumpPtrAllocator, etc.).
-class DistinctMDOperandPlaceholder : public Metadata {
+class LLVM_CLASS_ABI DistinctMDOperandPlaceholder : public Metadata {
   friend class MetadataTracking;
 
   Metadata **Use = nullptr;
@@ -1602,7 +1602,7 @@ class DistinctMDOperandPlaceholder : public Metadata {
 /// NamedMDNodes are named module-level entities that contain lists of MDNodes.
 ///
 /// It is illegal for a NamedMDNode to appear as an operand of an MDNode.
-class NamedMDNode : public ilist_node<NamedMDNode> {
+class LLVM_CLASS_ABI NamedMDNode : public ilist_node<NamedMDNode> {
   friend class LLVMContextImpl;
   friend class Module;
 
diff --git a/llvm/include/llvm/IR/Module.h b/llvm/include/llvm/IR/Module.h
index 9fa0fb34a8fcd6d..abf89ef4888ecb1 100644
--- a/llvm/include/llvm/IR/Module.h
+++ b/llvm/include/llvm/IR/Module.h
@@ -1025,7 +1025,7 @@ class LLVM_EXTERNAL_VISIBILITY Module {
 /// Given "llvm.used" or "llvm.compiler.used" as a global name, collect the
 /// initializer elements of that global in a SmallVector and return the global
 /// itself.
-GlobalVariable *collectUsedGlobalVariables(const Module &M,
+LLVM_FUNC_ABI GlobalVariable *collectUsedGlobalVariables(const Module &M,
                                            SmallVectorImpl<GlobalValue *> &Vec,
                                            bool CompilerUsed);
 
diff --git a/llvm/include/llvm/IR/ModuleSlotTracker.h b/llvm/include/llvm/IR/ModuleSlotTracker.h
index 9a56d485297b509..1aea78e2b60eec1 100644
--- a/llvm/include/llvm/IR/ModuleSlotTracker.h
+++ b/llvm/include/llvm/IR/ModuleSlotTracker.h
@@ -24,7 +24,7 @@ class Value;
 class MDNode;
 
 /// Abstract interface of slot tracker storage.
-class AbstractSlotTrackerStorage {
+class LLVM_CLASS_ABI AbstractSlotTrackerStorage {
 public:
   virtual ~AbstractSlotTrackerStorage();
 
@@ -42,7 +42,7 @@ class AbstractSlotTrackerStorage {
 ///
 /// If the IR changes from underneath \a ModuleSlotTracker, strings like
 /// "<badref>" will be printed, or, worse, the wrong slots entirely.
-class ModuleSlotTracker {
+class LLVM_CLASS_ABI ModuleSlotTracker {
   /// Storage for a slot tracker.
   std::unique_ptr<SlotTracker> MachineStorage;
   bool ShouldCreateStorage = false;
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index 3b8d4ee80fa6f2f..05f04acb86bdd6e 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -56,7 +56,7 @@ template <typename T> struct MappingTraits;
 } // end namespace yaml
 
 /// Class to accumulate and hold information about a callee.
-struct CalleeInfo {
+struct LLVM_CLASS_ABI CalleeInfo {
   enum class HotnessType : uint8_t {
     Unknown = 0,
     Cold = 1,
@@ -125,7 +125,7 @@ class GlobalValueSummary;
 
 using GlobalValueSummaryList = std::vector<std::unique_ptr<GlobalValueSummary>>;
 
-struct alignas(8) GlobalValueSummaryInfo {
+struct LLVM_CLASS_ABI alignas(8) GlobalValueSummaryInfo {
   union NameOrGV {
     NameOrGV(bool HaveGVs) {
       if (HaveGVs)
@@ -167,7 +167,7 @@ using GlobalValueSummaryMapTy =
 
 /// Struct that holds a reference to a particular GUID in a global value
 /// summary.
-struct ValueInfo {
+struct LLVM_CLASS_ABI ValueInfo {
   enum Flags { HaveGV = 1, ReadOnly = 2, WriteOnly = 4 };
   PointerIntPair<const GlobalValueSummaryMapTy::value_type *, 3, int>
       RefAndFlags;
@@ -265,7 +265,7 @@ inline bool operator<(const ValueInfo &A, const ValueInfo &B) {
   return A.getGUID() < B.getGUID();
 }
 
-template <> struct DenseMapInfo<ValueInfo> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<ValueInfo> {
   static inline ValueInfo getEmptyKey() {
     return ValueInfo(false, (GlobalValueSummaryMapTy::value_type *)-8);
   }
@@ -288,7 +288,7 @@ template <> struct DenseMapInfo<ValueInfo> {
 };
 
 /// Summary of memprof callsite metadata.
-struct CallsiteInfo {
+struct LLVM_CLASS_ABI CallsiteInfo {
   // Actual callee function.
   ValueInfo Callee;
 
@@ -351,7 +351,7 @@ enum class AllocationType : uint8_t {
 };
 
 /// Summary of a single MIB in a memprof metadata on allocations.
-struct MIBInfo {
+struct LLVM_CLASS_ABI MIBInfo {
   // The allocation type for this profiled context.
   AllocationType AllocType;
 
@@ -379,7 +379,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MIBInfo &MIB) {
 }
 
 /// Summary of memprof metadata on allocations.
-struct AllocInfo {
+struct LLVM_CLASS_ABI AllocInfo {
   // Used to record whole program analysis cloning decisions.
   // The ThinLTO backend will need to create as many clones as there are entries
   // in the vector (it is expected and should be confirmed that all such
@@ -418,7 +418,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const AllocInfo &AE) {
 
 /// Function and variable summary information to aid decisions and
 /// implementation of importing.
-class GlobalValueSummary {
+class LLVM_CLASS_ABI GlobalValueSummary {
 public:
   /// Sububclass discriminator (for dyn_cast<> et al.)
   enum SummaryKind : unsigned { AliasKind, FunctionKind, GlobalVarKind };
@@ -579,7 +579,7 @@ class GlobalValueSummary {
 GlobalValueSummaryInfo::GlobalValueSummaryInfo(bool HaveGVs) : U(HaveGVs) {}
 
 /// Alias summary information.
-class AliasSummary : public GlobalValueSummary {
+class LLVM_CLASS_ABI AliasSummary : public GlobalValueSummary {
   ValueInfo AliaseeValueInfo;
 
   /// This is the Aliasee in the same module as alias (could get from VI, trades
@@ -643,7 +643,7 @@ inline GlobalValueSummary *GlobalValueSummary::getBaseObject() {
 
 /// Function summary information to aid decisions and implementation of
 /// importing.
-class FunctionSummary : public GlobalValueSummary {
+class LLVM_CLASS_ABI FunctionSummary : public GlobalValueSummary {
 public:
   /// <CalleeValueInfo, CalleeInfo> call edge pair.
   using EdgeTy = std::pair<ValueInfo, CalleeInfo>;
@@ -1016,7 +1016,7 @@ class FunctionSummary : public GlobalValueSummary {
   friend struct GraphTraits<ValueInfo>;
 };
 
-template <> struct DenseMapInfo<FunctionSummary::VFuncId> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<FunctionSummary::VFuncId> {
   static FunctionSummary::VFuncId getEmptyKey() { return {0, uint64_t(-1)}; }
 
   static FunctionSummary::VFuncId getTombstoneKey() {
@@ -1030,7 +1030,7 @@ template <> struct DenseMapInfo<FunctionSummary::VFuncId> {
   static unsigned getHashValue(FunctionSummary::VFuncId I) { return I.GUID; }
 };
 
-template <> struct DenseMapInfo<FunctionSummary::ConstVCall> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<FunctionSummary::ConstVCall> {
   static FunctionSummary::ConstVCall getEmptyKey() {
     return {{0, uint64_t(-1)}, {}};
   }
@@ -1052,7 +1052,7 @@ template <> struct DenseMapInfo<FunctionSummary::ConstVCall> {
 
 /// The ValueInfo and offset for a function within a vtable definition
 /// initializer array.
-struct VirtFuncOffset {
+struct LLVM_CLASS_ABI VirtFuncOffset {
   VirtFuncOffset(ValueInfo VI, uint64_t Offset)
       : FuncVI(VI), VTableOffset(Offset) {}
 
@@ -1071,7 +1071,7 @@ using VTableFuncList = std::vector<VirtFuncOffset>;
 /// const-folded, while writeonly vars can be completely eliminated
 /// together with corresponding stores. We let both things happen
 /// by means of internalizing such variables after ThinLTO import.
-class GlobalVarSummary : public GlobalValueSummary {
+class LLVM_CLASS_ABI GlobalVarSummary : public GlobalValueSummary {
 private:
   /// For vtable definitions this holds the list of functions and
   /// their corresponding offsets within the initializer array.
@@ -1143,7 +1143,7 @@ class GlobalVarSummary : public GlobalValueSummary {
   }
 };
 
-struct TypeTestResolution {
+struct LLVM_CLASS_ABI TypeTestResolution {
   /// Specifies which kind of type check we should emit for this byte array.
   /// See http://clang.llvm.org/docs/ControlFlowIntegrityDesign.html for full
   /// details on each kind of check; the enumerators are described with
@@ -1174,7 +1174,7 @@ struct TypeTestResolution {
   uint64_t InlineBits = 0;
 };
 
-struct WholeProgramDevirtResolution {
+struct LLVM_CLASS_ABI WholeProgramDevirtResolution {
   enum Kind {
     Indir,        ///< Just do a regular virtual call
     SingleImpl,   ///< Single implementation devirtualization
@@ -1211,7 +1211,7 @@ struct WholeProgramDevirtResolution {
   std::map<std::vector<uint64_t>, ByArg> ResByArg;
 };
 
-struct TypeIdSummary {
+struct LLVM_CLASS_ABI TypeIdSummary {
   TypeTestResolution TTRes;
 
   /// Mapping from byte offset to whole-program devirt resolution for that
@@ -1250,7 +1250,7 @@ using TypeIdSummaryMapTy =
 /// Holds information about vtable definitions decorated with type metadata:
 /// the vtable definition value and its address point offset in a type
 /// identifier metadata it is decorated (compatible) with.
-struct TypeIdOffsetVtableInfo {
+struct LLVM_CLASS_ABI TypeIdOffsetVtableInfo {
   TypeIdOffsetVtableInfo(uint64_t Offset, ValueInfo VI)
       : AddressPointOffset(Offset), VTableVI(VI) {}
 
@@ -1265,7 +1265,7 @@ using TypeIdCompatibleVtableInfo = std::vector<TypeIdOffsetVtableInfo>;
 
 /// Class to hold module path string table and global value map,
 /// and encapsulate methods for operating on them.
-class ModuleSummaryIndex {
+class LLVM_CLASS_ABI ModuleSummaryIndex {
 private:
   /// Map from value name to list of summary instances for values of that
   /// name (may be duplicates in the COMDAT case, e.g.).
@@ -1843,7 +1843,7 @@ class ModuleSummaryIndex {
 };
 
 /// GraphTraits definition to build SCC for the index
-template <> struct GraphTraits<ValueInfo> {
+template <> struct LLVM_CLASS_ABI GraphTraits<ValueInfo> {
   typedef ValueInfo NodeRef;
   using EdgeRef = FunctionSummary::EdgeTy &;
 
@@ -1900,7 +1900,7 @@ template <> struct GraphTraits<ValueInfo> {
 };
 
 template <>
-struct GraphTraits<ModuleSummaryIndex *> : public GraphTraits<ValueInfo> {
+struct LLVM_CLASS_ABI GraphTraits<ModuleSummaryIndex *> : public GraphTraits<ValueInfo> {
   static NodeRef getEntryNode(ModuleSummaryIndex *I) {
     std::unique_ptr<GlobalValueSummary> Root =
         std::make_unique<FunctionSummary>(I->calculateCallGraphRoot());
diff --git a/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h b/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
index 0e23edbbc4608ad..cc41e7dd4380fc1 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
@@ -16,7 +16,7 @@
 namespace llvm {
 namespace yaml {
 
-template <> struct ScalarEnumerationTraits<TypeTestResolution::Kind> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<TypeTestResolution::Kind> {
   static void enumeration(IO &io, TypeTestResolution::Kind &value) {
     io.enumCase(value, "Unknown", TypeTestResolution::Unknown);
     io.enumCase(value, "Unsat", TypeTestResolution::Unsat);
@@ -27,7 +27,7 @@ template <> struct ScalarEnumerationTraits<TypeTestResolution::Kind> {
   }
 };
 
-template <> struct MappingTraits<TypeTestResolution> {
+template <> struct LLVM_CLASS_ABI MappingTraits<TypeTestResolution> {
   static void mapping(IO &io, TypeTestResolution &res) {
     io.mapOptional("Kind", res.TheKind);
     io.mapOptional("SizeM1BitWidth", res.SizeM1BitWidth);
@@ -39,7 +39,7 @@ template <> struct MappingTraits<TypeTestResolution> {
 };
 
 template <>
-struct ScalarEnumerationTraits<WholeProgramDevirtResolution::ByArg::Kind> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<WholeProgramDevirtResolution::ByArg::Kind> {
   static void enumeration(IO &io,
                           WholeProgramDevirtResolution::ByArg::Kind &value) {
     io.enumCase(value, "Indir", WholeProgramDevirtResolution::ByArg::Indir);
@@ -52,7 +52,7 @@ struct ScalarEnumerationTraits<WholeProgramDevirtResolution::ByArg::Kind> {
   }
 };
 
-template <> struct MappingTraits<WholeProgramDevirtResolution::ByArg> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WholeProgramDevirtResolution::ByArg> {
   static void mapping(IO &io, WholeProgramDevirtResolution::ByArg &res) {
     io.mapOptional("Kind", res.TheKind);
     io.mapOptional("Info", res.Info);
@@ -62,7 +62,7 @@ template <> struct MappingTraits<WholeProgramDevirtResolution::ByArg> {
 };
 
 template <>
-struct CustomMappingTraits<
+struct LLVM_CLASS_ABI CustomMappingTraits<
     std::map<std::vector<uint64_t>, WholeProgramDevirtResolution::ByArg>> {
   static void inputOne(
       IO &io, StringRef Key,
@@ -95,7 +95,7 @@ struct CustomMappingTraits<
   }
 };
 
-template <> struct ScalarEnumerationTraits<WholeProgramDevirtResolution::Kind> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WholeProgramDevirtResolution::Kind> {
   static void enumeration(IO &io, WholeProgramDevirtResolution::Kind &value) {
     io.enumCase(value, "Indir", WholeProgramDevirtResolution::Indir);
     io.enumCase(value, "SingleImpl", WholeProgramDevirtResolution::SingleImpl);
@@ -104,7 +104,7 @@ template <> struct ScalarEnumerationTraits<WholeProgramDevirtResolution::Kind> {
   }
 };
 
-template <> struct MappingTraits<WholeProgramDevirtResolution> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WholeProgramDevirtResolution> {
   static void mapping(IO &io, WholeProgramDevirtResolution &res) {
     io.mapOptional("Kind", res.TheKind);
     io.mapOptional("SingleImplName", res.SingleImplName);
@@ -113,7 +113,7 @@ template <> struct MappingTraits<WholeProgramDevirtResolution> {
 };
 
 template <>
-struct CustomMappingTraits<std::map<uint64_t, WholeProgramDevirtResolution>> {
+struct LLVM_CLASS_ABI CustomMappingTraits<std::map<uint64_t, WholeProgramDevirtResolution>> {
   static void inputOne(IO &io, StringRef Key,
                        std::map<uint64_t, WholeProgramDevirtResolution> &V) {
     uint64_t KeyInt;
@@ -129,14 +129,14 @@ struct CustomMappingTraits<std::map<uint64_t, WholeProgramDevirtResolution>> {
   }
 };
 
-template <> struct MappingTraits<TypeIdSummary> {
+template <> struct LLVM_CLASS_ABI MappingTraits<TypeIdSummary> {
   static void mapping(IO &io, TypeIdSummary& summary) {
     io.mapOptional("TTRes", summary.TTRes);
     io.mapOptional("WPDRes", summary.WPDRes);
   }
 };
 
-struct FunctionSummaryYaml {
+struct LLVM_CLASS_ABI FunctionSummaryYaml {
   unsigned Linkage, Visibility;
   bool NotEligibleToImport, Live, IsLocal, CanAutoHide;
   std::vector<uint64_t> Refs;
@@ -153,14 +153,14 @@ struct FunctionSummaryYaml {
 namespace llvm {
 namespace yaml {
 
-template <> struct MappingTraits<FunctionSummary::VFuncId> {
+template <> struct LLVM_CLASS_ABI MappingTraits<FunctionSummary::VFuncId> {
   static void mapping(IO &io, FunctionSummary::VFuncId& id) {
     io.mapOptional("GUID", id.GUID);
     io.mapOptional("Offset", id.Offset);
   }
 };
 
-template <> struct MappingTraits<FunctionSummary::ConstVCall> {
+template <> struct LLVM_CLASS_ABI MappingTraits<FunctionSummary::ConstVCall> {
   static void mapping(IO &io, FunctionSummary::ConstVCall& id) {
     io.mapOptional("VFunc", id.VFunc);
     io.mapOptional("Args", id.Args);
@@ -176,7 +176,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionSummary::ConstVCall)
 namespace llvm {
 namespace yaml {
 
-template <> struct MappingTraits<FunctionSummaryYaml> {
+template <> struct LLVM_CLASS_ABI MappingTraits<FunctionSummaryYaml> {
   static void mapping(IO &io, FunctionSummaryYaml& summary) {
     io.mapOptional("Linkage", summary.Linkage);
     io.mapOptional("Visibility", summary.Visibility);
@@ -204,7 +204,7 @@ namespace llvm {
 namespace yaml {
 
 // FIXME: Add YAML mappings for the rest of the module summary.
-template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {
+template <> struct LLVM_CLASS_ABI CustomMappingTraits<GlobalValueSummaryMapTy> {
   static void inputOne(IO &io, StringRef Key, GlobalValueSummaryMapTy &V) {
     std::vector<FunctionSummaryYaml> FSums;
     io.mapRequired(Key.str().c_str(), FSums);
@@ -265,7 +265,7 @@ template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {
   }
 };
 
-template <> struct CustomMappingTraits<TypeIdSummaryMapTy> {
+template <> struct LLVM_CLASS_ABI CustomMappingTraits<TypeIdSummaryMapTy> {
   static void inputOne(IO &io, StringRef Key, TypeIdSummaryMapTy &V) {
     TypeIdSummary TId;
     io.mapRequired(Key.str().c_str(), TId);
@@ -277,7 +277,7 @@ template <> struct CustomMappingTraits<TypeIdSummaryMapTy> {
   }
 };
 
-template <> struct MappingTraits<ModuleSummaryIndex> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ModuleSummaryIndex> {
   static void mapping(IO &io, ModuleSummaryIndex& index) {
     io.mapOptional("GlobalValueMap", index.GlobalValueMap);
     io.mapOptional("TypeIdMap", index.TypeIdMap);
diff --git a/llvm/include/llvm/IR/NoFolder.h b/llvm/include/llvm/IR/NoFolder.h
index 9aecedce8f34758..d87be6d15cc2dc5 100644
--- a/llvm/include/llvm/IR/NoFolder.h
+++ b/llvm/include/llvm/IR/NoFolder.h
@@ -33,7 +33,7 @@
 namespace llvm {
 
 /// NoFolder - Create "constants" (actually, instructions) with no folding.
-class NoFolder final : public IRBuilderFolder {
+class LLVM_CLASS_ABI NoFolder final : public IRBuilderFolder {
   virtual void anchor();
 
 public:
diff --git a/llvm/include/llvm/IR/OperandTraits.h b/llvm/include/llvm/IR/OperandTraits.h
index 5998a545715e246..822fcdb39077761 100644
--- a/llvm/include/llvm/IR/OperandTraits.h
+++ b/llvm/include/llvm/IR/OperandTraits.h
@@ -28,7 +28,7 @@ namespace llvm {
 /// known at compile time.
 
 template <typename SubClass, unsigned ARITY>
-struct FixedNumOperandTraits {
+struct LLVM_CLASS_ABI FixedNumOperandTraits {
   static Use *op_begin(SubClass* U) {
     static_assert(
         !std::is_polymorphic<SubClass>::value,
@@ -51,7 +51,7 @@ struct FixedNumOperandTraits {
 /// Naturally it may only decrease, because the allocations may not change.
 
 template <typename SubClass, unsigned ARITY = 1>
-struct OptionalOperandTraits : public FixedNumOperandTraits<SubClass, ARITY> {
+struct LLVM_CLASS_ABI OptionalOperandTraits : public FixedNumOperandTraits<SubClass, ARITY> {
   static unsigned operands(const User *U) {
     return U->getNumOperands();
   }
@@ -66,7 +66,7 @@ struct OptionalOperandTraits : public FixedNumOperandTraits<SubClass, ARITY> {
 /// only known at allocation time.
 
 template <typename SubClass, unsigned MINARITY = 0>
-struct VariadicOperandTraits {
+struct LLVM_CLASS_ABI VariadicOperandTraits {
   static Use *op_begin(SubClass* U) {
     static_assert(
         !std::is_polymorphic<SubClass>::value,
@@ -93,7 +93,7 @@ struct VariadicOperandTraits {
 /// resizable.
 
 template <unsigned MINARITY = 1>
-struct HungoffOperandTraits {
+struct LLVM_CLASS_ABI HungoffOperandTraits {
   static Use *op_begin(User* U) {
     return U->getOperandList();
   }
diff --git a/llvm/include/llvm/IR/Operator.h b/llvm/include/llvm/IR/Operator.h
index a14c5110d2bdc1c..a69c3748739a87a 100644
--- a/llvm/include/llvm/IR/Operator.h
+++ b/llvm/include/llvm/IR/Operator.h
@@ -29,7 +29,7 @@ namespace llvm {
 
 /// This is a utility class that provides an abstraction for the common
 /// functionality between Instructions and ConstantExprs.
-class Operator : public User {
+class LLVM_CLASS_ABI Operator : public User {
 public:
   // The Operator class is intended to be used as a utility, and is never itself
   // instantiated.
@@ -73,7 +73,7 @@ class Operator : public User {
 /// Utility class for integer operators which may exhibit overflow - Add, Sub,
 /// Mul, and Shl. It does not include SDiv, despite that operator having the
 /// potential for overflow.
-class OverflowingBinaryOperator : public Operator {
+class LLVM_CLASS_ABI OverflowingBinaryOperator : public Operator {
 public:
   enum {
     AnyWrap        = 0,
@@ -127,7 +127,7 @@ class OverflowingBinaryOperator : public Operator {
 
 /// A udiv or sdiv instruction, which can be marked as "exact",
 /// indicating that no bits are destroyed.
-class PossiblyExactOperator : public Operator {
+class LLVM_CLASS_ABI PossiblyExactOperator : public Operator {
 public:
   enum {
     IsExact = (1 << 0)
@@ -168,7 +168,7 @@ class PossiblyExactOperator : public Operator {
 
 /// Utility class for floating point operations which can have
 /// information about relaxed accuracy requirements attached to them.
-class FPMathOperator : public Operator {
+class LLVM_CLASS_ABI FPMathOperator : public Operator {
 private:
   friend class Instruction;
 
@@ -334,7 +334,7 @@ class FPMathOperator : public Operator {
 
 /// A helper template for defining operators for individual opcodes.
 template<typename SuperClass, unsigned Opc>
-class ConcreteOperator : public SuperClass {
+class LLVM_CLASS_ABI ConcreteOperator : public SuperClass {
 public:
   static bool classof(const Instruction *I) {
     return I->getOpcode() == Opc;
@@ -348,35 +348,35 @@ class ConcreteOperator : public SuperClass {
   }
 };
 
-class AddOperator
+class LLVM_CLASS_ABI AddOperator
   : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
 };
-class SubOperator
+class LLVM_CLASS_ABI SubOperator
   : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
 };
-class MulOperator
+class LLVM_CLASS_ABI MulOperator
   : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
 };
-class ShlOperator
+class LLVM_CLASS_ABI ShlOperator
   : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
 };
 
-class SDivOperator
+class LLVM_CLASS_ABI SDivOperator
   : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
 };
-class UDivOperator
+class LLVM_CLASS_ABI UDivOperator
   : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
 };
-class AShrOperator
+class LLVM_CLASS_ABI AShrOperator
   : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
 };
-class LShrOperator
+class LLVM_CLASS_ABI LShrOperator
   : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
 };
 
-class ZExtOperator : public ConcreteOperator<Operator, Instruction::ZExt> {};
+class LLVM_CLASS_ABI ZExtOperator : public ConcreteOperator<Operator, Instruction::ZExt> {};
 
-class GEPOperator
+class LLVM_CLASS_ABI GEPOperator
   : public ConcreteOperator<Operator, Instruction::GetElementPtr> {
   friend class GetElementPtrInst;
   friend class ConstantExpr;
@@ -515,7 +515,7 @@ class GEPOperator
                      APInt &ConstantOffset) const;
 };
 
-class PtrToIntOperator
+class LLVM_CLASS_ABI PtrToIntOperator
     : public ConcreteOperator<Operator, Instruction::PtrToInt> {
   friend class PtrToInt;
   friend class ConstantExpr;
@@ -543,7 +543,7 @@ class PtrToIntOperator
   }
 };
 
-class BitCastOperator
+class LLVM_CLASS_ABI BitCastOperator
     : public ConcreteOperator<Operator, Instruction::BitCast> {
   friend class BitCastInst;
   friend class ConstantExpr;
@@ -558,7 +558,7 @@ class BitCastOperator
   }
 };
 
-class AddrSpaceCastOperator
+class LLVM_CLASS_ABI AddrSpaceCastOperator
     : public ConcreteOperator<Operator, Instruction::AddrSpaceCast> {
   friend class AddrSpaceCastInst;
   friend class ConstantExpr;
diff --git a/llvm/include/llvm/IR/OptBisect.h b/llvm/include/llvm/IR/OptBisect.h
index cbd66844aac09c4..8631f7374c2f342 100644
--- a/llvm/include/llvm/IR/OptBisect.h
+++ b/llvm/include/llvm/IR/OptBisect.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 /// Extensions to this class implement mechanisms to disable passes and
 /// individual optimizations at compile time.
-class OptPassGate {
+class LLVM_CLASS_ABI OptPassGate {
 public:
   virtual ~OptPassGate() = default;
 
@@ -41,7 +41,7 @@ class OptPassGate {
 /// optimizations at compile time based on a command line option
 /// (-opt-bisect-limit) in order to perform a bisecting search for
 /// optimization-related problems.
-class OptBisect : public OptPassGate {
+class LLVM_CLASS_ABI OptBisect : public OptPassGate {
 public:
   /// Default constructor. Initializes the state to "disabled". The bisection
   /// will be enabled by the cl::opt call-back when the command line option
@@ -90,7 +90,7 @@ class OptBisect : public OptPassGate {
 
 /// Singleton instance of the OptBisect class, so multiple pass managers don't
 /// need to coordinate their uses of OptBisect.
-OptPassGate &getGlobalPassGate();
+LLVM_FUNC_ABI OptPassGate &getGlobalPassGate();
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/IR/PassInstrumentation.h b/llvm/include/llvm/IR/PassInstrumentation.h
index 3337dcb9cff07f4..6f6e636033699a1 100644
--- a/llvm/include/llvm/IR/PassInstrumentation.h
+++ b/llvm/include/llvm/IR/PassInstrumentation.h
@@ -64,7 +64,7 @@ class StringRef;
 
 /// This class manages callbacks registration, as well as provides a way for
 /// PassInstrumentation to pass control to the registered callbacks.
-class PassInstrumentationCallbacks {
+class LLVM_CLASS_ABI PassInstrumentationCallbacks {
 public:
   // Before/After callbacks accept IRUnits whenever appropriate, so they need
   // to take them as constant pointers, wrapped with llvm::Any.
@@ -190,7 +190,7 @@ class PassInstrumentationCallbacks {
 
 /// This class provides instrumentation entry points for the Pass Manager,
 /// doing calls to callbacks registered in PassInstrumentationCallbacks.
-class PassInstrumentation {
+class LLVM_CLASS_ABI PassInstrumentation {
   PassInstrumentationCallbacks *Callbacks;
 
   // Template argument PassT of PassInstrumentation::runBeforePass could be two
@@ -328,7 +328,7 @@ class PassInstrumentation {
   }
 };
 
-bool isSpecialPass(StringRef PassID, const std::vector<StringRef> &Specials);
+LLVM_FUNC_ABI bool isSpecialPass(StringRef PassID, const std::vector<StringRef> &Specials);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h
index 11af6b9ff3069b5..d01a486b2cea82e 100644
--- a/llvm/include/llvm/IR/PassManager.h
+++ b/llvm/include/llvm/IR/PassManager.h
@@ -67,7 +67,7 @@ namespace llvm {
 /// Analysis passes should have a static data member of this type and derive
 /// from the \c AnalysisInfoMixin to get a static ID method used to identify
 /// the analysis in the pass management infrastructure.
-struct alignas(8) AnalysisKey {};
+struct LLVM_CLASS_ABI alignas(8) AnalysisKey {};
 
 /// A special type used to provide an address that identifies a set of related
 /// analyses.  These sets are primarily used below to mark sets of analyses as
@@ -77,7 +77,7 @@ struct alignas(8) AnalysisKey {};
 /// function by preserving the appropriate AnalysisSetKey.  An analysis that
 /// depends only on the CFG can then check if that AnalysisSetKey is preserved;
 /// if it is, the analysis knows that it itself is preserved.
-struct alignas(8) AnalysisSetKey {};
+struct LLVM_CLASS_ABI alignas(8) AnalysisSetKey {};
 
 /// This templated class represents "all analyses that operate over \<a
 /// particular IR unit\>" (e.g. a Function or a Module) in instances of
@@ -88,7 +88,7 @@ struct alignas(8) AnalysisSetKey {};
 /// Note that you must provide an explicit instantiation declaration and
 /// definition for this template in order to get the correct behavior on
 /// Windows. Otherwise, the address of SetKey will not be stable.
-template <typename IRUnitT> class AllAnalysesOn {
+template <typename IRUnitT> class LLVM_CLASS_ABI AllAnalysesOn {
 public:
   static AnalysisSetKey *ID() { return &SetKey; }
 
@@ -111,7 +111,7 @@ extern template class AllAnalysesOn<Function>;
 /// mutate the CFG. Mutating the condition of a branch or argument of an
 /// invoked function does not mutate the CFG, but changing the successor labels
 /// of those instructions does.
-class CFGAnalyses {
+class LLVM_CLASS_ABI CFGAnalyses {
 public:
   static AnalysisSetKey *ID() { return &SetKey; }
 
@@ -150,7 +150,7 @@ class CFGAnalyses {
 ///     // The analysis has been successfully preserved ...
 ///   }
 /// ```
-class PreservedAnalyses {
+class LLVM_CLASS_ABI PreservedAnalyses {
 public:
   /// Convenience factory function for the empty preserved set.
   static PreservedAnalyses none() { return PreservedAnalyses(); }
@@ -369,7 +369,7 @@ template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager;
 /// passes.
 ///
 /// This provides some boilerplate for types that are passes.
-template <typename DerivedT> struct PassInfoMixin {
+template <typename DerivedT> struct LLVM_CLASS_ABI PassInfoMixin {
   /// Gets the name of the pass we are mixed into.
   static StringRef name() {
     static_assert(std::is_base_of<PassInfoMixin, DerivedT>::value,
@@ -392,7 +392,7 @@ template <typename DerivedT> struct PassInfoMixin {
 /// This provides some boilerplate for types that are analysis passes. It
 /// automatically mixes in \c PassInfoMixin.
 template <typename DerivedT>
-struct AnalysisInfoMixin : PassInfoMixin<DerivedT> {
+struct LLVM_CLASS_ABI AnalysisInfoMixin : PassInfoMixin<DerivedT> {
   /// Returns an opaque, unique ID for this analysis type.
   ///
   /// This ID is a pointer type that is guaranteed to be 8-byte aligned and thus
@@ -467,7 +467,7 @@ class PassInstrumentationAnalysis;
 template <typename IRUnitT,
           typename AnalysisManagerT = AnalysisManager<IRUnitT>,
           typename... ExtraArgTs>
-class PassManager : public PassInfoMixin<
+class LLVM_CLASS_ABI PassManager : public PassInfoMixin<
                         PassManager<IRUnitT, AnalysisManagerT, ExtraArgTs...>> {
 public:
   /// Construct a pass manager.
@@ -592,7 +592,7 @@ using FunctionPassManager = PassManager<Function>;
 /// internals (e.g PassInstrumentationAnalysis::ID) for use there if needed.
 /// FIXME: figure out a way to move PassInstrumentationAnalysis into its own
 /// header.
-class PassInstrumentationAnalysis
+class LLVM_CLASS_ABI PassInstrumentationAnalysis
     : public AnalysisInfoMixin<PassInstrumentationAnalysis> {
   friend AnalysisInfoMixin<PassInstrumentationAnalysis>;
   static AnalysisKey Key;
@@ -618,7 +618,7 @@ class PassInstrumentationAnalysis
 ///
 /// This class can manage analyses for any IR unit where the address of the IR
 /// unit sufficies as its identity.
-template <typename IRUnitT, typename... ExtraArgTs> class AnalysisManager {
+template <typename IRUnitT, typename... ExtraArgTs> class LLVM_CLASS_ABI AnalysisManager {
 public:
   class Invalidator;
 
@@ -929,7 +929,7 @@ using FunctionAnalysisManager = AnalysisManager<Function>;
 /// Note that the proxy's result is a move-only RAII object.  The validity of
 /// the analyses in the inner analysis manager is tied to its lifetime.
 template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs>
-class InnerAnalysisManagerProxy
+class LLVM_CLASS_ABI InnerAnalysisManagerProxy
     : public AnalysisInfoMixin<
           InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT>> {
 public:
@@ -1054,7 +1054,7 @@ extern template class InnerAnalysisManagerProxy<FunctionAnalysisManager,
 /// this is the outer analyses may be stale.  We invalidate the outer analyses
 /// only when we're done running passes over the inner IR units.
 template <typename AnalysisManagerT, typename IRUnitT, typename... ExtraArgTs>
-class OuterAnalysisManagerProxy
+class LLVM_CLASS_ABI OuterAnalysisManagerProxy
     : public AnalysisInfoMixin<
           OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>> {
 public:
@@ -1191,7 +1191,7 @@ using ModuleAnalysisManagerFunctionProxy =
 /// Note that although function passes can access module analyses, module
 /// analyses are not invalidated while the function passes are running, so they
 /// may be stale.  Function analyses will not be stale.
-class ModuleToFunctionPassAdaptor
+class LLVM_CLASS_ABI ModuleToFunctionPassAdaptor
     : public PassInfoMixin<ModuleToFunctionPassAdaptor> {
 public:
   using PassConceptT = detail::PassConcept<Function, FunctionAnalysisManager>;
@@ -1241,7 +1241,7 @@ createModuleToFunctionPassAdaptor(FunctionPassT &&Pass,
 template <typename AnalysisT, typename IRUnitT,
           typename AnalysisManagerT = AnalysisManager<IRUnitT>,
           typename... ExtraArgTs>
-struct RequireAnalysisPass
+struct LLVM_CLASS_ABI RequireAnalysisPass
     : PassInfoMixin<RequireAnalysisPass<AnalysisT, IRUnitT, AnalysisManagerT,
                                         ExtraArgTs...>> {
   /// Run this pass over some unit of IR.
@@ -1269,7 +1269,7 @@ struct RequireAnalysisPass
 /// A no-op pass template which simply forces a specific analysis result
 /// to be invalidated.
 template <typename AnalysisT>
-struct InvalidateAnalysisPass
+struct LLVM_CLASS_ABI InvalidateAnalysisPass
     : PassInfoMixin<InvalidateAnalysisPass<AnalysisT>> {
   /// Run this pass over some unit of IR.
   ///
@@ -1295,7 +1295,7 @@ struct InvalidateAnalysisPass
 ///
 /// Because this preserves no analyses, any analysis passes queried after this
 /// pass runs will recompute fresh results.
-struct InvalidateAllAnalysesPass : PassInfoMixin<InvalidateAllAnalysesPass> {
+struct LLVM_CLASS_ABI InvalidateAllAnalysesPass : PassInfoMixin<InvalidateAllAnalysesPass> {
   /// Run this pass over some unit of IR.
   template <typename IRUnitT, typename AnalysisManagerT, typename... ExtraArgTs>
   PreservedAnalyses run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...) {
@@ -1308,7 +1308,7 @@ struct InvalidateAllAnalysesPass : PassInfoMixin<InvalidateAllAnalysesPass> {
 /// This can be useful when debugging or testing passes. It also serves as an
 /// example of how to extend the pass manager in ways beyond composition.
 template <typename PassT>
-class RepeatedPass : public PassInfoMixin<RepeatedPass<PassT>> {
+class LLVM_CLASS_ABI RepeatedPass : public PassInfoMixin<RepeatedPass<PassT>> {
 public:
   RepeatedPass(int Count, PassT &&P)
       : Count(Count), P(std::forward<PassT>(P)) {}
diff --git a/llvm/include/llvm/IR/PassManagerInternal.h b/llvm/include/llvm/IR/PassManagerInternal.h
index 204dd03d3a18a4f..5a40858a5cff792 100644
--- a/llvm/include/llvm/IR/PassManagerInternal.h
+++ b/llvm/include/llvm/IR/PassManagerInternal.h
@@ -36,7 +36,7 @@ namespace detail {
 /// Template for the abstract base class used to dispatch
 /// polymorphically over pass objects.
 template <typename IRUnitT, typename AnalysisManagerT, typename... ExtraArgTs>
-struct PassConcept {
+struct LLVM_CLASS_ABI PassConcept {
   // Boiler plate necessary for the container of derived classes.
   virtual ~PassConcept() = default;
 
@@ -68,7 +68,7 @@ struct PassConcept {
 /// be a copyable object.
 template <typename IRUnitT, typename PassT, typename PreservedAnalysesT,
           typename AnalysisManagerT, typename... ExtraArgTs>
-struct PassModel : PassConcept<IRUnitT, AnalysisManagerT, ExtraArgTs...> {
+struct LLVM_CLASS_ABI PassModel : PassConcept<IRUnitT, AnalysisManagerT, ExtraArgTs...> {
   explicit PassModel(PassT Pass) : Pass(std::move(Pass)) {}
   // We have to explicitly define all the special member functions because MSVC
   // refuses to generate them.
@@ -122,7 +122,7 @@ struct PassModel : PassConcept<IRUnitT, AnalysisManagerT, ExtraArgTs...> {
 /// This concept is parameterized over the IR unit that this result pertains
 /// to.
 template <typename IRUnitT, typename PreservedAnalysesT, typename InvalidatorT>
-struct AnalysisResultConcept {
+struct LLVM_CLASS_ABI AnalysisResultConcept {
   virtual ~AnalysisResultConcept() = default;
 
   /// Method to try and mark a result as invalid.
@@ -146,7 +146,7 @@ struct AnalysisResultConcept {
 
 /// SFINAE metafunction for computing whether \c ResultT provides an
 /// \c invalidate member function.
-template <typename IRUnitT, typename ResultT> class ResultHasInvalidateMethod {
+template <typename IRUnitT, typename ResultT> class LLVM_CLASS_ABI ResultHasInvalidateMethod {
   using EnabledType = char;
   struct DisabledType {
     char a, b;
@@ -196,7 +196,7 @@ struct AnalysisResultModel;
 /// invalidate functionality.
 template <typename IRUnitT, typename PassT, typename ResultT,
           typename PreservedAnalysesT, typename InvalidatorT>
-struct AnalysisResultModel<IRUnitT, PassT, ResultT, PreservedAnalysesT,
+struct LLVM_CLASS_ABI AnalysisResultModel<IRUnitT, PassT, ResultT, PreservedAnalysesT,
                            InvalidatorT, false>
     : AnalysisResultConcept<IRUnitT, PreservedAnalysesT, InvalidatorT> {
   explicit AnalysisResultModel(ResultT Result) : Result(std::move(Result)) {}
@@ -235,7 +235,7 @@ struct AnalysisResultModel<IRUnitT, PassT, ResultT, PreservedAnalysesT,
 /// handling to \c ResultT.
 template <typename IRUnitT, typename PassT, typename ResultT,
           typename PreservedAnalysesT, typename InvalidatorT>
-struct AnalysisResultModel<IRUnitT, PassT, ResultT, PreservedAnalysesT,
+struct LLVM_CLASS_ABI AnalysisResultModel<IRUnitT, PassT, ResultT, PreservedAnalysesT,
                            InvalidatorT, true>
     : AnalysisResultConcept<IRUnitT, PreservedAnalysesT, InvalidatorT> {
   explicit AnalysisResultModel(ResultT Result) : Result(std::move(Result)) {}
@@ -270,7 +270,7 @@ struct AnalysisResultModel<IRUnitT, PassT, ResultT, PreservedAnalysesT,
 /// produce an analysis result.
 template <typename IRUnitT, typename PreservedAnalysesT, typename InvalidatorT,
           typename... ExtraArgTs>
-struct AnalysisPassConcept {
+struct LLVM_CLASS_ABI AnalysisPassConcept {
   virtual ~AnalysisPassConcept() = default;
 
   /// Method to run this analysis over a unit of IR.
@@ -292,7 +292,7 @@ struct AnalysisPassConcept {
 /// and produce an object which can be wrapped in a \c AnalysisResultModel.
 template <typename IRUnitT, typename PassT, typename PreservedAnalysesT,
           typename InvalidatorT, typename... ExtraArgTs>
-struct AnalysisPassModel : AnalysisPassConcept<IRUnitT, PreservedAnalysesT,
+struct LLVM_CLASS_ABI AnalysisPassModel : AnalysisPassConcept<IRUnitT, PreservedAnalysesT,
                                                InvalidatorT, ExtraArgTs...> {
   explicit AnalysisPassModel(PassT Pass) : Pass(std::move(Pass)) {}
   // We have to explicitly define all the special member functions because MSVC
diff --git a/llvm/include/llvm/IR/PassTimingInfo.h b/llvm/include/llvm/IR/PassTimingInfo.h
index 0b0bd247410375d..8da06e5aa0fd821 100644
--- a/llvm/include/llvm/IR/PassTimingInfo.h
+++ b/llvm/include/llvm/IR/PassTimingInfo.h
@@ -32,17 +32,17 @@ class raw_ostream;
 /// If -time-passes has been specified, report the timings immediately and then
 /// reset the timers to zero. By default it uses the stream created by
 /// CreateInfoOutputFile().
-void reportAndResetTimings(raw_ostream *OutStream = nullptr);
+LLVM_FUNC_ABI void reportAndResetTimings(raw_ostream *OutStream = nullptr);
 
 /// Request the timer for this legacy-pass-manager's pass instance.
-Timer *getPassTimer(Pass *);
+LLVM_FUNC_ABI Timer *getPassTimer(Pass *);
 
 /// This class implements -time-passes functionality for new pass manager.
 /// It provides the pass-instrumentation callbacks that measure the pass
 /// execution time. They collect timing info into individual timers as
 /// passes are being run. At the end of its life-time it prints the resulting
 /// timing report.
-class TimePassesHandler {
+class LLVM_CLASS_ABI TimePassesHandler {
   /// Value of this type is capable of uniquely identifying pass invocations.
   /// It is a pair of string Pass-Identifier (which for now is common
   /// to all the instance of a given pass) + sequential invocation counter.
diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
index e6d23dfaaeaf1ba..c2a5e685f6a4f51 100644
--- a/llvm/include/llvm/IR/PatternMatch.h
+++ b/llvm/include/llvm/IR/PatternMatch.h
@@ -55,7 +55,7 @@ template <typename Pattern> bool match(ArrayRef<int> Mask, const Pattern &P) {
   return const_cast<Pattern &>(P).match(Mask);
 }
 
-template <typename SubPattern_t> struct OneUse_match {
+template <typename SubPattern_t> struct LLVM_CLASS_ABI OneUse_match {
   SubPattern_t SubPattern;
 
   OneUse_match(const SubPattern_t &SP) : SubPattern(SP) {}
@@ -69,7 +69,7 @@ template <typename T> inline OneUse_match<T> m_OneUse(const T &SubPattern) {
   return SubPattern;
 }
 
-template <typename Class> struct class_match {
+template <typename Class> struct LLVM_CLASS_ABI class_match {
   template <typename ITy> bool match(ITy *V) { return isa<Class>(V); }
 };
 
@@ -89,7 +89,7 @@ inline class_match<BinaryOperator> m_BinOp() {
 /// Matches any compare instruction and ignore it.
 inline class_match<CmpInst> m_Cmp() { return class_match<CmpInst>(); }
 
-struct undef_match {
+struct LLVM_CLASS_ABI undef_match {
   static bool check(const Value *V) {
     if (isa<UndefValue>(V))
       return true;
@@ -154,7 +154,7 @@ inline class_match<ConstantFP> m_ConstantFP() {
   return class_match<ConstantFP>();
 }
 
-struct constantexpr_match {
+struct LLVM_CLASS_ABI constantexpr_match {
   template <typename ITy> bool match(ITy *V) {
     auto *C = dyn_cast<Constant>(V);
     return C && (isa<ConstantExpr>(C) || C->containsConstantExpression());
@@ -171,7 +171,7 @@ inline class_match<BasicBlock> m_BasicBlock() {
 }
 
 /// Inverting matcher
-template <typename Ty> struct match_unless {
+template <typename Ty> struct LLVM_CLASS_ABI match_unless {
   Ty M;
 
   match_unless(const Ty &Matcher) : M(Matcher) {}
@@ -185,7 +185,7 @@ template <typename Ty> inline match_unless<Ty> m_Unless(const Ty &M) {
 }
 
 /// Matching combinators
-template <typename LTy, typename RTy> struct match_combine_or {
+template <typename LTy, typename RTy> struct LLVM_CLASS_ABI match_combine_or {
   LTy L;
   RTy R;
 
@@ -200,7 +200,7 @@ template <typename LTy, typename RTy> struct match_combine_or {
   }
 };
 
-template <typename LTy, typename RTy> struct match_combine_and {
+template <typename LTy, typename RTy> struct LLVM_CLASS_ABI match_combine_and {
   LTy L;
   RTy R;
 
@@ -226,7 +226,7 @@ inline match_combine_and<LTy, RTy> m_CombineAnd(const LTy &L, const RTy &R) {
   return match_combine_and<LTy, RTy>(L, R);
 }
 
-struct apint_match {
+struct LLVM_CLASS_ABI apint_match {
   const APInt *&Res;
   bool AllowUndef;
 
@@ -251,7 +251,7 @@ struct apint_match {
 // Either constexpr if or renaming ConstantFP::getValueAPF to
 // ConstantFP::getValue is needed to do it via single template
 // function for both apint/apfloat.
-struct apfloat_match {
+struct LLVM_CLASS_ABI apfloat_match {
   const APFloat *&Res;
   bool AllowUndef;
 
@@ -308,7 +308,7 @@ inline apfloat_match m_APFloatForbidUndef(const APFloat *&Res) {
   return apfloat_match(Res, /* AllowUndef */ false);
 }
 
-template <int64_t Val> struct constantint_match {
+template <int64_t Val> struct LLVM_CLASS_ABI constantint_match {
   template <typename ITy> bool match(ITy *V) {
     if (const auto *CI = dyn_cast<ConstantInt>(V)) {
       const APInt &CIV = CI->getValue();
@@ -332,7 +332,7 @@ template <int64_t Val> inline constantint_match<Val> m_ConstantInt() {
 /// and fixed width vectors that satisfy a specified predicate.
 /// For fixed width vector constants, undefined elements are ignored.
 template <typename Predicate, typename ConstantVal>
-struct cstval_pred_ty : public Predicate {
+struct LLVM_CLASS_ABI cstval_pred_ty : public Predicate {
   template <typename ITy> bool match(ITy *V) {
     if (const auto *CV = dyn_cast<ConstantVal>(V))
       return this->isValue(CV->getValue());
@@ -378,7 +378,7 @@ using cstfp_pred_ty = cstval_pred_ty<Predicate, ConstantFP>;
 
 /// This helper class is used to match scalar and vector constants that
 /// satisfy a specified predicate, and bind them to an APInt.
-template <typename Predicate> struct api_pred_ty : public Predicate {
+template <typename Predicate> struct LLVM_CLASS_ABI api_pred_ty : public Predicate {
   const APInt *&Res;
 
   api_pred_ty(const APInt *&R) : Res(R) {}
@@ -404,7 +404,7 @@ template <typename Predicate> struct api_pred_ty : public Predicate {
 /// This helper class is used to match scalar and vector constants that
 /// satisfy a specified predicate, and bind them to an APFloat.
 /// Undefs are allowed in splat vector constants.
-template <typename Predicate> struct apf_pred_ty : public Predicate {
+template <typename Predicate> struct LLVM_CLASS_ABI apf_pred_ty : public Predicate {
   const APFloat *&Res;
 
   apf_pred_ty(const APFloat *&R) : Res(R) {}
@@ -437,7 +437,7 @@ template <typename Predicate> struct apf_pred_ty : public Predicate {
 //
 ///////////////////////////////////////////////////////////////////////////////
 
-struct is_any_apint {
+struct LLVM_CLASS_ABI is_any_apint {
   bool isValue(const APInt &C) { return true; }
 };
 /// Match an integer or vector with any integral constant.
@@ -446,7 +446,7 @@ inline cst_pred_ty<is_any_apint> m_AnyIntegralConstant() {
   return cst_pred_ty<is_any_apint>();
 }
 
-struct is_shifted_mask {
+struct LLVM_CLASS_ABI is_shifted_mask {
   bool isValue(const APInt &C) { return C.isShiftedMask(); }
 };
 
@@ -454,7 +454,7 @@ inline cst_pred_ty<is_shifted_mask> m_ShiftedMask() {
   return cst_pred_ty<is_shifted_mask>();
 }
 
-struct is_all_ones {
+struct LLVM_CLASS_ABI is_all_ones {
   bool isValue(const APInt &C) { return C.isAllOnes(); }
 };
 /// Match an integer or vector with all bits set.
@@ -463,7 +463,7 @@ inline cst_pred_ty<is_all_ones> m_AllOnes() {
   return cst_pred_ty<is_all_ones>();
 }
 
-struct is_maxsignedvalue {
+struct LLVM_CLASS_ABI is_maxsignedvalue {
   bool isValue(const APInt &C) { return C.isMaxSignedValue(); }
 };
 /// Match an integer or vector with values having all bits except for the high
@@ -476,7 +476,7 @@ inline api_pred_ty<is_maxsignedvalue> m_MaxSignedValue(const APInt *&V) {
   return V;
 }
 
-struct is_negative {
+struct LLVM_CLASS_ABI is_negative {
   bool isValue(const APInt &C) { return C.isNegative(); }
 };
 /// Match an integer or vector of negative values.
@@ -486,7 +486,7 @@ inline cst_pred_ty<is_negative> m_Negative() {
 }
 inline api_pred_ty<is_negative> m_Negative(const APInt *&V) { return V; }
 
-struct is_nonnegative {
+struct LLVM_CLASS_ABI is_nonnegative {
   bool isValue(const APInt &C) { return C.isNonNegative(); }
 };
 /// Match an integer or vector of non-negative values.
@@ -496,7 +496,7 @@ inline cst_pred_ty<is_nonnegative> m_NonNegative() {
 }
 inline api_pred_ty<is_nonnegative> m_NonNegative(const APInt *&V) { return V; }
 
-struct is_strictlypositive {
+struct LLVM_CLASS_ABI is_strictlypositive {
   bool isValue(const APInt &C) { return C.isStrictlyPositive(); }
 };
 /// Match an integer or vector of strictly positive values.
@@ -508,7 +508,7 @@ inline api_pred_ty<is_strictlypositive> m_StrictlyPositive(const APInt *&V) {
   return V;
 }
 
-struct is_nonpositive {
+struct LLVM_CLASS_ABI is_nonpositive {
   bool isValue(const APInt &C) { return C.isNonPositive(); }
 };
 /// Match an integer or vector of non-positive values.
@@ -518,14 +518,14 @@ inline cst_pred_ty<is_nonpositive> m_NonPositive() {
 }
 inline api_pred_ty<is_nonpositive> m_NonPositive(const APInt *&V) { return V; }
 
-struct is_one {
+struct LLVM_CLASS_ABI is_one {
   bool isValue(const APInt &C) { return C.isOne(); }
 };
 /// Match an integer 1 or a vector with all elements equal to 1.
 /// For vectors, this includes constants with undefined elements.
 inline cst_pred_ty<is_one> m_One() { return cst_pred_ty<is_one>(); }
 
-struct is_zero_int {
+struct LLVM_CLASS_ABI is_zero_int {
   bool isValue(const APInt &C) { return C.isZero(); }
 };
 /// Match an integer 0 or a vector with all elements equal to 0.
@@ -534,7 +534,7 @@ inline cst_pred_ty<is_zero_int> m_ZeroInt() {
   return cst_pred_ty<is_zero_int>();
 }
 
-struct is_zero {
+struct LLVM_CLASS_ABI is_zero {
   template <typename ITy> bool match(ITy *V) {
     auto *C = dyn_cast<Constant>(V);
     // FIXME: this should be able to do something for scalable vectors
@@ -545,7 +545,7 @@ struct is_zero {
 /// For vectors, this includes constants with undefined elements.
 inline is_zero m_Zero() { return is_zero(); }
 
-struct is_power2 {
+struct LLVM_CLASS_ABI is_power2 {
   bool isValue(const APInt &C) { return C.isPowerOf2(); }
 };
 /// Match an integer or vector power-of-2.
@@ -553,7 +553,7 @@ struct is_power2 {
 inline cst_pred_ty<is_power2> m_Power2() { return cst_pred_ty<is_power2>(); }
 inline api_pred_ty<is_power2> m_Power2(const APInt *&V) { return V; }
 
-struct is_negated_power2 {
+struct LLVM_CLASS_ABI is_negated_power2 {
   bool isValue(const APInt &C) { return C.isNegatedPowerOf2(); }
 };
 /// Match a integer or vector negated power-of-2.
@@ -565,7 +565,7 @@ inline api_pred_ty<is_negated_power2> m_NegatedPower2(const APInt *&V) {
   return V;
 }
 
-struct is_power2_or_zero {
+struct LLVM_CLASS_ABI is_power2_or_zero {
   bool isValue(const APInt &C) { return !C || C.isPowerOf2(); }
 };
 /// Match an integer or vector of 0 or power-of-2 values.
@@ -577,7 +577,7 @@ inline api_pred_ty<is_power2_or_zero> m_Power2OrZero(const APInt *&V) {
   return V;
 }
 
-struct is_sign_mask {
+struct LLVM_CLASS_ABI is_sign_mask {
   bool isValue(const APInt &C) { return C.isSignMask(); }
 };
 /// Match an integer or vector with only the sign bit(s) set.
@@ -586,7 +586,7 @@ inline cst_pred_ty<is_sign_mask> m_SignMask() {
   return cst_pred_ty<is_sign_mask>();
 }
 
-struct is_lowbit_mask {
+struct LLVM_CLASS_ABI is_lowbit_mask {
   bool isValue(const APInt &C) { return C.isMask(); }
 };
 /// Match an integer or vector with only the low bit(s) set.
@@ -596,7 +596,7 @@ inline cst_pred_ty<is_lowbit_mask> m_LowBitMask() {
 }
 inline api_pred_ty<is_lowbit_mask> m_LowBitMask(const APInt *&V) { return V; }
 
-struct icmp_pred_with_threshold {
+struct LLVM_CLASS_ABI icmp_pred_with_threshold {
   ICmpInst::Predicate Pred;
   const APInt *Thr;
   bool isValue(const APInt &C) { return ICmpInst::compare(C, *Thr, Pred); }
@@ -611,14 +611,14 @@ m_SpecificInt_ICMP(ICmpInst::Predicate Predicate, const APInt &Threshold) {
   return P;
 }
 
-struct is_nan {
+struct LLVM_CLASS_ABI is_nan {
   bool isValue(const APFloat &C) { return C.isNaN(); }
 };
 /// Match an arbitrary NaN constant. This includes quiet and signalling nans.
 /// For vectors, this includes constants with undefined elements.
 inline cstfp_pred_ty<is_nan> m_NaN() { return cstfp_pred_ty<is_nan>(); }
 
-struct is_nonnan {
+struct LLVM_CLASS_ABI is_nonnan {
   bool isValue(const APFloat &C) { return !C.isNaN(); }
 };
 /// Match a non-NaN FP constant.
@@ -627,14 +627,14 @@ inline cstfp_pred_ty<is_nonnan> m_NonNaN() {
   return cstfp_pred_ty<is_nonnan>();
 }
 
-struct is_inf {
+struct LLVM_CLASS_ABI is_inf {
   bool isValue(const APFloat &C) { return C.isInfinity(); }
 };
 /// Match a positive or negative infinity FP constant.
 /// For vectors, this includes constants with undefined elements.
 inline cstfp_pred_ty<is_inf> m_Inf() { return cstfp_pred_ty<is_inf>(); }
 
-struct is_noninf {
+struct LLVM_CLASS_ABI is_noninf {
   bool isValue(const APFloat &C) { return !C.isInfinity(); }
 };
 /// Match a non-infinity FP constant, i.e. finite or NaN.
@@ -643,7 +643,7 @@ inline cstfp_pred_ty<is_noninf> m_NonInf() {
   return cstfp_pred_ty<is_noninf>();
 }
 
-struct is_finite {
+struct LLVM_CLASS_ABI is_finite {
   bool isValue(const APFloat &C) { return C.isFinite(); }
 };
 /// Match a finite FP constant, i.e. not infinity or NaN.
@@ -653,7 +653,7 @@ inline cstfp_pred_ty<is_finite> m_Finite() {
 }
 inline apf_pred_ty<is_finite> m_Finite(const APFloat *&V) { return V; }
 
-struct is_finitenonzero {
+struct LLVM_CLASS_ABI is_finitenonzero {
   bool isValue(const APFloat &C) { return C.isFiniteNonZero(); }
 };
 /// Match a finite non-zero FP constant.
@@ -665,7 +665,7 @@ inline apf_pred_ty<is_finitenonzero> m_FiniteNonZero(const APFloat *&V) {
   return V;
 }
 
-struct is_any_zero_fp {
+struct LLVM_CLASS_ABI is_any_zero_fp {
   bool isValue(const APFloat &C) { return C.isZero(); }
 };
 /// Match a floating-point negative zero or positive zero.
@@ -674,7 +674,7 @@ inline cstfp_pred_ty<is_any_zero_fp> m_AnyZeroFP() {
   return cstfp_pred_ty<is_any_zero_fp>();
 }
 
-struct is_pos_zero_fp {
+struct LLVM_CLASS_ABI is_pos_zero_fp {
   bool isValue(const APFloat &C) { return C.isPosZero(); }
 };
 /// Match a floating-point positive zero.
@@ -683,7 +683,7 @@ inline cstfp_pred_ty<is_pos_zero_fp> m_PosZeroFP() {
   return cstfp_pred_ty<is_pos_zero_fp>();
 }
 
-struct is_neg_zero_fp {
+struct LLVM_CLASS_ABI is_neg_zero_fp {
   bool isValue(const APFloat &C) { return C.isNegZero(); }
 };
 /// Match a floating-point negative zero.
@@ -692,7 +692,7 @@ inline cstfp_pred_ty<is_neg_zero_fp> m_NegZeroFP() {
   return cstfp_pred_ty<is_neg_zero_fp>();
 }
 
-struct is_non_zero_fp {
+struct LLVM_CLASS_ABI is_non_zero_fp {
   bool isValue(const APFloat &C) { return C.isNonZero(); }
 };
 /// Match a floating-point non-zero.
@@ -703,7 +703,7 @@ inline cstfp_pred_ty<is_non_zero_fp> m_NonZeroFP() {
 
 ///////////////////////////////////////////////////////////////////////////////
 
-template <typename Class> struct bind_ty {
+template <typename Class> struct LLVM_CLASS_ABI bind_ty {
   Class *&VR;
 
   bind_ty(Class *&V) : VR(V) {}
@@ -769,7 +769,7 @@ m_ImmConstant(Constant *&C) {
 }
 
 /// Match a specified Value*.
-struct specificval_ty {
+struct LLVM_CLASS_ABI specificval_ty {
   const Value *Val;
 
   specificval_ty(const Value *V) : Val(V) {}
@@ -782,7 +782,7 @@ inline specificval_ty m_Specific(const Value *V) { return V; }
 
 /// Stores a reference to the Value *, not the Value * itself,
 /// thus can be used in commutative matchers.
-template <typename Class> struct deferredval_ty {
+template <typename Class> struct LLVM_CLASS_ABI deferredval_ty {
   Class *const &Val;
 
   deferredval_ty(Class *const &V) : Val(V) {}
@@ -803,7 +803,7 @@ inline deferredval_ty<const Value> m_Deferred(const Value *const &V) {
 
 /// Match a specified floating point value or vector of all elements of
 /// that value.
-struct specific_fpval {
+struct LLVM_CLASS_ABI specific_fpval {
   double Val;
 
   specific_fpval(double V) : Val(V) {}
@@ -826,7 +826,7 @@ inline specific_fpval m_SpecificFP(double V) { return specific_fpval(V); }
 /// Match a float 1.0 or vector with all elements equal to 1.0.
 inline specific_fpval m_FPOne() { return m_SpecificFP(1.0); }
 
-struct bind_const_intval_ty {
+struct LLVM_CLASS_ABI bind_const_intval_ty {
   uint64_t &VR;
 
   bind_const_intval_ty(uint64_t &V) : VR(V) {}
@@ -843,7 +843,7 @@ struct bind_const_intval_ty {
 
 /// Match a specified integer value or vector of all elements of that
 /// value.
-template <bool AllowUndefs> struct specific_intval {
+template <bool AllowUndefs> struct LLVM_CLASS_ABI specific_intval {
   APInt Val;
 
   specific_intval(APInt V) : Val(std::move(V)) {}
@@ -881,7 +881,7 @@ inline specific_intval<true> m_SpecificIntAllowUndef(uint64_t V) {
 inline bind_const_intval_ty m_ConstantInt(uint64_t &V) { return V; }
 
 /// Match a specified basic block value.
-struct specific_bbval {
+struct LLVM_CLASS_ABI specific_bbval {
   BasicBlock *Val;
 
   specific_bbval(BasicBlock *Val) : Val(Val) {}
@@ -910,7 +910,7 @@ m_Deferred(const BasicBlock *const &BB) {
 // Matcher for any binary operator.
 //
 template <typename LHS_t, typename RHS_t, bool Commutable = false>
-struct AnyBinaryOp_match {
+struct LLVM_CLASS_ABI AnyBinaryOp_match {
   LHS_t L;
   RHS_t R;
 
@@ -936,7 +936,7 @@ inline AnyBinaryOp_match<LHS, RHS> m_BinOp(const LHS &L, const RHS &R) {
 // Matcher for any unary operator.
 // TODO fuse unary, binary matcher into n-ary matcher
 //
-template <typename OP_t> struct AnyUnaryOp_match {
+template <typename OP_t> struct LLVM_CLASS_ABI AnyUnaryOp_match {
   OP_t X;
 
   AnyUnaryOp_match(const OP_t &X) : X(X) {}
@@ -958,7 +958,7 @@ template <typename OP_t> inline AnyUnaryOp_match<OP_t> m_UnOp(const OP_t &X) {
 
 template <typename LHS_t, typename RHS_t, unsigned Opcode,
           bool Commutable = false>
-struct BinaryOp_match {
+struct LLVM_CLASS_ABI BinaryOp_match {
   LHS_t L;
   RHS_t R;
 
@@ -1008,7 +1008,7 @@ inline BinaryOp_match<LHS, RHS, Instruction::FSub> m_FSub(const LHS &L,
   return BinaryOp_match<LHS, RHS, Instruction::FSub>(L, R);
 }
 
-template <typename Op_t> struct FNeg_match {
+template <typename Op_t> struct LLVM_CLASS_ABI FNeg_match {
   Op_t X;
 
   FNeg_match(const Op_t &Op) : X(Op) {}
@@ -1136,7 +1136,7 @@ inline BinaryOp_match<LHS, RHS, Instruction::AShr> m_AShr(const LHS &L,
 
 template <typename LHS_t, typename RHS_t, unsigned Opcode,
           unsigned WrapFlags = 0>
-struct OverflowingBinaryOp_match {
+struct LLVM_CLASS_ABI OverflowingBinaryOp_match {
   LHS_t L;
   RHS_t R;
 
@@ -1226,7 +1226,7 @@ m_NUWShl(const LHS &L, const RHS &R) {
 }
 
 template <typename LHS_t, typename RHS_t, bool Commutable = false>
-struct SpecificBinaryOp_match
+struct LLVM_CLASS_ABI SpecificBinaryOp_match
     : public BinaryOp_match<LHS_t, RHS_t, 0, Commutable> {
   unsigned Opcode;
 
@@ -1249,7 +1249,7 @@ inline SpecificBinaryOp_match<LHS, RHS> m_BinOp(unsigned Opcode, const LHS &L,
 // Class that matches a group of binary opcodes.
 //
 template <typename LHS_t, typename RHS_t, typename Predicate>
-struct BinOpPred_match : Predicate {
+struct LLVM_CLASS_ABI BinOpPred_match : Predicate {
   LHS_t L;
   RHS_t R;
 
@@ -1266,35 +1266,35 @@ struct BinOpPred_match : Predicate {
   }
 };
 
-struct is_shift_op {
+struct LLVM_CLASS_ABI is_shift_op {
   bool isOpType(unsigned Opcode) { return Instruction::isShift(Opcode); }
 };
 
-struct is_right_shift_op {
+struct LLVM_CLASS_ABI is_right_shift_op {
   bool isOpType(unsigned Opcode) {
     return Opcode == Instruction::LShr || Opcode == Instruction::AShr;
   }
 };
 
-struct is_logical_shift_op {
+struct LLVM_CLASS_ABI is_logical_shift_op {
   bool isOpType(unsigned Opcode) {
     return Opcode == Instruction::LShr || Opcode == Instruction::Shl;
   }
 };
 
-struct is_bitwiselogic_op {
+struct LLVM_CLASS_ABI is_bitwiselogic_op {
   bool isOpType(unsigned Opcode) {
     return Instruction::isBitwiseLogicOp(Opcode);
   }
 };
 
-struct is_idiv_op {
+struct LLVM_CLASS_ABI is_idiv_op {
   bool isOpType(unsigned Opcode) {
     return Opcode == Instruction::SDiv || Opcode == Instruction::UDiv;
   }
 };
 
-struct is_irem_op {
+struct LLVM_CLASS_ABI is_irem_op {
   bool isOpType(unsigned Opcode) {
     return Opcode == Instruction::SRem || Opcode == Instruction::URem;
   }
@@ -1345,7 +1345,7 @@ inline BinOpPred_match<LHS, RHS, is_irem_op> m_IRem(const LHS &L,
 //===----------------------------------------------------------------------===//
 // Class that matches exact binary ops.
 //
-template <typename SubPattern_t> struct Exact_match {
+template <typename SubPattern_t> struct LLVM_CLASS_ABI Exact_match {
   SubPattern_t SubPattern;
 
   Exact_match(const SubPattern_t &SP) : SubPattern(SP) {}
@@ -1367,7 +1367,7 @@ template <typename T> inline Exact_match<T> m_Exact(const T &SubPattern) {
 
 template <typename LHS_t, typename RHS_t, typename Class, typename PredicateTy,
           bool Commutable = false>
-struct CmpClass_match {
+struct LLVM_CLASS_ABI CmpClass_match {
   PredicateTy &Predicate;
   LHS_t L;
   RHS_t R;
@@ -1415,7 +1415,7 @@ m_FCmp(FCmpInst::Predicate &Pred, const LHS &L, const RHS &R) {
 //
 
 /// Matches instructions with Opcode and three operands.
-template <typename T0, unsigned Opcode> struct OneOps_match {
+template <typename T0, unsigned Opcode> struct LLVM_CLASS_ABI OneOps_match {
   T0 Op1;
 
   OneOps_match(const T0 &Op1) : Op1(Op1) {}
@@ -1430,7 +1430,7 @@ template <typename T0, unsigned Opcode> struct OneOps_match {
 };
 
 /// Matches instructions with Opcode and three operands.
-template <typename T0, typename T1, unsigned Opcode> struct TwoOps_match {
+template <typename T0, typename T1, unsigned Opcode> struct LLVM_CLASS_ABI TwoOps_match {
   T0 Op1;
   T1 Op2;
 
@@ -1447,7 +1447,7 @@ template <typename T0, typename T1, unsigned Opcode> struct TwoOps_match {
 
 /// Matches instructions with Opcode and three operands.
 template <typename T0, typename T1, typename T2, unsigned Opcode>
-struct ThreeOps_match {
+struct LLVM_CLASS_ABI ThreeOps_match {
   T0 Op1;
   T1 Op2;
   T2 Op3;
@@ -1503,7 +1503,7 @@ m_ExtractElt(const Val_t &Val, const Idx_t &Idx) {
 }
 
 /// Matches shuffle.
-template <typename T0, typename T1, typename T2> struct Shuffle_match {
+template <typename T0, typename T1, typename T2> struct LLVM_CLASS_ABI Shuffle_match {
   T0 Op1;
   T1 Op2;
   T2 Mask;
@@ -1520,7 +1520,7 @@ template <typename T0, typename T1, typename T2> struct Shuffle_match {
   }
 };
 
-struct m_Mask {
+struct LLVM_CLASS_ABI m_Mask {
   ArrayRef<int> &MaskRef;
   m_Mask(ArrayRef<int> &MaskRef) : MaskRef(MaskRef) {}
   bool match(ArrayRef<int> Mask) {
@@ -1529,19 +1529,19 @@ struct m_Mask {
   }
 };
 
-struct m_ZeroMask {
+struct LLVM_CLASS_ABI m_ZeroMask {
   bool match(ArrayRef<int> Mask) {
     return all_of(Mask, [](int Elem) { return Elem == 0 || Elem == -1; });
   }
 };
 
-struct m_SpecificMask {
+struct LLVM_CLASS_ABI m_SpecificMask {
   ArrayRef<int> &MaskRef;
   m_SpecificMask(ArrayRef<int> &MaskRef) : MaskRef(MaskRef) {}
   bool match(ArrayRef<int> Mask) { return MaskRef == Mask; }
 };
 
-struct m_SplatOrUndefMask {
+struct LLVM_CLASS_ABI m_SplatOrUndefMask {
   int &SplatIndex;
   m_SplatOrUndefMask(int &SplatIndex) : SplatIndex(SplatIndex) {}
   bool match(ArrayRef<int> Mask) {
@@ -1585,7 +1585,7 @@ m_Store(const ValueOpTy &ValueOp, const PointerOpTy &PointerOp) {
 // Matchers for CastInst classes
 //
 
-template <typename Op_t, unsigned Opcode> struct CastClass_match {
+template <typename Op_t, unsigned Opcode> struct LLVM_CLASS_ABI CastClass_match {
   Op_t Op;
 
   CastClass_match(const Op_t &OpMatch) : Op(OpMatch) {}
@@ -1597,7 +1597,7 @@ template <typename Op_t, unsigned Opcode> struct CastClass_match {
   }
 };
 
-template <typename Op_t> struct PtrToIntSameSize_match {
+template <typename Op_t> struct LLVM_CLASS_ABI PtrToIntSameSize_match {
   const DataLayout &DL;
   Op_t Op;
 
@@ -1724,7 +1724,7 @@ inline CastClass_match<OpTy, Instruction::FPExt> m_FPExt(const OpTy &Op) {
 // Matchers for control flow.
 //
 
-struct br_match {
+struct LLVM_CLASS_ABI br_match {
   BasicBlock *&Succ;
 
   br_match(BasicBlock *&Succ) : Succ(Succ) {}
@@ -1742,7 +1742,7 @@ struct br_match {
 inline br_match m_UnconditionalBr(BasicBlock *&Succ) { return br_match(Succ); }
 
 template <typename Cond_t, typename TrueBlock_t, typename FalseBlock_t>
-struct brc_match {
+struct LLVM_CLASS_ABI brc_match {
   Cond_t Cond;
   TrueBlock_t T;
   FalseBlock_t F;
@@ -1777,7 +1777,7 @@ m_Br(const Cond_t &C, const TrueBlock_t &T, const FalseBlock_t &F) {
 
 template <typename CmpInst_t, typename LHS_t, typename RHS_t, typename Pred_t,
           bool Commutable = false>
-struct MaxMin_match {
+struct LLVM_CLASS_ABI MaxMin_match {
   using PredType = Pred_t;
   LHS_t L;
   RHS_t R;
@@ -1826,56 +1826,56 @@ struct MaxMin_match {
 };
 
 /// Helper class for identifying signed max predicates.
-struct smax_pred_ty {
+struct LLVM_CLASS_ABI smax_pred_ty {
   static bool match(ICmpInst::Predicate Pred) {
     return Pred == CmpInst::ICMP_SGT || Pred == CmpInst::ICMP_SGE;
   }
 };
 
 /// Helper class for identifying signed min predicates.
-struct smin_pred_ty {
+struct LLVM_CLASS_ABI smin_pred_ty {
   static bool match(ICmpInst::Predicate Pred) {
     return Pred == CmpInst::ICMP_SLT || Pred == CmpInst::ICMP_SLE;
   }
 };
 
 /// Helper class for identifying unsigned max predicates.
-struct umax_pred_ty {
+struct LLVM_CLASS_ABI umax_pred_ty {
   static bool match(ICmpInst::Predicate Pred) {
     return Pred == CmpInst::ICMP_UGT || Pred == CmpInst::ICMP_UGE;
   }
 };
 
 /// Helper class for identifying unsigned min predicates.
-struct umin_pred_ty {
+struct LLVM_CLASS_ABI umin_pred_ty {
   static bool match(ICmpInst::Predicate Pred) {
     return Pred == CmpInst::ICMP_ULT || Pred == CmpInst::ICMP_ULE;
   }
 };
 
 /// Helper class for identifying ordered max predicates.
-struct ofmax_pred_ty {
+struct LLVM_CLASS_ABI ofmax_pred_ty {
   static bool match(FCmpInst::Predicate Pred) {
     return Pred == CmpInst::FCMP_OGT || Pred == CmpInst::FCMP_OGE;
   }
 };
 
 /// Helper class for identifying ordered min predicates.
-struct ofmin_pred_ty {
+struct LLVM_CLASS_ABI ofmin_pred_ty {
   static bool match(FCmpInst::Predicate Pred) {
     return Pred == CmpInst::FCMP_OLT || Pred == CmpInst::FCMP_OLE;
   }
 };
 
 /// Helper class for identifying unordered max predicates.
-struct ufmax_pred_ty {
+struct LLVM_CLASS_ABI ufmax_pred_ty {
   static bool match(FCmpInst::Predicate Pred) {
     return Pred == CmpInst::FCMP_UGT || Pred == CmpInst::FCMP_UGE;
   }
 };
 
 /// Helper class for identifying unordered min predicates.
-struct ufmin_pred_ty {
+struct LLVM_CLASS_ABI ufmin_pred_ty {
   static bool match(FCmpInst::Predicate Pred) {
     return Pred == CmpInst::FCMP_ULT || Pred == CmpInst::FCMP_ULE;
   }
@@ -1982,7 +1982,7 @@ m_UnordFMin(const LHS &L, const RHS &R) {
 //
 
 template <typename LHS_t, typename RHS_t, typename Sum_t>
-struct UAddWithOverflow_match {
+struct LLVM_CLASS_ABI UAddWithOverflow_match {
   LHS_t L;
   RHS_t R;
   Sum_t S;
@@ -2050,7 +2050,7 @@ m_UAddWithOverflow(const LHS_t &L, const RHS_t &R, const Sum_t &S) {
   return UAddWithOverflow_match<LHS_t, RHS_t, Sum_t>(L, R, S);
 }
 
-template <typename Opnd_t> struct Argument_match {
+template <typename Opnd_t> struct LLVM_CLASS_ABI Argument_match {
   unsigned OpI;
   Opnd_t Val;
 
@@ -2071,7 +2071,7 @@ inline Argument_match<Opnd_t> m_Argument(const Opnd_t &Op) {
 }
 
 /// Intrinsic matchers.
-struct IntrinsicID_match {
+struct LLVM_CLASS_ABI IntrinsicID_match {
   unsigned ID;
 
   IntrinsicID_match(Intrinsic::ID IntrID) : ID(IntrID) {}
@@ -2093,33 +2093,33 @@ template <typename T0 = void, typename T1 = void, typename T2 = void,
           typename T6 = void, typename T7 = void, typename T8 = void,
           typename T9 = void, typename T10 = void>
 struct m_Intrinsic_Ty;
-template <typename T0> struct m_Intrinsic_Ty<T0> {
+template <typename T0> struct LLVM_CLASS_ABI m_Intrinsic_Ty<T0> {
   using Ty = match_combine_and<IntrinsicID_match, Argument_match<T0>>;
 };
-template <typename T0, typename T1> struct m_Intrinsic_Ty<T0, T1> {
+template <typename T0, typename T1> struct LLVM_CLASS_ABI m_Intrinsic_Ty<T0, T1> {
   using Ty =
       match_combine_and<typename m_Intrinsic_Ty<T0>::Ty, Argument_match<T1>>;
 };
 template <typename T0, typename T1, typename T2>
-struct m_Intrinsic_Ty<T0, T1, T2> {
+struct LLVM_CLASS_ABI m_Intrinsic_Ty<T0, T1, T2> {
   using Ty = match_combine_and<typename m_Intrinsic_Ty<T0, T1>::Ty,
                                Argument_match<T2>>;
 };
 template <typename T0, typename T1, typename T2, typename T3>
-struct m_Intrinsic_Ty<T0, T1, T2, T3> {
+struct LLVM_CLASS_ABI m_Intrinsic_Ty<T0, T1, T2, T3> {
   using Ty = match_combine_and<typename m_Intrinsic_Ty<T0, T1, T2>::Ty,
                                Argument_match<T3>>;
 };
 
 template <typename T0, typename T1, typename T2, typename T3, typename T4>
-struct m_Intrinsic_Ty<T0, T1, T2, T3, T4> {
+struct LLVM_CLASS_ABI m_Intrinsic_Ty<T0, T1, T2, T3, T4> {
   using Ty = match_combine_and<typename m_Intrinsic_Ty<T0, T1, T2, T3>::Ty,
                                Argument_match<T4>>;
 };
 
 template <typename T0, typename T1, typename T2, typename T3, typename T4,
           typename T5>
-struct m_Intrinsic_Ty<T0, T1, T2, T3, T4, T5> {
+struct LLVM_CLASS_ABI m_Intrinsic_Ty<T0, T1, T2, T3, T4, T5> {
   using Ty = match_combine_and<typename m_Intrinsic_Ty<T0, T1, T2, T3, T4>::Ty,
                                Argument_match<T5>>;
 };
@@ -2335,7 +2335,7 @@ m_Not(const ValTy &V) {
   return m_c_Xor(m_AllOnes(), V);
 }
 
-template <typename ValTy> struct NotForbidUndef_match {
+template <typename ValTy> struct LLVM_CLASS_ABI NotForbidUndef_match {
   ValTy Val;
   NotForbidUndef_match(const ValTy &V) : Val(V) {}
 
@@ -2418,7 +2418,7 @@ m_c_FMul(const LHS &L, const RHS &R) {
   return BinaryOp_match<LHS, RHS, Instruction::FMul, true>(L, R);
 }
 
-template <typename Opnd_t> struct Signum_match {
+template <typename Opnd_t> struct LLVM_CLASS_ABI Signum_match {
   Opnd_t Val;
   Signum_match(const Opnd_t &V) : Val(V) {}
 
@@ -2458,7 +2458,7 @@ template <typename Val_t> inline Signum_match<Val_t> m_Signum(const Val_t &V) {
   return Signum_match<Val_t>(V);
 }
 
-template <int Ind, typename Opnd_t> struct ExtractValue_match {
+template <int Ind, typename Opnd_t> struct LLVM_CLASS_ABI ExtractValue_match {
   Opnd_t Val;
   ExtractValue_match(const Opnd_t &V) : Val(V) {}
 
@@ -2489,7 +2489,7 @@ inline ExtractValue_match<-1, Val_t> m_ExtractValue(const Val_t &V) {
 }
 
 /// Matcher for a single index InsertValue instruction.
-template <int Ind, typename T0, typename T1> struct InsertValue_match {
+template <int Ind, typename T0, typename T1> struct LLVM_CLASS_ABI InsertValue_match {
   T0 Op0;
   T1 Op1;
 
@@ -2515,7 +2515,7 @@ inline InsertValue_match<Ind, Val_t, Elt_t> m_InsertValue(const Val_t &Val,
 /// the constant expression
 ///  `ptrtoint(gep <vscale x 1 x i8>, <vscale x 1 x i8>* null, i32 1>`
 /// under the right conditions determined by DataLayout.
-struct VScaleVal_match {
+struct LLVM_CLASS_ABI VScaleVal_match {
   template <typename ITy> bool match(ITy *V) {
     if (m_Intrinsic<Intrinsic::vscale>().match(V))
       return true;
@@ -2542,7 +2542,7 @@ inline VScaleVal_match m_VScale() {
 }
 
 template <typename LHS, typename RHS, unsigned Opcode, bool Commutable = false>
-struct LogicalOp_match {
+struct LLVM_CLASS_ABI LogicalOp_match {
   LHS L;
   RHS R;
 
diff --git a/llvm/include/llvm/IR/PredIteratorCache.h b/llvm/include/llvm/IR/PredIteratorCache.h
index a7751ce6279bd95..e02fc096dd022aa 100644
--- a/llvm/include/llvm/IR/PredIteratorCache.h
+++ b/llvm/include/llvm/IR/PredIteratorCache.h
@@ -25,7 +25,7 @@ namespace llvm {
 /// PredIteratorCache - This class is an extremely trivial cache for
 /// predecessor iterator queries.  This is useful for code that repeatedly
 /// wants the predecessor list for the same blocks.
-class PredIteratorCache {
+class LLVM_CLASS_ABI PredIteratorCache {
   /// BlockToPredsMap - Pointer to null-terminated list.
   mutable DenseMap<BasicBlock *, BasicBlock **> BlockToPredsMap;
   mutable DenseMap<BasicBlock *, unsigned> BlockToPredCountMap;
diff --git a/llvm/include/llvm/IR/PrintPasses.h b/llvm/include/llvm/IR/PrintPasses.h
index 96b44ba5644cf42..93b8cf4a14f539b 100644
--- a/llvm/include/llvm/IR/PrintPasses.h
+++ b/llvm/include/llvm/IR/PrintPasses.h
@@ -28,54 +28,54 @@ enum class ChangePrinter {
   DotCfgQuiet
 };
 
-extern cl::opt<ChangePrinter> PrintChanged;
+LLVM_FUNC_ABI extern cl::opt<ChangePrinter> PrintChanged;
 
 // Returns true if printing before/after some pass is enabled, whether all
 // passes or a specific pass.
-bool shouldPrintBeforeSomePass();
-bool shouldPrintAfterSomePass();
+LLVM_FUNC_ABI bool shouldPrintBeforeSomePass();
+LLVM_FUNC_ABI bool shouldPrintAfterSomePass();
 
 // Returns true if we should print before/after a specific pass. The argument
 // should be the pass ID, e.g. "instcombine".
-bool shouldPrintBeforePass(StringRef PassID);
-bool shouldPrintAfterPass(StringRef PassID);
+LLVM_FUNC_ABI bool shouldPrintBeforePass(StringRef PassID);
+LLVM_FUNC_ABI bool shouldPrintAfterPass(StringRef PassID);
 
 // Returns true if we should print before/after all passes.
-bool shouldPrintBeforeAll();
-bool shouldPrintAfterAll();
+LLVM_FUNC_ABI bool shouldPrintBeforeAll();
+LLVM_FUNC_ABI bool shouldPrintAfterAll();
 
 // The list of passes to print before/after, if we only want to print
 // before/after specific passes.
-std::vector<std::string> printBeforePasses();
-std::vector<std::string> printAfterPasses();
+LLVM_FUNC_ABI std::vector<std::string> printBeforePasses();
+LLVM_FUNC_ABI std::vector<std::string> printAfterPasses();
 
 // Returns true if we should always print the entire module.
-bool forcePrintModuleIR();
+LLVM_FUNC_ABI bool forcePrintModuleIR();
 
 // Return true if -filter-passes is empty or contains the pass name.
-bool isPassInPrintList(StringRef PassName);
-bool isFilterPassesEmpty();
+LLVM_FUNC_ABI bool isPassInPrintList(StringRef PassName);
+LLVM_FUNC_ABI bool isFilterPassesEmpty();
 
 // Returns true if we should print the function.
-bool isFunctionInPrintList(StringRef FunctionName);
+LLVM_FUNC_ABI bool isFunctionInPrintList(StringRef FunctionName);
 
 // Ensure temporary files exist, creating or re-using them.  \p FD contains
 // file descriptors (-1 indicates that the file should be created) and
 // \p SR contains the corresponding initial content.  \p FileName will have
 // the filenames filled in when creating files.  Return first error code (if
 // any) and stop.
-std::error_code prepareTempFiles(SmallVector<int> &FD, ArrayRef<StringRef> SR,
+LLVM_FUNC_ABI std::error_code prepareTempFiles(SmallVector<int> &FD, ArrayRef<StringRef> SR,
                                  SmallVector<std::string> &FileName);
 
 // Remove the temporary files in \p FileName.  Typically used in conjunction
 // with prepareTempFiles.  Return first error code (if any) and stop..
-std::error_code cleanUpTempFiles(ArrayRef<std::string> FileName);
+LLVM_FUNC_ABI std::error_code cleanUpTempFiles(ArrayRef<std::string> FileName);
 
 // Perform a system based diff between \p Before and \p After, using \p
 // OldLineFormat, \p NewLineFormat, and \p UnchangedLineFormat to control the
 // formatting of the output. Return an error message for any failures instead
 // of the diff.
-std::string doSystemDiff(StringRef Before, StringRef After,
+LLVM_FUNC_ABI std::string doSystemDiff(StringRef Before, StringRef After,
                          StringRef OldLineFormat, StringRef NewLineFormat,
                          StringRef UnchangedLineFormat);
 
diff --git a/llvm/include/llvm/IR/ProfDataUtils.h b/llvm/include/llvm/IR/ProfDataUtils.h
index 649b861663ccf8c..cf6521860f57da5 100644
--- a/llvm/include/llvm/IR/ProfDataUtils.h
+++ b/llvm/include/llvm/IR/ProfDataUtils.h
@@ -23,38 +23,38 @@
 namespace llvm {
 
 /// Checks if an Instruction has MD_prof Metadata
-bool hasProfMD(const Instruction &I);
+LLVM_FUNC_ABI bool hasProfMD(const Instruction &I);
 
 /// Checks if an MDNode contains Branch Weight Metadata
-bool isBranchWeightMD(const MDNode *ProfileData);
+LLVM_FUNC_ABI bool isBranchWeightMD(const MDNode *ProfileData);
 
 /// Checks if an instructions has Branch Weight Metadata
 ///
 /// \param I The instruction to check
 /// \returns True if I has an MD_prof node containing Branch Weights. False
 /// otherwise.
-bool hasBranchWeightMD(const Instruction &I);
+LLVM_FUNC_ABI bool hasBranchWeightMD(const Instruction &I);
 
 /// Checks if an instructions has valid Branch Weight Metadata
 ///
 /// \param I The instruction to check
 /// \returns True if I has an MD_prof node containing valid Branch Weights,
 /// i.e., one weight for each successor. False otherwise.
-bool hasValidBranchWeightMD(const Instruction &I);
+LLVM_FUNC_ABI bool hasValidBranchWeightMD(const Instruction &I);
 
 /// Get the branch weights metadata node
 ///
 /// \param I The Instruction to get the weights from.
 /// \returns A pointer to I's branch weights metadata node, if it exists.
 /// Nullptr otherwise.
-MDNode *getBranchWeightMDNode(const Instruction &I);
+LLVM_FUNC_ABI MDNode *getBranchWeightMDNode(const Instruction &I);
 
 /// Get the valid branch weights metadata node
 ///
 /// \param I The Instruction to get the weights from.
 /// \returns A pointer to I's valid branch weights metadata node, if it exists.
 /// Nullptr otherwise.
-MDNode *getValidBranchWeightMDNode(const Instruction &I);
+LLVM_FUNC_ABI MDNode *getValidBranchWeightMDNode(const Instruction &I);
 
 /// Extract branch weights from MD_prof metadata
 ///
@@ -62,7 +62,7 @@ MDNode *getValidBranchWeightMDNode(const Instruction &I);
 /// \param [out] Weights An output vector to fill with branch weights
 /// \returns True if weights were extracted, False otherwise. When false Weights
 /// will be cleared.
-bool extractBranchWeights(const MDNode *ProfileData,
+LLVM_FUNC_ABI bool extractBranchWeights(const MDNode *ProfileData,
                           SmallVectorImpl<uint32_t> &Weights);
 
 /// Extract branch weights attatched to an Instruction
@@ -71,7 +71,7 @@ bool extractBranchWeights(const MDNode *ProfileData,
 /// \param [out] Weights An output vector to fill with branch weights
 /// \returns True if weights were extracted, False otherwise. When false Weights
 /// will be cleared.
-bool extractBranchWeights(const Instruction &I,
+LLVM_FUNC_ABI bool extractBranchWeights(const Instruction &I,
                           SmallVectorImpl<uint32_t> &Weights);
 
 /// Extract branch weights from a conditional branch or select Instruction.
@@ -81,7 +81,7 @@ bool extractBranchWeights(const Instruction &I,
 /// \param [out] FalseVal will contain the branch weight for the False branch
 /// \returns True on success with profile weights filled in. False if no
 /// metadata or invalid metadata was found.
-bool extractBranchWeights(const Instruction &I, uint64_t &TrueVal,
+LLVM_FUNC_ABI bool extractBranchWeights(const Instruction &I, uint64_t &TrueVal,
                           uint64_t &FalseVal);
 
 /// Retrieve the total of all weights from MD_prof data.
@@ -90,7 +90,7 @@ bool extractBranchWeights(const Instruction &I, uint64_t &TrueVal,
 /// \param [out] TotalWeights input variable to fill with total weights
 /// \returns True on success with profile total weights filled in. False if no
 /// metadata was found.
-bool extractProfTotalWeight(const MDNode *ProfileData, uint64_t &TotalWeights);
+LLVM_FUNC_ABI bool extractProfTotalWeight(const MDNode *ProfileData, uint64_t &TotalWeights);
 
 /// Retrieve the total of all weights from an instruction.
 ///
@@ -98,7 +98,7 @@ bool extractProfTotalWeight(const MDNode *ProfileData, uint64_t &TotalWeights);
 /// \param [out] TotalWeights input variable to fill with total weights
 /// \returns True on success with profile total weights filled in. False if no
 /// metadata was found.
-bool extractProfTotalWeight(const Instruction &I, uint64_t &TotalWeights);
+LLVM_FUNC_ABI bool extractProfTotalWeight(const Instruction &I, uint64_t &TotalWeights);
 
 } // namespace llvm
 #endif
diff --git a/llvm/include/llvm/IR/ProfileSummary.h b/llvm/include/llvm/IR/ProfileSummary.h
index 6561ac7e48eceb7..50afe4980610024 100644
--- a/llvm/include/llvm/IR/ProfileSummary.h
+++ b/llvm/include/llvm/IR/ProfileSummary.h
@@ -31,7 +31,7 @@ class raw_ostream;
 // per-line samples. Given a target counts percentile, we compute the minimum
 // number of counts needed to reach this target and the minimum among these
 // counts.
-struct ProfileSummaryEntry {
+struct LLVM_CLASS_ABI ProfileSummaryEntry {
   const uint32_t Cutoff;    ///< The required percentile of counts.
   const uint64_t MinCount;  ///< The minimum count for this percentile.
   const uint64_t NumCounts; ///< Number of counts >= the minimum count.
@@ -43,7 +43,7 @@ struct ProfileSummaryEntry {
 
 using SummaryEntryVector = std::vector<ProfileSummaryEntry>;
 
-class ProfileSummary {
+class LLVM_CLASS_ABI ProfileSummary {
 public:
   enum Kind { PSK_Instr, PSK_CSInstr, PSK_Sample };
 
diff --git a/llvm/include/llvm/IR/PseudoProbe.h b/llvm/include/llvm/IR/PseudoProbe.h
index fe25a552b1d48cf..48dfc10434f9b4a 100644
--- a/llvm/include/llvm/IR/PseudoProbe.h
+++ b/llvm/include/llvm/IR/PseudoProbe.h
@@ -39,7 +39,7 @@ enum class PseudoProbeAttributes {
 constexpr static uint64_t PseudoProbeFullDistributionFactor =
     std::numeric_limits<uint64_t>::max();
 
-struct PseudoProbeDwarfDiscriminator {
+struct LLVM_CLASS_ABI PseudoProbeDwarfDiscriminator {
 public:
   // The following APIs encodes/decodes per-probe information to/from a
   // 32-bit integer which is organized as:
@@ -79,7 +79,7 @@ struct PseudoProbeDwarfDiscriminator {
   constexpr static uint8_t FullDistributionFactor = 100;
 };
 
-class PseudoProbeDescriptor {
+class LLVM_CLASS_ABI PseudoProbeDescriptor {
   uint64_t FunctionGUID;
   uint64_t FunctionHash;
 
@@ -90,7 +90,7 @@ class PseudoProbeDescriptor {
   uint64_t getFunctionHash() const { return FunctionHash; }
 };
 
-struct PseudoProbe {
+struct LLVM_CLASS_ABI PseudoProbe {
   uint32_t Id;
   uint32_t Type;
   uint32_t Attr;
@@ -109,9 +109,9 @@ static inline bool hasDiscriminator(uint32_t Flags) {
   return Flags & (uint32_t)PseudoProbeAttributes::HasDiscriminator;
 }
 
-std::optional<PseudoProbe> extractProbe(const Instruction &Inst);
+LLVM_FUNC_ABI std::optional<PseudoProbe> extractProbe(const Instruction &Inst);
 
-void setProbeDistributionFactor(Instruction &Inst, float Factor);
+LLVM_FUNC_ABI void setProbeDistributionFactor(Instruction &Inst, float Factor);
 } // end namespace llvm
 
 #endif // LLVM_IR_PSEUDOPROBE_H
diff --git a/llvm/include/llvm/IR/ReplaceConstant.h b/llvm/include/llvm/IR/ReplaceConstant.h
index 77a9a014829a1d4..b1d2f7ca39702b2 100644
--- a/llvm/include/llvm/IR/ReplaceConstant.h
+++ b/llvm/include/llvm/IR/ReplaceConstant.h
@@ -25,7 +25,7 @@ class Constant;
 
 /// Replace constant expressions users of the given constants with
 /// instructions. Return whether anything was changed.
-bool convertUsersOfConstantsToInstructions(ArrayRef<Constant *> Consts);
+LLVM_FUNC_ABI bool convertUsersOfConstantsToInstructions(ArrayRef<Constant *> Consts);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/IR/SSAContext.h b/llvm/include/llvm/IR/SSAContext.h
index f13f23c999db67e..22012416d85d474 100644
--- a/llvm/include/llvm/IR/SSAContext.h
+++ b/llvm/include/llvm/IR/SSAContext.h
@@ -35,7 +35,7 @@ inline auto instrs(const BasicBlock &BB) {
   return llvm::make_range(BB.begin(), BB.end());
 }
 
-template <> class GenericSSAContext<Function> {
+template <> class LLVM_CLASS_ABI GenericSSAContext<Function> {
   Function *F;
 
 public:
diff --git a/llvm/include/llvm/IR/SafepointIRVerifier.h b/llvm/include/llvm/IR/SafepointIRVerifier.h
index f56e2f4837428f4..af43726776b9fcb 100644
--- a/llvm/include/llvm/IR/SafepointIRVerifier.h
+++ b/llvm/include/llvm/IR/SafepointIRVerifier.h
@@ -27,15 +27,15 @@ class Function;
 class FunctionPass;
 
 /// Run the safepoint verifier over a single function.  Crashes on failure.
-void verifySafepointIR(Function &F);
+LLVM_FUNC_ABI void verifySafepointIR(Function &F);
 
 /// Create an instance of the safepoint verifier pass which can be added to
 /// a pass pipeline to check for relocation bugs.
-FunctionPass *createSafepointIRVerifierPass();
+LLVM_FUNC_ABI FunctionPass *createSafepointIRVerifierPass();
 
 /// Create an instance of the safepoint verifier pass which can be added to
 /// a pass pipeline to check for relocation bugs.
-class SafepointIRVerifierPass : public PassInfoMixin<SafepointIRVerifierPass> {
+class LLVM_CLASS_ABI SafepointIRVerifierPass : public PassInfoMixin<SafepointIRVerifierPass> {
 
 public:
   explicit SafepointIRVerifierPass() = default;
diff --git a/llvm/include/llvm/IR/Statepoint.h b/llvm/include/llvm/IR/Statepoint.h
index c976c315a1a33c7..8c82a7a2221dfc6 100644
--- a/llvm/include/llvm/IR/Statepoint.h
+++ b/llvm/include/llvm/IR/Statepoint.h
@@ -59,7 +59,7 @@ class GCRelocateInst;
 /// Represents a gc.statepoint intrinsic call.  This extends directly from
 /// CallBase as the IntrinsicInst only supports calls and gc.statepoint is
 /// invokable.
-class GCStatepointInst : public CallBase {
+class LLVM_CLASS_ABI GCStatepointInst : public CallBase {
 public:
   GCStatepointInst() = delete;
   GCStatepointInst(const GCStatepointInst &) = delete;
@@ -233,7 +233,7 @@ std::vector<const GCRelocateInst *> GCStatepointInst::getGCRelocates() const {
 /// RewriteStatepointsForGC and potentially in other passes in the future) can
 /// have attributes that describe properties of gc.statepoint call they will be
 /// eventually be wrapped in.  This struct is used represent such directives.
-struct StatepointDirectives {
+struct LLVM_CLASS_ABI StatepointDirectives {
   std::optional<uint32_t> NumPatchBytes;
   std::optional<uint64_t> StatepointID;
 
@@ -243,11 +243,11 @@ struct StatepointDirectives {
 
 /// Parse out statepoint directives from the function attributes present in \p
 /// AS.
-StatepointDirectives parseStatepointDirectivesFromAttrs(AttributeList AS);
+LLVM_FUNC_ABI StatepointDirectives parseStatepointDirectivesFromAttrs(AttributeList AS);
 
 /// Return \c true if the \p Attr is an attribute that is a statepoint
 /// directive.
-bool isStatepointDirectiveAttr(Attribute Attr);
+LLVM_FUNC_ABI bool isStatepointDirectiveAttr(Attribute Attr);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/IR/StructuralHash.h b/llvm/include/llvm/IR/StructuralHash.h
index f7421b19caefe9f..ed0bc0052fe8964 100644
--- a/llvm/include/llvm/IR/StructuralHash.h
+++ b/llvm/include/llvm/IR/StructuralHash.h
@@ -22,8 +22,8 @@ namespace llvm {
 class Function;
 class Module;
 
-uint64_t StructuralHash(const Function &F);
-uint64_t StructuralHash(const Module &M);
+LLVM_FUNC_ABI uint64_t StructuralHash(const Function &F);
+LLVM_FUNC_ABI uint64_t StructuralHash(const Module &M);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/IR/SymbolTableListTraits.h b/llvm/include/llvm/IR/SymbolTableListTraits.h
index d9dd06a248fa70a..0fffefad3ede8a3 100644
--- a/llvm/include/llvm/IR/SymbolTableListTraits.h
+++ b/llvm/include/llvm/IR/SymbolTableListTraits.h
@@ -45,7 +45,7 @@ class ValueSymbolTable;
 ///
 /// Implementations create a typedef called \c type so that we only need a
 /// single template parameter for the list and traits.
-template <typename NodeTy> struct SymbolTableListParentType {};
+template <typename NodeTy> struct LLVM_CLASS_ABI SymbolTableListParentType {};
 
 #define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT)                          \
   template <> struct SymbolTableListParentType<NODE> { using type = PARENT; };
@@ -64,7 +64,7 @@ template <typename NodeTy> class SymbolTableList;
 // ItemParentClass - The type of object that owns the list, e.g. BasicBlock.
 //
 template <typename ValueSubClass>
-class SymbolTableListTraits : public ilist_alloc_traits<ValueSubClass> {
+class LLVM_CLASS_ABI SymbolTableListTraits : public ilist_alloc_traits<ValueSubClass> {
   using ListTy = SymbolTableList<ValueSubClass>;
   using iterator = typename simple_ilist<ValueSubClass>::iterator;
   using ItemParentClass =
@@ -112,7 +112,7 @@ class SymbolTableListTraits : public ilist_alloc_traits<ValueSubClass> {
 /// symbol table will be automatically updated.  Similarly, parent links get
 /// updated automatically.
 template <class T>
-class SymbolTableList
+class LLVM_CLASS_ABI SymbolTableList
     : public iplist_impl<simple_ilist<T>, SymbolTableListTraits<T>> {};
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/IR/TrackingMDRef.h b/llvm/include/llvm/IR/TrackingMDRef.h
index 219630ba54f4304..7a90aaf72245f45 100644
--- a/llvm/include/llvm/IR/TrackingMDRef.h
+++ b/llvm/include/llvm/IR/TrackingMDRef.h
@@ -23,7 +23,7 @@ namespace llvm {
 /// Tracking metadata reference.
 ///
 /// This class behaves like \a TrackingVH, but for metadata.
-class TrackingMDRef {
+class LLVM_CLASS_ABI TrackingMDRef {
   Metadata *MD = nullptr;
 
 public:
@@ -104,7 +104,7 @@ class TrackingMDRef {
 ///
 /// Track refererences of a particular type.  It's useful to use this for \a
 /// MDNode and \a ValueAsMetadata.
-template <class T> class TypedTrackingMDRef {
+template <class T> class LLVM_CLASS_ABI TypedTrackingMDRef {
   TrackingMDRef Ref;
 
 public:
@@ -143,13 +143,13 @@ using TrackingMDNodeRef = TypedTrackingMDRef<MDNode>;
 using TrackingValueAsMetadataRef = TypedTrackingMDRef<ValueAsMetadata>;
 
 // Expose the underlying metadata to casting.
-template <> struct simplify_type<TrackingMDRef> {
+template <> struct LLVM_CLASS_ABI simplify_type<TrackingMDRef> {
   using SimpleType = Metadata *;
 
   static SimpleType getSimplifiedValue(TrackingMDRef &MD) { return MD.get(); }
 };
 
-template <> struct simplify_type<const TrackingMDRef> {
+template <> struct LLVM_CLASS_ABI simplify_type<const TrackingMDRef> {
   using SimpleType = Metadata *;
 
   static SimpleType getSimplifiedValue(const TrackingMDRef &MD) {
@@ -157,7 +157,7 @@ template <> struct simplify_type<const TrackingMDRef> {
   }
 };
 
-template <class T> struct simplify_type<TypedTrackingMDRef<T>> {
+template <class T> struct LLVM_CLASS_ABI simplify_type<TypedTrackingMDRef<T>> {
   using SimpleType = T *;
 
   static SimpleType getSimplifiedValue(TypedTrackingMDRef<T> &MD) {
@@ -165,7 +165,7 @@ template <class T> struct simplify_type<TypedTrackingMDRef<T>> {
   }
 };
 
-template <class T> struct simplify_type<const TypedTrackingMDRef<T>> {
+template <class T> struct LLVM_CLASS_ABI simplify_type<const TypedTrackingMDRef<T>> {
   using SimpleType = T *;
 
   static SimpleType getSimplifiedValue(const TypedTrackingMDRef<T> &MD) {
diff --git a/llvm/include/llvm/IR/Type.h b/llvm/include/llvm/IR/Type.h
index 57d1773becb9c14..4d04a39da1548b9 100644
--- a/llvm/include/llvm/IR/Type.h
+++ b/llvm/include/llvm/IR/Type.h
@@ -42,7 +42,7 @@ template <typename PtrType> class SmallPtrSetImpl;
 /// in class Type and in derived classes.  Once allocated, Types are never
 /// free'd.
 ///
-class Type {
+class LLVM_CLASS_ABI Type {
 public:
   //===--------------------------------------------------------------------===//
   /// Definitions of all of the base types for the Type system.  Based on this
@@ -531,7 +531,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const Type &T) {
 }
 
 // allow isa<PointerType>(x) to work without DerivedTypes.h included.
-template <> struct isa_impl<PointerType, Type> {
+template <> struct LLVM_CLASS_ABI isa_impl<PointerType, Type> {
   static inline bool doit(const Type &Ty) {
     return Ty.getTypeID() == Type::PointerTyID;
   }
diff --git a/llvm/include/llvm/IR/TypeFinder.h b/llvm/include/llvm/IR/TypeFinder.h
index 770193a176a3b97..4d412f682925196 100644
--- a/llvm/include/llvm/IR/TypeFinder.h
+++ b/llvm/include/llvm/IR/TypeFinder.h
@@ -29,7 +29,7 @@ class Value;
 
 /// TypeFinder - Walk over a module, identifying all of the types that are
 /// used by the module.
-class TypeFinder {
+class LLVM_CLASS_ABI TypeFinder {
   // To avoid walking constant expressions multiple times and other IR
   // objects, we keep several helper maps.
   DenseSet<const Value*> VisitedConstants;
diff --git a/llvm/include/llvm/IR/TypedPointerType.h b/llvm/include/llvm/IR/TypedPointerType.h
index ccc303207970671..7bb0d10589bf442 100644
--- a/llvm/include/llvm/IR/TypedPointerType.h
+++ b/llvm/include/llvm/IR/TypedPointerType.h
@@ -23,7 +23,7 @@ namespace llvm {
 /// pointer type abstraction is used for tracking the types of these pointers.
 /// It is not legal to use this type, or derived types containing this type, in
 /// LLVM IR.
-class TypedPointerType : public Type {
+class LLVM_CLASS_ABI TypedPointerType : public Type {
   explicit TypedPointerType(Type *ElType, unsigned AddrSpace);
 
   Type *PointeeTy;
diff --git a/llvm/include/llvm/IR/Use.h b/llvm/include/llvm/IR/Use.h
index 64b86f3a4396ab2..26ebdeda3850fd2 100644
--- a/llvm/include/llvm/IR/Use.h
+++ b/llvm/include/llvm/IR/Use.h
@@ -40,7 +40,7 @@ class Value;
 /// all of the uses for a particular value definition. It also supports jumping
 /// directly to the used value when we arrive from the User's operands, and
 /// jumping directly to the User when we arrive from the Value's uses.
-class Use {
+class LLVM_CLASS_ABI Use {
 public:
   Use(const Use &U) = delete;
 
@@ -112,12 +112,12 @@ class Use {
 
 /// Allow clients to treat uses just like values when using
 /// casting operators.
-template <> struct simplify_type<Use> {
+template <> struct LLVM_CLASS_ABI simplify_type<Use> {
   using SimpleType = Value *;
 
   static SimpleType getSimplifiedValue(Use &Val) { return Val.get(); }
 };
-template <> struct simplify_type<const Use> {
+template <> struct LLVM_CLASS_ABI simplify_type<const Use> {
   using SimpleType = /*const*/ Value *;
 
   static SimpleType getSimplifiedValue(const Use &Val) { return Val.get(); }
diff --git a/llvm/include/llvm/IR/UseListOrder.h b/llvm/include/llvm/IR/UseListOrder.h
index 7d9b9bd7a8e3a5d..96e6491e694f19d 100644
--- a/llvm/include/llvm/IR/UseListOrder.h
+++ b/llvm/include/llvm/IR/UseListOrder.h
@@ -24,7 +24,7 @@ class Function;
 class Value;
 
 /// Structure to hold a use-list order.
-struct UseListOrder {
+struct LLVM_CLASS_ABI UseListOrder {
   const Value *V = nullptr;
   const Function *F = nullptr;
   std::vector<unsigned> Shuffle;
diff --git a/llvm/include/llvm/IR/User.h b/llvm/include/llvm/IR/User.h
index a9cf60151e5dc6c..6b4207afd75ea12 100644
--- a/llvm/include/llvm/IR/User.h
+++ b/llvm/include/llvm/IR/User.h
@@ -41,7 +41,7 @@ template <typename T> class MutableArrayRef;
 template <class>
 struct OperandTraits;
 
-class User : public Value {
+class LLVM_CLASS_ABI User : public Value {
   template <unsigned>
   friend struct HungoffOperandTraits;
 
@@ -319,14 +319,14 @@ static_assert(alignof(Use) >= alignof(User),
 static_assert(alignof(Use *) >= alignof(User),
               "Alignment is insufficient after objects prepended to User");
 
-template<> struct simplify_type<User::op_iterator> {
+template<> struct LLVM_CLASS_ABI simplify_type<User::op_iterator> {
   using SimpleType = Value*;
 
   static SimpleType getSimplifiedValue(User::op_iterator &Val) {
     return Val->get();
   }
 };
-template<> struct simplify_type<User::const_op_iterator> {
+template<> struct LLVM_CLASS_ABI simplify_type<User::const_op_iterator> {
   using SimpleType = /*const*/ Value*;
 
   static SimpleType getSimplifiedValue(User::const_op_iterator &Val) {
diff --git a/llvm/include/llvm/IR/Value.h b/llvm/include/llvm/IR/Value.h
index 4ee27d214d49bb4..a98fbc0db665814 100644
--- a/llvm/include/llvm/IR/Value.h
+++ b/llvm/include/llvm/IR/Value.h
@@ -72,7 +72,7 @@ using ValueName = StringMapEntry<Value *>;
 /// using this Value.  A Value can also have an arbitrary number of ValueHandle
 /// objects that watch it and listen to RAUW and Destroy events.  See
 /// llvm/IR/ValueHandle.h for details.
-class Value {
+class LLVM_CLASS_ABI Value {
   Type *VTy;
   Use *UseList;
 
@@ -856,7 +856,7 @@ class Value {
   void setValueSubclassData(unsigned short D) { SubclassData = D; }
 };
 
-struct ValueDeleter { void operator()(Value *V) { V->deleteValue(); } };
+struct LLVM_CLASS_ABI ValueDeleter { void operator()(Value *V) { V->deleteValue(); } };
 
 /// Use this instead of std::unique_ptr<Value> or std::unique_ptr<Instruction>.
 /// Those don't work because Value and Instruction's destructors are protected,
@@ -954,82 +954,82 @@ template <class Compare> void Value::sortUseList(Compare Cmp) {
 // isa - Provide some specializations of isa so that we don't have to include
 // the subtype header files to test to see if the value is a subclass...
 //
-template <> struct isa_impl<Constant, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<Constant, Value> {
   static inline bool doit(const Value &Val) {
     static_assert(Value::ConstantFirstVal == 0, "Val.getValueID() >= Value::ConstantFirstVal");
     return Val.getValueID() <= Value::ConstantLastVal;
   }
 };
 
-template <> struct isa_impl<ConstantData, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<ConstantData, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() >= Value::ConstantDataFirstVal &&
            Val.getValueID() <= Value::ConstantDataLastVal;
   }
 };
 
-template <> struct isa_impl<ConstantAggregate, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<ConstantAggregate, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() >= Value::ConstantAggregateFirstVal &&
            Val.getValueID() <= Value::ConstantAggregateLastVal;
   }
 };
 
-template <> struct isa_impl<Argument, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<Argument, Value> {
   static inline bool doit (const Value &Val) {
     return Val.getValueID() == Value::ArgumentVal;
   }
 };
 
-template <> struct isa_impl<InlineAsm, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<InlineAsm, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() == Value::InlineAsmVal;
   }
 };
 
-template <> struct isa_impl<Instruction, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<Instruction, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() >= Value::InstructionVal;
   }
 };
 
-template <> struct isa_impl<BasicBlock, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<BasicBlock, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() == Value::BasicBlockVal;
   }
 };
 
-template <> struct isa_impl<Function, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<Function, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() == Value::FunctionVal;
   }
 };
 
-template <> struct isa_impl<GlobalVariable, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<GlobalVariable, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() == Value::GlobalVariableVal;
   }
 };
 
-template <> struct isa_impl<GlobalAlias, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<GlobalAlias, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() == Value::GlobalAliasVal;
   }
 };
 
-template <> struct isa_impl<GlobalIFunc, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<GlobalIFunc, Value> {
   static inline bool doit(const Value &Val) {
     return Val.getValueID() == Value::GlobalIFuncVal;
   }
 };
 
-template <> struct isa_impl<GlobalValue, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<GlobalValue, Value> {
   static inline bool doit(const Value &Val) {
     return isa<GlobalObject>(Val) || isa<GlobalAlias>(Val);
   }
 };
 
-template <> struct isa_impl<GlobalObject, Value> {
+template <> struct LLVM_CLASS_ABI isa_impl<GlobalObject, Value> {
   static inline bool doit(const Value &Val) {
     return isa<GlobalVariable>(Val) || isa<Function>(Val) ||
            isa<GlobalIFunc>(Val);
diff --git a/llvm/include/llvm/IR/ValueHandle.h b/llvm/include/llvm/IR/ValueHandle.h
index e58c9d839c4e103..6841987c4da564c 100644
--- a/llvm/include/llvm/IR/ValueHandle.h
+++ b/llvm/include/llvm/IR/ValueHandle.h
@@ -27,7 +27,7 @@ namespace llvm {
 /// ValueHandle's are smart pointers to Value's that have special behavior when
 /// the value is deleted or ReplaceAllUsesWith'd.  See the specific handles
 /// below for details.
-class ValueHandleBase {
+class LLVM_CLASS_ABI ValueHandleBase {
   friend class Value;
 
 protected:
@@ -142,7 +142,7 @@ class ValueHandleBase {
 ///
 /// This is a value handle that points to a value, and nulls itself
 /// out if that value is deleted.
-class WeakVH : public ValueHandleBase {
+class LLVM_CLASS_ABI WeakVH : public ValueHandleBase {
 public:
   WeakVH() : ValueHandleBase(Weak) {}
   WeakVH(Value *P) : ValueHandleBase(Weak, P) {}
@@ -165,19 +165,19 @@ class WeakVH : public ValueHandleBase {
 
 // Specialize simplify_type to allow WeakVH to participate in
 // dyn_cast, isa, etc.
-template <> struct simplify_type<WeakVH> {
+template <> struct LLVM_CLASS_ABI simplify_type<WeakVH> {
   using SimpleType = Value *;
 
   static SimpleType getSimplifiedValue(WeakVH &WVH) { return WVH; }
 };
-template <> struct simplify_type<const WeakVH> {
+template <> struct LLVM_CLASS_ABI simplify_type<const WeakVH> {
   using SimpleType = Value *;
 
   static SimpleType getSimplifiedValue(const WeakVH &WVH) { return WVH; }
 };
 
 // Specialize DenseMapInfo to allow WeakVH to participate in DenseMap.
-template <> struct DenseMapInfo<WeakVH> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<WeakVH> {
   static inline WeakVH getEmptyKey() {
     return WeakVH(DenseMapInfo<Value *>::getEmptyKey());
   }
@@ -202,7 +202,7 @@ template <> struct DenseMapInfo<WeakVH> {
 /// is useful for advisory sorts of information, but should not be used as the
 /// key of a map (since the map would have to rearrange itself when the pointer
 /// changes).
-class WeakTrackingVH : public ValueHandleBase {
+class LLVM_CLASS_ABI WeakTrackingVH : public ValueHandleBase {
 public:
   WeakTrackingVH() : ValueHandleBase(WeakTracking) {}
   WeakTrackingVH(Value *P) : ValueHandleBase(WeakTracking, P) {}
@@ -229,12 +229,12 @@ class WeakTrackingVH : public ValueHandleBase {
 
 // Specialize simplify_type to allow WeakTrackingVH to participate in
 // dyn_cast, isa, etc.
-template <> struct simplify_type<WeakTrackingVH> {
+template <> struct LLVM_CLASS_ABI simplify_type<WeakTrackingVH> {
   using SimpleType = Value *;
 
   static SimpleType getSimplifiedValue(WeakTrackingVH &WVH) { return WVH; }
 };
-template <> struct simplify_type<const WeakTrackingVH> {
+template <> struct LLVM_CLASS_ABI simplify_type<const WeakTrackingVH> {
   using SimpleType = Value *;
 
   static SimpleType getSimplifiedValue(const WeakTrackingVH &WVH) {
@@ -258,7 +258,7 @@ template <> struct simplify_type<const WeakTrackingVH> {
 /// AssertingVH's as it moves.  This is required because in non-assert mode this
 /// class turns into a trivial wrapper around a pointer.
 template <typename ValueTy>
-class AssertingVH
+class LLVM_CLASS_ABI AssertingVH
 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
     : public ValueHandleBase
 #endif
@@ -311,7 +311,7 @@ class AssertingVH
 // Treat AssertingVH<T> like T* inside maps. This also allows using find_as()
 // to look up a value without constructing a value handle.
 template<typename T>
-struct DenseMapInfo<AssertingVH<T>> : DenseMapInfo<T *> {};
+struct LLVM_CLASS_ABI DenseMapInfo<AssertingVH<T>> : DenseMapInfo<T *> {};
 
 /// Value handle that tracks a Value across RAUW.
 ///
@@ -329,7 +329,7 @@ struct DenseMapInfo<AssertingVH<T>> : DenseMapInfo<T *> {};
 ///
 /// Assigning a value to a TrackingVH is always allowed, even if said TrackingVH
 /// no longer points to a valid value.
-template <typename ValueTy> class TrackingVH {
+template <typename ValueTy> class LLVM_CLASS_ABI TrackingVH {
   WeakTrackingVH InnerHandle;
 
 public:
@@ -381,7 +381,7 @@ template <typename ValueTy> class TrackingVH {
 /// class can be used as the key of a map, as long as the user takes it out of
 /// the map before calling setValPtr() (since the map has to rearrange itself
 /// when the pointer changes).  Unlike ValueHandleBase, this class has a vtable.
-class CallbackVH : public ValueHandleBase {
+class LLVM_CLASS_ABI CallbackVH : public ValueHandleBase {
   virtual void anchor();
 protected:
   ~CallbackVH() = default;
@@ -443,7 +443,7 @@ class CallbackVH : public ValueHandleBase {
 /// PoisoningVH's as it moves. This is required because in non-assert mode this
 /// class turns into a trivial wrapper around a pointer.
 template <typename ValueTy>
-class PoisoningVH final
+class LLVM_CLASS_ABI PoisoningVH final
 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
     : public CallbackVH
 #endif
@@ -524,7 +524,7 @@ class PoisoningVH final
 };
 
 // Specialize DenseMapInfo to allow PoisoningVH to participate in DenseMap.
-template <typename T> struct DenseMapInfo<PoisoningVH<T>> {
+template <typename T> struct LLVM_CLASS_ABI DenseMapInfo<PoisoningVH<T>> {
   static inline PoisoningVH<T> getEmptyKey() {
     PoisoningVH<T> Res;
     Res.setRawValPtr(DenseMapInfo<Value *>::getEmptyKey());
diff --git a/llvm/include/llvm/IR/ValueMap.h b/llvm/include/llvm/IR/ValueMap.h
index 44062ff655ae3e0..483b88082aca0d8 100644
--- a/llvm/include/llvm/IR/ValueMap.h
+++ b/llvm/include/llvm/IR/ValueMap.h
@@ -54,7 +54,7 @@ class ValueMapConstIterator;
 /// ValueMap<>.  User Configs should inherit from this class to be as compatible
 /// as possible with future versions of ValueMap.
 template<typename KeyT, typename MutexT = sys::Mutex>
-struct ValueMapConfig {
+struct LLVM_CLASS_ABI ValueMapConfig {
   using mutex_type = MutexT;
 
   /// If FollowRAUW is true, the ValueMap will update mappings on RAUW. If it's
@@ -82,7 +82,7 @@ struct ValueMapConfig {
 
 /// See the file comment.
 template<typename KeyT, typename ValueT, typename Config =ValueMapConfig<KeyT>>
-class ValueMap {
+class LLVM_CLASS_ABI ValueMap {
   friend class ValueMapCallbackVH<KeyT, ValueT, Config>;
 
   using ValueMapCVH = ValueMapCallbackVH<KeyT, ValueT, Config>;
@@ -238,7 +238,7 @@ class ValueMap {
 // This CallbackVH updates its ValueMap when the contained Value changes,
 // according to the user's preferences expressed through the Config object.
 template <typename KeyT, typename ValueT, typename Config>
-class ValueMapCallbackVH final : public CallbackVH {
+class LLVM_CLASS_ABI ValueMapCallbackVH final : public CallbackVH {
   friend class ValueMap<KeyT, ValueT, Config>;
   friend struct DenseMapInfo<ValueMapCallbackVH>;
 
@@ -295,7 +295,7 @@ class ValueMapCallbackVH final : public CallbackVH {
 };
 
 template<typename KeyT, typename ValueT, typename Config>
-struct DenseMapInfo<ValueMapCallbackVH<KeyT, ValueT, Config>> {
+struct LLVM_CLASS_ABI DenseMapInfo<ValueMapCallbackVH<KeyT, ValueT, Config>> {
   using VH = ValueMapCallbackVH<KeyT, ValueT, Config>;
 
   static inline VH getEmptyKey() {
@@ -323,7 +323,7 @@ struct DenseMapInfo<ValueMapCallbackVH<KeyT, ValueT, Config>> {
   }
 };
 
-template <typename DenseMapT, typename KeyT> class ValueMapIterator {
+template <typename DenseMapT, typename KeyT> class LLVM_CLASS_ABI ValueMapIterator {
   using BaseT = typename DenseMapT::iterator;
   using ValueT = typename DenseMapT::mapped_type;
 
@@ -377,7 +377,7 @@ template <typename DenseMapT, typename KeyT> class ValueMapIterator {
   }
 };
 
-template <typename DenseMapT, typename KeyT> class ValueMapConstIterator {
+template <typename DenseMapT, typename KeyT> class LLVM_CLASS_ABI ValueMapConstIterator {
   using BaseT = typename DenseMapT::const_iterator;
   using ValueT = typename DenseMapT::mapped_type;
 
diff --git a/llvm/include/llvm/IR/ValueSymbolTable.h b/llvm/include/llvm/IR/ValueSymbolTable.h
index 19d4da2d2fc7cf2..0698eae7457aee0 100644
--- a/llvm/include/llvm/IR/ValueSymbolTable.h
+++ b/llvm/include/llvm/IR/ValueSymbolTable.h
@@ -35,7 +35,7 @@ template <typename ValueSubClass> class SymbolTableListTraits;
 /// a std::map<std::string,Value*> but has a controlled interface provided by
 /// LLVM as well as ensuring uniqueness of names.
 ///
-class ValueSymbolTable {
+class LLVM_CLASS_ABI ValueSymbolTable {
   friend class SymbolTableListTraits<Argument>;
   friend class SymbolTableListTraits<BasicBlock>;
   friend class SymbolTableListTraits<Function>;
diff --git a/llvm/include/llvm/IR/VectorBuilder.h b/llvm/include/llvm/IR/VectorBuilder.h
index 922f070ee4922b1..05d2efae9465c25 100644
--- a/llvm/include/llvm/IR/VectorBuilder.h
+++ b/llvm/include/llvm/IR/VectorBuilder.h
@@ -23,7 +23,7 @@
 
 namespace llvm {
 
-class VectorBuilder {
+class LLVM_CLASS_ABI VectorBuilder {
 public:
   enum class Behavior {
     // Abort if the requested VP intrinsic could not be created.
diff --git a/llvm/include/llvm/IR/Verifier.h b/llvm/include/llvm/IR/Verifier.h
index 833e1a26c7036af..2a627c451196ba3 100644
--- a/llvm/include/llvm/IR/Verifier.h
+++ b/llvm/include/llvm/IR/Verifier.h
@@ -37,7 +37,7 @@ class raw_ostream;
 struct VerifierSupport;
 
 /// Verify that the TBAA Metadatas are valid.
-class TBAAVerifier {
+class LLVM_CLASS_ABI TBAAVerifier {
   VerifierSupport *Diagnostic = nullptr;
 
   /// Helper to diagnose a failure
@@ -86,7 +86,7 @@ class TBAAVerifier {
 /// If there are no errors, the function returns false. If an error is found,
 /// a message describing the error is written to OS (if non-null) and true is
 /// returned.
-bool verifyFunction(const Function &F, raw_ostream *OS = nullptr);
+LLVM_FUNC_ABI bool verifyFunction(const Function &F, raw_ostream *OS = nullptr);
 
 /// Check a module for errors.
 ///
@@ -98,14 +98,14 @@ bool verifyFunction(const Function &F, raw_ostream *OS = nullptr);
 /// supplied, DebugInfo verification failures won't be considered as
 /// error and instead *BrokenDebugInfo will be set to true. Debug
 /// info errors can be "recovered" from by stripping the debug info.
-bool verifyModule(const Module &M, raw_ostream *OS = nullptr,
+LLVM_FUNC_ABI bool verifyModule(const Module &M, raw_ostream *OS = nullptr,
                   bool *BrokenDebugInfo = nullptr);
 
-FunctionPass *createVerifierPass(bool FatalErrors = true);
+LLVM_FUNC_ABI FunctionPass *createVerifierPass(bool FatalErrors = true);
 
 /// Check a module for errors, and report separate error states for IR
 /// and debug info errors.
-class VerifierAnalysis : public AnalysisInfoMixin<VerifierAnalysis> {
+class LLVM_CLASS_ABI VerifierAnalysis : public AnalysisInfoMixin<VerifierAnalysis> {
   friend AnalysisInfoMixin<VerifierAnalysis>;
 
   static AnalysisKey Key;
@@ -130,7 +130,7 @@ class VerifierAnalysis : public AnalysisInfoMixin<VerifierAnalysis> {
 ///
 /// Note that this creates a pass suitable for the legacy pass manager. It has
 /// nothing to do with \c VerifierPass.
-class VerifierPass : public PassInfoMixin<VerifierPass> {
+class LLVM_CLASS_ABI VerifierPass : public PassInfoMixin<VerifierPass> {
   bool FatalErrors;
 
 public:
diff --git a/llvm/include/llvm/IRPrinter/IRPrintingPasses.h b/llvm/include/llvm/IRPrinter/IRPrintingPasses.h
index 7db7a641887f063..51be1ef36f9816d 100644
--- a/llvm/include/llvm/IRPrinter/IRPrintingPasses.h
+++ b/llvm/include/llvm/IRPrinter/IRPrintingPasses.h
@@ -30,7 +30,7 @@ class Pass;
 
 /// Pass (for the new pass manager) for printing a Module as
 /// LLVM's text IR assembly.
-class PrintModulePass : public PassInfoMixin<PrintModulePass> {
+class LLVM_CLASS_ABI PrintModulePass : public PassInfoMixin<PrintModulePass> {
   raw_ostream &OS;
   std::string Banner;
   bool ShouldPreserveUseListOrder;
@@ -48,7 +48,7 @@ class PrintModulePass : public PassInfoMixin<PrintModulePass> {
 
 /// Pass (for the new pass manager) for printing a Function as
 /// LLVM's text IR assembly.
-class PrintFunctionPass : public PassInfoMixin<PrintFunctionPass> {
+class LLVM_CLASS_ABI PrintFunctionPass : public PassInfoMixin<PrintFunctionPass> {
   raw_ostream &OS;
   std::string Banner;
 
diff --git a/llvm/include/llvm/IRReader/IRReader.h b/llvm/include/llvm/IRReader/IRReader.h
index eaec2c0a8486721..10ce83b2cca3db7 100644
--- a/llvm/include/llvm/IRReader/IRReader.h
+++ b/llvm/include/llvm/IRReader/IRReader.h
@@ -35,7 +35,7 @@ class LLVMContext;
 /// Module. The ShouldLazyLoadMetadata flag is passed down to the bitcode
 /// reader to optionally enable lazy metadata loading. This takes ownership
 /// of \p Buffer.
-std::unique_ptr<Module> getLazyIRModule(std::unique_ptr<MemoryBuffer> Buffer,
+LLVM_FUNC_ABI std::unique_ptr<Module> getLazyIRModule(std::unique_ptr<MemoryBuffer> Buffer,
                                         SMDiagnostic &Err, LLVMContext &Context,
                                         bool ShouldLazyLoadMetadata = false);
 
@@ -44,7 +44,7 @@ std::unique_ptr<Module> getLazyIRModule(std::unique_ptr<MemoryBuffer> Buffer,
 /// attempt to parse it as LLVM Assembly and return a fully populated
 /// Module. The ShouldLazyLoadMetadata flag is passed down to the bitcode
 /// reader to optionally enable lazy metadata loading.
-std::unique_ptr<Module>
+LLVM_FUNC_ABI std::unique_ptr<Module>
 getLazyIRFileModule(StringRef Filename, SMDiagnostic &Err, LLVMContext &Context,
                     bool ShouldLazyLoadMetadata = false);
 
@@ -52,7 +52,7 @@ getLazyIRFileModule(StringRef Filename, SMDiagnostic &Err, LLVMContext &Context,
 /// for it.  Otherwise, attempt to parse it as LLVM Assembly and return
 /// a Module for it.
 /// \param DataLayoutCallback Override datalayout in the llvm assembly.
-std::unique_ptr<Module> parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err,
+LLVM_FUNC_ABI std::unique_ptr<Module> parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err,
                                 LLVMContext &Context,
                                 ParserCallbacks Callbacks = {});
 
@@ -60,7 +60,7 @@ std::unique_ptr<Module> parseIR(MemoryBufferRef Buffer, SMDiagnostic &Err,
 /// Otherwise, attempt to parse it as LLVM Assembly and return a Module
 /// for it.
 /// \param DataLayoutCallback Override datalayout in the llvm assembly.
-std::unique_ptr<Module> parseIRFile(StringRef Filename, SMDiagnostic &Err,
+LLVM_FUNC_ABI std::unique_ptr<Module> parseIRFile(StringRef Filename, SMDiagnostic &Err,
                                     LLVMContext &Context,
                                     ParserCallbacks Callbacks = {});
 }
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index a8352ab71f12bed..256cd04937bbe44 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -21,327 +21,327 @@ namespace llvm {
 class PassRegistry;
 
 /// Initialize all passes linked into the Core library.
-void initializeCore(PassRegistry&);
+LLVM_FUNC_ABI void initializeCore(PassRegistry&);
 
 /// Initialize all passes linked into the TransformUtils library.
-void initializeTransformUtils(PassRegistry&);
+LLVM_FUNC_ABI void initializeTransformUtils(PassRegistry&);
 
 /// Initialize all passes linked into the ScalarOpts library.
-void initializeScalarOpts(PassRegistry&);
+LLVM_FUNC_ABI void initializeScalarOpts(PassRegistry&);
 
 /// Initialize all passes linked into the Vectorize library.
-void initializeVectorization(PassRegistry&);
+LLVM_FUNC_ABI void initializeVectorization(PassRegistry&);
 
 /// Initialize all passes linked into the InstCombine library.
-void initializeInstCombine(PassRegistry&);
+LLVM_FUNC_ABI void initializeInstCombine(PassRegistry&);
 
 /// Initialize all passes linked into the IPO library.
-void initializeIPO(PassRegistry&);
+LLVM_FUNC_ABI void initializeIPO(PassRegistry&);
 
 /// Initialize all passes linked into the Analysis library.
-void initializeAnalysis(PassRegistry&);
+LLVM_FUNC_ABI void initializeAnalysis(PassRegistry&);
 
 /// Initialize all passes linked into the CodeGen library.
-void initializeCodeGen(PassRegistry&);
+LLVM_FUNC_ABI void initializeCodeGen(PassRegistry&);
 
 /// Initialize all passes linked into the GlobalISel library.
-void initializeGlobalISel(PassRegistry&);
+LLVM_FUNC_ABI void initializeGlobalISel(PassRegistry&);
 
 /// Initialize all passes linked into the CodeGen library.
-void initializeTarget(PassRegistry&);
+LLVM_FUNC_ABI void initializeTarget(PassRegistry&);
 
-void initializeAAEvalLegacyPassPass(PassRegistry&);
-void initializeAAResultsWrapperPassPass(PassRegistry&);
-void initializeAlwaysInlinerLegacyPassPass(PassRegistry&);
-void initializeAssignmentTrackingAnalysisPass(PassRegistry &);
-void initializeAssumeBuilderPassLegacyPassPass(PassRegistry &);
-void initializeAssumptionCacheTrackerPass(PassRegistry&);
-void initializeAtomicExpandPass(PassRegistry&);
-void initializeBasicBlockSectionsProfileReaderPass(PassRegistry &);
-void initializeBasicBlockSectionsPass(PassRegistry &);
-void initializeBarrierNoopPass(PassRegistry&);
-void initializeBasicAAWrapperPassPass(PassRegistry&);
-void initializeBlockFrequencyInfoWrapperPassPass(PassRegistry&);
-void initializeBranchFolderPassPass(PassRegistry&);
-void initializeBranchProbabilityInfoWrapperPassPass(PassRegistry&);
-void initializeBranchRelaxationPass(PassRegistry&);
-void initializeBreakCriticalEdgesPass(PassRegistry&);
-void initializeBreakFalseDepsPass(PassRegistry&);
-void initializeCanonicalizeFreezeInLoopsPass(PassRegistry &);
-void initializeCFGOnlyPrinterLegacyPassPass(PassRegistry&);
-void initializeCFGOnlyViewerLegacyPassPass(PassRegistry&);
-void initializeCFGPrinterLegacyPassPass(PassRegistry&);
-void initializeCFGSimplifyPassPass(PassRegistry&);
-void initializeCFGuardPass(PassRegistry&);
-void initializeCFGuardLongjmpPass(PassRegistry&);
-void initializeCFGViewerLegacyPassPass(PassRegistry&);
-void initializeCFIFixupPass(PassRegistry&);
-void initializeCFIInstrInserterPass(PassRegistry&);
-void initializeCallBrPreparePass(PassRegistry &);
-void initializeCallGraphDOTPrinterPass(PassRegistry&);
-void initializeCallGraphPrinterLegacyPassPass(PassRegistry&);
-void initializeCallGraphViewerPass(PassRegistry&);
-void initializeCallGraphWrapperPassPass(PassRegistry&);
-void initializeCheckDebugMachineModulePass(PassRegistry &);
-void initializeCodeGenPreparePass(PassRegistry&);
-void initializeComplexDeinterleavingLegacyPassPass(PassRegistry&);
-void initializeConstantHoistingLegacyPassPass(PassRegistry&);
-void initializeCostModelAnalysisPass(PassRegistry&);
-void initializeCycleInfoWrapperPassPass(PassRegistry &);
-void initializeDAEPass(PassRegistry&);
-void initializeDAHPass(PassRegistry&);
-void initializeDCELegacyPassPass(PassRegistry&);
-void initializeDeadMachineInstructionElimPass(PassRegistry&);
-void initializeDebugifyMachineModulePass(PassRegistry &);
-void initializeDelinearizationPass(PassRegistry&);
-void initializeDependenceAnalysisWrapperPassPass(PassRegistry&);
-void initializeDetectDeadLanesPass(PassRegistry&);
-void initializeDomOnlyPrinterWrapperPassPass(PassRegistry &);
-void initializeDomOnlyViewerWrapperPassPass(PassRegistry &);
-void initializeDomPrinterWrapperPassPass(PassRegistry &);
-void initializeDomViewerWrapperPassPass(PassRegistry &);
-void initializeDominanceFrontierWrapperPassPass(PassRegistry&);
-void initializeDominatorTreeWrapperPassPass(PassRegistry&);
-void initializeDwarfEHPrepareLegacyPassPass(PassRegistry &);
-void initializeEarlyCSELegacyPassPass(PassRegistry&);
-void initializeEarlyCSEMemSSALegacyPassPass(PassRegistry&);
-void initializeEarlyIfConverterPass(PassRegistry&);
-void initializeEarlyIfPredicatorPass(PassRegistry &);
-void initializeEarlyMachineLICMPass(PassRegistry&);
-void initializeEarlyTailDuplicatePass(PassRegistry&);
-void initializeEdgeBundlesPass(PassRegistry&);
-void initializeEHContGuardCatchretPass(PassRegistry &);
-void initializeExpandLargeFpConvertLegacyPassPass(PassRegistry&);
-void initializeExpandLargeDivRemLegacyPassPass(PassRegistry&);
-void initializeExpandMemCmpPassPass(PassRegistry&);
-void initializeExpandPostRAPass(PassRegistry&);
-void initializeExpandReductionsPass(PassRegistry&);
-void initializeExpandVectorPredicationPass(PassRegistry &);
-void initializeMakeGuardsExplicitLegacyPassPass(PassRegistry&);
-void initializeExternalAAWrapperPassPass(PassRegistry&);
-void initializeFEntryInserterPass(PassRegistry&);
-void initializeFinalizeISelPass(PassRegistry&);
-void initializeFinalizeMachineBundlesPass(PassRegistry&);
-void initializeFixIrreduciblePass(PassRegistry &);
-void initializeFixupStatepointCallerSavedPass(PassRegistry&);
-void initializeFlattenCFGLegacyPassPass(PassRegistry &);
-void initializeFuncletLayoutPass(PassRegistry&);
-void initializeGCMachineCodeAnalysisPass(PassRegistry&);
-void initializeGCModuleInfoPass(PassRegistry&);
-void initializeGVNLegacyPassPass(PassRegistry&);
-void initializeGlobalMergePass(PassRegistry&);
-void initializeGlobalsAAWrapperPassPass(PassRegistry&);
-void initializeGuardWideningLegacyPassPass(PassRegistry&);
-void initializeHardwareLoopsLegacyPass(PassRegistry&);
-void initializeMIRProfileLoaderPassPass(PassRegistry &);
-void initializeIRSimilarityIdentifierWrapperPassPass(PassRegistry&);
-void initializeIRTranslatorPass(PassRegistry&);
-void initializeIVUsersWrapperPassPass(PassRegistry&);
-void initializeIfConverterPass(PassRegistry&);
-void initializeImmutableModuleSummaryIndexWrapperPassPass(PassRegistry&);
-void initializeImplicitNullChecksPass(PassRegistry&);
-void initializeIndirectBrExpandPassPass(PassRegistry&);
-void initializeInferAddressSpacesPass(PassRegistry&);
-void initializeInstCountLegacyPassPass(PassRegistry &);
-void initializeInstSimplifyLegacyPassPass(PassRegistry &);
-void initializeInstructionCombiningPassPass(PassRegistry&);
-void initializeInstructionSelectPass(PassRegistry&);
-void initializeInterleavedAccessPass(PassRegistry&);
-void initializeInterleavedLoadCombinePass(PassRegistry &);
-void initializeIntervalPartitionPass(PassRegistry&);
-void initializeJMCInstrumenterPass(PassRegistry&);
-void initializeKCFIPass(PassRegistry &);
-void initializeLCSSAVerificationPassPass(PassRegistry&);
-void initializeLCSSAWrapperPassPass(PassRegistry&);
-void initializeLazyBlockFrequencyInfoPassPass(PassRegistry&);
-void initializeLazyBranchProbabilityInfoPassPass(PassRegistry&);
-void initializeLazyMachineBlockFrequencyInfoPassPass(PassRegistry&);
-void initializeLazyValueInfoPrinterPass(PassRegistry&);
-void initializeLazyValueInfoWrapperPassPass(PassRegistry&);
-void initializeLegacyLICMPassPass(PassRegistry&);
-void initializeLegacyLoopSinkPassPass(PassRegistry&);
-void initializeLegalizerPass(PassRegistry&);
-void initializeGISelCSEAnalysisWrapperPassPass(PassRegistry &);
-void initializeGISelKnownBitsAnalysisPass(PassRegistry &);
-void initializeLiveDebugValuesPass(PassRegistry&);
-void initializeLiveDebugVariablesPass(PassRegistry&);
-void initializeLiveIntervalsPass(PassRegistry&);
-void initializeLiveRangeShrinkPass(PassRegistry&);
-void initializeLiveRegMatrixPass(PassRegistry&);
-void initializeLiveStacksPass(PassRegistry&);
-void initializeLiveVariablesPass(PassRegistry &);
-void initializeLoadStoreOptPass(PassRegistry &);
-void initializeLoadStoreVectorizerLegacyPassPass(PassRegistry&);
-void initializeLocalStackSlotPassPass(PassRegistry&);
-void initializeLocalizerPass(PassRegistry&);
-void initializeLoopDataPrefetchLegacyPassPass(PassRegistry&);
-void initializeLoopExtractorLegacyPassPass(PassRegistry &);
-void initializeLoopGuardWideningLegacyPassPass(PassRegistry&);
-void initializeLoopInfoWrapperPassPass(PassRegistry&);
-void initializeLoopInstSimplifyLegacyPassPass(PassRegistry&);
-void initializeLoopPassPass(PassRegistry&);
-void initializeLoopPredicationLegacyPassPass(PassRegistry&);
-void initializeLoopRotateLegacyPassPass(PassRegistry&);
-void initializeLoopSimplifyCFGLegacyPassPass(PassRegistry&);
-void initializeLoopSimplifyPass(PassRegistry&);
-void initializeLoopStrengthReducePass(PassRegistry&);
-void initializeLoopUnrollPass(PassRegistry&);
-void initializeLowerAtomicLegacyPassPass(PassRegistry&);
-void initializeLowerConstantIntrinsicsPass(PassRegistry&);
-void initializeLowerEmuTLSPass(PassRegistry&);
-void initializeLowerExpectIntrinsicPass(PassRegistry&);
-void initializeLowerGlobalDtorsLegacyPassPass(PassRegistry &);
-void initializeLowerGuardIntrinsicLegacyPassPass(PassRegistry&);
-void initializeLowerWidenableConditionLegacyPassPass(PassRegistry&);
-void initializeLowerIntrinsicsPass(PassRegistry&);
-void initializeLowerInvokeLegacyPassPass(PassRegistry&);
-void initializeLowerSwitchLegacyPassPass(PassRegistry &);
-void initializeKCFIPass(PassRegistry &);
-void initializeMIRAddFSDiscriminatorsPass(PassRegistry &);
-void initializeMIRCanonicalizerPass(PassRegistry &);
-void initializeMIRNamerPass(PassRegistry &);
-void initializeMIRPrintingPassPass(PassRegistry&);
-void initializeMachineBlockFrequencyInfoPass(PassRegistry&);
-void initializeMachineBlockPlacementPass(PassRegistry&);
-void initializeMachineBlockPlacementStatsPass(PassRegistry&);
-void initializeMachineBranchProbabilityInfoPass(PassRegistry&);
-void initializeMachineCFGPrinterPass(PassRegistry &);
-void initializeMachineCSEPass(PassRegistry&);
-void initializeMachineCombinerPass(PassRegistry&);
-void initializeMachineCopyPropagationPass(PassRegistry&);
-void initializeMachineCycleInfoPrinterPassPass(PassRegistry &);
-void initializeMachineCycleInfoWrapperPassPass(PassRegistry &);
-void initializeMachineDominanceFrontierPass(PassRegistry&);
-void initializeMachineDominatorTreePass(PassRegistry&);
-void initializeMachineFunctionPrinterPassPass(PassRegistry&);
-void initializeMachineFunctionSplitterPass(PassRegistry &);
-void initializeMachineLateInstrsCleanupPass(PassRegistry&);
-void initializeMachineLICMPass(PassRegistry&);
-void initializeMachineLoopInfoPass(PassRegistry&);
-void initializeMachineModuleInfoWrapperPassPass(PassRegistry &);
-void initializeMachineOptimizationRemarkEmitterPassPass(PassRegistry&);
-void initializeMachineOutlinerPass(PassRegistry&);
-void initializeMachinePipelinerPass(PassRegistry&);
-void initializeMachinePostDominatorTreePass(PassRegistry&);
-void initializeMachineRegionInfoPassPass(PassRegistry&);
-void initializeMachineSanitizerBinaryMetadataPass(PassRegistry &);
-void initializeMachineSchedulerPass(PassRegistry&);
-void initializeMachineSinkingPass(PassRegistry&);
-void initializeMachineTraceMetricsPass(PassRegistry&);
-void initializeMachineUniformityInfoPrinterPassPass(PassRegistry &);
-void initializeMachineUniformityAnalysisPassPass(PassRegistry &);
-void initializeMachineVerifierPassPass(PassRegistry&);
-void initializeMemoryDependenceWrapperPassPass(PassRegistry&);
-void initializeMemorySSAWrapperPassPass(PassRegistry&);
-void initializeMergeICmpsLegacyPassPass(PassRegistry &);
-void initializeMergedLoadStoreMotionLegacyPassPass(PassRegistry&);
-void initializeModuleSummaryIndexWrapperPassPass(PassRegistry&);
-void initializeModuloScheduleTestPass(PassRegistry&);
-void initializeNaryReassociateLegacyPassPass(PassRegistry&);
-void initializeObjCARCContractLegacyPassPass(PassRegistry &);
-void initializeOptimizationRemarkEmitterWrapperPassPass(PassRegistry&);
-void initializeOptimizePHIsPass(PassRegistry&);
-void initializePEIPass(PassRegistry&);
-void initializePHIEliminationPass(PassRegistry&);
-void initializePartiallyInlineLibCallsLegacyPassPass(PassRegistry&);
-void initializePatchableFunctionPass(PassRegistry&);
-void initializePeepholeOptimizerPass(PassRegistry&);
-void initializePhiValuesWrapperPassPass(PassRegistry&);
-void initializePhysicalRegisterUsageInfoPass(PassRegistry&);
-void initializePlaceBackedgeSafepointsLegacyPassPass(PassRegistry &);
-void initializePostDomOnlyPrinterWrapperPassPass(PassRegistry &);
-void initializePostDomOnlyViewerWrapperPassPass(PassRegistry &);
-void initializePostDomPrinterWrapperPassPass(PassRegistry &);
-void initializePostDomViewerWrapperPassPass(PassRegistry &);
-void initializePostDominatorTreeWrapperPassPass(PassRegistry&);
-void initializePostMachineSchedulerPass(PassRegistry&);
-void initializePostRAHazardRecognizerPass(PassRegistry&);
-void initializePostRAMachineSinkingPass(PassRegistry&);
-void initializePostRASchedulerPass(PassRegistry&);
-void initializePreISelIntrinsicLoweringLegacyPassPass(PassRegistry&);
-void initializePredicateInfoPrinterLegacyPassPass(PassRegistry&);
-void initializePrintFunctionPassWrapperPass(PassRegistry&);
-void initializePrintModulePassWrapperPass(PassRegistry&);
-void initializeProcessImplicitDefsPass(PassRegistry&);
-void initializeProfileSummaryInfoWrapperPassPass(PassRegistry&);
-void initializePromoteLegacyPassPass(PassRegistry&);
-void initializeRABasicPass(PassRegistry&);
-void initializePseudoProbeInserterPass(PassRegistry &);
-void initializeRAGreedyPass(PassRegistry&);
-void initializeReachingDefAnalysisPass(PassRegistry&);
-void initializeReassociateLegacyPassPass(PassRegistry&);
-void initializeRedundantDbgInstEliminationPass(PassRegistry&);
-void initializeRegAllocEvictionAdvisorAnalysisPass(PassRegistry &);
-void initializeRegAllocFastPass(PassRegistry&);
-void initializeRegAllocPriorityAdvisorAnalysisPass(PassRegistry &);
-void initializeRegAllocScoringPass(PassRegistry &);
-void initializeRegBankSelectPass(PassRegistry&);
-void initializeRegToMemLegacyPass(PassRegistry&);
-void initializeRegUsageInfoCollectorPass(PassRegistry&);
-void initializeRegUsageInfoPropagationPass(PassRegistry&);
-void initializeRegionInfoPassPass(PassRegistry&);
-void initializeRegionOnlyPrinterPass(PassRegistry&);
-void initializeRegionOnlyViewerPass(PassRegistry&);
-void initializeRegionPrinterPass(PassRegistry&);
-void initializeRegionViewerPass(PassRegistry&);
-void initializeRegisterCoalescerPass(PassRegistry&);
-void initializeRemoveRedundantDebugValuesPass(PassRegistry&);
-void initializeRenameIndependentSubregsPass(PassRegistry&);
-void initializeReplaceWithVeclibLegacyPass(PassRegistry &);
-void initializeResetMachineFunctionPass(PassRegistry&);
-void initializeSCEVAAWrapperPassPass(PassRegistry&);
-void initializeSROALegacyPassPass(PassRegistry&);
-void initializeSafeStackLegacyPassPass(PassRegistry&);
-void initializeSafepointIRVerifierPass(PassRegistry&);
-void initializeSelectOptimizePass(PassRegistry &);
-void initializeScalarEvolutionWrapperPassPass(PassRegistry&);
-void initializeScalarizeMaskedMemIntrinLegacyPassPass(PassRegistry &);
-void initializeScalarizerLegacyPassPass(PassRegistry&);
-void initializeScavengerTestPass(PassRegistry&);
-void initializeScopedNoAliasAAWrapperPassPass(PassRegistry&);
-void initializeSeparateConstOffsetFromGEPLegacyPassPass(PassRegistry &);
-void initializeShadowStackGCLoweringPass(PassRegistry&);
-void initializeShrinkWrapPass(PassRegistry&);
-void initializeSimpleLoopUnswitchLegacyPassPass(PassRegistry&);
-void initializeSingleLoopExtractorPass(PassRegistry&);
-void initializeSinkingLegacyPassPass(PassRegistry&);
-void initializeSjLjEHPreparePass(PassRegistry&);
-void initializeSlotIndexesPass(PassRegistry&);
-void initializeSpeculativeExecutionLegacyPassPass(PassRegistry&);
-void initializeSpillPlacementPass(PassRegistry&);
-void initializeStackColoringPass(PassRegistry&);
-void initializeStackFrameLayoutAnalysisPassPass(PassRegistry &);
-void initializeStackMapLivenessPass(PassRegistry&);
-void initializeStackProtectorPass(PassRegistry&);
-void initializeStackSafetyGlobalInfoWrapperPassPass(PassRegistry &);
-void initializeStackSafetyInfoWrapperPassPass(PassRegistry &);
-void initializeStackSlotColoringPass(PassRegistry&);
-void initializeStraightLineStrengthReduceLegacyPassPass(PassRegistry &);
-void initializeStripDebugMachineModulePass(PassRegistry &);
-void initializeStripGCRelocatesLegacyPass(PassRegistry &);
-void initializeStructurizeCFGLegacyPassPass(PassRegistry &);
-void initializeTailCallElimPass(PassRegistry&);
-void initializeTailDuplicatePass(PassRegistry&);
-void initializeTargetLibraryInfoWrapperPassPass(PassRegistry&);
-void initializeTargetPassConfigPass(PassRegistry&);
-void initializeTargetTransformInfoWrapperPassPass(PassRegistry&);
-void initializeTLSVariableHoistLegacyPassPass(PassRegistry &);
-void initializeTwoAddressInstructionPassPass(PassRegistry&);
-void initializeTypeBasedAAWrapperPassPass(PassRegistry&);
-void initializeTypePromotionLegacyPass(PassRegistry&);
-void initializeUniformityInfoWrapperPassPass(PassRegistry &);
-void initializeUnifyFunctionExitNodesLegacyPassPass(PassRegistry &);
-void initializeUnifyLoopExitsLegacyPassPass(PassRegistry &);
-void initializeUnpackMachineBundlesPass(PassRegistry&);
-void initializeUnreachableBlockElimLegacyPassPass(PassRegistry&);
-void initializeUnreachableMachineBlockElimPass(PassRegistry&);
-void initializeVerifierLegacyPassPass(PassRegistry&);
-void initializeVirtRegMapPass(PassRegistry&);
-void initializeVirtRegRewriterPass(PassRegistry&);
-void initializeWasmEHPreparePass(PassRegistry&);
-void initializeWinEHPreparePass(PassRegistry&);
-void initializeWriteBitcodePassPass(PassRegistry&);
-void initializeXRayInstrumentationPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeAAEvalLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeAAResultsWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeAlwaysInlinerLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeAssignmentTrackingAnalysisPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeAssumeBuilderPassLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeAssumptionCacheTrackerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeAtomicExpandPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeBasicBlockSectionsProfileReaderPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeBasicBlockSectionsPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeBarrierNoopPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeBasicAAWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeBlockFrequencyInfoWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeBranchFolderPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeBranchProbabilityInfoWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeBranchRelaxationPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeBreakCriticalEdgesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeBreakFalseDepsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCanonicalizeFreezeInLoopsPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeCFGOnlyPrinterLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCFGOnlyViewerLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCFGPrinterLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCFGSimplifyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCFGuardPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCFGuardLongjmpPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCFGViewerLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCFIFixupPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCFIInstrInserterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCallBrPreparePass(PassRegistry &);
+LLVM_FUNC_ABI void initializeCallGraphDOTPrinterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCallGraphPrinterLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCallGraphViewerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCallGraphWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCheckDebugMachineModulePass(PassRegistry &);
+LLVM_FUNC_ABI void initializeCodeGenPreparePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeComplexDeinterleavingLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeConstantHoistingLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCostModelAnalysisPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeCycleInfoWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeDAEPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDAHPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDCELegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDeadMachineInstructionElimPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDebugifyMachineModulePass(PassRegistry &);
+LLVM_FUNC_ABI void initializeDelinearizationPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDependenceAnalysisWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDetectDeadLanesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDomOnlyPrinterWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeDomOnlyViewerWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeDomPrinterWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeDomViewerWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeDominanceFrontierWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDominatorTreeWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeDwarfEHPrepareLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeEarlyCSELegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeEarlyCSEMemSSALegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeEarlyIfConverterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeEarlyIfPredicatorPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeEarlyMachineLICMPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeEarlyTailDuplicatePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeEdgeBundlesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeEHContGuardCatchretPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeExpandLargeFpConvertLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeExpandLargeDivRemLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeExpandMemCmpPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeExpandPostRAPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeExpandReductionsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeExpandVectorPredicationPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMakeGuardsExplicitLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeExternalAAWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeFEntryInserterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeFinalizeISelPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeFinalizeMachineBundlesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeFixIrreduciblePass(PassRegistry &);
+LLVM_FUNC_ABI void initializeFixupStatepointCallerSavedPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeFlattenCFGLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeFuncletLayoutPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeGCMachineCodeAnalysisPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeGCModuleInfoPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeGVNLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeGlobalMergePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeGlobalsAAWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeGuardWideningLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeHardwareLoopsLegacyPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMIRProfileLoaderPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeIRSimilarityIdentifierWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeIRTranslatorPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeIVUsersWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeIfConverterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeImmutableModuleSummaryIndexWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeImplicitNullChecksPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeIndirectBrExpandPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeInferAddressSpacesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeInstCountLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeInstSimplifyLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeInstructionCombiningPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeInstructionSelectPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeInterleavedAccessPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeInterleavedLoadCombinePass(PassRegistry &);
+LLVM_FUNC_ABI void initializeIntervalPartitionPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeJMCInstrumenterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeKCFIPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeLCSSAVerificationPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLCSSAWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLazyBlockFrequencyInfoPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLazyBranchProbabilityInfoPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLazyMachineBlockFrequencyInfoPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLazyValueInfoPrinterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLazyValueInfoWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLegacyLICMPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLegacyLoopSinkPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLegalizerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeGISelCSEAnalysisWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeGISelKnownBitsAnalysisPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeLiveDebugValuesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLiveDebugVariablesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLiveIntervalsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLiveRangeShrinkPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLiveRegMatrixPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLiveStacksPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLiveVariablesPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeLoadStoreOptPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeLoadStoreVectorizerLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLocalStackSlotPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLocalizerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopDataPrefetchLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopExtractorLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeLoopGuardWideningLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopInfoWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopInstSimplifyLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopPredicationLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopRotateLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopSimplifyCFGLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopSimplifyPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopStrengthReducePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLoopUnrollPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerAtomicLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerConstantIntrinsicsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerEmuTLSPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerExpectIntrinsicPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerGlobalDtorsLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeLowerGuardIntrinsicLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerWidenableConditionLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerIntrinsicsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerInvokeLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeLowerSwitchLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeKCFIPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMIRAddFSDiscriminatorsPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMIRCanonicalizerPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMIRNamerPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMIRPrintingPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineBlockFrequencyInfoPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineBlockPlacementPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineBlockPlacementStatsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineBranchProbabilityInfoPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineCFGPrinterPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMachineCSEPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineCombinerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineCopyPropagationPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineCycleInfoPrinterPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMachineCycleInfoWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMachineDominanceFrontierPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineDominatorTreePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineFunctionPrinterPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineFunctionSplitterPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMachineLateInstrsCleanupPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineLICMPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineLoopInfoPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineModuleInfoWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMachineOptimizationRemarkEmitterPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineOutlinerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachinePipelinerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachinePostDominatorTreePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineRegionInfoPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineSanitizerBinaryMetadataPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMachineSchedulerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineSinkingPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineTraceMetricsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMachineUniformityInfoPrinterPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMachineUniformityAnalysisPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMachineVerifierPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMemoryDependenceWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMemorySSAWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeMergeICmpsLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeMergedLoadStoreMotionLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeModuleSummaryIndexWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeModuloScheduleTestPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeNaryReassociateLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeObjCARCContractLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeOptimizationRemarkEmitterWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeOptimizePHIsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePEIPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePHIEliminationPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePartiallyInlineLibCallsLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePatchableFunctionPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePeepholeOptimizerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePhiValuesWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePhysicalRegisterUsageInfoPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePlaceBackedgeSafepointsLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializePostDomOnlyPrinterWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializePostDomOnlyViewerWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializePostDomPrinterWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializePostDomViewerWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializePostDominatorTreeWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePostMachineSchedulerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePostRAHazardRecognizerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePostRAMachineSinkingPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePostRASchedulerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePreISelIntrinsicLoweringLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePredicateInfoPrinterLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePrintFunctionPassWrapperPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePrintModulePassWrapperPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeProcessImplicitDefsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeProfileSummaryInfoWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePromoteLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRABasicPass(PassRegistry&);
+LLVM_FUNC_ABI void initializePseudoProbeInserterPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeRAGreedyPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeReachingDefAnalysisPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeReassociateLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRedundantDbgInstEliminationPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegAllocEvictionAdvisorAnalysisPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeRegAllocFastPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegAllocPriorityAdvisorAnalysisPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeRegAllocScoringPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeRegBankSelectPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegToMemLegacyPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegUsageInfoCollectorPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegUsageInfoPropagationPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegionInfoPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegionOnlyPrinterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegionOnlyViewerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegionPrinterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegionViewerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRegisterCoalescerPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRemoveRedundantDebugValuesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeRenameIndependentSubregsPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeReplaceWithVeclibLegacyPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeResetMachineFunctionPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSCEVAAWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSROALegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSafeStackLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSafepointIRVerifierPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSelectOptimizePass(PassRegistry &);
+LLVM_FUNC_ABI void initializeScalarEvolutionWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeScalarizeMaskedMemIntrinLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeScalarizerLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeScavengerTestPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeScopedNoAliasAAWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSeparateConstOffsetFromGEPLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeShadowStackGCLoweringPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeShrinkWrapPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSimpleLoopUnswitchLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSingleLoopExtractorPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSinkingLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSjLjEHPreparePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSlotIndexesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSpeculativeExecutionLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeSpillPlacementPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeStackColoringPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeStackFrameLayoutAnalysisPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeStackMapLivenessPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeStackProtectorPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeStackSafetyGlobalInfoWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeStackSafetyInfoWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeStackSlotColoringPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeStraightLineStrengthReduceLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeStripDebugMachineModulePass(PassRegistry &);
+LLVM_FUNC_ABI void initializeStripGCRelocatesLegacyPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeStructurizeCFGLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeTailCallElimPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeTailDuplicatePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeTargetLibraryInfoWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeTargetPassConfigPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeTargetTransformInfoWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeTLSVariableHoistLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeTwoAddressInstructionPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeTypeBasedAAWrapperPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeTypePromotionLegacyPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeUniformityInfoWrapperPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeUnifyFunctionExitNodesLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeUnifyLoopExitsLegacyPassPass(PassRegistry &);
+LLVM_FUNC_ABI void initializeUnpackMachineBundlesPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeUnreachableBlockElimLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeUnreachableMachineBlockElimPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeVerifierLegacyPassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeVirtRegMapPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeVirtRegRewriterPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeWasmEHPreparePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeWinEHPreparePass(PassRegistry&);
+LLVM_FUNC_ABI void initializeWriteBitcodePassPass(PassRegistry&);
+LLVM_FUNC_ABI void initializeXRayInstrumentationPass(PassRegistry&);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/InterfaceStub/ELFObjHandler.h b/llvm/include/llvm/InterfaceStub/ELFObjHandler.h
index 2ef0218a681b08b..07198dcdd572756 100644
--- a/llvm/include/llvm/InterfaceStub/ELFObjHandler.h
+++ b/llvm/include/llvm/InterfaceStub/ELFObjHandler.h
@@ -25,7 +25,7 @@ namespace ifs {
 struct IFSStub;
 
 /// Attempt to read a binary ELF file from a MemoryBuffer.
-Expected<std::unique_ptr<IFSStub>> readELFFile(MemoryBufferRef Buf);
+LLVM_FUNC_ABI Expected<std::unique_ptr<IFSStub>> readELFFile(MemoryBufferRef Buf);
 
 /// Attempt to write a binary ELF stub.
 /// This function determines appropriate ELFType using the passed ELFTarget and
@@ -35,7 +35,7 @@ Expected<std::unique_ptr<IFSStub>> readELFFile(MemoryBufferRef Buf);
 /// @param Stub Source ELFStub to generate a binary ELF stub from.
 /// @param WriteIfChanged Whether or not to preserve timestamp if
 ///        the output stays the same.
-Error writeBinaryStub(StringRef FilePath, const IFSStub &Stub,
+LLVM_FUNC_ABI Error writeBinaryStub(StringRef FilePath, const IFSStub &Stub,
                       bool WriteIfChanged = false);
 
 } // end namespace ifs
diff --git a/llvm/include/llvm/InterfaceStub/IFSHandler.h b/llvm/include/llvm/InterfaceStub/IFSHandler.h
index faa3709dc556a53..5c3b50d3a9e1be1 100644
--- a/llvm/include/llvm/InterfaceStub/IFSHandler.h
+++ b/llvm/include/llvm/InterfaceStub/IFSHandler.h
@@ -37,29 +37,29 @@ struct IFSStub;
 const VersionTuple IFSVersionCurrent(3, 0);
 
 /// Attempts to read an IFS interface file from a StringRef buffer.
-Expected<std::unique_ptr<IFSStub>> readIFSFromBuffer(StringRef Buf);
+LLVM_FUNC_ABI Expected<std::unique_ptr<IFSStub>> readIFSFromBuffer(StringRef Buf);
 
 /// Attempts to write an IFS interface file to a raw_ostream.
-Error writeIFSToOutputStream(raw_ostream &OS, const IFSStub &Stub);
+LLVM_FUNC_ABI Error writeIFSToOutputStream(raw_ostream &OS, const IFSStub &Stub);
 
 /// Override the target platform inforation in the text stub.
-Error overrideIFSTarget(IFSStub &Stub, std::optional<IFSArch> OverrideArch,
+LLVM_FUNC_ABI Error overrideIFSTarget(IFSStub &Stub, std::optional<IFSArch> OverrideArch,
                         std::optional<IFSEndiannessType> OverrideEndianness,
                         std::optional<IFSBitWidthType> OverrideBitWidth,
                         std::optional<std::string> OverrideTriple);
 
 /// Validate the target platform inforation in the text stub.
-Error validateIFSTarget(IFSStub &Stub, bool ParseTriple);
+LLVM_FUNC_ABI Error validateIFSTarget(IFSStub &Stub, bool ParseTriple);
 
 /// Strips target platform information from the text stub.
-void stripIFSTarget(IFSStub &Stub, bool StripTriple, bool StripArch,
+LLVM_FUNC_ABI void stripIFSTarget(IFSStub &Stub, bool StripTriple, bool StripArch,
                     bool StripEndianness, bool StripBitWidth);
 
-Error filterIFSSyms(IFSStub &Stub, bool StripUndefined,
+LLVM_FUNC_ABI Error filterIFSSyms(IFSStub &Stub, bool StripUndefined,
                     const std::vector<std::string> &Exclude = {});
 
 /// Parse llvm triple string into a IFSTarget struct.
-IFSTarget parseTriple(StringRef TripleStr);
+LLVM_FUNC_ABI IFSTarget parseTriple(StringRef TripleStr);
 
 } // end namespace ifs
 } // end namespace llvm
diff --git a/llvm/include/llvm/InterfaceStub/IFSStub.h b/llvm/include/llvm/InterfaceStub/IFSStub.h
index 03354f5d50c44f4..981a6a273ae482f 100644
--- a/llvm/include/llvm/InterfaceStub/IFSStub.h
+++ b/llvm/include/llvm/InterfaceStub/IFSStub.h
@@ -50,7 +50,7 @@ enum class IFSBitWidthType {
   Unknown = 256,
 };
 
-struct IFSSymbol {
+struct LLVM_CLASS_ABI IFSSymbol {
   IFSSymbol() = default;
   explicit IFSSymbol(std::string SymbolName) : Name(std::move(SymbolName)) {}
   std::string Name;
@@ -62,7 +62,7 @@ struct IFSSymbol {
   bool operator<(const IFSSymbol &RHS) const { return Name < RHS.Name; }
 };
 
-struct IFSTarget {
+struct LLVM_CLASS_ABI IFSTarget {
   std::optional<std::string> Triple;
   std::optional<std::string> ObjectFormat;
   std::optional<IFSArch> Arch;
@@ -87,7 +87,7 @@ inline bool operator!=(const IFSTarget &Lhs, const IFSTarget &Rhs) {
 
 // A cumulative representation of InterFace stubs.
 // Both textual and binary stubs will read into and write from this object.
-struct IFSStub {
+struct LLVM_CLASS_ABI IFSStub {
   // TODO: Add support for symbol versioning.
   VersionTuple IfsVersion;
   std::optional<std::string> SoName;
@@ -106,7 +106,7 @@ struct IFSStub {
 // which prevents us using 'Target:' field with different definitions.
 // This class makes it possible to map a second traits so the same data
 // structure can be used for 2 different yaml schema.
-struct IFSStubTriple : IFSStub {
+struct LLVM_CLASS_ABI IFSStubTriple : IFSStub {
   IFSStubTriple() = default;
   IFSStubTriple(const IFSStub &Stub);
   IFSStubTriple(const IFSStubTriple &Stub);
@@ -117,33 +117,33 @@ struct IFSStubTriple : IFSStub {
 /// Currently, ELFCLASS32 and ELFCLASS64 are supported.
 ///
 /// @param BitWidth IFS bit width type.
-uint8_t convertIFSBitWidthToELF(IFSBitWidthType BitWidth);
+LLVM_FUNC_ABI uint8_t convertIFSBitWidthToELF(IFSBitWidthType BitWidth);
 
 /// This function convert endianness type from IFS enum to ELF format
 /// Currently, ELFDATA2LSB and ELFDATA2MSB are supported.
 ///
 /// @param Endianness IFS endianness type.
-uint8_t convertIFSEndiannessToELF(IFSEndiannessType Endianness);
+LLVM_FUNC_ABI uint8_t convertIFSEndiannessToELF(IFSEndiannessType Endianness);
 
 /// This function convert symbol type from IFS enum to ELF format
 /// Currently, STT_NOTYPE, STT_OBJECT, STT_FUNC, and STT_TLS are supported.
 ///
 /// @param SymbolType IFS symbol type.
-uint8_t convertIFSSymbolTypeToELF(IFSSymbolType SymbolType);
+LLVM_FUNC_ABI uint8_t convertIFSSymbolTypeToELF(IFSSymbolType SymbolType);
 
 /// This function extracts ELF bit width from e_ident[EI_CLASS] of an ELF file
 /// Currently, ELFCLASS32 and ELFCLASS64 are supported.
 /// Other endianness types are mapped to IFSBitWidthType::Unknown.
 ///
 /// @param BitWidth e_ident[EI_CLASS] value to extract bit width from.
-IFSBitWidthType convertELFBitWidthToIFS(uint8_t BitWidth);
+LLVM_FUNC_ABI IFSBitWidthType convertELFBitWidthToIFS(uint8_t BitWidth);
 
 /// This function extracts ELF endianness from e_ident[EI_DATA] of an ELF file
 /// Currently, ELFDATA2LSB and ELFDATA2MSB are supported.
 /// Other endianness types are mapped to IFSEndiannessType::Unknown.
 ///
 /// @param Endianness e_ident[EI_DATA] value to extract endianness type from.
-IFSEndiannessType convertELFEndiannessToIFS(uint8_t Endianness);
+LLVM_FUNC_ABI IFSEndiannessType convertELFEndiannessToIFS(uint8_t Endianness);
 
 /// This function extracts symbol type from a symbol's st_info member and
 /// maps it to an IFSSymbolType enum.
@@ -151,7 +151,7 @@ IFSEndiannessType convertELFEndiannessToIFS(uint8_t Endianness);
 /// Other symbol types are mapped to IFSSymbolType::Unknown.
 ///
 /// @param SymbolType Binary symbol st_info to extract symbol type from.
-IFSSymbolType convertELFSymbolTypeToIFS(uint8_t SymbolType);
+LLVM_FUNC_ABI IFSSymbolType convertELFSymbolTypeToIFS(uint8_t SymbolType);
 } // namespace ifs
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/LTO/Config.h b/llvm/include/llvm/LTO/Config.h
index 16d38ad8ad06da7..9ebbe76b545dd81 100644
--- a/llvm/include/llvm/LTO/Config.h
+++ b/llvm/include/llvm/LTO/Config.h
@@ -39,7 +39,7 @@ namespace lto {
 
 /// LTO configuration. A linker can configure LTO by setting fields in this data
 /// structure and passing it to the lto::LTO constructor.
-struct Config {
+struct LLVM_CLASS_ABI Config {
   enum VisScheme {
     FromPrevailing,
     ELF,
@@ -275,7 +275,7 @@ struct Config {
                      const DenseSet<StringRef> &SaveTempsArgs = {});
 };
 
-struct LTOLLVMDiagnosticHandler : public DiagnosticHandler {
+struct LLVM_CLASS_ABI LTOLLVMDiagnosticHandler : public DiagnosticHandler {
   DiagnosticHandlerFunction *Fn;
   LTOLLVMDiagnosticHandler(DiagnosticHandlerFunction *DiagHandlerFn)
       : Fn(DiagHandlerFn) {}
@@ -289,7 +289,7 @@ struct LTOLLVMDiagnosticHandler : public DiagnosticHandler {
 /// diagnostic handler to the context, as opposed to the Config object (which
 /// may be ephemeral).
 // FIXME: This should not be required as diagnostic handler is not callback.
-struct LTOLLVMContext : LLVMContext {
+struct LLVM_CLASS_ABI LTOLLVMContext : LLVMContext {
 
   LTOLLVMContext(const Config &C) : DiagHandler(C.DiagHandler) {
     setDiscardValueNames(C.ShouldDiscardValueNames);
diff --git a/llvm/include/llvm/LTO/LTO.h b/llvm/include/llvm/LTO/LTO.h
index e8138978f076f1a..da7af91515a5cb5 100644
--- a/llvm/include/llvm/LTO/LTO.h
+++ b/llvm/include/llvm/LTO/LTO.h
@@ -44,7 +44,7 @@ class ToolOutputFile;
 ///
 /// This is done for correctness (if value exported, ensure we always
 /// emit a copy), and compile-time optimization (allow drop of duplicates).
-void thinLTOResolvePrevailingInIndex(
+LLVM_FUNC_ABI void thinLTOResolvePrevailingInIndex(
     const lto::Config &C, ModuleSummaryIndex &Index,
     function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
         isPrevailing,
@@ -55,7 +55,7 @@ void thinLTOResolvePrevailingInIndex(
 /// Update the linkages in the given \p Index to mark exported values
 /// as external and non-exported values as internal. The ThinLTO backends
 /// must apply the changes to the Module via thinLTOInternalizeModule.
-void thinLTOInternalizeAndPromoteInIndex(
+LLVM_FUNC_ABI void thinLTOInternalizeAndPromoteInIndex(
     ModuleSummaryIndex &Index,
     function_ref<bool(StringRef, ValueInfo)> isExported,
     function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
@@ -64,7 +64,7 @@ void thinLTOInternalizeAndPromoteInIndex(
 /// Computes a unique hash for the Module considering the current list of
 /// export/import and other global analysis results.
 /// The hash is produced in \p Key.
-void computeLTOCacheKey(
+LLVM_FUNC_ABI void computeLTOCacheKey(
     SmallString<40> &Key, const lto::Config &Conf,
     const ModuleSummaryIndex &Index, StringRef ModuleID,
     const FunctionImporter::ImportMapTy &ImportList,
@@ -79,27 +79,27 @@ namespace lto {
 /// Given the original \p Path to an output file, replace any path
 /// prefix matching \p OldPrefix with \p NewPrefix. Also, create the
 /// resulting directory if it does not yet exist.
-std::string getThinLTOOutputFile(StringRef Path, StringRef OldPrefix,
+LLVM_FUNC_ABI std::string getThinLTOOutputFile(StringRef Path, StringRef OldPrefix,
                                  StringRef NewPrefix);
 
 /// Setup optimization remarks.
-Expected<std::unique_ptr<ToolOutputFile>> setupLLVMOptimizationRemarks(
+LLVM_FUNC_ABI Expected<std::unique_ptr<ToolOutputFile>> setupLLVMOptimizationRemarks(
     LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses,
     StringRef RemarksFormat, bool RemarksWithHotness,
     std::optional<uint64_t> RemarksHotnessThreshold = 0, int Count = -1);
 
 /// Setups the output file for saving statistics.
-Expected<std::unique_ptr<ToolOutputFile>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<ToolOutputFile>>
 setupStatsFile(StringRef StatsFilename);
 
 /// Produces a container ordering for optimal multi-threaded processing. Returns
 /// ordered indices to elements in the input array.
-std::vector<int> generateModulesOrdering(ArrayRef<BitcodeModule *> R);
+LLVM_FUNC_ABI std::vector<int> generateModulesOrdering(ArrayRef<BitcodeModule *> R);
 
 /// Updates MemProf attributes (and metadata) based on whether the index
 /// has recorded that we are linking with allocation libraries containing
 /// the necessary APIs for downstream transformations.
-void updateMemProfAttributes(Module &Mod, const ModuleSummaryIndex &Index);
+LLVM_FUNC_ABI void updateMemProfAttributes(Module &Mod, const ModuleSummaryIndex &Index);
 
 class LTO;
 struct SymbolResolution;
@@ -107,7 +107,7 @@ class ThinBackendProc;
 
 /// An input file. This is a symbol table wrapper that only exposes the
 /// information that an LTO client should need in order to do symbol resolution.
-class InputFile {
+class LLVM_CLASS_ABI InputFile {
 public:
   class Symbol;
 
@@ -209,7 +209,7 @@ using ThinBackend = std::function<std::unique_ptr<ThinBackendProc>(
 /// ShouldEmitImportsFiles is true it also writes a list of imported files to a
 /// similar path with ".imports" appended instead.
 using IndexWriteCallback = std::function<void(const std::string &)>;
-ThinBackend createInProcessThinBackend(ThreadPoolStrategy Parallelism,
+LLVM_FUNC_ABI ThinBackend createInProcessThinBackend(ThreadPoolStrategy Parallelism,
                                        IndexWriteCallback OnWrite = nullptr,
                                        bool ShouldEmitIndexFiles = false,
                                        bool ShouldEmitImportsFiles = false);
@@ -229,7 +229,7 @@ ThinBackend createInProcessThinBackend(ThreadPoolStrategy Parallelism,
 /// the objects with NativeObjectPrefix instead of NewPrefix. OnWrite is
 /// callback which receives module identifier and notifies LTO user that index
 /// file for the module (and optionally imports file) was created.
-ThinBackend createWriteIndexesThinBackend(std::string OldPrefix,
+LLVM_FUNC_ABI ThinBackend createWriteIndexesThinBackend(std::string OldPrefix,
                                           std::string NewPrefix,
                                           std::string NativeObjectPrefix,
                                           bool ShouldEmitImportsFiles,
@@ -252,7 +252,7 @@ ThinBackend createWriteIndexesThinBackend(std::string OldPrefix,
 /// - Call the run() function. This function will use the supplied AddStream
 ///   and Cache functions to add up to getMaxTasks() native object files to
 ///   the link.
-class LTO {
+class LLVM_CLASS_ABI LTO {
   friend InputFile;
 
 public:
@@ -451,7 +451,7 @@ class LTO {
 
 /// The resolution for a symbol. The linker must provide a SymbolResolution for
 /// each global symbol based on its internal resolution of that symbol.
-struct SymbolResolution {
+struct LLVM_CLASS_ABI SymbolResolution {
   SymbolResolution()
       : Prevailing(0), FinalDefinitionInLinkageUnit(0), VisibleToRegularObj(0),
         ExportDynamic(0), LinkerRedefined(0) {}
diff --git a/llvm/include/llvm/LTO/LTOBackend.h b/llvm/include/llvm/LTO/LTOBackend.h
index a010f6a24f4106e..c52cf62157ed1c9 100644
--- a/llvm/include/llvm/LTO/LTOBackend.h
+++ b/llvm/include/llvm/LTO/LTOBackend.h
@@ -35,14 +35,14 @@ class Target;
 namespace lto {
 
 /// Runs middle-end LTO optimizations on \p Mod.
-bool opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
+LLVM_FUNC_ABI bool opt(const Config &Conf, TargetMachine *TM, unsigned Task, Module &Mod,
          bool IsThinLTO, ModuleSummaryIndex *ExportSummary,
          const ModuleSummaryIndex *ImportSummary,
          const std::vector<uint8_t> &CmdArgs);
 
 /// Runs a regular LTO backend. The regular LTO backend can also act as the
 /// regular LTO phase of ThinLTO, which may need to access the combined index.
-Error backend(const Config &C, AddStreamFn AddStream,
+LLVM_FUNC_ABI Error backend(const Config &C, AddStreamFn AddStream,
               unsigned ParallelCodeGenParallelismLevel, Module &M,
               ModuleSummaryIndex &CombinedIndex);
 
@@ -52,26 +52,26 @@ Error backend(const Config &C, AddStreamFn AddStream,
 /// are saved in the ModuleMap. If \p ModuleMap is nullptr, module files will
 /// be mapped to memory on demand and at any given time during importing, only
 /// one source module will be kept open at the most.
-Error thinBackend(const Config &C, unsigned Task, AddStreamFn AddStream,
+LLVM_FUNC_ABI Error thinBackend(const Config &C, unsigned Task, AddStreamFn AddStream,
                   Module &M, const ModuleSummaryIndex &CombinedIndex,
                   const FunctionImporter::ImportMapTy &ImportList,
                   const GVSummaryMapTy &DefinedGlobals,
                   MapVector<StringRef, BitcodeModule> *ModuleMap,
                   const std::vector<uint8_t> &CmdArgs = std::vector<uint8_t>());
 
-Error finalizeOptimizationRemarks(
+LLVM_FUNC_ABI Error finalizeOptimizationRemarks(
     std::unique_ptr<ToolOutputFile> DiagOutputFile);
 
 /// Returns the BitcodeModule that is ThinLTO.
-BitcodeModule *findThinLTOModule(MutableArrayRef<BitcodeModule> BMs);
+LLVM_FUNC_ABI BitcodeModule *findThinLTOModule(MutableArrayRef<BitcodeModule> BMs);
 
 /// Variant of the above.
-Expected<BitcodeModule> findThinLTOModule(MemoryBufferRef MBRef);
+LLVM_FUNC_ABI Expected<BitcodeModule> findThinLTOModule(MemoryBufferRef MBRef);
 
 /// Distributed ThinLTO: collect the referenced modules based on
 /// module summary and initialize ImportList. Returns false if the
 /// operation failed.
-bool initImportList(const Module &M, const ModuleSummaryIndex &CombinedIndex,
+LLVM_FUNC_ABI bool initImportList(const Module &M, const ModuleSummaryIndex &CombinedIndex,
                     FunctionImporter::ImportMapTy &ImportList);
 }
 }
diff --git a/llvm/include/llvm/LTO/SummaryBasedOptimizations.h b/llvm/include/llvm/LTO/SummaryBasedOptimizations.h
index 2923ee55dde0f03..336b761b23f1f0c 100644
--- a/llvm/include/llvm/LTO/SummaryBasedOptimizations.h
+++ b/llvm/include/llvm/LTO/SummaryBasedOptimizations.h
@@ -15,7 +15,7 @@ namespace llvm {
 class ModuleSummaryIndex;
 
 /// Compute synthetic function entry counts.
-void computeSyntheticCounts(ModuleSummaryIndex &Index);
+LLVM_FUNC_ABI void computeSyntheticCounts(ModuleSummaryIndex &Index);
 
 } // namespace llvm
 #endif
diff --git a/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
index d0af3c01748f216..b59ebd9ad23614c 100644
--- a/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
+++ b/llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
@@ -66,12 +66,12 @@ template <typename T> class ArrayRef;
   class raw_pwrite_stream;
 
 /// Enable global value internalization in LTO.
-extern cl::opt<bool> EnableLTOInternalization;
+LLVM_FUNC_ABI extern cl::opt<bool> EnableLTOInternalization;
 
 //===----------------------------------------------------------------------===//
 /// C++ class which implements the opaque lto_code_gen_t type.
 ///
-struct LTOCodeGenerator {
+struct LLVM_CLASS_ABI LTOCodeGenerator {
   static const char *getVersionString();
 
   LTOCodeGenerator(LLVMContext &Context);
@@ -252,6 +252,6 @@ struct LTOCodeGenerator {
 
 /// A convenience function that calls cl::ParseCommandLineOptions on the given
 /// set of options.
-void parseCommandLineOptions(std::vector<std::string> &Options);
+LLVM_FUNC_ABI void parseCommandLineOptions(std::vector<std::string> &Options);
 }
 #endif
diff --git a/llvm/include/llvm/LTO/legacy/LTOModule.h b/llvm/include/llvm/LTO/legacy/LTOModule.h
index f1c503128c51075..1a1eab7d3754e70 100644
--- a/llvm/include/llvm/LTO/legacy/LTOModule.h
+++ b/llvm/include/llvm/LTO/legacy/LTOModule.h
@@ -36,7 +36,7 @@ namespace llvm {
 //===----------------------------------------------------------------------===//
 /// C++ class which implements the opaque lto_module_t type.
 ///
-struct LTOModule {
+struct LLVM_CLASS_ABI LTOModule {
 private:
   struct NameAndAttributes {
     StringRef name;
diff --git a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
index 2b3a1f57f5fe793..6044ab94feab9a0 100644
--- a/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
+++ b/llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
@@ -33,7 +33,7 @@ class StringRef;
 class TargetMachine;
 
 /// Helper to gather options relevant to the target machine creation
-struct TargetMachineBuilder {
+struct LLVM_CLASS_ABI TargetMachineBuilder {
   Triple TheTriple;
   std::string MCpu;
   std::string MAttr;
@@ -50,7 +50,7 @@ struct TargetMachineBuilder {
 /// compilation: the model is that the client adds modules to the generator and
 /// ask to perform the ThinLTO optimizations / codegen, and finally destroys the
 /// codegenerator.
-class ThinLTOCodeGenerator {
+class LLVM_CLASS_ABI ThinLTOCodeGenerator {
 public:
   /// Add given module to the code generator.
   void addModule(StringRef Identifier, StringRef Data);
diff --git a/llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h b/llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h
index 2fb42cf12eeb3e2..50cdc29cf5248a3 100644
--- a/llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h
+++ b/llvm/include/llvm/LTO/legacy/UpdateCompilerUsed.h
@@ -25,7 +25,7 @@ class TargetMachine;
 /// \p AsmUndefinedRefs, as well as the user-supplied functions definitions that
 /// are also libcalls, and create or update the magic "llvm.compiler_used"
 /// global in \p TheModule.
-void updateCompilerUsed(Module &TheModule, const TargetMachine &TM,
+LLVM_FUNC_ABI void updateCompilerUsed(Module &TheModule, const TargetMachine &TM,
                         const StringSet<> &AsmUndefinedRefs);
 }
 
diff --git a/llvm/include/llvm/LineEditor/LineEditor.h b/llvm/include/llvm/LineEditor/LineEditor.h
index 29fdf9f85c6fa56..f8078be5f9c2566 100644
--- a/llvm/include/llvm/LineEditor/LineEditor.h
+++ b/llvm/include/llvm/LineEditor/LineEditor.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-class LineEditor {
+class LLVM_CLASS_ABI LineEditor {
 public:
   /// Create a LineEditor object.
   ///
diff --git a/llvm/include/llvm/LinkAllIR.h b/llvm/include/llvm/LinkAllIR.h
index ceed784d557de0e..f6762aded328756 100644
--- a/llvm/include/llvm/LinkAllIR.h
+++ b/llvm/include/llvm/LinkAllIR.h
@@ -32,7 +32,7 @@
 #include <cstdlib>
 
 namespace {
-  struct ForceVMCoreLinking {
+  struct LLVM_CLASS_ABI ForceVMCoreLinking {
     ForceVMCoreLinking() {
       // We must reference VMCore in such a way that compilers will not
       // delete it all as dead code, even with whole program optimization,
diff --git a/llvm/include/llvm/LinkAllPasses.h b/llvm/include/llvm/LinkAllPasses.h
index 7420ea64e954356..34d433d1f788b74 100644
--- a/llvm/include/llvm/LinkAllPasses.h
+++ b/llvm/include/llvm/LinkAllPasses.h
@@ -56,7 +56,7 @@
 #include <cstdlib>
 
 namespace {
-  struct ForcePassLinking {
+  struct LLVM_CLASS_ABI ForcePassLinking {
     ForcePassLinking() {
       // We must reference the passes in such a way that compilers will not
       // delete it all as dead code, even with whole program optimization,
diff --git a/llvm/include/llvm/Linker/IRMover.h b/llvm/include/llvm/Linker/IRMover.h
index 425190beee7b718..5308448f86f4555 100644
--- a/llvm/include/llvm/Linker/IRMover.h
+++ b/llvm/include/llvm/Linker/IRMover.h
@@ -24,7 +24,7 @@ class StructType;
 class TrackingMDRef;
 class Type;
 
-class IRMover {
+class LLVM_CLASS_ABI IRMover {
   struct StructTypeKeyInfo {
     struct KeyTy {
       ArrayRef<Type *> ETypes;
diff --git a/llvm/include/llvm/Linker/Linker.h b/llvm/include/llvm/Linker/Linker.h
index 7af75c934785f60..b25c9534e593f47 100644
--- a/llvm/include/llvm/Linker/Linker.h
+++ b/llvm/include/llvm/Linker/Linker.h
@@ -20,7 +20,7 @@ class Module;
 /// pointer to the merged module so far. It doesn't take ownership of the
 /// module since it is assumed that the user of this class will want to do
 /// something with it after the linking.
-class Linker {
+class LLVM_CLASS_ABI Linker {
   IRMover Mover;
 
 public:
diff --git a/llvm/include/llvm/MC/ConstantPools.h b/llvm/include/llvm/MC/ConstantPools.h
index e032072a8ed3ec3..ec9877d4275dfb8 100644
--- a/llvm/include/llvm/MC/ConstantPools.h
+++ b/llvm/include/llvm/MC/ConstantPools.h
@@ -29,7 +29,7 @@ class MCStreamer;
 class MCSymbol;
 class MCSymbolRefExpr;
 
-struct ConstantPoolEntry {
+struct LLVM_CLASS_ABI ConstantPoolEntry {
   ConstantPoolEntry(MCSymbol *L, const MCExpr *Val, unsigned Sz, SMLoc Loc_)
     : Label(L), Value(Val), Size(Sz), Loc(Loc_) {}
 
@@ -41,7 +41,7 @@ struct ConstantPoolEntry {
 
 // A class to keep track of assembler-generated constant pools that are use to
 // implement the ldr-pseudo.
-class ConstantPool {
+class LLVM_CLASS_ABI ConstantPool {
   using EntryVecTy = SmallVector<ConstantPoolEntry, 4>;
   EntryVecTy Entries;
   std::map<int64_t, const MCSymbolRefExpr *> CachedConstantEntries;
@@ -68,7 +68,7 @@ class ConstantPool {
   void clearCache();
 };
 
-class AssemblerConstantPools {
+class LLVM_CLASS_ABI AssemblerConstantPools {
   // Map type used to keep track of per-Section constant pools used by the
   // ldr-pseudo opcode. The map associates a section to its constant pool. The
   // constant pool is a vector of (label, value) pairs. When the ldr
diff --git a/llvm/include/llvm/MC/DXContainerPSVInfo.h b/llvm/include/llvm/MC/DXContainerPSVInfo.h
index f5cd5b2fcbe0c37..a8e4c837e264335 100644
--- a/llvm/include/llvm/MC/DXContainerPSVInfo.h
+++ b/llvm/include/llvm/MC/DXContainerPSVInfo.h
@@ -28,7 +28,7 @@ namespace mcdxbc {
 // This structure is used to represent the extracted data in an inspectable and
 // modifiable format, and can be used to serialize the data back into valid PSV
 // RuntimeInfo.
-struct PSVRuntimeInfo {
+struct LLVM_CLASS_ABI PSVRuntimeInfo {
   dxbc::PSV::v2::RuntimeInfo BaseData;
   std::vector<dxbc::PSV::v2::ResourceBindInfo> Resources;
 
diff --git a/llvm/include/llvm/MC/LaneBitmask.h b/llvm/include/llvm/MC/LaneBitmask.h
index c06ca7dd5b8fcd2..4e45aaedc249b34 100644
--- a/llvm/include/llvm/MC/LaneBitmask.h
+++ b/llvm/include/llvm/MC/LaneBitmask.h
@@ -37,7 +37,7 @@
 
 namespace llvm {
 
-  struct LaneBitmask {
+  struct LLVM_CLASS_ABI LaneBitmask {
     // When changing the underlying type, change the format string as well.
     using Type = uint64_t;
     enum : unsigned { BitWidth = 8*sizeof(Type) };
diff --git a/llvm/include/llvm/MC/MCAsmBackend.h b/llvm/include/llvm/MC/MCAsmBackend.h
index c5573bfecca6415..1f28e6c869e3f82 100644
--- a/llvm/include/llvm/MC/MCAsmBackend.h
+++ b/llvm/include/llvm/MC/MCAsmBackend.h
@@ -40,7 +40,7 @@ class StringRef;
 class raw_ostream;
 
 /// Generic interface to target specific assembler backends.
-class MCAsmBackend {
+class LLVM_CLASS_ABI MCAsmBackend {
 protected: // Can only create subclasses.
   MCAsmBackend(support::endianness Endian,
                unsigned RelaxFixupKind = MaxFixupKind);
diff --git a/llvm/include/llvm/MC/MCAsmInfo.h b/llvm/include/llvm/MC/MCAsmInfo.h
index 35386ecb878da1a..f4a776bbd2b14dc 100644
--- a/llvm/include/llvm/MC/MCAsmInfo.h
+++ b/llvm/include/llvm/MC/MCAsmInfo.h
@@ -54,7 +54,7 @@ enum LCOMMType { NoAlignment, ByteAlignment, Log2Alignment };
 
 /// This class is intended to be used as a base class for asm
 /// properties and features specific to the target.
-class MCAsmInfo {
+class LLVM_CLASS_ABI MCAsmInfo {
 public:
   /// Assembly character literal syntax types.
   enum AsmCharLiteralSyntax {
diff --git a/llvm/include/llvm/MC/MCAsmInfoCOFF.h b/llvm/include/llvm/MC/MCAsmInfoCOFF.h
index 17de5b0ab126512..e20c34a80dbe7f0 100644
--- a/llvm/include/llvm/MC/MCAsmInfoCOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoCOFF.h
@@ -14,21 +14,21 @@
 
 namespace llvm {
 
-class MCAsmInfoCOFF : public MCAsmInfo {
+class LLVM_CLASS_ABI MCAsmInfoCOFF : public MCAsmInfo {
   virtual void anchor();
 
 protected:
   explicit MCAsmInfoCOFF();
 };
 
-class MCAsmInfoMicrosoft : public MCAsmInfoCOFF {
+class LLVM_CLASS_ABI MCAsmInfoMicrosoft : public MCAsmInfoCOFF {
   void anchor() override;
 
 protected:
   explicit MCAsmInfoMicrosoft();
 };
 
-class MCAsmInfoGNUCOFF : public MCAsmInfoCOFF {
+class LLVM_CLASS_ABI MCAsmInfoGNUCOFF : public MCAsmInfoCOFF {
   void anchor() override;
 
 protected:
diff --git a/llvm/include/llvm/MC/MCAsmInfoDarwin.h b/llvm/include/llvm/MC/MCAsmInfoDarwin.h
index ed66a3224eb42ec..4dbcead9b1b57cd 100644
--- a/llvm/include/llvm/MC/MCAsmInfoDarwin.h
+++ b/llvm/include/llvm/MC/MCAsmInfoDarwin.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-class MCAsmInfoDarwin : public MCAsmInfo {
+class LLVM_CLASS_ABI MCAsmInfoDarwin : public MCAsmInfo {
 public:
   explicit MCAsmInfoDarwin();
 
diff --git a/llvm/include/llvm/MC/MCAsmInfoELF.h b/llvm/include/llvm/MC/MCAsmInfoELF.h
index 18e3cf1010ccd92..84ea91ee996bd08 100644
--- a/llvm/include/llvm/MC/MCAsmInfoELF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoELF.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class MCAsmInfoELF : public MCAsmInfo {
+class LLVM_CLASS_ABI MCAsmInfoELF : public MCAsmInfo {
   virtual void anchor();
   MCSection *getNonexecutableStackSection(MCContext &Ctx) const final;
 
diff --git a/llvm/include/llvm/MC/MCAsmInfoGOFF.h b/llvm/include/llvm/MC/MCAsmInfoGOFF.h
index 126739f90948fab..391da6035f83f0e 100644
--- a/llvm/include/llvm/MC/MCAsmInfoGOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoGOFF.h
@@ -19,7 +19,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class MCAsmInfoGOFF : public MCAsmInfo {
+class LLVM_CLASS_ABI MCAsmInfoGOFF : public MCAsmInfo {
   virtual void anchor();
 
 protected:
diff --git a/llvm/include/llvm/MC/MCAsmInfoWasm.h b/llvm/include/llvm/MC/MCAsmInfoWasm.h
index ab350bf612714e3..34d0642e0e37e5d 100644
--- a/llvm/include/llvm/MC/MCAsmInfoWasm.h
+++ b/llvm/include/llvm/MC/MCAsmInfoWasm.h
@@ -13,7 +13,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class MCAsmInfoWasm : public MCAsmInfo {
+class LLVM_CLASS_ABI MCAsmInfoWasm : public MCAsmInfo {
   virtual void anchor();
 
 protected:
diff --git a/llvm/include/llvm/MC/MCAsmInfoXCOFF.h b/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
index 648548312c17040..3168ada802f1295 100644
--- a/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
+++ b/llvm/include/llvm/MC/MCAsmInfoXCOFF.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class MCAsmInfoXCOFF : public MCAsmInfo {
+class LLVM_CLASS_ABI MCAsmInfoXCOFF : public MCAsmInfo {
   virtual void anchor();
 
 protected:
diff --git a/llvm/include/llvm/MC/MCAsmLayout.h b/llvm/include/llvm/MC/MCAsmLayout.h
index 518c9d92dea0908..791f09ab72de0b6 100644
--- a/llvm/include/llvm/MC/MCAsmLayout.h
+++ b/llvm/include/llvm/MC/MCAsmLayout.h
@@ -26,7 +26,7 @@ class MCSymbol;
 /// at a single point in time in such a way that it is always possible to
 /// efficiently compute the exact address of any symbol in the assembly file,
 /// even during the relaxation process.
-class MCAsmLayout {
+class LLVM_CLASS_ABI MCAsmLayout {
   MCAssembler &Assembler;
 
   /// List of sections in layout order.
diff --git a/llvm/include/llvm/MC/MCAsmMacro.h b/llvm/include/llvm/MC/MCAsmMacro.h
index ae2258a44843856..d0ee7d2aec07ba1 100644
--- a/llvm/include/llvm/MC/MCAsmMacro.h
+++ b/llvm/include/llvm/MC/MCAsmMacro.h
@@ -19,7 +19,7 @@
 namespace llvm {
 
 /// Target independent representation for an assembler token.
-class AsmToken {
+class LLVM_CLASS_ABI AsmToken {
 public:
   enum TokenKind {
     // Markers
@@ -127,7 +127,7 @@ class AsmToken {
   void dump(raw_ostream &OS) const;
 };
 
-struct MCAsmMacroParameter {
+struct LLVM_CLASS_ABI MCAsmMacroParameter {
   StringRef Name;
   std::vector<AsmToken> Value;
   bool Required = false;
@@ -140,7 +140,7 @@ struct MCAsmMacroParameter {
 };
 
 typedef std::vector<MCAsmMacroParameter> MCAsmMacroParameters;
-struct MCAsmMacro {
+struct LLVM_CLASS_ABI MCAsmMacro {
   StringRef Name;
   StringRef Body;
   MCAsmMacroParameters Parameters;
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index 3f5a81436ae71ec..e576dc86d60217c 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -56,14 +56,14 @@ class MCSection;
 class MCValue;
 
 // FIXME: This really doesn't belong here. See comments below.
-struct IndirectSymbolData {
+struct LLVM_CLASS_ABI IndirectSymbolData {
   MCSymbol *Symbol;
   MCSection *Section;
 };
 
 // FIXME: Ditto this. Purely so the Streamer and the ObjectWriter can talk
 // to one another.
-struct DataRegionData {
+struct LLVM_CLASS_ABI DataRegionData {
   // This enum should be kept in sync w/ the mach-o definition in
   // llvm/Object/MachOFormat.h.
   enum KindTy { Data = 1, JumpTable8, JumpTable16, JumpTable32 } Kind;
@@ -71,7 +71,7 @@ struct DataRegionData {
   MCSymbol *End;
 };
 
-class MCAssembler {
+class LLVM_CLASS_ABI MCAssembler {
   friend class MCAsmLayout;
 
 public:
@@ -497,7 +497,7 @@ class MCAssembler {
 /// Compute the amount of padding required before the fragment \p F to
 /// obey bundling restrictions, where \p FOffset is the fragment's offset in
 /// its section and \p FSize is the fragment's size.
-uint64_t computeBundlePadding(const MCAssembler &Assembler,
+LLVM_FUNC_ABI uint64_t computeBundlePadding(const MCAssembler &Assembler,
                               const MCEncodedFragment *F, uint64_t FOffset,
                               uint64_t FSize);
 
diff --git a/llvm/include/llvm/MC/MCCodeEmitter.h b/llvm/include/llvm/MC/MCCodeEmitter.h
index 573f171b14bd733..fbff33235d5fa12 100644
--- a/llvm/include/llvm/MC/MCCodeEmitter.h
+++ b/llvm/include/llvm/MC/MCCodeEmitter.h
@@ -20,7 +20,7 @@ class raw_ostream;
 template<typename T> class SmallVectorImpl;
 
 /// MCCodeEmitter - Generic instruction encoding interface.
-class MCCodeEmitter {
+class LLVM_CLASS_ABI MCCodeEmitter {
 protected: // Can only create subclasses.
   MCCodeEmitter();
 
diff --git a/llvm/include/llvm/MC/MCCodeView.h b/llvm/include/llvm/MC/MCCodeView.h
index 65bfcaa10503732..9a00a70b52a60c7 100644
--- a/llvm/include/llvm/MC/MCCodeView.h
+++ b/llvm/include/llvm/MC/MCCodeView.h
@@ -36,7 +36,7 @@ class MCStreamer;
 
 /// Instances of this class represent the information from a
 /// .cv_loc directive.
-class MCCVLoc {
+class LLVM_CLASS_ABI MCCVLoc {
   const MCSymbol *Label = nullptr;
   uint32_t FunctionId;
   uint32_t FileNum;
@@ -96,7 +96,7 @@ class MCCVLoc {
 /// .cv_func_id or .cv_inline_site_id. Accumulates information from .cv_loc
 /// directives used with this function's id or the id of an inlined call site
 /// within this function or inlined call site.
-struct MCCVFunctionInfo {
+struct LLVM_CLASS_ABI MCCVFunctionInfo {
   /// If this represents an inlined call site, then ParentFuncIdPlusOne will be
   /// the parent function id plus one. If this represents a normal function,
   /// then there is no parent, and ParentFuncIdPlusOne will be FunctionSentinel.
@@ -142,7 +142,7 @@ struct MCCVFunctionInfo {
 };
 
 /// Holds state from .cv_file and .cv_loc directives for later emission.
-class CodeViewContext {
+class LLVM_CLASS_ABI CodeViewContext {
 public:
   CodeViewContext();
   ~CodeViewContext();
diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h
index 68d6f3e59d2d41a..32dfcde9375c864 100644
--- a/llvm/include/llvm/MC/MCContext.h
+++ b/llvm/include/llvm/MC/MCContext.h
@@ -73,7 +73,7 @@ enum class EmitDwarfUnwindType;
 /// Context object for machine code objects.  This class owns all of the
 /// sections that it creates.
 ///
-class MCContext {
+class LLVM_CLASS_ABI MCContext {
 public:
   using SymbolTable = StringMap<MCSymbol *, BumpPtrAllocator &>;
   using DiagHandlerTy =
diff --git a/llvm/include/llvm/MC/MCDXContainerStreamer.h b/llvm/include/llvm/MC/MCDXContainerStreamer.h
index a2a9dee06a74c15..93d6baf1db5a54d 100644
--- a/llvm/include/llvm/MC/MCDXContainerStreamer.h
+++ b/llvm/include/llvm/MC/MCDXContainerStreamer.h
@@ -26,7 +26,7 @@ namespace llvm {
 class MCInst;
 class raw_ostream;
 
-class MCDXContainerStreamer : public MCObjectStreamer {
+class LLVM_CLASS_ABI MCDXContainerStreamer : public MCObjectStreamer {
 public:
   MCDXContainerStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
                         std::unique_ptr<MCObjectWriter> OW,
diff --git a/llvm/include/llvm/MC/MCDXContainerWriter.h b/llvm/include/llvm/MC/MCDXContainerWriter.h
index 7c1ea6c8f317421..75eadd6e194c9b9 100644
--- a/llvm/include/llvm/MC/MCDXContainerWriter.h
+++ b/llvm/include/llvm/MC/MCDXContainerWriter.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 class raw_pwrite_stream;
 
-class MCDXContainerTargetWriter : public MCObjectTargetWriter {
+class LLVM_CLASS_ABI MCDXContainerTargetWriter : public MCObjectTargetWriter {
 protected:
   MCDXContainerTargetWriter() {}
 
@@ -37,7 +37,7 @@ class MCDXContainerTargetWriter : public MCObjectTargetWriter {
 /// \param MOTW - The target specific DXContainer writer subclass.
 /// \param OS - The stream to write to.
 /// \returns The constructed object writer.
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createDXContainerObjectWriter(std::unique_ptr<MCDXContainerTargetWriter> MOTW,
                               raw_pwrite_stream &OS);
 
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h b/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
index 79d58d41d0ca946..3bc6655d94521c2 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
@@ -19,14 +19,14 @@
 
 namespace llvm {
 
-struct XCOFFSymbolInfoTy {
+struct LLVM_CLASS_ABI XCOFFSymbolInfoTy {
   std::optional<XCOFF::StorageMappingClass> StorageMappingClass;
   std::optional<uint32_t> Index;
   bool IsLabel = false;
   bool operator<(const XCOFFSymbolInfoTy &SymInfo) const;
 };
 
-struct SymbolInfoTy {
+struct LLVM_CLASS_ABI SymbolInfoTy {
   uint64_t Addr;
   StringRef Name;
   // XCOFF uses XCOFFSymInfo. Other targets use Type.
@@ -77,7 +77,7 @@ class raw_ostream;
 
 /// Superclass for all disassemblers. Consumes a memory region and provides an
 /// array of assembly instructions.
-class MCDisassembler {
+class LLVM_CLASS_ABI MCDisassembler {
 public:
   /// Ternary decode status. Most backends will just use Fail and
   /// Success, however some have a concept of an instruction with
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h b/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
index 4935d36dd72b8cf..4961c9e9f3549ac 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCExternalSymbolizer.h
@@ -25,7 +25,7 @@ namespace llvm {
 /// Symbolize using user-provided, C API, callbacks.
 ///
 /// See llvm-c/Disassembler.h.
-class MCExternalSymbolizer : public MCSymbolizer {
+class LLVM_CLASS_ABI MCExternalSymbolizer : public MCSymbolizer {
 protected:
   /// \name Hooks for symbolic disassembly via the public 'C' interface.
   /// @{
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h b/llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h
index e85b47465009001..1c1594c843a8efc 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h
@@ -23,7 +23,7 @@ class MCContext;
 class MCExpr;
 
 /// Create MCExprs from relocations found in an object file.
-class MCRelocationInfo {
+class LLVM_CLASS_ABI MCRelocationInfo {
 protected:
   MCContext &Ctx;
 
diff --git a/llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h b/llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h
index 3acfda5672e322d..0dfc929172d987e 100644
--- a/llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h
+++ b/llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h
@@ -37,7 +37,7 @@ class raw_ostream;
 /// inside each disassembler, but would use the instr info to determine what
 /// operands are actually symbolizable, and in what way. I don't think this
 /// information exists right now.
-class MCSymbolizer {
+class LLVM_CLASS_ABI MCSymbolizer {
 protected:
   MCContext &Ctx;
   std::unique_ptr<MCRelocationInfo> RelInfo;
diff --git a/llvm/include/llvm/MC/MCDwarf.h b/llvm/include/llvm/MC/MCDwarf.h
index 1611cc93be08774..2e496d7ac942cbb 100644
--- a/llvm/include/llvm/MC/MCDwarf.h
+++ b/llvm/include/llvm/MC/MCDwarf.h
@@ -45,11 +45,11 @@ class SourceMgr;
 
 namespace mcdwarf {
 // Emit the common part of the DWARF 5 range/locations list tables header.
-MCSymbol *emitListsTableHeaderStart(MCStreamer &S);
+LLVM_FUNC_ABI MCSymbol *emitListsTableHeaderStart(MCStreamer &S);
 } // namespace mcdwarf
 
 /// Manage the .debug_line_str section contents, if we use it.
-class MCDwarfLineStr {
+class LLVM_CLASS_ABI MCDwarfLineStr {
   BumpPtrAllocator Alloc;
   StringSaver Saver{Alloc};
   MCSymbol *LineStrLabel = nullptr;
@@ -85,7 +85,7 @@ class MCDwarfLineStr {
 /// numbers start from 0, with the MCDwarfFile with file number 0 being the
 /// primary source file, and file numbers correspond to their index in the
 /// vector.
-struct MCDwarfFile {
+struct LLVM_CLASS_ABI MCDwarfFile {
   // The base name of the file without its directory path.
   std::string Name;
 
@@ -103,7 +103,7 @@ struct MCDwarfFile {
 
 /// Instances of this class represent the information from a
 /// dwarf .loc directive.
-class MCDwarfLoc {
+class LLVM_CLASS_ABI MCDwarfLoc {
   uint32_t FileNum;
   uint32_t Line;
   uint16_t Column;
@@ -186,7 +186,7 @@ class MCDwarfLoc {
 /// instruction is assembled and uses an address from a temporary label
 /// created at the current address in the current section and the info from
 /// the last .loc directive seen as stored in the context.
-class MCDwarfLineEntry : public MCDwarfLoc {
+class LLVM_CLASS_ABI MCDwarfLineEntry : public MCDwarfLoc {
   MCSymbol *Label;
 
 private:
@@ -219,7 +219,7 @@ class MCDwarfLineEntry : public MCDwarfLoc {
 /// unit where machine instructions have been assembled after seeing .loc
 /// directives.  This is the information used to build the dwarf line
 /// table for a section.
-class MCLineSection {
+class LLVM_CLASS_ABI MCLineSection {
 public:
   // Add an entry to this MCLineSection's line entries.
   void addLineEntry(const MCDwarfLineEntry &LineEntry, MCSection *Sec) {
@@ -246,7 +246,7 @@ class MCLineSection {
   }
 };
 
-struct MCDwarfLineTableParams {
+struct LLVM_CLASS_ABI MCDwarfLineTableParams {
   /// First special line opcode - leave room for the standard opcodes.
   /// Note: If you want to change this, you'll have to update the
   /// "StandardOpcodeLengths" table that is emitted in
@@ -259,7 +259,7 @@ struct MCDwarfLineTableParams {
   uint8_t DWARF2LineRange = 14;
 };
 
-struct MCDwarfLineTableHeader {
+struct LLVM_CLASS_ABI MCDwarfLineTableHeader {
   MCSymbol *Label = nullptr;
   SmallVector<std::string, 3> MCDwarfDirs;
   SmallVector<MCDwarfFile, 3> MCDwarfFiles;
@@ -323,7 +323,7 @@ struct MCDwarfLineTableHeader {
                            std::optional<MCDwarfLineStr> &LineStr) const;
 };
 
-class MCDwarfDwoLineTable {
+class LLVM_CLASS_ABI MCDwarfDwoLineTable {
   MCDwarfLineTableHeader Header;
   bool HasSplitLineTable = false;
 
@@ -348,7 +348,7 @@ class MCDwarfDwoLineTable {
             MCSection *Section) const;
 };
 
-class MCDwarfLineTable {
+class LLVM_CLASS_ABI MCDwarfLineTable {
   MCDwarfLineTableHeader Header;
   MCLineSection MCLineSections;
 
@@ -431,7 +431,7 @@ class MCDwarfLineTable {
   }
 };
 
-class MCDwarfLineAddr {
+class LLVM_CLASS_ABI MCDwarfLineAddr {
 public:
   /// Utility function to encode a Dwarf pair of LineDelta and AddrDeltas.
   static void encode(MCContext &Context, MCDwarfLineTableParams Params,
@@ -442,7 +442,7 @@ class MCDwarfLineAddr {
                    int64_t LineDelta, uint64_t AddrDelta);
 };
 
-class MCGenDwarfInfo {
+class LLVM_CLASS_ABI MCGenDwarfInfo {
 public:
   //
   // When generating dwarf for assembly source files this emits the Dwarf
@@ -453,7 +453,7 @@ class MCGenDwarfInfo {
 
 // When generating dwarf for assembly source files this is the info that is
 // needed to be gathered for each symbol that will have a dwarf label.
-class MCGenDwarfLabelEntry {
+class LLVM_CLASS_ABI MCGenDwarfLabelEntry {
 private:
   // Name of the symbol without a leading underbar, if any.
   StringRef Name;
@@ -481,7 +481,7 @@ class MCGenDwarfLabelEntry {
                    SMLoc &Loc);
 };
 
-class MCCFIInstruction {
+class LLVM_CLASS_ABI MCCFIInstruction {
 public:
   enum OpType {
     OpSameValue,
@@ -694,7 +694,7 @@ class MCCFIInstruction {
   SMLoc getLoc() const { return Loc; }
 };
 
-struct MCDwarfFrameInfo {
+struct LLVM_CLASS_ABI MCDwarfFrameInfo {
   MCDwarfFrameInfo() = default;
 
   MCSymbol *Begin = nullptr;
@@ -713,7 +713,7 @@ struct MCDwarfFrameInfo {
   bool IsMTETaggedFrame = false;
 };
 
-class MCDwarfFrameEmitter {
+class LLVM_CLASS_ABI MCDwarfFrameEmitter {
 public:
   //
   // This emits the frame info section.
diff --git a/llvm/include/llvm/MC/MCELFObjectWriter.h b/llvm/include/llvm/MC/MCELFObjectWriter.h
index fde146ec04f57c9..9655be1833d5611 100644
--- a/llvm/include/llvm/MC/MCELFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCELFObjectWriter.h
@@ -28,7 +28,7 @@ class MCSymbol;
 class MCSymbolELF;
 class MCValue;
 
-struct ELFRelocationEntry {
+struct LLVM_CLASS_ABI ELFRelocationEntry {
   uint64_t Offset; // Where is the relocation.
   const MCSymbolELF *Symbol; // The symbol to relocate with.
   unsigned Type;   // The type of the relocation.
@@ -51,7 +51,7 @@ struct ELFRelocationEntry {
   LLVM_DUMP_METHOD void dump() const { print(errs()); }
 };
 
-class MCELFObjectTargetWriter : public MCObjectTargetWriter {
+class LLVM_CLASS_ABI MCELFObjectTargetWriter : public MCObjectTargetWriter {
   const uint8_t OSABI;
   const uint8_t ABIVersion;
   const uint16_t EMachine;
@@ -155,11 +155,11 @@ class MCELFObjectTargetWriter : public MCObjectTargetWriter {
 /// \param MOTW - The target specific ELF writer subclass.
 /// \param OS - The stream to write to.
 /// \returns The constructed object writer.
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createELFObjectWriter(std::unique_ptr<MCELFObjectTargetWriter> MOTW,
                       raw_pwrite_stream &OS, bool IsLittleEndian);
 
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createELFDwoObjectWriter(std::unique_ptr<MCELFObjectTargetWriter> MOTW,
                          raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS,
                          bool IsLittleEndian);
diff --git a/llvm/include/llvm/MC/MCELFStreamer.h b/llvm/include/llvm/MC/MCELFStreamer.h
index 3b08190458968b7..6303348af4477c2 100644
--- a/llvm/include/llvm/MC/MCELFStreamer.h
+++ b/llvm/include/llvm/MC/MCELFStreamer.h
@@ -29,7 +29,7 @@ class MCCodeEmitter;
 class MCExpr;
 class MCInst;
 
-class MCELFStreamer : public MCObjectStreamer {
+class LLVM_CLASS_ABI MCELFStreamer : public MCObjectStreamer {
 public:
   MCELFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
                 std::unique_ptr<MCObjectWriter> OW,
@@ -153,7 +153,7 @@ class MCELFStreamer : public MCObjectStreamer {
   SmallVector<MCDataFragment *, 4> BundleGroups;
 };
 
-MCELFStreamer *createARMELFStreamer(MCContext &Context,
+LLVM_FUNC_ABI MCELFStreamer *createARMELFStreamer(MCContext &Context,
                                     std::unique_ptr<MCAsmBackend> TAB,
                                     std::unique_ptr<MCObjectWriter> OW,
                                     std::unique_ptr<MCCodeEmitter> Emitter,
diff --git a/llvm/include/llvm/MC/MCExpr.h b/llvm/include/llvm/MC/MCExpr.h
index eb68426f5bcedc8..9812c9ae3f2fd8a 100644
--- a/llvm/include/llvm/MC/MCExpr.h
+++ b/llvm/include/llvm/MC/MCExpr.h
@@ -33,7 +33,7 @@ using SectionAddrMap = DenseMap<const MCSection *, uint64_t>;
 
 /// Base class for the full range of assembler expressions which are
 /// needed for parsing.
-class MCExpr {
+class LLVM_CLASS_ABI MCExpr {
 public:
   enum ExprKind : uint8_t {
     Binary,    ///< Binary expressions.
@@ -142,7 +142,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MCExpr &E) {
 }
 
 ////  Represent a constant integer expression.
-class MCConstantExpr : public MCExpr {
+class LLVM_CLASS_ABI MCConstantExpr : public MCExpr {
   int64_t Value;
 
   // Subclass data stores SizeInBytes in bits 0..7 and PrintInHex in bit 8.
@@ -190,7 +190,7 @@ class MCConstantExpr : public MCExpr {
 /// A symbol reference in an expression may be a use of a label, a use of an
 /// assembler variable (defined constant), or constitute an implicit definition
 /// of the symbol as external.
-class MCSymbolRefExpr : public MCExpr {
+class LLVM_CLASS_ABI MCSymbolRefExpr : public MCExpr {
 public:
   enum VariantKind : uint16_t {
     VK_None,
@@ -425,7 +425,7 @@ class MCSymbolRefExpr : public MCExpr {
 };
 
 /// Unary assembler expressions.
-class MCUnaryExpr : public MCExpr {
+class LLVM_CLASS_ABI MCUnaryExpr : public MCExpr {
 public:
   enum Opcode {
     LNot,  ///< Logical negation.
@@ -481,7 +481,7 @@ class MCUnaryExpr : public MCExpr {
 };
 
 /// Binary assembler expressions.
-class MCBinaryExpr : public MCExpr {
+class LLVM_CLASS_ABI MCBinaryExpr : public MCExpr {
 public:
   enum Opcode {
     Add,  ///< Addition.
@@ -645,7 +645,7 @@ class MCBinaryExpr : public MCExpr {
 ///
 /// NOTE: All subclasses are required to have trivial destructors because
 /// MCExprs are bump pointer allocated and not destructed.
-class MCTargetExpr : public MCExpr {
+class LLVM_CLASS_ABI MCTargetExpr : public MCExpr {
   virtual void anchor();
 
 protected:
diff --git a/llvm/include/llvm/MC/MCFixup.h b/llvm/include/llvm/MC/MCFixup.h
index 1de078c803b74fa..8655812acb4e758 100644
--- a/llvm/include/llvm/MC/MCFixup.h
+++ b/llvm/include/llvm/MC/MCFixup.h
@@ -69,7 +69,7 @@ enum MCFixupKind {
 /// symbolic values become concrete. When relaxation is complete, any remaining
 /// fixups become relocations in the object file (or errors, if the fixup cannot
 /// be encoded on the target).
-class MCFixup {
+class LLVM_CLASS_ABI MCFixup {
   /// The value to put into the fixup location. The exact interpretation of the
   /// expression is target dependent, usually it will be one of the operands to
   /// an instruction or an assembler directive.
diff --git a/llvm/include/llvm/MC/MCFixupKindInfo.h b/llvm/include/llvm/MC/MCFixupKindInfo.h
index a4d9a3b297fd856..f8bda71493fc75a 100644
--- a/llvm/include/llvm/MC/MCFixupKindInfo.h
+++ b/llvm/include/llvm/MC/MCFixupKindInfo.h
@@ -14,7 +14,7 @@
 namespace llvm {
 
 /// Target independent information on a fixup kind.
-struct MCFixupKindInfo {
+struct LLVM_CLASS_ABI MCFixupKindInfo {
   enum FixupKindFlags {
     /// Is this fixup kind PCrelative? This is used by the assembler backend to
     /// evaluate fixup values in a target independent manner when possible.
diff --git a/llvm/include/llvm/MC/MCFragment.h b/llvm/include/llvm/MC/MCFragment.h
index bbad3c729e66706..ba156e41067f013 100644
--- a/llvm/include/llvm/MC/MCFragment.h
+++ b/llvm/include/llvm/MC/MCFragment.h
@@ -28,7 +28,7 @@ class MCSection;
 class MCSubtargetInfo;
 class MCSymbol;
 
-class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
+class LLVM_CLASS_ABI MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
   friend class MCAsmLayout;
 
 public:
@@ -113,7 +113,7 @@ class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
   unsigned getSubsectionNumber() const { return SubsectionNumber; }
 };
 
-class MCDummyFragment : public MCFragment {
+class LLVM_CLASS_ABI MCDummyFragment : public MCFragment {
 public:
   explicit MCDummyFragment(MCSection *Sec) : MCFragment(FT_Dummy, false, Sec) {}
 
@@ -123,7 +123,7 @@ class MCDummyFragment : public MCFragment {
 /// Interface implemented by fragments that contain encoded instructions and/or
 /// data.
 ///
-class MCEncodedFragment : public MCFragment {
+class LLVM_CLASS_ABI MCEncodedFragment : public MCFragment {
   /// Should this fragment be aligned to the end of a bundle?
   bool AlignToBundleEnd = false;
 
@@ -185,7 +185,7 @@ class MCEncodedFragment : public MCFragment {
 /// data.
 ///
 template<unsigned ContentsSize>
-class MCEncodedFragmentWithContents : public MCEncodedFragment {
+class LLVM_CLASS_ABI MCEncodedFragmentWithContents : public MCEncodedFragment {
   SmallVector<char, ContentsSize> Contents;
 
 protected:
@@ -203,7 +203,7 @@ class MCEncodedFragmentWithContents : public MCEncodedFragment {
 /// data and also have fixups registered.
 ///
 template<unsigned ContentsSize, unsigned FixupsSize>
-class MCEncodedFragmentWithFixups :
+class LLVM_CLASS_ABI MCEncodedFragmentWithFixups :
   public MCEncodedFragmentWithContents<ContentsSize> {
 
   /// The list of fixups in this fragment.
@@ -240,7 +240,7 @@ class MCEncodedFragmentWithFixups :
 
 /// Fragment for data and encoded instructions.
 ///
-class MCDataFragment : public MCEncodedFragmentWithFixups<32, 4> {
+class LLVM_CLASS_ABI MCDataFragment : public MCEncodedFragmentWithFixups<32, 4> {
 public:
   MCDataFragment(MCSection *Sec = nullptr)
       : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {}
@@ -258,7 +258,7 @@ class MCDataFragment : public MCEncodedFragmentWithFixups<32, 4> {
 /// it can be used instead of MCDataFragment and lead to lower memory
 /// consumption.
 ///
-class MCCompactEncodedInstFragment : public MCEncodedFragmentWithContents<4> {
+class LLVM_CLASS_ABI MCCompactEncodedInstFragment : public MCEncodedFragmentWithContents<4> {
 public:
   MCCompactEncodedInstFragment(MCSection *Sec = nullptr)
       : MCEncodedFragmentWithContents(FT_CompactEncodedInst, true, Sec) {
@@ -272,7 +272,7 @@ class MCCompactEncodedInstFragment : public MCEncodedFragmentWithContents<4> {
 /// A relaxable fragment holds on to its MCInst, since it may need to be
 /// relaxed during the assembler layout and relaxation stage.
 ///
-class MCRelaxableFragment : public MCEncodedFragmentWithFixups<8, 1> {
+class LLVM_CLASS_ABI MCRelaxableFragment : public MCEncodedFragmentWithFixups<8, 1> {
 
   /// The instruction this is a fragment for.
   MCInst Inst;
@@ -296,7 +296,7 @@ class MCRelaxableFragment : public MCEncodedFragmentWithFixups<8, 1> {
   }
 };
 
-class MCAlignFragment : public MCFragment {
+class LLVM_CLASS_ABI MCAlignFragment : public MCFragment {
   /// The alignment to ensure, in bytes.
   Align Alignment;
 
@@ -345,7 +345,7 @@ class MCAlignFragment : public MCFragment {
   }
 };
 
-class MCFillFragment : public MCFragment {
+class LLVM_CLASS_ABI MCFillFragment : public MCFragment {
   uint8_t ValueSize;
   /// Value to use for filling bytes.
   uint64_t Value;
@@ -372,7 +372,7 @@ class MCFillFragment : public MCFragment {
   }
 };
 
-class MCNopsFragment : public MCFragment {
+class LLVM_CLASS_ABI MCNopsFragment : public MCFragment {
   /// The number of bytes to insert.
   int64_t Size;
   /// Maximum number of bytes allowed in each NOP instruction.
@@ -402,7 +402,7 @@ class MCNopsFragment : public MCFragment {
   }
 };
 
-class MCOrgFragment : public MCFragment {
+class LLVM_CLASS_ABI MCOrgFragment : public MCFragment {
   /// Value to use for filling bytes.
   int8_t Value;
 
@@ -429,7 +429,7 @@ class MCOrgFragment : public MCFragment {
   }
 };
 
-class MCLEBFragment : public MCFragment {
+class LLVM_CLASS_ABI MCLEBFragment : public MCFragment {
   /// True if this is a sleb128, false if uleb128.
   bool IsSigned;
 
@@ -458,7 +458,7 @@ class MCLEBFragment : public MCFragment {
   }
 };
 
-class MCDwarfLineAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {
+class LLVM_CLASS_ABI MCDwarfLineAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {
   /// The value of the difference between the two line numbers
   /// between two .loc dwarf directives.
   int64_t LineDelta;
@@ -482,7 +482,7 @@ class MCDwarfLineAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {
   }
 };
 
-class MCDwarfCallFrameFragment : public MCEncodedFragmentWithFixups<8, 1> {
+class LLVM_CLASS_ABI MCDwarfCallFrameFragment : public MCEncodedFragmentWithFixups<8, 1> {
   /// The expression for the difference of the two symbols that
   /// make up the address delta between two .cfi_* dwarf directives.
   const MCExpr *AddrDelta;
@@ -501,7 +501,7 @@ class MCDwarfCallFrameFragment : public MCEncodedFragmentWithFixups<8, 1> {
 };
 
 /// Represents a symbol table index fragment.
-class MCSymbolIdFragment : public MCFragment {
+class LLVM_CLASS_ABI MCSymbolIdFragment : public MCFragment {
   const MCSymbol *Sym;
 
 public:
@@ -518,7 +518,7 @@ class MCSymbolIdFragment : public MCFragment {
 
 /// Fragment representing the binary annotations produced by the
 /// .cv_inline_linetable directive.
-class MCCVInlineLineTableFragment : public MCFragment {
+class LLVM_CLASS_ABI MCCVInlineLineTableFragment : public MCFragment {
   unsigned SiteFuncId;
   unsigned StartFileId;
   unsigned StartLineNum;
@@ -551,7 +551,7 @@ class MCCVInlineLineTableFragment : public MCFragment {
 };
 
 /// Fragment representing the .cv_def_range directive.
-class MCCVDefRangeFragment : public MCEncodedFragmentWithFixups<32, 4> {
+class LLVM_CLASS_ABI MCCVDefRangeFragment : public MCEncodedFragmentWithFixups<32, 4> {
   SmallVector<std::pair<const MCSymbol *, const MCSymbol *>, 2> Ranges;
   SmallString<32> FixedSizePortion;
 
@@ -581,7 +581,7 @@ class MCCVDefRangeFragment : public MCEncodedFragmentWithFixups<32, 4> {
 /// Represents required padding such that a particular other set of fragments
 /// does not cross a particular power-of-two boundary. The other fragments must
 /// follow this one within the same section.
-class MCBoundaryAlignFragment : public MCFragment {
+class LLVM_CLASS_ABI MCBoundaryAlignFragment : public MCFragment {
   /// The alignment requirement of the branch to be aligned.
   Align AlignBoundary;
   /// The last fragment in the set of fragments to be aligned.
@@ -618,7 +618,7 @@ class MCBoundaryAlignFragment : public MCFragment {
   }
 };
 
-class MCPseudoProbeAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {
+class LLVM_CLASS_ABI MCPseudoProbeAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {
   /// The expression for the difference of the two symbols that
   /// make up the address delta between two .pseudoprobe directives.
   const MCExpr *AddrDelta;
diff --git a/llvm/include/llvm/MC/MCInst.h b/llvm/include/llvm/MC/MCInst.h
index a615c5f7909ad5a..ba8006de18afb5d 100644
--- a/llvm/include/llvm/MC/MCInst.h
+++ b/llvm/include/llvm/MC/MCInst.h
@@ -34,7 +34,7 @@ class raw_ostream;
 
 /// Instances of this class represent operands of the MCInst class.
 /// This is a simple discriminated union.
-class MCOperand {
+class LLVM_CLASS_ABI MCOperand {
   enum MachineOperandType : unsigned char {
     kInvalid,      ///< Uninitialized.
     kRegister,     ///< Register operand.
@@ -182,7 +182,7 @@ class MCOperand {
 
 /// Instances of this class represent a single low-level machine
 /// instruction.
-class MCInst {
+class LLVM_CLASS_ABI MCInst {
   unsigned Opcode = 0;
   // These flags could be used to pass some info from one target subcomponent
   // to another, for example, from disassembler to asm printer. The values of
diff --git a/llvm/include/llvm/MC/MCInstBuilder.h b/llvm/include/llvm/MC/MCInstBuilder.h
index c82a598454ab063..8f5681c0625e74a 100644
--- a/llvm/include/llvm/MC/MCInstBuilder.h
+++ b/llvm/include/llvm/MC/MCInstBuilder.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-class MCInstBuilder {
+class LLVM_CLASS_ABI MCInstBuilder {
   MCInst Inst;
 
 public:
diff --git a/llvm/include/llvm/MC/MCInstPrinter.h b/llvm/include/llvm/MC/MCInstPrinter.h
index 3b45dd44ff70a77..c13b9fc33723f1c 100644
--- a/llvm/include/llvm/MC/MCInstPrinter.h
+++ b/llvm/include/llvm/MC/MCInstPrinter.h
@@ -27,7 +27,7 @@ class StringRef;
 class raw_ostream;
 
 /// Convert `Bytes' to a hex string and output to `OS'
-void dumpBytes(ArrayRef<uint8_t> Bytes, raw_ostream &OS);
+LLVM_FUNC_ABI void dumpBytes(ArrayRef<uint8_t> Bytes, raw_ostream &OS);
 
 namespace HexStyle {
 
@@ -42,7 +42,7 @@ struct AliasMatchingData;
 
 /// This is an instance of a target assembly language printer that
 /// converts an MCInst to valid target assembly syntax.
-class MCInstPrinter {
+class LLVM_CLASS_ABI MCInstPrinter {
 protected:
   /// A stream that comments can be emitted to if desired.  Each comment
   /// must end with a newline.  This will be null if verbose assembly emission
@@ -144,7 +144,7 @@ class MCInstPrinter {
 };
 
 /// Map from opcode to pattern list by binary search.
-struct PatternsForOpcode {
+struct LLVM_CLASS_ABI PatternsForOpcode {
   uint32_t Opcode;
   uint16_t PatternStart;
   uint16_t NumPatterns;
@@ -152,14 +152,14 @@ struct PatternsForOpcode {
 
 /// Data for each alias pattern. Includes feature bits, string, number of
 /// operands, and a variadic list of conditions to check.
-struct AliasPattern {
+struct LLVM_CLASS_ABI AliasPattern {
   uint32_t AsmStrOffset;
   uint32_t AliasCondStart;
   uint8_t NumOperands;
   uint8_t NumConds;
 };
 
-struct AliasPatternCond {
+struct LLVM_CLASS_ABI AliasPatternCond {
   enum CondKind : uint8_t {
     K_Feature,       // Match only if a feature is enabled.
     K_NegFeature,    // Match only if a feature is disabled.
@@ -179,7 +179,7 @@ struct AliasPatternCond {
 };
 
 /// Tablegenerated data structures needed to match alias patterns.
-struct AliasMatchingData {
+struct LLVM_CLASS_ABI AliasMatchingData {
   ArrayRef<PatternsForOpcode> OpToPatterns;
   ArrayRef<AliasPattern> Patterns;
   ArrayRef<AliasPatternCond> PatternConds;
diff --git a/llvm/include/llvm/MC/MCInstrAnalysis.h b/llvm/include/llvm/MC/MCInstrAnalysis.h
index 126b94382056c20..e134406d79beb64 100644
--- a/llvm/include/llvm/MC/MCInstrAnalysis.h
+++ b/llvm/include/llvm/MC/MCInstrAnalysis.h
@@ -27,7 +27,7 @@ namespace llvm {
 class MCRegisterInfo;
 class Triple;
 
-class MCInstrAnalysis {
+class LLVM_CLASS_ABI MCInstrAnalysis {
 protected:
   friend class Target;
 
diff --git a/llvm/include/llvm/MC/MCInstrDesc.h b/llvm/include/llvm/MC/MCInstrDesc.h
index 971b97c33c48603..56f7027433b188c 100644
--- a/llvm/include/llvm/MC/MCInstrDesc.h
+++ b/llvm/include/llvm/MC/MCInstrDesc.h
@@ -83,7 +83,7 @@ enum OperandType {
 
 /// This holds information about one operand of a machine instruction,
 /// indicating the register class for register operands, etc.
-class MCOperandInfo {
+class LLVM_CLASS_ABI MCOperandInfo {
 public:
   /// This specifies the register class enumeration of the operand
   /// if the operand is a register.  If isLookupPtrRegClass is set, then this is
@@ -196,7 +196,7 @@ enum Flag {
 /// use and many other things.  There is one instance of this struct for each
 /// target instruction class, and the MachineInstr class points to this struct
 /// directly to describe itself.
-class MCInstrDesc {
+class LLVM_CLASS_ABI MCInstrDesc {
 public:
   // FIXME: Disable copies and moves.
   // Do not allow MCInstrDescs to be copied or moved. They should only exist in
diff --git a/llvm/include/llvm/MC/MCInstrInfo.h b/llvm/include/llvm/MC/MCInstrInfo.h
index e4cfcc0ae01a318..efa415b0ee61bee 100644
--- a/llvm/include/llvm/MC/MCInstrInfo.h
+++ b/llvm/include/llvm/MC/MCInstrInfo.h
@@ -24,7 +24,7 @@ class MCSubtargetInfo;
 
 //---------------------------------------------------------------------------
 /// Interface to description of machine instruction set.
-class MCInstrInfo {
+class LLVM_CLASS_ABI MCInstrInfo {
 public:
   using ComplexDeprecationPredicate = bool (*)(MCInst &,
                                                const MCSubtargetInfo &,
diff --git a/llvm/include/llvm/MC/MCInstrItineraries.h b/llvm/include/llvm/MC/MCInstrItineraries.h
index 36ddcdf2af66b71..2d03d57dd5111de 100644
--- a/llvm/include/llvm/MC/MCInstrItineraries.h
+++ b/llvm/include/llvm/MC/MCInstrItineraries.h
@@ -56,7 +56,7 @@ namespace llvm {
 /// Such two types of units reservation is used to model instruction domain
 /// change stalls, FUs using the same resource (e.g. same register file), etc.
 
-struct InstrStage {
+struct LLVM_CLASS_ABI InstrStage {
   enum ReservationKinds {
     Required = 0,
     Reserved = 1
@@ -96,7 +96,7 @@ struct InstrStage {
 /// This includes a set of stages occupied by the instruction and the pipeline
 /// cycle in which operands are read and written.
 ///
-struct InstrItinerary {
+struct LLVM_CLASS_ABI InstrItinerary {
   int16_t  NumMicroOps;        ///< # of micro-ops, -1 means it's variable
   uint16_t FirstStage;         ///< Index of first stage in itinerary
   uint16_t LastStage;          ///< Index of last + 1 stage in itinerary
@@ -107,7 +107,7 @@ struct InstrItinerary {
 //===----------------------------------------------------------------------===//
 /// Itinerary data supplied by a subtarget to be used by a target.
 ///
-class InstrItineraryData {
+class LLVM_CLASS_ABI InstrItineraryData {
 public:
   MCSchedModel SchedModel =
       MCSchedModel::GetDefaultSchedModel(); ///< Basic machine properties.
diff --git a/llvm/include/llvm/MC/MCLabel.h b/llvm/include/llvm/MC/MCLabel.h
index 21d781bb2fde2bc..520ea7326eb051a 100644
--- a/llvm/include/llvm/MC/MCLabel.h
+++ b/llvm/include/llvm/MC/MCLabel.h
@@ -22,7 +22,7 @@ class raw_ostream;
 /// Instances of this class represent a label name in the MC file,
 /// and MCLabel are created and uniqued by the MCContext class.  MCLabel
 /// should only be constructed for valid instances in the object file.
-class MCLabel {
+class LLVM_CLASS_ABI MCLabel {
   // The instance number of this Directional Local Label.
   unsigned Instance;
 
diff --git a/llvm/include/llvm/MC/MCLinkerOptimizationHint.h b/llvm/include/llvm/MC/MCLinkerOptimizationHint.h
index b994882d781ed0a..771c3b56196db56 100644
--- a/llvm/include/llvm/MC/MCLinkerOptimizationHint.h
+++ b/llvm/include/llvm/MC/MCLinkerOptimizationHint.h
@@ -100,7 +100,7 @@ static inline int MCLOHIdToNbArgs(MCLOHType Kind) {
 }
 
 /// Store Linker Optimization Hint information (LOH).
-class MCLOHDirective {
+class LLVM_CLASS_ABI MCLOHDirective {
   MCLOHType Kind;
 
   /// Arguments of this directive. Order matters.
@@ -134,7 +134,7 @@ class MCLOHDirective {
                        const MCAsmLayout &Layout) const;
 };
 
-class MCLOHContainer {
+class LLVM_CLASS_ABI MCLOHContainer {
   /// Keep track of the emit size of all the LOHs.
   mutable uint64_t EmitSize = 0;
 
diff --git a/llvm/include/llvm/MC/MCMachObjectWriter.h b/llvm/include/llvm/MC/MCMachObjectWriter.h
index 6244421bdd3d955..0aace4aaafff190 100644
--- a/llvm/include/llvm/MC/MCMachObjectWriter.h
+++ b/llvm/include/llvm/MC/MCMachObjectWriter.h
@@ -27,7 +27,7 @@ namespace llvm {
 
 class MachObjectWriter;
 
-class MCMachObjectTargetWriter : public MCObjectTargetWriter {
+class LLVM_CLASS_ABI MCMachObjectTargetWriter : public MCObjectTargetWriter {
   const unsigned Is64Bit : 1;
   const uint32_t CPUType;
 protected:
@@ -82,7 +82,7 @@ class MCMachObjectTargetWriter : public MCObjectTargetWriter {
   /// @}
 };
 
-class MachObjectWriter : public MCObjectWriter {
+class LLVM_CLASS_ABI MachObjectWriter : public MCObjectWriter {
   /// Helper struct for containing some precomputed information on symbols.
   struct MachSymbolData {
     const MCSymbol *Symbol;
@@ -276,7 +276,7 @@ class MachObjectWriter : public MCObjectWriter {
 /// \param MOTW - The target specific Mach-O writer subclass.
 /// \param OS - The stream to write to.
 /// \returns The constructed object writer.
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createMachObjectWriter(std::unique_ptr<MCMachObjectTargetWriter> MOTW,
                        raw_pwrite_stream &OS, bool IsLittleEndian);
 
diff --git a/llvm/include/llvm/MC/MCObjectFileInfo.h b/llvm/include/llvm/MC/MCObjectFileInfo.h
index 3ed0693f7d28788..0e0d8a67d03b663 100644
--- a/llvm/include/llvm/MC/MCObjectFileInfo.h
+++ b/llvm/include/llvm/MC/MCObjectFileInfo.h
@@ -26,7 +26,7 @@ namespace llvm {
 class MCContext;
 class MCSection;
 
-class MCObjectFileInfo {
+class LLVM_CLASS_ABI MCObjectFileInfo {
 protected:
   /// True if target object file supports a weak_definition of constant 0 for an
   /// omitted EH frame.
diff --git a/llvm/include/llvm/MC/MCObjectStreamer.h b/llvm/include/llvm/MC/MCObjectStreamer.h
index f0c5ee2753a0009..5552407bd75474b 100644
--- a/llvm/include/llvm/MC/MCObjectStreamer.h
+++ b/llvm/include/llvm/MC/MCObjectStreamer.h
@@ -40,7 +40,7 @@ class raw_pwrite_stream;
 /// are expected to subclass this interface to implement directives specific
 /// to that file format or custom semantics expected by the object writer
 /// implementation.
-class MCObjectStreamer : public MCStreamer {
+class LLVM_CLASS_ABI MCObjectStreamer : public MCStreamer {
   std::unique_ptr<MCAssembler> Assembler;
   MCSection::iterator CurInsertionPoint;
   bool EmitEHFrame;
diff --git a/llvm/include/llvm/MC/MCObjectWriter.h b/llvm/include/llvm/MC/MCObjectWriter.h
index 5bf6631c5a8254e..7312b5418b05cbd 100644
--- a/llvm/include/llvm/MC/MCObjectWriter.h
+++ b/llvm/include/llvm/MC/MCObjectWriter.h
@@ -32,7 +32,7 @@ class MCValue;
 /// points. Once assembly is complete, the object writer is given the
 /// MCAssembler instance, which contains all the symbol and section data which
 /// should be emitted as part of writeObject().
-class MCObjectWriter {
+class LLVM_CLASS_ABI MCObjectWriter {
 protected:
   std::vector<const MCSymbol *> AddrsigSyms;
   bool EmitAddrsigSection = false;
@@ -123,7 +123,7 @@ class MCObjectWriter {
 
 /// Base class for classes that define behaviour that is specific to both the
 /// target and the object format.
-class MCObjectTargetWriter {
+class LLVM_CLASS_ABI MCObjectTargetWriter {
 public:
   virtual ~MCObjectTargetWriter() = default;
   virtual Triple::ObjectFormatType getFormat() const = 0;
diff --git a/llvm/include/llvm/MC/MCParser/AsmCond.h b/llvm/include/llvm/MC/MCParser/AsmCond.h
index 6b8c8ae4b508dd7..6721f90fbf28f77 100644
--- a/llvm/include/llvm/MC/MCParser/AsmCond.h
+++ b/llvm/include/llvm/MC/MCParser/AsmCond.h
@@ -20,7 +20,7 @@ namespace llvm {
 /// processing.  Ignore can be either true or false.  When true we are ignoring
 /// the block of code in the middle of a conditional.
 
-class AsmCond {
+class LLVM_CLASS_ABI AsmCond {
 public:
   enum ConditionalAssemblyType {
     NoCond,     // no conditional is being processed
diff --git a/llvm/include/llvm/MC/MCParser/AsmLexer.h b/llvm/include/llvm/MC/MCParser/AsmLexer.h
index 0a0c59f6dbfdc79..0f160f711d3a728 100644
--- a/llvm/include/llvm/MC/MCParser/AsmLexer.h
+++ b/llvm/include/llvm/MC/MCParser/AsmLexer.h
@@ -23,7 +23,7 @@ namespace llvm {
 class MCAsmInfo;
 
 /// AsmLexer - Lexer class for assembly files.
-class AsmLexer : public MCAsmLexer {
+class LLVM_CLASS_ABI AsmLexer : public MCAsmLexer {
   const MCAsmInfo &MAI;
 
   const char *CurPtr = nullptr;
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmLexer.h b/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
index 3ea594ed3bfdaa4..6d58efd95b826ba 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmLexer.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 /// A callback class which is notified of each comment in an assembly file as
 /// it is lexed.
-class AsmCommentConsumer {
+class LLVM_CLASS_ABI AsmCommentConsumer {
 public:
   virtual ~AsmCommentConsumer() = default;
 
@@ -35,7 +35,7 @@ class AsmCommentConsumer {
 
 /// Generic assembler lexer interface, for use by target specific assembly
 /// lexers.
-class MCAsmLexer {
+class LLVM_CLASS_ABI MCAsmLexer {
   /// The current token, stored in the base class for faster access.
   SmallVector<AsmToken, 1> CurTok;
 
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParser.h b/llvm/include/llvm/MC/MCParser/MCAsmParser.h
index 1c36cd17efe447e..9fc9ad6223a60fa 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParser.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParser.h
@@ -34,7 +34,7 @@ class MCStreamer;
 class MCTargetAsmParser;
 class SourceMgr;
 
-struct InlineAsmIdentifierInfo {
+struct LLVM_CLASS_ABI InlineAsmIdentifierInfo {
   enum IdKind {
     IK_Invalid,  // Initial state. Unexpected after a successful parsing.
     IK_Label,    // Function/Label reference.
@@ -93,20 +93,20 @@ struct InlineAsmIdentifierInfo {
 
 // Generic type information for an assembly object.
 // All sizes measured in bytes.
-struct AsmTypeInfo {
+struct LLVM_CLASS_ABI AsmTypeInfo {
   StringRef Name;
   unsigned Size = 0;
   unsigned ElementSize = 0;
   unsigned Length = 0;
 };
 
-struct AsmFieldInfo {
+struct LLVM_CLASS_ABI AsmFieldInfo {
   AsmTypeInfo Type;
   unsigned Offset = 0;
 };
 
 /// Generic Sema callback for assembly parser.
-class MCAsmParserSemaCallback {
+class LLVM_CLASS_ABI MCAsmParserSemaCallback {
 public:
   virtual ~MCAsmParserSemaCallback();
 
@@ -121,7 +121,7 @@ class MCAsmParserSemaCallback {
 
 /// Generic assembler parser interface, for use by target specific
 /// assembly parsers.
-class MCAsmParser {
+class LLVM_CLASS_ABI MCAsmParser {
 public:
   using DirectiveHandler = bool (*)(MCAsmParserExtension*, StringRef, SMLoc);
   using ExtensionDirectiveHandler =
@@ -348,11 +348,11 @@ class MCAsmParser {
 };
 
 /// Create an MCAsmParser instance for parsing assembly similar to gas syntax
-MCAsmParser *createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &,
+LLVM_FUNC_ABI MCAsmParser *createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &,
                                const MCAsmInfo &, unsigned CB = 0);
 
 /// Create an MCAsmParser instance for parsing Microsoft MASM-style assembly
-MCAsmParser *createMCMasmParser(SourceMgr &, MCContext &, MCStreamer &,
+LLVM_FUNC_ABI MCAsmParser *createMCMasmParser(SourceMgr &, MCContext &, MCStreamer &,
                                 const MCAsmInfo &, struct tm, unsigned CB = 0);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h b/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
index ac1cf673e4ed5a2..9f90d685eb7018c 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
@@ -22,7 +22,7 @@ class Twine;
 /// Generic interface for extending the MCAsmParser,
 /// which is implemented by target and object file assembly parser
 /// implementations.
-class MCAsmParserExtension {
+class LLVM_CLASS_ABI MCAsmParserExtension {
   MCAsmParser *Parser = nullptr;
 
 protected:
diff --git a/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h b/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
index 603c740d44300e7..4a02b921e9ad5b7 100644
--- a/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
+++ b/llvm/include/llvm/MC/MCParser/MCAsmParserUtils.h
@@ -24,7 +24,7 @@ namespace MCParserUtils {
 /// with the given name.
 ///
 /// On success, returns false and sets the Symbol and Value output parameters.
-bool parseAssignmentExpression(StringRef Name, bool allow_redef,
+LLVM_FUNC_ABI bool parseAssignmentExpression(StringRef Name, bool allow_redef,
                                MCAsmParser &Parser, MCSymbol *&Symbol,
                                const MCExpr *&Value);
 
diff --git a/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h b/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h
index 59583b16b7c1afd..4ca58f9aabbb66f 100644
--- a/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h
+++ b/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h
@@ -22,7 +22,7 @@ class raw_ostream;
 /// instruction operand.  It should be subclassed by target-specific code.  This
 /// base class is used by target-independent clients and is the interface
 /// between parsing an asm instruction and recognizing it.
-class MCParsedAsmOperand {
+class LLVM_CLASS_ABI MCParsedAsmOperand {
   /// MCOperandNum - The corresponding MCInst operand number.  Only valid when
   /// parsing MS-style inline assembly.
   unsigned MCOperandNum = ~0u;
diff --git a/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h b/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
index 3eecace2f7e2d73..7776bb4b4a22a46 100644
--- a/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
+++ b/llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
@@ -63,7 +63,7 @@ const char AsmRewritePrecedence [] = {
 
 // Represent the various parts which make up an intel expression,
 // used for emitting compound intel expressions
-struct IntelExpr {
+struct LLVM_CLASS_ABI IntelExpr {
   bool NeedBracs = false;
   int64_t Imm = 0;
   StringRef BaseReg;
@@ -93,7 +93,7 @@ struct IntelExpr {
   }
 };
 
-struct AsmRewrite {
+struct LLVM_CLASS_ABI AsmRewrite {
   AsmRewriteKind Kind;
   SMLoc Loc;
   unsigned Len;
@@ -115,7 +115,7 @@ struct AsmRewrite {
     : AsmRewrite(AOK_IntelExpr, loc, len) { IntelExp = exp; }
 };
 
-struct ParseInstructionInfo {
+struct LLVM_CLASS_ABI ParseInstructionInfo {
   SmallVectorImpl<AsmRewrite> *AsmRewrites = nullptr;
 
   ParseInstructionInfo() = default;
@@ -130,7 +130,7 @@ enum OperandMatchResultTy {
 };
 
 /// Ternary parse status returned by various parse* methods.
-class ParseStatus {
+class LLVM_CLASS_ABI ParseStatus {
   enum class StatusTy { Success, Failure, NoMatch } Status;
 
 public:
@@ -198,7 +198,7 @@ enum class DiagnosticPredicateTy {
 // below which collects *all* possible diagnostics. This alternative
 // is optional and fully backward compatible with existing
 // PredicateMethods that return a 'bool' (match or no match).
-struct DiagnosticPredicate {
+struct LLVM_CLASS_ABI DiagnosticPredicate {
   DiagnosticPredicateTy Type;
 
   explicit DiagnosticPredicate(bool Match)
@@ -219,7 +219,7 @@ struct DiagnosticPredicate {
 // the programmer intended to use, so we want to report an error which mentions
 // each of these "near-miss" encodings. This struct contains information about
 // one such encoding, and why it did not match the parsed instruction.
-class NearMissInfo {
+class LLVM_CLASS_ABI NearMissInfo {
 public:
   enum NearMissKind {
     NoNearMiss,
@@ -348,7 +348,7 @@ class NearMissInfo {
 };
 
 /// MCTargetAsmParser - Generic interface to target specific assembly parsers.
-class MCTargetAsmParser : public MCAsmParserExtension {
+class LLVM_CLASS_ABI MCTargetAsmParser : public MCAsmParserExtension {
 public:
   enum MatchResultTy {
     Match_InvalidOperand,
diff --git a/llvm/include/llvm/MC/MCPseudoProbe.h b/llvm/include/llvm/MC/MCPseudoProbe.h
index d3625723c5df307..fa400f740f674ea 100644
--- a/llvm/include/llvm/MC/MCPseudoProbe.h
+++ b/llvm/include/llvm/MC/MCPseudoProbe.h
@@ -83,7 +83,7 @@ enum class MCPseudoProbeFlag {
 };
 
 // Function descriptor decoded from .pseudo_probe_desc section
-struct MCPseudoProbeFuncDesc {
+struct LLVM_CLASS_ABI MCPseudoProbeFuncDesc {
   uint64_t FuncGUID = 0;
   uint64_t FuncHash = 0;
   std::string FuncName;
@@ -108,7 +108,7 @@ using AddressProbesMap =
 
 class MCDecodedPseudoProbeInlineTree;
 
-class MCPseudoProbeBase {
+class LLVM_CLASS_ABI MCPseudoProbeBase {
 protected:
   uint64_t Guid;
   uint64_t Index;
@@ -157,7 +157,7 @@ class MCPseudoProbeBase {
 /// table entry, which is created during a machine instruction is assembled and
 /// uses an address from a temporary label created at the current address in the
 /// current section.
-class MCPseudoProbe : public MCPseudoProbeBase {
+class LLVM_CLASS_ABI MCPseudoProbe : public MCPseudoProbeBase {
   MCSymbol *Label;
 
 public:
@@ -177,7 +177,7 @@ class MCPseudoProbe : public MCPseudoProbeBase {
 // Represents a callsite with caller function name and probe id
 using MCPseduoProbeFrameLocation = std::pair<StringRef, uint32_t>;
 
-class MCDecodedPseudoProbe : public MCPseudoProbeBase {
+class LLVM_CLASS_ABI MCDecodedPseudoProbe : public MCPseudoProbeBase {
   uint64_t Address;
   MCDecodedPseudoProbeInlineTree *InlineTree;
 
@@ -213,7 +213,7 @@ class MCDecodedPseudoProbe : public MCPseudoProbeBase {
 };
 
 template <typename ProbeType, typename DerivedProbeInlineTreeType>
-class MCPseudoProbeInlineTreeBase {
+class LLVM_CLASS_ABI MCPseudoProbeInlineTreeBase {
   struct InlineSiteHash {
     uint64_t operator()(const InlineSite &Site) const {
       return std::get<0>(Site) ^ std::get<1>(Site);
@@ -259,7 +259,7 @@ class MCPseudoProbeInlineTreeBase {
 // instance is created as the root of a tree.
 // A real instance of this class is created for each function, either a
 // not inlined function that has code in .text section or an inlined function.
-class MCPseudoProbeInlineTree
+class LLVM_CLASS_ABI MCPseudoProbeInlineTree
     : public MCPseudoProbeInlineTreeBase<MCPseudoProbe,
                                          MCPseudoProbeInlineTree> {
 public:
@@ -276,7 +276,7 @@ class MCPseudoProbeInlineTree
 };
 
 // inline tree node for the decoded pseudo probe
-class MCDecodedPseudoProbeInlineTree
+class LLVM_CLASS_ABI MCDecodedPseudoProbeInlineTree
     : public MCPseudoProbeInlineTreeBase<MCDecodedPseudoProbe *,
                                          MCDecodedPseudoProbeInlineTree> {
 public:
@@ -293,7 +293,7 @@ class MCDecodedPseudoProbeInlineTree
 
 /// Instances of this class represent the pseudo probes inserted into a compile
 /// unit.
-class MCPseudoProbeSections {
+class LLVM_CLASS_ABI MCPseudoProbeSections {
 public:
   void addPseudoProbe(MCSymbol *FuncSym, const MCPseudoProbe &Probe,
                       const MCPseudoProbeInlineStack &InlineStack) {
@@ -317,7 +317,7 @@ class MCPseudoProbeSections {
   void emit(MCObjectStreamer *MCOS);
 };
 
-class MCPseudoProbeTable {
+class LLVM_CLASS_ABI MCPseudoProbeTable {
   // A collection of MCPseudoProbe in the current module grouped by
   // functions. MCPseudoProbes will be encoded into a corresponding
   // .pseudoprobe section. With functions emitted as separate comdats,
@@ -336,7 +336,7 @@ class MCPseudoProbeTable {
 #endif
 };
 
-class MCPseudoProbeDecoder {
+class LLVM_CLASS_ABI MCPseudoProbeDecoder {
   // GUID to PseudoProbeFuncDesc map.
   GUIDProbeFunctionMap GUID2FuncDescMap;
 
diff --git a/llvm/include/llvm/MC/MCRegister.h b/llvm/include/llvm/MC/MCRegister.h
index 82f5477e510d0af..216fa43fc73ad7b 100644
--- a/llvm/include/llvm/MC/MCRegister.h
+++ b/llvm/include/llvm/MC/MCRegister.h
@@ -31,8 +31,8 @@ using MCPhysReg = uint16_t;
 using MCRegUnit = unsigned;
 
 /// Wrapper class representing physical registers. Should be passed by value.
-class MCRegister {
-  friend hash_code hash_value(const MCRegister &);
+class LLVM_CLASS_ABI MCRegister {
+  friend LLVM_FUNC_ABI hash_code hash_value(const MCRegister &);
   unsigned Reg;
 
 public:
@@ -107,7 +107,7 @@ class MCRegister {
 };
 
 // Provide DenseMapInfo for MCRegister
-template <> struct DenseMapInfo<MCRegister> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<MCRegister> {
   static inline unsigned getEmptyKey() {
     return DenseMapInfo<unsigned>::getEmptyKey();
   }
diff --git a/llvm/include/llvm/MC/MCRegisterInfo.h b/llvm/include/llvm/MC/MCRegisterInfo.h
index 3afdd70e16b1d06..4b85aa94af252f4 100644
--- a/llvm/include/llvm/MC/MCRegisterInfo.h
+++ b/llvm/include/llvm/MC/MCRegisterInfo.h
@@ -33,7 +33,7 @@ class MCSubRegIterator;
 class MCSuperRegIterator;
 
 /// MCRegisterClass - Base class of TargetRegisterClass.
-class MCRegisterClass {
+class LLVM_CLASS_ABI MCRegisterClass {
 public:
   using iterator = const MCPhysReg*;
   using const_iterator = const MCPhysReg*;
@@ -107,7 +107,7 @@ class MCRegisterClass {
 /// super-registers of the specific register, e.g. RAX, EAX, are
 /// super-registers of AX.
 ///
-struct MCRegisterDesc {
+struct LLVM_CLASS_ABI MCRegisterDesc {
   uint32_t Name;      // Printable name for the reg (for debugging)
   uint32_t SubRegs;   // Sub-register set, described above
   uint32_t SuperRegs; // Super-register set, described above
@@ -137,7 +137,7 @@ struct MCRegisterDesc {
 /// TableGen generated physical register data. It must not be extended with
 /// virtual methods.
 ///
-class MCRegisterInfo {
+class LLVM_CLASS_ABI MCRegisterInfo {
 public:
   using regclass_iterator = const MCRegisterClass *;
 
@@ -508,7 +508,7 @@ class MCRegisterInfo {
 
 /// MCSubRegIterator enumerates all sub-registers of Reg.
 /// If IncludeSelf is set, Reg itself is included in the list.
-class MCSubRegIterator
+class LLVM_CLASS_ABI MCSubRegIterator
     : public iterator_adaptor_base<MCSubRegIterator,
                                    MCRegisterInfo::DiffListIterator,
                                    std::forward_iterator_tag, const MCPhysReg> {
@@ -543,7 +543,7 @@ class MCSubRegIterator
 
 /// Iterator that enumerates the sub-registers of a Reg and the associated
 /// sub-register indices.
-class MCSubRegIndexIterator {
+class LLVM_CLASS_ABI MCSubRegIndexIterator {
   MCSubRegIterator SRIter;
   const uint16_t *SRIndex;
 
@@ -577,7 +577,7 @@ class MCSubRegIndexIterator {
 
 /// MCSuperRegIterator enumerates all super-registers of Reg.
 /// If IncludeSelf is set, Reg itself is included in the list.
-class MCSuperRegIterator
+class LLVM_CLASS_ABI MCSuperRegIterator
     : public iterator_adaptor_base<MCSuperRegIterator,
                                    MCRegisterInfo::DiffListIterator,
                                    std::forward_iterator_tag, const MCPhysReg> {
@@ -622,7 +622,7 @@ inline bool MCRegisterInfo::isSuperRegister(MCRegister RegA, MCRegister RegB) co
 
 // MCRegUnitIterator enumerates a list of register units for Reg. The list is
 // in ascending numerical order.
-class MCRegUnitIterator
+class LLVM_CLASS_ABI MCRegUnitIterator
     : public iterator_adaptor_base<MCRegUnitIterator,
                                    MCRegisterInfo::DiffListIterator,
                                    std::forward_iterator_tag, const MCRegUnit> {
@@ -661,7 +661,7 @@ class MCRegUnitIterator
 /// MCRegUnitMaskIterator enumerates a list of register units and their
 /// associated lane masks for Reg. The register units are in ascending
 /// numerical order.
-class MCRegUnitMaskIterator {
+class LLVM_CLASS_ABI MCRegUnitMaskIterator {
   MCRegUnitIterator RUIter;
   const LaneBitmask *MaskListIter;
 
@@ -701,7 +701,7 @@ class MCRegUnitMaskIterator {
 //    }
 
 /// MCRegUnitRootIterator enumerates the root registers of a register unit.
-class MCRegUnitRootIterator {
+class LLVM_CLASS_ABI MCRegUnitRootIterator {
   uint16_t Reg0 = 0;
   uint16_t Reg1 = 0;
 
@@ -735,7 +735,7 @@ class MCRegUnitRootIterator {
 /// MCRegAliasIterator enumerates all registers aliasing Reg.  If IncludeSelf is
 /// set, Reg itself is included in the list.  This iterator does not guarantee
 /// any ordering or that entries are unique.
-class MCRegAliasIterator {
+class LLVM_CLASS_ABI MCRegAliasIterator {
 private:
   MCRegister Reg;
   const MCRegisterInfo *MCRI;
diff --git a/llvm/include/llvm/MC/MCSPIRVObjectWriter.h b/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
index 8c8c1b43f8da0cd..3ce41b9c9f85ff7 100644
--- a/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
+++ b/llvm/include/llvm/MC/MCSPIRVObjectWriter.h
@@ -16,7 +16,7 @@
 
 namespace llvm {
 
-class MCSPIRVObjectTargetWriter : public MCObjectTargetWriter {
+class LLVM_CLASS_ABI MCSPIRVObjectTargetWriter : public MCObjectTargetWriter {
 protected:
   explicit MCSPIRVObjectTargetWriter() {}
 
@@ -32,7 +32,7 @@ class MCSPIRVObjectTargetWriter : public MCObjectTargetWriter {
 /// \param MOTW - The target specific SPIR-V writer subclass.
 /// \param OS - The stream to write to.
 /// \returns The constructed object writer.
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createSPIRVObjectWriter(std::unique_ptr<MCSPIRVObjectTargetWriter> MOTW,
                         raw_pwrite_stream &OS);
 
diff --git a/llvm/include/llvm/MC/MCSPIRVStreamer.h b/llvm/include/llvm/MC/MCSPIRVStreamer.h
index 43cfdbb28acfb47..282edd946e706d3 100644
--- a/llvm/include/llvm/MC/MCSPIRVStreamer.h
+++ b/llvm/include/llvm/MC/MCSPIRVStreamer.h
@@ -23,7 +23,7 @@ namespace llvm {
 class MCInst;
 class raw_ostream;
 
-class MCSPIRVStreamer : public MCObjectStreamer {
+class LLVM_CLASS_ABI MCSPIRVStreamer : public MCObjectStreamer {
 public:
   MCSPIRVStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
                   std::unique_ptr<MCObjectWriter> OW,
diff --git a/llvm/include/llvm/MC/MCSchedule.h b/llvm/include/llvm/MC/MCSchedule.h
index 06f8e3fd24865b2..5fda2fa99957d97 100644
--- a/llvm/include/llvm/MC/MCSchedule.h
+++ b/llvm/include/llvm/MC/MCSchedule.h
@@ -29,7 +29,7 @@ class MCInst;
 class InstrItineraryData;
 
 /// Define a kind of processor resource that will be modeled by the scheduler.
-struct MCProcResourceDesc {
+struct LLVM_CLASS_ABI MCProcResourceDesc {
   const char *Name;
   unsigned NumUnits; // Number of resource of this kind
   unsigned SuperIdx; // Index of the resources kind that contains this kind.
@@ -65,7 +65,7 @@ struct MCProcResourceDesc {
 /// `AcquireAtCycle` and `ReleaseAtCycle` respectively, to stress the
 /// fact that resource allocation is now represented as an interval,
 /// relatively to the issue cycle of the instruction.
-struct MCWriteProcResEntry {
+struct LLVM_CLASS_ABI MCWriteProcResEntry {
   uint16_t ProcResourceIdx;
   /// Cycle at which the resource will be released by an instruction,
   /// relatively to the cycle in which the instruction is issued
@@ -87,7 +87,7 @@ struct MCWriteProcResEntry {
 /// an instruction with invalid latency to have infinite latency.  Also identify
 /// the WriteResources of this def. When the operand expands to a sequence of
 /// writes, this ID is the last write in the sequence.
-struct MCWriteLatencyEntry {
+struct LLVM_CLASS_ABI MCWriteLatencyEntry {
   int16_t Cycles;
   uint16_t WriteResourceID;
 
@@ -104,7 +104,7 @@ struct MCWriteLatencyEntry {
 ///
 /// MCReadAdvanceEntries are sorted first by operand index (UseIdx), then by
 /// WriteResourceIdx.
-struct MCReadAdvanceEntry {
+struct LLVM_CLASS_ABI MCReadAdvanceEntry {
   unsigned UseIdx;
   unsigned WriteResourceID;
   int Cycles;
@@ -119,7 +119,7 @@ struct MCReadAdvanceEntry {
 /// particular scheduling class.
 ///
 /// Defined as an aggregate struct for creating tables with initializer lists.
-struct MCSchedClassDesc {
+struct LLVM_CLASS_ABI MCSchedClassDesc {
   static const unsigned short InvalidNumMicroOps = (1U << 13) - 1;
   static const unsigned short VariantNumMicroOps = InvalidNumMicroOps - 1;
 
@@ -152,7 +152,7 @@ struct MCSchedClassDesc {
 /// and each COP updates a physical register. Basically, on Jaguar, a YMM
 /// register write effectively consumes two physical registers. That means,
 /// the cost of a YMM write in the BtVer2 model is 2.
-struct MCRegisterCostEntry {
+struct LLVM_CLASS_ABI MCRegisterCostEntry {
   unsigned RegisterClassID;
   unsigned Cost;
   bool AllowMoveElimination;
@@ -167,7 +167,7 @@ struct MCRegisterCostEntry {
 /// of read/write ports to the register file.  A value of zero for field
 /// 'NumPhysRegs' means: this register file has an unbounded number of physical
 /// registers.
-struct MCRegisterFileDesc {
+struct LLVM_CLASS_ABI MCRegisterFileDesc {
   const char *Name;
   uint16_t NumPhysRegs;
   uint16_t NumRegisterCostEntries;
@@ -187,7 +187,7 @@ struct MCRegisterFileDesc {
 /// normally used by the LLVM machine schedulers, but that can be consumed by
 /// external tools like llvm-mca to improve the quality of the peformance
 /// analysis.
-struct MCExtraProcessorInfo {
+struct LLVM_CLASS_ABI MCExtraProcessorInfo {
   // Actual size of the reorder buffer in hardware.
   unsigned ReorderBufferSize;
   // Number of instructions retired per cycle.
@@ -254,7 +254,7 @@ struct MCExtraProcessorInfo {
 /// the latency between pairs of instructions. However, they can still be used
 /// to detect potential bottlenecks across a sequence of instructions and bias
 /// the scheduling heuristics appropriately.
-struct MCSchedModel {
+struct LLVM_CLASS_ABI MCSchedModel {
   // IssueWidth is the maximum number of instructions that may be scheduled in
   // the same per-cycle group. This is meant to be a hard in-order constraint
   // (a.k.a. "hazard"). In the GenericScheduler strategy, no more than
diff --git a/llvm/include/llvm/MC/MCSection.h b/llvm/include/llvm/MC/MCSection.h
index 89fd6ba43277182..7c967ac7b4fbb06 100644
--- a/llvm/include/llvm/MC/MCSection.h
+++ b/llvm/include/llvm/MC/MCSection.h
@@ -31,13 +31,13 @@ class MCSymbol;
 class raw_ostream;
 class Triple;
 
-template <> struct ilist_alloc_traits<MCFragment> {
+template <> struct LLVM_CLASS_ABI ilist_alloc_traits<MCFragment> {
   static void deleteNode(MCFragment *V);
 };
 
 /// Instances of this class represent a uniqued identifier for a section in the
 /// current translation unit.  The MCContext class uniques and creates these.
-class MCSection {
+class LLVM_CLASS_ABI MCSection {
 public:
   static constexpr unsigned NonUniqueID = ~0U;
 
diff --git a/llvm/include/llvm/MC/MCSectionCOFF.h b/llvm/include/llvm/MC/MCSectionCOFF.h
index c84747a2deffac3..f7efc83b03f455a 100644
--- a/llvm/include/llvm/MC/MCSectionCOFF.h
+++ b/llvm/include/llvm/MC/MCSectionCOFF.h
@@ -24,7 +24,7 @@ namespace llvm {
 class MCSymbol;
 
 /// This represents a section on Windows
-class MCSectionCOFF final : public MCSection {
+class LLVM_CLASS_ABI MCSectionCOFF final : public MCSection {
   // FIXME: The following fields should not be mutable, but are for now so the
   // asm parser can honor the .linkonce directive.
 
diff --git a/llvm/include/llvm/MC/MCSectionDXContainer.h b/llvm/include/llvm/MC/MCSectionDXContainer.h
index 7fdd3282eb0e3c7..c19556363b957a2 100644
--- a/llvm/include/llvm/MC/MCSectionDXContainer.h
+++ b/llvm/include/llvm/MC/MCSectionDXContainer.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 class MCSymbol;
 
-class MCSectionDXContainer final : public MCSection {
+class LLVM_CLASS_ABI MCSectionDXContainer final : public MCSection {
   friend class MCContext;
 
   MCSectionDXContainer(StringRef Name, SectionKind K, MCSymbol *Begin)
diff --git a/llvm/include/llvm/MC/MCSectionELF.h b/llvm/include/llvm/MC/MCSectionELF.h
index 152e2bcff8ff43c..cec6981a876e99d 100644
--- a/llvm/include/llvm/MC/MCSectionELF.h
+++ b/llvm/include/llvm/MC/MCSectionELF.h
@@ -24,7 +24,7 @@ namespace llvm {
 
 /// This represents a section on linux, lots of unix variants and some bare
 /// metal systems.
-class MCSectionELF final : public MCSection {
+class LLVM_CLASS_ABI MCSectionELF final : public MCSection {
   /// This is the sh_type field of a section, drawn from the enums below.
   unsigned Type;
 
diff --git a/llvm/include/llvm/MC/MCSectionGOFF.h b/llvm/include/llvm/MC/MCSectionGOFF.h
index 1f98199eea5a7f8..3d95b8ef32e0274 100644
--- a/llvm/include/llvm/MC/MCSectionGOFF.h
+++ b/llvm/include/llvm/MC/MCSectionGOFF.h
@@ -24,7 +24,7 @@ namespace llvm {
 
 class MCExpr;
 
-class MCSectionGOFF final : public MCSection {
+class LLVM_CLASS_ABI MCSectionGOFF final : public MCSection {
 private:
   MCSection *Parent;
   const MCExpr *SubsectionId;
diff --git a/llvm/include/llvm/MC/MCSectionMachO.h b/llvm/include/llvm/MC/MCSectionMachO.h
index b9ab4422e8d1d10..e32cefeaa398905 100644
--- a/llvm/include/llvm/MC/MCSectionMachO.h
+++ b/llvm/include/llvm/MC/MCSectionMachO.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 /// This represents a section on a Mach-O system (used by Mac OS X).  On a Mac
 /// system, these are also described in /usr/include/mach-o/loader.h.
-class MCSectionMachO final : public MCSection {
+class LLVM_CLASS_ABI MCSectionMachO final : public MCSection {
   char SegmentName[16];  // Not necessarily null terminated!
 
   /// This is the SECTION_TYPE and SECTION_ATTRIBUTES field of a section, drawn
diff --git a/llvm/include/llvm/MC/MCSectionSPIRV.h b/llvm/include/llvm/MC/MCSectionSPIRV.h
index ba9a16cd32a3170..82ea7ca8dfb8d31 100644
--- a/llvm/include/llvm/MC/MCSectionSPIRV.h
+++ b/llvm/include/llvm/MC/MCSectionSPIRV.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 class MCSymbol;
 
-class MCSectionSPIRV final : public MCSection {
+class LLVM_CLASS_ABI MCSectionSPIRV final : public MCSection {
   friend class MCContext;
 
   MCSectionSPIRV(SectionKind K, MCSymbol *Begin)
diff --git a/llvm/include/llvm/MC/MCSectionWasm.h b/llvm/include/llvm/MC/MCSectionWasm.h
index 4c9b5d8886aa306..e08bdbc7b235139 100644
--- a/llvm/include/llvm/MC/MCSectionWasm.h
+++ b/llvm/include/llvm/MC/MCSectionWasm.h
@@ -24,7 +24,7 @@ class StringRef;
 class raw_ostream;
 
 /// This represents a section on wasm.
-class MCSectionWasm final : public MCSection {
+class LLVM_CLASS_ABI MCSectionWasm final : public MCSection {
   unsigned UniqueID;
 
   const MCSymbolWasm *Group;
diff --git a/llvm/include/llvm/MC/MCSectionXCOFF.h b/llvm/include/llvm/MC/MCSectionXCOFF.h
index 65092b14ab3585a..5aea7b52a89e43b 100644
--- a/llvm/include/llvm/MC/MCSectionXCOFF.h
+++ b/llvm/include/llvm/MC/MCSectionXCOFF.h
@@ -30,7 +30,7 @@ namespace llvm {
 // 3) An external reference providing a symbol table entry for a symbol
 //    contained in another XCOFF object file. External reference csects are not
 //    implemented yet.
-class MCSectionXCOFF final : public MCSection {
+class LLVM_CLASS_ABI MCSectionXCOFF final : public MCSection {
   friend class MCContext;
 
   std::optional<XCOFF::CsectProperties> CsectProp;
diff --git a/llvm/include/llvm/MC/MCStreamer.h b/llvm/include/llvm/MC/MCStreamer.h
index 09b6fd664af75ad..82ebb1fb316921c 100644
--- a/llvm/include/llvm/MC/MCStreamer.h
+++ b/llvm/include/llvm/MC/MCStreamer.h
@@ -91,7 +91,7 @@ using MCSectionSubPair = std::pair<MCSection *, const MCExpr *>;
 /// The base classes FooTargetAsmStreamer and FooTargetELFStreamer should
 /// *never* be treated differently. Callers should always talk to a
 /// FooTargetStreamer.
-class MCTargetStreamer {
+class LLVM_CLASS_ABI MCTargetStreamer {
 protected:
   MCStreamer &Streamer;
 
@@ -133,7 +133,7 @@ class MCTargetStreamer {
 
 // FIXME: declared here because it is used from
 // lib/CodeGen/AsmPrinter/ARMException.cpp.
-class ARMTargetStreamer : public MCTargetStreamer {
+class LLVM_CLASS_ABI ARMTargetStreamer : public MCTargetStreamer {
 public:
   ARMTargetStreamer(MCStreamer &S);
   ~ARMTargetStreamer() override;
@@ -210,7 +210,7 @@ class ARMTargetStreamer : public MCTargetStreamer {
 /// There are multiple implementations of this interface: one for writing out
 /// a .s file, and implementations that write out .o files of various formats.
 ///
-class MCStreamer {
+class LLVM_CLASS_ABI MCStreamer {
   MCContext &Context;
   std::unique_ptr<MCTargetStreamer> TargetStreamer;
 
@@ -1170,7 +1170,7 @@ class MCStreamer {
 
 /// Create a dummy machine code streamer, which does nothing. This is useful for
 /// timing the assembler front end.
-MCStreamer *createNullStreamer(MCContext &Ctx);
+LLVM_FUNC_ABI MCStreamer *createNullStreamer(MCContext &Ctx);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/MC/MCSubtargetInfo.h b/llvm/include/llvm/MC/MCSubtargetInfo.h
index ab45d1873fb1811..2c49de4216ef317 100644
--- a/llvm/include/llvm/MC/MCSubtargetInfo.h
+++ b/llvm/include/llvm/MC/MCSubtargetInfo.h
@@ -33,7 +33,7 @@ class MCInst;
 //===----------------------------------------------------------------------===//
 
 /// Used to provide key value pairs for feature and CPU bit flags.
-struct SubtargetFeatureKV {
+struct LLVM_CLASS_ABI SubtargetFeatureKV {
   const char *Key;                      ///< K-V key string
   const char *Desc;                     ///< Help descriptor
   unsigned Value;                       ///< K-V integer value
@@ -53,7 +53,7 @@ struct SubtargetFeatureKV {
 //===----------------------------------------------------------------------===//
 
 /// Used to provide key value pairs for feature and CPU bit flags.
-struct SubtargetSubTypeKV {
+struct LLVM_CLASS_ABI SubtargetSubTypeKV {
   const char *Key;                      ///< K-V key string
   FeatureBitArray Implies;              ///< K-V bit mask
   FeatureBitArray TuneImplies;          ///< K-V bit mask
@@ -74,7 +74,7 @@ struct SubtargetSubTypeKV {
 ///
 /// Generic base class for all target subtargets.
 ///
-class MCSubtargetInfo {
+class LLVM_CLASS_ABI MCSubtargetInfo {
   Triple TargetTriple;
   std::string CPU; // CPU being targeted.
   std::string TuneCPU; // CPU being tuned for.
diff --git a/llvm/include/llvm/MC/MCSymbol.h b/llvm/include/llvm/MC/MCSymbol.h
index a50ce48bf330dca..660b3ae6c7f27f0 100644
--- a/llvm/include/llvm/MC/MCSymbol.h
+++ b/llvm/include/llvm/MC/MCSymbol.h
@@ -39,7 +39,7 @@ class raw_ostream;
 /// If the symbol is defined/emitted into the current translation unit, the
 /// Section member is set to indicate what section it lives in.  Otherwise, if
 /// it is a reference to an external entity, it has a null section.
-class MCSymbol {
+class LLVM_CLASS_ABI MCSymbol {
 protected:
   /// The kind of the symbol.  If it is any value other than unset then this
   /// class is actually one of the appropriate subclasses of MCSymbol.
diff --git a/llvm/include/llvm/MC/MCSymbolCOFF.h b/llvm/include/llvm/MC/MCSymbolCOFF.h
index 59ec933463b3629..173ab707430e849 100644
--- a/llvm/include/llvm/MC/MCSymbolCOFF.h
+++ b/llvm/include/llvm/MC/MCSymbolCOFF.h
@@ -16,7 +16,7 @@
 
 namespace llvm {
 
-class MCSymbolCOFF : public MCSymbol {
+class LLVM_CLASS_ABI MCSymbolCOFF : public MCSymbol {
   /// This corresponds to the e_type field of the COFF symbol.
   mutable uint16_t Type = 0;
 
diff --git a/llvm/include/llvm/MC/MCSymbolELF.h b/llvm/include/llvm/MC/MCSymbolELF.h
index ef496b2feafc92d..0d74e0ffe6dffa3 100644
--- a/llvm/include/llvm/MC/MCSymbolELF.h
+++ b/llvm/include/llvm/MC/MCSymbolELF.h
@@ -12,7 +12,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class MCSymbolELF : public MCSymbol {
+class LLVM_CLASS_ABI MCSymbolELF : public MCSymbol {
   /// An expression describing how to calculate the size of a symbol. If a
   /// symbol has no size this field will be NULL.
   const MCExpr *SymbolSize = nullptr;
diff --git a/llvm/include/llvm/MC/MCSymbolGOFF.h b/llvm/include/llvm/MC/MCSymbolGOFF.h
index 6cbc7080a99a3d2..f49283e445eb5bd 100644
--- a/llvm/include/llvm/MC/MCSymbolGOFF.h
+++ b/llvm/include/llvm/MC/MCSymbolGOFF.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 
-class MCSymbolGOFF : public MCSymbol {
+class LLVM_CLASS_ABI MCSymbolGOFF : public MCSymbol {
 public:
   MCSymbolGOFF(const StringMapEntry<bool> *Name, bool IsTemporary)
       : MCSymbol(SymbolKindGOFF, Name, IsTemporary) {}
diff --git a/llvm/include/llvm/MC/MCSymbolMachO.h b/llvm/include/llvm/MC/MCSymbolMachO.h
index 14ac6faffcf14dc..e49991473f26c37 100644
--- a/llvm/include/llvm/MC/MCSymbolMachO.h
+++ b/llvm/include/llvm/MC/MCSymbolMachO.h
@@ -13,7 +13,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class MCSymbolMachO : public MCSymbol {
+class LLVM_CLASS_ABI MCSymbolMachO : public MCSymbol {
   /// We store the value for the 'desc' symbol field in the
   /// lowest 16 bits of the implementation defined flags.
   enum MachOSymbolFlags : uint16_t { // See <mach-o/nlist.h>.
diff --git a/llvm/include/llvm/MC/MCSymbolWasm.h b/llvm/include/llvm/MC/MCSymbolWasm.h
index 3f88aaf19590f4c..04bbf3f4476822c 100644
--- a/llvm/include/llvm/MC/MCSymbolWasm.h
+++ b/llvm/include/llvm/MC/MCSymbolWasm.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class MCSymbolWasm : public MCSymbol {
+class LLVM_CLASS_ABI MCSymbolWasm : public MCSymbol {
   std::optional<wasm::WasmSymbolType> Type;
   bool IsWeak = false;
   bool IsHidden = false;
diff --git a/llvm/include/llvm/MC/MCSymbolXCOFF.h b/llvm/include/llvm/MC/MCSymbolXCOFF.h
index 502e6e4c8c804c1..424d07a4e382742 100644
--- a/llvm/include/llvm/MC/MCSymbolXCOFF.h
+++ b/llvm/include/llvm/MC/MCSymbolXCOFF.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 class MCSectionXCOFF;
 
-class MCSymbolXCOFF : public MCSymbol {
+class LLVM_CLASS_ABI MCSymbolXCOFF : public MCSymbol {
 public:
   MCSymbolXCOFF(const StringMapEntry<bool> *Name, bool isTemporary)
       : MCSymbol(SymbolKindXCOFF, Name, isTemporary) {}
diff --git a/llvm/include/llvm/MC/MCTargetOptions.h b/llvm/include/llvm/MC/MCTargetOptions.h
index 8556502ec6dc0f4..7d454dce22d97a5 100644
--- a/llvm/include/llvm/MC/MCTargetOptions.h
+++ b/llvm/include/llvm/MC/MCTargetOptions.h
@@ -35,7 +35,7 @@ enum class EmitDwarfUnwindType {
 
 class StringRef;
 
-class MCTargetOptions {
+class LLVM_CLASS_ABI MCTargetOptions {
 public:
   enum AsmInstrumentation {
     AsmInstrumentationNone,
diff --git a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
index fef63b27cf11f47..cd030e4ccca09b9 100644
--- a/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
+++ b/llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
@@ -25,40 +25,40 @@ enum class EmitDwarfUnwindType;
 
 namespace mc {
 
-bool getRelaxAll();
-std::optional<bool> getExplicitRelaxAll();
+LLVM_FUNC_ABI bool getRelaxAll();
+LLVM_FUNC_ABI std::optional<bool> getExplicitRelaxAll();
 
-bool getIncrementalLinkerCompatible();
+LLVM_FUNC_ABI bool getIncrementalLinkerCompatible();
 
-int getDwarfVersion();
+LLVM_FUNC_ABI int getDwarfVersion();
 
-bool getDwarf64();
+LLVM_FUNC_ABI bool getDwarf64();
 
-EmitDwarfUnwindType getEmitDwarfUnwind();
+LLVM_FUNC_ABI EmitDwarfUnwindType getEmitDwarfUnwind();
 
-bool getEmitCompactUnwindNonCanonical();
+LLVM_FUNC_ABI bool getEmitCompactUnwindNonCanonical();
 
-bool getShowMCInst();
+LLVM_FUNC_ABI bool getShowMCInst();
 
-bool getFatalWarnings();
+LLVM_FUNC_ABI bool getFatalWarnings();
 
-bool getNoWarn();
+LLVM_FUNC_ABI bool getNoWarn();
 
-bool getNoDeprecatedWarn();
+LLVM_FUNC_ABI bool getNoDeprecatedWarn();
 
-bool getNoTypeCheck();
+LLVM_FUNC_ABI bool getNoTypeCheck();
 
-std::string getABIName();
+LLVM_FUNC_ABI std::string getABIName();
 
-std::string getAsSecureLogFile();
+LLVM_FUNC_ABI std::string getAsSecureLogFile();
 
 /// Create this object with static storage to register mc-related command
 /// line options.
-struct RegisterMCTargetOptionsFlags {
+struct LLVM_CLASS_ABI RegisterMCTargetOptionsFlags {
   RegisterMCTargetOptionsFlags();
 };
 
-MCTargetOptions InitMCTargetOptionsFromFlags();
+LLVM_FUNC_ABI MCTargetOptions InitMCTargetOptionsFromFlags();
 
 } // namespace mc
 
diff --git a/llvm/include/llvm/MC/MCValue.h b/llvm/include/llvm/MC/MCValue.h
index 927514b013da948..1e90e8f2a12aa96 100644
--- a/llvm/include/llvm/MC/MCValue.h
+++ b/llvm/include/llvm/MC/MCValue.h
@@ -34,7 +34,7 @@ class raw_ostream;
 ///
 /// Note that this class must remain a simple POD value class, because we need
 /// it to live in unions etc.
-class MCValue {
+class LLVM_CLASS_ABI MCValue {
   const MCSymbolRefExpr *SymA = nullptr, *SymB = nullptr;
   int64_t Cst = 0;
   uint32_t RefKind = 0;
diff --git a/llvm/include/llvm/MC/MCWasmObjectWriter.h b/llvm/include/llvm/MC/MCWasmObjectWriter.h
index 22cfd1b74bb38c2..714448e83050aea 100644
--- a/llvm/include/llvm/MC/MCWasmObjectWriter.h
+++ b/llvm/include/llvm/MC/MCWasmObjectWriter.h
@@ -20,7 +20,7 @@ class MCSectionWasm;
 class MCValue;
 class raw_pwrite_stream;
 
-class MCWasmObjectTargetWriter : public MCObjectTargetWriter {
+class LLVM_CLASS_ABI MCWasmObjectTargetWriter : public MCObjectTargetWriter {
   const unsigned Is64Bit : 1;
   const unsigned IsEmscripten : 1;
 
@@ -51,11 +51,11 @@ class MCWasmObjectTargetWriter : public MCObjectTargetWriter {
 /// \param MOTW - The target specific Wasm writer subclass.
 /// \param OS - The stream to write to.
 /// \returns The constructed object writer.
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createWasmObjectWriter(std::unique_ptr<MCWasmObjectTargetWriter> MOTW,
                        raw_pwrite_stream &OS);
 
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createWasmDwoObjectWriter(std::unique_ptr<MCWasmObjectTargetWriter> MOTW,
                           raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS);
 
diff --git a/llvm/include/llvm/MC/MCWasmStreamer.h b/llvm/include/llvm/MC/MCWasmStreamer.h
index e9bd97046ca4576..f89bedda48ef355 100644
--- a/llvm/include/llvm/MC/MCWasmStreamer.h
+++ b/llvm/include/llvm/MC/MCWasmStreamer.h
@@ -21,7 +21,7 @@ namespace llvm {
 class MCExpr;
 class MCInst;
 
-class MCWasmStreamer : public MCObjectStreamer {
+class LLVM_CLASS_ABI MCWasmStreamer : public MCObjectStreamer {
 public:
   MCWasmStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> TAB,
                  std::unique_ptr<MCObjectWriter> OW,
diff --git a/llvm/include/llvm/MC/MCWin64EH.h b/llvm/include/llvm/MC/MCWin64EH.h
index 1a0858c3a8e4bae..04346465b174199 100644
--- a/llvm/include/llvm/MC/MCWin64EH.h
+++ b/llvm/include/llvm/MC/MCWin64EH.h
@@ -23,7 +23,7 @@ class MCStreamer;
 class MCSymbol;
 
 namespace Win64EH {
-struct Instruction {
+struct LLVM_CLASS_ABI Instruction {
   static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg) {
     return WinEH::Instruction(Win64EH::UOP_PushNonVol, L, Reg, -1);
   }
@@ -51,21 +51,21 @@ struct Instruction {
   }
 };
 
-class UnwindEmitter : public WinEH::UnwindEmitter {
+class LLVM_CLASS_ABI UnwindEmitter : public WinEH::UnwindEmitter {
 public:
   void Emit(MCStreamer &Streamer) const override;
   void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI,
                       bool HandlerData) const override;
 };
 
-class ARMUnwindEmitter : public WinEH::UnwindEmitter {
+class LLVM_CLASS_ABI ARMUnwindEmitter : public WinEH::UnwindEmitter {
 public:
   void Emit(MCStreamer &Streamer) const override;
   void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI,
                       bool HandlerData) const override;
 };
 
-class ARM64UnwindEmitter : public WinEH::UnwindEmitter {
+class LLVM_CLASS_ABI ARM64UnwindEmitter : public WinEH::UnwindEmitter {
 public:
   void Emit(MCStreamer &Streamer) const override;
   void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI,
diff --git a/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h b/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
index 3f4d1b23331f684..714f2e84da80aaa 100644
--- a/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
@@ -21,7 +21,7 @@ class MCFixup;
 class MCValue;
 class raw_pwrite_stream;
 
-class MCWinCOFFObjectTargetWriter : public MCObjectTargetWriter {
+class LLVM_CLASS_ABI MCWinCOFFObjectTargetWriter : public MCObjectTargetWriter {
   virtual void anchor();
 
   const unsigned Machine;
@@ -49,11 +49,11 @@ class MCWinCOFFObjectTargetWriter : public MCObjectTargetWriter {
 /// \param MOTW - The target specific WinCOFF writer subclass.
 /// \param OS - The stream to write to.
 /// \returns The constructed object writer.
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createWinCOFFObjectWriter(std::unique_ptr<MCWinCOFFObjectTargetWriter> MOTW,
                           raw_pwrite_stream &OS);
 
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createWinCOFFDwoObjectWriter(std::unique_ptr<MCWinCOFFObjectTargetWriter> MOTW,
                              raw_pwrite_stream &OS, raw_pwrite_stream &DwoOS);
 } // end namespace llvm
diff --git a/llvm/include/llvm/MC/MCWinCOFFStreamer.h b/llvm/include/llvm/MC/MCWinCOFFStreamer.h
index b036d9bf51e2f41..ced3775dae3fc72 100644
--- a/llvm/include/llvm/MC/MCWinCOFFStreamer.h
+++ b/llvm/include/llvm/MC/MCWinCOFFStreamer.h
@@ -25,7 +25,7 @@ class MCSymbol;
 class StringRef;
 class raw_pwrite_stream;
 
-class MCWinCOFFStreamer : public MCObjectStreamer {
+class LLVM_CLASS_ABI MCWinCOFFStreamer : public MCObjectStreamer {
 public:
   MCWinCOFFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
                     std::unique_ptr<MCCodeEmitter> CE,
diff --git a/llvm/include/llvm/MC/MCWinEH.h b/llvm/include/llvm/MC/MCWinEH.h
index ae8a77cf0f95ca4..89d889293424bf8 100644
--- a/llvm/include/llvm/MC/MCWinEH.h
+++ b/llvm/include/llvm/MC/MCWinEH.h
@@ -19,7 +19,7 @@ class MCStreamer;
 class MCSymbol;
 
 namespace WinEH {
-struct Instruction {
+struct LLVM_CLASS_ABI Instruction {
   const MCSymbol *Label;
   unsigned Offset;
   unsigned Register;
@@ -37,7 +37,7 @@ struct Instruction {
   bool operator!=(const Instruction &I) const { return !(*this == I); }
 };
 
-struct FrameInfo {
+struct LLVM_CLASS_ABI FrameInfo {
   const MCSymbol *Begin = nullptr;
   const MCSymbol *End = nullptr;
   const MCSymbol *FuncletOrFuncEnd = nullptr;
@@ -97,7 +97,7 @@ struct FrameInfo {
   }
 };
 
-class UnwindEmitter {
+class LLVM_CLASS_ABI UnwindEmitter {
 public:
   virtual ~UnwindEmitter();
 
diff --git a/llvm/include/llvm/MC/MCXCOFFObjectWriter.h b/llvm/include/llvm/MC/MCXCOFFObjectWriter.h
index 3a4f49ee334e02a..3fde55210740efe 100644
--- a/llvm/include/llvm/MC/MCXCOFFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCXCOFFObjectWriter.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 class raw_pwrite_stream;
 
-class MCXCOFFObjectTargetWriter : public MCObjectTargetWriter {
+class LLVM_CLASS_ABI MCXCOFFObjectTargetWriter : public MCObjectTargetWriter {
 protected:
   MCXCOFFObjectTargetWriter(bool Is64Bit);
 
@@ -40,7 +40,7 @@ class MCXCOFFObjectTargetWriter : public MCObjectTargetWriter {
   bool Is64Bit;
 };
 
-std::unique_ptr<MCObjectWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectWriter>
 createXCOFFObjectWriter(std::unique_ptr<MCXCOFFObjectTargetWriter> MOTW,
                         raw_pwrite_stream &OS);
 
diff --git a/llvm/include/llvm/MC/MCXCOFFStreamer.h b/llvm/include/llvm/MC/MCXCOFFStreamer.h
index f358faec7f4bcd7..38de8fff462a940 100644
--- a/llvm/include/llvm/MC/MCXCOFFStreamer.h
+++ b/llvm/include/llvm/MC/MCXCOFFStreamer.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class MCXCOFFStreamer : public MCObjectStreamer {
+class LLVM_CLASS_ABI MCXCOFFStreamer : public MCObjectStreamer {
 public:
   MCXCOFFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
                   std::unique_ptr<MCObjectWriter> OW,
diff --git a/llvm/include/llvm/MC/MachineLocation.h b/llvm/include/llvm/MC/MachineLocation.h
index 5b9d26ddfdc748f..8c09a6e8217593a 100644
--- a/llvm/include/llvm/MC/MachineLocation.h
+++ b/llvm/include/llvm/MC/MachineLocation.h
@@ -20,7 +20,7 @@
 
 namespace llvm {
 
-class MachineLocation {
+class LLVM_CLASS_ABI MachineLocation {
 private:
   bool IsRegister = false;              ///< True if location is a register.
   unsigned Register = 0;                ///< gcc/gdb register number.
diff --git a/llvm/include/llvm/MC/SectionKind.h b/llvm/include/llvm/MC/SectionKind.h
index 14d11e0051a87e4..1a1b6e663fe69a7 100644
--- a/llvm/include/llvm/MC/SectionKind.h
+++ b/llvm/include/llvm/MC/SectionKind.h
@@ -21,7 +21,7 @@ namespace llvm {
 /// The comments below describe these as if they were an inheritance hierarchy
 /// in order to explain the predicates below.
 ///
-class SectionKind {
+class LLVM_CLASS_ABI SectionKind {
   enum Kind {
     /// Metadata - Debug info sections or other metadata.
     Metadata,
diff --git a/llvm/include/llvm/MC/StringTableBuilder.h b/llvm/include/llvm/MC/StringTableBuilder.h
index 718f61d0c531b65..5df6e3d2e721f39 100644
--- a/llvm/include/llvm/MC/StringTableBuilder.h
+++ b/llvm/include/llvm/MC/StringTableBuilder.h
@@ -22,7 +22,7 @@ namespace llvm {
 class raw_ostream;
 
 /// Utility for building string tables with deduplicated suffixes.
-class StringTableBuilder {
+class LLVM_CLASS_ABI StringTableBuilder {
 public:
   enum Kind {
     ELF,
diff --git a/llvm/include/llvm/MC/TargetRegistry.h b/llvm/include/llvm/MC/TargetRegistry.h
index ed9be225d743acb..f64513b4762b3a3 100644
--- a/llvm/include/llvm/MC/TargetRegistry.h
+++ b/llvm/include/llvm/MC/TargetRegistry.h
@@ -65,7 +65,7 @@ class InstrumentManager;
 struct SourceMgr;
 } // namespace mca
 
-MCStreamer *createNullStreamer(MCContext &Ctx);
+LLVM_FUNC_ABI MCStreamer *createNullStreamer(MCContext &Ctx);
 // Takes ownership of \p TAB and \p CE.
 
 /// Create a machine code streamer which will print out assembly for the native
@@ -84,59 +84,59 @@ MCStreamer *createNullStreamer(MCContext &Ctx);
 ///
 /// \param ShowInst - Whether to show the MCInst representation inline with
 /// the assembly.
-MCStreamer *
+LLVM_FUNC_ABI MCStreamer *
 createAsmStreamer(MCContext &Ctx, std::unique_ptr<formatted_raw_ostream> OS,
                   bool isVerboseAsm, bool useDwarfDirectory,
                   MCInstPrinter *InstPrint, std::unique_ptr<MCCodeEmitter> &&CE,
                   std::unique_ptr<MCAsmBackend> &&TAB, bool ShowInst);
 
-MCStreamer *createELFStreamer(MCContext &Ctx,
+LLVM_FUNC_ABI MCStreamer *createELFStreamer(MCContext &Ctx,
                               std::unique_ptr<MCAsmBackend> &&TAB,
                               std::unique_ptr<MCObjectWriter> &&OW,
                               std::unique_ptr<MCCodeEmitter> &&CE,
                               bool RelaxAll);
-MCStreamer *createMachOStreamer(MCContext &Ctx,
+LLVM_FUNC_ABI MCStreamer *createMachOStreamer(MCContext &Ctx,
                                 std::unique_ptr<MCAsmBackend> &&TAB,
                                 std::unique_ptr<MCObjectWriter> &&OW,
                                 std::unique_ptr<MCCodeEmitter> &&CE,
                                 bool RelaxAll, bool DWARFMustBeAtTheEnd,
                                 bool LabelSections = false);
-MCStreamer *createWasmStreamer(MCContext &Ctx,
+LLVM_FUNC_ABI MCStreamer *createWasmStreamer(MCContext &Ctx,
                                std::unique_ptr<MCAsmBackend> &&TAB,
                                std::unique_ptr<MCObjectWriter> &&OW,
                                std::unique_ptr<MCCodeEmitter> &&CE,
                                bool RelaxAll);
-MCStreamer *createXCOFFStreamer(MCContext &Ctx,
+LLVM_FUNC_ABI MCStreamer *createXCOFFStreamer(MCContext &Ctx,
                                 std::unique_ptr<MCAsmBackend> &&TAB,
                                 std::unique_ptr<MCObjectWriter> &&OW,
                                 std::unique_ptr<MCCodeEmitter> &&CE,
                                 bool RelaxAll);
-MCStreamer *createSPIRVStreamer(MCContext &Ctx,
+LLVM_FUNC_ABI MCStreamer *createSPIRVStreamer(MCContext &Ctx,
                                 std::unique_ptr<MCAsmBackend> &&TAB,
                                 std::unique_ptr<MCObjectWriter> &&OW,
                                 std::unique_ptr<MCCodeEmitter> &&CE,
                                 bool RelaxAll);
-MCStreamer *createDXContainerStreamer(MCContext &Ctx,
+LLVM_FUNC_ABI MCStreamer *createDXContainerStreamer(MCContext &Ctx,
                                       std::unique_ptr<MCAsmBackend> &&TAB,
                                       std::unique_ptr<MCObjectWriter> &&OW,
                                       std::unique_ptr<MCCodeEmitter> &&CE,
                                       bool RelaxAll);
 
-MCRelocationInfo *createMCRelocationInfo(const Triple &TT, MCContext &Ctx);
+LLVM_FUNC_ABI MCRelocationInfo *createMCRelocationInfo(const Triple &TT, MCContext &Ctx);
 
-MCSymbolizer *createMCSymbolizer(const Triple &TT, LLVMOpInfoCallback GetOpInfo,
+LLVM_FUNC_ABI MCSymbolizer *createMCSymbolizer(const Triple &TT, LLVMOpInfoCallback GetOpInfo,
                                  LLVMSymbolLookupCallback SymbolLookUp,
                                  void *DisInfo, MCContext *Ctx,
                                  std::unique_ptr<MCRelocationInfo> &&RelInfo);
 
-mca::CustomBehaviour *createCustomBehaviour(const MCSubtargetInfo &STI,
+LLVM_FUNC_ABI mca::CustomBehaviour *createCustomBehaviour(const MCSubtargetInfo &STI,
                                             const mca::SourceMgr &SrcMgr,
                                             const MCInstrInfo &MCII);
 
-mca::InstrPostProcess *createInstrPostProcess(const MCSubtargetInfo &STI,
+LLVM_FUNC_ABI mca::InstrPostProcess *createInstrPostProcess(const MCSubtargetInfo &STI,
                                               const MCInstrInfo &MCII);
 
-mca::InstrumentManager *createInstrumentManager(const MCSubtargetInfo &STI,
+LLVM_FUNC_ABI mca::InstrumentManager *createInstrumentManager(const MCSubtargetInfo &STI,
                                                 const MCInstrInfo &MCII);
 
 /// Target - Wrapper for Target specific information.
@@ -147,7 +147,7 @@ mca::InstrumentManager *createInstrumentManager(const MCSubtargetInfo &STI,
 /// Targets should implement a single global instance of this class (which
 /// will be zero initialized), and pass that instance to the TargetRegistry as
 /// part of their initialization.
-class Target {
+class LLVM_CLASS_ABI Target {
 public:
   friend struct TargetRegistry;
 
@@ -733,7 +733,7 @@ class Target {
 };
 
 /// TargetRegistry - Generic interface to target specific features.
-struct TargetRegistry {
+struct LLVM_CLASS_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...
@@ -1134,7 +1134,7 @@ struct TargetRegistry {
 /// }
 template <Triple::ArchType TargetArchType = Triple::UnknownArch,
           bool HasJIT = false>
-struct RegisterTarget {
+struct LLVM_CLASS_ABI RegisterTarget {
   RegisterTarget(Target &T, const char *Name, const char *Desc,
                  const char *BackendName) {
     TargetRegistry::RegisterTarget(T, Name, Desc, BackendName, &getArchMatch,
@@ -1154,7 +1154,7 @@ struct RegisterTarget {
 ///   extern Target TheFooTarget;
 ///   RegisterMCAsmInfo<FooMCAsmInfo> X(TheFooTarget);
 /// }
-template <class MCAsmInfoImpl> struct RegisterMCAsmInfo {
+template <class MCAsmInfoImpl> struct LLVM_CLASS_ABI RegisterMCAsmInfo {
   RegisterMCAsmInfo(Target &T) {
     TargetRegistry::RegisterMCAsmInfo(T, &Allocator);
   }
@@ -1174,7 +1174,7 @@ template <class MCAsmInfoImpl> struct RegisterMCAsmInfo {
 ///   extern Target TheFooTarget;
 ///   RegisterMCAsmInfoFn X(TheFooTarget, TheFunction);
 /// }
-struct RegisterMCAsmInfoFn {
+struct LLVM_CLASS_ABI RegisterMCAsmInfoFn {
   RegisterMCAsmInfoFn(Target &T, Target::MCAsmInfoCtorFnTy Fn) {
     TargetRegistry::RegisterMCAsmInfo(T, Fn);
   }
@@ -1188,7 +1188,7 @@ struct RegisterMCAsmInfoFn {
 ///   extern Target TheFooTarget;
 ///   RegisterMCObjectFileInfo<FooMCObjectFileInfo> X(TheFooTarget);
 /// }
-template <class MCObjectFileInfoImpl> struct RegisterMCObjectFileInfo {
+template <class MCObjectFileInfoImpl> struct LLVM_CLASS_ABI RegisterMCObjectFileInfo {
   RegisterMCObjectFileInfo(Target &T) {
     TargetRegistry::RegisterMCObjectFileInfo(T, &Allocator);
   }
@@ -1207,7 +1207,7 @@ template <class MCObjectFileInfoImpl> struct RegisterMCObjectFileInfo {
 ///   extern Target TheFooTarget;
 ///   RegisterMCObjectFileInfoFn X(TheFooTarget, TheFunction);
 /// }
-struct RegisterMCObjectFileInfoFn {
+struct LLVM_CLASS_ABI RegisterMCObjectFileInfoFn {
   RegisterMCObjectFileInfoFn(Target &T, Target::MCObjectFileInfoCtorFnTy Fn) {
     TargetRegistry::RegisterMCObjectFileInfo(T, Fn);
   }
@@ -1221,7 +1221,7 @@ struct RegisterMCObjectFileInfoFn {
 ///   extern Target TheFooTarget;
 ///   RegisterMCInstrInfo<FooMCInstrInfo> X(TheFooTarget);
 /// }
-template <class MCInstrInfoImpl> struct RegisterMCInstrInfo {
+template <class MCInstrInfoImpl> struct LLVM_CLASS_ABI RegisterMCInstrInfo {
   RegisterMCInstrInfo(Target &T) {
     TargetRegistry::RegisterMCInstrInfo(T, &Allocator);
   }
@@ -1238,7 +1238,7 @@ template <class MCInstrInfoImpl> struct RegisterMCInstrInfo {
 ///   extern Target TheFooTarget;
 ///   RegisterMCInstrInfoFn X(TheFooTarget, TheFunction);
 /// }
-struct RegisterMCInstrInfoFn {
+struct LLVM_CLASS_ABI RegisterMCInstrInfoFn {
   RegisterMCInstrInfoFn(Target &T, Target::MCInstrInfoCtorFnTy Fn) {
     TargetRegistry::RegisterMCInstrInfo(T, Fn);
   }
@@ -1252,7 +1252,7 @@ struct RegisterMCInstrInfoFn {
 ///   extern Target TheFooTarget;
 ///   RegisterMCInstrAnalysis<FooMCInstrAnalysis> X(TheFooTarget);
 /// }
-template <class MCInstrAnalysisImpl> struct RegisterMCInstrAnalysis {
+template <class MCInstrAnalysisImpl> struct LLVM_CLASS_ABI RegisterMCInstrAnalysis {
   RegisterMCInstrAnalysis(Target &T) {
     TargetRegistry::RegisterMCInstrAnalysis(T, &Allocator);
   }
@@ -1271,7 +1271,7 @@ template <class MCInstrAnalysisImpl> struct RegisterMCInstrAnalysis {
 ///   extern Target TheFooTarget;
 ///   RegisterMCInstrAnalysisFn X(TheFooTarget, TheFunction);
 /// }
-struct RegisterMCInstrAnalysisFn {
+struct LLVM_CLASS_ABI RegisterMCInstrAnalysisFn {
   RegisterMCInstrAnalysisFn(Target &T, Target::MCInstrAnalysisCtorFnTy Fn) {
     TargetRegistry::RegisterMCInstrAnalysis(T, Fn);
   }
@@ -1285,7 +1285,7 @@ struct RegisterMCInstrAnalysisFn {
 ///   extern Target TheFooTarget;
 ///   RegisterMCRegInfo<FooMCRegInfo> X(TheFooTarget);
 /// }
-template <class MCRegisterInfoImpl> struct RegisterMCRegInfo {
+template <class MCRegisterInfoImpl> struct LLVM_CLASS_ABI RegisterMCRegInfo {
   RegisterMCRegInfo(Target &T) {
     TargetRegistry::RegisterMCRegInfo(T, &Allocator);
   }
@@ -1304,7 +1304,7 @@ template <class MCRegisterInfoImpl> struct RegisterMCRegInfo {
 ///   extern Target TheFooTarget;
 ///   RegisterMCRegInfoFn X(TheFooTarget, TheFunction);
 /// }
-struct RegisterMCRegInfoFn {
+struct LLVM_CLASS_ABI RegisterMCRegInfoFn {
   RegisterMCRegInfoFn(Target &T, Target::MCRegInfoCtorFnTy Fn) {
     TargetRegistry::RegisterMCRegInfo(T, Fn);
   }
@@ -1318,7 +1318,7 @@ struct RegisterMCRegInfoFn {
 ///   extern Target TheFooTarget;
 ///   RegisterMCSubtargetInfo<FooMCSubtargetInfo> X(TheFooTarget);
 /// }
-template <class MCSubtargetInfoImpl> struct RegisterMCSubtargetInfo {
+template <class MCSubtargetInfoImpl> struct LLVM_CLASS_ABI RegisterMCSubtargetInfo {
   RegisterMCSubtargetInfo(Target &T) {
     TargetRegistry::RegisterMCSubtargetInfo(T, &Allocator);
   }
@@ -1338,7 +1338,7 @@ template <class MCSubtargetInfoImpl> struct RegisterMCSubtargetInfo {
 ///   extern Target TheFooTarget;
 ///   RegisterMCSubtargetInfoFn X(TheFooTarget, TheFunction);
 /// }
-struct RegisterMCSubtargetInfoFn {
+struct LLVM_CLASS_ABI RegisterMCSubtargetInfoFn {
   RegisterMCSubtargetInfoFn(Target &T, Target::MCSubtargetInfoCtorFnTy Fn) {
     TargetRegistry::RegisterMCSubtargetInfo(T, Fn);
   }
@@ -1352,7 +1352,7 @@ struct RegisterMCSubtargetInfoFn {
 ///   extern Target TheFooTarget;
 ///   RegisterTargetMachine<FooTargetMachine> X(TheFooTarget);
 /// }
-template <class TargetMachineImpl> struct RegisterTargetMachine {
+template <class TargetMachineImpl> struct LLVM_CLASS_ABI RegisterTargetMachine {
   RegisterTargetMachine(Target &T) {
     TargetRegistry::RegisterTargetMachine(T, &Allocator);
   }
@@ -1375,7 +1375,7 @@ template <class TargetMachineImpl> struct RegisterTargetMachine {
 ///   extern Target TheFooTarget;
 ///   RegisterMCAsmBackend<FooAsmLexer> X(TheFooTarget);
 /// }
-template <class MCAsmBackendImpl> struct RegisterMCAsmBackend {
+template <class MCAsmBackendImpl> struct LLVM_CLASS_ABI RegisterMCAsmBackend {
   RegisterMCAsmBackend(Target &T) {
     TargetRegistry::RegisterMCAsmBackend(T, &Allocator);
   }
@@ -1396,7 +1396,7 @@ template <class MCAsmBackendImpl> struct RegisterMCAsmBackend {
 ///   extern Target TheFooTarget;
 ///   RegisterMCAsmParser<FooAsmParser> X(TheFooTarget);
 /// }
-template <class MCAsmParserImpl> struct RegisterMCAsmParser {
+template <class MCAsmParserImpl> struct LLVM_CLASS_ABI RegisterMCAsmParser {
   RegisterMCAsmParser(Target &T) {
     TargetRegistry::RegisterMCAsmParser(T, &Allocator);
   }
@@ -1417,7 +1417,7 @@ template <class MCAsmParserImpl> struct RegisterMCAsmParser {
 ///   extern Target TheFooTarget;
 ///   RegisterAsmPrinter<FooAsmPrinter> X(TheFooTarget);
 /// }
-template <class AsmPrinterImpl> struct RegisterAsmPrinter {
+template <class AsmPrinterImpl> struct LLVM_CLASS_ABI RegisterAsmPrinter {
   RegisterAsmPrinter(Target &T) {
     TargetRegistry::RegisterAsmPrinter(T, &Allocator);
   }
@@ -1437,7 +1437,7 @@ template <class AsmPrinterImpl> struct RegisterAsmPrinter {
 ///   extern Target TheFooTarget;
 ///   RegisterMCCodeEmitter<FooCodeEmitter> X(TheFooTarget);
 /// }
-template <class MCCodeEmitterImpl> struct RegisterMCCodeEmitter {
+template <class MCCodeEmitterImpl> struct LLVM_CLASS_ABI RegisterMCCodeEmitter {
   RegisterMCCodeEmitter(Target &T) {
     TargetRegistry::RegisterMCCodeEmitter(T, &Allocator);
   }
diff --git a/llvm/include/llvm/MCA/CodeEmitter.h b/llvm/include/llvm/MCA/CodeEmitter.h
index 3c8ecaf2c1070a9..5bbaafd77bbf99c 100644
--- a/llvm/include/llvm/MCA/CodeEmitter.h
+++ b/llvm/include/llvm/MCA/CodeEmitter.h
@@ -32,7 +32,7 @@ namespace mca {
 ///
 /// It provides a simple API to compute and return instruction encodings as
 /// strings. Encodings are cached internally for later usage.
-class CodeEmitter {
+class LLVM_CLASS_ABI CodeEmitter {
   const MCSubtargetInfo &STI;
   const MCAsmBackend &MAB;
   const MCCodeEmitter &MCE;
diff --git a/llvm/include/llvm/MCA/Context.h b/llvm/include/llvm/MCA/Context.h
index 1c9573a2ffa0acf..d8f01933a032a54 100644
--- a/llvm/include/llvm/MCA/Context.h
+++ b/llvm/include/llvm/MCA/Context.h
@@ -31,7 +31,7 @@ namespace mca {
 
 /// This is a convenience struct to hold the parameters necessary for creating
 /// the pre-built "default" out-of-order pipeline.
-struct PipelineOptions {
+struct LLVM_CLASS_ABI PipelineOptions {
   PipelineOptions(unsigned UOPQSize, unsigned DecThr, unsigned DW, unsigned RFS,
                   unsigned LQS, unsigned SQS, bool NoAlias,
                   bool ShouldEnableBottleneckAnalysis = false)
@@ -49,7 +49,7 @@ struct PipelineOptions {
   bool EnableBottleneckAnalysis;
 };
 
-class Context {
+class LLVM_CLASS_ABI Context {
   SmallVector<std::unique_ptr<HardwareUnit>, 4> Hardware;
   const MCRegisterInfo &MRI;
   const MCSubtargetInfo &STI;
diff --git a/llvm/include/llvm/MCA/CustomBehaviour.h b/llvm/include/llvm/MCA/CustomBehaviour.h
index 77bff2f27db46c5..25fcbd710d7e792 100644
--- a/llvm/include/llvm/MCA/CustomBehaviour.h
+++ b/llvm/include/llvm/MCA/CustomBehaviour.h
@@ -34,7 +34,7 @@ namespace mca {
 /// A common usage of this class is to add immediate operands to certain
 /// instructions or to remove Defs/Uses from an instruction where the
 /// schedulinng model is incorrect.
-class InstrPostProcess {
+class LLVM_CLASS_ABI InstrPostProcess {
 protected:
   const MCSubtargetInfo &STI;
   const MCInstrInfo &MCII;
@@ -64,7 +64,7 @@ class InstrPostProcess {
 /// them properly.
 /// If you implement this class for your target, make sure to also implement
 /// a target specific InstrPostProcess class as well.
-class CustomBehaviour {
+class LLVM_CLASS_ABI CustomBehaviour {
 protected:
   const MCSubtargetInfo &STI;
   const mca::SourceMgr &SrcMgr;
@@ -116,7 +116,7 @@ class CustomBehaviour {
   getEndViews(llvm::MCInstPrinter &IP, llvm::ArrayRef<llvm::MCInst> Insts);
 };
 
-class Instrument {
+class LLVM_CLASS_ABI Instrument {
   /// The description of Instrument kind
   const StringRef Desc;
 
@@ -139,7 +139,7 @@ using UniqueInstrument = std::unique_ptr<Instrument>;
 /// This class allows targets to optionally customize the logic that resolves
 /// scheduling class IDs. Targets can use information encoded in Instrument
 /// objects to make more informed scheduling decisions.
-class InstrumentManager {
+class LLVM_CLASS_ABI InstrumentManager {
 protected:
   const MCSubtargetInfo &STI;
   const MCInstrInfo &MCII;
diff --git a/llvm/include/llvm/MCA/HWEventListener.h b/llvm/include/llvm/MCA/HWEventListener.h
index a0e422e2f7a88b2..5bea657b5fa9101 100644
--- a/llvm/include/llvm/MCA/HWEventListener.h
+++ b/llvm/include/llvm/MCA/HWEventListener.h
@@ -25,7 +25,7 @@ namespace mca {
 // An HWInstructionEvent represents state changes of instructions that
 // listeners might be interested in. Listeners can choose to ignore any event
 // they are not interested in.
-class HWInstructionEvent {
+class LLVM_CLASS_ABI HWInstructionEvent {
 public:
   // This is the list of event types that are shared by all targets, that
   // generic subtarget-agnostic classes (e.g., Pipeline, HWInstructionEvent,
@@ -63,7 +63,7 @@ class HWInstructionEvent {
 using ResourceRef = std::pair<uint64_t, uint64_t>;
 using ResourceUse = std::pair<ResourceRef, ResourceCycles>;
 
-class HWInstructionIssuedEvent : public HWInstructionEvent {
+class LLVM_CLASS_ABI HWInstructionIssuedEvent : public HWInstructionEvent {
 public:
   HWInstructionIssuedEvent(const InstRef &IR, ArrayRef<ResourceUse> UR)
       : HWInstructionEvent(HWInstructionEvent::Issued, IR), UsedResources(UR) {}
@@ -71,7 +71,7 @@ class HWInstructionIssuedEvent : public HWInstructionEvent {
   ArrayRef<ResourceUse> UsedResources;
 };
 
-class HWInstructionDispatchedEvent : public HWInstructionEvent {
+class LLVM_CLASS_ABI HWInstructionDispatchedEvent : public HWInstructionEvent {
 public:
   HWInstructionDispatchedEvent(const InstRef &IR, ArrayRef<unsigned> Regs,
                                unsigned UOps)
@@ -92,7 +92,7 @@ class HWInstructionDispatchedEvent : public HWInstructionEvent {
   unsigned MicroOpcodes;
 };
 
-class HWInstructionRetiredEvent : public HWInstructionEvent {
+class LLVM_CLASS_ABI HWInstructionRetiredEvent : public HWInstructionEvent {
 public:
   HWInstructionRetiredEvent(const InstRef &IR, ArrayRef<unsigned> Regs)
       : HWInstructionEvent(HWInstructionEvent::Retired, IR),
@@ -104,7 +104,7 @@ class HWInstructionRetiredEvent : public HWInstructionEvent {
 
 // A HWStallEvent represents a pipeline stall caused by the lack of hardware
 // resources.
-class HWStallEvent {
+class LLVM_CLASS_ABI HWStallEvent {
 public:
   enum GenericEventType {
     Invalid = 0,
@@ -131,7 +131,7 @@ class HWStallEvent {
 
 // A HWPressureEvent describes an increase in backend pressure caused by
 // the presence of data dependencies or unavailability of pipeline resources.
-class HWPressureEvent {
+class LLVM_CLASS_ABI HWPressureEvent {
 public:
   enum GenericReason {
     INVALID = 0,
@@ -158,7 +158,7 @@ class HWPressureEvent {
   const uint64_t ResourceMask;
 };
 
-class HWEventListener {
+class LLVM_CLASS_ABI HWEventListener {
 public:
   // Generic events generated by the pipeline.
   virtual void onCycleBegin() {}
diff --git a/llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h b/llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h
index 20533500c4b794f..428397f65f07a73 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h
@@ -20,7 +20,7 @@
 namespace llvm {
 namespace mca {
 
-class HardwareUnit {
+class LLVM_CLASS_ABI HardwareUnit {
   HardwareUnit(const HardwareUnit &H) = delete;
   HardwareUnit &operator=(const HardwareUnit &H) = delete;
 
diff --git a/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h b/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
index 28ce2ffd127d254..9b8ae8ed2076151 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
@@ -33,7 +33,7 @@ namespace mca {
 /// A Memory group identifier is then stored as a "token" in field
 /// Instruction::LSUTokenID of each dispatched instructions. That token is used
 /// internally by the LSUnit to track memory dependencies.
-class MemoryGroup {
+class LLVM_CLASS_ABI MemoryGroup {
   unsigned NumPredecessors = 0;
   unsigned NumExecutingPredecessors = 0;
   unsigned NumExecutedPredecessors = 0;
@@ -188,7 +188,7 @@ class MemoryGroup {
 };
 
 /// Abstract base interface for LS (load/store) units in llvm-mca.
-class LSUnitBase : public HardwareUnit {
+class LLVM_CLASS_ABI LSUnitBase : public HardwareUnit {
   /// Load queue size.
   ///
   /// A value of zero for this field means that the load queue is unbounded.
@@ -396,7 +396,7 @@ class LSUnitBase : public HardwareUnit {
 /// A load/store barrier is "executed" when it becomes the oldest entry in
 /// the load/store queue(s). That also means, all the older loads/stores have
 /// already been executed.
-class LSUnit : public LSUnitBase {
+class LLVM_CLASS_ABI LSUnit : public LSUnitBase {
   // This class doesn't know about the latency of a load instruction. So, it
   // conservatively/pessimistically assumes that the latency of a load opcode
   // matches the instruction latency.
diff --git a/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h b/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h
index 68c9cf2ddcb4019..333a47c8dbef587 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/RegisterFile.h
@@ -36,7 +36,7 @@ class Instruction;
 /// This class is mainly used by the register file to describe register
 /// mappings. It correlates a register write to the source index of the
 /// defining instruction.
-class WriteRef {
+class LLVM_CLASS_ABI WriteRef {
   unsigned IID;
   unsigned WriteBackCycle;
   unsigned WriteResID;
@@ -81,7 +81,7 @@ class WriteRef {
 
 /// Manages hardware register files, and tracks register definitions for
 /// register renaming purposes.
-class RegisterFile : public HardwareUnit {
+class LLVM_CLASS_ABI RegisterFile : public HardwareUnit {
   const MCRegisterInfo &MRI;
 
   // class RegisterMappingTracker is a  physical register file (PRF) descriptor.
diff --git a/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h b/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h
index 4a9269383d525d0..b7b3f9488284f33 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h
@@ -45,7 +45,7 @@ enum ResourceStateEvent {
 };
 
 /// Resource allocation strategy used by hardware scheduler resources.
-class ResourceStrategy {
+class LLVM_CLASS_ABI ResourceStrategy {
   ResourceStrategy(const ResourceStrategy &) = delete;
   ResourceStrategy &operator=(const ResourceStrategy &) = delete;
 
@@ -65,7 +65,7 @@ class ResourceStrategy {
 
 /// Default resource allocation strategy used by processor resource groups and
 /// processor resources with multiple units.
-class DefaultResourceStrategy final : public ResourceStrategy {
+class LLVM_CLASS_ABI DefaultResourceStrategy final : public ResourceStrategy {
   /// A Mask of resource unit identifiers.
   ///
   /// There is one bit set for every available resource unit.
@@ -133,7 +133,7 @@ class DefaultResourceStrategy final : public ResourceStrategy {
 /// the machine scheduling model.
 /// Objects of class ResourceState dynamically track the usage of processor
 /// resource units.
-class ResourceState {
+class LLVM_CLASS_ABI ResourceState {
   /// An index to the MCProcResourceDesc entry in the processor model.
   const unsigned ProcResourceDescIndex;
   /// A resource mask. This is generated by the tool with the help of
@@ -309,7 +309,7 @@ typedef std::pair<unsigned, unsigned> BufferUsageEntry;
 /// This class doesn't know about instruction itineraries and functional units.
 /// In future, it can be extended to support itineraries too through the same
 /// public interface.
-class ResourceManager {
+class LLVM_CLASS_ABI ResourceManager {
   // Set of resources available on the subtarget.
   //
   // There is an instance of ResourceState for every resource declared by the
diff --git a/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h b/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h
index 51a794232ad5312..47280717cccb676 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/RetireControlUnit.h
@@ -34,7 +34,7 @@ namespace mca {
 /// On instruction retired, register updates are all architecturally
 /// committed, and any physicall registers previously allocated for the
 /// retired instruction are freed.
-struct RetireControlUnit : public HardwareUnit {
+struct LLVM_CLASS_ABI RetireControlUnit : public HardwareUnit {
   // A RUToken is created by the RCU for every instruction dispatched to the
   // schedulers.  These "tokens" are managed by the RCU in its token Queue.
   //
diff --git a/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h b/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h
index d363c22cea4022f..16bcd3b76ad782b 100644
--- a/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h
+++ b/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h
@@ -25,7 +25,7 @@
 namespace llvm {
 namespace mca {
 
-class SchedulerStrategy {
+class LLVM_CLASS_ABI SchedulerStrategy {
 public:
   SchedulerStrategy() = default;
   virtual ~SchedulerStrategy();
@@ -38,7 +38,7 @@ class SchedulerStrategy {
 };
 
 /// Default instruction selection strategy used by class Scheduler.
-class DefaultSchedulerStrategy : public SchedulerStrategy {
+class LLVM_CLASS_ABI DefaultSchedulerStrategy : public SchedulerStrategy {
   /// This method ranks instructions based on their age, and the number of known
   /// users. The lower the rank value, the better.
   int computeRank(const InstRef &Lhs) const {
@@ -68,7 +68,7 @@ class DefaultSchedulerStrategy : public SchedulerStrategy {
 /// resources. This class is also responsible for tracking the progress of
 /// instructions from the dispatch stage, until the write-back stage.
 ///
-class Scheduler : public HardwareUnit {
+class LLVM_CLASS_ABI Scheduler : public HardwareUnit {
   LSUnitBase &LSU;
 
   // Instruction selection strategy for this Scheduler.
diff --git a/llvm/include/llvm/MCA/IncrementalSourceMgr.h b/llvm/include/llvm/MCA/IncrementalSourceMgr.h
index b3dc5c24c47f6e5..30f864a67b08890 100644
--- a/llvm/include/llvm/MCA/IncrementalSourceMgr.h
+++ b/llvm/include/llvm/MCA/IncrementalSourceMgr.h
@@ -24,7 +24,7 @@ namespace mca {
 /// An implementation of \a SourceMgr that allows users to add new instructions
 /// incrementally / dynamically.
 /// Note that this SourceMgr takes ownership of all \a mca::Instruction.
-class IncrementalSourceMgr : public SourceMgr {
+class LLVM_CLASS_ABI IncrementalSourceMgr : public SourceMgr {
   /// Owner of all mca::Instruction instances. Note that we use std::deque here
   /// to have a better throughput, in comparison to std::vector or
   /// llvm::SmallVector, as they usually pay a higher re-allocation cost when
diff --git a/llvm/include/llvm/MCA/InstrBuilder.h b/llvm/include/llvm/MCA/InstrBuilder.h
index 4c5b5287ac6aaa2..c49304570c5ecae 100644
--- a/llvm/include/llvm/MCA/InstrBuilder.h
+++ b/llvm/include/llvm/MCA/InstrBuilder.h
@@ -28,7 +28,7 @@
 namespace llvm {
 namespace mca {
 
-class RecycledInstErr : public ErrorInfo<RecycledInstErr> {
+class LLVM_CLASS_ABI RecycledInstErr : public ErrorInfo<RecycledInstErr> {
   Instruction *RecycledInst;
 
 public:
@@ -59,7 +59,7 @@ class RecycledInstErr : public ErrorInfo<RecycledInstErr> {
 /// descriptors (i.e. InstrDesc objects).
 /// Information from the machine scheduling model is used to identify processor
 /// resources that are consumed by an instruction.
-class InstrBuilder {
+class LLVM_CLASS_ABI InstrBuilder {
   const MCSubtargetInfo &STI;
   const MCInstrInfo &MCII;
   const MCRegisterInfo &MRI;
diff --git a/llvm/include/llvm/MCA/Instruction.h b/llvm/include/llvm/MCA/Instruction.h
index 9c6bd9ed3b13787..14e2b8f4b964c24 100644
--- a/llvm/include/llvm/MCA/Instruction.h
+++ b/llvm/include/llvm/MCA/Instruction.h
@@ -36,7 +36,7 @@ constexpr int UNKNOWN_CYCLES = -512;
 
 /// A representation of an mca::Instruction operand
 /// for use in mca::CustomBehaviour.
-class MCAOperand {
+class LLVM_CLASS_ABI MCAOperand {
   // This class is mostly copied from MCOperand within
   // MCInst.h except that we don't keep track of
   // expressions or sub-instructions.
@@ -133,7 +133,7 @@ class MCAOperand {
 };
 
 /// A register write descriptor.
-struct WriteDescriptor {
+struct LLVM_CLASS_ABI WriteDescriptor {
   // Operand index. The index is negative for implicit writes only.
   // For implicit writes, the actual operand index is computed performing
   // a bitwise not of the OpIndex.
@@ -161,7 +161,7 @@ struct WriteDescriptor {
 };
 
 /// A register read descriptor.
-struct ReadDescriptor {
+struct LLVM_CLASS_ABI ReadDescriptor {
   // A MCOperand index. This is used by the Dispatch logic to identify register
   // reads. Implicit reads have negative indices. The actual operand index of an
   // implicit read is the bitwise not of field OpIndex.
@@ -183,7 +183,7 @@ class ReadState;
 /// A critical data dependency descriptor.
 ///
 /// Field RegID is set to the invalid register for memory dependencies.
-struct CriticalDependency {
+struct LLVM_CLASS_ABI CriticalDependency {
   unsigned IID;
   MCPhysReg RegID;
   unsigned Cycles;
@@ -195,7 +195,7 @@ struct CriticalDependency {
 /// this class. A WriteState object tracks the dependent users of a
 /// register write. It also tracks how many cycles are left before the write
 /// back stage.
-class WriteState {
+class LLVM_CLASS_ABI WriteState {
   const WriteDescriptor *WD;
   // On instruction issue, this field is set equal to the write latency.
   // Before instruction issue, this field defaults to -512, a special
@@ -324,7 +324,7 @@ class WriteState {
 ///
 /// A read may be dependent on more than one write. This occurs when some
 /// writes only partially update the register associated to this read.
-class ReadState {
+class LLVM_CLASS_ABI ReadState {
   const ReadDescriptor *RD;
   // Physical register identified associated to this read.
   MCPhysReg RegisterID;
@@ -387,7 +387,7 @@ class ReadState {
 /// A sequence of cycles.
 ///
 /// This class can be used as a building block to construct ranges of cycles.
-class CycleSegment {
+class LLVM_CLASS_ABI CycleSegment {
   unsigned Begin; // Inclusive.
   unsigned End;   // Exclusive.
   bool Reserved;  // Resources associated to this segment must be reserved.
@@ -434,7 +434,7 @@ class CycleSegment {
 ///
 /// This class describes how many resource units of a specific resource kind
 /// (and how many cycles) are "used" by an instruction.
-struct ResourceUsage {
+struct LLVM_CLASS_ABI ResourceUsage {
   CycleSegment CS;
   unsigned NumUnits;
   ResourceUsage(CycleSegment Cycles, unsigned Units = 1)
@@ -445,7 +445,7 @@ struct ResourceUsage {
 };
 
 /// An instruction descriptor
-struct InstrDesc {
+struct LLVM_CLASS_ABI InstrDesc {
   SmallVector<WriteDescriptor, 2> Writes; // Implicit writes are at the end.
   SmallVector<ReadDescriptor, 4> Reads;   // Implicit reads are at the end.
 
@@ -494,7 +494,7 @@ struct InstrDesc {
 ///
 /// This class tracks data dependencies as well as generic properties
 /// of the instruction.
-class InstructionBase {
+class LLVM_CLASS_ABI InstructionBase {
   const InstrDesc &Desc;
 
   // This field is set for instructions that are candidates for move
@@ -598,7 +598,7 @@ class InstructionBase {
 ///
 /// This class is used to monitor changes to the internal state of instructions
 /// that are sent to the various components of the simulated hardware pipeline.
-class Instruction : public InstructionBase {
+class LLVM_CLASS_ABI Instruction : public InstructionBase {
   enum InstrStage {
     IS_INVALID,    // Instruction in an invalid state.
     IS_DISPATCHED, // Instruction dispatched but operands are not ready.
@@ -718,7 +718,7 @@ class Instruction : public InstructionBase {
 /// An InstRef contains both a SourceMgr index and Instruction pair.  The index
 /// is used as a unique identifier for the instruction.  MCA will make use of
 /// this index as a key throughout MCA.
-class InstRef {
+class LLVM_CLASS_ABI InstRef {
   std::pair<unsigned, Instruction *> Data;
 
 public:
diff --git a/llvm/include/llvm/MCA/Pipeline.h b/llvm/include/llvm/MCA/Pipeline.h
index 484cda3289342ee..59c68d74382ae44 100644
--- a/llvm/include/llvm/MCA/Pipeline.h
+++ b/llvm/include/llvm/MCA/Pipeline.h
@@ -48,7 +48,7 @@ class HWEventListener;
 /// Internally, the Pipeline collects statistical information in the form of
 /// histograms. For example, it tracks how the dispatch group size changes
 /// over time.
-class Pipeline {
+class LLVM_CLASS_ABI Pipeline {
   Pipeline(const Pipeline &P) = delete;
   Pipeline &operator=(const Pipeline &P) = delete;
 
diff --git a/llvm/include/llvm/MCA/SourceMgr.h b/llvm/include/llvm/MCA/SourceMgr.h
index 23682d3820912e8..3da75b62c91f0a7 100644
--- a/llvm/include/llvm/MCA/SourceMgr.h
+++ b/llvm/include/llvm/MCA/SourceMgr.h
@@ -27,7 +27,7 @@ typedef std::pair<unsigned, const Instruction &> SourceRef;
 
 /// Abstracting the input code sequence (a sequence of MCInst) and assigning
 /// unique identifiers to every instruction in the sequence.
-struct SourceMgr {
+struct LLVM_CLASS_ABI SourceMgr {
   using UniqueInst = std::unique_ptr<Instruction>;
 
   /// Provides a fixed range of \a UniqueInst to iterate.
@@ -57,7 +57,7 @@ struct SourceMgr {
 /// The default implementation of \a SourceMgr. It always takes a fixed number
 /// of instructions and provides an option to loop the given sequence for a
 /// certain iterations.
-class CircularSourceMgr : public SourceMgr {
+class LLVM_CLASS_ABI CircularSourceMgr : public SourceMgr {
   ArrayRef<UniqueInst> Sequence;
   unsigned Current;
   const unsigned Iterations;
diff --git a/llvm/include/llvm/MCA/Stages/DispatchStage.h b/llvm/include/llvm/MCA/Stages/DispatchStage.h
index 7a2cc95c26497a0..94ea89d58dd6142 100644
--- a/llvm/include/llvm/MCA/Stages/DispatchStage.h
+++ b/llvm/include/llvm/MCA/Stages/DispatchStage.h
@@ -47,7 +47,7 @@ namespace mca {
 //
 // If the number of micro opcodes exceedes DispatchWidth, then the instruction
 // is dispatched in multiple cycles.
-class DispatchStage final : public Stage {
+class LLVM_CLASS_ABI DispatchStage final : public Stage {
   unsigned DispatchWidth;
   unsigned AvailableEntries;
   unsigned CarryOver;
diff --git a/llvm/include/llvm/MCA/Stages/EntryStage.h b/llvm/include/llvm/MCA/Stages/EntryStage.h
index c157c34c989ebe6..9358c17fab95f2e 100644
--- a/llvm/include/llvm/MCA/Stages/EntryStage.h
+++ b/llvm/include/llvm/MCA/Stages/EntryStage.h
@@ -24,7 +24,7 @@
 namespace llvm {
 namespace mca {
 
-class EntryStage final : public Stage {
+class LLVM_CLASS_ABI EntryStage final : public Stage {
   InstRef CurrentInstruction;
   SmallVector<std::unique_ptr<Instruction>, 16> Instructions;
   SourceMgr &SM;
diff --git a/llvm/include/llvm/MCA/Stages/ExecuteStage.h b/llvm/include/llvm/MCA/Stages/ExecuteStage.h
index 21c27669ee052e4..995011c06543e97 100644
--- a/llvm/include/llvm/MCA/Stages/ExecuteStage.h
+++ b/llvm/include/llvm/MCA/Stages/ExecuteStage.h
@@ -26,7 +26,7 @@
 namespace llvm {
 namespace mca {
 
-class ExecuteStage final : public Stage {
+class LLVM_CLASS_ABI ExecuteStage final : public Stage {
   Scheduler &HWS;
 
   unsigned NumDispatchedOpcodes;
diff --git a/llvm/include/llvm/MCA/Stages/InOrderIssueStage.h b/llvm/include/llvm/MCA/Stages/InOrderIssueStage.h
index 16973c55c6c3abb..4f59e7c1790a606 100644
--- a/llvm/include/llvm/MCA/Stages/InOrderIssueStage.h
+++ b/llvm/include/llvm/MCA/Stages/InOrderIssueStage.h
@@ -25,7 +25,7 @@ namespace mca {
 class LSUnit;
 class RegisterFile;
 
-struct StallInfo {
+struct LLVM_CLASS_ABI StallInfo {
   enum class StallKind {
     DEFAULT,
     REGISTER_DEPS,
@@ -52,7 +52,7 @@ struct StallInfo {
   void cycleEnd();
 };
 
-class InOrderIssueStage final : public Stage {
+class LLVM_CLASS_ABI InOrderIssueStage final : public Stage {
   const MCSubtargetInfo &STI;
   RegisterFile &PRF;
   ResourceManager RM;
diff --git a/llvm/include/llvm/MCA/Stages/InstructionTables.h b/llvm/include/llvm/MCA/Stages/InstructionTables.h
index 84861cc0b056fe4..fe10e0b9966294d 100644
--- a/llvm/include/llvm/MCA/Stages/InstructionTables.h
+++ b/llvm/include/llvm/MCA/Stages/InstructionTables.h
@@ -26,7 +26,7 @@
 namespace llvm {
 namespace mca {
 
-class InstructionTables final : public Stage {
+class LLVM_CLASS_ABI InstructionTables final : public Stage {
   const MCSchedModel &SM;
   SmallVector<ResourceUse, 4> UsedResources;
   SmallVector<uint64_t, 8> Masks;
diff --git a/llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h b/llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h
index d4608fe595c8861..91f606acbd8271c 100644
--- a/llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h
+++ b/llvm/include/llvm/MCA/Stages/MicroOpQueueStage.h
@@ -24,7 +24,7 @@ namespace llvm {
 namespace mca {
 
 /// A stage that simulates a queue of instruction opcodes.
-class MicroOpQueueStage : public Stage {
+class LLVM_CLASS_ABI MicroOpQueueStage : public Stage {
   SmallVector<InstRef, 8> Buffer;
   unsigned NextAvailableSlotIdx;
   unsigned CurrentInstructionSlotIdx;
diff --git a/llvm/include/llvm/MCA/Stages/RetireStage.h b/llvm/include/llvm/MCA/Stages/RetireStage.h
index ab6d21e9c4de6eb..1abf99f5e09246a 100644
--- a/llvm/include/llvm/MCA/Stages/RetireStage.h
+++ b/llvm/include/llvm/MCA/Stages/RetireStage.h
@@ -26,7 +26,7 @@
 namespace llvm {
 namespace mca {
 
-class RetireStage final : public Stage {
+class LLVM_CLASS_ABI RetireStage final : public Stage {
   // Owner will go away when we move listeners/eventing to the stages.
   RetireControlUnit &RCU;
   RegisterFile &PRF;
diff --git a/llvm/include/llvm/MCA/Stages/Stage.h b/llvm/include/llvm/MCA/Stages/Stage.h
index f869e825b05ab66..f51306f013de3c1 100644
--- a/llvm/include/llvm/MCA/Stages/Stage.h
+++ b/llvm/include/llvm/MCA/Stages/Stage.h
@@ -25,7 +25,7 @@ namespace mca {
 
 class InstRef;
 
-class Stage {
+class LLVM_CLASS_ABI Stage {
   Stage *NextInSequence = nullptr;
   std::set<HWEventListener *> Listeners;
 
@@ -88,7 +88,7 @@ class Stage {
 
 /// This is actually not an error but a marker to indicate that
 /// the instruction stream is paused.
-struct InstStreamPause : public ErrorInfo<InstStreamPause> {
+struct LLVM_CLASS_ABI InstStreamPause : public ErrorInfo<InstStreamPause> {
   static char ID;
 
   std::error_code convertToErrorCode() const override {
diff --git a/llvm/include/llvm/MCA/Support.h b/llvm/include/llvm/MCA/Support.h
index 67aec1ed7610e04..ac0e057fd502a0f 100644
--- a/llvm/include/llvm/MCA/Support.h
+++ b/llvm/include/llvm/MCA/Support.h
@@ -25,7 +25,7 @@ namespace llvm {
 namespace mca {
 
 template <typename T>
-class InstructionError : public ErrorInfo<InstructionError<T>> {
+class LLVM_CLASS_ABI InstructionError : public ErrorInfo<InstructionError<T>> {
 public:
   static char ID;
   std::string Message;
@@ -49,7 +49,7 @@ template <typename T> char InstructionError<T>::ID;
 /// number of resources, are kept separate.  This is used by the
 /// ResourcePressureView to calculate the average resource cycles
 /// per instruction/iteration.
-class ResourceCycles {
+class LLVM_CLASS_ABI ResourceCycles {
   unsigned Numerator, Denominator;
 
 public:
@@ -93,7 +93,7 @@ class ResourceCycles {
 ///
 /// Resource masks are used by the ResourceManager to solve set membership
 /// problems with simple bit manipulation operations.
-void computeProcResourceMasks(const MCSchedModel &SM,
+LLVM_FUNC_ABI void computeProcResourceMasks(const MCSchedModel &SM,
                               MutableArrayRef<uint64_t> Masks);
 
 // Returns the index of the highest bit set. For resource masks, the position of
@@ -107,7 +107,7 @@ inline unsigned getResourceStateIndex(uint64_t Mask) {
 /// cycles. The reciprocal block throughput is computed as the MAX between:
 ///  - NumMicroOps / DispatchWidth
 ///  - ProcResourceCycles / #ProcResourceUnits  (for every consumed resource).
-double computeBlockRThroughput(const MCSchedModel &SM, unsigned DispatchWidth,
+LLVM_FUNC_ABI double computeBlockRThroughput(const MCSchedModel &SM, unsigned DispatchWidth,
                                unsigned NumMicroOps,
                                ArrayRef<unsigned> ProcResourceUsage);
 } // namespace mca
diff --git a/llvm/include/llvm/MCA/View.h b/llvm/include/llvm/MCA/View.h
index 9bf69f88360015e..8ce50e1489ab49f 100644
--- a/llvm/include/llvm/MCA/View.h
+++ b/llvm/include/llvm/MCA/View.h
@@ -24,7 +24,7 @@
 namespace llvm {
 namespace mca {
 
-class View : public HWEventListener {
+class LLVM_CLASS_ABI View : public HWEventListener {
 public:
   virtual ~View() = default;
 
diff --git a/llvm/include/llvm/ObjCopy/COFF/COFFConfig.h b/llvm/include/llvm/ObjCopy/COFF/COFFConfig.h
index 533c2f9ce759250..fd1145e82b6219a 100644
--- a/llvm/include/llvm/ObjCopy/COFF/COFFConfig.h
+++ b/llvm/include/llvm/ObjCopy/COFF/COFFConfig.h
@@ -16,7 +16,7 @@ namespace llvm {
 namespace objcopy {
 
 // Coff specific configuration for copying/stripping a single file.
-struct COFFConfig {
+struct LLVM_CLASS_ABI COFFConfig {
   std::optional<unsigned> Subsystem;
   std::optional<unsigned> MajorSubsystemVersion;
   std::optional<unsigned> MinorSubsystemVersion;
diff --git a/llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h b/llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h
index 75ec4fe2f5efd17..c44c114ce9e72d2 100644
--- a/llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h
@@ -28,7 +28,7 @@ namespace coff {
 /// Apply the transformations described by \p Config and \p COFFConfig
 /// to \p In and writes the result into \p Out.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnBinary(const CommonConfig &Config, const COFFConfig &,
+LLVM_FUNC_ABI Error executeObjcopyOnBinary(const CommonConfig &Config, const COFFConfig &,
                              object::COFFObjectFile &In, raw_ostream &Out);
 
 } // end namespace coff
diff --git a/llvm/include/llvm/ObjCopy/CommonConfig.h b/llvm/include/llvm/ObjCopy/CommonConfig.h
index 3555b3186d8a768..0c2b94d127f097d 100644
--- a/llvm/include/llvm/ObjCopy/CommonConfig.h
+++ b/llvm/include/llvm/ObjCopy/CommonConfig.h
@@ -38,7 +38,7 @@ enum class FileFormat {
 // This type keeps track of the machine info for various architectures. This
 // lets us map architecture names to ELF types and the e_machine value of the
 // ELF file.
-struct MachineInfo {
+struct LLVM_CLASS_ABI MachineInfo {
   MachineInfo(uint16_t EM, uint8_t ABI, bool Is64, bool IsLittle)
       : EMachine(EM), OSABI(ABI), Is64Bit(Is64), IsLittleEndian(IsLittle) {}
   // Alternative constructor that defaults to NONE for OSABI.
@@ -73,13 +73,13 @@ enum SectionFlag {
   LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/SecExclude)
 };
 
-struct SectionRename {
+struct LLVM_CLASS_ABI SectionRename {
   StringRef OriginalName;
   StringRef NewName;
   std::optional<SectionFlag> NewFlags;
 };
 
-struct SectionFlagsUpdate {
+struct LLVM_CLASS_ABI SectionFlagsUpdate {
   StringRef Name;
   SectionFlag NewFlags;
 };
@@ -96,7 +96,7 @@ enum class MatchStyle {
   Regex,    // Enabled with --regex.
 };
 
-class NameOrPattern {
+class LLVM_CLASS_ABI NameOrPattern {
   StringRef Name;
   // Regex is shared between multiple CommonConfig instances.
   std::shared_ptr<Regex> R;
@@ -129,7 +129,7 @@ class NameOrPattern {
 
 // Matcher that checks symbol or section names against the command line flags
 // provided for that option.
-class NameMatcher {
+class LLVM_CLASS_ABI NameMatcher {
   DenseSet<CachedHashStringRef> PosNames;
   std::vector<NameOrPattern> PosPatterns;
   std::vector<NameOrPattern> NegMatchers;
@@ -180,7 +180,7 @@ enum class SymbolFlag {
 
 // Symbol info specified by --add-symbol option. Symbol flags not supported
 // by a concrete format should be ignored.
-struct NewSymbolInfo {
+struct LLVM_CLASS_ABI NewSymbolInfo {
   StringRef SymbolName;
   StringRef SectionName;
   uint64_t Value = 0;
@@ -189,7 +189,7 @@ struct NewSymbolInfo {
 };
 
 // Specify section name and section body for newly added or updated section.
-struct NewSectionInfo {
+struct LLVM_CLASS_ABI NewSectionInfo {
   NewSectionInfo() = default;
   NewSectionInfo(StringRef Name, std::unique_ptr<MemoryBuffer> &&Buffer)
       : SectionName(Name), SectionData(std::move(Buffer)) {}
@@ -199,7 +199,7 @@ struct NewSectionInfo {
 };
 
 // Configuration for copying/stripping a single file.
-struct CommonConfig {
+struct LLVM_CLASS_ABI CommonConfig {
   // Main input/output options
   StringRef InputFilename;
   FileFormat InputFormat = FileFormat::Unspecified;
diff --git a/llvm/include/llvm/ObjCopy/ConfigManager.h b/llvm/include/llvm/ObjCopy/ConfigManager.h
index 9859f3a8723864a..b45b36a1613a8c4 100644
--- a/llvm/include/llvm/ObjCopy/ConfigManager.h
+++ b/llvm/include/llvm/ObjCopy/ConfigManager.h
@@ -21,7 +21,7 @@
 namespace llvm {
 namespace objcopy {
 
-struct ConfigManager : public MultiFormatConfig {
+struct LLVM_CLASS_ABI ConfigManager : public MultiFormatConfig {
   virtual ~ConfigManager() {}
 
   const CommonConfig &getCommonConfig() const override { return Common; }
diff --git a/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h b/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h
index cbaef0268fe58a2..20a1f13087f1f97 100644
--- a/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h
+++ b/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h
@@ -18,7 +18,7 @@ namespace llvm {
 namespace objcopy {
 
 // ELF specific configuration for copying/stripping a single file.
-struct ELFConfig {
+struct LLVM_CLASS_ABI ELFConfig {
   uint8_t NewSymbolVisibility = (uint8_t)ELF::STV_DEFAULT;
 
   // ELF entry point address expression. The input parameter is an entry point
diff --git a/llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h b/llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h
index 042a7a98cf86be8..e0a277213d7db3d 100644
--- a/llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h
@@ -29,7 +29,7 @@ namespace elf {
 /// \p In, which must represent an IHex file, and writes the result
 /// into \p Out.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnIHex(const CommonConfig &Config,
+LLVM_FUNC_ABI Error executeObjcopyOnIHex(const CommonConfig &Config,
                            const ELFConfig &ELFConfig, MemoryBuffer &In,
                            raw_ostream &Out);
 
@@ -37,14 +37,14 @@ Error executeObjcopyOnIHex(const CommonConfig &Config,
 /// \p In, which is treated as a raw binary input, and writes the result
 /// into \p Out.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnRawBinary(const CommonConfig &Config,
+LLVM_FUNC_ABI Error executeObjcopyOnRawBinary(const CommonConfig &Config,
                                 const ELFConfig &ELFConfig, MemoryBuffer &In,
                                 raw_ostream &Out);
 
 /// Apply the transformations described by \p Config and \p ELFConfig to
 /// \p In and writes the result into \p Out.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnBinary(const CommonConfig &Config,
+LLVM_FUNC_ABI Error executeObjcopyOnBinary(const CommonConfig &Config,
                              const ELFConfig &ELFConfig,
                              object::ELFObjectFileBase &In, raw_ostream &Out);
 
diff --git a/llvm/include/llvm/ObjCopy/MachO/MachOConfig.h b/llvm/include/llvm/ObjCopy/MachO/MachOConfig.h
index ce2671b08fb63de..715d3de3b028944 100644
--- a/llvm/include/llvm/ObjCopy/MachO/MachOConfig.h
+++ b/llvm/include/llvm/ObjCopy/MachO/MachOConfig.h
@@ -20,7 +20,7 @@ namespace llvm {
 namespace objcopy {
 
 // Mach-O specific configuration for copying/stripping a single file.
-struct MachOConfig {
+struct LLVM_CLASS_ABI MachOConfig {
   // Repeated options
   std::vector<StringRef> RPathToAdd;
   std::vector<StringRef> RPathToPrepend;
diff --git a/llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h b/llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h
index 1aebb8b6775adca..a400df1e6d636e3 100644
--- a/llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h
@@ -29,14 +29,14 @@ namespace macho {
 /// Apply the transformations described by \p Config and \p MachOConfig to
 /// \p In and writes the result into \p Out.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnBinary(const CommonConfig &Config,
+LLVM_FUNC_ABI Error executeObjcopyOnBinary(const CommonConfig &Config,
                              const MachOConfig &MachOConfig,
                              object::MachOObjectFile &In, raw_ostream &Out);
 
 /// Apply the transformations described by \p Config and \p MachOConfig to
 /// \p In and writes the result into \p Out.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnMachOUniversalBinary(
+LLVM_FUNC_ABI Error executeObjcopyOnMachOUniversalBinary(
     const MultiFormatConfig &Config, const object::MachOUniversalBinary &In,
     raw_ostream &Out);
 
diff --git a/llvm/include/llvm/ObjCopy/MultiFormatConfig.h b/llvm/include/llvm/ObjCopy/MultiFormatConfig.h
index a8b22847123b006..78c43d847d437f0 100644
--- a/llvm/include/llvm/ObjCopy/MultiFormatConfig.h
+++ b/llvm/include/llvm/ObjCopy/MultiFormatConfig.h
@@ -22,7 +22,7 @@ struct MachOConfig;
 struct WasmConfig;
 struct XCOFFConfig;
 
-class MultiFormatConfig {
+class LLVM_CLASS_ABI MultiFormatConfig {
 public:
   virtual ~MultiFormatConfig() {}
 
diff --git a/llvm/include/llvm/ObjCopy/ObjCopy.h b/llvm/include/llvm/ObjCopy/ObjCopy.h
index d9808b9d99d8b48..4558daa4a46cc4b 100644
--- a/llvm/include/llvm/ObjCopy/ObjCopy.h
+++ b/llvm/include/llvm/ObjCopy/ObjCopy.h
@@ -27,14 +27,14 @@ class MultiFormatConfig;
 /// each member in archive \p Ar.
 /// Writes a result in a file specified by \p Config.OutputFilename.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnArchive(const MultiFormatConfig &Config,
+LLVM_FUNC_ABI Error executeObjcopyOnArchive(const MultiFormatConfig &Config,
                               const object::Archive &Ar);
 
 /// Applies the transformations described by \p Config to \p In and writes
 /// the result into \p Out. This function does the dispatch based on the
 /// format of the input binary (COFF, ELF, MachO or wasm).
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnBinary(const MultiFormatConfig &Config,
+LLVM_FUNC_ABI Error executeObjcopyOnBinary(const MultiFormatConfig &Config,
                              object::Binary &In, raw_ostream &Out);
 
 } // end namespace objcopy
diff --git a/llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h b/llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h
index 143a62d9d693fd3..d2955ff03b1eb01 100644
--- a/llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h
+++ b/llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h
@@ -15,7 +15,7 @@ namespace llvm {
 namespace objcopy {
 
 // XCOFF specific configuration for copying/stripping a single file.
-struct XCOFFConfig {};
+struct LLVM_CLASS_ABI XCOFFConfig {};
 
 } // namespace objcopy
 } // namespace llvm
diff --git a/llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h b/llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h
index 63501ec297ac6a9..2c61cdfa5605321 100644
--- a/llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h
@@ -27,7 +27,7 @@ namespace xcoff {
 /// Apply the transformations described by \p Config and \p XCOFFConfig
 /// to \p In and writes the result into \p Out.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnBinary(const CommonConfig &Config, const XCOFFConfig &,
+LLVM_FUNC_ABI Error executeObjcopyOnBinary(const CommonConfig &Config, const XCOFFConfig &,
                              object::XCOFFObjectFile &In, raw_ostream &Out);
 
 } // end namespace xcoff
diff --git a/llvm/include/llvm/ObjCopy/wasm/WasmConfig.h b/llvm/include/llvm/ObjCopy/wasm/WasmConfig.h
index fdb767002f67cfd..ecc62b68c7c0848 100644
--- a/llvm/include/llvm/ObjCopy/wasm/WasmConfig.h
+++ b/llvm/include/llvm/ObjCopy/wasm/WasmConfig.h
@@ -15,7 +15,7 @@ namespace llvm {
 namespace objcopy {
 
 // Wasm specific configuration for copying/stripping a single file.
-struct WasmConfig {};
+struct LLVM_CLASS_ABI WasmConfig {};
 
 } // namespace objcopy
 } // namespace llvm
diff --git a/llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h b/llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h
index 526ed0c3c13f504..848328ba11b3669 100644
--- a/llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h
+++ b/llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h
@@ -27,7 +27,7 @@ namespace wasm {
 /// Apply the transformations described by \p Config and \p WasmConfig
 /// to \p In and writes the result into \p Out.
 /// \returns any Error encountered whilst performing the operation.
-Error executeObjcopyOnBinary(const CommonConfig &Config, const WasmConfig &,
+LLVM_FUNC_ABI Error executeObjcopyOnBinary(const CommonConfig &Config, const WasmConfig &,
                              object::WasmObjectFile &In, raw_ostream &Out);
 
 } // end namespace wasm
diff --git a/llvm/include/llvm/Object/Archive.h b/llvm/include/llvm/Object/Archive.h
index 600f74ca6dd98a1..de0dc16e4a8a59e 100644
--- a/llvm/include/llvm/Object/Archive.h
+++ b/llvm/include/llvm/Object/Archive.h
@@ -37,7 +37,7 @@ const char BigArchiveMagic[] = "<bigaf>\n";
 
 class Archive;
 
-class AbstractArchiveMemberHeader {
+class LLVM_CLASS_ABI AbstractArchiveMemberHeader {
 protected:
   AbstractArchiveMemberHeader(const Archive *Parent) : Parent(Parent){};
 
@@ -75,7 +75,7 @@ class AbstractArchiveMemberHeader {
 };
 
 template <typename T>
-class CommonArchiveMemberHeader : public AbstractArchiveMemberHeader {
+class LLVM_CLASS_ABI CommonArchiveMemberHeader : public AbstractArchiveMemberHeader {
 public:
   CommonArchiveMemberHeader(const Archive *Parent, const T *RawHeaderPtr)
       : AbstractArchiveMemberHeader(Parent), ArMemHdr(RawHeaderPtr){};
@@ -90,7 +90,7 @@ class CommonArchiveMemberHeader : public AbstractArchiveMemberHeader {
   T const *ArMemHdr;
 };
 
-struct UnixArMemHdrType {
+struct LLVM_CLASS_ABI UnixArMemHdrType {
   char Name[16];
   char LastModified[12];
   char UID[6];
@@ -100,7 +100,7 @@ struct UnixArMemHdrType {
   char Terminator[2];
 };
 
-class ArchiveMemberHeader : public CommonArchiveMemberHeader<UnixArMemHdrType> {
+class LLVM_CLASS_ABI ArchiveMemberHeader : public CommonArchiveMemberHeader<UnixArMemHdrType> {
 public:
   ArchiveMemberHeader(const Archive *Parent, const char *RawHeaderPtr,
                       uint64_t Size, Error *Err);
@@ -118,7 +118,7 @@ class ArchiveMemberHeader : public CommonArchiveMemberHeader<UnixArMemHdrType> {
 };
 
 // File Member Header
-struct BigArMemHdrType {
+struct LLVM_CLASS_ABI BigArMemHdrType {
   char Size[20];       // File member size in decimal
   char NextOffset[20]; // Next member offset in decimal
   char PrevOffset[20]; // Previous member offset in decimal
@@ -134,7 +134,7 @@ struct BigArMemHdrType {
 };
 
 // Define file member header of AIX big archive.
-class BigArchiveMemberHeader
+class LLVM_CLASS_ABI BigArchiveMemberHeader
     : public CommonArchiveMemberHeader<BigArMemHdrType> {
 
 public:
@@ -154,7 +154,7 @@ class BigArchiveMemberHeader
   Expected<bool> isThin() const override { return false; }
 };
 
-class Archive : public Binary {
+class LLVM_CLASS_ABI Archive : public Binary {
   virtual void anchor();
 
 public:
@@ -394,7 +394,7 @@ class Archive : public Binary {
   mutable std::vector<std::unique_ptr<MemoryBuffer>> ThinBuffers;
 };
 
-class BigArchive : public Archive {
+class LLVM_CLASS_ABI BigArchive : public Archive {
 public:
   /// Fixed-Length Header.
   struct FixLenHdr {
diff --git a/llvm/include/llvm/Object/ArchiveWriter.h b/llvm/include/llvm/Object/ArchiveWriter.h
index be9d21a3e1cd490..97bd63c20657378 100644
--- a/llvm/include/llvm/Object/ArchiveWriter.h
+++ b/llvm/include/llvm/Object/ArchiveWriter.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 
-struct NewArchiveMember {
+struct LLVM_CLASS_ABI NewArchiveMember {
   std::unique_ptr<MemoryBuffer> Buf;
   StringRef MemberName;
   sys::TimePoint<std::chrono::seconds> ModTime;
@@ -39,9 +39,9 @@ struct NewArchiveMember {
                                             bool Deterministic);
 };
 
-Expected<std::string> computeArchiveRelativePath(StringRef From, StringRef To);
+LLVM_FUNC_ABI Expected<std::string> computeArchiveRelativePath(StringRef From, StringRef To);
 
-Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
+LLVM_FUNC_ABI Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
                    bool WriteSymtab, object::Archive::Kind Kind,
                    bool Deterministic, bool Thin,
                    std::unique_ptr<MemoryBuffer> OldArchiveBuf = nullptr,
@@ -49,7 +49,7 @@ Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
 
 // writeArchiveToBuffer is similar to writeArchive but returns the Archive in a
 // buffer instead of writing it out to a file.
-Expected<std::unique_ptr<MemoryBuffer>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<MemoryBuffer>>
 writeArchiveToBuffer(ArrayRef<NewArchiveMember> NewMembers, bool WriteSymtab,
                      object::Archive::Kind Kind, bool Deterministic, bool Thin);
 }
diff --git a/llvm/include/llvm/Object/Binary.h b/llvm/include/llvm/Object/Binary.h
index 9a1566c8d0e401d..fbf28b8cf3bac6e 100644
--- a/llvm/include/llvm/Object/Binary.h
+++ b/llvm/include/llvm/Object/Binary.h
@@ -30,7 +30,7 @@ class StringRef;
 
 namespace object {
 
-class Binary {
+class LLVM_CLASS_ABI Binary {
 private:
   unsigned int TypeID;
 
@@ -190,11 +190,11 @@ DEFINE_ISA_CONVERSION_FUNCTIONS(Binary, LLVMBinaryRef)
 /// Create a Binary from Source, autodetecting the file type.
 ///
 /// @param Source The data to create the Binary from.
-Expected<std::unique_ptr<Binary>> createBinary(MemoryBufferRef Source,
+LLVM_FUNC_ABI Expected<std::unique_ptr<Binary>> createBinary(MemoryBufferRef Source,
                                                LLVMContext *Context = nullptr,
                                                bool InitContent = true);
 
-template <typename T> class OwningBinary {
+template <typename T> class LLVM_CLASS_ABI OwningBinary {
   std::unique_ptr<T> Bin;
   std::unique_ptr<MemoryBuffer> Buf;
 
@@ -242,7 +242,7 @@ template <typename T> const T* OwningBinary<T>::getBinary() const {
   return Bin.get();
 }
 
-Expected<OwningBinary<Binary>> createBinary(StringRef Path,
+LLVM_FUNC_ABI Expected<OwningBinary<Binary>> createBinary(StringRef Path,
                                             LLVMContext *Context = nullptr,
                                             bool InitContent = true);
 
diff --git a/llvm/include/llvm/Object/BuildID.h b/llvm/include/llvm/Object/BuildID.h
index 9cbc3527cd8b972..111be42a90a112b 100644
--- a/llvm/include/llvm/Object/BuildID.h
+++ b/llvm/include/llvm/Object/BuildID.h
@@ -31,13 +31,13 @@ typedef ArrayRef<uint8_t> BuildIDRef;
 class ObjectFile;
 
 /// Parses a build ID from a hex string.
-BuildID parseBuildID(StringRef Str);
+LLVM_FUNC_ABI BuildID parseBuildID(StringRef Str);
 
 /// Returns the build ID, if any, contained in the given object file.
-BuildIDRef getBuildID(const ObjectFile *Obj);
+LLVM_FUNC_ABI BuildIDRef getBuildID(const ObjectFile *Obj);
 
 /// BuildIDFetcher searches local cache directories for debug info.
-class BuildIDFetcher {
+class LLVM_CLASS_ABI BuildIDFetcher {
 public:
   BuildIDFetcher(std::vector<std::string> DebugFileDirectories)
       : DebugFileDirectories(std::move(DebugFileDirectories)) {}
diff --git a/llvm/include/llvm/Object/COFF.h b/llvm/include/llvm/Object/COFF.h
index a2fb51913d73b46..453a2609f9795a5 100644
--- a/llvm/include/llvm/Object/COFF.h
+++ b/llvm/include/llvm/Object/COFF.h
@@ -51,7 +51,7 @@ using imported_symbol_iterator = content_iterator<ImportedSymbolRef>;
 using base_reloc_iterator = content_iterator<BaseRelocRef>;
 
 /// The DOS compatible header at the front of all PE/COFF executables.
-struct dos_header {
+struct LLVM_CLASS_ABI dos_header {
   char                 Magic[2];
   support::ulittle16_t UsedBytesInTheLastPage;
   support::ulittle16_t FileSizeInPages;
@@ -73,7 +73,7 @@ struct dos_header {
   support::ulittle32_t AddressOfNewExeHeader;
 };
 
-struct coff_file_header {
+struct LLVM_CLASS_ABI coff_file_header {
   support::ulittle16_t Machine;
   support::ulittle16_t NumberOfSections;
   support::ulittle32_t TimeDateStamp;
@@ -85,7 +85,7 @@ struct coff_file_header {
   bool isImportLibrary() const { return NumberOfSections == 0xffff; }
 };
 
-struct coff_bigobj_file_header {
+struct LLVM_CLASS_ABI coff_bigobj_file_header {
   support::ulittle16_t Sig1;
   support::ulittle16_t Sig2;
   support::ulittle16_t Version;
@@ -102,7 +102,7 @@ struct coff_bigobj_file_header {
 };
 
 /// The 32-bit PE header that follows the COFF header.
-struct pe32_header {
+struct LLVM_CLASS_ABI pe32_header {
   support::ulittle16_t Magic;
   uint8_t MajorLinkerVersion;
   uint8_t MinorLinkerVersion;
@@ -138,7 +138,7 @@ struct pe32_header {
 };
 
 /// The 64-bit PE header that follows the COFF header.
-struct pe32plus_header {
+struct LLVM_CLASS_ABI pe32plus_header {
   support::ulittle16_t Magic;
   uint8_t MajorLinkerVersion;
   uint8_t MinorLinkerVersion;
@@ -170,12 +170,12 @@ struct pe32plus_header {
   support::ulittle32_t NumberOfRvaAndSize;
 };
 
-struct data_directory {
+struct LLVM_CLASS_ABI data_directory {
   support::ulittle32_t RelativeVirtualAddress;
   support::ulittle32_t Size;
 };
 
-struct debug_directory {
+struct LLVM_CLASS_ABI debug_directory {
   support::ulittle32_t Characteristics;
   support::ulittle32_t TimeDateStamp;
   support::ulittle16_t MajorVersion;
@@ -187,7 +187,7 @@ struct debug_directory {
 };
 
 template <typename IntTy>
-struct import_lookup_table_entry {
+struct LLVM_CLASS_ABI import_lookup_table_entry {
   IntTy Data;
 
   bool isOrdinal() const { return Data < 0; }
@@ -208,7 +208,7 @@ using import_lookup_table_entry32 =
 using import_lookup_table_entry64 =
     import_lookup_table_entry<support::little64_t>;
 
-struct delay_import_directory_table_entry {
+struct LLVM_CLASS_ABI delay_import_directory_table_entry {
   // dumpbin reports this field as "Characteristics" instead of "Attributes".
   support::ulittle32_t Attributes;
   support::ulittle32_t Name;
@@ -220,7 +220,7 @@ struct delay_import_directory_table_entry {
   support::ulittle32_t TimeStamp;
 };
 
-struct export_directory_table_entry {
+struct LLVM_CLASS_ABI export_directory_table_entry {
   support::ulittle32_t ExportFlags;
   support::ulittle32_t TimeDateStamp;
   support::ulittle16_t MajorVersion;
@@ -242,13 +242,13 @@ union export_address_table_entry {
 using export_name_pointer_table_entry = support::ulittle32_t;
 using export_ordinal_table_entry = support::ulittle16_t;
 
-struct StringTableOffset {
+struct LLVM_CLASS_ABI StringTableOffset {
   support::ulittle32_t Zeroes;
   support::ulittle32_t Offset;
 };
 
 template <typename SectionNumberType>
-struct coff_symbol {
+struct LLVM_CLASS_ABI coff_symbol {
   union {
     char ShortName[COFF::NameSize];
     StringTableOffset Offset;
@@ -267,7 +267,7 @@ using coff_symbol16 = coff_symbol<support::ulittle16_t>;
 using coff_symbol32 = coff_symbol<support::ulittle32_t>;
 
 // Contains only common parts of coff_symbol16 and coff_symbol32.
-struct coff_symbol_generic {
+struct LLVM_CLASS_ABI coff_symbol_generic {
   union {
     char ShortName[COFF::NameSize];
     StringTableOffset Offset;
@@ -278,7 +278,7 @@ struct coff_symbol_generic {
 struct coff_aux_section_definition;
 struct coff_aux_weak_external;
 
-class COFFSymbolRef {
+class LLVM_CLASS_ABI COFFSymbolRef {
 public:
   COFFSymbolRef() = default;
   COFFSymbolRef(const coff_symbol16 *CS) : CS16(CS) {}
@@ -438,7 +438,7 @@ class COFFSymbolRef {
   const coff_symbol32 *CS32 = nullptr;
 };
 
-struct coff_section {
+struct LLVM_CLASS_ABI coff_section {
   char Name[COFF::NameSize];
   support::ulittle32_t VirtualSize;
   support::ulittle32_t VirtualAddress;
@@ -472,13 +472,13 @@ struct coff_section {
   }
 };
 
-struct coff_relocation {
+struct LLVM_CLASS_ABI coff_relocation {
   support::ulittle32_t VirtualAddress;
   support::ulittle32_t SymbolTableIndex;
   support::ulittle16_t Type;
 };
 
-struct coff_aux_function_definition {
+struct LLVM_CLASS_ABI coff_aux_function_definition {
   support::ulittle32_t TagIndex;
   support::ulittle32_t TotalSize;
   support::ulittle32_t PointerToLinenumber;
@@ -489,7 +489,7 @@ struct coff_aux_function_definition {
 static_assert(sizeof(coff_aux_function_definition) == 18,
               "auxiliary entry must be 18 bytes");
 
-struct coff_aux_bf_and_ef_symbol {
+struct LLVM_CLASS_ABI coff_aux_bf_and_ef_symbol {
   char Unused1[4];
   support::ulittle16_t Linenumber;
   char Unused2[6];
@@ -500,7 +500,7 @@ struct coff_aux_bf_and_ef_symbol {
 static_assert(sizeof(coff_aux_bf_and_ef_symbol) == 18,
               "auxiliary entry must be 18 bytes");
 
-struct coff_aux_weak_external {
+struct LLVM_CLASS_ABI coff_aux_weak_external {
   support::ulittle32_t TagIndex;
   support::ulittle32_t Characteristics;
   char Unused1[10];
@@ -509,7 +509,7 @@ struct coff_aux_weak_external {
 static_assert(sizeof(coff_aux_weak_external) == 18,
               "auxiliary entry must be 18 bytes");
 
-struct coff_aux_section_definition {
+struct LLVM_CLASS_ABI coff_aux_section_definition {
   support::ulittle32_t Length;
   support::ulittle16_t NumberOfRelocations;
   support::ulittle16_t NumberOfLinenumbers;
@@ -529,7 +529,7 @@ struct coff_aux_section_definition {
 static_assert(sizeof(coff_aux_section_definition) == 18,
               "auxiliary entry must be 18 bytes");
 
-struct coff_aux_clr_token {
+struct LLVM_CLASS_ABI coff_aux_clr_token {
   uint8_t              AuxType;
   uint8_t              Reserved;
   support::ulittle32_t SymbolTableIndex;
@@ -539,7 +539,7 @@ struct coff_aux_clr_token {
 static_assert(sizeof(coff_aux_clr_token) == 18,
               "auxiliary entry must be 18 bytes");
 
-struct coff_import_header {
+struct LLVM_CLASS_ABI coff_import_header {
   support::ulittle16_t Sig1;
   support::ulittle16_t Sig2;
   support::ulittle16_t Version;
@@ -553,7 +553,7 @@ struct coff_import_header {
   int getNameType() const { return (TypeInfo >> 2) & 0x7; }
 };
 
-struct coff_import_directory_table_entry {
+struct LLVM_CLASS_ABI coff_import_directory_table_entry {
   support::ulittle32_t ImportLookupTableRVA;
   support::ulittle32_t TimeDateStamp;
   support::ulittle32_t ForwarderChain;
@@ -567,7 +567,7 @@ struct coff_import_directory_table_entry {
 };
 
 template <typename IntTy>
-struct coff_tls_directory {
+struct LLVM_CLASS_ABI coff_tls_directory {
   IntTy StartAddressOfRawData;
   IntTy EndAddressOfRawData;
   IntTy AddressOfIndex;
@@ -600,7 +600,7 @@ using coff_tls_directory64 = coff_tls_directory<support::little64_t>;
 
 enum class frame_type : uint16_t { Fpo = 0, Trap = 1, Tss = 2, NonFpo = 3 };
 
-struct coff_load_config_code_integrity {
+struct LLVM_CLASS_ABI coff_load_config_code_integrity {
   support::ulittle16_t Flags;
   support::ulittle16_t Catalog;
   support::ulittle32_t CatalogOffset;
@@ -608,7 +608,7 @@ struct coff_load_config_code_integrity {
 };
 
 /// 32-bit load config (IMAGE_LOAD_CONFIG_DIRECTORY32)
-struct coff_load_configuration32 {
+struct LLVM_CLASS_ABI coff_load_configuration32 {
   support::ulittle32_t Size;
   support::ulittle32_t TimeDateStamp;
   support::ulittle16_t MajorVersion;
@@ -666,7 +666,7 @@ struct coff_load_configuration32 {
 };
 
 /// 64-bit load config (IMAGE_LOAD_CONFIG_DIRECTORY64)
-struct coff_load_configuration64 {
+struct LLVM_CLASS_ABI coff_load_configuration64 {
   support::ulittle32_t Size;
   support::ulittle32_t TimeDateStamp;
   support::ulittle16_t MajorVersion;
@@ -723,7 +723,7 @@ struct coff_load_configuration64 {
   support::ulittle64_t CastGuardOsDeterminedFailureMode;
 };
 
-struct chpe_metadata {
+struct LLVM_CLASS_ABI chpe_metadata {
   support::ulittle32_t Version;
   support::ulittle32_t CodeMap;
   support::ulittle32_t CodeMapCount;
@@ -746,43 +746,43 @@ struct chpe_metadata {
   support::ulittle32_t AuxiliaryIATCopy;
 };
 
-struct chpe_range_entry {
+struct LLVM_CLASS_ABI chpe_range_entry {
   support::ulittle32_t StartOffset;
   support::ulittle32_t Length;
 };
 
 enum chpe_range_type { CHPE_RANGE_ARM64, CHPE_RANGE_ARM64EC, CHPE_RANGE_AMD64 };
 
-struct chpe_code_range_entry {
+struct LLVM_CLASS_ABI chpe_code_range_entry {
   support::ulittle32_t StartRva;
   support::ulittle32_t EndRva;
   support::ulittle32_t EntryPoint;
 };
 
-struct chpe_redirection_entry {
+struct LLVM_CLASS_ABI chpe_redirection_entry {
   support::ulittle32_t Source;
   support::ulittle32_t Destination;
 };
 
-struct coff_runtime_function_x64 {
+struct LLVM_CLASS_ABI coff_runtime_function_x64 {
   support::ulittle32_t BeginAddress;
   support::ulittle32_t EndAddress;
   support::ulittle32_t UnwindInformation;
 };
 
-struct coff_base_reloc_block_header {
+struct LLVM_CLASS_ABI coff_base_reloc_block_header {
   support::ulittle32_t PageRVA;
   support::ulittle32_t BlockSize;
 };
 
-struct coff_base_reloc_block_entry {
+struct LLVM_CLASS_ABI coff_base_reloc_block_entry {
   support::ulittle16_t Data;
 
   int getType() const { return Data >> 12; }
   int getOffset() const { return Data & ((1 << 12) - 1); }
 };
 
-struct coff_resource_dir_entry {
+struct LLVM_CLASS_ABI coff_resource_dir_entry {
   union {
     support::ulittle32_t NameOffset;
     support::ulittle32_t ID;
@@ -805,14 +805,14 @@ struct coff_resource_dir_entry {
   } Offset;
 };
 
-struct coff_resource_data_entry {
+struct LLVM_CLASS_ABI coff_resource_data_entry {
   support::ulittle32_t DataRVA;
   support::ulittle32_t DataSize;
   support::ulittle32_t Codepage;
   support::ulittle32_t Reserved;
 };
 
-struct coff_resource_dir_table {
+struct LLVM_CLASS_ABI coff_resource_dir_table {
   support::ulittle32_t Characteristics;
   support::ulittle32_t TimeDateStamp;
   support::ulittle16_t MajorVersion;
@@ -821,13 +821,13 @@ struct coff_resource_dir_table {
   support::ulittle16_t NumberOfIDEntries;
 };
 
-struct debug_h_header {
+struct LLVM_CLASS_ABI debug_h_header {
   support::ulittle32_t Magic;
   support::ulittle16_t Version;
   support::ulittle16_t HashAlgorithm;
 };
 
-class COFFObjectFile : public ObjectFile {
+class LLVM_CLASS_ABI COFFObjectFile : public ObjectFile {
 private:
   COFFObjectFile(MemoryBufferRef Object);
 
@@ -1156,7 +1156,7 @@ class COFFObjectFile : public ObjectFile {
 };
 
 // The iterator for the import directory table.
-class ImportDirectoryEntryRef {
+class LLVM_CLASS_ABI ImportDirectoryEntryRef {
 public:
   ImportDirectoryEntryRef() = default;
   ImportDirectoryEntryRef(const coff_import_directory_table_entry *Table,
@@ -1187,7 +1187,7 @@ class ImportDirectoryEntryRef {
   const COFFObjectFile *OwningObject = nullptr;
 };
 
-class DelayImportDirectoryEntryRef {
+class LLVM_CLASS_ABI DelayImportDirectoryEntryRef {
 public:
   DelayImportDirectoryEntryRef() = default;
   DelayImportDirectoryEntryRef(const delay_import_directory_table_entry *T,
@@ -1213,7 +1213,7 @@ class DelayImportDirectoryEntryRef {
 };
 
 // The iterator for the export directory table entry.
-class ExportDirectoryEntryRef {
+class LLVM_CLASS_ABI ExportDirectoryEntryRef {
 public:
   ExportDirectoryEntryRef() = default;
   ExportDirectoryEntryRef(const export_directory_table_entry *Table, uint32_t I,
@@ -1238,7 +1238,7 @@ class ExportDirectoryEntryRef {
   const COFFObjectFile *OwningObject = nullptr;
 };
 
-class ImportedSymbolRef {
+class LLVM_CLASS_ABI ImportedSymbolRef {
 public:
   ImportedSymbolRef() = default;
   ImportedSymbolRef(const import_lookup_table_entry32 *Entry, uint32_t I,
@@ -1263,7 +1263,7 @@ class ImportedSymbolRef {
   const COFFObjectFile *OwningObject = nullptr;
 };
 
-class BaseRelocRef {
+class LLVM_CLASS_ABI BaseRelocRef {
 public:
   BaseRelocRef() = default;
   BaseRelocRef(const coff_base_reloc_block_header *Header,
@@ -1281,7 +1281,7 @@ class BaseRelocRef {
   uint32_t Index;
 };
 
-class ResourceSectionRef {
+class LLVM_CLASS_ABI ResourceSectionRef {
 public:
   ResourceSectionRef() = default;
   explicit ResourceSectionRef(StringRef Ref) : BBS(Ref, support::little) {}
@@ -1318,7 +1318,7 @@ class ResourceSectionRef {
 };
 
 // Corresponds to `_FPO_DATA` structure in the PE/COFF spec.
-struct FpoData {
+struct LLVM_CLASS_ABI FpoData {
   support::ulittle32_t Offset; // ulOffStart: Offset 1st byte of function code
   support::ulittle32_t Size;   // cbProcSize: # bytes in function
   support::ulittle32_t NumLocals; // cdwLocals: # bytes in locals/4
@@ -1341,7 +1341,7 @@ struct FpoData {
   frame_type getFP() const { return static_cast<frame_type>(Attributes >> 14); }
 };
 
-class SectionStrippedError
+class LLVM_CLASS_ABI SectionStrippedError
     : public ErrorInfo<SectionStrippedError, BinaryError> {
 public:
   SectionStrippedError() { setErrorCode(object_error::section_stripped); }
diff --git a/llvm/include/llvm/Object/COFFImportFile.h b/llvm/include/llvm/Object/COFFImportFile.h
index a1e64c66d502a47..1566ff5fb73b797 100644
--- a/llvm/include/llvm/Object/COFFImportFile.h
+++ b/llvm/include/llvm/Object/COFFImportFile.h
@@ -27,7 +27,7 @@
 namespace llvm {
 namespace object {
 
-class COFFImportFile : public SymbolicFile {
+class LLVM_CLASS_ABI COFFImportFile : public SymbolicFile {
 public:
   COFFImportFile(MemoryBufferRef Source)
       : SymbolicFile(ID_COFFImportFile, Source) {}
@@ -70,7 +70,7 @@ class COFFImportFile : public SymbolicFile {
   }
 };
 
-struct COFFShortExport {
+struct LLVM_CLASS_ABI COFFShortExport {
   /// The name of the export as specified in the .def file or on the command
   /// line, i.e. "foo" in "/EXPORT:foo", and "bar" in "/EXPORT:foo=bar". This
   /// may lack mangling, such as underscore prefixing and stdcall suffixing.
@@ -105,7 +105,7 @@ struct COFFShortExport {
   }
 };
 
-Error writeImportLibrary(StringRef ImportName, StringRef Path,
+LLVM_FUNC_ABI Error writeImportLibrary(StringRef ImportName, StringRef Path,
                          ArrayRef<COFFShortExport> Exports,
                          COFF::MachineTypes Machine, bool MinGW);
 
diff --git a/llvm/include/llvm/Object/COFFModuleDefinition.h b/llvm/include/llvm/Object/COFFModuleDefinition.h
index e8c5114f2ac11d1..05d9bf51d6f50d6 100644
--- a/llvm/include/llvm/Object/COFFModuleDefinition.h
+++ b/llvm/include/llvm/Object/COFFModuleDefinition.h
@@ -25,7 +25,7 @@
 namespace llvm {
 namespace object {
 
-struct COFFModuleDefinition {
+struct LLVM_CLASS_ABI COFFModuleDefinition {
   std::vector<COFFShortExport> Exports;
   std::string OutputFile;
   std::string ImportName;
@@ -40,7 +40,7 @@ struct COFFModuleDefinition {
   uint32_t MinorOSVersion = 0;
 };
 
-Expected<COFFModuleDefinition>
+LLVM_FUNC_ABI Expected<COFFModuleDefinition>
 parseCOFFModuleDefinition(MemoryBufferRef MB, COFF::MachineTypes Machine,
                           bool MingwDef = false, bool AddUnderscores = true);
 
diff --git a/llvm/include/llvm/Object/CVDebugRecord.h b/llvm/include/llvm/Object/CVDebugRecord.h
index 7db7b778f4431ce..f80efa358966172 100644
--- a/llvm/include/llvm/Object/CVDebugRecord.h
+++ b/llvm/include/llvm/Object/CVDebugRecord.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 namespace OMF {
-struct Signature {
+struct LLVM_CLASS_ABI Signature {
   enum ID : uint32_t {
     PDB70 = 0x53445352, // RSDS
     PDB20 = 0x3031424e, // NB10
@@ -28,14 +28,14 @@ struct Signature {
 }
 
 namespace codeview {
-struct PDB70DebugInfo {
+struct LLVM_CLASS_ABI PDB70DebugInfo {
   support::ulittle32_t CVSignature;
   uint8_t Signature[16];
   support::ulittle32_t Age;
   // char PDBFileName[];
 };
 
-struct PDB20DebugInfo {
+struct LLVM_CLASS_ABI PDB20DebugInfo {
   support::ulittle32_t CVSignature;
   support::ulittle32_t Offset;
   support::ulittle32_t Signature;
diff --git a/llvm/include/llvm/Object/DXContainer.h b/llvm/include/llvm/Object/DXContainer.h
index 33aa18470af387e..acdd162c359e4c9 100644
--- a/llvm/include/llvm/Object/DXContainer.h
+++ b/llvm/include/llvm/Object/DXContainer.h
@@ -28,7 +28,7 @@ namespace llvm {
 namespace object {
 
 namespace DirectX {
-class PSVRuntimeInfo {
+class LLVM_CLASS_ABI PSVRuntimeInfo {
 
   // This class provides a view into the underlying resource array. The Resource
   // data is little-endian encoded and may not be properly aligned to read
@@ -129,7 +129,7 @@ class PSVRuntimeInfo {
 
 } // namespace DirectX
 
-class DXContainer {
+class LLVM_CLASS_ABI DXContainer {
 public:
   using DXILData = std::pair<dxbc::ProgramHeader, const char *>;
 
diff --git a/llvm/include/llvm/Object/Decompressor.h b/llvm/include/llvm/Object/Decompressor.h
index a51fa8691635b8c..105b49603e7b070 100644
--- a/llvm/include/llvm/Object/Decompressor.h
+++ b/llvm/include/llvm/Object/Decompressor.h
@@ -19,7 +19,7 @@ namespace llvm {
 namespace object {
 
 /// Decompressor helps to handle decompression of compressed sections.
-class Decompressor {
+class LLVM_CLASS_ABI Decompressor {
 public:
   /// Create decompressor object.
   /// @param Name        Section name.
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index 2119c9b54566e85..682aafa6b9ad0c8 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -33,12 +33,12 @@
 namespace llvm {
 namespace object {
 
-struct VerdAux {
+struct LLVM_CLASS_ABI VerdAux {
   unsigned Offset;
   std::string Name;
 };
 
-struct VerDef {
+struct LLVM_CLASS_ABI VerDef {
   unsigned Offset;
   unsigned Version;
   unsigned Flags;
@@ -49,7 +49,7 @@ struct VerDef {
   std::vector<VerdAux> AuxV;
 };
 
-struct VernAux {
+struct LLVM_CLASS_ABI VernAux {
   unsigned Hash;
   unsigned Flags;
   unsigned Other;
@@ -57,7 +57,7 @@ struct VernAux {
   std::string Name;
 };
 
-struct VerNeed {
+struct LLVM_CLASS_ABI VerNeed {
   unsigned Version;
   unsigned Cnt;
   unsigned Offset;
@@ -65,14 +65,14 @@ struct VerNeed {
   std::vector<VernAux> AuxV;
 };
 
-struct VersionEntry {
+struct LLVM_CLASS_ABI VersionEntry {
   std::string Name;
   bool IsVerDef;
 };
 
-StringRef getELFRelocationTypeName(uint32_t Machine, uint32_t Type);
-uint32_t getELFRelativeRelocationType(uint32_t Machine);
-StringRef getELFSectionTypeName(uint32_t Machine, uint32_t Type);
+LLVM_FUNC_ABI StringRef getELFRelocationTypeName(uint32_t Machine, uint32_t Type);
+LLVM_FUNC_ABI uint32_t getELFRelativeRelocationType(uint32_t Machine);
+LLVM_FUNC_ABI StringRef getELFSectionTypeName(uint32_t Machine, uint32_t Type);
 
 // Subclasses of ELFFile may need this for template instantiation
 inline std::pair<unsigned char, unsigned char>
@@ -96,7 +96,7 @@ enum PPCInstrMasks : uint64_t {
 
 template <class ELFT> class ELFFile;
 
-template <class T> struct DataRegion {
+template <class T> struct LLVM_CLASS_ABI DataRegion {
   // This constructor is used when we know the start and the size of a data
   // region. We assume that Arr does not go past the end of the file.
   DataRegion(ArrayRef<T> Arr) : First(Arr.data()), Size(Arr.size()) {}
@@ -166,7 +166,7 @@ static inline Error defaultWarningHandler(const Twine &Msg) {
 }
 
 template <class ELFT>
-class ELFFile {
+class LLVM_CLASS_ABI ELFFile {
 public:
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
 
diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h
index 152155fb8a27080..a90e162cb4c719e 100644
--- a/llvm/include/llvm/Object/ELFObjectFile.h
+++ b/llvm/include/llvm/Object/ELFObjectFile.h
@@ -45,17 +45,17 @@ template <typename T> class SmallVectorImpl;
 namespace object {
 
 constexpr int NumElfSymbolTypes = 16;
-extern const llvm::EnumEntry<unsigned> ElfSymbolTypes[NumElfSymbolTypes];
+LLVM_FUNC_ABI extern const llvm::EnumEntry<unsigned> ElfSymbolTypes[NumElfSymbolTypes];
 
 class elf_symbol_iterator;
 
-struct ELFPltEntry {
+struct LLVM_CLASS_ABI ELFPltEntry {
   StringRef Section;
   std::optional<DataRefImpl> Symbol;
   uint64_t Address;
 };
 
-class ELFObjectFileBase : public ObjectFile {
+class LLVM_CLASS_ABI ELFObjectFileBase : public ObjectFile {
   friend class ELFRelocationRef;
   friend class ELFSectionRef;
   friend class ELFSymbolRef;
@@ -117,7 +117,7 @@ class ELFObjectFileBase : public ObjectFile {
   readBBAddrMap(std::optional<unsigned> TextSectionIndex = std::nullopt) const;
 };
 
-class ELFSectionRef : public SectionRef {
+class LLVM_CLASS_ABI ELFSectionRef : public SectionRef {
 public:
   ELFSectionRef(const SectionRef &B) : SectionRef(B) {
     assert(isa<ELFObjectFileBase>(SectionRef::getObject()));
@@ -140,7 +140,7 @@ class ELFSectionRef : public SectionRef {
   }
 };
 
-class elf_section_iterator : public section_iterator {
+class LLVM_CLASS_ABI elf_section_iterator : public section_iterator {
 public:
   elf_section_iterator(const section_iterator &B) : section_iterator(B) {
     assert(isa<ELFObjectFileBase>(B->getObject()));
@@ -155,7 +155,7 @@ class elf_section_iterator : public section_iterator {
   }
 };
 
-class ELFSymbolRef : public SymbolRef {
+class LLVM_CLASS_ABI ELFSymbolRef : public SymbolRef {
 public:
   ELFSymbolRef(const SymbolRef &B) : SymbolRef(B) {
     assert(isa<ELFObjectFileBase>(SymbolRef::getObject()));
@@ -192,7 +192,7 @@ class ELFSymbolRef : public SymbolRef {
   }
 };
 
-class elf_symbol_iterator : public symbol_iterator {
+class LLVM_CLASS_ABI elf_symbol_iterator : public symbol_iterator {
 public:
   elf_symbol_iterator(const basic_symbol_iterator &B)
       : symbol_iterator(SymbolRef(B->getRawDataRefImpl(),
@@ -207,7 +207,7 @@ class elf_symbol_iterator : public symbol_iterator {
   }
 };
 
-class ELFRelocationRef : public RelocationRef {
+class LLVM_CLASS_ABI ELFRelocationRef : public RelocationRef {
 public:
   ELFRelocationRef(const RelocationRef &B) : RelocationRef(B) {
     assert(isa<ELFObjectFileBase>(RelocationRef::getObject()));
@@ -222,7 +222,7 @@ class ELFRelocationRef : public RelocationRef {
   }
 };
 
-class elf_relocation_iterator : public relocation_iterator {
+class LLVM_CLASS_ABI elf_relocation_iterator : public relocation_iterator {
 public:
   elf_relocation_iterator(const relocation_iterator &B)
       : relocation_iterator(RelocationRef(
@@ -244,7 +244,7 @@ ELFObjectFileBase::symbols() const {
   return elf_symbol_iterator_range(symbol_begin(), symbol_end());
 }
 
-template <class ELFT> class ELFObjectFile : public ELFObjectFileBase {
+template <class ELFT> class LLVM_CLASS_ABI ELFObjectFile : public ELFObjectFileBase {
   uint16_t getEMachine() const override;
   uint16_t getEType() const override;
   uint64_t getSymbolSize(DataRefImpl Sym) const override;
diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h
index f8a698bb35a5364..026fd73af06c5fe 100644
--- a/llvm/include/llvm/Object/ELFTypes.h
+++ b/llvm/include/llvm/Object/ELFTypes.h
@@ -46,7 +46,7 @@ template <class ELFT> class Elf_Note_Impl;
 template <class ELFT> class Elf_Note_Iterator_Impl;
 template <class ELFT> struct Elf_CGProfile_Impl;
 
-template <endianness E, bool Is64> struct ELFType {
+template <endianness E, bool Is64> struct LLVM_CLASS_ABI ELFType {
 private:
   template <typename Ty>
   using packed = support::detail::packed_endian_specific_integral<Ty, E, 1>;
@@ -147,7 +147,7 @@ using ELF64BE = ELFType<support::big, true>;
 template <class ELFT> struct Elf_Shdr_Base;
 
 template <endianness TargetEndianness>
-struct Elf_Shdr_Base<ELFType<TargetEndianness, false>> {
+struct LLVM_CLASS_ABI Elf_Shdr_Base<ELFType<TargetEndianness, false>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
   Elf_Word sh_name;      // Section name (index into string table)
   Elf_Word sh_type;      // Section type (SHT_*)
@@ -162,7 +162,7 @@ struct Elf_Shdr_Base<ELFType<TargetEndianness, false>> {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Shdr_Base<ELFType<TargetEndianness, true>> {
+struct LLVM_CLASS_ABI Elf_Shdr_Base<ELFType<TargetEndianness, true>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
   Elf_Word sh_name;       // Section name (index into string table)
   Elf_Word sh_type;       // Section type (SHT_*)
@@ -177,7 +177,7 @@ struct Elf_Shdr_Base<ELFType<TargetEndianness, true>> {
 };
 
 template <class ELFT>
-struct Elf_Shdr_Impl : Elf_Shdr_Base<ELFT> {
+struct LLVM_CLASS_ABI Elf_Shdr_Impl : Elf_Shdr_Base<ELFT> {
   using Elf_Shdr_Base<ELFT>::sh_entsize;
   using Elf_Shdr_Base<ELFT>::sh_size;
 
@@ -192,7 +192,7 @@ struct Elf_Shdr_Impl : Elf_Shdr_Base<ELFT> {
 template <class ELFT> struct Elf_Sym_Base;
 
 template <endianness TargetEndianness>
-struct Elf_Sym_Base<ELFType<TargetEndianness, false>> {
+struct LLVM_CLASS_ABI Elf_Sym_Base<ELFType<TargetEndianness, false>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
   Elf_Word st_name;       // Symbol name (index into string table)
   Elf_Addr st_value;      // Value or address associated with the symbol
@@ -203,7 +203,7 @@ struct Elf_Sym_Base<ELFType<TargetEndianness, false>> {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Sym_Base<ELFType<TargetEndianness, true>> {
+struct LLVM_CLASS_ABI Elf_Sym_Base<ELFType<TargetEndianness, true>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
   Elf_Word st_name;       // Symbol name (index into string table)
   unsigned char st_info;  // Symbol's type and binding attributes
@@ -214,7 +214,7 @@ struct Elf_Sym_Base<ELFType<TargetEndianness, true>> {
 };
 
 template <class ELFT>
-struct Elf_Sym_Impl : Elf_Sym_Base<ELFT> {
+struct LLVM_CLASS_ABI Elf_Sym_Impl : Elf_Sym_Base<ELFT> {
   using Elf_Sym_Base<ELFT>::st_info;
   using Elf_Sym_Base<ELFT>::st_shndx;
   using Elf_Sym_Base<ELFT>::st_other;
@@ -289,7 +289,7 @@ Expected<StringRef> Elf_Sym_Impl<ELFT>::getName(StringRef StrTab) const {
 /// Elf_Versym: This is the structure of entries in the SHT_GNU_versym section
 /// (.gnu.version). This structure is identical for ELF32 and ELF64.
 template <class ELFT>
-struct Elf_Versym_Impl {
+struct LLVM_CLASS_ABI Elf_Versym_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Half vs_index; // Version index with flags (e.g. VERSYM_HIDDEN)
 };
@@ -297,7 +297,7 @@ struct Elf_Versym_Impl {
 /// Elf_Verdef: This is the structure of entries in the SHT_GNU_verdef section
 /// (.gnu.version_d). This structure is identical for ELF32 and ELF64.
 template <class ELFT>
-struct Elf_Verdef_Impl {
+struct LLVM_CLASS_ABI Elf_Verdef_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Half vd_version; // Version of this structure (e.g. VER_DEF_CURRENT)
   Elf_Half vd_flags;   // Bitwise flags (VER_DEF_*)
@@ -316,7 +316,7 @@ struct Elf_Verdef_Impl {
 /// Elf_Verdaux: This is the structure of auxiliary data in the SHT_GNU_verdef
 /// section (.gnu.version_d). This structure is identical for ELF32 and ELF64.
 template <class ELFT>
-struct Elf_Verdaux_Impl {
+struct LLVM_CLASS_ABI Elf_Verdaux_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Word vda_name; // Version name (offset in string table)
   Elf_Word vda_next; // Offset to next Verdaux entry (in bytes)
@@ -325,7 +325,7 @@ struct Elf_Verdaux_Impl {
 /// Elf_Verneed: This is the structure of entries in the SHT_GNU_verneed
 /// section (.gnu.version_r). This structure is identical for ELF32 and ELF64.
 template <class ELFT>
-struct Elf_Verneed_Impl {
+struct LLVM_CLASS_ABI Elf_Verneed_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Half vn_version; // Version of this structure (e.g. VER_NEED_CURRENT)
   Elf_Half vn_cnt;     // Number of associated Vernaux entries
@@ -337,7 +337,7 @@ struct Elf_Verneed_Impl {
 /// Elf_Vernaux: This is the structure of auxiliary data in SHT_GNU_verneed
 /// section (.gnu.version_r). This structure is identical for ELF32 and ELF64.
 template <class ELFT>
-struct Elf_Vernaux_Impl {
+struct LLVM_CLASS_ABI Elf_Vernaux_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Word vna_hash;  // Hash of dependency name
   Elf_Half vna_flags; // Bitwise Flags (VER_FLAG_*)
@@ -351,7 +351,7 @@ struct Elf_Vernaux_Impl {
 template <class ELFT> struct Elf_Dyn_Base;
 
 template <endianness TargetEndianness>
-struct Elf_Dyn_Base<ELFType<TargetEndianness, false>> {
+struct LLVM_CLASS_ABI Elf_Dyn_Base<ELFType<TargetEndianness, false>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
   Elf_Sword d_tag;
   union {
@@ -361,7 +361,7 @@ struct Elf_Dyn_Base<ELFType<TargetEndianness, false>> {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Dyn_Base<ELFType<TargetEndianness, true>> {
+struct LLVM_CLASS_ABI Elf_Dyn_Base<ELFType<TargetEndianness, true>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
   Elf_Sxword d_tag;
   union {
@@ -372,7 +372,7 @@ struct Elf_Dyn_Base<ELFType<TargetEndianness, true>> {
 
 /// Elf_Dyn_Impl: This inherits from Elf_Dyn_Base, adding getters.
 template <class ELFT>
-struct Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> {
+struct LLVM_CLASS_ABI Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> {
   using Elf_Dyn_Base<ELFT>::d_tag;
   using Elf_Dyn_Base<ELFT>::d_un;
   using intX_t = std::conditional_t<ELFT::Is64Bits, int64_t, int32_t>;
@@ -383,7 +383,7 @@ struct Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
+struct LLVM_CLASS_ABI Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
   static const bool IsRela = false;
   Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
@@ -418,7 +418,7 @@ struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, true>
+struct LLVM_CLASS_ABI Elf_Rel_Impl<ELFType<TargetEndianness, false>, true>
     : public Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
   static const bool IsRela = true;
@@ -426,7 +426,7 @@ struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, true>
 };
 
 template <endianness TargetEndianness>
-struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
+struct LLVM_CLASS_ABI Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
   static const bool IsRela = false;
   Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
@@ -471,7 +471,7 @@ struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, true>
+struct LLVM_CLASS_ABI Elf_Rel_Impl<ELFType<TargetEndianness, true>, true>
     : public Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
   static const bool IsRela = true;
@@ -479,7 +479,7 @@ struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, true>
 };
 
 template <class ELFT>
-struct Elf_Ehdr_Impl {
+struct LLVM_CLASS_ABI Elf_Ehdr_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   unsigned char e_ident[ELF::EI_NIDENT]; // ELF Identification bytes
   Elf_Half e_type;                       // Type of file (see ET_*)
@@ -506,7 +506,7 @@ struct Elf_Ehdr_Impl {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Phdr_Impl<ELFType<TargetEndianness, false>> {
+struct LLVM_CLASS_ABI Elf_Phdr_Impl<ELFType<TargetEndianness, false>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
   Elf_Word p_type;   // Type of segment
   Elf_Off p_offset;  // FileOffset where segment is located, in bytes
@@ -519,7 +519,7 @@ struct Elf_Phdr_Impl<ELFType<TargetEndianness, false>> {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Phdr_Impl<ELFType<TargetEndianness, true>> {
+struct LLVM_CLASS_ABI Elf_Phdr_Impl<ELFType<TargetEndianness, true>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
   Elf_Word p_type;    // Type of segment
   Elf_Word p_flags;   // Segment flags
@@ -533,7 +533,7 @@ struct Elf_Phdr_Impl<ELFType<TargetEndianness, true>> {
 
 // ELFT needed for endianness.
 template <class ELFT>
-struct Elf_Hash_Impl {
+struct LLVM_CLASS_ABI Elf_Hash_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Word nbucket;
   Elf_Word nchain;
@@ -550,7 +550,7 @@ struct Elf_Hash_Impl {
 
 // .gnu.hash section
 template <class ELFT>
-struct Elf_GnuHash_Impl {
+struct LLVM_CLASS_ABI Elf_GnuHash_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Word nbuckets;
   Elf_Word symndx;
@@ -576,7 +576,7 @@ struct Elf_GnuHash_Impl {
 // Compressed section headers.
 // http://www.sco.com/developers/gabi/latest/ch4.sheader.html#compression_header
 template <endianness TargetEndianness>
-struct Elf_Chdr_Impl<ELFType<TargetEndianness, false>> {
+struct LLVM_CLASS_ABI Elf_Chdr_Impl<ELFType<TargetEndianness, false>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
   Elf_Word ch_type;
   Elf_Word ch_size;
@@ -584,7 +584,7 @@ struct Elf_Chdr_Impl<ELFType<TargetEndianness, false>> {
 };
 
 template <endianness TargetEndianness>
-struct Elf_Chdr_Impl<ELFType<TargetEndianness, true>> {
+struct LLVM_CLASS_ABI Elf_Chdr_Impl<ELFType<TargetEndianness, true>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
   Elf_Word ch_type;
   Elf_Word ch_reserved;
@@ -594,7 +594,7 @@ struct Elf_Chdr_Impl<ELFType<TargetEndianness, true>> {
 
 /// Note header
 template <class ELFT>
-struct Elf_Nhdr_Impl {
+struct LLVM_CLASS_ABI Elf_Nhdr_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Word n_namesz;
   Elf_Word n_descsz;
@@ -615,7 +615,7 @@ struct Elf_Nhdr_Impl {
 /// Wraps a note header, providing methods for accessing the name and
 /// descriptor safely.
 template <class ELFT>
-class Elf_Note_Impl {
+class LLVM_CLASS_ABI Elf_Note_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
 
   const Elf_Nhdr_Impl<ELFT> &Nhdr;
@@ -653,7 +653,7 @@ class Elf_Note_Impl {
   Elf_Word getType() const { return Nhdr.n_type; }
 };
 
-template <class ELFT> class Elf_Note_Iterator_Impl {
+template <class ELFT> class LLVM_CLASS_ABI Elf_Note_Iterator_Impl {
 public:
   using iterator_category = std::forward_iterator_tag;
   using value_type = Elf_Note_Impl<ELFT>;
@@ -734,7 +734,7 @@ template <class ELFT> class Elf_Note_Iterator_Impl {
   }
 };
 
-template <class ELFT> struct Elf_CGProfile_Impl {
+template <class ELFT> struct LLVM_CLASS_ABI Elf_CGProfile_Impl {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Xword cgp_weight;
 };
@@ -744,7 +744,7 @@ template <class ELFT>
 struct Elf_Mips_RegInfo;
 
 template <support::endianness TargetEndianness>
-struct Elf_Mips_RegInfo<ELFType<TargetEndianness, false>> {
+struct LLVM_CLASS_ABI Elf_Mips_RegInfo<ELFType<TargetEndianness, false>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
   Elf_Word ri_gprmask;     // bit-mask of used general registers
   Elf_Word ri_cprmask[4];  // bit-mask of used co-processor registers
@@ -752,7 +752,7 @@ struct Elf_Mips_RegInfo<ELFType<TargetEndianness, false>> {
 };
 
 template <support::endianness TargetEndianness>
-struct Elf_Mips_RegInfo<ELFType<TargetEndianness, true>> {
+struct LLVM_CLASS_ABI Elf_Mips_RegInfo<ELFType<TargetEndianness, true>> {
   LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
   Elf_Word ri_gprmask;     // bit-mask of used general registers
   Elf_Word ri_pad;         // unused padding field
@@ -761,7 +761,7 @@ struct Elf_Mips_RegInfo<ELFType<TargetEndianness, true>> {
 };
 
 // .MIPS.options section
-template <class ELFT> struct Elf_Mips_Options {
+template <class ELFT> struct LLVM_CLASS_ABI Elf_Mips_Options {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   uint8_t kind;     // Determines interpretation of variable part of descriptor
   uint8_t size;     // Byte size of descriptor, including this header
@@ -780,7 +780,7 @@ template <class ELFT> struct Elf_Mips_Options {
 };
 
 // .MIPS.abiflags section content
-template <class ELFT> struct Elf_Mips_ABIFlags {
+template <class ELFT> struct LLVM_CLASS_ABI Elf_Mips_ABIFlags {
   LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
   Elf_Half version;  // Version of the structure
   uint8_t isa_level; // ISA level: 1-5, 32, and 64
@@ -796,7 +796,7 @@ template <class ELFT> struct Elf_Mips_ABIFlags {
 };
 
 // Struct representing the BBAddrMap for one function.
-struct BBAddrMap {
+struct LLVM_CLASS_ABI BBAddrMap {
   uint64_t Addr; // Function address
   // Struct representing the BBAddrMap information for one basic block.
   struct BBEntry {
diff --git a/llvm/include/llvm/Object/Error.h b/llvm/include/llvm/Object/Error.h
index d76df0494b22f69..603a3dfaa7ecdf6 100644
--- a/llvm/include/llvm/Object/Error.h
+++ b/llvm/include/llvm/Object/Error.h
@@ -23,7 +23,7 @@ class Twine;
 
 namespace object {
 
-const std::error_category &object_category();
+LLVM_FUNC_ABI const std::error_category &object_category();
 
 enum class object_error {
   // Error code 0 is absent. Use std::error_code() instead.
@@ -50,7 +50,7 @@ inline std::error_code make_error_code(object_error e) {
 ///
 /// Currently inherits from ECError for easy interoperability with
 /// std::error_code, but this will be removed in the future.
-class BinaryError : public ErrorInfo<BinaryError, ECError> {
+class LLVM_CLASS_ABI BinaryError : public ErrorInfo<BinaryError, ECError> {
   void anchor() override;
 public:
   static char ID;
@@ -64,7 +64,7 @@ class BinaryError : public ErrorInfo<BinaryError, ECError> {
 ///
 /// For errors that don't require their own specific sub-error (most errors)
 /// this class can be used to describe the error via a string message.
-class GenericBinaryError : public ErrorInfo<GenericBinaryError, BinaryError> {
+class LLVM_CLASS_ABI GenericBinaryError : public ErrorInfo<GenericBinaryError, BinaryError> {
 public:
   static char ID;
   GenericBinaryError(const Twine &Msg);
@@ -80,7 +80,7 @@ class GenericBinaryError : public ErrorInfo<GenericBinaryError, BinaryError> {
 /// llvm::Error.  In the cases we want to loop through the children and ignore the
 /// non-objects in the archive this is used to test the error to see if an
 /// error() function needs to called on the llvm::Error.
-Error isNotObjectErrorInvalidFileType(llvm::Error Err);
+LLVM_FUNC_ABI Error isNotObjectErrorInvalidFileType(llvm::Error Err);
 
 inline Error createError(const Twine &Err) {
   return make_error<StringError>(Err, object_error::parse_failed);
@@ -92,7 +92,7 @@ inline Error createError(const Twine &Err) {
 
 namespace std {
 template <>
-struct is_error_code_enum<llvm::object::object_error> : std::true_type {};
+struct LLVM_CLASS_ABI is_error_code_enum<llvm::object::object_error> : std::true_type {};
 }
 
 #endif
diff --git a/llvm/include/llvm/Object/FaultMapParser.h b/llvm/include/llvm/Object/FaultMapParser.h
index 32f8075bb10b703..779d2c12f9d0be7 100644
--- a/llvm/include/llvm/Object/FaultMapParser.h
+++ b/llvm/include/llvm/Object/FaultMapParser.h
@@ -23,7 +23,7 @@ class raw_ostream;
 /// with the __llvm_faultmaps section generated by the version of LLVM that
 /// includes it.  No guarantees are made with respect to forward or backward
 /// compatibility.
-class FaultMapParser {
+class LLVM_CLASS_ABI FaultMapParser {
   using FaultMapVersionType = uint8_t;
   using Reserved0Type = uint8_t;
   using Reserved1Type = uint16_t;
@@ -155,13 +155,13 @@ class FaultMapParser {
   }
 };
 
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         const FaultMapParser::FunctionFaultInfoAccessor &);
 
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         const FaultMapParser::FunctionInfoAccessor &);
 
-raw_ostream &operator<<(raw_ostream &OS, const FaultMapParser &);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const FaultMapParser &);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Object/GOFF.h b/llvm/include/llvm/Object/GOFF.h
index ac1923b5a83fd31..8fa906c7e099e48 100644
--- a/llvm/include/llvm/Object/GOFF.h
+++ b/llvm/include/llvm/Object/GOFF.h
@@ -29,7 +29,7 @@ namespace object {
 ///
 /// Specifies protected member functions to manipulate the record. These should
 /// be called from deriving classes to change values as that record specifies.
-class Record {
+class LLVM_CLASS_ABI Record {
 public:
   static Error getContinuousData(const uint8_t *Record, uint16_t DataLength,
                                  int DataIndex, SmallString<256> &CompleteData);
@@ -75,7 +75,7 @@ class Record {
   }
 };
 
-class HDRRecord : public Record {
+class LLVM_CLASS_ABI HDRRecord : public Record {
 public:
   static Error getData(const uint8_t *Record, SmallString<256> &CompleteData);
 
@@ -86,7 +86,7 @@ class HDRRecord : public Record {
   }
 };
 
-class ESDRecord : public Record {
+class LLVM_CLASS_ABI ESDRecord : public Record {
 public:
   /// \brief Number of bytes for name; any more must go in continuation.
   /// This is the number of bytes that can fit into the data field of an ESD
@@ -268,7 +268,7 @@ class ESDRecord : public Record {
   }
 };
 
-class ENDRecord : public Record {
+class LLVM_CLASS_ABI ENDRecord : public Record {
 public:
   static Error getData(const uint8_t *Record, SmallString<256> &CompleteData);
 
diff --git a/llvm/include/llvm/Object/GOFFObjectFile.h b/llvm/include/llvm/Object/GOFFObjectFile.h
index f99eb82cc096e4a..62b1326f3361c28 100644
--- a/llvm/include/llvm/Object/GOFFObjectFile.h
+++ b/llvm/include/llvm/Object/GOFFObjectFile.h
@@ -30,7 +30,7 @@ namespace llvm {
 
 namespace object {
 
-class GOFFObjectFile : public ObjectFile {
+class LLVM_CLASS_ABI GOFFObjectFile : public ObjectFile {
   IndexedMap<const uint8_t *> EsdPtrs; // Indexed by EsdId.
 
   mutable DenseMap<uint32_t, std::pair<size_t, std::unique_ptr<char[]>>>
diff --git a/llvm/include/llvm/Object/IRObjectFile.h b/llvm/include/llvm/Object/IRObjectFile.h
index d0e339192df11fe..e3b3c49563a61ac 100644
--- a/llvm/include/llvm/Object/IRObjectFile.h
+++ b/llvm/include/llvm/Object/IRObjectFile.h
@@ -25,7 +25,7 @@ class Module;
 namespace object {
 class ObjectFile;
 
-class IRObjectFile : public SymbolicFile {
+class LLVM_CLASS_ABI IRObjectFile : public SymbolicFile {
   std::vector<std::unique_ptr<Module>> Mods;
   ModuleSymbolTable SymTab;
   IRObjectFile(MemoryBufferRef Object,
@@ -74,14 +74,14 @@ class IRObjectFile : public SymbolicFile {
 
 /// The contents of a bitcode file and its irsymtab. Any underlying data
 /// for the irsymtab are owned by Symtab and Strtab.
-struct IRSymtabFile {
+struct LLVM_CLASS_ABI IRSymtabFile {
   std::vector<BitcodeModule> Mods;
   SmallVector<char, 0> Symtab, Strtab;
   irsymtab::Reader TheReader;
 };
 
 /// Reads a bitcode file, creating its irsymtab if necessary.
-Expected<IRSymtabFile> readIRSymtab(MemoryBufferRef MBRef);
+LLVM_FUNC_ABI Expected<IRSymtabFile> readIRSymtab(MemoryBufferRef MBRef);
 
 }
 
diff --git a/llvm/include/llvm/Object/IRSymtab.h b/llvm/include/llvm/Object/IRSymtab.h
index 0b7a2fccb2d0d47..7c6ab959d681eb7 100644
--- a/llvm/include/llvm/Object/IRSymtab.h
+++ b/llvm/include/llvm/Object/IRSymtab.h
@@ -53,7 +53,7 @@ namespace storage {
 using Word = support::ulittle32_t;
 
 /// A reference to a string in the string table.
-struct Str {
+struct LLVM_CLASS_ABI Str {
   Word Offset, Size;
 
   StringRef get(StringRef Strtab) const {
@@ -62,7 +62,7 @@ struct Str {
 };
 
 /// A reference to a range of objects in the symbol table.
-template <typename T> struct Range {
+template <typename T> struct LLVM_CLASS_ABI Range {
   Word Offset, Size;
 
   ArrayRef<T> get(StringRef Symtab) const {
@@ -72,7 +72,7 @@ template <typename T> struct Range {
 
 /// Describes the range of a particular module's symbols within the symbol
 /// table.
-struct Module {
+struct LLVM_CLASS_ABI Module {
   Word Begin, End;
 
   /// The index of the first Uncommon for this Module.
@@ -80,7 +80,7 @@ struct Module {
 };
 
 /// This is equivalent to an IR comdat.
-struct Comdat {
+struct LLVM_CLASS_ABI Comdat {
   Str Name;
 
   // llvm::Comdat::SelectionKind
@@ -89,7 +89,7 @@ struct Comdat {
 
 /// Contains the information needed by linkers for symbol resolution, as well as
 /// by the LTO implementation itself.
-struct Symbol {
+struct LLVM_CLASS_ABI Symbol {
   /// The mangled symbol name.
   Str Name;
 
@@ -120,7 +120,7 @@ struct Symbol {
 
 /// This data structure contains rarely used symbol fields and is optionally
 /// referenced by a Symbol.
-struct Uncommon {
+struct LLVM_CLASS_ABI Uncommon {
   Word CommonSize, CommonAlign;
 
   /// COFF-specific: the name of the symbol that a weak external resolves to
@@ -132,7 +132,7 @@ struct Uncommon {
 };
 
 
-struct Header {
+struct LLVM_CLASS_ABI Header {
   /// Version number of the symtab format. This number should be incremented
   /// when the format changes, but it does not need to be incremented if a
   /// change to LLVM would cause it to create a different symbol table.
@@ -163,12 +163,12 @@ struct Header {
 
 /// Fills in Symtab and StrtabBuilder with a valid symbol and string table for
 /// Mods.
-Error build(ArrayRef<Module *> Mods, SmallVector<char, 0> &Symtab,
+LLVM_FUNC_ABI Error build(ArrayRef<Module *> Mods, SmallVector<char, 0> &Symtab,
             StringTableBuilder &StrtabBuilder, BumpPtrAllocator &Alloc);
 
 /// This represents a symbol that has been read from a storage::Symbol and
 /// possibly a storage::Uncommon.
-struct Symbol {
+struct LLVM_CLASS_ABI Symbol {
   // Copied from storage::Symbol.
   StringRef Name, IRName;
   int ComdatIndex;
@@ -234,7 +234,7 @@ struct Symbol {
 
 /// This class can be used to read a Symtab and Strtab produced by
 /// irsymtab::build.
-class Reader {
+class LLVM_CLASS_ABI Reader {
   StringRef Symtab, Strtab;
 
   ArrayRef<storage::Module> Modules;
@@ -367,13 +367,13 @@ inline Reader::symbol_range Reader::module_symbols(unsigned I) const {
 
 /// The contents of the irsymtab in a bitcode file. Any underlying data for the
 /// irsymtab are owned by Symtab and Strtab.
-struct FileContents {
+struct LLVM_CLASS_ABI FileContents {
   SmallVector<char, 0> Symtab, Strtab;
   Reader TheReader;
 };
 
 /// Reads the contents of a bitcode file, creating its irsymtab if necessary.
-Expected<FileContents> readBitcode(const BitcodeFileContents &BFC);
+LLVM_FUNC_ABI Expected<FileContents> readBitcode(const BitcodeFileContents &BFC);
 
 } // end namespace irsymtab
 } // end namespace llvm
diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h
index 8ea599fbcde2082..7fbd43b35d06398 100644
--- a/llvm/include/llvm/Object/MachO.h
+++ b/llvm/include/llvm/Object/MachO.h
@@ -42,7 +42,7 @@ namespace object {
 
 /// DiceRef - This is a value type class that represents a single
 /// data in code entry in the table in a Mach-O object file.
-class DiceRef {
+class LLVM_CLASS_ABI DiceRef {
   DataRefImpl DicePimpl;
   const ObjectFile *OwningObject = nullptr;
 
@@ -71,7 +71,7 @@ using dice_iterator = content_iterator<DiceRef>;
 ///      for (const llvm::object::ExportEntry &AnExport : Obj->exports(&Err)) {
 ///      }
 ///      if (Err) { report error ...
-class ExportEntry {
+class LLVM_CLASS_ABI ExportEntry {
 public:
   ExportEntry(Error *Err, const MachOObjectFile *O, ArrayRef<uint8_t> Trie);
 
@@ -130,7 +130,7 @@ using export_iterator = content_iterator<ExportEntry>;
 // can be checked and translated.  Only the SegIndex/SegOffset pairs from
 // checked entries are to be used with the segmentName(), sectionName() and
 // address() methods below.
-class BindRebaseSegInfo {
+class LLVM_CLASS_ABI BindRebaseSegInfo {
 public:
   BindRebaseSegInfo(const MachOObjectFile *Obj);
 
@@ -166,7 +166,7 @@ class BindRebaseSegInfo {
 ///    for (const llvm::object::MachORebaseEntry &Entry : Obj->rebaseTable(&Err)) {
 ///    }
 ///    if (Err) { report error ...
-class MachORebaseEntry {
+class LLVM_CLASS_ABI MachORebaseEntry {
 public:
   MachORebaseEntry(Error *Err, const MachOObjectFile *O,
                    ArrayRef<uint8_t> opcodes, bool is64Bit);
@@ -210,7 +210,7 @@ using rebase_iterator = content_iterator<MachORebaseEntry>;
 ///    for (const llvm::object::MachOBindEntry &Entry : Obj->bindTable(&Err)) {
 ///    }
 ///    if (Err) { report error ...
-class MachOBindEntry {
+class LLVM_CLASS_ABI MachOBindEntry {
 public:
   enum class Kind { Regular, Lazy, Weak };
 
@@ -273,7 +273,7 @@ using bind_iterator = content_iterator<MachOBindEntry>;
 ///   LibOrdinal == BIND_SPECIAL_DYLIB_WEAK_LOOKUP
 ///     This symbol may be coalesced with other libraries vending the same
 ///     symbol. E.g., C++'s "operator new". This is called a "weak bind."
-struct ChainedFixupTarget {
+struct LLVM_CLASS_ABI ChainedFixupTarget {
 public:
   ChainedFixupTarget(int LibOrdinal, uint32_t NameOffset, StringRef Symbol,
                      uint64_t Addend, bool WeakImport)
@@ -297,7 +297,7 @@ struct ChainedFixupTarget {
   bool WeakImport;
 };
 
-struct ChainedFixupsSegment {
+struct LLVM_CLASS_ABI ChainedFixupsSegment {
   ChainedFixupsSegment(uint8_t SegIdx, uint32_t Offset,
                        const MachO::dyld_chained_starts_in_segment &Header,
                        std::vector<uint16_t> &&PageStarts)
@@ -320,7 +320,7 @@ struct ChainedFixupsSegment {
 ///                            rebase, where rebases are mixed in with other
 ///                            bind opcodes.
 ///   MachOChainedFixupEntry - for pointer chains embedded in data pages.
-class MachOAbstractFixupEntry {
+class LLVM_CLASS_ABI MachOAbstractFixupEntry {
 public:
   MachOAbstractFixupEntry(Error *Err, const MachOObjectFile *O);
 
@@ -376,7 +376,7 @@ class MachOAbstractFixupEntry {
   uint64_t TextAddress;
 };
 
-class MachOChainedFixupEntry : public MachOAbstractFixupEntry {
+class LLVM_CLASS_ABI MachOChainedFixupEntry : public MachOAbstractFixupEntry {
 public:
   enum class FixupKind { Bind, Rebase };
 
@@ -404,7 +404,7 @@ class MachOChainedFixupEntry : public MachOAbstractFixupEntry {
 };
 using fixup_iterator = content_iterator<MachOChainedFixupEntry>;
 
-class MachOObjectFile : public ObjectFile {
+class LLVM_CLASS_ABI MachOObjectFile : public ObjectFile {
 public:
   struct LoadCommandInfo {
     const char *Ptr;      // Where in memory the load command is.
diff --git a/llvm/include/llvm/Object/MachOUniversal.h b/llvm/include/llvm/Object/MachOUniversal.h
index e94c7d56f953f6c..faba9c684d1cf7c 100644
--- a/llvm/include/llvm/Object/MachOUniversal.h
+++ b/llvm/include/llvm/Object/MachOUniversal.h
@@ -28,7 +28,7 @@ namespace object {
 class Archive;
 class IRObjectFile;
 
-class MachOUniversalBinary : public Binary {
+class LLVM_CLASS_ABI MachOUniversalBinary : public Binary {
   virtual void anchor();
 
   uint32_t Magic;
diff --git a/llvm/include/llvm/Object/MachOUniversalWriter.h b/llvm/include/llvm/Object/MachOUniversalWriter.h
index 2ead8ef6f4e2b9f..61334af9f62c14d 100644
--- a/llvm/include/llvm/Object/MachOUniversalWriter.h
+++ b/llvm/include/llvm/Object/MachOUniversalWriter.h
@@ -32,7 +32,7 @@ class Binary;
 class IRObjectFile;
 class MachOObjectFile;
 
-class Slice {
+class LLVM_CLASS_ABI Slice {
   const Binary *B;
   uint32_t CPUType;
   uint32_t CPUSubType;
@@ -98,9 +98,9 @@ class Slice {
   }
 };
 
-Error writeUniversalBinary(ArrayRef<Slice> Slices, StringRef OutputFileName);
+LLVM_FUNC_ABI Error writeUniversalBinary(ArrayRef<Slice> Slices, StringRef OutputFileName);
 
-Error writeUniversalBinaryToStream(ArrayRef<Slice> Slices, raw_ostream &Out);
+LLVM_FUNC_ABI Error writeUniversalBinaryToStream(ArrayRef<Slice> Slices, raw_ostream &Out);
 
 } // end namespace object
 
diff --git a/llvm/include/llvm/Object/Minidump.h b/llvm/include/llvm/Object/Minidump.h
index 71338087ff3540e..950f59c713eb96d 100644
--- a/llvm/include/llvm/Object/Minidump.h
+++ b/llvm/include/llvm/Object/Minidump.h
@@ -21,7 +21,7 @@ namespace llvm {
 namespace object {
 
 /// A class providing access to the contents of a minidump file.
-class MinidumpFile : public Binary {
+class LLVM_CLASS_ABI MinidumpFile : public Binary {
 public:
   /// Construct a new MinidumpFile object from the given memory buffer. Returns
   /// an error if this file cannot be identified as a minidump file, or if its
diff --git a/llvm/include/llvm/Object/ModuleSymbolTable.h b/llvm/include/llvm/Object/ModuleSymbolTable.h
index b84de8e02d11537..7c649a38fa0700f 100644
--- a/llvm/include/llvm/Object/ModuleSymbolTable.h
+++ b/llvm/include/llvm/Object/ModuleSymbolTable.h
@@ -31,7 +31,7 @@ namespace llvm {
 class GlobalValue;
 class Module;
 
-class ModuleSymbolTable {
+class LLVM_CLASS_ABI ModuleSymbolTable {
 public:
   using AsmSymbol = std::pair<std::string, uint32_t>;
   using Symbol = PointerUnion<GlobalValue *, AsmSymbol *>;
diff --git a/llvm/include/llvm/Object/ObjectFile.h b/llvm/include/llvm/Object/ObjectFile.h
index 01552f5d15f5601..725944d91b927d4 100644
--- a/llvm/include/llvm/Object/ObjectFile.h
+++ b/llvm/include/llvm/Object/ObjectFile.h
@@ -50,7 +50,7 @@ using section_iterator = content_iterator<SectionRef>;
 typedef std::function<bool(const SectionRef &)> SectionFilterPredicate;
 /// This is a value type class that represents a single relocation in the list
 /// of relocations in the object file.
-class RelocationRef {
+class LLVM_CLASS_ABI RelocationRef {
   DataRefImpl RelocationPimpl;
   const ObjectFile *OwningObject = nullptr;
 
@@ -79,7 +79,7 @@ using relocation_iterator = content_iterator<RelocationRef>;
 
 /// This is a value type class that represents a single section in the list of
 /// sections in the object file.
-class SectionRef {
+class LLVM_CLASS_ABI SectionRef {
   friend class SymbolRef;
 
   DataRefImpl SectionPimpl;
@@ -143,7 +143,7 @@ class SectionRef {
   const ObjectFile *getObject() const;
 };
 
-struct SectionedAddress {
+struct LLVM_CLASS_ABI SectionedAddress {
   const static uint64_t UndefSection = UINT64_MAX;
 
   uint64_t Address = 0;
@@ -162,11 +162,11 @@ inline bool operator==(const SectionedAddress &LHS,
          std::tie(RHS.SectionIndex, RHS.Address);
 }
 
-raw_ostream &operator<<(raw_ostream &OS, const SectionedAddress &Addr);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SectionedAddress &Addr);
 
 /// This is a value type class that represents a single symbol in the list of
 /// symbols in the object file.
-class SymbolRef : public BasicSymbolRef {
+class LLVM_CLASS_ABI SymbolRef : public BasicSymbolRef {
   friend class SectionRef;
 
 public:
@@ -206,7 +206,7 @@ class SymbolRef : public BasicSymbolRef {
   const ObjectFile *getObject() const;
 };
 
-class symbol_iterator : public basic_symbol_iterator {
+class LLVM_CLASS_ABI symbol_iterator : public basic_symbol_iterator {
 public:
   symbol_iterator(SymbolRef Sym) : basic_symbol_iterator(Sym) {}
   symbol_iterator(const basic_symbol_iterator &B)
@@ -227,7 +227,7 @@ class symbol_iterator : public basic_symbol_iterator {
 /// This class is the base class for all object file types. Concrete instances
 /// of this object are created by createObjectFile, which figures out which type
 /// to create.
-class ObjectFile : public SymbolicFile {
+class LLVM_CLASS_ABI ObjectFile : public SymbolicFile {
   virtual void anchor();
 
 protected:
@@ -403,7 +403,7 @@ class ObjectFile : public SymbolicFile {
 
 /// A filtered iterator for SectionRefs that skips sections based on some given
 /// predicate.
-class SectionFilterIterator {
+class LLVM_CLASS_ABI SectionFilterIterator {
 public:
   SectionFilterIterator(SectionFilterPredicate Pred,
                         const section_iterator &Begin,
@@ -434,7 +434,7 @@ class SectionFilterIterator {
 
 /// Creates an iterator range of SectionFilterIterators for a given Object and
 /// predicate.
-class SectionFilter {
+class LLVM_CLASS_ABI SectionFilter {
 public:
   SectionFilter(SectionFilterPredicate Pred, const ObjectFile &Obj)
       : Predicate(std::move(Pred)), Object(Obj) {}
@@ -642,7 +642,7 @@ inline const ObjectFile *RelocationRef::getObject() const {
 
 } // end namespace object
 
-template <> struct DenseMapInfo<object::SectionRef> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<object::SectionRef> {
   static bool isEqual(const object::SectionRef &A,
                       const object::SectionRef &B) {
     return A == B;
diff --git a/llvm/include/llvm/Object/OffloadBinary.h b/llvm/include/llvm/Object/OffloadBinary.h
index 0a6ebbc591b631e..124d69449d738ba 100644
--- a/llvm/include/llvm/Object/OffloadBinary.h
+++ b/llvm/include/llvm/Object/OffloadBinary.h
@@ -58,7 +58,7 @@ enum ImageKind : uint16_t {
 /// detect ABI stability and the size is used to find other offloading entries
 /// that may exist in the same section. All offsets are given as absolute byte
 /// offsets from the beginning of the file.
-class OffloadBinary : public Binary {
+class LLVM_CLASS_ABI OffloadBinary : public Binary {
 public:
   using string_iterator = MapVector<StringRef, StringRef>::const_iterator;
   using string_iterator_range = iterator_range<string_iterator>;
@@ -154,7 +154,7 @@ class OffloadBinary : public Binary {
 
 /// A class to contain the binary information for a single OffloadBinary that
 /// owns its memory.
-class OffloadFile : public OwningBinary<OffloadBinary> {
+class LLVM_CLASS_ABI OffloadFile : public OwningBinary<OffloadBinary> {
 public:
   using TargetID = std::pair<StringRef, StringRef>;
 
@@ -171,20 +171,20 @@ class OffloadFile : public OwningBinary<OffloadBinary> {
 
 /// Extracts embedded device offloading code from a memory \p Buffer to a list
 /// of \p Binaries.
-Error extractOffloadBinaries(MemoryBufferRef Buffer,
+LLVM_FUNC_ABI Error extractOffloadBinaries(MemoryBufferRef Buffer,
                              SmallVectorImpl<OffloadFile> &Binaries);
 
 /// Convert a string \p Name to an image kind.
-ImageKind getImageKind(StringRef Name);
+LLVM_FUNC_ABI ImageKind getImageKind(StringRef Name);
 
 /// Convert an image kind to its string representation.
-StringRef getImageKindName(ImageKind Name);
+LLVM_FUNC_ABI StringRef getImageKindName(ImageKind Name);
 
 /// Convert a string \p Name to an offload kind.
-OffloadKind getOffloadKind(StringRef Name);
+LLVM_FUNC_ABI OffloadKind getOffloadKind(StringRef Name);
 
 /// Convert an offload kind to its string representation.
-StringRef getOffloadKindName(OffloadKind Name);
+LLVM_FUNC_ABI StringRef getOffloadKindName(OffloadKind Name);
 
 } // namespace object
 
diff --git a/llvm/include/llvm/Object/RelocationResolver.h b/llvm/include/llvm/Object/RelocationResolver.h
index f5262137ae08010..cd569a827ae9e20 100644
--- a/llvm/include/llvm/Object/RelocationResolver.h
+++ b/llvm/include/llvm/Object/RelocationResolver.h
@@ -30,10 +30,10 @@ using RelocationResolver = uint64_t (*)(uint64_t Type, uint64_t Offset,
                                         uint64_t S, uint64_t LocData,
                                         int64_t Addend);
 
-std::pair<SupportsRelocation, RelocationResolver>
+LLVM_FUNC_ABI std::pair<SupportsRelocation, RelocationResolver>
 getRelocationResolver(const ObjectFile &Obj);
 
-uint64_t resolveRelocation(RelocationResolver Resolver, const RelocationRef &R,
+LLVM_FUNC_ABI uint64_t resolveRelocation(RelocationResolver Resolver, const RelocationRef &R,
                            uint64_t S, uint64_t LocData);
 
 } // end namespace object
diff --git a/llvm/include/llvm/Object/StackMapParser.h b/llvm/include/llvm/Object/StackMapParser.h
index 3560675af564c09..7e66218525a88eb 100644
--- a/llvm/include/llvm/Object/StackMapParser.h
+++ b/llvm/include/llvm/Object/StackMapParser.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 /// A parser for the latest stackmap format.  At the moment, latest=V3.
 template <support::endianness Endianness>
-class StackMapParser {
+class LLVM_CLASS_ABI StackMapParser {
 public:
   template <typename AccessorT>
   class AccessorIterator {
diff --git a/llvm/include/llvm/Object/SymbolSize.h b/llvm/include/llvm/Object/SymbolSize.h
index 6c372ddcfdeeca9..d6962e5bfa37608 100644
--- a/llvm/include/llvm/Object/SymbolSize.h
+++ b/llvm/include/llvm/Object/SymbolSize.h
@@ -16,16 +16,16 @@
 namespace llvm {
 namespace object {
 
-struct SymEntry {
+struct LLVM_CLASS_ABI SymEntry {
   symbol_iterator I;
   uint64_t Address;
   unsigned Number;
   unsigned SectionID;
 };
 
-int compareAddress(const SymEntry *A, const SymEntry *B);
+LLVM_FUNC_ABI int compareAddress(const SymEntry *A, const SymEntry *B);
 
-std::vector<std::pair<SymbolRef, uint64_t>>
+LLVM_FUNC_ABI std::vector<std::pair<SymbolRef, uint64_t>>
 computeSymbolSizes(const ObjectFile &O);
 
 }
diff --git a/llvm/include/llvm/Object/SymbolicFile.h b/llvm/include/llvm/Object/SymbolicFile.h
index 8877019b950bd65..408acd55dffdc3a 100644
--- a/llvm/include/llvm/Object/SymbolicFile.h
+++ b/llvm/include/llvm/Object/SymbolicFile.h
@@ -67,7 +67,7 @@ inline bool operator<(const DataRefImpl &a, const DataRefImpl &b) {
   return std::memcmp(&a, &b, sizeof(DataRefImpl)) < 0;
 }
 
-template <class content_type> class content_iterator {
+template <class content_type> class LLVM_CLASS_ABI content_iterator {
   content_type Current;
 
 public:
@@ -101,7 +101,7 @@ class SymbolicFile;
 
 /// This is a value type class that represents a single symbol in the list of
 /// symbols in the object file.
-class BasicSymbolRef {
+class LLVM_CLASS_ABI BasicSymbolRef {
   DataRefImpl SymbolPimpl;
   const SymbolicFile *OwningObject = nullptr;
 
@@ -143,7 +143,7 @@ class BasicSymbolRef {
 
 using basic_symbol_iterator = content_iterator<BasicSymbolRef>;
 
-class SymbolicFile : public Binary {
+class LLVM_CLASS_ABI SymbolicFile : public Binary {
 public:
   SymbolicFile(unsigned int Type, MemoryBufferRef Source);
   ~SymbolicFile() override;
diff --git a/llvm/include/llvm/Object/TapiFile.h b/llvm/include/llvm/Object/TapiFile.h
index 5a0cde7b26cbf17..134c2122f408a7f 100644
--- a/llvm/include/llvm/Object/TapiFile.h
+++ b/llvm/include/llvm/Object/TapiFile.h
@@ -34,7 +34,7 @@ class InterfaceFile;
 
 namespace object {
 
-class TapiFile : public SymbolicFile {
+class LLVM_CLASS_ABI TapiFile : public SymbolicFile {
 public:
   TapiFile(MemoryBufferRef Source, const MachO::InterfaceFile &Interface,
            MachO::Architecture Arch);
diff --git a/llvm/include/llvm/Object/TapiUniversal.h b/llvm/include/llvm/Object/TapiUniversal.h
index b5a3d5d748e741b..d94ecabb8ee0521 100644
--- a/llvm/include/llvm/Object/TapiUniversal.h
+++ b/llvm/include/llvm/Object/TapiUniversal.h
@@ -26,7 +26,7 @@ namespace object {
 
 class TapiFile;
 
-class TapiUniversal : public Binary {
+class LLVM_CLASS_ABI TapiUniversal : public Binary {
 public:
   class ObjectForArch {
     const TapiUniversal *Parent;
diff --git a/llvm/include/llvm/Object/Wasm.h b/llvm/include/llvm/Object/Wasm.h
index eb325bab7064528..9b39b48f08b7dcb 100644
--- a/llvm/include/llvm/Object/Wasm.h
+++ b/llvm/include/llvm/Object/Wasm.h
@@ -33,7 +33,7 @@
 namespace llvm {
 namespace object {
 
-class WasmSymbol {
+class LLVM_CLASS_ABI WasmSymbol {
 public:
   WasmSymbol(const wasm::WasmSymbolInfo &Info,
              const wasm::WasmGlobalType *GlobalType,
@@ -102,7 +102,7 @@ class WasmSymbol {
 #endif
 };
 
-struct WasmSection {
+struct LLVM_CLASS_ABI WasmSection {
   WasmSection() = default;
 
   uint32_t Type = 0;         // Section type (See below)
@@ -113,12 +113,12 @@ struct WasmSection {
   std::vector<wasm::WasmRelocation> Relocations; // Relocations for this section
 };
 
-struct WasmSegment {
+struct LLVM_CLASS_ABI WasmSegment {
   uint32_t SectionOffset;
   wasm::WasmDataSegment Data;
 };
 
-class WasmObjectFile : public ObjectFile {
+class LLVM_CLASS_ABI WasmObjectFile : public ObjectFile {
 
 public:
   WasmObjectFile(MemoryBufferRef Object, Error &Err);
@@ -303,7 +303,7 @@ class WasmObjectFile : public ObjectFile {
   uint32_t TableSection = 0;
 };
 
-class WasmSectionOrderChecker {
+class LLVM_CLASS_ABI WasmSectionOrderChecker {
 public:
   // We define orders for all core wasm sections and known custom sections.
   enum : int {
diff --git a/llvm/include/llvm/Object/WindowsMachineFlag.h b/llvm/include/llvm/Object/WindowsMachineFlag.h
index 443c73381c559b1..05e02e675eb72bd 100644
--- a/llvm/include/llvm/Object/WindowsMachineFlag.h
+++ b/llvm/include/llvm/Object/WindowsMachineFlag.h
@@ -24,11 +24,11 @@ enum MachineTypes : unsigned;
 
 // Returns a user-readable string for ARMNT, ARM64, AMD64, I386.
 // Other MachineTypes values must not be passed in.
-StringRef machineToStr(COFF::MachineTypes MT);
+LLVM_FUNC_ABI StringRef machineToStr(COFF::MachineTypes MT);
 
 // Maps /machine: arguments to a MachineTypes value.
 // Only returns ARMNT, ARM64, AMD64, I386, or IMAGE_FILE_MACHINE_UNKNOWN.
-COFF::MachineTypes getMachineType(StringRef S);
+LLVM_FUNC_ABI COFF::MachineTypes getMachineType(StringRef S);
 
 }
 
diff --git a/llvm/include/llvm/Object/WindowsResource.h b/llvm/include/llvm/Object/WindowsResource.h
index c229260bc857a57..afb886899cac068 100644
--- a/llvm/include/llvm/Object/WindowsResource.h
+++ b/llvm/include/llvm/Object/WindowsResource.h
@@ -58,14 +58,14 @@ const uint32_t WIN_RES_HEADER_ALIGNMENT = 4;
 const uint32_t WIN_RES_DATA_ALIGNMENT = 4;
 const uint16_t WIN_RES_PURE_MOVEABLE = 0x0030;
 
-struct WinResHeaderPrefix {
+struct LLVM_CLASS_ABI WinResHeaderPrefix {
   support::ulittle32_t DataSize;
   support::ulittle32_t HeaderSize;
 };
 
 // Type and Name may each either be an integer ID or a string.  This struct is
 // only used in the case where they are both IDs.
-struct WinResIDs {
+struct LLVM_CLASS_ABI WinResIDs {
   uint16_t TypeFlag;
   support::ulittle16_t TypeID;
   uint16_t NameFlag;
@@ -82,7 +82,7 @@ struct WinResIDs {
   }
 };
 
-struct WinResHeaderSuffix {
+struct LLVM_CLASS_ABI WinResHeaderSuffix {
   support::ulittle32_t DataVersion;
   support::ulittle16_t MemoryFlags;
   support::ulittle16_t Language;
@@ -90,13 +90,13 @@ struct WinResHeaderSuffix {
   support::ulittle32_t Characteristics;
 };
 
-class EmptyResError : public GenericBinaryError {
+class LLVM_CLASS_ABI EmptyResError : public GenericBinaryError {
 public:
   EmptyResError(Twine Msg, object_error ECOverride)
       : GenericBinaryError(Msg, ECOverride) {}
 };
 
-class ResourceEntryRef {
+class LLVM_CLASS_ABI ResourceEntryRef {
 public:
   Error moveNext(bool &End);
   bool checkTypeString() const { return IsStringType; }
@@ -134,7 +134,7 @@ class ResourceEntryRef {
   ArrayRef<uint8_t> Data;
 };
 
-class WindowsResource : public Binary {
+class LLVM_CLASS_ABI WindowsResource : public Binary {
 public:
   Expected<ResourceEntryRef> getHeadEntry();
 
@@ -151,7 +151,7 @@ class WindowsResource : public Binary {
   BinaryByteStream BBS;
 };
 
-class WindowsResourceParser {
+class LLVM_CLASS_ABI WindowsResourceParser {
 public:
   class TreeNode;
   WindowsResourceParser(bool MinGW = false);
@@ -258,12 +258,12 @@ class WindowsResourceParser {
   bool MinGW;
 };
 
-Expected<std::unique_ptr<MemoryBuffer>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<MemoryBuffer>>
 writeWindowsResourceCOFF(llvm::COFF::MachineTypes MachineType,
                          const WindowsResourceParser &Parser,
                          uint32_t TimeDateStamp);
 
-void printResourceTypeName(uint16_t TypeID, raw_ostream &OS);
+LLVM_FUNC_ABI void printResourceTypeName(uint16_t TypeID, raw_ostream &OS);
 } // namespace object
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Object/XCOFFObjectFile.h b/llvm/include/llvm/Object/XCOFFObjectFile.h
index db72da15faab48c..2018ac3a88dbecd 100644
--- a/llvm/include/llvm/Object/XCOFFObjectFile.h
+++ b/llvm/include/llvm/Object/XCOFFObjectFile.h
@@ -24,7 +24,7 @@
 namespace llvm {
 namespace object {
 
-struct XCOFFFileHeader32 {
+struct LLVM_CLASS_ABI XCOFFFileHeader32 {
   support::ubig16_t Magic;
   support::ubig16_t NumberOfSections;
 
@@ -38,7 +38,7 @@ struct XCOFFFileHeader32 {
   support::ubig16_t Flags;
 };
 
-struct XCOFFFileHeader64 {
+struct LLVM_CLASS_ABI XCOFFFileHeader64 {
   support::ubig16_t Magic;
   support::ubig16_t NumberOfSections;
 
@@ -52,7 +52,7 @@ struct XCOFFFileHeader64 {
   support::ubig32_t NumberOfSymTableEntries;
 };
 
-template <typename T> struct XCOFFAuxiliaryHeader {
+template <typename T> struct LLVM_CLASS_ABI XCOFFAuxiliaryHeader {
   static constexpr uint8_t AuxiHeaderFlagMask = 0xF0;
   static constexpr uint8_t AuxiHeaderTDataAlignmentMask = 0x0F;
 
@@ -70,7 +70,7 @@ template <typename T> struct XCOFFAuxiliaryHeader {
   uint16_t getVersion() const { return static_cast<const T *>(this)->Version; }
 };
 
-struct XCOFFAuxiliaryHeader32 : XCOFFAuxiliaryHeader<XCOFFAuxiliaryHeader32> {
+struct LLVM_CLASS_ABI XCOFFAuxiliaryHeader32 : XCOFFAuxiliaryHeader<XCOFFAuxiliaryHeader32> {
   support::ubig16_t
       AuxMagic; ///< If the value of the o_vstamp field is greater than 1, the
                 ///< o_mflags field is reserved for future use and it should
@@ -117,7 +117,7 @@ struct XCOFFAuxiliaryHeader32 : XCOFFAuxiliaryHeader<XCOFFAuxiliaryHeader32> {
   support::ubig16_t SecNumOfTBSS;
 };
 
-struct XCOFFAuxiliaryHeader64 : XCOFFAuxiliaryHeader<XCOFFAuxiliaryHeader64> {
+struct LLVM_CLASS_ABI XCOFFAuxiliaryHeader64 : XCOFFAuxiliaryHeader<XCOFFAuxiliaryHeader64> {
   support::ubig16_t AuxMagic;
   support::ubig16_t Version;
   support::ubig32_t ReservedForDebugger;
@@ -150,7 +150,7 @@ struct XCOFFAuxiliaryHeader64 : XCOFFAuxiliaryHeader<XCOFFAuxiliaryHeader64> {
   support::ubig16_t XCOFF64Flag;
 };
 
-template <typename T> struct XCOFFSectionHeader {
+template <typename T> struct LLVM_CLASS_ABI XCOFFSectionHeader {
   // Least significant 3 bits are reserved.
   static constexpr unsigned SectionFlagsReservedMask = 0x7;
 
@@ -169,7 +169,7 @@ struct XCOFFSectionHeader64;
 extern template struct XCOFFSectionHeader<XCOFFSectionHeader32>;
 extern template struct XCOFFSectionHeader<XCOFFSectionHeader64>;
 
-struct XCOFFSectionHeader32 : XCOFFSectionHeader<XCOFFSectionHeader32> {
+struct LLVM_CLASS_ABI XCOFFSectionHeader32 : XCOFFSectionHeader<XCOFFSectionHeader32> {
   char Name[XCOFF::NameSize];
   support::ubig32_t PhysicalAddress;
   support::ubig32_t VirtualAddress;
@@ -182,7 +182,7 @@ struct XCOFFSectionHeader32 : XCOFFSectionHeader<XCOFFSectionHeader32> {
   support::big32_t Flags;
 };
 
-struct XCOFFSectionHeader64 : XCOFFSectionHeader<XCOFFSectionHeader64> {
+struct LLVM_CLASS_ABI XCOFFSectionHeader64 : XCOFFSectionHeader<XCOFFSectionHeader64> {
   char Name[XCOFF::NameSize];
   support::ubig64_t PhysicalAddress;
   support::ubig64_t VirtualAddress;
@@ -198,7 +198,7 @@ struct XCOFFSectionHeader64 : XCOFFSectionHeader<XCOFFSectionHeader64> {
 
 struct LoaderSectionHeader32;
 struct LoaderSectionHeader64;
-struct LoaderSectionSymbolEntry32 {
+struct LLVM_CLASS_ABI LoaderSectionSymbolEntry32 {
   struct NameOffsetInStrTbl {
     support::big32_t IsNameInStrTbl; // Zero indicates name in string table.
     support::ubig32_t Offset;
@@ -216,7 +216,7 @@ struct LoaderSectionSymbolEntry32 {
   getSymbolName(const LoaderSectionHeader32 *LoaderSecHeader) const;
 };
 
-struct LoaderSectionSymbolEntry64 {
+struct LLVM_CLASS_ABI LoaderSectionSymbolEntry64 {
   support::ubig64_t Value; // The virtual address of the symbol.
   support::ubig32_t Offset;
   support::big16_t SectionNumber;
@@ -229,21 +229,21 @@ struct LoaderSectionSymbolEntry64 {
   getSymbolName(const LoaderSectionHeader64 *LoaderSecHeader) const;
 };
 
-struct LoaderSectionRelocationEntry32 {
+struct LLVM_CLASS_ABI LoaderSectionRelocationEntry32 {
   support::ubig32_t VirtualAddr;
   support::big32_t SymbolIndex;
   support::ubig16_t Type;
   support::big16_t SectionNum;
 };
 
-struct LoaderSectionRelocationEntry64 {
+struct LLVM_CLASS_ABI LoaderSectionRelocationEntry64 {
   support::ubig64_t VirtualAddr;
   support::ubig16_t Type;
   support::big16_t SectionNum;
   support::big32_t SymbolIndex;
 };
 
-struct LoaderSectionHeader32 {
+struct LLVM_CLASS_ABI LoaderSectionHeader32 {
   support::ubig32_t Version;
   support::ubig32_t NumberOfSymTabEnt;
   support::ubig32_t NumberOfRelTabEnt;
@@ -266,7 +266,7 @@ struct LoaderSectionHeader32 {
   }
 };
 
-struct LoaderSectionHeader64 {
+struct LLVM_CLASS_ABI LoaderSectionHeader64 {
   support::ubig32_t Version;
   support::ubig32_t NumberOfSymTabEnt;
   support::ubig32_t NumberOfRelTabEnt;
@@ -282,7 +282,7 @@ struct LoaderSectionHeader64 {
   uint64_t getOffsetToRelEnt() const { return OffsetToRelEnt; }
 };
 
-template <typename AddressType> struct ExceptionSectionEntry {
+template <typename AddressType> struct LLVM_CLASS_ABI ExceptionSectionEntry {
   union {
     support::ubig32_t SymbolIdx;
     AddressType TrapInstAddr;
@@ -311,12 +311,12 @@ typedef ExceptionSectionEntry<support::ubig64_t> ExceptionSectionEntry64;
 extern template struct ExceptionSectionEntry<support::ubig32_t>;
 extern template struct ExceptionSectionEntry<support::ubig64_t>;
 
-struct XCOFFStringTable {
+struct LLVM_CLASS_ABI XCOFFStringTable {
   uint32_t Size;
   const char *Data;
 };
 
-struct XCOFFCsectAuxEnt32 {
+struct LLVM_CLASS_ABI XCOFFCsectAuxEnt32 {
   support::ubig32_t SectionOrLength;
   support::ubig32_t ParameterHashIndex;
   support::ubig16_t TypeChkSectNum;
@@ -326,7 +326,7 @@ struct XCOFFCsectAuxEnt32 {
   support::ubig16_t StabSectNum;
 };
 
-struct XCOFFCsectAuxEnt64 {
+struct LLVM_CLASS_ABI XCOFFCsectAuxEnt64 {
   support::ubig32_t SectionOrLengthLowByte;
   support::ubig32_t ParameterHashIndex;
   support::ubig16_t TypeChkSectNum;
@@ -337,7 +337,7 @@ struct XCOFFCsectAuxEnt64 {
   XCOFF::SymbolAuxType AuxType;
 };
 
-class XCOFFCsectAuxRef {
+class LLVM_CLASS_ABI XCOFFCsectAuxRef {
 public:
   static constexpr uint8_t SymbolTypeMask = 0x07;
   static constexpr uint8_t SymbolAlignmentMask = 0xF8;
@@ -420,7 +420,7 @@ class XCOFFCsectAuxRef {
   const XCOFFCsectAuxEnt64 *Entry64 = nullptr;
 };
 
-struct XCOFFFileAuxEnt {
+struct LLVM_CLASS_ABI XCOFFFileAuxEnt {
   typedef struct {
     support::big32_t Magic; // Zero indicates name in string table.
     support::ubig32_t Offset;
@@ -435,14 +435,14 @@ struct XCOFFFileAuxEnt {
   XCOFF::SymbolAuxType AuxType; // 64-bit XCOFF file only.
 };
 
-struct XCOFFSectAuxEntForStat {
+struct LLVM_CLASS_ABI XCOFFSectAuxEntForStat {
   support::ubig32_t SectionLength;
   support::ubig16_t NumberOfRelocEnt;
   support::ubig16_t NumberOfLineNum;
   uint8_t Pad[10];
 }; // 32-bit XCOFF file only.
 
-struct XCOFFFunctionAuxEnt32 {
+struct LLVM_CLASS_ABI XCOFFFunctionAuxEnt32 {
   support::ubig32_t OffsetToExceptionTbl;
   support::ubig32_t SizeOfFunction;
   support::ubig32_t PtrToLineNum;
@@ -450,7 +450,7 @@ struct XCOFFFunctionAuxEnt32 {
   uint8_t Pad[2];
 };
 
-struct XCOFFFunctionAuxEnt64 {
+struct LLVM_CLASS_ABI XCOFFFunctionAuxEnt64 {
   support::ubig64_t PtrToLineNum;
   support::ubig32_t SizeOfFunction;
   support::big32_t SymIdxOfNextBeyond;
@@ -458,7 +458,7 @@ struct XCOFFFunctionAuxEnt64 {
   XCOFF::SymbolAuxType AuxType; // Contains _AUX_FCN; Type of auxiliary entry
 };
 
-struct XCOFFExceptionAuxEnt {
+struct LLVM_CLASS_ABI XCOFFExceptionAuxEnt {
   support::ubig64_t OffsetToExceptionTbl;
   support::ubig32_t SizeOfFunction;
   support::big32_t SymIdxOfNextBeyond;
@@ -466,34 +466,34 @@ struct XCOFFExceptionAuxEnt {
   XCOFF::SymbolAuxType AuxType; // Contains _AUX_EXCEPT; Type of auxiliary entry
 };
 
-struct XCOFFBlockAuxEnt32 {
+struct LLVM_CLASS_ABI XCOFFBlockAuxEnt32 {
   uint8_t ReservedZeros1[2];
   support::ubig16_t LineNumHi;
   support::ubig16_t LineNumLo;
   uint8_t ReservedZeros2[12];
 };
 
-struct XCOFFBlockAuxEnt64 {
+struct LLVM_CLASS_ABI XCOFFBlockAuxEnt64 {
   support::ubig32_t LineNum;
   uint8_t Pad[13];
   XCOFF::SymbolAuxType AuxType; // Contains _AUX_SYM; Type of auxiliary entry
 };
 
-struct XCOFFSectAuxEntForDWARF32 {
+struct LLVM_CLASS_ABI XCOFFSectAuxEntForDWARF32 {
   support::ubig32_t LengthOfSectionPortion;
   uint8_t Pad1[4];
   support::ubig32_t NumberOfRelocEnt;
   uint8_t Pad2[6];
 };
 
-struct XCOFFSectAuxEntForDWARF64 {
+struct LLVM_CLASS_ABI XCOFFSectAuxEntForDWARF64 {
   support::ubig64_t LengthOfSectionPortion;
   support::ubig64_t NumberOfRelocEnt;
   uint8_t Pad;
   XCOFF::SymbolAuxType AuxType; // Contains _AUX_SECT; Type of Auxillary entry
 };
 
-template <typename AddressType> struct XCOFFRelocation {
+template <typename AddressType> struct LLVM_CLASS_ABI XCOFFRelocation {
 public:
   AddressType VirtualAddress;
   support::ubig32_t SymbolIndex;
@@ -514,12 +514,12 @@ template <typename AddressType> struct XCOFFRelocation {
 extern template struct XCOFFRelocation<llvm::support::ubig32_t>;
 extern template struct XCOFFRelocation<llvm::support::ubig64_t>;
 
-struct XCOFFRelocation32 : XCOFFRelocation<llvm::support::ubig32_t> {};
-struct XCOFFRelocation64 : XCOFFRelocation<llvm::support::ubig64_t> {};
+struct LLVM_CLASS_ABI XCOFFRelocation32 : XCOFFRelocation<llvm::support::ubig32_t> {};
+struct LLVM_CLASS_ABI XCOFFRelocation64 : XCOFFRelocation<llvm::support::ubig64_t> {};
 
 class XCOFFSymbolRef;
 
-class XCOFFObjectFile : public ObjectFile {
+class LLVM_CLASS_ABI XCOFFObjectFile : public ObjectFile {
 private:
   const void *FileHeader = nullptr;
   const void *AuxiliaryHeader = nullptr;
@@ -718,12 +718,12 @@ class XCOFFObjectFile : public ObjectFile {
   static bool classof(const Binary *B) { return B->isXCOFF(); }
 }; // XCOFFObjectFile
 
-typedef struct {
+typedef struct LLVM_CLASS_ABI {
   uint8_t LanguageId;
   uint8_t CpuTypeId;
 } CFileLanguageIdAndTypeIdType;
 
-struct XCOFFSymbolEntry32 {
+struct LLVM_CLASS_ABI XCOFFSymbolEntry32 {
   typedef struct {
     support::big32_t Magic; // Zero indicates name in string table.
     support::ubig32_t Offset;
@@ -746,7 +746,7 @@ struct XCOFFSymbolEntry32 {
   uint8_t NumberOfAuxEntries;
 };
 
-struct XCOFFSymbolEntry64 {
+struct LLVM_CLASS_ABI XCOFFSymbolEntry64 {
   support::ubig64_t Value; // Symbol value; storage class-dependent.
   support::ubig32_t Offset;
   support::big16_t SectionNumber;
@@ -760,7 +760,7 @@ struct XCOFFSymbolEntry64 {
   uint8_t NumberOfAuxEntries;
 };
 
-class XCOFFSymbolRef {
+class LLVM_CLASS_ABI XCOFFSymbolRef {
 public:
   enum { NAME_IN_STR_TBL_MAGIC = 0x0 };
 
@@ -826,7 +826,7 @@ class XCOFFSymbolRef {
   const XCOFFSymbolEntry64 *Entry64 = nullptr;
 };
 
-class TBVectorExt {
+class LLVM_CLASS_ABI TBVectorExt {
   uint16_t Data;
   SmallString<32> VecParmsInfo;
 
@@ -845,7 +845,7 @@ class TBVectorExt {
 /// This class provides methods to extract traceback table data from a buffer.
 /// The various accessors may reference the buffer provided via the constructor.
 
-class XCOFFTracebackTable {
+class LLVM_CLASS_ABI XCOFFTracebackTable {
   const uint8_t *const TBPtr;
   bool Is64BitObj;
   std::optional<SmallString<32>> ParmsType;
@@ -937,7 +937,7 @@ class XCOFFTracebackTable {
   const std::optional<uint64_t> &getEhInfoDisp() const { return EhInfoDisp; }
 };
 
-bool doesXCOFFTracebackTableBegin(ArrayRef<uint8_t> Bytes);
+LLVM_FUNC_ABI bool doesXCOFFTracebackTableBegin(ArrayRef<uint8_t> Bytes);
 } // namespace object
 } // namespace llvm
 
diff --git a/llvm/include/llvm/ObjectYAML/ArchiveYAML.h b/llvm/include/llvm/ObjectYAML/ArchiveYAML.h
index 542e32be0fb2311..2bc9dc1fda79144 100644
--- a/llvm/include/llvm/ObjectYAML/ArchiveYAML.h
+++ b/llvm/include/llvm/ObjectYAML/ArchiveYAML.h
@@ -23,7 +23,7 @@
 namespace llvm {
 namespace ArchYAML {
 
-struct Archive {
+struct LLVM_CLASS_ABI Archive {
   struct Child {
     struct Field {
       Field() = default;
@@ -63,12 +63,12 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ArchYAML::Archive::Child)
 namespace llvm {
 namespace yaml {
 
-template <> struct MappingTraits<ArchYAML::Archive> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ArchYAML::Archive> {
   static void mapping(IO &IO, ArchYAML::Archive &A);
   static std::string validate(IO &, ArchYAML::Archive &A);
 };
 
-template <> struct MappingTraits<ArchYAML::Archive::Child> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ArchYAML::Archive::Child> {
   static void mapping(IO &IO, ArchYAML::Archive::Child &C);
   static std::string validate(IO &, ArchYAML::Archive::Child &C);
 };
diff --git a/llvm/include/llvm/ObjectYAML/COFFYAML.h b/llvm/include/llvm/ObjectYAML/COFFYAML.h
index 811fe2b5930f862..a02a54fa1767684 100644
--- a/llvm/include/llvm/ObjectYAML/COFFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/COFFYAML.h
@@ -55,7 +55,7 @@ LLVM_YAML_STRONG_TYPEDEF(uint8_t, COMDATType)
 LLVM_YAML_STRONG_TYPEDEF(uint32_t, WeakExternalCharacteristics)
 LLVM_YAML_STRONG_TYPEDEF(uint8_t, AuxSymbolType)
 
-struct Relocation {
+struct LLVM_CLASS_ABI Relocation {
   uint32_t VirtualAddress;
   uint16_t Type;
 
@@ -67,7 +67,7 @@ struct Relocation {
   std::optional<uint32_t> SymbolTableIndex;
 };
 
-struct SectionDataEntry {
+struct LLVM_CLASS_ABI SectionDataEntry {
   std::optional<uint32_t> UInt32;
   yaml::BinaryRef Binary;
 
@@ -75,7 +75,7 @@ struct SectionDataEntry {
   void writeAsBinary(raw_ostream &OS) const;
 };
 
-struct Section {
+struct LLVM_CLASS_ABI Section {
   COFF::section Header;
   unsigned Alignment = 0;
   yaml::BinaryRef SectionData;
@@ -90,7 +90,7 @@ struct Section {
   Section();
 };
 
-struct Symbol {
+struct LLVM_CLASS_ABI Symbol {
   COFF::symbol Header;
   COFF::SymbolBaseType SimpleType = COFF::IMAGE_SYM_TYPE_NULL;
   COFF::SymbolComplexType ComplexType = COFF::IMAGE_SYM_DTYPE_NULL;
@@ -105,13 +105,13 @@ struct Symbol {
   Symbol();
 };
 
-struct PEHeader {
+struct LLVM_CLASS_ABI PEHeader {
   COFF::PE32Header Header;
   std::optional<COFF::DataDirectory>
       DataDirectories[COFF::NUM_DATA_DIRECTORIES];
 };
 
-struct Object {
+struct LLVM_CLASS_ABI Object {
   std::optional<PEHeader> OptionalHeader;
   COFF::header Header;
   std::vector<Section> Sections;
@@ -133,136 +133,136 @@ namespace llvm {
 namespace yaml {
 
 template <>
-struct ScalarEnumerationTraits<COFFYAML::WeakExternalCharacteristics> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFFYAML::WeakExternalCharacteristics> {
   static void enumeration(IO &IO, COFFYAML::WeakExternalCharacteristics &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFFYAML::AuxSymbolType> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFFYAML::AuxSymbolType> {
   static void enumeration(IO &IO, COFFYAML::AuxSymbolType &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFFYAML::COMDATType> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFFYAML::COMDATType> {
   static void enumeration(IO &IO, COFFYAML::COMDATType &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::MachineTypes> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::MachineTypes> {
   static void enumeration(IO &IO, COFF::MachineTypes &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::SymbolBaseType> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::SymbolBaseType> {
   static void enumeration(IO &IO, COFF::SymbolBaseType &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::SymbolStorageClass> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::SymbolStorageClass> {
   static void enumeration(IO &IO, COFF::SymbolStorageClass &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::SymbolComplexType> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::SymbolComplexType> {
   static void enumeration(IO &IO, COFF::SymbolComplexType &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::RelocationTypeI386> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::RelocationTypeI386> {
   static void enumeration(IO &IO, COFF::RelocationTypeI386 &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::RelocationTypeAMD64> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::RelocationTypeAMD64> {
   static void enumeration(IO &IO, COFF::RelocationTypeAMD64 &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::RelocationTypesARM> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::RelocationTypesARM> {
   static void enumeration(IO &IO, COFF::RelocationTypesARM &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::RelocationTypesARM64> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::RelocationTypesARM64> {
   static void enumeration(IO &IO, COFF::RelocationTypesARM64 &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<COFF::WindowsSubsystem> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<COFF::WindowsSubsystem> {
   static void enumeration(IO &IO, COFF::WindowsSubsystem &Value);
 };
 
 template <>
-struct ScalarBitSetTraits<COFF::Characteristics> {
+struct LLVM_CLASS_ABI ScalarBitSetTraits<COFF::Characteristics> {
   static void bitset(IO &IO, COFF::Characteristics &Value);
 };
 
 template <>
-struct ScalarBitSetTraits<COFF::SectionCharacteristics> {
+struct LLVM_CLASS_ABI ScalarBitSetTraits<COFF::SectionCharacteristics> {
   static void bitset(IO &IO, COFF::SectionCharacteristics &Value);
 };
 
 template <>
-struct ScalarBitSetTraits<COFF::DLLCharacteristics> {
+struct LLVM_CLASS_ABI ScalarBitSetTraits<COFF::DLLCharacteristics> {
   static void bitset(IO &IO, COFF::DLLCharacteristics &Value);
 };
 
 template <>
-struct MappingTraits<COFFYAML::Relocation> {
+struct LLVM_CLASS_ABI MappingTraits<COFFYAML::Relocation> {
   static void mapping(IO &IO, COFFYAML::Relocation &Rel);
 };
 
 template <>
-struct MappingTraits<COFFYAML::PEHeader> {
+struct LLVM_CLASS_ABI MappingTraits<COFFYAML::PEHeader> {
   static void mapping(IO &IO, COFFYAML::PEHeader &PH);
 };
 
 template <>
-struct MappingTraits<COFF::DataDirectory> {
+struct LLVM_CLASS_ABI MappingTraits<COFF::DataDirectory> {
   static void mapping(IO &IO, COFF::DataDirectory &DD);
 };
 
 template <>
-struct MappingTraits<COFF::header> {
+struct LLVM_CLASS_ABI MappingTraits<COFF::header> {
   static void mapping(IO &IO, COFF::header &H);
 };
 
-template <> struct MappingTraits<COFF::AuxiliaryFunctionDefinition> {
+template <> struct LLVM_CLASS_ABI MappingTraits<COFF::AuxiliaryFunctionDefinition> {
   static void mapping(IO &IO, COFF::AuxiliaryFunctionDefinition &AFD);
 };
 
-template <> struct MappingTraits<COFF::AuxiliarybfAndefSymbol> {
+template <> struct LLVM_CLASS_ABI MappingTraits<COFF::AuxiliarybfAndefSymbol> {
   static void mapping(IO &IO, COFF::AuxiliarybfAndefSymbol &AAS);
 };
 
-template <> struct MappingTraits<COFF::AuxiliaryWeakExternal> {
+template <> struct LLVM_CLASS_ABI MappingTraits<COFF::AuxiliaryWeakExternal> {
   static void mapping(IO &IO, COFF::AuxiliaryWeakExternal &AWE);
 };
 
-template <> struct MappingTraits<COFF::AuxiliarySectionDefinition> {
+template <> struct LLVM_CLASS_ABI MappingTraits<COFF::AuxiliarySectionDefinition> {
   static void mapping(IO &IO, COFF::AuxiliarySectionDefinition &ASD);
 };
 
-template <> struct MappingTraits<COFF::AuxiliaryCLRToken> {
+template <> struct LLVM_CLASS_ABI MappingTraits<COFF::AuxiliaryCLRToken> {
   static void mapping(IO &IO, COFF::AuxiliaryCLRToken &ACT);
 };
 
 template <>
-struct MappingTraits<COFFYAML::Symbol> {
+struct LLVM_CLASS_ABI MappingTraits<COFFYAML::Symbol> {
   static void mapping(IO &IO, COFFYAML::Symbol &S);
 };
 
-template <> struct MappingTraits<COFFYAML::SectionDataEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<COFFYAML::SectionDataEntry> {
   static void mapping(IO &IO, COFFYAML::SectionDataEntry &Sec);
 };
 
 template <>
-struct MappingTraits<COFFYAML::Section> {
+struct LLVM_CLASS_ABI MappingTraits<COFFYAML::Section> {
   static void mapping(IO &IO, COFFYAML::Section &Sec);
 };
 
 template <>
-struct MappingTraits<COFFYAML::Object> {
+struct LLVM_CLASS_ABI MappingTraits<COFFYAML::Object> {
   static void mapping(IO &IO, COFFYAML::Object &Obj);
 };
 
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h b/llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h
index a3c7d76f3cfb609..3c0fe36a6cbf630 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAMLDebugSections.h
@@ -43,7 +43,7 @@ struct YAMLSubsectionBase;
 
 } // end namespace detail
 
-struct YAMLFrameData {
+struct LLVM_CLASS_ABI YAMLFrameData {
   uint32_t RvaStart;
   uint32_t CodeSize;
   uint32_t LocalSize;
@@ -55,40 +55,40 @@ struct YAMLFrameData {
   uint32_t Flags;
 };
 
-struct YAMLCrossModuleImport {
+struct LLVM_CLASS_ABI YAMLCrossModuleImport {
   StringRef ModuleName;
   std::vector<uint32_t> ImportIds;
 };
 
-struct SourceLineEntry {
+struct LLVM_CLASS_ABI SourceLineEntry {
   uint32_t Offset;
   uint32_t LineStart;
   uint32_t EndDelta;
   bool IsStatement;
 };
 
-struct SourceColumnEntry {
+struct LLVM_CLASS_ABI SourceColumnEntry {
   uint16_t StartColumn;
   uint16_t EndColumn;
 };
 
-struct SourceLineBlock {
+struct LLVM_CLASS_ABI SourceLineBlock {
   StringRef FileName;
   std::vector<SourceLineEntry> Lines;
   std::vector<SourceColumnEntry> Columns;
 };
 
-struct HexFormattedString {
+struct LLVM_CLASS_ABI HexFormattedString {
   std::vector<uint8_t> Bytes;
 };
 
-struct SourceFileChecksumEntry {
+struct LLVM_CLASS_ABI SourceFileChecksumEntry {
   StringRef FileName;
   codeview::FileChecksumKind Kind;
   HexFormattedString ChecksumBytes;
 };
 
-struct SourceLineInfo {
+struct LLVM_CLASS_ABI SourceLineInfo {
   uint32_t RelocOffset;
   uint32_t RelocSegment;
   codeview::LineFlags Flags;
@@ -96,19 +96,19 @@ struct SourceLineInfo {
   std::vector<SourceLineBlock> Blocks;
 };
 
-struct InlineeSite {
+struct LLVM_CLASS_ABI InlineeSite {
   uint32_t Inlinee;
   StringRef FileName;
   uint32_t SourceLineNum;
   std::vector<StringRef> ExtraFiles;
 };
 
-struct InlineeInfo {
+struct LLVM_CLASS_ABI InlineeInfo {
   bool HasExtraFiles;
   std::vector<InlineeSite> Sites;
 };
 
-struct YAMLDebugSubsection {
+struct LLVM_CLASS_ABI YAMLDebugSubsection {
   static Expected<YAMLDebugSubsection>
   fromCodeViewSubection(const codeview::StringsAndChecksumsRef &SC,
                         const codeview::DebugSubsectionRecord &SS);
@@ -116,15 +116,15 @@ struct YAMLDebugSubsection {
   std::shared_ptr<detail::YAMLSubsectionBase> Subsection;
 };
 
-Expected<std::vector<std::shared_ptr<codeview::DebugSubsection>>>
+LLVM_FUNC_ABI Expected<std::vector<std::shared_ptr<codeview::DebugSubsection>>>
 toCodeViewSubsectionList(BumpPtrAllocator &Allocator,
                          ArrayRef<YAMLDebugSubsection> Subsections,
                          const codeview::StringsAndChecksums &SC);
 
-std::vector<YAMLDebugSubsection>
+LLVM_FUNC_ABI std::vector<YAMLDebugSubsection>
 fromDebugS(ArrayRef<uint8_t> Data, const codeview::StringsAndChecksumsRef &SC);
 
-void initializeStringsAndChecksums(ArrayRef<YAMLDebugSubsection> Sections,
+LLVM_FUNC_ABI void initializeStringsAndChecksums(ArrayRef<YAMLDebugSubsection> Sections,
                                    codeview::StringsAndChecksums &SC);
 
 } // end namespace CodeViewYAML
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h b/llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h
index b66629a9e1d1d32..eca27aee275756c 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAMLSymbols.h
@@ -30,7 +30,7 @@ struct SymbolRecordBase;
 
 } // end namespace detail
 
-struct SymbolRecord {
+struct LLVM_CLASS_ABI SymbolRecord {
   std::shared_ptr<detail::SymbolRecordBase> Symbol;
 
   codeview::CVSymbol
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h b/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h
index 14d956b59f2de0b..b62862ca0dec67d 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypeHashing.h
@@ -29,7 +29,7 @@ namespace llvm {
 
 namespace CodeViewYAML {
 
-struct GlobalHash {
+struct LLVM_CLASS_ABI GlobalHash {
   GlobalHash() = default;
   explicit GlobalHash(StringRef S) : Hash(S) {
     assert(S.size() == 8 && "Invalid hash size!");
@@ -40,15 +40,15 @@ struct GlobalHash {
   yaml::BinaryRef Hash;
 };
 
-struct DebugHSection {
+struct LLVM_CLASS_ABI DebugHSection {
   uint32_t Magic;
   uint16_t Version;
   uint16_t HashAlgorithm;
   std::vector<GlobalHash> Hashes;
 };
 
-DebugHSection fromDebugH(ArrayRef<uint8_t> DebugH);
-ArrayRef<uint8_t> toDebugH(const DebugHSection &DebugH,
+LLVM_FUNC_ABI DebugHSection fromDebugH(ArrayRef<uint8_t> DebugH);
+LLVM_FUNC_ABI ArrayRef<uint8_t> toDebugH(const DebugHSection &DebugH,
                            BumpPtrAllocator &Alloc);
 
 } // end namespace CodeViewYAML
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h b/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h
index 822bb42cf74d24a..b93dca8ee204e65 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAMLTypes.h
@@ -39,11 +39,11 @@ struct MemberRecordBase;
 
 } // end namespace detail
 
-struct MemberRecord {
+struct LLVM_CLASS_ABI MemberRecord {
   std::shared_ptr<detail::MemberRecordBase> Member;
 };
 
-struct LeafRecord {
+struct LLVM_CLASS_ABI LeafRecord {
   std::shared_ptr<detail::LeafRecordBase> Leaf;
 
   codeview::CVType
@@ -51,9 +51,9 @@ struct LeafRecord {
   static Expected<LeafRecord> fromCodeViewRecord(codeview::CVType Type);
 };
 
-std::vector<LeafRecord> fromDebugT(ArrayRef<uint8_t> DebugTorP,
+LLVM_FUNC_ABI std::vector<LeafRecord> fromDebugT(ArrayRef<uint8_t> DebugTorP,
                                    StringRef SectionName);
-ArrayRef<uint8_t> toDebugT(ArrayRef<LeafRecord>, BumpPtrAllocator &Alloc,
+LLVM_FUNC_ABI ArrayRef<uint8_t> toDebugT(ArrayRef<LeafRecord>, BumpPtrAllocator &Alloc,
                            StringRef SectionName);
 
 } // end namespace CodeViewYAML
diff --git a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
index e7dd82f6663f055..c3fdc0c27a7223b 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFEmitter.h
@@ -28,25 +28,25 @@ namespace DWARFYAML {
 
 struct Data;
 
-Error emitDebugAbbrev(raw_ostream &OS, const Data &DI);
-Error emitDebugStr(raw_ostream &OS, const Data &DI);
-
-Error emitDebugAranges(raw_ostream &OS, const Data &DI);
-Error emitDebugRanges(raw_ostream &OS, const Data &DI);
-Error emitDebugPubnames(raw_ostream &OS, const Data &DI);
-Error emitDebugPubtypes(raw_ostream &OS, const Data &DI);
-Error emitDebugGNUPubnames(raw_ostream &OS, const Data &DI);
-Error emitDebugGNUPubtypes(raw_ostream &OS, const Data &DI);
-Error emitDebugInfo(raw_ostream &OS, const Data &DI);
-Error emitDebugLine(raw_ostream &OS, const Data &DI);
-Error emitDebugAddr(raw_ostream &OS, const Data &DI);
-Error emitDebugStrOffsets(raw_ostream &OS, const Data &DI);
-Error emitDebugRnglists(raw_ostream &OS, const Data &DI);
-Error emitDebugLoclists(raw_ostream &OS, const Data &DI);
-
-std::function<Error(raw_ostream &, const Data &)>
+LLVM_FUNC_ABI Error emitDebugAbbrev(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugStr(raw_ostream &OS, const Data &DI);
+
+LLVM_FUNC_ABI Error emitDebugAranges(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugRanges(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugPubnames(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugPubtypes(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugGNUPubnames(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugGNUPubtypes(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugInfo(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugLine(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugAddr(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugStrOffsets(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugRnglists(raw_ostream &OS, const Data &DI);
+LLVM_FUNC_ABI Error emitDebugLoclists(raw_ostream &OS, const Data &DI);
+
+LLVM_FUNC_ABI std::function<Error(raw_ostream &, const Data &)>
 getDWARFEmitterByName(StringRef SecName);
-Expected<StringMap<std::unique_ptr<MemoryBuffer>>>
+LLVM_FUNC_ABI Expected<StringMap<std::unique_ptr<MemoryBuffer>>>
 emitDebugSections(StringRef YAMLString,
                   bool IsLittleEndian = sys::IsLittleEndianHost,
                   bool Is64BitAddrSize = true);
diff --git a/llvm/include/llvm/ObjectYAML/DWARFYAML.h b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
index 5f0d2cd0454c599..977bd484567612b 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
@@ -29,30 +29,30 @@
 namespace llvm {
 namespace DWARFYAML {
 
-struct AttributeAbbrev {
+struct LLVM_CLASS_ABI AttributeAbbrev {
   llvm::dwarf::Attribute Attribute;
   llvm::dwarf::Form Form;
   llvm::yaml::Hex64 Value; // Some DWARF5 attributes have values
 };
 
-struct Abbrev {
+struct LLVM_CLASS_ABI Abbrev {
   std::optional<yaml::Hex64> Code;
   llvm::dwarf::Tag Tag;
   llvm::dwarf::Constants Children;
   std::vector<AttributeAbbrev> Attributes;
 };
 
-struct AbbrevTable {
+struct LLVM_CLASS_ABI AbbrevTable {
   std::optional<uint64_t> ID;
   std::vector<Abbrev> Table;
 };
 
-struct ARangeDescriptor {
+struct LLVM_CLASS_ABI ARangeDescriptor {
   llvm::yaml::Hex64 Address;
   yaml::Hex64 Length;
 };
 
-struct ARange {
+struct LLVM_CLASS_ABI ARange {
   dwarf::DwarfFormat Format;
   std::optional<yaml::Hex64> Length;
   uint16_t Version;
@@ -64,25 +64,25 @@ struct ARange {
 
 /// Class that describes a range list entry, or a base address selection entry
 /// within a range list in the .debug_ranges section.
-struct RangeEntry {
+struct LLVM_CLASS_ABI RangeEntry {
   llvm::yaml::Hex64 LowOffset;
   llvm::yaml::Hex64 HighOffset;
 };
 
 /// Class that describes a single range list inside the .debug_ranges section.
-struct Ranges {
+struct LLVM_CLASS_ABI Ranges {
   std::optional<llvm::yaml::Hex64> Offset;
   std::optional<llvm::yaml::Hex8> AddrSize;
   std::vector<RangeEntry> Entries;
 };
 
-struct PubEntry {
+struct LLVM_CLASS_ABI PubEntry {
   llvm::yaml::Hex32 DieOffset;
   llvm::yaml::Hex8 Descriptor;
   StringRef Name;
 };
 
-struct PubSection {
+struct LLVM_CLASS_ABI PubSection {
   dwarf::DwarfFormat Format;
   yaml::Hex64 Length;
   uint16_t Version;
@@ -91,24 +91,24 @@ struct PubSection {
   std::vector<PubEntry> Entries;
 };
 
-struct FormValue {
+struct LLVM_CLASS_ABI FormValue {
   llvm::yaml::Hex64 Value;
   StringRef CStr;
   std::vector<llvm::yaml::Hex8> BlockData;
 };
 
-struct Entry {
+struct LLVM_CLASS_ABI Entry {
   llvm::yaml::Hex32 AbbrCode;
   std::vector<FormValue> Values;
 };
 
 /// Class that contains helpful context information when mapping YAML into DWARF
 /// data structures.
-struct DWARFContext {
+struct LLVM_CLASS_ABI DWARFContext {
   bool IsGNUPubSec = false;
 };
 
-struct Unit {
+struct LLVM_CLASS_ABI Unit {
   dwarf::DwarfFormat Format;
   std::optional<yaml::Hex64> Length;
   uint16_t Version;
@@ -119,14 +119,14 @@ struct Unit {
   std::vector<Entry> Entries;
 };
 
-struct File {
+struct LLVM_CLASS_ABI File {
   StringRef Name;
   uint64_t DirIdx;
   uint64_t ModTime;
   uint64_t Length;
 };
 
-struct LineTableOpcode {
+struct LLVM_CLASS_ABI LineTableOpcode {
   dwarf::LineNumberOps Opcode;
   std::optional<uint64_t> ExtLen;
   dwarf::LineNumberExtendedOps SubOpcode;
@@ -137,7 +137,7 @@ struct LineTableOpcode {
   std::vector<llvm::yaml::Hex64> StandardOpcodeData;
 };
 
-struct LineTable {
+struct LLVM_CLASS_ABI LineTable {
   dwarf::DwarfFormat Format;
   std::optional<uint64_t> Length;
   uint16_t Version;
@@ -154,12 +154,12 @@ struct LineTable {
   std::vector<LineTableOpcode> Opcodes;
 };
 
-struct SegAddrPair {
+struct LLVM_CLASS_ABI SegAddrPair {
   yaml::Hex64 Segment;
   yaml::Hex64 Address;
 };
 
-struct AddrTableEntry {
+struct LLVM_CLASS_ABI AddrTableEntry {
   dwarf::DwarfFormat Format;
   std::optional<yaml::Hex64> Length;
   yaml::Hex16 Version;
@@ -168,7 +168,7 @@ struct AddrTableEntry {
   std::vector<SegAddrPair> SegAddrPairs;
 };
 
-struct StringOffsetsTable {
+struct LLVM_CLASS_ABI StringOffsetsTable {
   dwarf::DwarfFormat Format;
   std::optional<yaml::Hex64> Length;
   yaml::Hex16 Version;
@@ -176,29 +176,29 @@ struct StringOffsetsTable {
   std::vector<yaml::Hex64> Offsets;
 };
 
-struct DWARFOperation {
+struct LLVM_CLASS_ABI DWARFOperation {
   dwarf::LocationAtom Operator;
   std::vector<yaml::Hex64> Values;
 };
 
-struct RnglistEntry {
+struct LLVM_CLASS_ABI RnglistEntry {
   dwarf::RnglistEntries Operator;
   std::vector<yaml::Hex64> Values;
 };
 
-struct LoclistEntry {
+struct LLVM_CLASS_ABI LoclistEntry {
   dwarf::LoclistEntries Operator;
   std::vector<yaml::Hex64> Values;
   std::optional<yaml::Hex64> DescriptionsLength;
   std::vector<DWARFOperation> Descriptions;
 };
 
-template <typename EntryType> struct ListEntries {
+template <typename EntryType> struct LLVM_CLASS_ABI ListEntries {
   std::optional<std::vector<EntryType>> Entries;
   std::optional<yaml::BinaryRef> Content;
 };
 
-template <typename EntryType> struct ListTable {
+template <typename EntryType> struct LLVM_CLASS_ABI ListTable {
   dwarf::DwarfFormat Format;
   std::optional<yaml::Hex64> Length;
   yaml::Hex16 Version;
@@ -209,7 +209,7 @@ template <typename EntryType> struct ListTable {
   std::vector<ListEntries<EntryType>> Lists;
 };
 
-struct Data {
+struct LLVM_CLASS_ABI Data {
   bool IsLittleEndian;
   bool Is64BitAddrSize;
   std::vector<AbbrevTable> DebugAbbrev;
@@ -281,107 +281,107 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DWARFOperation)
 namespace llvm {
 namespace yaml {
 
-template <> struct MappingTraits<DWARFYAML::Data> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::Data> {
   static void mapping(IO &IO, DWARFYAML::Data &DWARF);
 };
 
-template <> struct MappingTraits<DWARFYAML::AbbrevTable> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::AbbrevTable> {
   static void mapping(IO &IO, DWARFYAML::AbbrevTable &AbbrevTable);
 };
 
-template <> struct MappingTraits<DWARFYAML::Abbrev> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::Abbrev> {
   static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev);
 };
 
-template <> struct MappingTraits<DWARFYAML::AttributeAbbrev> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::AttributeAbbrev> {
   static void mapping(IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev);
 };
 
-template <> struct MappingTraits<DWARFYAML::ARangeDescriptor> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::ARangeDescriptor> {
   static void mapping(IO &IO, DWARFYAML::ARangeDescriptor &Descriptor);
 };
 
-template <> struct MappingTraits<DWARFYAML::ARange> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::ARange> {
   static void mapping(IO &IO, DWARFYAML::ARange &ARange);
 };
 
-template <> struct MappingTraits<DWARFYAML::RangeEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::RangeEntry> {
   static void mapping(IO &IO, DWARFYAML::RangeEntry &Entry);
 };
 
-template <> struct MappingTraits<DWARFYAML::Ranges> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::Ranges> {
   static void mapping(IO &IO, DWARFYAML::Ranges &Ranges);
 };
 
-template <> struct MappingTraits<DWARFYAML::PubEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::PubEntry> {
   static void mapping(IO &IO, DWARFYAML::PubEntry &Entry);
 };
 
-template <> struct MappingTraits<DWARFYAML::PubSection> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::PubSection> {
   static void mapping(IO &IO, DWARFYAML::PubSection &Section);
 };
 
-template <> struct MappingTraits<DWARFYAML::Unit> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::Unit> {
   static void mapping(IO &IO, DWARFYAML::Unit &Unit);
 };
 
-template <> struct MappingTraits<DWARFYAML::Entry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::Entry> {
   static void mapping(IO &IO, DWARFYAML::Entry &Entry);
 };
 
-template <> struct MappingTraits<DWARFYAML::FormValue> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::FormValue> {
   static void mapping(IO &IO, DWARFYAML::FormValue &FormValue);
 };
 
-template <> struct MappingTraits<DWARFYAML::File> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::File> {
   static void mapping(IO &IO, DWARFYAML::File &File);
 };
 
-template <> struct MappingTraits<DWARFYAML::LineTableOpcode> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::LineTableOpcode> {
   static void mapping(IO &IO, DWARFYAML::LineTableOpcode &LineTableOpcode);
 };
 
-template <> struct MappingTraits<DWARFYAML::LineTable> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::LineTable> {
   static void mapping(IO &IO, DWARFYAML::LineTable &LineTable);
 };
 
-template <> struct MappingTraits<DWARFYAML::SegAddrPair> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::SegAddrPair> {
   static void mapping(IO &IO, DWARFYAML::SegAddrPair &SegAddrPair);
 };
 
-template <> struct MappingTraits<DWARFYAML::DWARFOperation> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::DWARFOperation> {
   static void mapping(IO &IO, DWARFYAML::DWARFOperation &DWARFOperation);
 };
 
 template <typename EntryType>
-struct MappingTraits<DWARFYAML::ListTable<EntryType>> {
+struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::ListTable<EntryType>> {
   static void mapping(IO &IO, DWARFYAML::ListTable<EntryType> &ListTable);
 };
 
 template <typename EntryType>
-struct MappingTraits<DWARFYAML::ListEntries<EntryType>> {
+struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::ListEntries<EntryType>> {
   static void mapping(IO &IO, DWARFYAML::ListEntries<EntryType> &ListEntries);
   static std::string validate(IO &IO,
                               DWARFYAML::ListEntries<EntryType> &ListEntries);
 };
 
-template <> struct MappingTraits<DWARFYAML::RnglistEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::RnglistEntry> {
   static void mapping(IO &IO, DWARFYAML::RnglistEntry &RnglistEntry);
 };
 
-template <> struct MappingTraits<DWARFYAML::LoclistEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::LoclistEntry> {
   static void mapping(IO &IO, DWARFYAML::LoclistEntry &LoclistEntry);
 };
 
-template <> struct MappingTraits<DWARFYAML::AddrTableEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::AddrTableEntry> {
   static void mapping(IO &IO, DWARFYAML::AddrTableEntry &AddrTable);
 };
 
-template <> struct MappingTraits<DWARFYAML::StringOffsetsTable> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DWARFYAML::StringOffsetsTable> {
   static void mapping(IO &IO, DWARFYAML::StringOffsetsTable &StrOffsetsTable);
 };
 
-template <> struct ScalarEnumerationTraits<dwarf::DwarfFormat> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::DwarfFormat> {
   static void enumeration(IO &IO, dwarf::DwarfFormat &Format) {
     IO.enumCase(Format, "DWARF32", dwarf::DWARF32);
     IO.enumCase(Format, "DWARF64", dwarf::DWARF64);
@@ -391,7 +391,7 @@ template <> struct ScalarEnumerationTraits<dwarf::DwarfFormat> {
 #define HANDLE_DW_TAG(unused, name, unused2, unused3, unused4)                 \
   io.enumCase(value, "DW_TAG_" #name, dwarf::DW_TAG_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::Tag> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::Tag> {
   static void enumeration(IO &io, dwarf::Tag &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
     io.enumFallback<Hex16>(value);
@@ -401,7 +401,7 @@ template <> struct ScalarEnumerationTraits<dwarf::Tag> {
 #define HANDLE_DW_LNS(unused, name)                                            \
   io.enumCase(value, "DW_LNS_" #name, dwarf::DW_LNS_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::LineNumberOps> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::LineNumberOps> {
   static void enumeration(IO &io, dwarf::LineNumberOps &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
     io.enumFallback<Hex8>(value);
@@ -411,7 +411,7 @@ template <> struct ScalarEnumerationTraits<dwarf::LineNumberOps> {
 #define HANDLE_DW_LNE(unused, name)                                            \
   io.enumCase(value, "DW_LNE_" #name, dwarf::DW_LNE_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::LineNumberExtendedOps> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::LineNumberExtendedOps> {
   static void enumeration(IO &io, dwarf::LineNumberExtendedOps &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
     io.enumFallback<Hex16>(value);
@@ -421,7 +421,7 @@ template <> struct ScalarEnumerationTraits<dwarf::LineNumberExtendedOps> {
 #define HANDLE_DW_AT(unused, name, unused2, unused3)                           \
   io.enumCase(value, "DW_AT_" #name, dwarf::DW_AT_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::Attribute> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::Attribute> {
   static void enumeration(IO &io, dwarf::Attribute &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
     io.enumFallback<Hex16>(value);
@@ -431,7 +431,7 @@ template <> struct ScalarEnumerationTraits<dwarf::Attribute> {
 #define HANDLE_DW_FORM(unused, name, unused2, unused3)                         \
   io.enumCase(value, "DW_FORM_" #name, dwarf::DW_FORM_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::Form> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::Form> {
   static void enumeration(IO &io, dwarf::Form &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
     io.enumFallback<Hex16>(value);
@@ -441,14 +441,14 @@ template <> struct ScalarEnumerationTraits<dwarf::Form> {
 #define HANDLE_DW_UT(unused, name)                                             \
   io.enumCase(value, "DW_UT_" #name, dwarf::DW_UT_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::UnitType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::UnitType> {
   static void enumeration(IO &io, dwarf::UnitType &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
     io.enumFallback<Hex8>(value);
   }
 };
 
-template <> struct ScalarEnumerationTraits<dwarf::Constants> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::Constants> {
   static void enumeration(IO &io, dwarf::Constants &value) {
     io.enumCase(value, "DW_CHILDREN_no", dwarf::DW_CHILDREN_no);
     io.enumCase(value, "DW_CHILDREN_yes", dwarf::DW_CHILDREN_yes);
@@ -459,7 +459,7 @@ template <> struct ScalarEnumerationTraits<dwarf::Constants> {
 #define HANDLE_DW_RLE(unused, name)                                            \
   io.enumCase(value, "DW_RLE_" #name, dwarf::DW_RLE_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::RnglistEntries> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::RnglistEntries> {
   static void enumeration(IO &io, dwarf::RnglistEntries &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
   }
@@ -468,7 +468,7 @@ template <> struct ScalarEnumerationTraits<dwarf::RnglistEntries> {
 #define HANDLE_DW_LLE(unused, name)                                            \
   io.enumCase(value, "DW_LLE_" #name, dwarf::DW_LLE_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::LoclistEntries> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::LoclistEntries> {
   static void enumeration(IO &io, dwarf::LoclistEntries &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
   }
@@ -477,7 +477,7 @@ template <> struct ScalarEnumerationTraits<dwarf::LoclistEntries> {
 #define HANDLE_DW_OP(id, name, version, vendor)                                \
   io.enumCase(value, "DW_OP_" #name, dwarf::DW_OP_##name);
 
-template <> struct ScalarEnumerationTraits<dwarf::LocationAtom> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<dwarf::LocationAtom> {
   static void enumeration(IO &io, dwarf::LocationAtom &value) {
 #include "llvm/BinaryFormat/Dwarf.def"
     io.enumFallback<yaml::Hex8>(value);
diff --git a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
index 23970dae385f625..04afd0c8d697113 100644
--- a/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DXContainerYAML.h
@@ -28,7 +28,7 @@
 namespace llvm {
 namespace DXContainerYAML {
 
-struct VersionTuple {
+struct LLVM_CLASS_ABI VersionTuple {
   uint16_t Major;
   uint16_t Minor;
 };
@@ -36,7 +36,7 @@ struct VersionTuple {
 // The optional header fields are required in the binary and will be populated
 // when reading from binary, but can be omitted in the YAML text because the
 // emitter can calculate them.
-struct FileHeader {
+struct LLVM_CLASS_ABI FileHeader {
   std::vector<llvm::yaml::Hex8> Hash;
   VersionTuple Version;
   std::optional<uint32_t> FileSize;
@@ -44,7 +44,7 @@ struct FileHeader {
   std::optional<std::vector<uint32_t>> PartOffsets;
 };
 
-struct DXILProgram {
+struct LLVM_CLASS_ABI DXILProgram {
   uint8_t MajorVersion;
   uint8_t MinorVersion;
   uint16_t ShaderKind;
@@ -57,14 +57,14 @@ struct DXILProgram {
 };
 
 #define SHADER_FLAG(Num, Val, Str) bool Val = false;
-struct ShaderFlags {
+struct LLVM_CLASS_ABI ShaderFlags {
   ShaderFlags() = default;
   ShaderFlags(uint64_t FlagData);
   uint64_t getEncodedFlags();
 #include "llvm/BinaryFormat/DXContainerConstants.def"
 };
 
-struct ShaderHash {
+struct LLVM_CLASS_ABI ShaderHash {
   ShaderHash() = default;
   ShaderHash(const dxbc::ShaderHash &Data);
 
@@ -74,7 +74,7 @@ struct ShaderHash {
 
 using ResourceBindInfo = dxbc::PSV::v2::ResourceBindInfo;
 
-struct PSVInfo {
+struct LLVM_CLASS_ABI PSVInfo {
   // The version field isn't actually encoded in the file, but it is inferred by
   // the size of data regions. We include it in the yaml because it simplifies
   // the format.
@@ -91,7 +91,7 @@ struct PSVInfo {
   PSVInfo(const dxbc::PSV::v2::RuntimeInfo *P);
 };
 
-struct Part {
+struct LLVM_CLASS_ABI Part {
   Part() = default;
   Part(std::string N, uint32_t S) : Name(N), Size(S) {}
   std::string Name;
@@ -102,7 +102,7 @@ struct Part {
   std::optional<PSVInfo> Info;
 };
 
-struct Object {
+struct LLVM_CLASS_ABI Object {
   FileHeader Header;
   std::vector<Part> Parts;
 };
@@ -118,39 +118,39 @@ class raw_ostream;
 
 namespace yaml {
 
-template <> struct MappingTraits<DXContainerYAML::VersionTuple> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::VersionTuple> {
   static void mapping(IO &IO, DXContainerYAML::VersionTuple &Version);
 };
 
-template <> struct MappingTraits<DXContainerYAML::FileHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::FileHeader> {
   static void mapping(IO &IO, DXContainerYAML::FileHeader &Header);
 };
 
-template <> struct MappingTraits<DXContainerYAML::DXILProgram> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::DXILProgram> {
   static void mapping(IO &IO, DXContainerYAML::DXILProgram &Program);
 };
 
-template <> struct MappingTraits<DXContainerYAML::ShaderFlags> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::ShaderFlags> {
   static void mapping(IO &IO, DXContainerYAML::ShaderFlags &Flags);
 };
 
-template <> struct MappingTraits<DXContainerYAML::ShaderHash> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::ShaderHash> {
   static void mapping(IO &IO, DXContainerYAML::ShaderHash &Hash);
 };
 
-template <> struct MappingTraits<DXContainerYAML::PSVInfo> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::PSVInfo> {
   static void mapping(IO &IO, DXContainerYAML::PSVInfo &PSV);
 };
 
-template <> struct MappingTraits<DXContainerYAML::Part> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::Part> {
   static void mapping(IO &IO, DXContainerYAML::Part &Version);
 };
 
-template <> struct MappingTraits<DXContainerYAML::Object> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::Object> {
   static void mapping(IO &IO, DXContainerYAML::Object &Obj);
 };
 
-template <> struct MappingTraits<DXContainerYAML::ResourceBindInfo> {
+template <> struct LLVM_CLASS_ABI MappingTraits<DXContainerYAML::ResourceBindInfo> {
   static void mapping(IO &IO, DXContainerYAML::ResourceBindInfo &Res);
 };
 
diff --git a/llvm/include/llvm/ObjectYAML/ELFYAML.h b/llvm/include/llvm/ObjectYAML/ELFYAML.h
index 5396ef461adf7a8..6f1c6b98a38325e 100644
--- a/llvm/include/llvm/ObjectYAML/ELFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/ELFYAML.h
@@ -30,8 +30,8 @@
 namespace llvm {
 namespace ELFYAML {
 
-StringRef dropUniqueSuffix(StringRef S);
-std::string appendUniqueSuffix(StringRef Name, const Twine& Msg);
+LLVM_FUNC_ABI StringRef dropUniqueSuffix(StringRef S);
+LLVM_FUNC_ABI std::string appendUniqueSuffix(StringRef Name, const Twine& Msg);
 
 // These types are invariant across 32/64-bit ELF, so for simplicity just
 // directly give them their exact sizes. We don't need to worry about
@@ -111,7 +111,7 @@ unsigned getDefaultShEntSize(unsigned EMachine, ELF_SHT SecType,
 
 // For now, hardcode 64 bits everywhere that 32 or 64 would be needed
 // since 64-bit can hold 32-bit values too.
-struct FileHeader {
+struct LLVM_CLASS_ABI FileHeader {
   ELF_ELFCLASS Class;
   ELF_ELFDATA Data;
   ELF_ELFOSABI OSABI;
@@ -131,11 +131,11 @@ struct FileHeader {
   std::optional<llvm::yaml::Hex16> EShStrNdx;
 };
 
-struct SectionHeader {
+struct LLVM_CLASS_ABI SectionHeader {
   StringRef Name;
 };
 
-struct Symbol {
+struct LLVM_CLASS_ABI Symbol {
   StringRef Name;
   ELF_STT Type;
   std::optional<StringRef> Section;
@@ -148,16 +148,16 @@ struct Symbol {
   std::optional<uint32_t> StName;
 };
 
-struct SectionOrType {
+struct LLVM_CLASS_ABI SectionOrType {
   StringRef sectionNameOrType;
 };
 
-struct DynamicEntry {
+struct LLVM_CLASS_ABI DynamicEntry {
   ELF_DYNTAG Tag;
   llvm::yaml::Hex64 Val;
 };
 
-struct BBAddrMapEntry {
+struct LLVM_CLASS_ABI BBAddrMapEntry {
   struct BBEntry {
     uint32_t ID;
     llvm::yaml::Hex64 AddressOffset;
@@ -171,18 +171,18 @@ struct BBAddrMapEntry {
   std::optional<std::vector<BBEntry>> BBEntries;
 };
 
-struct StackSizeEntry {
+struct LLVM_CLASS_ABI StackSizeEntry {
   llvm::yaml::Hex64 Address;
   llvm::yaml::Hex64 Size;
 };
 
-struct NoteEntry {
+struct LLVM_CLASS_ABI NoteEntry {
   StringRef Name;
   yaml::BinaryRef Desc;
   ELF_NT Type;
 };
 
-struct Chunk {
+struct LLVM_CLASS_ABI Chunk {
   enum class ChunkKind {
     Dynamic,
     Group,
@@ -224,7 +224,7 @@ struct Chunk {
   virtual ~Chunk();
 };
 
-struct Section : public Chunk {
+struct LLVM_CLASS_ABI Section : public Chunk {
   ELF_SHT Type;
   std::optional<ELF_SHF> Flags;
   std::optional<llvm::yaml::Hex64> Address;
@@ -282,7 +282,7 @@ struct Section : public Chunk {
 // Fill is a block of data which is placed outside of sections. It is
 // not present in the sections header table, but it might affect the output file
 // size and program headers produced.
-struct Fill : Chunk {
+struct LLVM_CLASS_ABI Fill : Chunk {
   std::optional<yaml::BinaryRef> Pattern;
   llvm::yaml::Hex64 Size;
 
@@ -291,7 +291,7 @@ struct Fill : Chunk {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Fill; }
 };
 
-struct SectionHeaderTable : Chunk {
+struct LLVM_CLASS_ABI SectionHeaderTable : Chunk {
   SectionHeaderTable(bool IsImplicit)
       : Chunk(ChunkKind::SectionHeaderTable, IsImplicit) {}
 
@@ -316,7 +316,7 @@ struct SectionHeaderTable : Chunk {
   static constexpr StringRef TypeStr = "SectionHeaderTable";
 };
 
-struct BBAddrMapSection : Section {
+struct LLVM_CLASS_ABI BBAddrMapSection : Section {
   std::optional<std::vector<BBAddrMapEntry>> Entries;
 
   BBAddrMapSection() : Section(ChunkKind::BBAddrMap) {}
@@ -330,7 +330,7 @@ struct BBAddrMapSection : Section {
   }
 };
 
-struct StackSizesSection : Section {
+struct LLVM_CLASS_ABI StackSizesSection : Section {
   std::optional<std::vector<StackSizeEntry>> Entries;
 
   StackSizesSection() : Section(ChunkKind::StackSizes) {}
@@ -348,7 +348,7 @@ struct StackSizesSection : Section {
   }
 };
 
-struct DynamicSection : Section {
+struct LLVM_CLASS_ABI DynamicSection : Section {
   std::optional<std::vector<DynamicEntry>> Entries;
 
   DynamicSection() : Section(ChunkKind::Dynamic) {}
@@ -360,7 +360,7 @@ struct DynamicSection : Section {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Dynamic; }
 };
 
-struct RawContentSection : Section {
+struct LLVM_CLASS_ABI RawContentSection : Section {
   std::optional<llvm::yaml::Hex64> Info;
 
   RawContentSection() : Section(ChunkKind::RawContent) {}
@@ -373,13 +373,13 @@ struct RawContentSection : Section {
   std::optional<std::vector<uint8_t>> ContentBuf;
 };
 
-struct NoBitsSection : Section {
+struct LLVM_CLASS_ABI NoBitsSection : Section {
   NoBitsSection() : Section(ChunkKind::NoBits) {}
 
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::NoBits; }
 };
 
-struct NoteSection : Section {
+struct LLVM_CLASS_ABI NoteSection : Section {
   std::optional<std::vector<ELFYAML::NoteEntry>> Notes;
 
   NoteSection() : Section(ChunkKind::Note) {}
@@ -391,7 +391,7 @@ struct NoteSection : Section {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Note; }
 };
 
-struct HashSection : Section {
+struct LLVM_CLASS_ABI HashSection : Section {
   std::optional<std::vector<uint32_t>> Bucket;
   std::optional<std::vector<uint32_t>> Chain;
 
@@ -409,7 +409,7 @@ struct HashSection : Section {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Hash; }
 };
 
-struct GnuHashHeader {
+struct LLVM_CLASS_ABI GnuHashHeader {
   // The number of hash buckets.
   // Not used when dumping the object, but can be used to override
   // the real number of buckets when emiting an object from a YAML document.
@@ -429,7 +429,7 @@ struct GnuHashHeader {
   llvm::yaml::Hex32 Shift2;
 };
 
-struct GnuHashSection : Section {
+struct LLVM_CLASS_ABI GnuHashSection : Section {
   std::optional<GnuHashHeader> Header;
   std::optional<std::vector<llvm::yaml::Hex64>> BloomFilter;
   std::optional<std::vector<llvm::yaml::Hex32>> HashBuckets;
@@ -447,20 +447,20 @@ struct GnuHashSection : Section {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::GnuHash; }
 };
 
-struct VernauxEntry {
+struct LLVM_CLASS_ABI VernauxEntry {
   uint32_t Hash;
   uint16_t Flags;
   uint16_t Other;
   StringRef Name;
 };
 
-struct VerneedEntry {
+struct LLVM_CLASS_ABI VerneedEntry {
   uint16_t Version;
   StringRef File;
   std::vector<VernauxEntry> AuxV;
 };
 
-struct VerneedSection : Section {
+struct LLVM_CLASS_ABI VerneedSection : Section {
   std::optional<std::vector<VerneedEntry>> VerneedV;
   std::optional<llvm::yaml::Hex64> Info;
 
@@ -475,7 +475,7 @@ struct VerneedSection : Section {
   }
 };
 
-struct AddrsigSection : Section {
+struct LLVM_CLASS_ABI AddrsigSection : Section {
   std::optional<std::vector<YAMLFlowString>> Symbols;
 
   AddrsigSection() : Section(ChunkKind::Addrsig) {}
@@ -487,12 +487,12 @@ struct AddrsigSection : Section {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Addrsig; }
 };
 
-struct LinkerOption {
+struct LLVM_CLASS_ABI LinkerOption {
   StringRef Key;
   StringRef Value;
 };
 
-struct LinkerOptionsSection : Section {
+struct LLVM_CLASS_ABI LinkerOptionsSection : Section {
   std::optional<std::vector<LinkerOption>> Options;
 
   LinkerOptionsSection() : Section(ChunkKind::LinkerOptions) {}
@@ -506,7 +506,7 @@ struct LinkerOptionsSection : Section {
   }
 };
 
-struct DependentLibrariesSection : Section {
+struct LLVM_CLASS_ABI DependentLibrariesSection : Section {
   std::optional<std::vector<YAMLFlowString>> Libs;
 
   DependentLibrariesSection() : Section(ChunkKind::DependentLibraries) {}
@@ -521,12 +521,12 @@ struct DependentLibrariesSection : Section {
 };
 
 // Represents the call graph profile section entry.
-struct CallGraphEntryWeight {
+struct LLVM_CLASS_ABI CallGraphEntryWeight {
   // The weight of the edge.
   uint64_t Weight;
 };
 
-struct CallGraphProfileSection : Section {
+struct LLVM_CLASS_ABI CallGraphProfileSection : Section {
   std::optional<std::vector<CallGraphEntryWeight>> Entries;
 
   CallGraphProfileSection() : Section(ChunkKind::CallGraphProfile) {}
@@ -540,7 +540,7 @@ struct CallGraphProfileSection : Section {
   }
 };
 
-struct SymverSection : Section {
+struct LLVM_CLASS_ABI SymverSection : Section {
   std::optional<std::vector<uint16_t>> Entries;
 
   SymverSection() : Section(ChunkKind::Symver) {}
@@ -552,7 +552,7 @@ struct SymverSection : Section {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Symver; }
 };
 
-struct VerdefEntry {
+struct LLVM_CLASS_ABI VerdefEntry {
   std::optional<uint16_t> Version;
   std::optional<uint16_t> Flags;
   std::optional<uint16_t> VersionNdx;
@@ -560,7 +560,7 @@ struct VerdefEntry {
   std::vector<StringRef> VerNames;
 };
 
-struct VerdefSection : Section {
+struct LLVM_CLASS_ABI VerdefSection : Section {
   std::optional<std::vector<VerdefEntry>> Entries;
   std::optional<llvm::yaml::Hex64> Info;
 
@@ -573,7 +573,7 @@ struct VerdefSection : Section {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Verdef; }
 };
 
-struct GroupSection : Section {
+struct LLVM_CLASS_ABI GroupSection : Section {
   // Members of a group contain a flag and a list of section indices
   // that are part of the group.
   std::optional<std::vector<SectionOrType>> Members;
@@ -588,14 +588,14 @@ struct GroupSection : Section {
   static bool classof(const Chunk *S) { return S->Kind == ChunkKind::Group; }
 };
 
-struct Relocation {
+struct LLVM_CLASS_ABI Relocation {
   llvm::yaml::Hex64 Offset;
   YAMLIntUInt Addend;
   ELF_REL Type;
   std::optional<StringRef> Symbol;
 };
 
-struct RelocationSection : Section {
+struct LLVM_CLASS_ABI RelocationSection : Section {
   std::optional<std::vector<Relocation>> Relocations;
   StringRef RelocatableSec; /* Info */
 
@@ -610,7 +610,7 @@ struct RelocationSection : Section {
   }
 };
 
-struct RelrSection : Section {
+struct LLVM_CLASS_ABI RelrSection : Section {
   std::optional<std::vector<llvm::yaml::Hex64>> Entries;
 
   RelrSection() : Section(ChunkKind::Relr) {}
@@ -624,7 +624,7 @@ struct RelrSection : Section {
   }
 };
 
-struct SymtabShndxSection : Section {
+struct LLVM_CLASS_ABI SymtabShndxSection : Section {
   std::optional<std::vector<uint32_t>> Entries;
 
   SymtabShndxSection() : Section(ChunkKind::SymtabShndxSection) {}
@@ -638,12 +638,12 @@ struct SymtabShndxSection : Section {
   }
 };
 
-struct ARMIndexTableEntry {
+struct LLVM_CLASS_ABI ARMIndexTableEntry {
   llvm::yaml::Hex32 Offset;
   llvm::yaml::Hex32 Value;
 };
 
-struct ARMIndexTableSection : Section {
+struct LLVM_CLASS_ABI ARMIndexTableSection : Section {
   std::optional<std::vector<ARMIndexTableEntry>> Entries;
 
   ARMIndexTableSection() : Section(ChunkKind::ARMIndexTable) {}
@@ -658,7 +658,7 @@ struct ARMIndexTableSection : Section {
 };
 
 // Represents .MIPS.abiflags section
-struct MipsABIFlags : Section {
+struct LLVM_CLASS_ABI MipsABIFlags : Section {
   llvm::yaml::Hex16 Version;
   MIPS_ISA ISALevel;
   llvm::yaml::Hex8 ISARevision;
@@ -678,7 +678,7 @@ struct MipsABIFlags : Section {
   }
 };
 
-struct ProgramHeader {
+struct LLVM_CLASS_ABI ProgramHeader {
   ELF_PT Type;
   ELF_PF Flags;
   llvm::yaml::Hex64 VAddr;
@@ -694,7 +694,7 @@ struct ProgramHeader {
   std::vector<Chunk *> Chunks;
 };
 
-struct Object {
+struct LLVM_CLASS_ABI Object {
   FileHeader Header;
   std::vector<ProgramHeader> ProgramHeaders;
 
@@ -729,7 +729,7 @@ struct Object {
   unsigned getMachine() const;
 };
 
-bool shouldAllocateFileSpace(ArrayRef<ProgramHeader> Phdrs,
+LLVM_FUNC_ABI bool shouldAllocateFileSpace(ArrayRef<ProgramHeader> Phdrs,
                              const NoBitsSection &S);
 
 } // end namespace ELFYAML
@@ -756,7 +756,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::ELFYAML::ARMIndexTableEntry)
 namespace llvm {
 namespace yaml {
 
-template <> struct ScalarTraits<ELFYAML::YAMLIntUInt> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<ELFYAML::YAMLIntUInt> {
   static void output(const ELFYAML::YAMLIntUInt &Val, void *Ctx,
                      raw_ostream &Out);
   static StringRef input(StringRef Scalar, void *Ctx,
@@ -765,198 +765,198 @@ template <> struct ScalarTraits<ELFYAML::YAMLIntUInt> {
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_ET> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_ET> {
   static void enumeration(IO &IO, ELFYAML::ELF_ET &Value);
 };
 
-template <> struct ScalarEnumerationTraits<ELFYAML::ELF_PT> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_PT> {
   static void enumeration(IO &IO, ELFYAML::ELF_PT &Value);
 };
 
-template <> struct ScalarEnumerationTraits<ELFYAML::ELF_NT> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_NT> {
   static void enumeration(IO &IO, ELFYAML::ELF_NT &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_EM> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_EM> {
   static void enumeration(IO &IO, ELFYAML::ELF_EM &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_ELFCLASS> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_ELFCLASS> {
   static void enumeration(IO &IO, ELFYAML::ELF_ELFCLASS &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_ELFDATA> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_ELFDATA> {
   static void enumeration(IO &IO, ELFYAML::ELF_ELFDATA &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_ELFOSABI> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_ELFOSABI> {
   static void enumeration(IO &IO, ELFYAML::ELF_ELFOSABI &Value);
 };
 
 template <>
-struct ScalarBitSetTraits<ELFYAML::ELF_EF> {
+struct LLVM_CLASS_ABI ScalarBitSetTraits<ELFYAML::ELF_EF> {
   static void bitset(IO &IO, ELFYAML::ELF_EF &Value);
 };
 
-template <> struct ScalarBitSetTraits<ELFYAML::ELF_PF> {
+template <> struct LLVM_CLASS_ABI ScalarBitSetTraits<ELFYAML::ELF_PF> {
   static void bitset(IO &IO, ELFYAML::ELF_PF &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_SHT> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_SHT> {
   static void enumeration(IO &IO, ELFYAML::ELF_SHT &Value);
 };
 
 template <>
-struct ScalarBitSetTraits<ELFYAML::ELF_SHF> {
+struct LLVM_CLASS_ABI ScalarBitSetTraits<ELFYAML::ELF_SHF> {
   static void bitset(IO &IO, ELFYAML::ELF_SHF &Value);
 };
 
-template <> struct ScalarEnumerationTraits<ELFYAML::ELF_SHN> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_SHN> {
   static void enumeration(IO &IO, ELFYAML::ELF_SHN &Value);
 };
 
-template <> struct ScalarEnumerationTraits<ELFYAML::ELF_STB> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_STB> {
   static void enumeration(IO &IO, ELFYAML::ELF_STB &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_STT> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_STT> {
   static void enumeration(IO &IO, ELFYAML::ELF_STT &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_REL> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_REL> {
   static void enumeration(IO &IO, ELFYAML::ELF_REL &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_DYNTAG> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_DYNTAG> {
   static void enumeration(IO &IO, ELFYAML::ELF_DYNTAG &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::ELF_RSS> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::ELF_RSS> {
   static void enumeration(IO &IO, ELFYAML::ELF_RSS &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::MIPS_AFL_REG> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::MIPS_AFL_REG> {
   static void enumeration(IO &IO, ELFYAML::MIPS_AFL_REG &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::MIPS_ABI_FP> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::MIPS_ABI_FP> {
   static void enumeration(IO &IO, ELFYAML::MIPS_ABI_FP &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::MIPS_AFL_EXT> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::MIPS_AFL_EXT> {
   static void enumeration(IO &IO, ELFYAML::MIPS_AFL_EXT &Value);
 };
 
 template <>
-struct ScalarEnumerationTraits<ELFYAML::MIPS_ISA> {
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<ELFYAML::MIPS_ISA> {
   static void enumeration(IO &IO, ELFYAML::MIPS_ISA &Value);
 };
 
 template <>
-struct ScalarBitSetTraits<ELFYAML::MIPS_AFL_ASE> {
+struct LLVM_CLASS_ABI ScalarBitSetTraits<ELFYAML::MIPS_AFL_ASE> {
   static void bitset(IO &IO, ELFYAML::MIPS_AFL_ASE &Value);
 };
 
 template <>
-struct ScalarBitSetTraits<ELFYAML::MIPS_AFL_FLAGS1> {
+struct LLVM_CLASS_ABI ScalarBitSetTraits<ELFYAML::MIPS_AFL_FLAGS1> {
   static void bitset(IO &IO, ELFYAML::MIPS_AFL_FLAGS1 &Value);
 };
 
 template <>
-struct MappingTraits<ELFYAML::FileHeader> {
+struct LLVM_CLASS_ABI MappingTraits<ELFYAML::FileHeader> {
   static void mapping(IO &IO, ELFYAML::FileHeader &FileHdr);
 };
 
-template <> struct MappingTraits<ELFYAML::SectionHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::SectionHeader> {
   static void mapping(IO &IO, ELFYAML::SectionHeader &SHdr);
 };
 
-template <> struct MappingTraits<ELFYAML::ProgramHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::ProgramHeader> {
   static void mapping(IO &IO, ELFYAML::ProgramHeader &FileHdr);
   static std::string validate(IO &IO, ELFYAML::ProgramHeader &FileHdr);
 };
 
 template <>
-struct MappingTraits<ELFYAML::Symbol> {
+struct LLVM_CLASS_ABI MappingTraits<ELFYAML::Symbol> {
   static void mapping(IO &IO, ELFYAML::Symbol &Symbol);
   static std::string validate(IO &IO, ELFYAML::Symbol &Symbol);
 };
 
-template <> struct MappingTraits<ELFYAML::StackSizeEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::StackSizeEntry> {
   static void mapping(IO &IO, ELFYAML::StackSizeEntry &Rel);
 };
 
-template <> struct MappingTraits<ELFYAML::BBAddrMapEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::BBAddrMapEntry> {
   static void mapping(IO &IO, ELFYAML::BBAddrMapEntry &Rel);
 };
 
-template <> struct MappingTraits<ELFYAML::BBAddrMapEntry::BBEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::BBAddrMapEntry::BBEntry> {
   static void mapping(IO &IO, ELFYAML::BBAddrMapEntry::BBEntry &Rel);
 };
 
-template <> struct MappingTraits<ELFYAML::GnuHashHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::GnuHashHeader> {
   static void mapping(IO &IO, ELFYAML::GnuHashHeader &Rel);
 };
 
-template <> struct MappingTraits<ELFYAML::DynamicEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::DynamicEntry> {
   static void mapping(IO &IO, ELFYAML::DynamicEntry &Rel);
 };
 
-template <> struct MappingTraits<ELFYAML::NoteEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::NoteEntry> {
   static void mapping(IO &IO, ELFYAML::NoteEntry &N);
 };
 
-template <> struct MappingTraits<ELFYAML::VerdefEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::VerdefEntry> {
   static void mapping(IO &IO, ELFYAML::VerdefEntry &E);
 };
 
-template <> struct MappingTraits<ELFYAML::VerneedEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::VerneedEntry> {
   static void mapping(IO &IO, ELFYAML::VerneedEntry &E);
 };
 
-template <> struct MappingTraits<ELFYAML::VernauxEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::VernauxEntry> {
   static void mapping(IO &IO, ELFYAML::VernauxEntry &E);
 };
 
-template <> struct MappingTraits<ELFYAML::LinkerOption> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::LinkerOption> {
   static void mapping(IO &IO, ELFYAML::LinkerOption &Sym);
 };
 
-template <> struct MappingTraits<ELFYAML::CallGraphEntryWeight> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::CallGraphEntryWeight> {
   static void mapping(IO &IO, ELFYAML::CallGraphEntryWeight &E);
 };
 
-template <> struct MappingTraits<ELFYAML::Relocation> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::Relocation> {
   static void mapping(IO &IO, ELFYAML::Relocation &Rel);
 };
 
-template <> struct MappingTraits<ELFYAML::ARMIndexTableEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::ARMIndexTableEntry> {
   static void mapping(IO &IO, ELFYAML::ARMIndexTableEntry &E);
 };
 
-template <> struct MappingTraits<std::unique_ptr<ELFYAML::Chunk>> {
+template <> struct LLVM_CLASS_ABI MappingTraits<std::unique_ptr<ELFYAML::Chunk>> {
   static void mapping(IO &IO, std::unique_ptr<ELFYAML::Chunk> &C);
   static std::string validate(IO &io, std::unique_ptr<ELFYAML::Chunk> &C);
 };
 
 template <>
-struct MappingTraits<ELFYAML::Object> {
+struct LLVM_CLASS_ABI MappingTraits<ELFYAML::Object> {
   static void mapping(IO &IO, ELFYAML::Object &Object);
 };
 
-template <> struct MappingTraits<ELFYAML::SectionOrType> {
+template <> struct LLVM_CLASS_ABI MappingTraits<ELFYAML::SectionOrType> {
   static void mapping(IO &IO, ELFYAML::SectionOrType &sectionOrType);
 };
 
diff --git a/llvm/include/llvm/ObjectYAML/MachOYAML.h b/llvm/include/llvm/ObjectYAML/MachOYAML.h
index b29d46c61c4a180..b2eec06689c7833 100644
--- a/llvm/include/llvm/ObjectYAML/MachOYAML.h
+++ b/llvm/include/llvm/ObjectYAML/MachOYAML.h
@@ -29,7 +29,7 @@
 namespace llvm {
 namespace MachOYAML {
 
-struct Relocation {
+struct LLVM_CLASS_ABI Relocation {
   // Offset in the section to what is being relocated.
   llvm::yaml::Hex32 address;
   // Symbol index if r_extern == 1 else section index.
@@ -43,7 +43,7 @@ struct Relocation {
   int32_t value;
 };
 
-struct Section {
+struct LLVM_CLASS_ABI Section {
   char sectname[16];
   char segname[16];
   llvm::yaml::Hex64 addr;
@@ -60,7 +60,7 @@ struct Section {
   std::vector<Relocation> relocations;
 };
 
-struct FileHeader {
+struct LLVM_CLASS_ABI FileHeader {
   llvm::yaml::Hex32 magic;
   llvm::yaml::Hex32 cputype;
   llvm::yaml::Hex32 cpusubtype;
@@ -71,7 +71,7 @@ struct FileHeader {
   llvm::yaml::Hex32 reserved;
 };
 
-struct LoadCommand {
+struct LLVM_CLASS_ABI LoadCommand {
   virtual ~LoadCommand();
 
   llvm::MachO::macho_load_command Data;
@@ -82,7 +82,7 @@ struct LoadCommand {
   uint64_t ZeroPadBytes;
 };
 
-struct NListEntry {
+struct LLVM_CLASS_ABI NListEntry {
   uint32_t n_strx;
   llvm::yaml::Hex8 n_type;
   uint8_t n_sect;
@@ -90,13 +90,13 @@ struct NListEntry {
   uint64_t n_value;
 };
 
-struct RebaseOpcode {
+struct LLVM_CLASS_ABI RebaseOpcode {
   MachO::RebaseOpcode Opcode;
   uint8_t Imm;
   std::vector<yaml::Hex64> ExtraData;
 };
 
-struct BindOpcode {
+struct LLVM_CLASS_ABI BindOpcode {
   MachO::BindOpcode Opcode;
   uint8_t Imm;
   std::vector<yaml::Hex64> ULEBExtraData;
@@ -104,7 +104,7 @@ struct BindOpcode {
   StringRef Symbol;
 };
 
-struct ExportEntry {
+struct LLVM_CLASS_ABI ExportEntry {
   uint64_t TerminalSize = 0;
   uint64_t NodeOffset = 0;
   std::string Name;
@@ -115,13 +115,13 @@ struct ExportEntry {
   std::vector<MachOYAML::ExportEntry> Children;
 };
 
-struct DataInCodeEntry {
+struct LLVM_CLASS_ABI DataInCodeEntry {
   llvm::yaml::Hex32 Offset;
   uint16_t Length;
   llvm::yaml::Hex16 Kind;
 };
 
-struct LinkEditData {
+struct LLVM_CLASS_ABI LinkEditData {
   std::vector<MachOYAML::RebaseOpcode> RebaseOpcodes;
   std::vector<MachOYAML::BindOpcode> BindOpcodes;
   std::vector<MachOYAML::BindOpcode> WeakBindOpcodes;
@@ -137,7 +137,7 @@ struct LinkEditData {
   bool isEmpty() const;
 };
 
-struct Object {
+struct LLVM_CLASS_ABI Object {
   bool IsLittleEndian;
   FileHeader Header;
   std::vector<LoadCommand> LoadCommands;
@@ -147,12 +147,12 @@ struct Object {
   DWARFYAML::Data DWARF;
 };
 
-struct FatHeader {
+struct LLVM_CLASS_ABI FatHeader {
   llvm::yaml::Hex32 magic;
   uint32_t nfat_arch;
 };
 
-struct FatArch {
+struct LLVM_CLASS_ABI FatArch {
   llvm::yaml::Hex32 cputype;
   llvm::yaml::Hex32 cpusubtype;
   llvm::yaml::Hex64 offset;
@@ -161,7 +161,7 @@ struct FatArch {
   llvm::yaml::Hex32 reserved;
 };
 
-struct UniversalBinary {
+struct LLVM_CLASS_ABI UniversalBinary {
   FatHeader Header;
   std::vector<FatArch> FatArchs;
   std::vector<Object> Slices;
@@ -188,71 +188,71 @@ class raw_ostream;
 
 namespace yaml {
 
-template <> struct MappingTraits<MachOYAML::FileHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::FileHeader> {
   static void mapping(IO &IO, MachOYAML::FileHeader &FileHeader);
 };
 
-template <> struct MappingTraits<MachOYAML::Object> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::Object> {
   static void mapping(IO &IO, MachOYAML::Object &Object);
 };
 
-template <> struct MappingTraits<MachOYAML::FatHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::FatHeader> {
   static void mapping(IO &IO, MachOYAML::FatHeader &FatHeader);
 };
 
-template <> struct MappingTraits<MachOYAML::FatArch> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::FatArch> {
   static void mapping(IO &IO, MachOYAML::FatArch &FatArch);
 };
 
-template <> struct MappingTraits<MachOYAML::UniversalBinary> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::UniversalBinary> {
   static void mapping(IO &IO, MachOYAML::UniversalBinary &UniversalBinary);
 };
 
-template <> struct MappingTraits<MachOYAML::LoadCommand> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::LoadCommand> {
   static void mapping(IO &IO, MachOYAML::LoadCommand &LoadCommand);
 };
 
-template <> struct MappingTraits<MachOYAML::LinkEditData> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::LinkEditData> {
   static void mapping(IO &IO, MachOYAML::LinkEditData &LinkEditData);
 };
 
-template <> struct MappingTraits<MachOYAML::RebaseOpcode> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::RebaseOpcode> {
   static void mapping(IO &IO, MachOYAML::RebaseOpcode &RebaseOpcode);
 };
 
-template <> struct MappingTraits<MachOYAML::BindOpcode> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::BindOpcode> {
   static void mapping(IO &IO, MachOYAML::BindOpcode &BindOpcode);
 };
 
-template <> struct MappingTraits<MachOYAML::ExportEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::ExportEntry> {
   static void mapping(IO &IO, MachOYAML::ExportEntry &ExportEntry);
 };
 
-template <> struct MappingTraits<MachOYAML::Relocation> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::Relocation> {
   static void mapping(IO &IO, MachOYAML::Relocation &R);
 };
 
-template <> struct MappingTraits<MachOYAML::Section> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::Section> {
   static void mapping(IO &IO, MachOYAML::Section &Section);
   static std::string validate(IO &io, MachOYAML::Section &Section);
 };
 
-template <> struct MappingTraits<MachOYAML::NListEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::NListEntry> {
   static void mapping(IO &IO, MachOYAML::NListEntry &NListEntry);
 };
 
-template <> struct MappingTraits<MachO::build_tool_version> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachO::build_tool_version> {
   static void mapping(IO &IO, MachO::build_tool_version &tool);
 };
 
-template <> struct MappingTraits<MachOYAML::DataInCodeEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachOYAML::DataInCodeEntry> {
   static void mapping(IO &IO, MachOYAML::DataInCodeEntry &DataInCodeEntry);
 };
 
 #define HANDLE_LOAD_COMMAND(LCName, LCValue, LCStruct)                         \
   io.enumCase(value, #LCName, MachO::LCName);
 
-template <> struct ScalarEnumerationTraits<MachO::LoadCommandType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<MachO::LoadCommandType> {
   static void enumeration(IO &io, MachO::LoadCommandType &value) {
 #include "llvm/BinaryFormat/MachO.def"
     io.enumFallback<Hex32>(value);
@@ -261,7 +261,7 @@ template <> struct ScalarEnumerationTraits<MachO::LoadCommandType> {
 
 #define ENUM_CASE(Enum) io.enumCase(value, #Enum, MachO::Enum);
 
-template <> struct ScalarEnumerationTraits<MachO::RebaseOpcode> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<MachO::RebaseOpcode> {
   static void enumeration(IO &io, MachO::RebaseOpcode &value) {
     ENUM_CASE(REBASE_OPCODE_DONE)
     ENUM_CASE(REBASE_OPCODE_SET_TYPE_IMM)
@@ -276,7 +276,7 @@ template <> struct ScalarEnumerationTraits<MachO::RebaseOpcode> {
   }
 };
 
-template <> struct ScalarEnumerationTraits<MachO::BindOpcode> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<MachO::BindOpcode> {
   static void enumeration(IO &io, MachO::BindOpcode &value) {
     ENUM_CASE(BIND_OPCODE_DONE)
     ENUM_CASE(BIND_OPCODE_SET_DYLIB_ORDINAL_IMM)
@@ -298,7 +298,7 @@ template <> struct ScalarEnumerationTraits<MachO::BindOpcode> {
 // This trait is used for 16-byte chars in Mach structures used for strings
 using char_16 = char[16];
 
-template <> struct ScalarTraits<char_16> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<char_16> {
   static void output(const char_16 &Val, void *, raw_ostream &Out);
   static StringRef input(StringRef Scalar, void *, char_16 &Val);
   static QuotingType mustQuote(StringRef S);
@@ -308,7 +308,7 @@ template <> struct ScalarTraits<char_16> {
 // formatting style.
 using uuid_t = raw_ostream::uuid_t;
 
-template <> struct ScalarTraits<uuid_t> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<uuid_t> {
   static void output(const uuid_t &Val, void *, raw_ostream &Out);
   static StringRef input(StringRef Scalar, void *, uuid_t &Val);
   static QuotingType mustQuote(StringRef S);
@@ -324,19 +324,19 @@ template <> struct ScalarTraits<uuid_t> {
 #include "llvm/BinaryFormat/MachO.def"
 
 // Extra structures used by load commands
-template <> struct MappingTraits<MachO::dylib> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachO::dylib> {
   static void mapping(IO &IO, MachO::dylib &LoadCommand);
 };
 
-template <> struct MappingTraits<MachO::fvmlib> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachO::fvmlib> {
   static void mapping(IO &IO, MachO::fvmlib &LoadCommand);
 };
 
-template <> struct MappingTraits<MachO::section> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachO::section> {
   static void mapping(IO &IO, MachO::section &LoadCommand);
 };
 
-template <> struct MappingTraits<MachO::section_64> {
+template <> struct LLVM_CLASS_ABI MappingTraits<MachO::section_64> {
   static void mapping(IO &IO, MachO::section_64 &LoadCommand);
 };
 
diff --git a/llvm/include/llvm/ObjectYAML/MinidumpYAML.h b/llvm/include/llvm/ObjectYAML/MinidumpYAML.h
index 0621edecaff6114..15686201d465093 100644
--- a/llvm/include/llvm/ObjectYAML/MinidumpYAML.h
+++ b/llvm/include/llvm/ObjectYAML/MinidumpYAML.h
@@ -25,7 +25,7 @@ namespace MinidumpYAML {
 /// one stream Kind can be used to represent multiple stream Types (e.g. any
 /// unrecognised stream Type will be handled via RawContentStream). The mapping
 /// from Types to Kinds is fixed and given by the static getKind function.
-struct Stream {
+struct LLVM_CLASS_ABI Stream {
   enum class StreamKind {
     Exception,
     MemoryInfoList,
@@ -59,7 +59,7 @@ namespace detail {
 /// A stream representing a list of abstract entries in a minidump stream. Its
 /// instantiations can be used to represent the ModuleList stream and other
 /// streams with a similar structure.
-template <typename EntryT> struct ListStream : public Stream {
+template <typename EntryT> struct LLVM_CLASS_ABI ListStream : public Stream {
   using entry_type = EntryT;
 
   std::vector<entry_type> Entries;
@@ -71,7 +71,7 @@ template <typename EntryT> struct ListStream : public Stream {
 };
 
 /// A structure containing all data belonging to a single minidump module.
-struct ParsedModule {
+struct LLVM_CLASS_ABI ParsedModule {
   static constexpr Stream::StreamKind Kind = Stream::StreamKind::ModuleList;
   static constexpr minidump::StreamType Type = minidump::StreamType::ModuleList;
 
@@ -82,7 +82,7 @@ struct ParsedModule {
 };
 
 /// A structure containing all data belonging to a single minidump thread.
-struct ParsedThread {
+struct LLVM_CLASS_ABI ParsedThread {
   static constexpr Stream::StreamKind Kind = Stream::StreamKind::ThreadList;
   static constexpr minidump::StreamType Type = minidump::StreamType::ThreadList;
 
@@ -92,7 +92,7 @@ struct ParsedThread {
 };
 
 /// A structure containing all data describing a single memory region.
-struct ParsedMemoryDescriptor {
+struct LLVM_CLASS_ABI ParsedMemoryDescriptor {
   static constexpr Stream::StreamKind Kind = Stream::StreamKind::MemoryList;
   static constexpr minidump::StreamType Type = minidump::StreamType::MemoryList;
 
@@ -106,7 +106,7 @@ using ThreadListStream = detail::ListStream<detail::ParsedThread>;
 using MemoryListStream = detail::ListStream<detail::ParsedMemoryDescriptor>;
 
 /// ExceptionStream minidump stream.
-struct ExceptionStream : public Stream {
+struct LLVM_CLASS_ABI ExceptionStream : public Stream {
   minidump::ExceptionStream MDExceptionStream;
   yaml::BinaryRef ThreadContext;
 
@@ -126,7 +126,7 @@ struct ExceptionStream : public Stream {
 
 /// A structure containing the list of MemoryInfo entries comprising a
 /// MemoryInfoList stream.
-struct MemoryInfoListStream : public Stream {
+struct LLVM_CLASS_ABI MemoryInfoListStream : public Stream {
   std::vector<minidump::MemoryInfo> Infos;
 
   MemoryInfoListStream()
@@ -146,7 +146,7 @@ struct MemoryInfoListStream : public Stream {
 
 /// A minidump stream represented as a sequence of hex bytes. This is used as a
 /// fallback when no other stream kind is suitable.
-struct RawContentStream : public Stream {
+struct LLVM_CLASS_ABI RawContentStream : public Stream {
   yaml::BinaryRef Content;
   yaml::Hex32 Size;
 
@@ -160,7 +160,7 @@ struct RawContentStream : public Stream {
 };
 
 /// SystemInfo minidump stream.
-struct SystemInfoStream : public Stream {
+struct LLVM_CLASS_ABI SystemInfoStream : public Stream {
   minidump::SystemInfo Info;
   std::string CSDVersion;
 
@@ -184,7 +184,7 @@ LLVM_YAML_STRONG_TYPEDEF(StringRef, BlockStringRef)
 
 /// A minidump stream containing textual data (typically, the contents of a
 /// /proc/<pid> file on linux).
-struct TextContentStream : public Stream {
+struct LLVM_CLASS_ABI TextContentStream : public Stream {
   BlockStringRef Text;
 
   TextContentStream(minidump::StreamType Type, StringRef Text = {})
@@ -199,7 +199,7 @@ struct TextContentStream : public Stream {
 /// minidump header, and zero or more streams. To construct an Object from a
 /// minidump file, use the static create function. To serialize to/from yaml,
 /// use the appropriate streaming operator on a yaml stream.
-struct Object {
+struct LLVM_CLASS_ABI Object {
   Object() = default;
   Object(const Object &) = delete;
   Object &operator=(const Object &) = delete;
@@ -222,7 +222,7 @@ struct Object {
 } // namespace MinidumpYAML
 
 namespace yaml {
-template <> struct BlockScalarTraits<MinidumpYAML::BlockStringRef> {
+template <> struct LLVM_CLASS_ABI BlockScalarTraits<MinidumpYAML::BlockStringRef> {
   static void output(const MinidumpYAML::BlockStringRef &Text, void *,
                      raw_ostream &OS) {
     OS << Text;
@@ -235,12 +235,12 @@ template <> struct BlockScalarTraits<MinidumpYAML::BlockStringRef> {
   }
 };
 
-template <> struct MappingTraits<std::unique_ptr<MinidumpYAML::Stream>> {
+template <> struct LLVM_CLASS_ABI MappingTraits<std::unique_ptr<MinidumpYAML::Stream>> {
   static void mapping(IO &IO, std::unique_ptr<MinidumpYAML::Stream> &S);
   static std::string validate(IO &IO, std::unique_ptr<MinidumpYAML::Stream> &S);
 };
 
-template <> struct MappingContextTraits<minidump::MemoryDescriptor, BinaryRef> {
+template <> struct LLVM_CLASS_ABI MappingContextTraits<minidump::MemoryDescriptor, BinaryRef> {
   static void mapping(IO &IO, minidump::MemoryDescriptor &Memory,
                       BinaryRef &Content);
 };
diff --git a/llvm/include/llvm/ObjectYAML/ObjectYAML.h b/llvm/include/llvm/ObjectYAML/ObjectYAML.h
index e9fa5a4d3995873..d127add76656793 100644
--- a/llvm/include/llvm/ObjectYAML/ObjectYAML.h
+++ b/llvm/include/llvm/ObjectYAML/ObjectYAML.h
@@ -27,7 +27,7 @@ namespace yaml {
 
 class IO;
 
-struct YamlObjectFile {
+struct LLVM_CLASS_ABI YamlObjectFile {
   std::unique_ptr<ArchYAML::Archive> Arch;
   std::unique_ptr<ELFYAML::Object> Elf;
   std::unique_ptr<COFFYAML::Object> Coff;
@@ -40,7 +40,7 @@ struct YamlObjectFile {
   std::unique_ptr<DXContainerYAML::Object> DXContainer;
 };
 
-template <> struct MappingTraits<YamlObjectFile> {
+template <> struct LLVM_CLASS_ABI MappingTraits<YamlObjectFile> {
   static void mapping(IO &IO, YamlObjectFile &ObjectFile);
 };
 
diff --git a/llvm/include/llvm/ObjectYAML/OffloadYAML.h b/llvm/include/llvm/ObjectYAML/OffloadYAML.h
index 79dee0763c40e05..5300a1a2678b866 100644
--- a/llvm/include/llvm/ObjectYAML/OffloadYAML.h
+++ b/llvm/include/llvm/ObjectYAML/OffloadYAML.h
@@ -25,7 +25,7 @@
 namespace llvm {
 namespace OffloadYAML {
 
-struct Binary {
+struct LLVM_CLASS_ABI Binary {
   struct StringEntry {
     StringRef Key;
     StringRef Value;
@@ -55,23 +55,23 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::OffloadYAML::Binary::StringEntry)
 namespace llvm {
 namespace yaml {
 
-template <> struct ScalarEnumerationTraits<object::ImageKind> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<object::ImageKind> {
   static void enumeration(IO &IO, object::ImageKind &Value);
 };
 
-template <> struct ScalarEnumerationTraits<object::OffloadKind> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<object::OffloadKind> {
   static void enumeration(IO &IO, object::OffloadKind &Value);
 };
 
-template <> struct MappingTraits<OffloadYAML::Binary> {
+template <> struct LLVM_CLASS_ABI MappingTraits<OffloadYAML::Binary> {
   static void mapping(IO &IO, OffloadYAML::Binary &O);
 };
 
-template <> struct MappingTraits<OffloadYAML::Binary::StringEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<OffloadYAML::Binary::StringEntry> {
   static void mapping(IO &IO, OffloadYAML::Binary::StringEntry &M);
 };
 
-template <> struct MappingTraits<OffloadYAML::Binary::Member> {
+template <> struct LLVM_CLASS_ABI MappingTraits<OffloadYAML::Binary::Member> {
   static void mapping(IO &IO, OffloadYAML::Binary::Member &M);
 };
 
diff --git a/llvm/include/llvm/ObjectYAML/WasmYAML.h b/llvm/include/llvm/ObjectYAML/WasmYAML.h
index 666f71c0edfff38..7a43990632a5eb8 100644
--- a/llvm/include/llvm/ObjectYAML/WasmYAML.h
+++ b/llvm/include/llvm/ObjectYAML/WasmYAML.h
@@ -41,29 +41,29 @@ LLVM_YAML_STRONG_TYPEDEF(uint32_t, LimitFlags)
 LLVM_YAML_STRONG_TYPEDEF(uint32_t, ComdatKind)
 LLVM_YAML_STRONG_TYPEDEF(uint32_t, FeaturePolicyPrefix)
 
-struct FileHeader {
+struct LLVM_CLASS_ABI FileHeader {
   yaml::Hex32 Version;
 };
 
-struct Limits {
+struct LLVM_CLASS_ABI Limits {
   LimitFlags Flags;
   yaml::Hex32 Minimum;
   yaml::Hex32 Maximum;
 };
 
-struct Table {
+struct LLVM_CLASS_ABI Table {
   TableType ElemType;
   Limits TableLimits;
   uint32_t Index;
 };
 
-struct Export {
+struct LLVM_CLASS_ABI Export {
   StringRef Name;
   ExportKind Kind;
   uint32_t Index;
 };
 
-struct InitExpr {
+struct LLVM_CLASS_ABI InitExpr {
   InitExpr() {}
   bool Extended;
   union {
@@ -72,7 +72,7 @@ struct InitExpr {
   };
 };
 
-struct ElemSegment {
+struct LLVM_CLASS_ABI ElemSegment {
   uint32_t Flags;
   uint32_t TableNumber;
   ValueType ElemKind;
@@ -80,14 +80,14 @@ struct ElemSegment {
   std::vector<uint32_t> Functions;
 };
 
-struct Global {
+struct LLVM_CLASS_ABI Global {
   uint32_t Index;
   ValueType Type;
   bool Mutable;
   InitExpr Init;
 };
 
-struct Import {
+struct LLVM_CLASS_ABI Import {
   Import() {}
   StringRef Module;
   StringRef Field;
@@ -101,18 +101,18 @@ struct Import {
   };
 };
 
-struct LocalDecl {
+struct LLVM_CLASS_ABI LocalDecl {
   ValueType Type;
   uint32_t Count;
 };
 
-struct Function {
+struct LLVM_CLASS_ABI Function {
   uint32_t Index;
   std::vector<LocalDecl> Locals;
   yaml::BinaryRef Body;
 };
 
-struct Relocation {
+struct LLVM_CLASS_ABI Relocation {
   RelocType Type;
   uint32_t Index;
   // TODO(wvo): this would strictly be better as Hex64, but that will change
@@ -121,7 +121,7 @@ struct Relocation {
   int64_t Addend;
 };
 
-struct DataSegment {
+struct LLVM_CLASS_ABI DataSegment {
   uint32_t SectionOffset;
   uint32_t InitFlags;
   uint32_t MemoryIndex;
@@ -129,36 +129,36 @@ struct DataSegment {
   yaml::BinaryRef Content;
 };
 
-struct NameEntry {
+struct LLVM_CLASS_ABI NameEntry {
   uint32_t Index;
   StringRef Name;
 };
 
-struct ProducerEntry {
+struct LLVM_CLASS_ABI ProducerEntry {
   std::string Name;
   std::string Version;
 };
 
-struct FeatureEntry {
+struct LLVM_CLASS_ABI FeatureEntry {
   FeaturePolicyPrefix Prefix;
   std::string Name;
 };
 
-struct SegmentInfo {
+struct LLVM_CLASS_ABI SegmentInfo {
   uint32_t Index;
   StringRef Name;
   uint32_t Alignment;
   SegmentFlags Flags;
 };
 
-struct Signature {
+struct LLVM_CLASS_ABI Signature {
   uint32_t Index;
   SignatureForm Form = wasm::WASM_TYPE_FUNC;
   std::vector<ValueType> ParamTypes;
   std::vector<ValueType> ReturnTypes;
 };
 
-struct SymbolInfo {
+struct LLVM_CLASS_ABI SymbolInfo {
   uint32_t Index;
   StringRef Name;
   SymbolKind Kind;
@@ -169,22 +169,22 @@ struct SymbolInfo {
   };
 };
 
-struct InitFunction {
+struct LLVM_CLASS_ABI InitFunction {
   uint32_t Priority;
   uint32_t Symbol;
 };
 
-struct ComdatEntry {
+struct LLVM_CLASS_ABI ComdatEntry {
   ComdatKind Kind;
   uint32_t Index;
 };
 
-struct Comdat {
+struct LLVM_CLASS_ABI Comdat {
   StringRef Name;
   std::vector<ComdatEntry> Entries;
 };
 
-struct Section {
+struct LLVM_CLASS_ABI Section {
   explicit Section(SectionType SecType) : Type(SecType) {}
   virtual ~Section();
 
@@ -192,7 +192,7 @@ struct Section {
   std::vector<Relocation> Relocations;
 };
 
-struct CustomSection : Section {
+struct LLVM_CLASS_ABI CustomSection : Section {
   explicit CustomSection(StringRef Name)
       : Section(wasm::WASM_SEC_CUSTOM), Name(Name) {}
 
@@ -204,18 +204,18 @@ struct CustomSection : Section {
   yaml::BinaryRef Payload;
 };
 
-struct DylinkImportInfo {
+struct LLVM_CLASS_ABI DylinkImportInfo {
   StringRef Module;
   StringRef Field;
   SymbolFlags Flags;
 };
 
-struct DylinkExportInfo {
+struct LLVM_CLASS_ABI DylinkExportInfo {
   StringRef Name;
   SymbolFlags Flags;
 };
 
-struct DylinkSection : CustomSection {
+struct LLVM_CLASS_ABI DylinkSection : CustomSection {
   DylinkSection() : CustomSection("dylink.0") {}
 
   static bool classof(const Section *S) {
@@ -232,7 +232,7 @@ struct DylinkSection : CustomSection {
   std::vector<DylinkExportInfo> ExportInfo;
 };
 
-struct NameSection : CustomSection {
+struct LLVM_CLASS_ABI NameSection : CustomSection {
   NameSection() : CustomSection("name") {}
 
   static bool classof(const Section *S) {
@@ -245,7 +245,7 @@ struct NameSection : CustomSection {
   std::vector<NameEntry> DataSegmentNames;
 };
 
-struct LinkingSection : CustomSection {
+struct LLVM_CLASS_ABI LinkingSection : CustomSection {
   LinkingSection() : CustomSection("linking") {}
 
   static bool classof(const Section *S) {
@@ -260,7 +260,7 @@ struct LinkingSection : CustomSection {
   std::vector<Comdat> Comdats;
 };
 
-struct ProducersSection : CustomSection {
+struct LLVM_CLASS_ABI ProducersSection : CustomSection {
   ProducersSection() : CustomSection("producers") {}
 
   static bool classof(const Section *S) {
@@ -273,7 +273,7 @@ struct ProducersSection : CustomSection {
   std::vector<ProducerEntry> SDKs;
 };
 
-struct TargetFeaturesSection : CustomSection {
+struct LLVM_CLASS_ABI TargetFeaturesSection : CustomSection {
   TargetFeaturesSection() : CustomSection("target_features") {}
 
   static bool classof(const Section *S) {
@@ -284,7 +284,7 @@ struct TargetFeaturesSection : CustomSection {
   std::vector<FeatureEntry> Features;
 };
 
-struct TypeSection : Section {
+struct LLVM_CLASS_ABI TypeSection : Section {
   TypeSection() : Section(wasm::WASM_SEC_TYPE) {}
 
   static bool classof(const Section *S) {
@@ -294,7 +294,7 @@ struct TypeSection : Section {
   std::vector<Signature> Signatures;
 };
 
-struct ImportSection : Section {
+struct LLVM_CLASS_ABI ImportSection : Section {
   ImportSection() : Section(wasm::WASM_SEC_IMPORT) {}
 
   static bool classof(const Section *S) {
@@ -304,7 +304,7 @@ struct ImportSection : Section {
   std::vector<Import> Imports;
 };
 
-struct FunctionSection : Section {
+struct LLVM_CLASS_ABI FunctionSection : Section {
   FunctionSection() : Section(wasm::WASM_SEC_FUNCTION) {}
 
   static bool classof(const Section *S) {
@@ -314,7 +314,7 @@ struct FunctionSection : Section {
   std::vector<uint32_t> FunctionTypes;
 };
 
-struct TableSection : Section {
+struct LLVM_CLASS_ABI TableSection : Section {
   TableSection() : Section(wasm::WASM_SEC_TABLE) {}
 
   static bool classof(const Section *S) {
@@ -324,7 +324,7 @@ struct TableSection : Section {
   std::vector<Table> Tables;
 };
 
-struct MemorySection : Section {
+struct LLVM_CLASS_ABI MemorySection : Section {
   MemorySection() : Section(wasm::WASM_SEC_MEMORY) {}
 
   static bool classof(const Section *S) {
@@ -334,7 +334,7 @@ struct MemorySection : Section {
   std::vector<Limits> Memories;
 };
 
-struct TagSection : Section {
+struct LLVM_CLASS_ABI TagSection : Section {
   TagSection() : Section(wasm::WASM_SEC_TAG) {}
 
   static bool classof(const Section *S) {
@@ -344,7 +344,7 @@ struct TagSection : Section {
   std::vector<uint32_t> TagTypes;
 };
 
-struct GlobalSection : Section {
+struct LLVM_CLASS_ABI GlobalSection : Section {
   GlobalSection() : Section(wasm::WASM_SEC_GLOBAL) {}
 
   static bool classof(const Section *S) {
@@ -354,7 +354,7 @@ struct GlobalSection : Section {
   std::vector<Global> Globals;
 };
 
-struct ExportSection : Section {
+struct LLVM_CLASS_ABI ExportSection : Section {
   ExportSection() : Section(wasm::WASM_SEC_EXPORT) {}
 
   static bool classof(const Section *S) {
@@ -364,7 +364,7 @@ struct ExportSection : Section {
   std::vector<Export> Exports;
 };
 
-struct StartSection : Section {
+struct LLVM_CLASS_ABI StartSection : Section {
   StartSection() : Section(wasm::WASM_SEC_START) {}
 
   static bool classof(const Section *S) {
@@ -374,7 +374,7 @@ struct StartSection : Section {
   uint32_t StartFunction;
 };
 
-struct ElemSection : Section {
+struct LLVM_CLASS_ABI ElemSection : Section {
   ElemSection() : Section(wasm::WASM_SEC_ELEM) {}
 
   static bool classof(const Section *S) {
@@ -384,7 +384,7 @@ struct ElemSection : Section {
   std::vector<ElemSegment> Segments;
 };
 
-struct CodeSection : Section {
+struct LLVM_CLASS_ABI CodeSection : Section {
   CodeSection() : Section(wasm::WASM_SEC_CODE) {}
 
   static bool classof(const Section *S) {
@@ -394,7 +394,7 @@ struct CodeSection : Section {
   std::vector<Function> Functions;
 };
 
-struct DataSection : Section {
+struct LLVM_CLASS_ABI DataSection : Section {
   DataSection() : Section(wasm::WASM_SEC_DATA) {}
 
   static bool classof(const Section *S) {
@@ -404,7 +404,7 @@ struct DataSection : Section {
   std::vector<DataSegment> Segments;
 };
 
-struct DataCountSection : Section {
+struct LLVM_CLASS_ABI DataCountSection : Section {
   DataCountSection() : Section(wasm::WASM_SEC_DATACOUNT) {}
 
   static bool classof(const Section *S) {
@@ -414,7 +414,7 @@ struct DataCountSection : Section {
   uint32_t Count;
 };
 
-struct Object {
+struct LLVM_CLASS_ABI Object {
   FileHeader Header;
   std::vector<std::unique_ptr<Section>> Sections;
 };
@@ -449,151 +449,151 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::DylinkExportInfo)
 namespace llvm {
 namespace yaml {
 
-template <> struct MappingTraits<WasmYAML::FileHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::FileHeader> {
   static void mapping(IO &IO, WasmYAML::FileHeader &FileHdr);
 };
 
-template <> struct MappingTraits<std::unique_ptr<WasmYAML::Section>> {
+template <> struct LLVM_CLASS_ABI MappingTraits<std::unique_ptr<WasmYAML::Section>> {
   static void mapping(IO &IO, std::unique_ptr<WasmYAML::Section> &Section);
 };
 
-template <> struct MappingTraits<WasmYAML::Object> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Object> {
   static void mapping(IO &IO, WasmYAML::Object &Object);
 };
 
-template <> struct MappingTraits<WasmYAML::Import> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Import> {
   static void mapping(IO &IO, WasmYAML::Import &Import);
 };
 
-template <> struct MappingTraits<WasmYAML::Export> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Export> {
   static void mapping(IO &IO, WasmYAML::Export &Export);
 };
 
-template <> struct MappingTraits<WasmYAML::Global> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Global> {
   static void mapping(IO &IO, WasmYAML::Global &Global);
 };
 
-template <> struct ScalarBitSetTraits<WasmYAML::LimitFlags> {
+template <> struct LLVM_CLASS_ABI ScalarBitSetTraits<WasmYAML::LimitFlags> {
   static void bitset(IO &IO, WasmYAML::LimitFlags &Value);
 };
 
-template <> struct ScalarBitSetTraits<WasmYAML::SymbolFlags> {
+template <> struct LLVM_CLASS_ABI ScalarBitSetTraits<WasmYAML::SymbolFlags> {
   static void bitset(IO &IO, WasmYAML::SymbolFlags &Value);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::SymbolKind> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::SymbolKind> {
   static void enumeration(IO &IO, WasmYAML::SymbolKind &Kind);
 };
 
-template <> struct ScalarBitSetTraits<WasmYAML::SegmentFlags> {
+template <> struct LLVM_CLASS_ABI ScalarBitSetTraits<WasmYAML::SegmentFlags> {
   static void bitset(IO &IO, WasmYAML::SegmentFlags &Value);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::SectionType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::SectionType> {
   static void enumeration(IO &IO, WasmYAML::SectionType &Type);
 };
 
-template <> struct MappingTraits<WasmYAML::Signature> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Signature> {
   static void mapping(IO &IO, WasmYAML::Signature &Signature);
 };
 
-template <> struct MappingTraits<WasmYAML::Table> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Table> {
   static void mapping(IO &IO, WasmYAML::Table &Table);
 };
 
-template <> struct MappingTraits<WasmYAML::Limits> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Limits> {
   static void mapping(IO &IO, WasmYAML::Limits &Limits);
 };
 
-template <> struct MappingTraits<WasmYAML::Function> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Function> {
   static void mapping(IO &IO, WasmYAML::Function &Function);
 };
 
-template <> struct MappingTraits<WasmYAML::Relocation> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Relocation> {
   static void mapping(IO &IO, WasmYAML::Relocation &Relocation);
 };
 
-template <> struct MappingTraits<WasmYAML::NameEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::NameEntry> {
   static void mapping(IO &IO, WasmYAML::NameEntry &NameEntry);
 };
 
-template <> struct MappingTraits<WasmYAML::ProducerEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::ProducerEntry> {
   static void mapping(IO &IO, WasmYAML::ProducerEntry &ProducerEntry);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::FeaturePolicyPrefix> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::FeaturePolicyPrefix> {
   static void enumeration(IO &IO, WasmYAML::FeaturePolicyPrefix &Prefix);
 };
 
-template <> struct MappingTraits<WasmYAML::FeatureEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::FeatureEntry> {
   static void mapping(IO &IO, WasmYAML::FeatureEntry &FeatureEntry);
 };
 
-template <> struct MappingTraits<WasmYAML::SegmentInfo> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::SegmentInfo> {
   static void mapping(IO &IO, WasmYAML::SegmentInfo &SegmentInfo);
 };
 
-template <> struct MappingTraits<WasmYAML::LocalDecl> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::LocalDecl> {
   static void mapping(IO &IO, WasmYAML::LocalDecl &LocalDecl);
 };
 
-template <> struct MappingTraits<WasmYAML::InitExpr> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::InitExpr> {
   static void mapping(IO &IO, WasmYAML::InitExpr &Expr);
 };
 
-template <> struct MappingTraits<WasmYAML::DataSegment> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::DataSegment> {
   static void mapping(IO &IO, WasmYAML::DataSegment &Segment);
 };
 
-template <> struct MappingTraits<WasmYAML::ElemSegment> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::ElemSegment> {
   static void mapping(IO &IO, WasmYAML::ElemSegment &Segment);
 };
 
-template <> struct MappingTraits<WasmYAML::SymbolInfo> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::SymbolInfo> {
   static void mapping(IO &IO, WasmYAML::SymbolInfo &Info);
 };
 
-template <> struct MappingTraits<WasmYAML::InitFunction> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::InitFunction> {
   static void mapping(IO &IO, WasmYAML::InitFunction &Init);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::ComdatKind> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::ComdatKind> {
   static void enumeration(IO &IO, WasmYAML::ComdatKind &Kind);
 };
 
-template <> struct MappingTraits<WasmYAML::ComdatEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::ComdatEntry> {
   static void mapping(IO &IO, WasmYAML::ComdatEntry &ComdatEntry);
 };
 
-template <> struct MappingTraits<WasmYAML::Comdat> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::Comdat> {
   static void mapping(IO &IO, WasmYAML::Comdat &Comdat);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::ValueType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::ValueType> {
   static void enumeration(IO &IO, WasmYAML::ValueType &Type);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::ExportKind> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::ExportKind> {
   static void enumeration(IO &IO, WasmYAML::ExportKind &Kind);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::TableType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::TableType> {
   static void enumeration(IO &IO, WasmYAML::TableType &Type);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::Opcode> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::Opcode> {
   static void enumeration(IO &IO, WasmYAML::Opcode &Opcode);
 };
 
-template <> struct ScalarEnumerationTraits<WasmYAML::RelocType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<WasmYAML::RelocType> {
   static void enumeration(IO &IO, WasmYAML::RelocType &Kind);
 };
 
-template <> struct MappingTraits<WasmYAML::DylinkImportInfo> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::DylinkImportInfo> {
   static void mapping(IO &IO, WasmYAML::DylinkImportInfo &Info);
 };
 
-template <> struct MappingTraits<WasmYAML::DylinkExportInfo> {
+template <> struct LLVM_CLASS_ABI MappingTraits<WasmYAML::DylinkExportInfo> {
   static void mapping(IO &IO, WasmYAML::DylinkExportInfo &Info);
 };
 
diff --git a/llvm/include/llvm/ObjectYAML/XCOFFYAML.h b/llvm/include/llvm/ObjectYAML/XCOFFYAML.h
index 0ba0fb3a19223fc..7129306729ef3bc 100644
--- a/llvm/include/llvm/ObjectYAML/XCOFFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/XCOFFYAML.h
@@ -21,7 +21,7 @@
 namespace llvm {
 namespace XCOFFYAML {
 
-struct FileHeader {
+struct LLVM_CLASS_ABI FileHeader {
   llvm::yaml::Hex16 Magic;
   uint16_t NumberOfSections;
   int32_t TimeStamp;
@@ -31,7 +31,7 @@ struct FileHeader {
   llvm::yaml::Hex16 Flags;
 };
 
-struct AuxiliaryHeader {
+struct LLVM_CLASS_ABI AuxiliaryHeader {
   std::optional<llvm::yaml::Hex16> Magic;
   std::optional<llvm::yaml::Hex16> Version;
   std::optional<llvm::yaml::Hex64> TextStartAddr;
@@ -63,14 +63,14 @@ struct AuxiliaryHeader {
   std::optional<llvm::yaml::Hex16> Flag;
 };
 
-struct Relocation {
+struct LLVM_CLASS_ABI Relocation {
   llvm::yaml::Hex64 VirtualAddress;
   llvm::yaml::Hex64 SymbolIndex;
   llvm::yaml::Hex8 Info;
   llvm::yaml::Hex8 Type;
 };
 
-struct Section {
+struct LLVM_CLASS_ABI Section {
   StringRef SectionName;
   llvm::yaml::Hex64 Address;
   llvm::yaml::Hex64 Size;
@@ -94,14 +94,14 @@ enum AuxSymbolType : uint8_t {
   AUX_STAT = 249
 };
 
-struct AuxSymbolEnt {
+struct LLVM_CLASS_ABI AuxSymbolEnt {
   AuxSymbolType Type;
 
   explicit AuxSymbolEnt(AuxSymbolType T) : Type(T) {}
   virtual ~AuxSymbolEnt();
 };
 
-struct FileAuxEnt : AuxSymbolEnt {
+struct LLVM_CLASS_ABI FileAuxEnt : AuxSymbolEnt {
   std::optional<StringRef> FileNameOrString;
   std::optional<XCOFF::CFileStringType> FileStringType;
 
@@ -111,7 +111,7 @@ struct FileAuxEnt : AuxSymbolEnt {
   }
 };
 
-struct CsectAuxEnt : AuxSymbolEnt {
+struct LLVM_CLASS_ABI CsectAuxEnt : AuxSymbolEnt {
   // Only for XCOFF32.
   std::optional<uint32_t> SectionOrLength;
   std::optional<uint32_t> StabInfoIndex;
@@ -131,7 +131,7 @@ struct CsectAuxEnt : AuxSymbolEnt {
   }
 };
 
-struct FunctionAuxEnt : AuxSymbolEnt {
+struct LLVM_CLASS_ABI FunctionAuxEnt : AuxSymbolEnt {
   std::optional<uint32_t> OffsetToExceptionTbl; // Only for XCOFF32.
   std::optional<uint64_t> PtrToLineNum;
   std::optional<uint32_t> SizeOfFunction;
@@ -143,7 +143,7 @@ struct FunctionAuxEnt : AuxSymbolEnt {
   }
 };
 
-struct ExcpetionAuxEnt : AuxSymbolEnt {
+struct LLVM_CLASS_ABI ExcpetionAuxEnt : AuxSymbolEnt {
   std::optional<uint64_t> OffsetToExceptionTbl;
   std::optional<uint32_t> SizeOfFunction;
   std::optional<int32_t> SymIdxOfNextBeyond;
@@ -154,7 +154,7 @@ struct ExcpetionAuxEnt : AuxSymbolEnt {
   }
 }; // Only for XCOFF64.
 
-struct BlockAuxEnt : AuxSymbolEnt {
+struct LLVM_CLASS_ABI BlockAuxEnt : AuxSymbolEnt {
   // Only for XCOFF32.
   std::optional<uint16_t> LineNumHi;
   std::optional<uint16_t> LineNumLo;
@@ -167,7 +167,7 @@ struct BlockAuxEnt : AuxSymbolEnt {
   }
 };
 
-struct SectAuxEntForDWARF : AuxSymbolEnt {
+struct LLVM_CLASS_ABI SectAuxEntForDWARF : AuxSymbolEnt {
   std::optional<uint32_t> LengthOfSectionPortion;
   std::optional<uint32_t> NumberOfRelocEnt;
 
@@ -177,7 +177,7 @@ struct SectAuxEntForDWARF : AuxSymbolEnt {
   }
 };
 
-struct SectAuxEntForStat : AuxSymbolEnt {
+struct LLVM_CLASS_ABI SectAuxEntForStat : AuxSymbolEnt {
   std::optional<uint32_t> SectionLength;
   std::optional<uint16_t> NumberOfRelocEnt;
   std::optional<uint16_t> NumberOfLineNum;
@@ -188,7 +188,7 @@ struct SectAuxEntForStat : AuxSymbolEnt {
   }
 }; // Only for XCOFF32.
 
-struct Symbol {
+struct LLVM_CLASS_ABI Symbol {
   StringRef SymbolName;
   llvm::yaml::Hex64 Value; // Symbol value; storage class-dependent.
   std::optional<StringRef> SectionName;
@@ -199,7 +199,7 @@ struct Symbol {
   std::vector<std::unique_ptr<AuxSymbolEnt>> AuxEntries;
 };
 
-struct StringTable {
+struct LLVM_CLASS_ABI StringTable {
   std::optional<uint32_t> ContentSize; // The total size of the string table.
   std::optional<uint32_t> Length; // The value of the length field for the first
                                   // 4 bytes of the table.
@@ -207,7 +207,7 @@ struct StringTable {
   std::optional<yaml::BinaryRef> RawContent;
 };
 
-struct Object {
+struct LLVM_CLASS_ABI Object {
   FileHeader Header;
   std::optional<AuxiliaryHeader> AuxHeader;
   std::vector<Section> Sections;
@@ -226,55 +226,55 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(std::unique_ptr<llvm::XCOFFYAML::AuxSymbolEnt>)
 namespace llvm {
 namespace yaml {
 
-template <> struct ScalarBitSetTraits<XCOFF::SectionTypeFlags> {
+template <> struct LLVM_CLASS_ABI ScalarBitSetTraits<XCOFF::SectionTypeFlags> {
   static void bitset(IO &IO, XCOFF::SectionTypeFlags &Value);
 };
 
-template <> struct ScalarEnumerationTraits<XCOFF::StorageClass> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<XCOFF::StorageClass> {
   static void enumeration(IO &IO, XCOFF::StorageClass &Value);
 };
 
-template <> struct ScalarEnumerationTraits<XCOFF::StorageMappingClass> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<XCOFF::StorageMappingClass> {
   static void enumeration(IO &IO, XCOFF::StorageMappingClass &Value);
 };
 
-template <> struct ScalarEnumerationTraits<XCOFF::CFileStringType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<XCOFF::CFileStringType> {
   static void enumeration(IO &IO, XCOFF::CFileStringType &Type);
 };
 
-template <> struct ScalarEnumerationTraits<XCOFFYAML::AuxSymbolType> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<XCOFFYAML::AuxSymbolType> {
   static void enumeration(IO &IO, XCOFFYAML::AuxSymbolType &Type);
 };
 
-template <> struct MappingTraits<XCOFFYAML::FileHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<XCOFFYAML::FileHeader> {
   static void mapping(IO &IO, XCOFFYAML::FileHeader &H);
 };
 
-template <> struct MappingTraits<XCOFFYAML::AuxiliaryHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<XCOFFYAML::AuxiliaryHeader> {
   static void mapping(IO &IO, XCOFFYAML::AuxiliaryHeader &AuxHdr);
 };
 
-template <> struct MappingTraits<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>> {
+template <> struct LLVM_CLASS_ABI MappingTraits<std::unique_ptr<XCOFFYAML::AuxSymbolEnt>> {
   static void mapping(IO &IO, std::unique_ptr<XCOFFYAML::AuxSymbolEnt> &AuxSym);
 };
 
-template <> struct MappingTraits<XCOFFYAML::Symbol> {
+template <> struct LLVM_CLASS_ABI MappingTraits<XCOFFYAML::Symbol> {
   static void mapping(IO &IO, XCOFFYAML::Symbol &S);
 };
 
-template <> struct MappingTraits<XCOFFYAML::Relocation> {
+template <> struct LLVM_CLASS_ABI MappingTraits<XCOFFYAML::Relocation> {
   static void mapping(IO &IO, XCOFFYAML::Relocation &R);
 };
 
-template <> struct MappingTraits<XCOFFYAML::Section> {
+template <> struct LLVM_CLASS_ABI MappingTraits<XCOFFYAML::Section> {
   static void mapping(IO &IO, XCOFFYAML::Section &Sec);
 };
 
-template <> struct MappingTraits<XCOFFYAML::StringTable> {
+template <> struct LLVM_CLASS_ABI MappingTraits<XCOFFYAML::StringTable> {
   static void mapping(IO &IO, XCOFFYAML::StringTable &Str);
 };
 
-template <> struct MappingTraits<XCOFFYAML::Object> {
+template <> struct LLVM_CLASS_ABI MappingTraits<XCOFFYAML::Object> {
   static void mapping(IO &IO, XCOFFYAML::Object &Obj);
 };
 
diff --git a/llvm/include/llvm/ObjectYAML/YAML.h b/llvm/include/llvm/ObjectYAML/YAML.h
index 4b3afabd7edf013..58571b8036bcd52 100644
--- a/llvm/include/llvm/ObjectYAML/YAML.h
+++ b/llvm/include/llvm/ObjectYAML/YAML.h
@@ -61,8 +61,8 @@ namespace yaml {
 /// } // end namespace yaml
 /// } // end namespace llvm
 /// \endcode
-class BinaryRef {
-  friend bool operator==(const BinaryRef &LHS, const BinaryRef &RHS);
+class LLVM_CLASS_ABI BinaryRef {
+  friend LLVM_FUNC_ABI bool operator==(const BinaryRef &LHS, const BinaryRef &RHS);
 
   /// Either raw binary data, or a string of hex bytes (must always
   /// be an even number of characters).
@@ -104,7 +104,7 @@ inline bool operator==(const BinaryRef &LHS, const BinaryRef &RHS) {
   return LHS.DataIsHexString == RHS.DataIsHexString && LHS.Data == RHS.Data;
 }
 
-template <> struct ScalarTraits<BinaryRef> {
+template <> struct LLVM_CLASS_ABI ScalarTraits<BinaryRef> {
   static void output(const BinaryRef &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, BinaryRef &);
   static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
diff --git a/llvm/include/llvm/ObjectYAML/yaml2obj.h b/llvm/include/llvm/ObjectYAML/yaml2obj.h
index 3aabd748bfb55c6..a6763d45a3d2fd4 100644
--- a/llvm/include/llvm/ObjectYAML/yaml2obj.h
+++ b/llvm/include/llvm/ObjectYAML/yaml2obj.h
@@ -63,24 +63,24 @@ struct YamlObjectFile;
 
 using ErrorHandler = llvm::function_ref<void(const Twine &Msg)>;
 
-bool yaml2archive(ArchYAML::Archive &Doc, raw_ostream &Out, ErrorHandler EH);
-bool yaml2coff(COFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
-bool yaml2elf(ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH,
+LLVM_FUNC_ABI bool yaml2archive(ArchYAML::Archive &Doc, raw_ostream &Out, ErrorHandler EH);
+LLVM_FUNC_ABI bool yaml2coff(COFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
+LLVM_FUNC_ABI bool yaml2elf(ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH,
               uint64_t MaxSize);
-bool yaml2macho(YamlObjectFile &Doc, raw_ostream &Out, ErrorHandler EH);
-bool yaml2minidump(MinidumpYAML::Object &Doc, raw_ostream &Out,
+LLVM_FUNC_ABI bool yaml2macho(YamlObjectFile &Doc, raw_ostream &Out, ErrorHandler EH);
+LLVM_FUNC_ABI bool yaml2minidump(MinidumpYAML::Object &Doc, raw_ostream &Out,
                    ErrorHandler EH);
-bool yaml2offload(OffloadYAML::Binary &Doc, raw_ostream &Out, ErrorHandler EH);
-bool yaml2wasm(WasmYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
-bool yaml2xcoff(XCOFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
-bool yaml2dxcontainer(DXContainerYAML::Object &Doc, raw_ostream &Out,
+LLVM_FUNC_ABI bool yaml2offload(OffloadYAML::Binary &Doc, raw_ostream &Out, ErrorHandler EH);
+LLVM_FUNC_ABI bool yaml2wasm(WasmYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
+LLVM_FUNC_ABI bool yaml2xcoff(XCOFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH);
+LLVM_FUNC_ABI bool yaml2dxcontainer(DXContainerYAML::Object &Doc, raw_ostream &Out,
                       ErrorHandler EH);
 
-bool convertYAML(Input &YIn, raw_ostream &Out, ErrorHandler ErrHandler,
+LLVM_FUNC_ABI bool convertYAML(Input &YIn, raw_ostream &Out, ErrorHandler ErrHandler,
                  unsigned DocNum = 1, uint64_t MaxSize = UINT64_MAX);
 
 /// Convenience function for tests.
-std::unique_ptr<object::ObjectFile>
+LLVM_FUNC_ABI std::unique_ptr<object::ObjectFile>
 yaml2ObjectFile(SmallVectorImpl<char> &Storage, StringRef Yaml,
                 ErrorHandler ErrHandler);
 
diff --git a/llvm/include/llvm/Option/Arg.h b/llvm/include/llvm/Option/Arg.h
index b9f52ed23a2482b..ef91e0a4d835d34 100644
--- a/llvm/include/llvm/Option/Arg.h
+++ b/llvm/include/llvm/Option/Arg.h
@@ -32,7 +32,7 @@ class ArgList;
 ///
 /// The Arg class encodes just enough information to be able to
 /// derive the argument values efficiently.
-class Arg {
+class LLVM_CLASS_ABI Arg {
 private:
   /// The option this argument is an instance of.
   const Option Opt;
diff --git a/llvm/include/llvm/Option/ArgList.h b/llvm/include/llvm/Option/ArgList.h
index a8b8b103dec08d5..0836cffcece554a 100644
--- a/llvm/include/llvm/Option/ArgList.h
+++ b/llvm/include/llvm/Option/ArgList.h
@@ -38,7 +38,7 @@ namespace opt {
 
 /// arg_iterator - Iterates through arguments stored inside an ArgList.
 template<typename BaseIter, unsigned NumOptSpecifiers = 0>
-class arg_iterator {
+class LLVM_CLASS_ABI arg_iterator {
   /// The current argument and the end of the sequence we're iterating.
   BaseIter Current, End;
 
@@ -114,7 +114,7 @@ class arg_iterator {
 /// auxiliary data and convenience methods to allow Tools to quickly
 /// check for the presence of Arg instances for a particular Option
 /// and to iterate over groups of arguments.
-class ArgList {
+class LLVM_CLASS_ABI ArgList {
 public:
   using arglist_type = SmallVector<Arg *, 16>;
   using iterator = arg_iterator<arglist_type::iterator>;
@@ -387,7 +387,7 @@ class ArgList {
   /// @}
 };
 
-class InputArgList final : public ArgList {
+class LLVM_CLASS_ABI InputArgList final : public ArgList {
 private:
   /// List of argument strings used by the contained Args.
   ///
@@ -458,7 +458,7 @@ class InputArgList final : public ArgList {
 
 /// DerivedArgList - An ordered collection of driver arguments,
 /// whose storage may be in another argument list.
-class DerivedArgList final : public ArgList {
+class LLVM_CLASS_ABI DerivedArgList final : public ArgList {
   const InputArgList &BaseArgs;
 
   /// The list of arguments we synthesized.
diff --git a/llvm/include/llvm/Option/OptSpecifier.h b/llvm/include/llvm/Option/OptSpecifier.h
index 8bcb02298e99a98..c71015c31496df6 100644
--- a/llvm/include/llvm/Option/OptSpecifier.h
+++ b/llvm/include/llvm/Option/OptSpecifier.h
@@ -17,7 +17,7 @@ namespace opt {
 class Option;
 
 /// OptSpecifier - Wrapper class for abstracting references to option IDs.
-class OptSpecifier {
+class LLVM_CLASS_ABI OptSpecifier {
   unsigned ID = 0;
 
 public:
diff --git a/llvm/include/llvm/Option/OptTable.h b/llvm/include/llvm/Option/OptTable.h
index 90613e42cff2ec3..593d95ca28f72b6 100644
--- a/llvm/include/llvm/Option/OptTable.h
+++ b/llvm/include/llvm/Option/OptTable.h
@@ -38,7 +38,7 @@ class Option;
 /// be needed at runtime; the OptTable class maintains enough information to
 /// parse command lines without instantiating Options, while letting other
 /// parts of the driver still use Option instances where convenient.
-class OptTable {
+class LLVM_CLASS_ABI OptTable {
 public:
   /// Entry for a single option instance in the option data table.
   struct Info {
@@ -270,7 +270,7 @@ class OptTable {
 };
 
 /// Specialization of OptTable
-class GenericOptTable : public OptTable {
+class LLVM_CLASS_ABI GenericOptTable : public OptTable {
   SmallVector<StringLiteral> PrefixesUnionBuffer;
 
 protected:
@@ -280,7 +280,7 @@ class GenericOptTable : public OptTable {
   }
 };
 
-class PrecomputedOptTable : public OptTable {
+class LLVM_CLASS_ABI PrecomputedOptTable : public OptTable {
   ArrayRef<StringLiteral> PrefixesUnion;
 
 protected:
diff --git a/llvm/include/llvm/Option/Option.h b/llvm/include/llvm/Option/Option.h
index ebc02dda55cd194..231d3fbaa5ecd78 100644
--- a/llvm/include/llvm/Option/Option.h
+++ b/llvm/include/llvm/Option/Option.h
@@ -49,7 +49,7 @@ enum DriverFlag {
 /// flags. At runtime the driver parses the command line into
 /// concrete Arg instances, each of which corresponds to a
 /// particular Option instance.
-class Option {
+class LLVM_CLASS_ABI Option {
 public:
   enum OptionClass {
     GroupClass = 0,
diff --git a/llvm/include/llvm/Pass.h b/llvm/include/llvm/Pass.h
index 71ac3e1c864b78e..5f48270f0f9befb 100644
--- a/llvm/include/llvm/Pass.h
+++ b/llvm/include/llvm/Pass.h
@@ -92,7 +92,7 @@ enum class ThinOrFullLTOPhase {
 /// interprocedural optimization or you do not fit into any of the more
 /// constrained passes described below.
 ///
-class Pass {
+class LLVM_CLASS_ABI Pass {
   AnalysisResolver *Resolver = nullptr;  // Used to resolve analysis
   const void *PassID;
   PassKind Kind;
@@ -249,7 +249,7 @@ class Pass {
 /// interprocedural optimizations and analyses.  ModulePasses may do anything
 /// they want to the program.
 ///
-class ModulePass : public Pass {
+class LLVM_CLASS_ABI ModulePass : public Pass {
 public:
   explicit ModulePass(char &pid) : Pass(PT_Module, pid) {}
 
@@ -280,7 +280,7 @@ class ModulePass : public Pass {
 /// not need to be run.  This is useful for things like target information and
 /// "basic" versions of AnalysisGroups.
 ///
-class ImmutablePass : public ModulePass {
+class LLVM_CLASS_ABI ImmutablePass : public ModulePass {
 public:
   explicit ImmutablePass(char &pid) : ModulePass(pid) {}
 
@@ -309,7 +309,7 @@ class ImmutablePass : public ModulePass {
 ///  2. Optimizing a function does not cause the addition or removal of any
 ///     functions in the module
 ///
-class FunctionPass : public Pass {
+class LLVM_CLASS_ABI FunctionPass : public Pass {
 public:
   explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {}
 
@@ -336,13 +336,13 @@ class FunctionPass : public Pass {
 /// If the user specifies the -time-passes argument on an LLVM tool command line
 /// then the value of this boolean will be true, otherwise false.
 /// This is the storage for the -time-passes option.
-extern bool TimePassesIsEnabled;
+LLVM_FUNC_ABI extern bool TimePassesIsEnabled;
 /// If TimePassesPerRun is true, there would be one line of report for
 /// each pass invocation.
 /// If TimePassesPerRun is false, there would be only one line of
 /// report for each pass (even there are more than one pass objects).
 /// (For new pass manager only)
-extern bool TimePassesPerRun;
+LLVM_FUNC_ABI extern bool TimePassesPerRun;
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/PassAnalysisSupport.h b/llvm/include/llvm/PassAnalysisSupport.h
index cdf2bcd6f389de0..1646de38b4327ee 100644
--- a/llvm/include/llvm/PassAnalysisSupport.h
+++ b/llvm/include/llvm/PassAnalysisSupport.h
@@ -45,7 +45,7 @@ class StringRef;
 /// of these analyses).  This information is provided by a pass to the Pass
 /// infrastructure through the getAnalysisUsage virtual function.
 ///
-class AnalysisUsage {
+class LLVM_CLASS_ABI AnalysisUsage {
 public:
   using VectorType = SmallVectorImpl<AnalysisID>;
 
@@ -155,7 +155,7 @@ class AnalysisUsage {
 /// analysis information out of pass manager that is responsible to manage
 /// the pass.
 ///
-class AnalysisResolver {
+class LLVM_CLASS_ABI AnalysisResolver {
 public:
   AnalysisResolver() = delete;
   explicit AnalysisResolver(PMDataManager &P) : PM(P) {}
diff --git a/llvm/include/llvm/PassInfo.h b/llvm/include/llvm/PassInfo.h
index 4ecd5d9f05481e8..4745bcbf4880acc 100644
--- a/llvm/include/llvm/PassInfo.h
+++ b/llvm/include/llvm/PassInfo.h
@@ -28,7 +28,7 @@ class Pass;
 /// getPassInfo() method.  These objects are set up by the RegisterPass<>
 /// template.
 ///
-class PassInfo {
+class LLVM_CLASS_ABI PassInfo {
 public:
   using NormalCtor_t = Pass* (*)();
 
diff --git a/llvm/include/llvm/PassRegistry.h b/llvm/include/llvm/PassRegistry.h
index 82b3346600f5742..26f7c241a337290 100644
--- a/llvm/include/llvm/PassRegistry.h
+++ b/llvm/include/llvm/PassRegistry.h
@@ -35,7 +35,7 @@ struct PassRegistrationListener;
 /// NOTE: PassRegistry is NOT thread-safe.  If you want to use LLVM on multiple
 /// threads simultaneously, you will need to use a separate PassRegistry on
 /// each thread.
-class PassRegistry {
+class LLVM_CLASS_ABI PassRegistry {
   mutable sys::SmartRWMutex<true> Lock;
 
   /// PassInfoMap - Keep track of the PassInfo object for each registered pass.
diff --git a/llvm/include/llvm/PassSupport.h b/llvm/include/llvm/PassSupport.h
index 99785a0c593f9a2..cbbdef1f1827a78 100644
--- a/llvm/include/llvm/PassSupport.h
+++ b/llvm/include/llvm/PassSupport.h
@@ -107,7 +107,7 @@ Pass *callDefaultCtor() {
 ///
 /// This statement will cause your pass to be created by calling the default
 /// constructor exposed by the pass.
-template <typename passName> struct RegisterPass : public PassInfo {
+template <typename passName> struct LLVM_CLASS_ABI RegisterPass : public PassInfo {
   // Register Pass using default constructor...
   RegisterPass(StringRef PassArg, StringRef Name, bool CFGOnly = false,
                bool is_analysis = false)
@@ -136,14 +136,14 @@ template <typename passName> struct RegisterPass : public PassInfo {
 /// The actual interface may also be registered as well (by not specifying the
 /// second template argument).  The interface should be registered to associate
 /// a nice name with the interface.
-class RegisterAGBase : public PassInfo {
+class LLVM_CLASS_ABI RegisterAGBase : public PassInfo {
 public:
   RegisterAGBase(StringRef Name, const void *InterfaceID,
                  const void *PassID = nullptr, bool isDefault = false);
 };
 
 template <typename Interface, bool Default = false>
-struct RegisterAnalysisGroup : public RegisterAGBase {
+struct LLVM_CLASS_ABI RegisterAnalysisGroup : public RegisterAGBase {
   explicit RegisterAnalysisGroup(PassInfo &RPB)
       : RegisterAGBase(RPB.getPassName(), &Interface::ID, RPB.getTypeInfo(),
                        Default) {}
@@ -213,7 +213,7 @@ struct RegisterAnalysisGroup : public RegisterAGBase {
 /// at runtime (which can be because of the RegisterPass constructors being run
 /// as the program starts up, or may be because a shared object just got
 /// loaded).
-struct PassRegistrationListener {
+struct LLVM_CLASS_ABI PassRegistrationListener {
   PassRegistrationListener() = default;
   virtual ~PassRegistrationListener() = default;
 
diff --git a/llvm/include/llvm/Passes/OptimizationLevel.h b/llvm/include/llvm/Passes/OptimizationLevel.h
index 544f99ba63de05e..2202060895ae54e 100644
--- a/llvm/include/llvm/Passes/OptimizationLevel.h
+++ b/llvm/include/llvm/Passes/OptimizationLevel.h
@@ -20,7 +20,7 @@
 
 namespace llvm {
 
-class OptimizationLevel final {
+class LLVM_CLASS_ABI OptimizationLevel final {
   unsigned SpeedLevel = 2;
   unsigned SizeLevel = 0;
   OptimizationLevel(unsigned SpeedLevel, unsigned SizeLevel)
diff --git a/llvm/include/llvm/Passes/PassBuilder.h b/llvm/include/llvm/Passes/PassBuilder.h
index f493d5f900daf5c..517fb9fa3d5856f 100644
--- a/llvm/include/llvm/Passes/PassBuilder.h
+++ b/llvm/include/llvm/Passes/PassBuilder.h
@@ -30,7 +30,7 @@
 
 namespace llvm {
 
-extern cl::opt<bool> PrintPipelinePasses;
+LLVM_FUNC_ABI extern cl::opt<bool> PrintPipelinePasses;
 
 class StringRef;
 class AAManager;
@@ -42,7 +42,7 @@ class FileSystem;
 } // namespace vfs
 
 /// Tunable parameters for passes in the default pipelines.
-class PipelineTuningOptions {
+class LLVM_CLASS_ABI PipelineTuningOptions {
 public:
   /// Constructor sets pipeline tuning defaults based on cl::opts. Each option
   /// can be set in the PassBuilder when using a LLVM as a library.
@@ -104,7 +104,7 @@ class PipelineTuningOptions {
 /// construction. The \c PassRegistry.def file specifies how to construct all
 /// of the built-in passes, and those may reference these members during
 /// construction.
-class PassBuilder {
+class LLVM_CLASS_ABI PassBuilder {
   TargetMachine *TM;
   PipelineTuningOptions PTO;
   std::optional<PGOOptions> PGOOpt;
diff --git a/llvm/include/llvm/Passes/PassPlugin.h b/llvm/include/llvm/Passes/PassPlugin.h
index 013b7a827c47ddb..4c362e5b7a83883 100644
--- a/llvm/include/llvm/Passes/PassPlugin.h
+++ b/llvm/include/llvm/Passes/PassPlugin.h
@@ -38,7 +38,7 @@ extern "C" {
 /// This struct defines the core interface for pass plugins and is supposed to
 /// be filled out by plugin implementors. LLVM-side users of a plugin are
 /// expected to use the \c PassPlugin class below to interface with it.
-struct PassPluginLibraryInfo {
+struct LLVM_CLASS_ABI PassPluginLibraryInfo {
   /// The API version understood by this plugin, usually \c
   /// LLVM_PLUGIN_API_VERSION
   uint32_t APIVersion;
@@ -57,7 +57,7 @@ struct PassPluginLibraryInfo {
 ///
 /// An instance of this class wraps a loaded pass plugin and gives access to
 /// its interface defined by the \c PassPluginLibraryInfo it exposes.
-class PassPlugin {
+class LLVM_CLASS_ABI PassPlugin {
 public:
   /// Attempts to load a pass plugin from a given file.
   ///
@@ -107,7 +107,7 @@ class PassPlugin {
 ///   };
 /// }
 /// ```
-extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
+extern "C" LLVM_FUNC_ABI ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK
 llvmGetPassPluginInfo();
 
 #endif /* LLVM_PASSES_PASSPLUGIN_H */
diff --git a/llvm/include/llvm/Passes/StandardInstrumentations.h b/llvm/include/llvm/Passes/StandardInstrumentations.h
index 380c3a95efe2feb..167761a61a62c0f 100644
--- a/llvm/include/llvm/Passes/StandardInstrumentations.h
+++ b/llvm/include/llvm/Passes/StandardInstrumentations.h
@@ -40,7 +40,7 @@ class PassInstrumentationCallbacks;
 ///
 /// Needs state to be able to print module after pass that invalidates IR unit
 /// (typically Loop or SCC).
-class PrintIRInstrumentation {
+class LLVM_CLASS_ABI PrintIRInstrumentation {
 public:
   ~PrintIRInstrumentation();
 
@@ -70,7 +70,7 @@ class PrintIRInstrumentation {
   unsigned CurrentPassNumber = 0;
 };
 
-class OptNoneInstrumentation {
+class LLVM_CLASS_ABI OptNoneInstrumentation {
 public:
   OptNoneInstrumentation(bool DebugLogging) : DebugLogging(DebugLogging) {}
   void registerCallbacks(PassInstrumentationCallbacks &PIC);
@@ -80,7 +80,7 @@ class OptNoneInstrumentation {
   bool shouldRun(StringRef PassID, Any IR);
 };
 
-class OptPassGateInstrumentation {
+class LLVM_CLASS_ABI OptPassGateInstrumentation {
   LLVMContext &Context;
   bool HasWrittenIR = false;
 public:
@@ -89,7 +89,7 @@ class OptPassGateInstrumentation {
   void registerCallbacks(PassInstrumentationCallbacks &PIC);
 };
 
-struct PrintPassOptions {
+struct LLVM_CLASS_ABI PrintPassOptions {
   /// Print adaptors and pass managers.
   bool Verbose = false;
   /// Don't print information for analyses.
@@ -99,7 +99,7 @@ struct PrintPassOptions {
 };
 
 // Debug logging for transformation and analysis passes.
-class PrintPassInstrumentation {
+class LLVM_CLASS_ABI PrintPassInstrumentation {
   raw_ostream &print();
 
 public:
@@ -113,7 +113,7 @@ class PrintPassInstrumentation {
   int Indent = 0;
 };
 
-class PreservedCFGCheckerInstrumentation {
+class LLVM_CLASS_ABI PreservedCFGCheckerInstrumentation {
 public:
   // Keeps sticky poisoned flag for the given basic block once it has been
   // deleted or RAUWed.
@@ -177,7 +177,7 @@ class PreservedCFGCheckerInstrumentation {
 // 6.  When a pass is run on an IR that is not interesting (based on options).
 // 7.  When a pass is ignored (pass manager or adapter pass).
 // 8.  To compare two IR representations (of type \p T).
-template <typename IRUnitT> class ChangeReporter {
+template <typename IRUnitT> class LLVM_CLASS_ABI ChangeReporter {
 protected:
   ChangeReporter(bool RunInVerboseMode) : VerboseMode(RunInVerboseMode) {}
 
@@ -226,7 +226,7 @@ template <typename IRUnitT> class ChangeReporter {
 // An abstract template base class that handles printing banners and
 // reporting when things have not changed or are filtered out.
 template <typename IRUnitT>
-class TextChangeReporter : public ChangeReporter<IRUnitT> {
+class LLVM_CLASS_ABI TextChangeReporter : public ChangeReporter<IRUnitT> {
 protected:
   TextChangeReporter(bool Verbose);
 
@@ -250,7 +250,7 @@ class TextChangeReporter : public ChangeReporter<IRUnitT> {
 // by unwrapAndPrint.  The string representation is stored in a std::string
 // to preserve it as the IR changes in each pass.  Note that the banner is
 // included in this representation but it is massaged before reporting.
-class IRChangedPrinter : public TextChangeReporter<std::string> {
+class LLVM_CLASS_ABI IRChangedPrinter : public TextChangeReporter<std::string> {
 public:
   IRChangedPrinter(bool VerboseMode)
       : TextChangeReporter<std::string>(VerboseMode) {}
@@ -267,7 +267,7 @@ class IRChangedPrinter : public TextChangeReporter<std::string> {
                    Any) override;
 };
 
-class IRChangedTester : public IRChangedPrinter {
+class LLVM_CLASS_ABI IRChangedTester : public IRChangedPrinter {
 public:
   IRChangedTester() : IRChangedPrinter(true) {}
   ~IRChangedTester() override;
@@ -295,7 +295,7 @@ class IRChangedTester : public IRChangedPrinter {
 
 // Information that needs to be saved for a basic block in order to compare
 // before and after the pass to determine if it was changed by a pass.
-template <typename T> class BlockDataT {
+template <typename T> class LLVM_CLASS_ABI BlockDataT {
 public:
   BlockDataT(const BasicBlock &B) : Label(B.getName().str()), Data(B) {
     raw_string_ostream SS(Body);
@@ -321,7 +321,7 @@ template <typename T> class BlockDataT {
   T Data;
 };
 
-template <typename T> class OrderedChangedData {
+template <typename T> class LLVM_CLASS_ABI OrderedChangedData {
 public:
   // Return the names in the order they were saved
   std::vector<std::string> &getOrder() { return Order; }
@@ -350,14 +350,14 @@ template <typename T> class OrderedChangedData {
 };
 
 // Do not need extra information for patch-style change reporter.
-class EmptyData {
+class LLVM_CLASS_ABI EmptyData {
 public:
   EmptyData(const BasicBlock &) {}
 };
 
 // The data saved for comparing functions.
 template <typename T>
-class FuncDataT : public OrderedChangedData<BlockDataT<T>> {
+class LLVM_CLASS_ABI FuncDataT : public OrderedChangedData<BlockDataT<T>> {
 public:
   FuncDataT(std::string S) : EntryBlockName(S) {}
 
@@ -370,12 +370,12 @@ class FuncDataT : public OrderedChangedData<BlockDataT<T>> {
 
 // The data saved for comparing IRs.
 template <typename T>
-class IRDataT : public OrderedChangedData<FuncDataT<T>> {};
+class LLVM_CLASS_ABI IRDataT : public OrderedChangedData<FuncDataT<T>> {};
 
 // Abstract template base class for a class that compares two IRs.  The
 // class is created with the 2 IRs to compare and then compare is called.
 // The static function analyzeIR is used to build up the IR representation.
-template <typename T> class IRComparer {
+template <typename T> class LLVM_CLASS_ABI IRComparer {
 public:
   IRComparer(const IRDataT<T> &Before, const IRDataT<T> &After)
       : Before(Before), After(After) {}
@@ -406,7 +406,7 @@ template <typename T> class IRComparer {
 // and added, respectively.  Changes to the IR that do not affect basic
 // blocks are not reported as having changed the IR.  The option
 // -print-module-scope does not affect this change reporter.
-class InLineChangePrinter : public TextChangeReporter<IRDataT<EmptyData>> {
+class LLVM_CLASS_ABI InLineChangePrinter : public TextChangeReporter<IRDataT<EmptyData>> {
 public:
   InLineChangePrinter(bool VerboseMode, bool ColourMode)
       : TextChangeReporter<IRDataT<EmptyData>>(VerboseMode),
@@ -432,7 +432,7 @@ class InLineChangePrinter : public TextChangeReporter<IRDataT<EmptyData>> {
   bool UseColour;
 };
 
-class VerifyInstrumentation {
+class LLVM_CLASS_ABI VerifyInstrumentation {
   bool DebugLogging;
 
 public:
@@ -443,7 +443,7 @@ class VerifyInstrumentation {
 /// This class implements --time-trace functionality for new pass manager.
 /// It provides the pass-instrumentation callbacks that measure the pass
 /// execution time. They collect time tracing info by TimeProfiler.
-class TimeProfilingPassesHandler {
+class LLVM_CLASS_ABI TimeProfilingPassesHandler {
 public:
   TimeProfilingPassesHandler();
   // We intend this to be unique per-compilation, thus no copies.
@@ -460,7 +460,7 @@ class TimeProfilingPassesHandler {
 
 // Class that holds transitions between basic blocks.  The transitions
 // are contained in a map of values to names of basic blocks.
-class DCData {
+class LLVM_CLASS_ABI DCData {
 public:
   // Fill the map with the transitions from basic block \p B.
   DCData(const BasicBlock &B);
@@ -491,7 +491,7 @@ class DCData {
 
 // A change reporter that builds a website with links to pdf files showing
 // dot control flow graphs with changed instructions shown in colour.
-class DotCfgChangeReporter : public ChangeReporter<IRDataT<DCData>> {
+class LLVM_CLASS_ABI DotCfgChangeReporter : public ChangeReporter<IRDataT<DCData>> {
 public:
   DotCfgChangeReporter(bool Verbose);
   ~DotCfgChangeReporter() override;
@@ -534,7 +534,7 @@ class DotCfgChangeReporter : public ChangeReporter<IRDataT<DCData>> {
 };
 
 // Print IR on crash.
-class PrintCrashIRInstrumentation {
+class LLVM_CLASS_ABI PrintCrashIRInstrumentation {
 public:
   PrintCrashIRInstrumentation()
       : SavedIR("*** Dump of IR Before Last Pass Unknown ***") {}
@@ -554,7 +554,7 @@ class PrintCrashIRInstrumentation {
 
 /// This class provides an interface to register all the standard pass
 /// instrumentations and manages their state (if any).
-class StandardInstrumentations {
+class LLVM_CLASS_ABI StandardInstrumentations {
   PrintIRInstrumentation PrintIR;
   PrintPassInstrumentation PrintPass;
   TimePassesHandler TimePasses;
diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
index 3c8f940ba97b7eb..9405d02e1daf5a7 100644
--- a/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
+++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
@@ -67,13 +67,13 @@ enum class coveragemap_error {
   invalid_or_missing_arch_specifier
 };
 
-const std::error_category &coveragemap_category();
+LLVM_FUNC_ABI const std::error_category &coveragemap_category();
 
 inline std::error_code make_error_code(coveragemap_error E) {
   return std::error_code(static_cast<int>(E), coveragemap_category());
 }
 
-class CoverageMapError : public ErrorInfo<CoverageMapError> {
+class LLVM_CLASS_ABI CoverageMapError : public ErrorInfo<CoverageMapError> {
 public:
   CoverageMapError(coveragemap_error Err) : Err(Err) {
     assert(Err != coveragemap_error::success && "Not an error");
@@ -97,7 +97,7 @@ class CoverageMapError : public ErrorInfo<CoverageMapError> {
 
 /// A Counter is an abstract value that describes how to compute the
 /// execution count for a region of code using the collected profile count data.
-struct Counter {
+struct LLVM_CLASS_ABI Counter {
   /// The CounterExpression kind (Add or Subtract) is encoded in bit 0 next to
   /// the CounterKind. This means CounterKind has to leave bit 0 free.
   enum CounterKind { Zero, CounterValueReference, Expression };
@@ -154,7 +154,7 @@ struct Counter {
 
 /// A Counter expression is a value that represents an arithmetic operation
 /// with two counters.
-struct CounterExpression {
+struct LLVM_CLASS_ABI CounterExpression {
   enum ExprKind { Subtract, Add };
   ExprKind Kind;
   Counter LHS, RHS;
@@ -165,7 +165,7 @@ struct CounterExpression {
 
 /// A Counter expression builder is used to construct the counter expressions.
 /// It avoids unnecessary duplication and simplifies algebraic expressions.
-class CounterExpressionBuilder {
+class LLVM_CLASS_ABI CounterExpressionBuilder {
   /// A list of all the counter expressions
   std::vector<CounterExpression> Expressions;
 
@@ -213,7 +213,7 @@ class CounterExpressionBuilder {
 using LineColPair = std::pair<unsigned, unsigned>;
 
 /// A Counter mapping region associates a source range with a specific counter.
-struct CounterMappingRegion {
+struct LLVM_CLASS_ABI CounterMappingRegion {
   enum RegionKind {
     /// A CodeRegion associates some code with a counter
     CodeRegion,
@@ -308,7 +308,7 @@ struct CounterMappingRegion {
 };
 
 /// Associates a source range with an execution count.
-struct CountedRegion : public CounterMappingRegion {
+struct LLVM_CLASS_ABI CountedRegion : public CounterMappingRegion {
   uint64_t ExecutionCount;
   uint64_t FalseExecutionCount;
   bool Folded;
@@ -325,7 +325,7 @@ struct CountedRegion : public CounterMappingRegion {
 
 /// A Counter mapping context is used to connect the counters, expressions
 /// and the obtained counter values.
-class CounterMappingContext {
+class LLVM_CLASS_ABI CounterMappingContext {
   ArrayRef<CounterExpression> Expressions;
   ArrayRef<uint64_t> CounterValues;
 
@@ -347,7 +347,7 @@ class CounterMappingContext {
 };
 
 /// Code coverage information for a single function.
-struct FunctionRecord {
+struct LLVM_CLASS_ABI FunctionRecord {
   /// Raw function name.
   std::string Name;
   /// Mapping from FileID (i.e. vector index) to filename. Used to support
@@ -387,7 +387,7 @@ struct FunctionRecord {
 };
 
 /// Iterator over Functions, optionally filtered to a single file.
-class FunctionRecordIterator
+class LLVM_CLASS_ABI FunctionRecordIterator
     : public iterator_facade_base<FunctionRecordIterator,
                                   std::forward_iterator_tag, FunctionRecord> {
   ArrayRef<FunctionRecord> Records;
@@ -425,7 +425,7 @@ class FunctionRecordIterator
 /// When covered code has pieces that can be expanded for more detail, such as a
 /// preprocessor macro use and its definition, these are represented as
 /// expansions whose coverage can be looked up independently.
-struct ExpansionRecord {
+struct LLVM_CLASS_ABI ExpansionRecord {
   /// The abstract file this expansion covers.
   unsigned FileID;
   /// The region that expands to this record.
@@ -442,7 +442,7 @@ struct ExpansionRecord {
 ///
 /// A sequence of CoverageSegments gives execution counts for a file in format
 /// that's simple to iterate through for processing.
-struct CoverageSegment {
+struct LLVM_CLASS_ABI CoverageSegment {
   /// The line where this segment begins.
   unsigned Line;
   /// The column where this segment begins.
@@ -479,7 +479,7 @@ struct CoverageSegment {
 ///
 /// Note that it's possible for a function to have more than one instantiation
 /// (consider C++ template specializations or static inline functions).
-class InstantiationGroup {
+class LLVM_CLASS_ABI InstantiationGroup {
   friend class CoverageMapping;
 
   unsigned Line;
@@ -536,7 +536,7 @@ class InstantiationGroup {
 /// This represents the coverage of an entire file, expansion, or function. It
 /// provides a sequence of CoverageSegments to iterate through, as well as the
 /// list of expansions that can be further processed.
-class CoverageData {
+class LLVM_CLASS_ABI CoverageData {
   friend class CoverageMapping;
 
   std::string Filename;
@@ -575,7 +575,7 @@ class CoverageData {
 ///
 /// This is the main interface to get coverage information, using a profile to
 /// fill out execution counts.
-class CoverageMapping {
+class LLVM_CLASS_ABI CoverageMapping {
   DenseMap<size_t, DenseSet<size_t>> RecordProvenance;
   std::vector<FunctionRecord> Functions;
   DenseMap<size_t, SmallVector<unsigned, 0>> FilenameHash2RecordIndices;
@@ -678,7 +678,7 @@ class CoverageMapping {
 };
 
 /// Coverage statistics for a single line.
-class LineCoverageStats {
+class LLVM_CLASS_ABI LineCoverageStats {
   uint64_t ExecutionCount;
   bool HasMultipleRegions;
   bool Mapped;
@@ -710,7 +710,7 @@ class LineCoverageStats {
 
 /// An iterator over the \c LineCoverageStats objects for lines described by
 /// a \c CoverageData instance.
-class LineCoverageIterator
+class LLVM_CLASS_ABI LineCoverageIterator
     : public iterator_facade_base<LineCoverageIterator,
                                   std::forward_iterator_tag,
                                   const LineCoverageStats> {
@@ -835,7 +835,7 @@ advanceByOneOutOfLine(const FuncRecordTy *Record, const char *MappingBuf) {
 
 LLVM_PACKED_START
 template <class IntPtrT>
-struct CovMapFunctionRecordV1 {
+struct LLVM_CLASS_ABI CovMapFunctionRecordV1 {
   using ThisT = CovMapFunctionRecordV1<IntPtrT>;
 
 #define COVMAP_V1
@@ -885,7 +885,7 @@ struct CovMapFunctionRecordV1 {
   }
 };
 
-struct CovMapFunctionRecordV2 {
+struct LLVM_CLASS_ABI CovMapFunctionRecordV2 {
   using ThisT = CovMapFunctionRecordV2;
 
 #define COVMAP_V2
@@ -929,7 +929,7 @@ struct CovMapFunctionRecordV2 {
   }
 };
 
-struct CovMapFunctionRecordV3 {
+struct LLVM_CLASS_ABI CovMapFunctionRecordV3 {
   using ThisT = CovMapFunctionRecordV3;
 
 #define COVMAP_V3
@@ -985,7 +985,7 @@ struct CovMapFunctionRecordV3 {
 
 // Per module coverage mapping data header, i.e. CoverageMapFileHeader
 // documented above.
-struct CovMapHeader {
+struct LLVM_CLASS_ABI CovMapHeader {
 #define COVMAP_HEADER(Type, LLVMType, Name, Init) Type Name;
 #include "llvm/ProfileData/InstrProfData.inc"
   template <support::endianness Endian> uint32_t getNRecords() const {
@@ -1027,22 +1027,22 @@ enum CovMapVersion {
   CurrentVersion = INSTR_PROF_COVMAP_VERSION
 };
 
-template <int CovMapVersion, class IntPtrT> struct CovMapTraits {
+template <int CovMapVersion, class IntPtrT> struct LLVM_CLASS_ABI CovMapTraits {
   using CovMapFuncRecordType = CovMapFunctionRecordV3;
   using NameRefType = uint64_t;
 };
 
-template <class IntPtrT> struct CovMapTraits<CovMapVersion::Version3, IntPtrT> {
+template <class IntPtrT> struct LLVM_CLASS_ABI CovMapTraits<CovMapVersion::Version3, IntPtrT> {
   using CovMapFuncRecordType = CovMapFunctionRecordV2;
   using NameRefType = uint64_t;
 };
 
-template <class IntPtrT> struct CovMapTraits<CovMapVersion::Version2, IntPtrT> {
+template <class IntPtrT> struct LLVM_CLASS_ABI CovMapTraits<CovMapVersion::Version2, IntPtrT> {
   using CovMapFuncRecordType = CovMapFunctionRecordV2;
   using NameRefType = uint64_t;
 };
 
-template <class IntPtrT> struct CovMapTraits<CovMapVersion::Version1, IntPtrT> {
+template <class IntPtrT> struct LLVM_CLASS_ABI CovMapTraits<CovMapVersion::Version1, IntPtrT> {
   using CovMapFuncRecordType = CovMapFunctionRecordV1<IntPtrT>;
   using NameRefType = IntPtrT;
 };
@@ -1050,7 +1050,7 @@ template <class IntPtrT> struct CovMapTraits<CovMapVersion::Version1, IntPtrT> {
 } // end namespace coverage
 
 /// Provide DenseMapInfo for CounterExpression
-template<> struct DenseMapInfo<coverage::CounterExpression> {
+template<> struct LLVM_CLASS_ABI DenseMapInfo<coverage::CounterExpression> {
   static inline coverage::CounterExpression getEmptyKey() {
     using namespace coverage;
 
diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
index 510199a2864ede7..8bd9aa845121ed2 100644
--- a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
+++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
@@ -33,7 +33,7 @@ namespace coverage {
 class CoverageMappingReader;
 
 /// Coverage mapping information for a single function.
-struct CoverageMappingRecord {
+struct LLVM_CLASS_ABI CoverageMappingRecord {
   StringRef FunctionName;
   uint64_t FunctionHash;
   ArrayRef<StringRef> Filenames;
@@ -42,7 +42,7 @@ struct CoverageMappingRecord {
 };
 
 /// A file format agnostic iterator over coverage mapping data.
-class CoverageMappingIterator {
+class LLVM_CLASS_ABI CoverageMappingIterator {
   CoverageMappingReader *Reader;
   CoverageMappingRecord Record;
   coveragemap_error ReadErr;
@@ -97,7 +97,7 @@ class CoverageMappingIterator {
   }
 };
 
-class CoverageMappingReader {
+class LLVM_CLASS_ABI CoverageMappingReader {
 public:
   virtual ~CoverageMappingReader() = default;
 
@@ -107,7 +107,7 @@ class CoverageMappingReader {
 };
 
 /// Base class for the raw coverage mapping and filenames data readers.
-class RawCoverageReader {
+class LLVM_CLASS_ABI RawCoverageReader {
 protected:
   StringRef Data;
 
@@ -121,7 +121,7 @@ class RawCoverageReader {
 
 /// Checks if the given coverage mapping data is exported for
 /// an unused function.
-class RawCoverageMappingDummyChecker : public RawCoverageReader {
+class LLVM_CLASS_ABI RawCoverageMappingDummyChecker : public RawCoverageReader {
 public:
   RawCoverageMappingDummyChecker(StringRef MappingData)
       : RawCoverageReader(MappingData) {}
@@ -130,7 +130,7 @@ class RawCoverageMappingDummyChecker : public RawCoverageReader {
 };
 
 /// Reader for the raw coverage mapping data.
-class RawCoverageMappingReader : public RawCoverageReader {
+class LLVM_CLASS_ABI RawCoverageMappingReader : public RawCoverageReader {
   ArrayRef<std::string> &TranslationUnitFilenames;
   std::vector<StringRef> &Filenames;
   std::vector<CounterExpression> &Expressions;
@@ -162,7 +162,7 @@ class RawCoverageMappingReader : public RawCoverageReader {
 
 /// Reader for the coverage mapping data that is emitted by the
 /// frontend and stored in an object file.
-class BinaryCoverageReader : public CoverageMappingReader {
+class LLVM_CLASS_ABI BinaryCoverageReader : public CoverageMappingReader {
 public:
   struct ProfileMappingRecord {
     CovMapVersion Version;
@@ -221,7 +221,7 @@ class BinaryCoverageReader : public CoverageMappingReader {
 };
 
 /// Reader for the raw coverage filenames.
-class RawCoverageFilenamesReader : public RawCoverageReader {
+class LLVM_CLASS_ABI RawCoverageFilenamesReader : public RawCoverageReader {
   std::vector<std::string> &Filenames;
   StringRef CompilationDir;
 
diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h
index a21c6cd68acea61..cdbb6ffc86400bf 100644
--- a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h
+++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h
@@ -27,7 +27,7 @@ namespace coverage {
 
 /// Writer of the filenames section for the instrumentation
 /// based code coverage.
-class CoverageFilenamesSectionWriter {
+class LLVM_CLASS_ABI CoverageFilenamesSectionWriter {
   ArrayRef<std::string> Filenames;
 
 public:
@@ -39,7 +39,7 @@ class CoverageFilenamesSectionWriter {
 };
 
 /// Writer for instrumentation based coverage mapping data.
-class CoverageMappingWriter {
+class LLVM_CLASS_ABI CoverageMappingWriter {
   ArrayRef<unsigned> VirtualFileMapping;
   ArrayRef<CounterExpression> Expressions;
   MutableArrayRef<CounterMappingRegion> MappingRegions;
diff --git a/llvm/include/llvm/ProfileData/GCOV.h b/llvm/include/llvm/ProfileData/GCOV.h
index 8d1de661172239e..4780ec5d5bc33a7 100644
--- a/llvm/include/llvm/ProfileData/GCOV.h
+++ b/llvm/include/llvm/ProfileData/GCOV.h
@@ -43,7 +43,7 @@ namespace GCOV {
 enum GCOVVersion { V304, V407, V408, V800, V900, V1200 };
 
 /// A struct for passing gcov options between functions.
-struct Options {
+struct LLVM_CLASS_ABI Options {
   Options(bool A, bool B, bool C, bool F, bool P, bool U, bool I, bool L,
           bool M, bool N, bool R, bool T, bool X, std::string SourcePrefix)
       : AllBlocks(A), BranchInfo(B), BranchCount(C), FuncCoverage(F),
@@ -71,7 +71,7 @@ struct Options {
 
 /// GCOVBuffer - A wrapper around MemoryBuffer to provide GCOV specific
 /// read operations.
-class GCOVBuffer {
+class LLVM_CLASS_ABI GCOVBuffer {
 public:
   GCOVBuffer(MemoryBuffer *B) : Buffer(B) {}
   ~GCOVBuffer() { consumeError(cursor.takeError()); }
@@ -189,7 +189,7 @@ class GCOVBuffer {
 
 /// GCOVFile - Collects coverage information for one pair of coverage file
 /// (.gcno and .gcda).
-class GCOVFile {
+class LLVM_CLASS_ABI GCOVFile {
 public:
   GCOVFile() = default;
 
@@ -221,7 +221,7 @@ class GCOVFile {
   unsigned addNormalizedPathToMap(StringRef filename);
 };
 
-struct GCOVArc {
+struct LLVM_CLASS_ABI GCOVArc {
   GCOVArc(GCOVBlock &src, GCOVBlock &dst, uint32_t flags)
       : src(src), dst(dst), flags(flags) {}
   bool onTree() const;
@@ -234,7 +234,7 @@ struct GCOVArc {
 };
 
 /// GCOVFunction - Collects function information.
-class GCOVFunction {
+class LLVM_CLASS_ABI GCOVFunction {
 public:
   using BlockIterator = pointee_iterator<
       SmallVectorImpl<std::unique_ptr<GCOVBlock>>::const_iterator>;
@@ -272,7 +272,7 @@ class GCOVFunction {
 };
 
 /// GCOVBlock - Collects block information.
-class GCOVBlock {
+class LLVM_CLASS_ABI GCOVBlock {
 public:
   using EdgeIterator = SmallVectorImpl<GCOVArc *>::const_iterator;
   using BlockVector = SmallVector<const GCOVBlock *, 1>;
@@ -316,7 +316,7 @@ class GCOVBlock {
   GCOVArc *incoming = nullptr;
 };
 
-void gcovOneInput(const GCOV::Options &options, StringRef filename,
+LLVM_FUNC_ABI void gcovOneInput(const GCOV::Options &options, StringRef filename,
                   StringRef gcno, StringRef gcda, GCOVFile &file);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h
index a3e21b26a428d82..362d48e873654fb 100644
--- a/llvm/include/llvm/ProfileData/InstrProf.h
+++ b/llvm/include/llvm/ProfileData/InstrProf.h
@@ -71,7 +71,7 @@ inline uint64_t getInstrMaxCountValue() {
 /// The name of the section depends on the object format type \p OF. If
 /// \p AddSegmentInfo is true, a segment prefix and additional linker hints may
 /// be added to the section name (this is the default).
-std::string getInstrProfSectionName(InstrProfSectKind IPSK,
+LLVM_FUNC_ABI std::string getInstrProfSectionName(InstrProfSectKind IPSK,
                                     Triple::ObjectFormatType OF,
                                     bool AddSegmentInfo = true);
 
@@ -172,14 +172,14 @@ inline StringRef getInstrProfNameSeparator() { return "\01"; }
 /// Return the modified name for function \c F suitable to be
 /// used the key for profile lookup. Variable \c InLTO indicates if this
 /// is called in LTO optimization passes.
-std::string getPGOFuncName(const Function &F, bool InLTO = false,
+LLVM_FUNC_ABI std::string getPGOFuncName(const Function &F, bool InLTO = false,
                            uint64_t Version = INSTR_PROF_INDEX_VERSION);
 
 /// Return the modified name for a function suitable to be
 /// used the key for profile lookup. The function's original
 /// name is \c RawFuncName and has linkage of type \c Linkage.
 /// The function is defined in module \c FileName.
-std::string getPGOFuncName(StringRef RawFuncName,
+LLVM_FUNC_ABI std::string getPGOFuncName(StringRef RawFuncName,
                            GlobalValue::LinkageTypes Linkage,
                            StringRef FileName,
                            uint64_t Version = INSTR_PROF_INDEX_VERSION);
@@ -187,28 +187,28 @@ std::string getPGOFuncName(StringRef RawFuncName,
 /// Return the name of the global variable used to store a function
 /// name in PGO instrumentation. \c FuncName is the name of the function
 /// returned by the \c getPGOFuncName call.
-std::string getPGOFuncNameVarName(StringRef FuncName,
+LLVM_FUNC_ABI std::string getPGOFuncNameVarName(StringRef FuncName,
                                   GlobalValue::LinkageTypes Linkage);
 
 /// Create and return the global variable for function name used in PGO
 /// instrumentation. \c FuncName is the name of the function returned
 /// by \c getPGOFuncName call.
-GlobalVariable *createPGOFuncNameVar(Function &F, StringRef PGOFuncName);
+LLVM_FUNC_ABI GlobalVariable *createPGOFuncNameVar(Function &F, StringRef PGOFuncName);
 
 /// Create and return the global variable for function name used in PGO
 /// instrumentation.  /// \c FuncName is the name of the function
 /// returned by \c getPGOFuncName call, \c M is the owning module,
 /// and \c Linkage is the linkage of the instrumented function.
-GlobalVariable *createPGOFuncNameVar(Module &M,
+LLVM_FUNC_ABI GlobalVariable *createPGOFuncNameVar(Module &M,
                                      GlobalValue::LinkageTypes Linkage,
                                      StringRef PGOFuncName);
 
 /// Return the initializer in string of the PGO name var \c NameVar.
-StringRef getPGOFuncNameVarInitializer(GlobalVariable *NameVar);
+LLVM_FUNC_ABI StringRef getPGOFuncNameVarInitializer(GlobalVariable *NameVar);
 
 /// Given a PGO function name, remove the filename prefix and return
 /// the original (static) function name.
-StringRef getFuncNameWithoutPrefix(StringRef PGOFuncName,
+LLVM_FUNC_ABI StringRef getFuncNameWithoutPrefix(StringRef PGOFuncName,
                                    StringRef FileName = "<unknown>");
 
 /// Given a vector of strings (function PGO names) \c NameStrs, the
@@ -220,27 +220,27 @@ StringRef getFuncNameWithoutPrefix(StringRef PGOFuncName,
 ///  third field is the uncompressed strings; otherwise it is the
 /// compressed string. When the string compression is off, the
 /// second field will have value zero.
-Error collectPGOFuncNameStrings(ArrayRef<std::string> NameStrs,
+LLVM_FUNC_ABI Error collectPGOFuncNameStrings(ArrayRef<std::string> NameStrs,
                                 bool doCompression, std::string &Result);
 
 /// Produce \c Result string with the same format described above. The input
 /// is vector of PGO function name variables that are referenced.
-Error collectPGOFuncNameStrings(ArrayRef<GlobalVariable *> NameVars,
+LLVM_FUNC_ABI Error collectPGOFuncNameStrings(ArrayRef<GlobalVariable *> NameVars,
                                 std::string &Result, bool doCompression = true);
 
 /// \c NameStrings is a string composed of one of more sub-strings encoded in
 /// the format described above. The substrings are separated by 0 or more zero
 /// bytes. This method decodes the string and populates the \c Symtab.
-Error readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab);
+LLVM_FUNC_ABI Error readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab);
 
 /// Check if INSTR_PROF_RAW_VERSION_VAR is defined. This global is only being
 /// set in IR PGO compilation.
-bool isIRPGOFlagSet(const Module *M);
+LLVM_FUNC_ABI bool isIRPGOFlagSet(const Module *M);
 
 /// Check if we can safely rename this Comdat function. Instances of the same
 /// comdat function may have different control flows thus can not share the
 /// same counter variable.
-bool canRenameComdatFunc(const Function &F, bool CheckAddressTaken = false);
+LLVM_FUNC_ABI bool canRenameComdatFunc(const Function &F, bool CheckAddressTaken = false);
 
 enum InstrProfValueKind : uint32_t {
 #define VALUE_PROF_KIND(Enumerator, Value, Descr) Enumerator = Value,
@@ -250,20 +250,20 @@ enum InstrProfValueKind : uint32_t {
 /// Get the value profile data for value site \p SiteIdx from \p InstrProfR
 /// and annotate the instruction \p Inst with the value profile meta data.
 /// Annotate up to \p MaxMDCount (default 3) number of records per value site.
-void annotateValueSite(Module &M, Instruction &Inst,
+LLVM_FUNC_ABI void annotateValueSite(Module &M, Instruction &Inst,
                        const InstrProfRecord &InstrProfR,
                        InstrProfValueKind ValueKind, uint32_t SiteIndx,
                        uint32_t MaxMDCount = 3);
 
 /// Same as the above interface but using an ArrayRef, as well as \p Sum.
-void annotateValueSite(Module &M, Instruction &Inst,
+LLVM_FUNC_ABI void annotateValueSite(Module &M, Instruction &Inst,
                        ArrayRef<InstrProfValueData> VDs, uint64_t Sum,
                        InstrProfValueKind ValueKind, uint32_t MaxMDCount);
 
 /// Extract the value profile data from \p Inst which is annotated with
 /// value profile meta data. Return false if there is no value data annotated,
 /// otherwise  return true.
-bool getValueProfDataFromInst(const Instruction &Inst,
+LLVM_FUNC_ABI bool getValueProfDataFromInst(const Instruction &Inst,
                               InstrProfValueKind ValueKind,
                               uint32_t MaxNumValueData,
                               InstrProfValueData ValueData[],
@@ -273,16 +273,16 @@ bool getValueProfDataFromInst(const Instruction &Inst,
 inline StringRef getPGOFuncNameMetadataName() { return "PGOFuncName"; }
 
 /// Return the PGOFuncName meta data associated with a function.
-MDNode *getPGOFuncNameMetadata(const Function &F);
+LLVM_FUNC_ABI MDNode *getPGOFuncNameMetadata(const Function &F);
 
 /// Create the PGOFuncName meta data if PGOFuncName is different from
 /// function's raw name. This should only apply to internal linkage functions
 /// declared by users only.
-void createPGOFuncNameMetadata(Function &F, StringRef PGOFuncName);
+LLVM_FUNC_ABI void createPGOFuncNameMetadata(Function &F, StringRef PGOFuncName);
 
 /// Check if we can use Comdat for profile variables. This will eliminate
 /// the duplicated profile variables for Comdat functions.
-bool needsComdatForCounter(const Function &F, const Module &M);
+LLVM_FUNC_ABI bool needsComdatForCounter(const Function &F, const Module &M);
 
 /// An enum describing the attributes of an instrumented profile.
 enum class InstrProfKind {
@@ -306,7 +306,7 @@ enum class InstrProfKind {
   LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/TemporalProfile)
 };
 
-const std::error_category &instrprof_category();
+LLVM_FUNC_ABI const std::error_category &instrprof_category();
 
 enum class instrprof_error {
   success = 0,
@@ -337,7 +337,7 @@ enum class instrprof_error {
 
 /// An ordered list of functions identified by their NameRef found in
 /// INSTR_PROF_DATA
-struct TemporalProfTraceTy {
+struct LLVM_CLASS_ABI TemporalProfTraceTy {
   std::vector<uint64_t> FunctionNameRefs;
   uint64_t Weight;
   TemporalProfTraceTy(std::initializer_list<uint64_t> Trace = {},
@@ -355,7 +355,7 @@ inline std::error_code make_error_code(instrprof_error E) {
   return std::error_code(static_cast<int>(E), instrprof_category());
 }
 
-class InstrProfError : public ErrorInfo<InstrProfError> {
+class LLVM_CLASS_ABI InstrProfError : public ErrorInfo<InstrProfError> {
 public:
   InstrProfError(instrprof_error Err, const Twine &ErrStr = Twine())
       : Err(Err), Msg(ErrStr.str()) {
@@ -402,7 +402,7 @@ class SectionRef;
 
 namespace IndexedInstrProf {
 
-uint64_t ComputeHash(StringRef K);
+LLVM_FUNC_ABI uint64_t ComputeHash(StringRef K);
 
 } // end namespace IndexedInstrProf
 
@@ -411,7 +411,7 @@ uint64_t ComputeHash(StringRef K);
 /// PGO name or name's md5hash are used in retrieving the profile
 /// data of the function. See \c getPGOFuncName() method for details
 /// on how PGO name is formed.
-class InstrProfSymtab {
+class LLVM_CLASS_ABI InstrProfSymtab {
 public:
   using AddrHashMap = std::vector<std::pair<uint64_t, uint64_t>>;
 
@@ -601,7 +601,7 @@ StringRef InstrProfSymtab::getOrigFuncName(uint64_t FuncMD5Hash) {
 
 // To store the sums of profile count values, or the percentage of
 // the sums of the total count values.
-struct CountSumOrPercent {
+struct LLVM_CLASS_ABI CountSumOrPercent {
   uint64_t NumEntries;
   double CountSum;
   double ValueCounts[IPVK_Last - IPVK_First + 1];
@@ -615,7 +615,7 @@ struct CountSumOrPercent {
 };
 
 // Function level or program level overlap information.
-struct OverlapStats {
+struct LLVM_CLASS_ABI OverlapStats {
   enum OverlapStatsLevel { ProgramLevel, FunctionLevel };
   // Sum of the total count values for the base profile.
   CountSumOrPercent Base;
@@ -658,12 +658,12 @@ struct OverlapStats {
 
 // This is used to filter the functions whose overlap information
 // to be output.
-struct OverlapFuncFilters {
+struct LLVM_CLASS_ABI OverlapFuncFilters {
   uint64_t ValueCutoff;
   const std::string NameFilter;
 };
 
-struct InstrProfValueSiteRecord {
+struct LLVM_CLASS_ABI InstrProfValueSiteRecord {
   /// Value profiling data pairs at a given value site.
   std::list<InstrProfValueData> ValueData;
 
@@ -695,7 +695,7 @@ struct InstrProfValueSiteRecord {
 };
 
 /// Profiling information for a single function.
-struct InstrProfRecord {
+struct LLVM_CLASS_ABI InstrProfRecord {
   std::vector<uint64_t> Counts;
 
   InstrProfRecord() = default;
@@ -876,7 +876,7 @@ struct InstrProfRecord {
                           function_ref<void(instrprof_error)> Warn);
 };
 
-struct NamedInstrProfRecord : InstrProfRecord {
+struct LLVM_CLASS_ABI NamedInstrProfRecord : InstrProfRecord {
   StringRef Name;
   uint64_t Hash;
 
@@ -1033,7 +1033,7 @@ inline uint64_t ComputeHash(StringRef K) { return ComputeHash(HashType, K); }
 
 // This structure defines the file header of the LLVM profile
 // data file in indexed-format.
-struct Header {
+struct LLVM_CLASS_ABI Header {
   uint64_t Magic;
   uint64_t Version;
   uint64_t Unused; // Becomes unused since version 4
@@ -1061,7 +1061,7 @@ struct Header {
 // Profile summary data recorded in the profile data file in indexed
 // format. It is introduced in version 4. The summary data follows
 // right after the profile file header.
-struct Summary {
+struct LLVM_CLASS_ABI Summary {
   struct Entry {
     uint64_t Cutoff; ///< The required percentile of total execution count.
     uint64_t
@@ -1176,7 +1176,7 @@ template <> inline uint64_t getMagic<uint32_t>() {
 // compiler-rt/lib/profile/InstrProfiling.h.
 // It should also match the synthesized type in
 // Transforms/Instrumentation/InstrProfiling.cpp:getOrCreateRegionCounters.
-template <class IntPtrT> struct alignas(8) ProfileData {
+template <class IntPtrT> struct LLVM_CLASS_ABI alignas(8) ProfileData {
   #define INSTR_PROF_DATA(Type, LLVMType, Name, Init) Type Name;
   #include "llvm/ProfileData/InstrProfData.inc"
 };
@@ -1185,7 +1185,7 @@ template <class IntPtrT> struct alignas(8) ProfileData {
 // The definition should match the header referenced in
 // compiler-rt/lib/profile/InstrProfilingFile.c  and
 // InstrProfilingBuffer.c.
-struct Header {
+struct LLVM_CLASS_ABI Header {
 #define INSTR_PROF_RAW_HEADER(Type, Name, Init) const Type Name;
 #include "llvm/ProfileData/InstrProfData.inc"
 };
@@ -1193,11 +1193,11 @@ struct Header {
 } // end namespace RawInstrProf
 
 // Create the variable for the profile file name.
-void createProfileFileNameVar(Module &M, StringRef InstrProfileOutput);
+LLVM_FUNC_ABI void createProfileFileNameVar(Module &M, StringRef InstrProfileOutput);
 
 // Whether to compress function names in profile records, and filenames in
 // code coverage mappings. Used by the Instrumentation library and unit tests.
-extern cl::opt<bool> DoInstrProfNameCompression;
+LLVM_FUNC_ABI extern cl::opt<bool> DoInstrProfNameCompression;
 
 } // end namespace llvm
 #endif // LLVM_PROFILEDATA_INSTRPROF_H
diff --git a/llvm/include/llvm/ProfileData/InstrProfCorrelator.h b/llvm/include/llvm/ProfileData/InstrProfCorrelator.h
index 5096693312df35f..d07dbeba9c9a89a 100644
--- a/llvm/include/llvm/ProfileData/InstrProfCorrelator.h
+++ b/llvm/include/llvm/ProfileData/InstrProfCorrelator.h
@@ -30,7 +30,7 @@ class ObjectFile;
 
 /// InstrProfCorrelator - A base class used to create raw instrumentation data
 /// to their functions.
-class InstrProfCorrelator {
+class LLVM_CLASS_ABI InstrProfCorrelator {
 public:
   static llvm::Expected<std::unique_ptr<InstrProfCorrelator>>
   get(StringRef DebugInfoFilename);
@@ -111,7 +111,7 @@ class InstrProfCorrelator {
 /// InstrProfCorrelatorImpl - A child of InstrProfCorrelator with a template
 /// pointer type so that the ProfileData vector can be materialized.
 template <class IntPtrT>
-class InstrProfCorrelatorImpl : public InstrProfCorrelator {
+class LLVM_CLASS_ABI InstrProfCorrelatorImpl : public InstrProfCorrelator {
 public:
   InstrProfCorrelatorImpl(std::unique_ptr<InstrProfCorrelator::Context> Ctx);
   static bool classof(const InstrProfCorrelator *C);
@@ -156,7 +156,7 @@ class InstrProfCorrelatorImpl : public InstrProfCorrelator {
 /// DwarfInstrProfCorrelator - A child of InstrProfCorrelatorImpl that takes
 /// DWARF debug info as input to correlate profiles.
 template <class IntPtrT>
-class DwarfInstrProfCorrelator : public InstrProfCorrelatorImpl<IntPtrT> {
+class LLVM_CLASS_ABI DwarfInstrProfCorrelator : public InstrProfCorrelatorImpl<IntPtrT> {
 public:
   DwarfInstrProfCorrelator(std::unique_ptr<DWARFContext> DICtx,
                            std::unique_ptr<InstrProfCorrelator::Context> Ctx)
diff --git a/llvm/include/llvm/ProfileData/InstrProfData.inc b/llvm/include/llvm/ProfileData/InstrProfData.inc
index 94261f4705b96c4..60a4beabd670688 100644
--- a/llvm/include/llvm/ProfileData/InstrProfData.inc
+++ b/llvm/include/llvm/ProfileData/InstrProfData.inc
@@ -300,7 +300,7 @@ INSTR_PROF_SECT_ENTRY(IPSK_orderfile, \
  * This is the header of the data structure that defines the on-disk
  * layout of the value profile data of a particular kind for one function.
  */
-typedef struct ValueProfRecord {
+typedef struct LLVM_CLASS_ABI ValueProfRecord {
   /* The kind of the value profile record. */
   uint32_t Kind;
   /*
@@ -350,7 +350,7 @@ typedef struct ValueProfRecord {
  * Per-function header/control data structure for value profiling
  * data in indexed format.
  */
-typedef struct ValueProfData {
+typedef struct LLVM_CLASS_ABI ValueProfData {
   /*
    * Total size in bytes including this field. It must be a multiple
    * of sizeof(uint64_t).
@@ -433,7 +433,7 @@ typedef struct ValueProfData {
  * For documentation of the member methods below, refer to corresponding methods
  * in class InstrProfRecord.
  */
-typedef struct ValueProfRecordClosure {
+typedef struct LLVM_CLASS_ABI ValueProfRecordClosure {
   const void *Record;
   uint32_t (*GetNumValueKinds)(const void *Record);
   uint32_t (*GetNumValueSites)(const void *Record, uint32_t VKind);
@@ -451,13 +451,13 @@ typedef struct ValueProfRecordClosure {
   ValueProfData *(*AllocValueProfData)(size_t TotalSizeInBytes);
 } ValueProfRecordClosure;
 
-INSTR_PROF_VISIBILITY ValueProfRecord *
+INSTR_PROF_VISIBILITY LLVM_FUNC_ABI ValueProfRecord *
 getFirstValueProfRecord(ValueProfData *VPD);
-INSTR_PROF_VISIBILITY ValueProfRecord *
+INSTR_PROF_VISIBILITY LLVM_FUNC_ABI ValueProfRecord *
 getValueProfRecordNext(ValueProfRecord *VPR);
-INSTR_PROF_VISIBILITY InstrProfValueData *
+INSTR_PROF_VISIBILITY LLVM_FUNC_ABI InstrProfValueData *
 getValueProfRecordValueData(ValueProfRecord *VPR);
-INSTR_PROF_VISIBILITY uint32_t
+INSTR_PROF_VISIBILITY LLVM_FUNC_ABI uint32_t
 getValueProfRecordHeaderSize(uint32_t NumValueSites);
 
 #undef INSTR_PROF_VALUE_PROF_DATA
@@ -769,7 +769,7 @@ serializeValueProfDataFrom(ValueProfRecordClosure *Closure,
 /* The data structure that represents a tracked value by the
  * value profiler.
  */
-typedef struct InstrProfValueData {
+typedef struct LLVM_CLASS_ABI InstrProfValueData {
   /* Profiled value. */
   uint64_t Value;
   /* Number of times the value appears in the training run. */
diff --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h
index f0e811980b154fc..dd808f6013d0fdf 100644
--- a/llvm/include/llvm/ProfileData/InstrProfReader.h
+++ b/llvm/include/llvm/ProfileData/InstrProfReader.h
@@ -49,7 +49,7 @@ class FileSystem;
 /// A file format agnostic iterator over profiling data.
 template <class record_type = NamedInstrProfRecord,
           class reader_type = InstrProfReader>
-class InstrProfIterator {
+class LLVM_CLASS_ABI InstrProfIterator {
 public:
   using iterator_category = std::input_iterator_tag;
   using value_type = record_type;
@@ -89,7 +89,7 @@ class InstrProfIterator {
 
 /// Base class and interface for reading profiling data of any known instrprof
 /// format. Provides an iterator over NamedInstrProfRecords.
-class InstrProfReader {
+class LLVM_CLASS_ABI InstrProfReader {
   instrprof_error LastError = instrprof_error::success;
   std::string LastErrorMsg;
 
@@ -232,7 +232,7 @@ class InstrProfReader {
 ///
 /// Each record consists of a function name, a function hash, a number of
 /// counters, and then each counter value, in that order.
-class TextInstrProfReader : public InstrProfReader {
+class LLVM_CLASS_ABI TextInstrProfReader : public InstrProfReader {
 private:
   /// The profile data file contents.
   std::unique_ptr<MemoryBuffer> DataBuffer;
@@ -309,7 +309,7 @@ class TextInstrProfReader : public InstrProfReader {
 /// Templated on the unsigned type whose size matches pointers on the platform
 /// that wrote the profile.
 template <class IntPtrT>
-class RawInstrProfReader : public InstrProfReader {
+class LLVM_CLASS_ABI RawInstrProfReader : public InstrProfReader {
 private:
   /// The profile data file contents.
   std::unique_ptr<MemoryBuffer> DataBuffer;
@@ -472,7 +472,7 @@ enum class HashT : uint32_t;
 
 /// Trait for lookups into the on-disk hash table for the binary instrprof
 /// format.
-class InstrProfLookupTrait {
+class LLVM_CLASS_ABI InstrProfLookupTrait {
   std::vector<NamedInstrProfRecord> DataBuffer;
   IndexedInstrProf::HashT HashType;
   unsigned FormatVersion;
@@ -521,7 +521,7 @@ class InstrProfLookupTrait {
   }
 };
 
-struct InstrProfReaderIndexBase {
+struct LLVM_CLASS_ABI InstrProfReaderIndexBase {
   virtual ~InstrProfReaderIndexBase() = default;
 
   // Read all the profile records with the same key pointed to the current
@@ -558,7 +558,7 @@ template <typename HashTableImpl>
 class InstrProfReaderItaniumRemapper;
 
 template <typename HashTableImpl>
-class InstrProfReaderIndex : public InstrProfReaderIndexBase {
+class LLVM_CLASS_ABI InstrProfReaderIndex : public InstrProfReaderIndexBase {
 private:
   std::unique_ptr<HashTableImpl> HashTable;
   typename HashTableImpl::data_iterator RecordIterator;
@@ -624,7 +624,7 @@ class InstrProfReaderIndex : public InstrProfReaderIndexBase {
 };
 
 /// Name matcher supporting fuzzy matching of symbol names to names in profiles.
-class InstrProfReaderRemapper {
+class LLVM_CLASS_ABI InstrProfReaderRemapper {
 public:
   virtual ~InstrProfReaderRemapper() = default;
   virtual Error populateRemappings() { return Error::success(); }
@@ -633,7 +633,7 @@ class InstrProfReaderRemapper {
 };
 
 /// Reader for the indexed binary instrprof format.
-class IndexedInstrProfReader : public InstrProfReader {
+class LLVM_CLASS_ABI IndexedInstrProfReader : public InstrProfReader {
 private:
   /// The profile data file contents.
   std::unique_ptr<MemoryBuffer> DataBuffer;
diff --git a/llvm/include/llvm/ProfileData/InstrProfWriter.h b/llvm/include/llvm/ProfileData/InstrProfWriter.h
index 9ba4e67ed1bd550..0f6d1ce9a1ad84e 100644
--- a/llvm/include/llvm/ProfileData/InstrProfWriter.h
+++ b/llvm/include/llvm/ProfileData/InstrProfWriter.h
@@ -36,7 +36,7 @@ class ProfOStream;
 class MemoryBuffer;
 class raw_fd_ostream;
 
-class InstrProfWriter {
+class LLVM_CLASS_ABI InstrProfWriter {
 public:
   using ProfilingData = SmallDenseMap<uint64_t, InstrProfRecord>;
 
diff --git a/llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h b/llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h
index 25951537e1d0597..5336e5e1c5482b6 100644
--- a/llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h
+++ b/llvm/include/llvm/ProfileData/ItaniumManglingCanonicalizer.h
@@ -33,7 +33,7 @@ class StringRef;
 /// 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_CLASS_ABI ItaniumManglingCanonicalizer {
 public:
   ItaniumManglingCanonicalizer();
   ItaniumManglingCanonicalizer(const ItaniumManglingCanonicalizer &) = delete;
diff --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h
index 3f1e06738466469..635190e3c797d08 100644
--- a/llvm/include/llvm/ProfileData/MemProf.h
+++ b/llvm/include/llvm/ProfileData/MemProf.h
@@ -30,7 +30,7 @@ using MemProfSchema = llvm::SmallVector<Meta, static_cast<int>(Meta::Size)>;
 // Holds the actual MemInfoBlock data with all fields. Contents may be read or
 // written partially by providing an appropriate schema to the serialize and
 // deserialize methods.
-struct PortableMemInfoBlock {
+struct LLVM_CLASS_ABI PortableMemInfoBlock {
   PortableMemInfoBlock() = default;
   explicit PortableMemInfoBlock(const MemInfoBlock &Block) {
 #define MIBEntryDef(NameTag, Name, Type) Name = Block.Name;
@@ -140,7 +140,7 @@ using FrameId = uint64_t;
 // Describes a call frame for a dynamic allocation context. The contents of
 // the frame are populated by symbolizing the stack depot call frame from the
 // compiler runtime.
-struct Frame {
+struct LLVM_CLASS_ABI Frame {
   // A uuid (uint64_t) identifying the function. It is obtained by
   // llvm::md5(FunctionName) which returns the lower 64 bits.
   GlobalValue::GUID Function;
@@ -252,7 +252,7 @@ struct Frame {
 
 // Holds allocation information in a space efficient format where frames are
 // represented using unique identifiers.
-struct IndexedAllocationInfo {
+struct LLVM_CLASS_ABI IndexedAllocationInfo {
   // The dynamic calling context for the allocation in bottom-up (leaf-to-root)
   // order. Frame contents are stored out-of-line.
   llvm::SmallVector<FrameId> CallStack;
@@ -291,7 +291,7 @@ struct IndexedAllocationInfo {
 
 // Holds allocation information with frame contents inline. The type should
 // be used for temporary in-memory instances.
-struct AllocationInfo {
+struct LLVM_CLASS_ABI AllocationInfo {
   // Same as IndexedAllocationInfo::CallStack with the frame contents inline.
   llvm::SmallVector<Frame> CallStack;
   // Same as IndexedAllocationInfo::Info;
@@ -322,7 +322,7 @@ struct AllocationInfo {
 // Holds the memprof profile information for a function. The internal
 // representation stores frame ids for efficiency. This representation should
 // be used in the profile conversion and manipulation tools.
-struct IndexedMemProfRecord {
+struct LLVM_CLASS_ABI IndexedMemProfRecord {
   // Memory allocation sites in this function for which we have memory
   // profiling data.
   llvm::SmallVector<IndexedAllocationInfo> AllocSites;
@@ -396,7 +396,7 @@ struct IndexedMemProfRecord {
 // Holds the memprof profile information for a function. The internal
 // representation stores frame contents inline. This representation should
 // be used for small amount of temporary, in memory instances.
-struct MemProfRecord {
+struct LLVM_CLASS_ABI MemProfRecord {
   // Same as IndexedMemProfRecord::AllocSites with frame contents inline.
   llvm::SmallVector<AllocationInfo> AllocSites;
   // Same as IndexedMemProfRecord::CallSites with frame contents inline.
@@ -443,10 +443,10 @@ struct MemProfRecord {
 // ids in the schema. Subsequent entries are integers which map to memprof::Meta
 // enum class entries. After successfully reading the schema, the pointer is one
 // byte past the schema contents.
-Expected<MemProfSchema> readMemProfSchema(const unsigned char *&Buffer);
+LLVM_FUNC_ABI Expected<MemProfSchema> readMemProfSchema(const unsigned char *&Buffer);
 
 // Trait for reading IndexedMemProfRecord data from the on-disk hash table.
-class RecordLookupTrait {
+class LLVM_CLASS_ABI RecordLookupTrait {
 public:
   using data_type = const IndexedMemProfRecord &;
   using internal_key_type = uint64_t;
@@ -491,7 +491,7 @@ class RecordLookupTrait {
 };
 
 // Trait for writing IndexedMemProfRecord data to the on-disk hash table.
-class RecordWriterTrait {
+class LLVM_CLASS_ABI RecordWriterTrait {
 public:
   using key_type = uint64_t;
   using key_type_ref = uint64_t;
@@ -537,7 +537,7 @@ class RecordWriterTrait {
 };
 
 // Trait for writing frame mappings to the on-disk hash table.
-class FrameWriterTrait {
+class LLVM_CLASS_ABI FrameWriterTrait {
 public:
   using key_type = FrameId;
   using key_type_ref = FrameId;
@@ -574,7 +574,7 @@ class FrameWriterTrait {
 };
 
 // Trait for reading frame mappings from the on-disk hash table.
-class FrameLookupTrait {
+class LLVM_CLASS_ABI FrameLookupTrait {
 public:
   using data_type = const Frame;
   using internal_key_type = FrameId;
diff --git a/llvm/include/llvm/ProfileData/MemProfData.inc b/llvm/include/llvm/ProfileData/MemProfData.inc
index b82a4baf6dd74e6..263d6b951315e5c 100644
--- a/llvm/include/llvm/ProfileData/MemProfData.inc
+++ b/llvm/include/llvm/ProfileData/MemProfData.inc
@@ -97,7 +97,7 @@ __pragma(pack(push,1))
 // runtime context. This struct is shared between the compiler-rt runtime and
 // the raw profile reader. The indexed format uses a separate, self-describing
 // backwards compatible format.
-struct MemInfoBlock{
+struct LLVM_CLASS_ABI MemInfoBlock{
 
 #define MIBEntryDef(NameTag, Name, Type) Type Name;
 #include "MIBEntryDef.inc"
diff --git a/llvm/include/llvm/ProfileData/ProfileCommon.h b/llvm/include/llvm/ProfileData/ProfileCommon.h
index 7b0142a26b81a3e..84d50b521eea06f 100644
--- a/llvm/include/llvm/ProfileData/ProfileCommon.h
+++ b/llvm/include/llvm/ProfileData/ProfileCommon.h
@@ -29,13 +29,13 @@
 
 namespace llvm {
 
-extern cl::opt<bool> UseContextLessSummary;
-extern cl::opt<int> ProfileSummaryCutoffHot;
-extern cl::opt<int> ProfileSummaryCutoffCold;
-extern cl::opt<unsigned> ProfileSummaryHugeWorkingSetSizeThreshold;
-extern cl::opt<unsigned> ProfileSummaryLargeWorkingSetSizeThreshold;
-extern cl::opt<uint64_t> ProfileSummaryHotCount;
-extern cl::opt<uint64_t> ProfileSummaryColdCount;
+LLVM_FUNC_ABI extern cl::opt<bool> UseContextLessSummary;
+LLVM_FUNC_ABI extern cl::opt<int> ProfileSummaryCutoffHot;
+LLVM_FUNC_ABI extern cl::opt<int> ProfileSummaryCutoffCold;
+LLVM_FUNC_ABI extern cl::opt<unsigned> ProfileSummaryHugeWorkingSetSizeThreshold;
+LLVM_FUNC_ABI extern cl::opt<unsigned> ProfileSummaryLargeWorkingSetSizeThreshold;
+LLVM_FUNC_ABI extern cl::opt<uint64_t> ProfileSummaryHotCount;
+LLVM_FUNC_ABI extern cl::opt<uint64_t> ProfileSummaryColdCount;
 
 namespace sampleprof {
 
@@ -43,7 +43,7 @@ class FunctionSamples;
 
 } // end namespace sampleprof
 
-class ProfileSummaryBuilder {
+class LLVM_CLASS_ABI ProfileSummaryBuilder {
 private:
   /// We keep track of the number of times a count (block count or samples)
   /// appears in the profile. The map is kept sorted in the descending order of
@@ -77,7 +77,7 @@ class ProfileSummaryBuilder {
   static uint64_t getColdCountThreshold(const SummaryEntryVector &DS);
 };
 
-class InstrProfSummaryBuilder final : public ProfileSummaryBuilder {
+class LLVM_CLASS_ABI InstrProfSummaryBuilder final : public ProfileSummaryBuilder {
   uint64_t MaxInternalBlockCount = 0;
 
   inline void addEntryCount(uint64_t Count);
@@ -91,7 +91,7 @@ class InstrProfSummaryBuilder final : public ProfileSummaryBuilder {
   std::unique_ptr<ProfileSummary> getSummary();
 };
 
-class SampleProfileSummaryBuilder final : public ProfileSummaryBuilder {
+class LLVM_CLASS_ABI SampleProfileSummaryBuilder final : public ProfileSummaryBuilder {
 public:
   SampleProfileSummaryBuilder(std::vector<uint32_t> Cutoffs)
       : ProfileSummaryBuilder(std::move(Cutoffs)) {}
diff --git a/llvm/include/llvm/ProfileData/RawMemProfReader.h b/llvm/include/llvm/ProfileData/RawMemProfReader.h
index 85b6d8bc7e144c2..158096ca8600779 100644
--- a/llvm/include/llvm/ProfileData/RawMemProfReader.h
+++ b/llvm/include/llvm/ProfileData/RawMemProfReader.h
@@ -36,7 +36,7 @@ namespace memprof {
 // each program counter address in the callstack.
 using CallStackMap = llvm::DenseMap<uint64_t, llvm::SmallVector<uint64_t>>;
 
-class RawMemProfReader {
+class LLVM_CLASS_ABI RawMemProfReader {
 public:
   RawMemProfReader(const RawMemProfReader &) = delete;
   RawMemProfReader &operator=(const RawMemProfReader &) = delete;
diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h
index 309e0be6b5aa12b..b449e413e34cfa5 100644
--- a/llvm/include/llvm/ProfileData/SampleProf.h
+++ b/llvm/include/llvm/ProfileData/SampleProf.h
@@ -42,7 +42,7 @@ namespace llvm {
 class DILocation;
 class raw_ostream;
 
-const std::error_category &sampleprof_category();
+LLVM_FUNC_ABI const std::error_category &sampleprof_category();
 
 enum class sampleprof_error {
   success = 0,
@@ -81,7 +81,7 @@ inline sampleprof_error MergeResult(sampleprof_error &Accumulator,
 namespace std {
 
 template <>
-struct is_error_code_enum<llvm::sampleprof_error> : std::true_type {};
+struct LLVM_CLASS_ABI is_error_code_enum<llvm::sampleprof_error> : std::true_type {};
 
 } // end namespace std
 
@@ -163,7 +163,7 @@ static inline std::string getSecName(SecType Type) {
 
 // Entry type of section header table used by SampleProfileExtBinaryBaseReader
 // and SampleProfileExtBinaryBaseWriter.
-struct SecHdrTableEntry {
+struct LLVM_CLASS_ABI SecHdrTableEntry {
   SecType Type;
   uint64_t Flags;
   uint64_t Offset;
@@ -287,7 +287,7 @@ static inline bool hasSecFlag(const SecHdrTableEntry &Entry, SecFlagType Flag) {
 /// The discriminator value is useful to distinguish instructions
 /// that are on the same line but belong to different basic blocks
 /// (e.g., the two post-increment instructions in "if (p) x++; else y++;").
-struct LineLocation {
+struct LLVM_CLASS_ABI LineLocation {
   LineLocation(uint32_t L, uint32_t D) : LineOffset(L), Discriminator(D) {}
 
   void print(raw_ostream &OS) const;
@@ -310,14 +310,14 @@ struct LineLocation {
   uint32_t Discriminator;
 };
 
-struct LineLocationHash {
+struct LLVM_CLASS_ABI LineLocationHash {
   uint64_t operator()(const LineLocation &Loc) const {
     return std::hash<std::uint64_t>{}((((uint64_t)Loc.LineOffset) << 32) |
                                       Loc.Discriminator);
   }
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const LineLocation &Loc);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const LineLocation &Loc);
 
 /// Representation of a single sample record.
 ///
@@ -329,7 +329,7 @@ raw_ostream &operator<<(raw_ostream &OS, const LineLocation &Loc);
 /// direct calls, this will be the exact function being invoked. For
 /// indirect calls (function pointers, virtual table dispatch), this
 /// will be a list of one or more functions.
-class SampleRecord {
+class LLVM_CLASS_ABI SampleRecord {
 public:
   using CallTarget = std::pair<StringRef, uint64_t>;
   struct CallTargetComparator {
@@ -447,7 +447,7 @@ class SampleRecord {
   CallTargetMap CallTargets;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const SampleRecord &Sample);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const SampleRecord &Sample);
 
 // State of context associated with FunctionSamples
 enum ContextStateMask {
@@ -468,7 +468,7 @@ enum ContextAttributeMask {
 };
 
 // Represents a context frame with function name and line location
-struct SampleContextFrame {
+struct LLVM_CLASS_ABI SampleContextFrame {
   StringRef FuncName;
   LineLocation Location;
 
@@ -505,7 +505,7 @@ static inline hash_code hash_value(const SampleContextFrame &arg) {
 using SampleContextFrameVector = SmallVector<SampleContextFrame, 1>;
 using SampleContextFrames = ArrayRef<SampleContextFrame>;
 
-struct SampleContextFrameHash {
+struct LLVM_CLASS_ABI SampleContextFrameHash {
   uint64_t operator()(const SampleContextFrameVector &S) const {
     return hash_combine_range(S.begin(), S.end());
   }
@@ -521,7 +521,7 @@ struct SampleContextFrameHash {
 // For a base CS profile without calling context, the context vector should only
 // contain the leaf frame name.
 // For a non-CS profile, the context vector should be empty.
-class SampleContext {
+class LLVM_CLASS_ABI SampleContext {
 public:
   SampleContext() : State(UnknownContext), Attributes(ContextNone) {}
 
@@ -732,7 +732,7 @@ using LocToLocMap =
 /// This data structure contains all the collected samples for the body
 /// of a function. Each sample corresponds to a LineLocation instance
 /// within the body of the function.
-class FunctionSamples {
+class LLVM_CLASS_ABI FunctionSamples {
 public:
   FunctionSamples() = default;
 
@@ -1270,21 +1270,21 @@ class FunctionSamples {
   const LocToLocMap *IRToProfileLocationMap = nullptr;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const FunctionSamples &FS);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const FunctionSamples &FS);
 
 using SampleProfileMap =
     std::unordered_map<SampleContext, FunctionSamples, SampleContext::Hash>;
 
 using NameFunctionSamples = std::pair<SampleContext, const FunctionSamples *>;
 
-void sortFuncProfiles(const SampleProfileMap &ProfileMap,
+LLVM_FUNC_ABI void sortFuncProfiles(const SampleProfileMap &ProfileMap,
                       std::vector<NameFunctionSamples> &SortedProfiles);
 
 /// Sort a LocationT->SampleT map by LocationT.
 ///
 /// It produces a sorted list of <LocationT, SampleT> records by ascending
 /// order of LocationT.
-template <class LocationT, class SampleT> class SampleSorter {
+template <class LocationT, class SampleT> class LLVM_CLASS_ABI SampleSorter {
 public:
   using SamplesWithLoc = std::pair<const LocationT, SampleT>;
   using SamplesWithLocList = SmallVector<const SamplesWithLoc *, 20>;
@@ -1306,7 +1306,7 @@ template <class LocationT, class SampleT> class SampleSorter {
 /// SampleContextTrimmer impelements helper functions to trim, merge cold
 /// context profiles. It also supports context profile canonicalization to make
 /// sure ProfileMap's key is consistent with FunctionSample's name/context.
-class SampleContextTrimmer {
+class LLVM_CLASS_ABI SampleContextTrimmer {
 public:
   SampleContextTrimmer(SampleProfileMap &Profiles) : ProfileMap(Profiles){};
   // Trim and merge cold context profile when requested. TrimBaseProfileOnly
@@ -1332,7 +1332,7 @@ class SampleContextTrimmer {
 ///
 /// It supports full context-sensitive profile to nested profile conversion,
 /// nested profile to flatten profile conversion, etc.
-class ProfileConverter {
+class LLVM_CLASS_ABI ProfileConverter {
 public:
   ProfileConverter(SampleProfileMap &Profiles);
   // Convert a full context-sensitive flat sample profile into a nested sample
@@ -1445,7 +1445,7 @@ class ProfileConverter {
 /// in the binary used to generate the profile. It is useful to
 /// to discriminate a function being so cold as not to shown up
 /// in the profile and a function newly added.
-class ProfileSymbolList {
+class LLVM_CLASS_ABI ProfileSymbolList {
 public:
   /// copy indicates whether we need to copy the underlying memory
   /// for the input Name.
@@ -1486,7 +1486,7 @@ class ProfileSymbolList {
 
 using namespace sampleprof;
 // Provide DenseMapInfo for SampleContext.
-template <> struct DenseMapInfo<SampleContext> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<SampleContext> {
   static inline SampleContext getEmptyKey() { return SampleContext(); }
 
   static inline SampleContext getTombstoneKey() { return SampleContext("@"); }
diff --git a/llvm/include/llvm/ProfileData/SampleProfReader.h b/llvm/include/llvm/ProfileData/SampleProfReader.h
index 6b115603774399d..d439ccf9aec465f 100644
--- a/llvm/include/llvm/ProfileData/SampleProfReader.h
+++ b/llvm/include/llvm/ProfileData/SampleProfReader.h
@@ -263,7 +263,7 @@ class SampleProfileReader;
 /// SampleProfileReaderItaniumRemapper remaps the profile data from a
 /// sample profile data reader, by applying a provided set of equivalences
 /// between components of the symbol names in the profile.
-class SampleProfileReaderItaniumRemapper {
+class LLVM_CLASS_ABI SampleProfileReaderItaniumRemapper {
 public:
   SampleProfileReaderItaniumRemapper(std::unique_ptr<MemoryBuffer> B,
                                      std::unique_ptr<SymbolRemappingReader> SRR,
@@ -344,7 +344,7 @@ class SampleProfileReaderItaniumRemapper {
 /// The reader supports two file formats: text and binary. The text format
 /// is useful for debugging and testing, while the binary format is more
 /// compact and I/O efficient. They can both be used interchangeably.
-class SampleProfileReader {
+class LLVM_CLASS_ABI SampleProfileReader {
 public:
   SampleProfileReader(std::unique_ptr<MemoryBuffer> B, LLVMContext &C,
                       SampleProfileFormat Format = SPF_None)
@@ -577,7 +577,7 @@ class SampleProfileReader {
   bool ProfileIsMD5 = false;
 };
 
-class SampleProfileReaderText : public SampleProfileReader {
+class LLVM_CLASS_ABI SampleProfileReaderText : public SampleProfileReader {
 public:
   SampleProfileReaderText(std::unique_ptr<MemoryBuffer> B, LLVMContext &C)
       : SampleProfileReader(std::move(B), C, SPF_Text) {}
@@ -600,7 +600,7 @@ class SampleProfileReaderText : public SampleProfileReader {
   std::list<SampleContextFrameVector> CSNameTable;
 };
 
-class SampleProfileReaderBinary : public SampleProfileReader {
+class LLVM_CLASS_ABI SampleProfileReaderBinary : public SampleProfileReader {
 public:
   SampleProfileReaderBinary(std::unique_ptr<MemoryBuffer> B, LLVMContext &C,
                             SampleProfileFormat Format = SPF_None)
@@ -695,7 +695,7 @@ class SampleProfileReaderBinary : public SampleProfileReader {
   virtual std::error_code verifySPMagic(uint64_t Magic) = 0;
 };
 
-class SampleProfileReaderRawBinary : public SampleProfileReaderBinary {
+class LLVM_CLASS_ABI SampleProfileReaderRawBinary : public SampleProfileReaderBinary {
 private:
   std::error_code verifySPMagic(uint64_t Magic) override;
 
@@ -727,7 +727,7 @@ class SampleProfileReaderRawBinary : public SampleProfileReaderBinary {
 /// commonly used sections of a profile in extensible binary format. It is
 /// possible to define other types of profile inherited from
 /// SampleProfileReaderExtBinaryBase/SampleProfileWriterExtBinaryBase.
-class SampleProfileReaderExtBinaryBase : public SampleProfileReaderBinary {
+class LLVM_CLASS_ABI SampleProfileReaderExtBinaryBase : public SampleProfileReaderBinary {
 private:
   std::error_code decompressSection(const uint8_t *SecStart,
                                     const uint64_t SecSize,
@@ -804,7 +804,7 @@ class SampleProfileReaderExtBinaryBase : public SampleProfileReaderBinary {
   void setSkipFlatProf(bool Skip) override { SkipFlatProf = Skip; }
 };
 
-class SampleProfileReaderExtBinary : public SampleProfileReaderExtBinaryBase {
+class LLVM_CLASS_ABI SampleProfileReaderExtBinary : public SampleProfileReaderExtBinaryBase {
 private:
   std::error_code verifySPMagic(uint64_t Magic) override;
   std::error_code readCustomSection(const SecHdrTableEntry &Entry) override {
@@ -837,7 +837,7 @@ enum HistType {
   HIST_TYPE_INDIR_CALL_TOPN
 };
 
-class SampleProfileReaderGCC : public SampleProfileReader {
+class LLVM_CLASS_ABI SampleProfileReaderGCC : public SampleProfileReader {
 public:
   SampleProfileReaderGCC(std::unique_ptr<MemoryBuffer> B, LLVMContext &C)
       : SampleProfileReader(std::move(B), C, SPF_GCC),
diff --git a/llvm/include/llvm/ProfileData/SampleProfWriter.h b/llvm/include/llvm/ProfileData/SampleProfWriter.h
index 7495bdfb0aa71ae..64b22aceff1811b 100644
--- a/llvm/include/llvm/ProfileData/SampleProfWriter.h
+++ b/llvm/include/llvm/ProfileData/SampleProfWriter.h
@@ -40,7 +40,7 @@ enum SectionLayout {
 /// strategy to reduce function count other than dropping functions with fewest
 /// samples first. In this case a class implementing the same interfaces should
 /// be provided to SampleProfileWriter::writeWithSizeLimit().
-class FunctionPruningStrategy {
+class LLVM_CLASS_ABI FunctionPruningStrategy {
 protected:
   SampleProfileMap &ProfileMap;
   size_t OutputSizeLimit;
@@ -66,7 +66,7 @@ class FunctionPruningStrategy {
   virtual void Erase(size_t CurrentOutputSize) = 0;
 };
 
-class DefaultFunctionPruningStrategy : public FunctionPruningStrategy {
+class LLVM_CLASS_ABI DefaultFunctionPruningStrategy : public FunctionPruningStrategy {
   std::vector<NameFunctionSamples> SortedFunctions;
 
 public:
@@ -87,7 +87,7 @@ class DefaultFunctionPruningStrategy : public FunctionPruningStrategy {
 };
 
 /// Sample-based profile writer. Base class.
-class SampleProfileWriter {
+class LLVM_CLASS_ABI SampleProfileWriter {
 public:
   virtual ~SampleProfileWriter() = default;
 
@@ -164,7 +164,7 @@ class SampleProfileWriter {
 };
 
 /// Sample-based profile writer (text format).
-class SampleProfileWriterText : public SampleProfileWriter {
+class LLVM_CLASS_ABI SampleProfileWriterText : public SampleProfileWriter {
 public:
   std::error_code writeSample(const FunctionSamples &S) override;
 
@@ -189,7 +189,7 @@ class SampleProfileWriterText : public SampleProfileWriter {
 };
 
 /// Sample-based profile writer (binary format).
-class SampleProfileWriterBinary : public SampleProfileWriter {
+class LLVM_CLASS_ABI SampleProfileWriterBinary : public SampleProfileWriter {
 public:
   SampleProfileWriterBinary(std::unique_ptr<raw_ostream> &OS)
       : SampleProfileWriter(OS) {}
@@ -220,7 +220,7 @@ class SampleProfileWriterBinary : public SampleProfileWriter {
                               SampleProfileFormat Format);
 };
 
-class SampleProfileWriterRawBinary : public SampleProfileWriterBinary {
+class LLVM_CLASS_ABI SampleProfileWriterRawBinary : public SampleProfileWriterBinary {
   using SampleProfileWriterBinary::SampleProfileWriterBinary;
 };
 
@@ -255,7 +255,7 @@ const std::array<SmallVector<SecHdrTableEntry, 8>, NumOfLayout>
                                           {SecFuncMetadata, 0, 0, 0, 0}}),
 };
 
-class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
+class LLVM_CLASS_ABI SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
   using SampleProfileWriterBinary::SampleProfileWriterBinary;
 public:
   std::error_code write(const SampleProfileMap &ProfileMap) override;
@@ -394,7 +394,7 @@ class SampleProfileWriterExtBinaryBase : public SampleProfileWriterBinary {
   ProfileSymbolList *ProfSymList = nullptr;
 };
 
-class SampleProfileWriterExtBinary : public SampleProfileWriterExtBinaryBase {
+class LLVM_CLASS_ABI SampleProfileWriterExtBinary : public SampleProfileWriterExtBinaryBase {
 public:
   SampleProfileWriterExtBinary(std::unique_ptr<raw_ostream> &OS)
       : SampleProfileWriterExtBinaryBase(OS) {}
diff --git a/llvm/include/llvm/ProfileData/SymbolRemappingReader.h b/llvm/include/llvm/ProfileData/SymbolRemappingReader.h
index ecfe40c5755d4d5..33c91d409e01d27 100644
--- a/llvm/include/llvm/ProfileData/SymbolRemappingReader.h
+++ b/llvm/include/llvm/ProfileData/SymbolRemappingReader.h
@@ -68,7 +68,7 @@ namespace llvm {
 
 class MemoryBuffer;
 
-class SymbolRemappingParseError : public ErrorInfo<SymbolRemappingParseError> {
+class LLVM_CLASS_ABI SymbolRemappingParseError : public ErrorInfo<SymbolRemappingParseError> {
 public:
   SymbolRemappingParseError(StringRef File, int64_t Line, const Twine &Message)
       : File(File), Line(Line), Message(Message.str()) {}
@@ -96,7 +96,7 @@ class SymbolRemappingParseError : public ErrorInfo<SymbolRemappingParseError> {
 ///
 /// 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_CLASS_ABI SymbolRemappingReader {
 public:
   /// Read remappings from the given buffer, which must live as long as
   /// the remapper.
diff --git a/llvm/include/llvm/Remarks/BitstreamRemarkParser.h b/llvm/include/llvm/Remarks/BitstreamRemarkParser.h
index 5c5edf20314a356..d8044a5ad7857c8 100644
--- a/llvm/include/llvm/Remarks/BitstreamRemarkParser.h
+++ b/llvm/include/llvm/Remarks/BitstreamRemarkParser.h
@@ -27,7 +27,7 @@ namespace llvm {
 namespace remarks {
 
 /// Helper to parse a META_BLOCK for a bitstream remark container.
-struct BitstreamMetaParserHelper {
+struct LLVM_CLASS_ABI BitstreamMetaParserHelper {
   /// The Bitstream reader.
   BitstreamCursor &Stream;
   /// Reference to the storage for the block info.
@@ -52,7 +52,7 @@ struct BitstreamMetaParserHelper {
 };
 
 /// Helper to parse a REMARK_BLOCK for a bitstream remark container.
-struct BitstreamRemarkParserHelper {
+struct LLVM_CLASS_ABI BitstreamRemarkParserHelper {
   /// The Bitstream reader.
   BitstreamCursor &Stream;
   /// The parsed content: depending on the remark, some fields might be empty.
@@ -87,7 +87,7 @@ struct BitstreamRemarkParserHelper {
 };
 
 /// Helper to parse any bitstream remark container.
-struct BitstreamParserHelper {
+struct LLVM_CLASS_ABI BitstreamParserHelper {
   /// The Bitstream reader.
   BitstreamCursor Stream;
   /// The block info block.
diff --git a/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h b/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h
index cf26b3b9c95531f..ff9bfddf603f4ee 100644
--- a/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h
+++ b/llvm/include/llvm/Remarks/BitstreamRemarkSerializer.h
@@ -49,7 +49,7 @@ struct Remarks;
 ///                         | Remark2
 ///                         | ...
 ///
-struct BitstreamRemarkSerializerHelper {
+struct LLVM_CLASS_ABI BitstreamRemarkSerializerHelper {
   /// Buffer used for encoding the bitstream before writing it to the final
   /// stream.
   SmallVector<char, 1024> Encoded;
@@ -122,7 +122,7 @@ struct BitstreamRemarkSerializerHelper {
 };
 
 /// Implementation of the remark serializer using LLVM bitstream.
-struct BitstreamRemarkSerializer : public RemarkSerializer {
+struct LLVM_CLASS_ABI BitstreamRemarkSerializer : public RemarkSerializer {
   /// The file should contain:
   /// 1) The block info block that describes how to read the blocks.
   /// 2) The metadata block that contains various information about the remarks
@@ -158,7 +158,7 @@ struct BitstreamRemarkSerializer : public RemarkSerializer {
 };
 
 /// Serializer of metadata for bitstream remarks.
-struct BitstreamMetaSerializer : public MetaSerializer {
+struct LLVM_CLASS_ABI BitstreamMetaSerializer : public MetaSerializer {
   /// This class can be used with [1] a pre-constructed
   /// BitstreamRemarkSerializerHelper, or with [2] one that is owned by the meta
   /// serializer. In case of [1], we need to be able to store a reference to the
diff --git a/llvm/include/llvm/Remarks/HotnessThresholdParser.h b/llvm/include/llvm/Remarks/HotnessThresholdParser.h
index 737c8cde15fccd3..9d696bf51dcfad2 100644
--- a/llvm/include/llvm/Remarks/HotnessThresholdParser.h
+++ b/llvm/include/llvm/Remarks/HotnessThresholdParser.h
@@ -43,7 +43,7 @@ inline Expected<std::optional<uint64_t>> parseHotnessThresholdOption(StringRef A
 }
 
 // A simple CL parser for '*-remarks-hotness-threshold='
-class HotnessThresholdParser : public cl::parser<std::optional<uint64_t>> {
+class LLVM_CLASS_ABI HotnessThresholdParser : public cl::parser<std::optional<uint64_t>> {
 public:
   HotnessThresholdParser(cl::Option &O) : cl::parser<std::optional<uint64_t>>(O) {}
 
diff --git a/llvm/include/llvm/Remarks/Remark.h b/llvm/include/llvm/Remarks/Remark.h
index 3cbe7b6e60f7af5..9918ab968298b43 100644
--- a/llvm/include/llvm/Remarks/Remark.h
+++ b/llvm/include/llvm/Remarks/Remark.h
@@ -28,7 +28,7 @@ namespace remarks {
 constexpr uint64_t CurrentRemarkVersion = 0;
 
 /// The debug location used to track a remark back to the source file.
-struct RemarkLocation {
+struct LLVM_CLASS_ABI RemarkLocation {
   /// Absolute path of the source file corresponding to this remark.
   StringRef SourceFilePath;
   unsigned SourceLine = 0;
@@ -40,7 +40,7 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(RemarkLocation, LLVMRemarkDebugLocRef)
 
 /// A key-value pair with a debug location that is used to display the remarks
 /// at the right place in the source.
-struct Argument {
+struct LLVM_CLASS_ABI Argument {
   StringRef Key;
   // FIXME: We might want to be able to store other types than strings here.
   StringRef Val;
@@ -65,7 +65,7 @@ enum class Type {
 };
 
 /// A remark type used for both emission and parsing.
-struct Remark {
+struct LLVM_CLASS_ABI Remark {
   /// The type of the remark.
   Type RemarkType = Type::Unknown;
 
diff --git a/llvm/include/llvm/Remarks/RemarkFormat.h b/llvm/include/llvm/Remarks/RemarkFormat.h
index 009c92a2376633b..63d45a43c1a2cfe 100644
--- a/llvm/include/llvm/Remarks/RemarkFormat.h
+++ b/llvm/include/llvm/Remarks/RemarkFormat.h
@@ -26,10 +26,10 @@ constexpr StringLiteral Magic("REMARKS");
 enum class Format { Unknown, YAML, YAMLStrTab, Bitstream };
 
 /// Parse and validate a string for the remark format.
-Expected<Format> parseFormat(StringRef FormatStr);
+LLVM_FUNC_ABI Expected<Format> parseFormat(StringRef FormatStr);
 
 /// Parse and validate a magic number to a remark format.
-Expected<Format> magicToFormat(StringRef Magic);
+LLVM_FUNC_ABI Expected<Format> magicToFormat(StringRef Magic);
 
 } // end namespace remarks
 } // end namespace llvm
diff --git a/llvm/include/llvm/Remarks/RemarkLinker.h b/llvm/include/llvm/Remarks/RemarkLinker.h
index cd1a4a6e93c2318..353b495fda539fc 100644
--- a/llvm/include/llvm/Remarks/RemarkLinker.h
+++ b/llvm/include/llvm/Remarks/RemarkLinker.h
@@ -30,7 +30,7 @@ class ObjectFile;
 
 namespace remarks {
 
-struct RemarkLinker {
+struct LLVM_CLASS_ABI RemarkLinker {
 private:
   /// Compare through the pointers.
   struct RemarkPtrCompare {
@@ -110,7 +110,7 @@ struct RemarkLinker {
 /// Returns a buffer with the contents of the remarks section depending on the
 /// format of the file. If the section doesn't exist, this returns an empty
 /// optional.
-Expected<std::optional<StringRef>>
+LLVM_FUNC_ABI Expected<std::optional<StringRef>>
 getRemarksSectionContents(const object::ObjectFile &Obj);
 
 } // end namespace remarks
diff --git a/llvm/include/llvm/Remarks/RemarkParser.h b/llvm/include/llvm/Remarks/RemarkParser.h
index fe3b323f0de37cf..99652ccbf06ff12 100644
--- a/llvm/include/llvm/Remarks/RemarkParser.h
+++ b/llvm/include/llvm/Remarks/RemarkParser.h
@@ -25,7 +25,7 @@ namespace remarks {
 
 struct Remark;
 
-class EndOfFileError : public ErrorInfo<EndOfFileError> {
+class LLVM_CLASS_ABI EndOfFileError : public ErrorInfo<EndOfFileError> {
 public:
   static char ID;
 
@@ -38,7 +38,7 @@ class EndOfFileError : public ErrorInfo<EndOfFileError> {
 };
 
 /// Parser used to parse a raw buffer to remarks::Remark objects.
-struct RemarkParser {
+struct LLVM_CLASS_ABI RemarkParser {
   /// The format of the parser.
   Format ParserFormat;
   /// Path to prepend when opening an external remark file.
@@ -58,7 +58,7 @@ struct RemarkParser {
 
 /// In-memory representation of the string table parsed from a buffer (e.g. the
 /// remarks section).
-struct ParsedStringTable {
+struct LLVM_CLASS_ABI ParsedStringTable {
   /// The buffer mapped from the section contents.
   StringRef Buffer;
   /// This object has high changes to be std::move'd around, so don't use a
@@ -77,14 +77,14 @@ struct ParsedStringTable {
   Expected<StringRef> operator[](size_t Index) const;
 };
 
-Expected<std::unique_ptr<RemarkParser>> createRemarkParser(Format ParserFormat,
+LLVM_FUNC_ABI Expected<std::unique_ptr<RemarkParser>> createRemarkParser(Format ParserFormat,
                                                            StringRef Buf);
 
-Expected<std::unique_ptr<RemarkParser>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<RemarkParser>>
 createRemarkParser(Format ParserFormat, StringRef Buf,
                    ParsedStringTable StrTab);
 
-Expected<std::unique_ptr<RemarkParser>> createRemarkParserFromMeta(
+LLVM_FUNC_ABI Expected<std::unique_ptr<RemarkParser>> createRemarkParserFromMeta(
     Format ParserFormat, StringRef Buf,
     std::optional<ParsedStringTable> StrTab = std::nullopt,
     std::optional<StringRef> ExternalFilePrependPath = std::nullopt);
diff --git a/llvm/include/llvm/Remarks/RemarkSerializer.h b/llvm/include/llvm/Remarks/RemarkSerializer.h
index 64361cd3afaf63f..81b755823c1c5f1 100644
--- a/llvm/include/llvm/Remarks/RemarkSerializer.h
+++ b/llvm/include/llvm/Remarks/RemarkSerializer.h
@@ -40,7 +40,7 @@ struct MetaSerializer;
 
 /// This is the base class for a remark serializer.
 /// It includes support for using a string table while emitting.
-struct RemarkSerializer {
+struct LLVM_CLASS_ABI RemarkSerializer {
   /// The format of the serializer.
   Format SerializerFormat;
   /// The open raw_ostream that the remark diagnostics are emitted to.
@@ -66,7 +66,7 @@ struct RemarkSerializer {
 };
 
 /// This is the base class for a remark metadata serializer.
-struct MetaSerializer {
+struct LLVM_CLASS_ABI MetaSerializer {
   /// The open raw_ostream that the metadata is emitted to.
   raw_ostream &OS;
 
@@ -78,12 +78,12 @@ struct MetaSerializer {
 };
 
 /// Create a remark serializer.
-Expected<std::unique_ptr<RemarkSerializer>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<RemarkSerializer>>
 createRemarkSerializer(Format RemarksFormat, SerializerMode Mode,
                        raw_ostream &OS);
 
 /// Create a remark serializer that uses a pre-filled string table.
-Expected<std::unique_ptr<RemarkSerializer>>
+LLVM_FUNC_ABI Expected<std::unique_ptr<RemarkSerializer>>
 createRemarkSerializer(Format RemarksFormat, SerializerMode Mode,
                        raw_ostream &OS, remarks::StringTable StrTab);
 
diff --git a/llvm/include/llvm/Remarks/RemarkStreamer.h b/llvm/include/llvm/Remarks/RemarkStreamer.h
index 37c2b47046b9cd4..bdf620ddbc05be2 100644
--- a/llvm/include/llvm/Remarks/RemarkStreamer.h
+++ b/llvm/include/llvm/Remarks/RemarkStreamer.h
@@ -42,7 +42,7 @@ namespace llvm {
 class raw_ostream;
 
 namespace remarks {
-class RemarkStreamer final {
+class LLVM_CLASS_ABI RemarkStreamer final {
   /// The regex used to filter remarks based on the passes that emit them.
   std::optional<Regex> PassFilter;
   /// The object used to serialize the remarks to a specific format.
diff --git a/llvm/include/llvm/Remarks/RemarkStringTable.h b/llvm/include/llvm/Remarks/RemarkStringTable.h
index 351b23faaa56036..0f8925bb767a8ca 100644
--- a/llvm/include/llvm/Remarks/RemarkStringTable.h
+++ b/llvm/include/llvm/Remarks/RemarkStringTable.h
@@ -34,7 +34,7 @@ struct Remark;
 /// The string table used for serializing remarks.
 /// This table can be for example serialized in a section to be consumed after
 /// the compilation.
-struct StringTable {
+struct LLVM_CLASS_ABI StringTable {
   /// The string table containing all the unique strings used in the output.
   /// It maps a string to an unique ID.
   StringMap<unsigned, BumpPtrAllocator> StrTab;
diff --git a/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h b/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h
index 95353e92d0a8df2..f807d4eae1b3dcd 100644
--- a/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h
+++ b/llvm/include/llvm/Remarks/YAMLRemarkSerializer.h
@@ -32,7 +32,7 @@ namespace remarks {
 ///   - <KEY>: <VALUE>
 ///     DebugLoc:        { File: <FILE>, Line: <LINE>, Column: <COL> }
 /// ...
-struct YAMLRemarkSerializer : public RemarkSerializer {
+struct LLVM_CLASS_ABI YAMLRemarkSerializer : public RemarkSerializer {
   /// The YAML streamer.
   yaml::Output YAMLOutput;
 
@@ -54,7 +54,7 @@ struct YAMLRemarkSerializer : public RemarkSerializer {
                        std::optional<StringTable> StrTab = std::nullopt);
 };
 
-struct YAMLMetaSerializer : public MetaSerializer {
+struct LLVM_CLASS_ABI YAMLMetaSerializer : public MetaSerializer {
   std::optional<StringRef> ExternalFilename;
 
   YAMLMetaSerializer(raw_ostream &OS, std::optional<StringRef> ExternalFilename)
@@ -66,7 +66,7 @@ struct YAMLMetaSerializer : public MetaSerializer {
 /// Serialize the remarks to YAML using a string table. An remark entry looks
 /// like the regular YAML remark but instead of string entries it's using
 /// numbers that map to an index in the string table.
-struct YAMLStrTabRemarkSerializer : public YAMLRemarkSerializer {
+struct LLVM_CLASS_ABI YAMLStrTabRemarkSerializer : public YAMLRemarkSerializer {
   /// Wether we already emitted the metadata in standalone mode.
   /// This should be set to true after the first invocation of `emit`.
   bool DidEmitMeta = false;
@@ -92,7 +92,7 @@ struct YAMLStrTabRemarkSerializer : public YAMLRemarkSerializer {
   }
 };
 
-struct YAMLStrTabMetaSerializer : public YAMLMetaSerializer {
+struct LLVM_CLASS_ABI YAMLStrTabMetaSerializer : public YAMLMetaSerializer {
   /// The string table is part of the metadata.
   const StringTable &StrTab;
 
diff --git a/llvm/include/llvm/Support/AMDGPUMetadata.h b/llvm/include/llvm/Support/AMDGPUMetadata.h
index a0ab3992f702dad..867fa3380ed1b7e 100644
--- a/llvm/include/llvm/Support/AMDGPUMetadata.h
+++ b/llvm/include/llvm/Support/AMDGPUMetadata.h
@@ -136,7 +136,7 @@ constexpr char RuntimeHandle[] = "RuntimeHandle";
 } // end namespace Key
 
 /// In-memory representation of kernel attributes metadata.
-struct Metadata final {
+struct LLVM_CLASS_ABI Metadata final {
   /// 'reqd_work_group_size' attribute. Optional.
   std::vector<uint32_t> mReqdWorkGroupSize = std::vector<uint32_t>();
   /// 'work_group_size_hint' attribute. Optional.
@@ -203,7 +203,7 @@ constexpr char IsPipe[] = "IsPipe";
 } // end namespace Key
 
 /// In-memory representation of kernel argument metadata.
-struct Metadata final {
+struct LLVM_CLASS_ABI Metadata final {
   /// Name. Optional.
   std::string mName = std::string();
   /// Type name. Optional.
@@ -272,7 +272,7 @@ constexpr char NumSpilledVGPRs[] = "NumSpilledVGPRs";
 } // end namespace Key
 
 /// In-memory representation of kernel code properties metadata.
-struct Metadata final {
+struct LLVM_CLASS_ABI Metadata final {
   /// Size in bytes of the kernarg segment memory. Kernarg segment memory
   /// holds the values of the arguments to the kernel. Required.
   uint64_t mKernargSegmentSize = 0;
@@ -344,7 +344,7 @@ constexpr char WavefrontPrivateSegmentOffsetSGPR[] =
 } // end namespace Key
 
 /// In-memory representation of kernel debug properties metadata.
-struct Metadata final {
+struct LLVM_CLASS_ABI Metadata final {
   /// Debugger ABI version. Optional.
   std::vector<uint32_t> mDebuggerABIVersion = std::vector<uint32_t>();
   /// Consecutive number of VGPRs reserved for debugger use. Must be 0 if
@@ -400,7 +400,7 @@ constexpr char DebugProps[] = "DebugProps";
 } // end namespace Key
 
 /// In-memory representation of kernel metadata.
-struct Metadata final {
+struct LLVM_CLASS_ABI Metadata final {
   /// Kernel source name. Required.
   std::string mName = std::string();
   /// Kernel descriptor name. Required.
@@ -434,7 +434,7 @@ constexpr char Kernels[] = "Kernels";
 } // end namespace Key
 
 /// In-memory representation of HSA metadata.
-struct Metadata final {
+struct LLVM_CLASS_ABI Metadata final {
   /// HSA metadata version. Required.
   std::vector<uint32_t> mVersion = std::vector<uint32_t>();
   /// Printf metadata. Optional.
@@ -447,10 +447,10 @@ struct Metadata final {
 };
 
 /// Converts \p String to \p HSAMetadata.
-std::error_code fromString(StringRef String, Metadata &HSAMetadata);
+LLVM_FUNC_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_FUNC_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
index 116f0403d19bc9b..11969d78f520948 100644
--- a/llvm/include/llvm/Support/ARMAttributeParser.h
+++ b/llvm/include/llvm/Support/ARMAttributeParser.h
@@ -19,7 +19,7 @@ namespace llvm {
 
 class ScopedPrinter;
 
-class ARMAttributeParser : public ELFAttributeParser {
+class LLVM_CLASS_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
index f99b729e7fce6d6..3d5e9b85b8363dd 100644
--- a/llvm/include/llvm/Support/ARMBuildAttributes.h
+++ b/llvm/include/llvm/Support/ARMBuildAttributes.h
@@ -24,7 +24,7 @@
 namespace llvm {
 namespace ARMBuildAttrs {
 
-const TagNameMap &getARMAttributeTags();
+LLVM_FUNC_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/ARMWinEH.h b/llvm/include/llvm/Support/ARMWinEH.h
index 25011a7c870065f..cc38c9b2847ae51 100644
--- a/llvm/include/llvm/Support/ARMWinEH.h
+++ b/llvm/include/llvm/Support/ARMWinEH.h
@@ -101,7 +101,7 @@ enum class ReturnType {
 // to fully inspect the contents of the data structure which is particularly
 // useful for scenarios such as llvm-readobj to aid in testing.
 
-class RuntimeFunction {
+class LLVM_CLASS_ABI RuntimeFunction {
 public:
   const support::ulittle32_t BeginAddress;
   const support::ulittle32_t UnwindData;
@@ -206,7 +206,7 @@ inline uint16_t StackAdjustment(const RuntimeFunction &RF) {
 
 /// 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_FUNC_ABI std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF,
                                                 bool Prologue = true);
 
 /// RuntimeFunctionARM64 - An entry in the table of procedure data (.pdata)
@@ -222,7 +222,7 @@ std::pair<uint16_t, uint32_t> SavedRegisterMask(const RuntimeFunction &RF,
 /// See https://docs.microsoft.com/en-us/cpp/build/arm64-exception-handling
 /// for the full reference for this struct.
 
-class RuntimeFunctionARM64 {
+class LLVM_CLASS_ABI RuntimeFunctionARM64 {
 public:
   const support::ulittle32_t BeginAddress;
   const support::ulittle32_t UnwindData;
@@ -394,7 +394,7 @@ class RuntimeFunctionARM64 {
 /// variable length data associated with the exception handler.
 ///
 
-struct EpilogueScope {
+struct LLVM_CLASS_ABI EpilogueScope {
   const support::ulittle32_t ES;
 
   EpilogueScope(const support::ulittle32_t Data) : ES(Data) {}
@@ -428,9 +428,9 @@ struct EpilogueScope {
 };
 
 struct ExceptionDataRecord;
-inline size_t HeaderWords(const ExceptionDataRecord &XR);
+LLVM_FUNC_ABI inline size_t HeaderWords(const ExceptionDataRecord &XR);
 
-struct ExceptionDataRecord {
+struct LLVM_CLASS_ABI ExceptionDataRecord {
   const support::ulittle32_t *Data;
   bool isAArch64;
 
diff --git a/llvm/include/llvm/Support/AlignOf.h b/llvm/include/llvm/Support/AlignOf.h
index 6a9cff27d1efafe..9302d560ccf8ca0 100644
--- a/llvm/include/llvm/Support/AlignOf.h
+++ b/llvm/include/llvm/Support/AlignOf.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_SUPPORT_ALIGNOF_H
 #define LLVM_SUPPORT_ALIGNOF_H
 
+#include "llvm/Support/Compiler.h"
 #include <type_traits>
 
 namespace llvm {
diff --git a/llvm/include/llvm/Support/Alignment.h b/llvm/include/llvm/Support/Alignment.h
index 8153ec31e0cc7c0..b9d3f4fa99030eb 100644
--- a/llvm/include/llvm/Support/Alignment.h
+++ b/llvm/include/llvm/Support/Alignment.h
@@ -37,21 +37,21 @@ namespace llvm {
 /// This struct is a compact representation of a valid (non-zero power of two)
 /// alignment.
 /// It is suitable for use as static global constants.
-struct Align {
+struct LLVM_CLASS_ABI Align {
 private:
   uint8_t ShiftValue = 0; /// The log2 of the required alignment.
                           /// ShiftValue is less than 64 by construction.
 
   friend struct MaybeAlign;
-  friend unsigned Log2(Align);
-  friend bool operator==(Align Lhs, Align Rhs);
-  friend bool operator!=(Align Lhs, Align Rhs);
-  friend bool operator<=(Align Lhs, Align Rhs);
-  friend bool operator>=(Align Lhs, Align Rhs);
-  friend bool operator<(Align Lhs, Align Rhs);
-  friend bool operator>(Align Lhs, Align Rhs);
-  friend unsigned encode(struct MaybeAlign A);
-  friend struct MaybeAlign decodeMaybeAlign(unsigned Value);
+  friend LLVM_FUNC_ABI unsigned Log2(Align);
+  friend LLVM_FUNC_ABI bool operator==(Align Lhs, Align Rhs);
+  friend LLVM_FUNC_ABI bool operator!=(Align Lhs, Align Rhs);
+  friend LLVM_FUNC_ABI bool operator<=(Align Lhs, Align Rhs);
+  friend LLVM_FUNC_ABI bool operator>=(Align Lhs, Align Rhs);
+  friend LLVM_FUNC_ABI bool operator<(Align Lhs, Align Rhs);
+  friend LLVM_FUNC_ABI bool operator>(Align Lhs, Align Rhs);
+  friend LLVM_FUNC_ABI unsigned encode(struct MaybeAlign A);
+  friend LLVM_FUNC_ABI struct MaybeAlign decodeMaybeAlign(unsigned Value);
 
   /// A trivial type to allow construction of constexpr Align.
   /// This is currently needed to workaround a bug in GCC 5.3 which prevents
@@ -115,7 +115,7 @@ inline Align assumeAligned(uint64_t Value) {
 
 /// This struct is a compact representation of a valid (power of two) or
 /// undefined (0) alignment.
-struct MaybeAlign : public std::optional<Align> {
+struct LLVM_CLASS_ABI MaybeAlign : public std::optional<Align> {
 private:
   using UP = std::optional<Align>;
 
diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
index c1e5c6d2853bd5b..d15fcdafc442e01 100644
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/include/llvm/Support/Allocator.h
@@ -36,7 +36,7 @@ namespace detail {
 
 // 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_FUNC_ABI void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
                                 size_t TotalMemory);
 
 } // end namespace detail
@@ -60,7 +60,7 @@ void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,
 /// increases the size of the slabs.
 template <typename AllocatorT = MallocAllocator, size_t SlabSize = 4096,
           size_t SizeThreshold = SlabSize, size_t GrowthDelay = 128>
-class BumpPtrAllocatorImpl
+class LLVM_CLASS_ABI BumpPtrAllocatorImpl
     : public AllocatorBase<BumpPtrAllocatorImpl<AllocatorT, SlabSize,
                                                 SizeThreshold, GrowthDelay>>,
       private detail::AllocatorHolder<AllocatorT> {
@@ -379,7 +379,7 @@ typedef BumpPtrAllocatorImpl<> BumpPtrAllocator;
 ///
 /// This allows calling the destructor in DestroyAll() and when the allocator is
 /// destroyed.
-template <typename T> class SpecificBumpPtrAllocator {
+template <typename T> class LLVM_CLASS_ABI SpecificBumpPtrAllocator {
   BumpPtrAllocator Allocator;
 
 public:
diff --git a/llvm/include/llvm/Support/AllocatorBase.h b/llvm/include/llvm/Support/AllocatorBase.h
index 044243225006920..e9e9163d5240ff8 100644
--- a/llvm/include/llvm/Support/AllocatorBase.h
+++ b/llvm/include/llvm/Support/AllocatorBase.h
@@ -37,7 +37,7 @@ namespace llvm {
 /// This base class both documents the full public interface exposed by all
 /// LLVM-style allocators, and redirects all of the overloads to a single core
 /// set of methods which the derived class must define.
-template <typename DerivedT> class AllocatorBase {
+template <typename DerivedT> class LLVM_CLASS_ABI AllocatorBase {
 public:
   /// Allocate \a Size bytes of \a Alignment aligned memory. This method
   /// must be implemented by \c DerivedT.
@@ -84,7 +84,7 @@ template <typename DerivedT> class AllocatorBase {
   }
 };
 
-class MallocAllocator : public AllocatorBase<MallocAllocator> {
+class LLVM_CLASS_ABI MallocAllocator : public AllocatorBase<MallocAllocator> {
 public:
   void Reset() {}
 
@@ -107,7 +107,7 @@ class MallocAllocator : public AllocatorBase<MallocAllocator> {
 
 namespace detail {
 
-template <typename Alloc> class AllocatorHolder : Alloc {
+template <typename Alloc> class LLVM_CLASS_ABI AllocatorHolder : Alloc {
 public:
   AllocatorHolder() = default;
   AllocatorHolder(const Alloc &A) : Alloc(A) {}
@@ -116,7 +116,7 @@ template <typename Alloc> class AllocatorHolder : Alloc {
   const Alloc &getAllocator() const { return *this; }
 };
 
-template <typename Alloc> class AllocatorHolder<Alloc &> {
+template <typename Alloc> class LLVM_CLASS_ABI AllocatorHolder<Alloc &> {
   Alloc &A;
 
 public:
diff --git a/llvm/include/llvm/Support/ArrayRecycler.h b/llvm/include/llvm/Support/ArrayRecycler.h
index 69f542b10b95871..67ce2fc3061e6eb 100644
--- a/llvm/include/llvm/Support/ArrayRecycler.h
+++ b/llvm/include/llvm/Support/ArrayRecycler.h
@@ -26,7 +26,7 @@ namespace llvm {
 /// Arrays are allocated in a small number of fixed sizes. For each supported
 /// array size, the ArrayRecycler keeps a free list of available arrays.
 ///
-template <class T, size_t Align = alignof(T)> class ArrayRecycler {
+template <class T, size_t Align = alignof(T)> class LLVM_CLASS_ABI ArrayRecycler {
   // The free list for a given array size is a simple singly linked list.
   // We can't use iplist or Recycler here since those classes can't be copied.
   struct FreeList {
diff --git a/llvm/include/llvm/Support/Atomic.h b/llvm/include/llvm/Support/Atomic.h
index dbe321a7f21e714..bf2d0267aac53ef 100644
--- a/llvm/include/llvm/Support/Atomic.h
+++ b/llvm/include/llvm/Support/Atomic.h
@@ -27,14 +27,14 @@
 
 namespace llvm {
   namespace sys {
-    void MemoryFence();
+    LLVM_FUNC_ABI void MemoryFence();
 
 #ifdef _MSC_VER
     typedef long cas_flag;
 #else
     typedef uint32_t cas_flag;
 #endif
-    cas_flag CompareAndSwap(volatile cas_flag* ptr,
+    LLVM_FUNC_ABI cas_flag CompareAndSwap(volatile cas_flag* ptr,
                             cas_flag new_value,
                             cas_flag old_value);
   }
diff --git a/llvm/include/llvm/Support/Automaton.h b/llvm/include/llvm/Support/Automaton.h
index e7c5e88e2cf4768..642dc9457cceb67 100644
--- a/llvm/include/llvm/Support/Automaton.h
+++ b/llvm/include/llvm/Support/Automaton.h
@@ -46,7 +46,7 @@ using NfaPath = SmallVector<uint64_t, 4>;
 /// Experimental results with large tables have shown a significant (multiple
 /// orders of magnitude) parsing speedup by using a custom struct here with a
 /// trivial constructor rather than std::pair<uint64_t, uint64_t>.
-struct NfaStatePair {
+struct LLVM_CLASS_ABI NfaStatePair {
   uint64_t FromDfaState, ToDfaState;
 
   bool operator<(const NfaStatePair &Other) const {
@@ -58,7 +58,7 @@ struct NfaStatePair {
 namespace internal {
 /// The internal class that maintains all possible paths through an NFA based
 /// on a path through the DFA.
-class NfaTranscriber {
+class LLVM_CLASS_ABI NfaTranscriber {
 private:
   /// Cached transition table. This is a table of NfaStatePairs that contains
   /// zero-terminated sequences pointed to by DFA transitions.
@@ -160,7 +160,7 @@ class NfaTranscriber {
 ///
 /// An automaton accepts a sequence of input tokens ("actions"). This class is
 /// templated on the type of these actions.
-template <typename ActionT> class Automaton {
+template <typename ActionT> class LLVM_CLASS_ABI Automaton {
   /// Map from {State, Action} to {NewState, TransitionInfoIdx}.
   /// TransitionInfoIdx is used by the DfaTranscriber to analyze the transition.
   /// FIXME: This uses a std::map because ActionT can be a pair type including
diff --git a/llvm/include/llvm/Support/BLAKE3.h b/llvm/include/llvm/Support/BLAKE3.h
index 6c3b5492570aef3..6a2d2f984beef38 100644
--- a/llvm/include/llvm/Support/BLAKE3.h
+++ b/llvm/include/llvm/Support/BLAKE3.h
@@ -36,7 +36,7 @@ template <size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
 using BLAKE3Result = std::array<uint8_t, NumBytes>;
 
 /// A class that wraps the BLAKE3 algorithm.
-class BLAKE3 {
+class LLVM_CLASS_ABI BLAKE3 {
 public:
   BLAKE3() { init(); }
 
@@ -99,7 +99,7 @@ class BLAKE3 {
 ///
 /// This is useful for using BLAKE3 as the hasher type for \p HashBuilder with
 /// non-default hash sizes.
-template <size_t NumBytes> class TruncatedBLAKE3 : public BLAKE3 {
+template <size_t NumBytes> class LLVM_CLASS_ABI TruncatedBLAKE3 : public BLAKE3 {
 public:
   /// Finalize the hasher and put the result in \p Result.
   /// This doesn't modify the hasher itself, and it's possible to finalize again
diff --git a/llvm/include/llvm/Support/BalancedPartitioning.h b/llvm/include/llvm/Support/BalancedPartitioning.h
index 5e8cfe8091ef3e3..f180272a4f5edc8 100644
--- a/llvm/include/llvm/Support/BalancedPartitioning.h
+++ b/llvm/include/llvm/Support/BalancedPartitioning.h
@@ -54,7 +54,7 @@ namespace llvm {
 class ThreadPool;
 /// A function with a set of utility nodes where it is beneficial to order two
 /// functions close together if they have similar utility nodes
-class BPFunctionNode {
+class LLVM_CLASS_ABI BPFunctionNode {
   friend class BalancedPartitioning;
 
 public:
@@ -84,7 +84,7 @@ class BPFunctionNode {
 };
 
 /// Algorithm parameters; default values are tuned on real-world binaries
-struct BalancedPartitioningConfig {
+struct LLVM_CLASS_ABI BalancedPartitioningConfig {
   /// The depth of the recursive bisection
   unsigned SplitDepth = 18;
   /// The maximum number of bp iterations per split
@@ -98,7 +98,7 @@ struct BalancedPartitioningConfig {
   unsigned TaskSplitDepth = 9;
 };
 
-class BalancedPartitioning {
+class LLVM_CLASS_ABI BalancedPartitioning {
 public:
   BalancedPartitioning(const BalancedPartitioningConfig &Config);
 
diff --git a/llvm/include/llvm/Support/Base64.h b/llvm/include/llvm/Support/Base64.h
index 77e41d58ad4878f..f7b0e039681a92c 100644
--- a/llvm/include/llvm/Support/Base64.h
+++ b/llvm/include/llvm/Support/Base64.h
@@ -55,7 +55,7 @@ template <class InputBytes> std::string encodeBase64(InputBytes const &Bytes) {
   return Buffer;
 }
 
-llvm::Error decodeBase64(llvm::StringRef Input, std::vector<char> &Output);
+LLVM_FUNC_ABI llvm::Error decodeBase64(llvm::StringRef Input, std::vector<char> &Output);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Support/BinaryByteStream.h b/llvm/include/llvm/Support/BinaryByteStream.h
index 5f2e996f981d412..012fa330848f96b 100644
--- a/llvm/include/llvm/Support/BinaryByteStream.h
+++ b/llvm/include/llvm/Support/BinaryByteStream.h
@@ -28,7 +28,7 @@ namespace llvm {
 /// in a single contiguous buffer.  BinaryByteStream guarantees that no read
 /// operation will ever incur a copy.  Note that BinaryByteStream does not
 /// own the underlying buffer.
-class BinaryByteStream : public BinaryStream {
+class LLVM_CLASS_ABI BinaryByteStream : public BinaryStream {
 public:
   BinaryByteStream() = default;
   BinaryByteStream(ArrayRef<uint8_t> Data, llvm::support::endianness Endian)
@@ -72,7 +72,7 @@ class BinaryByteStream : public BinaryStream {
 /// MemoryBuffer object.  MemoryBufferByteStream owns the MemoryBuffer in
 /// question.  As with BinaryByteStream, reading from a MemoryBufferByteStream
 /// will never cause a copy.
-class MemoryBufferByteStream : public BinaryByteStream {
+class LLVM_CLASS_ABI MemoryBufferByteStream : public BinaryByteStream {
 public:
   MemoryBufferByteStream(std::unique_ptr<MemoryBuffer> Buffer,
                          llvm::support::endianness Endian)
@@ -86,7 +86,7 @@ class MemoryBufferByteStream : public BinaryByteStream {
 /// in a single contiguous buffer.  As with BinaryByteStream, the mutable
 /// version also guarantees that no read operation will ever incur a copy,
 /// and similarly it does not own the underlying buffer.
-class MutableBinaryByteStream : public WritableBinaryStream {
+class LLVM_CLASS_ABI MutableBinaryByteStream : public WritableBinaryStream {
 public:
   MutableBinaryByteStream() = default;
   MutableBinaryByteStream(MutableArrayRef<uint8_t> Data,
@@ -132,7 +132,7 @@ class MutableBinaryByteStream : public WritableBinaryStream {
 
 /// An implementation of WritableBinaryStream which can write at its end
 /// causing the underlying data to grow.  This class owns the underlying data.
-class AppendingBinaryByteStream : public WritableBinaryStream {
+class LLVM_CLASS_ABI AppendingBinaryByteStream : public WritableBinaryStream {
   std::vector<uint8_t> Data;
   llvm::support::endianness Endian = llvm::support::little;
 
@@ -200,7 +200,7 @@ class AppendingBinaryByteStream : public WritableBinaryStream {
 
 /// An implementation of WritableBinaryStream backed by an llvm
 /// FileOutputBuffer.
-class FileBufferByteStream : public WritableBinaryStream {
+class LLVM_CLASS_ABI FileBufferByteStream : public WritableBinaryStream {
 private:
   class StreamImpl : public MutableBinaryByteStream {
   public:
diff --git a/llvm/include/llvm/Support/BinaryItemStream.h b/llvm/include/llvm/Support/BinaryItemStream.h
index bfdec2331d2bcf6..b068b2297df20bb 100644
--- a/llvm/include/llvm/Support/BinaryItemStream.h
+++ b/llvm/include/llvm/Support/BinaryItemStream.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-template <typename T> struct BinaryItemTraits {
+template <typename T> struct LLVM_CLASS_ABI BinaryItemTraits {
   static size_t length(const T &Item) = delete;
   static ArrayRef<uint8_t> bytes(const T &Item) = delete;
 };
@@ -32,7 +32,7 @@ template <typename T> struct BinaryItemTraits {
 /// contiguously in memory, but we may wish to read from or write to these
 /// records as if they were.
 template <typename T, typename Traits = BinaryItemTraits<T>>
-class BinaryItemStream : public BinaryStream {
+class LLVM_CLASS_ABI BinaryItemStream : public BinaryStream {
 public:
   explicit BinaryItemStream(llvm::support::endianness Endian)
       : Endian(Endian) {}
diff --git a/llvm/include/llvm/Support/BinaryStream.h b/llvm/include/llvm/Support/BinaryStream.h
index 1a1546f82c7ef0e..0cd13f28518b8d1 100644
--- a/llvm/include/llvm/Support/BinaryStream.h
+++ b/llvm/include/llvm/Support/BinaryStream.h
@@ -33,7 +33,7 @@ enum BinaryStreamFlags {
 /// single contiguous buffer (or even in memory at all), in such cases a it may
 /// be necessary for an implementation to cache such a buffer so that it can
 /// return it.
-class BinaryStream {
+class LLVM_CLASS_ABI BinaryStream {
 public:
   virtual ~BinaryStream() = default;
 
@@ -71,7 +71,7 @@ class BinaryStream {
 /// buffer to the stream's backing store.  Streams are assumed to be buffered
 /// so that to be portable it is necessary to call commit() on the stream when
 /// all data has been written.
-class WritableBinaryStream : public BinaryStream {
+class LLVM_CLASS_ABI WritableBinaryStream : public BinaryStream {
 public:
   ~WritableBinaryStream() override = default;
 
diff --git a/llvm/include/llvm/Support/BinaryStreamArray.h b/llvm/include/llvm/Support/BinaryStreamArray.h
index 4dd27eb806d887d..89d8655e9a65906 100644
--- a/llvm/include/llvm/Support/BinaryStreamArray.h
+++ b/llvm/include/llvm/Support/BinaryStreamArray.h
@@ -45,7 +45,7 @@ namespace llvm {
 /// You can specialize this template for your own custom value types to avoid
 /// having to specify a second template argument to VarStreamArray (documented
 /// below).
-template <typename T> struct VarStreamArrayExtractor {
+template <typename T> struct LLVM_CLASS_ABI VarStreamArrayExtractor {
   // Method intentionally deleted.  You must provide an explicit specialization
   // with the following method implemented.
   Error operator()(BinaryStreamRef Stream, uint32_t &Len,
@@ -90,7 +90,7 @@ template <typename ValueType, typename Extractor> class VarStreamArrayIterator;
 
 template <typename ValueType,
           typename Extractor = VarStreamArrayExtractor<ValueType>>
-class VarStreamArray {
+class LLVM_CLASS_ABI VarStreamArray {
   friend class VarStreamArrayIterator<ValueType, Extractor>;
 
 public:
@@ -154,7 +154,7 @@ class VarStreamArray {
 };
 
 template <typename ValueType, typename Extractor>
-class VarStreamArrayIterator
+class LLVM_CLASS_ABI VarStreamArrayIterator
     : public iterator_facade_base<VarStreamArrayIterator<ValueType, Extractor>,
                                   std::forward_iterator_tag, const ValueType> {
   typedef VarStreamArrayIterator<ValueType, Extractor> IterType;
@@ -257,7 +257,7 @@ template <typename T> class FixedStreamArrayIterator;
 /// cost associated with building or copying a FixedStreamArray, as the
 /// memory for each element is not read from the backing stream until that
 /// element is iterated.
-template <typename T> class FixedStreamArray {
+template <typename T> class LLVM_CLASS_ABI FixedStreamArray {
   friend class FixedStreamArrayIterator<T>;
 
 public:
@@ -318,7 +318,7 @@ template <typename T> class FixedStreamArray {
 };
 
 template <typename T>
-class FixedStreamArrayIterator
+class LLVM_CLASS_ABI FixedStreamArrayIterator
     : public iterator_facade_base<FixedStreamArrayIterator<T>,
                                   std::random_access_iterator_tag, const T> {
 
diff --git a/llvm/include/llvm/Support/BinaryStreamError.h b/llvm/include/llvm/Support/BinaryStreamError.h
index ad1f62f911b2289..de4974386b3a322 100644
--- a/llvm/include/llvm/Support/BinaryStreamError.h
+++ b/llvm/include/llvm/Support/BinaryStreamError.h
@@ -25,7 +25,7 @@ enum class stream_error_code {
 };
 
 /// Base class for errors originating when parsing raw PDB files
-class BinaryStreamError : public ErrorInfo<BinaryStreamError> {
+class LLVM_CLASS_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
index 885f6483beb9a87..971070350321a92 100644
--- a/llvm/include/llvm/Support/BinaryStreamReader.h
+++ b/llvm/include/llvm/Support/BinaryStreamReader.h
@@ -27,7 +27,7 @@ namespace llvm {
 /// 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_CLASS_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
index f00a018be01bef8..a8294ae881e00f6 100644
--- a/llvm/include/llvm/Support/BinaryStreamRef.h
+++ b/llvm/include/llvm/Support/BinaryStreamRef.h
@@ -21,7 +21,7 @@
 namespace llvm {
 
 /// Common stuff for mutable and immutable StreamRefs.
-template <class RefType, class StreamType> class BinaryStreamRefBase {
+template <class RefType, class StreamType> class LLVM_CLASS_ABI BinaryStreamRefBase {
 protected:
   BinaryStreamRefBase() = default;
   explicit BinaryStreamRefBase(StreamType &BorrowedImpl)
@@ -153,7 +153,7 @@ template <class RefType, class StreamType> class BinaryStreamRefBase {
 /// 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_CLASS_ABI BinaryStreamRef
     : public BinaryStreamRefBase<BinaryStreamRef, BinaryStream> {
   friend BinaryStreamRefBase<BinaryStreamRef, BinaryStream>;
   friend class WritableBinaryStreamRef;
@@ -197,7 +197,7 @@ class BinaryStreamRef
                                    ArrayRef<uint8_t> &Buffer) const;
 };
 
-struct BinarySubstreamRef {
+struct LLVM_CLASS_ABI BinarySubstreamRef {
   uint64_t Offset = 0;        // Offset in the parent stream
   BinaryStreamRef StreamData; // Stream Data
 
@@ -218,7 +218,7 @@ struct BinarySubstreamRef {
   bool empty() const { return size() == 0; }
 };
 
-class WritableBinaryStreamRef
+class LLVM_CLASS_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
index 10ac2f49881f82a..b6e0c092bc7fca5 100644
--- a/llvm/include/llvm/Support/BinaryStreamWriter.h
+++ b/llvm/include/llvm/Support/BinaryStreamWriter.h
@@ -28,7 +28,7 @@ namespace llvm {
 /// 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_CLASS_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
index a194599a3f9db49..d2b27ed5d6572e8 100644
--- a/llvm/include/llvm/Support/BlockFrequency.h
+++ b/llvm/include/llvm/Support/BlockFrequency.h
@@ -22,7 +22,7 @@ namespace llvm {
 class BranchProbability;
 
 // This class represents Block Frequency as a 64-bit value.
-class BlockFrequency {
+class LLVM_CLASS_ABI BlockFrequency {
   uint64_t Frequency;
 
 public:
diff --git a/llvm/include/llvm/Support/BranchProbability.h b/llvm/include/llvm/Support/BranchProbability.h
index 66bb7c44cc8fe5e..787b44f8f791146 100644
--- a/llvm/include/llvm/Support/BranchProbability.h
+++ b/llvm/include/llvm/Support/BranchProbability.h
@@ -28,7 +28,7 @@ class raw_ostream;
 // 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_CLASS_ABI BranchProbability {
   // Numerator
   uint32_t N;
 
diff --git a/llvm/include/llvm/Support/BuryPointer.h b/llvm/include/llvm/Support/BuryPointer.h
index 79690c66a65d255..9ae1c4d551ad2f5 100644
--- a/llvm/include/llvm/Support/BuryPointer.h
+++ b/llvm/include/llvm/Support/BuryPointer.h
@@ -20,7 +20,7 @@ namespace llvm {
 // 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_FUNC_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/CFGDiff.h b/llvm/include/llvm/Support/CFGDiff.h
index aa7e37f584c8be1..c0381d65a680090 100644
--- a/llvm/include/llvm/Support/CFGDiff.h
+++ b/llvm/include/llvm/Support/CFGDiff.h
@@ -55,7 +55,7 @@ template <bool B, typename Range> auto reverse_if(Range &&R) {
 // in the snapshot. The current diff treats the CFG as a graph rather than a
 // multigraph. Added edges are pruned to be unique, and deleted edges will
 // remove all existing edges between two blocks.
-template <typename NodePtr, bool InverseGraph = false> class GraphDiff {
+template <typename NodePtr, bool InverseGraph = false> class LLVM_CLASS_ABI GraphDiff {
   struct DeletesInserts {
     SmallVector<NodePtr, 2> DI[2];
   };
diff --git a/llvm/include/llvm/Support/CFGUpdate.h b/llvm/include/llvm/Support/CFGUpdate.h
index 18c34bb73695acb..0018ff9a59372be 100644
--- a/llvm/include/llvm/Support/CFGUpdate.h
+++ b/llvm/include/llvm/Support/CFGUpdate.h
@@ -25,7 +25,7 @@ namespace llvm {
 namespace cfg {
 enum class UpdateKind : unsigned char { Insert, Delete };
 
-template <typename NodePtr> class Update {
+template <typename NodePtr> class LLVM_CLASS_ABI Update {
   using NodeKindPair = PointerIntPair<NodePtr, 1, UpdateKind>;
   NodePtr From;
   NodeKindPair ToAndKind;
diff --git a/llvm/include/llvm/Support/COM.h b/llvm/include/llvm/Support/COM.h
index ea4199600d9913e..3d4c2b643437c2f 100644
--- a/llvm/include/llvm/Support/COM.h
+++ b/llvm/include/llvm/Support/COM.h
@@ -21,7 +21,7 @@ namespace sys {
 
 enum class COMThreadingMode { SingleThreaded, MultiThreaded };
 
-class InitializeCOMRAII {
+class LLVM_CLASS_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
index c34aa605ffc4bbd..d2a3524bd2588f6 100644
--- a/llvm/include/llvm/Support/CRC.h
+++ b/llvm/include/llvm/Support/CRC.h
@@ -20,11 +20,11 @@ namespace llvm {
 template <typename T> class ArrayRef;
 
 // Compute the CRC-32 of Data.
-uint32_t crc32(ArrayRef<uint8_t> Data);
+LLVM_FUNC_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_FUNC_ABI uint32_t crc32(uint32_t CRC, ArrayRef<uint8_t> Data);
 
 // Class for computing the JamCRC.
 //
@@ -43,7 +43,7 @@ uint32_t crc32(uint32_t CRC, ArrayRef<uint8_t> Data);
 //
 // N.B.  We permit flexibility of the "Init" value.  Some consumers of this need
 //       it to be zero.
-class JamCRC {
+class LLVM_CLASS_ABI JamCRC {
 public:
   JamCRC(uint32_t Init = 0xFFFFFFFFU) : CRC(Init) {}
 
diff --git a/llvm/include/llvm/Support/CSKYAttributeParser.h b/llvm/include/llvm/Support/CSKYAttributeParser.h
index 00cc50bfb4b66fa..7805f806f0c4205 100644
--- a/llvm/include/llvm/Support/CSKYAttributeParser.h
+++ b/llvm/include/llvm/Support/CSKYAttributeParser.h
@@ -14,7 +14,7 @@
 #include "llvm/Support/ELFAttributeParser.h"
 
 namespace llvm {
-class CSKYAttributeParser : public ELFAttributeParser {
+class LLVM_CLASS_ABI CSKYAttributeParser : public ELFAttributeParser {
   struct DisplayHandler {
     CSKYAttrs::AttrType attribute;
     Error (CSKYAttributeParser::*routine)(unsigned);
diff --git a/llvm/include/llvm/Support/CSKYAttributes.h b/llvm/include/llvm/Support/CSKYAttributes.h
index 23c88b347179110..01fceb4715d9494 100644
--- a/llvm/include/llvm/Support/CSKYAttributes.h
+++ b/llvm/include/llvm/Support/CSKYAttributes.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace CSKYAttrs {
 
-const TagNameMap &getCSKYAttributeTags();
+LLVM_FUNC_ABI const TagNameMap &getCSKYAttributeTags();
 
 enum AttrType {
   CSKY_ARCH_NAME = 4,
diff --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
index de976636a2381e5..77098e1b501f794 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -26,7 +26,7 @@ class StringRef;
 
 /// Policy for the pruneCache() function. A default constructed
 /// CachePruningPolicy provides a reasonable default policy.
-struct CachePruningPolicy {
+struct LLVM_CLASS_ABI CachePruningPolicy {
   /// The pruning interval. This is intended to be used to avoid scanning the
   /// directory too often. It does not impact the decision of which file to
   /// prune. A value of 0 forces the scan to occur. A value of std::nullopt
@@ -67,7 +67,7 @@ struct CachePruningPolicy {
 /// 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_FUNC_ABI Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicyStr);
 
 /// Peform pruning using the supplied policy, returns true if pruning
 /// occurred, i.e. if Policy.Interval was expired.
@@ -80,7 +80,7 @@ Expected<CachePruningPolicy> parseCachePruningPolicy(StringRef PolicyStr);
 /// 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_FUNC_ABI bool pruneCache(StringRef Path, CachePruningPolicy Policy,
                 const std::vector<std::unique_ptr<MemoryBuffer>> &Files = {});
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Support/Caching.h b/llvm/include/llvm/Support/Caching.h
index 3182df35b357f3c..737fd1f66f9039e 100644
--- a/llvm/include/llvm/Support/Caching.h
+++ b/llvm/include/llvm/Support/Caching.h
@@ -26,7 +26,7 @@ class MemoryBuffer;
 /// able to return an instance of this base class from the stream callback, but
 /// if a client needs to perform some action after the stream is written to,
 /// that can be done by deriving from this class and overriding the destructor.
-class CachedFileStream {
+class LLVM_CLASS_ABI CachedFileStream {
 public:
   CachedFileStream(std::unique_ptr<raw_pwrite_stream> OS,
                    std::string OSPath = "")
@@ -70,7 +70,7 @@ using AddBufferFn = std::function<void(unsigned Task, const Twine &ModuleName,
 /// done lazily the first time a file is added.  The cache name appears in error
 /// messages for errors during caching. The temporary file prefix is used in the
 /// temporary file naming scheme used when writing files atomically.
-Expected<FileCache> localCache(
+LLVM_FUNC_ABI Expected<FileCache> localCache(
     const Twine &CacheNameRef, const Twine &TempFilePrefixRef,
     const Twine &CacheDirectoryPathRef,
     AddBufferFn AddBuffer = [](size_t Task, const Twine &ModuleName,
diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h
index a0a6fb053d3140a..dd707133685f975 100644
--- a/llvm/include/llvm/Support/Casting.h
+++ b/llvm/include/llvm/Support/Casting.h
@@ -31,14 +31,14 @@ namespace llvm {
 /// fact that they are automatically dereferenced, and are not involved with the
 /// template selection process...  the default implementation is a noop.
 // TODO: rename this and/or replace it with other cast traits.
-template <typename From> struct simplify_type {
+template <typename From> struct LLVM_CLASS_ABI simplify_type {
   using SimpleType = From; // The real type this represents...
 
   // An accessor to get the real value...
   static SimpleType &getSimplifiedValue(From &Val) { return Val; }
 };
 
-template <typename From> struct simplify_type<const From> {
+template <typename From> struct LLVM_CLASS_ABI simplify_type<const From> {
   using NonConstSimpleType = typename simplify_type<From>::SimpleType;
   using SimpleType = typename add_const_past_pointer<NonConstSimpleType>::type;
   using RetType =
@@ -60,51 +60,51 @@ template <typename From> struct simplify_type<const From> {
 // The core of the implementation of isa<X> is here; To and From should be
 // the names of classes.  This template can be specialized to customize the
 // implementation of isa<> without rewriting it from scratch.
-template <typename To, typename From, typename Enabler = void> struct isa_impl {
+template <typename To, typename From, typename Enabler = void> struct LLVM_CLASS_ABI isa_impl {
   static inline bool doit(const From &Val) { return To::classof(&Val); }
 };
 
 // Always allow upcasts, and perform no dynamic check for them.
 template <typename To, typename From>
-struct isa_impl<To, From, std::enable_if_t<std::is_base_of_v<To, From>>> {
+struct LLVM_CLASS_ABI isa_impl<To, From, std::enable_if_t<std::is_base_of_v<To, From>>> {
   static inline bool doit(const From &) { return true; }
 };
 
-template <typename To, typename From> struct isa_impl_cl {
+template <typename To, typename From> struct LLVM_CLASS_ABI isa_impl_cl {
   static inline bool doit(const From &Val) {
     return isa_impl<To, From>::doit(Val);
   }
 };
 
-template <typename To, typename From> struct isa_impl_cl<To, const From> {
+template <typename To, typename From> struct LLVM_CLASS_ABI isa_impl_cl<To, const From> {
   static inline bool doit(const From &Val) {
     return isa_impl<To, From>::doit(Val);
   }
 };
 
 template <typename To, typename From>
-struct isa_impl_cl<To, const std::unique_ptr<From>> {
+struct LLVM_CLASS_ABI isa_impl_cl<To, const std::unique_ptr<From>> {
   static inline bool doit(const std::unique_ptr<From> &Val) {
     assert(Val && "isa<> used on a null pointer");
     return isa_impl_cl<To, From>::doit(*Val);
   }
 };
 
-template <typename To, typename From> struct isa_impl_cl<To, From *> {
+template <typename To, typename From> struct LLVM_CLASS_ABI isa_impl_cl<To, >From *> {
   static inline bool doit(const From *Val) {
     assert(Val && "isa<> used on a null pointer");
     return isa_impl<To, From>::doit(*Val);
   }
 };
 
-template <typename To, typename From> struct isa_impl_cl<To, From *const> {
+template <typename To, typename From> struct LLVM_CLASS_ABI isa_impl_cl<To, >From *const> {
   static inline bool doit(const From *Val) {
     assert(Val && "isa<> used on a null pointer");
     return isa_impl<To, From>::doit(*Val);
   }
 };
 
-template <typename To, typename From> struct isa_impl_cl<To, const From *> {
+template <typename To, typename From> struct LLVM_CLASS_ABI isa_impl_cl<To, const From *> {
   static inline bool doit(const From *Val) {
     assert(Val && "isa<> used on a null pointer");
     return isa_impl<To, From>::doit(*Val);
@@ -112,7 +112,7 @@ template <typename To, typename From> struct isa_impl_cl<To, const From *> {
 };
 
 template <typename To, typename From>
-struct isa_impl_cl<To, const From *const> {
+struct LLVM_CLASS_ABI isa_impl_cl<To, const From *const> {
   static inline bool doit(const From *Val) {
     assert(Val && "isa<> used on a null pointer");
     return isa_impl<To, From>::doit(*Val);
@@ -120,7 +120,7 @@ struct isa_impl_cl<To, const From *const> {
 };
 
 template <typename To, typename From, typename SimpleFrom>
-struct isa_impl_wrap {
+struct LLVM_CLASS_ABI isa_impl_wrap {
   // When From != SimplifiedType, we can simplify the type some more by using
   // the simplify_type template.
   static bool doit(const From &Val) {
@@ -131,7 +131,7 @@ struct isa_impl_wrap {
 };
 
 template <typename To, typename FromTy>
-struct isa_impl_wrap<To, FromTy, FromTy> {
+struct LLVM_CLASS_ABI isa_impl_wrap<To, FromTy, FromTy> {
   // When From == SimpleType, we are as simple as we are going to get.
   static bool doit(const FromTy &Val) {
     return isa_impl_cl<To, FromTy>::doit(Val);
@@ -146,27 +146,27 @@ template <class To, class From> struct cast_retty;
 
 // Calculate what type the 'cast' function should return, based on a requested
 // type of To and a source type of From.
-template <class To, class From> struct cast_retty_impl {
+template <class To, class From> struct LLVM_CLASS_ABI cast_retty_impl {
   using ret_type = To &; // Normal case, return Ty&
 };
-template <class To, class From> struct cast_retty_impl<To, const From> {
+template <class To, class From> struct LLVM_CLASS_ABI cast_retty_impl<To, const From> {
   using ret_type = const To &; // Normal case, return Ty&
 };
 
-template <class To, class From> struct cast_retty_impl<To, From *> {
+template <class To, class From> struct LLVM_CLASS_ABI cast_retty_impl<To, From *> {
   using ret_type = To *; // Pointer arg case, return Ty*
 };
 
-template <class To, class From> struct cast_retty_impl<To, const From *> {
+template <class To, class From> struct LLVM_CLASS_ABI cast_retty_impl<To, const From *> {
   using ret_type = const To *; // Constant pointer arg case, return const Ty*
 };
 
-template <class To, class From> struct cast_retty_impl<To, const From *const> {
+template <class To, class From> struct LLVM_CLASS_ABI cast_retty_impl<To, const From *const> {
   using ret_type = const To *; // Constant pointer arg case, return const Ty*
 };
 
 template <class To, class From>
-struct cast_retty_impl<To, std::unique_ptr<From>> {
+struct LLVM_CLASS_ABI cast_retty_impl<To, std::unique_ptr<From>> {
 private:
   using PointerType = typename cast_retty_impl<To, From *>::ret_type;
   using ResultType = std::remove_pointer_t<PointerType>;
@@ -175,19 +175,19 @@ struct cast_retty_impl<To, std::unique_ptr<From>> {
   using ret_type = std::unique_ptr<ResultType>;
 };
 
-template <class To, class From, class SimpleFrom> struct cast_retty_wrap {
+template <class To, class From, class SimpleFrom> struct LLVM_CLASS_ABI cast_retty_wrap {
   // When the simplified type and the from type are not the same, use the type
   // simplifier to reduce the type, then reuse cast_retty_impl to get the
   // resultant type.
   using ret_type = typename cast_retty<To, SimpleFrom>::ret_type;
 };
 
-template <class To, class FromTy> struct cast_retty_wrap<To, FromTy, FromTy> {
+template <class To, class FromTy> struct LLVM_CLASS_ABI cast_retty_wrap<To, FromTy, FromTy> {
   // When the simplified type is equal to the from type, use it directly.
   using ret_type = typename cast_retty_impl<To, FromTy>::ret_type;
 };
 
-template <class To, class From> struct cast_retty {
+template <class To, class From> struct LLVM_CLASS_ABI cast_retty {
   using ret_type = typename cast_retty_wrap<
       To, From, typename simplify_type<From>::SimpleType>::ret_type;
 };
@@ -199,7 +199,7 @@ template <class To, class From> struct cast_retty {
 // Ensure the non-simple values are converted using the simplify_type template
 // that may be specialized by smart pointers...
 //
-template <class To, class From, class SimpleFrom> struct cast_convert_val {
+template <class To, class From, class SimpleFrom> struct LLVM_CLASS_ABI cast_convert_val {
   // This is not a simple type, use the template to simplify it...
   static typename cast_retty<To, From>::ret_type doit(const From &Val) {
     return cast_convert_val<To, SimpleFrom,
@@ -208,7 +208,7 @@ template <class To, class From, class SimpleFrom> struct cast_convert_val {
   }
 };
 
-template <class To, class FromTy> struct cast_convert_val<To, FromTy, FromTy> {
+template <class To, class FromTy> struct LLVM_CLASS_ABI cast_convert_val<To, FromTy, FromTy> {
   // If it's a reference, switch to a pointer to do the cast and then deref it.
   static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
     return *(std::remove_reference_t<typename cast_retty<To, FromTy>::ret_type>
@@ -217,7 +217,7 @@ template <class To, class FromTy> struct cast_convert_val<To, FromTy, FromTy> {
 };
 
 template <class To, class FromTy>
-struct cast_convert_val<To, FromTy *, FromTy *> {
+struct LLVM_CLASS_ABI cast_convert_val<To, FromTy *, FromTy *> {
   // If it's a pointer, we can use c-style casting directly.
   static typename cast_retty<To, FromTy *>::ret_type doit(const FromTy *Val) {
     return (typename cast_retty<To, FromTy *>::ret_type) const_cast<FromTy *>(
@@ -229,7 +229,7 @@ struct cast_convert_val<To, FromTy *, FromTy *> {
 // is_simple_type
 //===----------------------------------------------------------------------===//
 
-template <class X> struct is_simple_type {
+template <class X> struct LLVM_CLASS_ABI is_simple_type {
   static const bool value =
       std::is_same_v<X, typename simplify_type<X>::SimpleType>;
 };
@@ -250,7 +250,7 @@ template <class X> struct is_simple_type {
 ///   }
 /// };
 template <typename To, typename From, typename Enable = void>
-struct CastIsPossible {
+struct LLVM_CLASS_ABI CastIsPossible {
   static inline bool isPossible(const From &f) {
     return isa_impl_wrap<
         To, const From,
@@ -263,7 +263,7 @@ struct CastIsPossible {
 // over. In fact, some of the isa_impl templates should be moved over to
 // CastIsPossible.
 template <typename To, typename From>
-struct CastIsPossible<To, std::optional<From>> {
+struct LLVM_CLASS_ABI CastIsPossible<To, std::optional<From>> {
   static inline bool isPossible(const std::optional<From> &f) {
     assert(f && "CastIsPossible::isPossible called on a nullopt!");
     return isa_impl_wrap<
@@ -275,7 +275,7 @@ struct CastIsPossible<To, std::optional<From>> {
 /// Upcasting (from derived to base) and casting from a type to itself should
 /// always be possible.
 template <typename To, typename From>
-struct CastIsPossible<To, From, std::enable_if_t<std::is_base_of_v<To, From>>> {
+struct LLVM_CLASS_ABI CastIsPossible<To, From, std::enable_if_t<std::is_base_of_v<To, From>>> {
   static inline bool isPossible(const From &f) { return true; }
 };
 
@@ -298,7 +298,7 @@ struct CastIsPossible<To, From, std::enable_if_t<std::is_base_of_v<To, From>>> {
 /// This cast trait just provides castFailed for the specified `To` type to make
 /// CastInfo specializations more declarative. In order to use this, the target
 /// result type must be `To` and `To` must be constructible from `nullptr`.
-template <typename To> struct NullableValueCastFailed {
+template <typename To> struct LLVM_CLASS_ABI NullableValueCastFailed {
   static To castFailed() { return To(nullptr); }
 };
 
@@ -306,7 +306,7 @@ template <typename To> struct NullableValueCastFailed {
 /// to make CastInfo specializations more declarative. The `Derived` template
 /// parameter *must* be provided for forwarding castFailed and doCast.
 template <typename To, typename From, typename Derived>
-struct DefaultDoCastIfPossible {
+struct LLVM_CLASS_ABI DefaultDoCastIfPossible {
   static To doCastIfPossible(From f) {
     if (!Derived::isPossible(f))
       return Derived::castFailed();
@@ -326,7 +326,7 @@ using SelfType = std::conditional_t<std::is_same_v<OptionalDerived, void>,
 /// value-typed object from a pointer-typed object. Note that `To` must be
 /// nullable/constructible from a pointer to `From` to use this cast.
 template <typename To, typename From, typename Derived = void>
-struct ValueFromPointerCast
+struct LLVM_CLASS_ABI ValueFromPointerCast
     : public CastIsPossible<To, From *>,
       public NullableValueCastFailed<To>,
       public DefaultDoCastIfPossible<
@@ -340,7 +340,7 @@ struct ValueFromPointerCast
 /// during the cast. It's also a good example of how to implement a move-only
 /// cast.
 template <typename To, typename From, typename Derived = void>
-struct UniquePtrCast : public CastIsPossible<To, From *> {
+struct LLVM_CLASS_ABI UniquePtrCast : public CastIsPossible<To, From *> {
   using Self = detail::SelfType<Derived, UniquePtrCast<To, From>>;
   using CastResultType = std::unique_ptr<
       std::remove_reference_t<typename cast_retty<To, From>::ret_type>>;
@@ -362,7 +362,7 @@ struct UniquePtrCast : public CastIsPossible<To, From *> {
 /// have a value type, you can cast it to another value type and have dyn_cast
 /// return an std::optional<T>.
 template <typename To, typename From, typename Derived = void>
-struct OptionalValueCast
+struct LLVM_CLASS_ABI OptionalValueCast
     : public CastIsPossible<To, From>,
       public DefaultDoCastIfPossible<
           std::optional<To>, From,
@@ -385,7 +385,7 @@ struct OptionalValueCast
 ///        ConstStrippingForwardingCast<foo, const bar, CastInfo<foo, bar>> {};
 ///
 template <typename To, typename From, typename ForwardTo>
-struct ConstStrippingForwardingCast {
+struct LLVM_CLASS_ABI ConstStrippingForwardingCast {
   // Remove the pointer if it exists, then we can get rid of consts/volatiles.
   using DecayedFrom = std::remove_cv_t<std::remove_pointer_t<From>>;
   // Now if it's a pointer, add it back. Otherwise, we want a ref.
@@ -420,7 +420,7 @@ struct ConstStrippingForwardingCast {
 ///       : public ForwardToPointerCast<foo, bar, CastInfo<foo, bar *>> {};
 ///
 template <typename To, typename From, typename ForwardTo>
-struct ForwardToPointerCast {
+struct LLVM_CLASS_ABI ForwardToPointerCast {
   static inline bool isPossible(const From &f) {
     return ForwardTo::isPossible(&f);
   }
@@ -473,7 +473,7 @@ struct ForwardToPointerCast {
 // take advantage of the cast traits whenever possible!
 
 template <typename To, typename From, typename Enable = void>
-struct CastInfo : public CastIsPossible<To, From> {
+struct LLVM_CLASS_ABI CastInfo : public CastIsPossible<To, From> {
   using Self = CastInfo<To, From, Enable>;
 
   using CastReturnType = typename cast_retty<To, From>::ret_type;
@@ -500,7 +500,7 @@ struct CastInfo : public CastIsPossible<To, From> {
 /// defined. This simply forwards to the appropriate CastInfo with the
 /// simplified type/value, so you don't have to implement both.
 template <typename To, typename From>
-struct CastInfo<To, From, std::enable_if_t<!is_simple_type<From>::value>> {
+struct LLVM_CLASS_ABI CastInfo<To, From, std::enable_if_t<!is_simple_type<From>::value>> {
   using Self = CastInfo<To, From>;
   using SimpleFrom = typename simplify_type<From>::SimpleType;
   using SimplifiedSelf = CastInfo<To, SimpleFrom>;
@@ -530,13 +530,13 @@ struct CastInfo<To, From, std::enable_if_t<!is_simple_type<From>::value>> {
 
 /// Provide a CastInfo specialized for std::unique_ptr.
 template <typename To, typename From>
-struct CastInfo<To, std::unique_ptr<From>> : public UniquePtrCast<To, From> {};
+struct LLVM_CLASS_ABI CastInfo<To, std::unique_ptr<From>> : public UniquePtrCast<To, From> {};
 
 /// Provide a CastInfo specialized for std::optional<From>. It's assumed that if
 /// the input is std::optional<From> that the output can be std::optional<To>.
 /// If that's not the case, specialize CastInfo for your use case.
 template <typename To, typename From>
-struct CastInfo<To, std::optional<From>> : public OptionalValueCast<To, From> {
+struct LLVM_CLASS_ABI CastInfo<To, std::optional<From>> : public OptionalValueCast<To, From> {
 };
 
 /// isa<X> - Return true if the parameter to the template is an instance of one
@@ -599,14 +599,14 @@ constexpr bool IsNullable =
 /// unwrapping a value (think calling .value() on an optional).
 
 // Generic values can't *not* be present.
-template <typename T, typename Enable = void> struct ValueIsPresent {
+template <typename T, typename Enable = void> struct LLVM_CLASS_ABI ValueIsPresent {
   using UnwrappedType = T;
   static inline bool isPresent(const T &t) { return true; }
   static inline decltype(auto) unwrapValue(T &t) { return t; }
 };
 
 // Optional provides its own way to check if something is present.
-template <typename T> struct ValueIsPresent<std::optional<T>> {
+template <typename T> struct LLVM_CLASS_ABI ValueIsPresent<std::optional<T>> {
   using UnwrappedType = T;
   static inline bool isPresent(const std::optional<T> &t) {
     return t.has_value();
@@ -617,7 +617,7 @@ template <typename T> struct ValueIsPresent<std::optional<T>> {
 // If something is "nullable" then we just compare it to nullptr to see if it
 // exists.
 template <typename T>
-struct ValueIsPresent<T, std::enable_if_t<IsNullable<T>>> {
+struct LLVM_CLASS_ABI ValueIsPresent<T, std::enable_if_t<IsNullable<T>>> {
   using UnwrappedType = T;
   static inline bool isPresent(const T &t) { return t != T(nullptr); }
   static inline decltype(auto) unwrapValue(T &t) { return t; }
diff --git a/llvm/include/llvm/Support/Chrono.h b/llvm/include/llvm/Support/Chrono.h
index 9c2bd45d2803e56..3c83656979daf34 100644
--- a/llvm/include/llvm/Support/Chrono.h
+++ b/llvm/include/llvm/Support/Chrono.h
@@ -57,7 +57,7 @@ toTimePoint(std::time_t T, uint32_t nsec) {
 
 } // namespace sys
 
-raw_ostream &operator<<(raw_ostream &OS, sys::TimePoint<> TP);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, sys::TimePoint<> TP);
 
 /// Format provider for TimePoint<>
 ///
@@ -68,21 +68,21 @@ raw_ostream &operator<<(raw_ostream &OS, sys::TimePoint<> TP);
 ///
 /// If no options are given, the default format is "%Y-%m-%d %H:%M:%S.%N".
 template <>
-struct format_provider<sys::TimePoint<>> {
+struct LLVM_CLASS_ABI format_provider<sys::TimePoint<>> {
   static void format(const sys::TimePoint<> &TP, llvm::raw_ostream &OS,
                      StringRef Style);
 };
 
 namespace detail {
-template <typename Period> struct unit { static const char value[]; };
+template <typename Period> struct LLVM_CLASS_ABI 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_CLASS_ABI unit<std::ratio<3600>> { static const char value[]; };
+template <> struct LLVM_CLASS_ABI unit<std::ratio<60>> { static const char value[]; };
+template <> struct LLVM_CLASS_ABI unit<std::ratio<1>> { static const char value[]; };
+template <> struct LLVM_CLASS_ABI unit<std::milli> { static const char value[]; };
+template <> struct LLVM_CLASS_ABI unit<std::micro> { static const char value[]; };
+template <> struct LLVM_CLASS_ABI unit<std::nano> { static const char value[]; };
 } // namespace detail
 
 /// Implementation of format_provider<T> for duration types.
@@ -110,7 +110,7 @@ template <> struct unit<std::nano> { static const char value[]; };
 ///  display unit or you request that the unit is not displayed.
 
 template <typename Rep, typename Period>
-struct format_provider<std::chrono::duration<Rep, Period>> {
+struct LLVM_CLASS_ABI format_provider<std::chrono::duration<Rep, Period>> {
 private:
   typedef std::chrono::duration<Rep, Period> Dur;
   typedef std::conditional_t<std::chrono::treat_as_floating_point<Rep>::value,
diff --git a/llvm/include/llvm/Support/CodeGenCoverage.h b/llvm/include/llvm/Support/CodeGenCoverage.h
index 218fdd90ed81721..7887b5b2752715f 100644
--- a/llvm/include/llvm/Support/CodeGenCoverage.h
+++ b/llvm/include/llvm/Support/CodeGenCoverage.h
@@ -17,7 +17,7 @@
 namespace llvm {
 class MemoryBuffer;
 
-class CodeGenCoverage {
+class LLVM_CLASS_ABI CodeGenCoverage {
 protected:
   BitVector RuleCoverage;
 
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
index 4ed41480ba54ddb..342861e373ee9e9 100644
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/include/llvm/Support/CommandLine.h
@@ -67,7 +67,7 @@ namespace cl {
 // 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.
-bool ParseCommandLineOptions(int argc, const char *const *argv,
+LLVM_FUNC_ABI bool ParseCommandLineOptions(int argc, const char *const *argv,
                              StringRef Overview = "",
                              raw_ostream *Errs = nullptr,
                              const char *EnvVar = nullptr,
@@ -80,20 +80,20 @@ using VersionPrinterTy = std::function<void(raw_ostream &)>;
 /// Override the default (LLVM specific) version printer 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_FUNC_ABI void SetVersionPrinter(VersionPrinterTy func);
 
 ///===---------------------------------------------------------------------===//
 /// Add an extra printer to use in addition to the default one. This can be
 /// called multiple times, and each time it adds a new function to the list
 /// 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_FUNC_ABI void AddExtraVersionPrinter(VersionPrinterTy func);
 
 // 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_FUNC_ABI void PrintOptionValues();
 
 // Forward declaration - AddLiteralOption needs to be up here to make gcc happy.
 class Option;
@@ -105,7 +105,7 @@ class Option;
 ///
 /// Literal options are used by some parsers to register special option values.
 /// This is how the PassNameParser registers pass names for opt.
-void AddLiteralOption(Option &O, StringRef Name);
+LLVM_FUNC_ABI void AddLiteralOption(Option &O, StringRef Name);
 
 //===----------------------------------------------------------------------===//
 // Flags permitted to be passed to command line arguments
@@ -178,7 +178,7 @@ enum MiscFlags {             // Miscellaneous flags to adjust argument
 
 //===----------------------------------------------------------------------===//
 //
-class OptionCategory {
+class LLVM_CLASS_ABI OptionCategory {
 private:
   StringRef const Name;
   StringRef const Description;
@@ -197,11 +197,11 @@ class OptionCategory {
 };
 
 // The general Option Category (used as default category).
-OptionCategory &getGeneralCategory();
+LLVM_FUNC_ABI OptionCategory &getGeneralCategory();
 
 //===----------------------------------------------------------------------===//
 //
-class SubCommand {
+class LLVM_CLASS_ABI SubCommand {
 private:
   StringRef Name;
   StringRef Description;
@@ -239,14 +239,14 @@ class SubCommand {
 };
 
 // A special subcommand representing no subcommand
-extern ManagedStatic<SubCommand> TopLevelSubCommand;
+LLVM_FUNC_ABI extern ManagedStatic<SubCommand> TopLevelSubCommand;
 
 // A special subcommand that can be used to put an option into all subcommands.
-extern ManagedStatic<SubCommand> AllSubCommands;
+LLVM_FUNC_ABI extern ManagedStatic<SubCommand> AllSubCommands;
 
 //===----------------------------------------------------------------------===//
 //
-class Option {
+class LLVM_CLASS_ABI Option {
   friend class alias;
 
   // Overriden by subclasses to handle the value passed into an argument. Should
@@ -409,7 +409,7 @@ class Option {
 //
 
 // Modifier to set the description shown in the -help output...
-struct desc {
+struct LLVM_CLASS_ABI desc {
   StringRef Desc;
 
   desc(StringRef Str) : Desc(Str) {}
@@ -418,7 +418,7 @@ struct desc {
 };
 
 // Modifier to set the value description shown in the -help output...
-struct value_desc {
+struct LLVM_CLASS_ABI value_desc {
   StringRef Desc;
 
   value_desc(StringRef Str) : Desc(Str) {}
@@ -429,14 +429,14 @@ struct value_desc {
 // Specify a default (initial) value for the command line argument, if the
 // default constructor for the argument type does not give you what you want.
 // This is only valid on "opt" arguments, not on "list" arguments.
-template <class Ty> struct initializer {
+template <class Ty> struct LLVM_CLASS_ABI initializer {
   const Ty &Init;
   initializer(const Ty &Val) : Init(Val) {}
 
   template <class Opt> void apply(Opt &O) const { O.setInitialValue(Init); }
 };
 
-template <class Ty> struct list_initializer {
+template <class Ty> struct LLVM_CLASS_ABI list_initializer {
   ArrayRef<Ty> Inits;
   list_initializer(ArrayRef<Ty> Vals) : Inits(Vals) {}
 
@@ -455,7 +455,7 @@ list_initializer<Ty> list_init(ArrayRef<Ty> Vals) {
 // Allow the user to specify which external variable they want to store the
 // results of the command line argument processing into, if they don't want to
 // store it in the option itself.
-template <class Ty> struct LocationClass {
+template <class Ty> struct LLVM_CLASS_ABI LocationClass {
   Ty &Loc;
 
   LocationClass(Ty &L) : Loc(L) {}
@@ -468,7 +468,7 @@ template <class Ty> LocationClass<Ty> location(Ty &L) {
 }
 
 // Specify the Option category for the command line argument to belong to.
-struct cat {
+struct LLVM_CLASS_ABI cat {
   OptionCategory &Category;
 
   cat(OptionCategory &c) : Category(c) {}
@@ -477,7 +477,7 @@ struct cat {
 };
 
 // Specify the subcommand that this option belongs to.
-struct sub {
+struct LLVM_CLASS_ABI sub {
   SubCommand ⋐
 
   sub(SubCommand &S) : Sub(S) {}
@@ -487,7 +487,7 @@ struct sub {
 
 // Specify a callback function to be called when an option is seen.
 // Can be used to set other options automatically.
-template <typename R, typename Ty> struct cb {
+template <typename R, typename Ty> struct LLVM_CLASS_ABI cb {
   std::function<R(Ty)> CB;
 
   cb(std::function<R(Ty)> CB) : CB(CB) {}
@@ -497,10 +497,10 @@ template <typename R, typename Ty> struct cb {
 
 namespace detail {
 template <typename F>
-struct callback_traits : public callback_traits<decltype(&F::operator())> {};
+struct LLVM_CLASS_ABI callback_traits : public callback_traits<decltype(&F::operator())> {};
 
 template <typename R, typename C, typename... Args>
-struct callback_traits<R (C::*)(Args...) const> {
+struct LLVM_CLASS_ABI callback_traits<R (C::*)(Args...) const> {
   using result_type = R;
   using arg_type = std::tuple_element_t<0, std::tuple<Args...>>;
   static_assert(sizeof...(Args) == 1, "callback function must have one and only one parameter");
@@ -524,7 +524,7 @@ callback(F CB) {
 //===----------------------------------------------------------------------===//
 
 // Support value comparison outside the template.
-struct GenericOptionValue {
+struct LLVM_CLASS_ABI GenericOptionValue {
   virtual bool compare(const GenericOptionValue &V) const = 0;
 
 protected:
@@ -542,7 +542,7 @@ template <class DataType> struct OptionValue;
 // The default value safely does nothing. Option value printing is only
 // best-effort.
 template <class DataType, bool isClass>
-struct OptionValueBase : public GenericOptionValue {
+struct LLVM_CLASS_ABI OptionValueBase : public GenericOptionValue {
   // Temporary storage for argument passing.
   using WrapperType = OptionValue<DataType>;
 
@@ -564,7 +564,7 @@ struct OptionValueBase : public GenericOptionValue {
 };
 
 // Simple copy of the option value.
-template <class DataType> class OptionValueCopy : public GenericOptionValue {
+template <class DataType> class LLVM_CLASS_ABI OptionValueCopy : public GenericOptionValue {
   DataType Value;
   bool Valid = false;
 
@@ -601,7 +601,7 @@ template <class DataType> class OptionValueCopy : public GenericOptionValue {
 
 // Non-class option values.
 template <class DataType>
-struct OptionValueBase<DataType, false> : OptionValueCopy<DataType> {
+struct LLVM_CLASS_ABI OptionValueBase<DataType, false> : OptionValueCopy<DataType> {
   using WrapperType = DataType;
 
 protected:
@@ -613,7 +613,7 @@ struct OptionValueBase<DataType, false> : OptionValueCopy<DataType> {
 
 // Top-level option class.
 template <class DataType>
-struct OptionValue final
+struct LLVM_CLASS_ABI OptionValue final
     : OptionValueBase<DataType, std::is_class_v<DataType>> {
   OptionValue() = default;
 
@@ -629,7 +629,7 @@ struct OptionValue final
 // Other safe-to-copy-by-value common option types.
 enum boolOrDefault { BOU_UNSET, BOU_TRUE, BOU_FALSE };
 template <>
-struct OptionValue<cl::boolOrDefault> final
+struct LLVM_CLASS_ABI OptionValue<cl::boolOrDefault> final
     : OptionValueCopy<cl::boolOrDefault> {
   using WrapperType = cl::boolOrDefault;
 
@@ -647,7 +647,7 @@ struct OptionValue<cl::boolOrDefault> final
 };
 
 template <>
-struct OptionValue<std::string> final : OptionValueCopy<std::string> {
+struct LLVM_CLASS_ABI OptionValue<std::string> final : OptionValueCopy<std::string> {
   using WrapperType = StringRef;
 
   OptionValue() = default;
@@ -668,7 +668,7 @@ struct OptionValue<std::string> final : OptionValueCopy<std::string> {
 //
 
 // This represents a single enum value, using "int" as the underlying type.
-struct OptionEnumValue {
+struct LLVM_CLASS_ABI OptionEnumValue {
   StringRef Name;
   int Value;
   StringRef Description;
@@ -682,7 +682,7 @@ struct OptionEnumValue {
 // For custom data types, allow specifying a group of values together as the
 // values that go into the mapping that the option handler uses.
 //
-class ValuesClass {
+class LLVM_CLASS_ABI ValuesClass {
   // Use a vector instead of a map, because the lists should be short,
   // the overhead is less, and most importantly, it keeps them in the order
   // inserted so we can print our option out nicely.
@@ -717,7 +717,7 @@ template <typename... OptsTy> ValuesClass values(OptsTy... Options) {
 // every instance of the generic parser.  This also allows us to put stuff into
 // CommandLine.cpp
 //
-class generic_parser_base {
+class LLVM_CLASS_ABI generic_parser_base {
 protected:
   class GenericOptionInfo {
   public:
@@ -813,7 +813,7 @@ class generic_parser_base {
 // command line option for -help.  Because this is a simple mapping parser, the
 // data type can be any unsupported type.
 //
-template <class DataType> class parser : public generic_parser_base {
+template <class DataType> class LLVM_CLASS_ABI parser : public generic_parser_base {
 protected:
   class OptionInfo : public GenericOptionInfo {
   public:
@@ -880,7 +880,7 @@ template <class DataType> class parser : public generic_parser_base {
 //--------------------------------------------------
 // Super class of parsers to provide boilerplate code
 //
-class basic_parser_impl { // non-template implementation of basic_parser<t>
+class LLVM_CLASS_ABI basic_parser_impl { // non-template implementation of basic_parser<t>
 public:
   basic_parser_impl(Option &) {}
 
@@ -919,7 +919,7 @@ class basic_parser_impl { // non-template implementation of basic_parser<t>
 // The real basic parser is just a template wrapper that provides a typedef for
 // the provided data type.
 //
-template <class DataType> class basic_parser : public basic_parser_impl {
+template <class DataType> class LLVM_CLASS_ABI basic_parser : public basic_parser_impl {
 public:
   using parser_data_type = DataType;
   using OptVal = OptionValue<DataType>;
@@ -931,7 +931,7 @@ template <class DataType> class basic_parser : public basic_parser_impl {
 
 extern template class basic_parser<bool>;
 
-template <> class parser<bool> : public basic_parser<bool> {
+template <> class LLVM_CLASS_ABI parser<bool> : public basic_parser<bool> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -958,7 +958,7 @@ template <> class parser<bool> : public basic_parser<bool> {
 
 extern template class basic_parser<boolOrDefault>;
 
-template <> class parser<boolOrDefault> : public basic_parser<boolOrDefault> {
+template <> class LLVM_CLASS_ABI parser<boolOrDefault> : public basic_parser<boolOrDefault> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -983,7 +983,7 @@ template <> class parser<boolOrDefault> : public basic_parser<boolOrDefault> {
 
 extern template class basic_parser<int>;
 
-template <> class parser<int> : public basic_parser<int> {
+template <> class LLVM_CLASS_ABI parser<int> : public basic_parser<int> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1004,7 +1004,7 @@ template <> class parser<int> : public basic_parser<int> {
 
 extern template class basic_parser<long>;
 
-template <> class parser<long> final : public basic_parser<long> {
+template <> class LLVM_CLASS_ABI parser<long> final : public basic_parser<long> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1025,7 +1025,7 @@ template <> class parser<long> final : public basic_parser<long> {
 
 extern template class basic_parser<long long>;
 
-template <> class parser<long long> : public basic_parser<long long> {
+template <> class LLVM_CLASS_ABI parser<long long> : public basic_parser<long long> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1046,7 +1046,7 @@ template <> class parser<long long> : public basic_parser<long long> {
 
 extern template class basic_parser<unsigned>;
 
-template <> class parser<unsigned> : public basic_parser<unsigned> {
+template <> class LLVM_CLASS_ABI parser<unsigned> : public basic_parser<unsigned> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1068,7 +1068,7 @@ template <> class parser<unsigned> : public basic_parser<unsigned> {
 extern template class basic_parser<unsigned long>;
 
 template <>
-class parser<unsigned long> final : public basic_parser<unsigned long> {
+class LLVM_CLASS_ABI parser<unsigned long> final : public basic_parser<unsigned long> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1090,7 +1090,7 @@ class parser<unsigned long> final : public basic_parser<unsigned long> {
 extern template class basic_parser<unsigned long long>;
 
 template <>
-class parser<unsigned long long> : public basic_parser<unsigned long long> {
+class LLVM_CLASS_ABI parser<unsigned long long> : public basic_parser<unsigned long long> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1112,7 +1112,7 @@ class parser<unsigned long long> : public basic_parser<unsigned long long> {
 
 extern template class basic_parser<double>;
 
-template <> class parser<double> : public basic_parser<double> {
+template <> class LLVM_CLASS_ABI parser<double> : public basic_parser<double> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1133,7 +1133,7 @@ template <> class parser<double> : public basic_parser<double> {
 
 extern template class basic_parser<float>;
 
-template <> class parser<float> : public basic_parser<float> {
+template <> class LLVM_CLASS_ABI parser<float> : public basic_parser<float> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1154,7 +1154,7 @@ template <> class parser<float> : public basic_parser<float> {
 
 extern template class basic_parser<std::string>;
 
-template <> class parser<std::string> : public basic_parser<std::string> {
+template <> class LLVM_CLASS_ABI parser<std::string> : public basic_parser<std::string> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1178,7 +1178,7 @@ template <> class parser<std::string> : public basic_parser<std::string> {
 
 extern template class basic_parser<char>;
 
-template <> class parser<char> : public basic_parser<char> {
+template <> class LLVM_CLASS_ABI parser<char> : public basic_parser<char> {
 public:
   parser(Option &O) : basic_parser(O) {}
 
@@ -1212,7 +1212,7 @@ void printOptionDiff(const Option &O, const generic_parser_base &P, const DT &V,
 
 // This is instantiated for basic parsers when the parsed value has a different
 // type than the option value. e.g. HelpPrinter.
-template <class ParserDT, class ValDT> struct OptionDiffPrinter {
+template <class ParserDT, class ValDT> struct LLVM_CLASS_ABI OptionDiffPrinter {
   void print(const Option &O, const parser<ParserDT> &P, const ValDT & /*V*/,
              const OptionValue<ValDT> & /*Default*/, size_t GlobalWidth) {
     P.printOptionNoValue(O, GlobalWidth);
@@ -1221,7 +1221,7 @@ template <class ParserDT, class ValDT> struct OptionDiffPrinter {
 
 // This is instantiated for basic parsers when the parsed value has the same
 // type as the option value.
-template <class DT> struct OptionDiffPrinter<DT, DT> {
+template <class DT> struct LLVM_CLASS_ABI OptionDiffPrinter<DT, DT> {
   void print(const Option &O, const parser<DT> &P, const DT &V,
              const OptionValue<DT> &Default, size_t GlobalWidth) {
     P.printOptionDiff(O, V, Default, GlobalWidth);
@@ -1247,46 +1247,46 @@ void printOptionDiff(
 // the apply method). Because the syntax to use this is a pain, we have the
 // 'apply' method below to handle the nastiness...
 //
-template <class Mod> struct applicator {
+template <class Mod> struct LLVM_CLASS_ABI applicator {
   template <class Opt> static void opt(const Mod &M, Opt &O) { M.apply(O); }
 };
 
 // Handle const char* as a special case...
-template <unsigned n> struct applicator<char[n]> {
+template <unsigned n> struct LLVM_CLASS_ABI applicator<char[n]> {
   template <class Opt> static void opt(StringRef Str, Opt &O) {
     O.setArgStr(Str);
   }
 };
-template <unsigned n> struct applicator<const char[n]> {
+template <unsigned n> struct LLVM_CLASS_ABI applicator<const char[n]> {
   template <class Opt> static void opt(StringRef Str, Opt &O) {
     O.setArgStr(Str);
   }
 };
-template <> struct applicator<StringRef > {
+template <> struct LLVM_CLASS_ABI applicator<StringRef > {
   template <class Opt> static void opt(StringRef Str, Opt &O) {
     O.setArgStr(Str);
   }
 };
 
-template <> struct applicator<NumOccurrencesFlag> {
+template <> struct LLVM_CLASS_ABI applicator<NumOccurrencesFlag> {
   static void opt(NumOccurrencesFlag N, Option &O) {
     O.setNumOccurrencesFlag(N);
   }
 };
 
-template <> struct applicator<ValueExpected> {
+template <> struct LLVM_CLASS_ABI applicator<ValueExpected> {
   static void opt(ValueExpected VE, Option &O) { O.setValueExpectedFlag(VE); }
 };
 
-template <> struct applicator<OptionHidden> {
+template <> struct LLVM_CLASS_ABI applicator<OptionHidden> {
   static void opt(OptionHidden OH, Option &O) { O.setHiddenFlag(OH); }
 };
 
-template <> struct applicator<FormattingFlags> {
+template <> struct LLVM_CLASS_ABI applicator<FormattingFlags> {
   static void opt(FormattingFlags FF, Option &O) { O.setFormattingFlag(FF); }
 };
 
-template <> struct applicator<MiscFlags> {
+template <> struct LLVM_CLASS_ABI applicator<MiscFlags> {
   static void opt(MiscFlags MF, Option &O) {
     assert((MF != Grouping || O.ArgStr.size() == 1) &&
            "cl::Grouping can only apply to single character Options.");
@@ -1311,7 +1311,7 @@ template <class Opt, class Mod> void apply(Opt *O, const Mod &M) {
 // cl::location(x) modifier.
 //
 template <class DataType, bool ExternalStorage, bool isClass>
-class opt_storage {
+class LLVM_CLASS_ABI opt_storage {
   DataType *Location = nullptr; // Where to store the object...
   OptionValue<DataType> Default;
 
@@ -1358,7 +1358,7 @@ class opt_storage {
 // object in all cases that it is used.
 //
 template <class DataType>
-class opt_storage<DataType, false, true> : public DataType {
+class LLVM_CLASS_ABI opt_storage<DataType, false, true> : public DataType {
 public:
   OptionValue<DataType> Default;
 
@@ -1378,7 +1378,7 @@ class opt_storage<DataType, false, true> : public DataType {
 // this case, we store an instance through containment, and overload operators
 // to get at the value.
 //
-template <class DataType> class opt_storage<DataType, false, false> {
+template <class DataType> class LLVM_CLASS_ABI opt_storage<DataType, false, false> {
 public:
   DataType Value;
   OptionValue<DataType> Default;
@@ -1408,7 +1408,7 @@ template <class DataType> class opt_storage<DataType, false, false> {
 //
 template <class DataType, bool ExternalStorage = false,
           class ParserClass = parser<DataType>>
-class opt
+class LLVM_CLASS_ABI opt
     : public Option,
       public opt_storage<DataType, ExternalStorage, std::is_class_v<DataType>> {
   ParserClass Parser;
@@ -1511,7 +1511,7 @@ extern template class opt<bool>;
 // assumes the user will specify a variable to store the data into with the
 // cl::location(x) modifier.
 //
-template <class DataType, class StorageClass> class list_storage {
+template <class DataType, class StorageClass> class LLVM_CLASS_ABI list_storage {
   StorageClass *Location = nullptr; // Where to store the object...
   std::vector<OptionValue<DataType>> Default =
       std::vector<OptionValue<DataType>>();
@@ -1555,7 +1555,7 @@ template <class DataType, class StorageClass> class list_storage {
 //
 // FIXME: Reduce this API to a more narrow subset of std::vector
 //
-template <class DataType> class list_storage<DataType, bool> {
+template <class DataType> class LLVM_CLASS_ABI list_storage<DataType, bool> {
   std::vector<DataType> Storage;
   std::vector<OptionValue<DataType>> Default;
   bool DefaultAssigned = false;
@@ -1642,7 +1642,7 @@ template <class DataType> class list_storage<DataType, bool> {
 //
 template <class DataType, class StorageClass = bool,
           class ParserClass = parser<DataType>>
-class list : public Option, public list_storage<DataType, StorageClass> {
+class LLVM_CLASS_ABI list : public Option, public list_storage<DataType, StorageClass> {
   std::vector<unsigned> Positions;
   ParserClass Parser;
 
@@ -1741,7 +1741,7 @@ class list : public Option, public list_storage<DataType, StorageClass> {
 };
 
 // Modifier to set the number of additional values.
-struct multi_val {
+struct LLVM_CLASS_ABI multi_val {
   unsigned AdditionalVals;
   explicit multi_val(unsigned N) : AdditionalVals(N) {}
 
@@ -1756,7 +1756,7 @@ struct multi_val {
 // assumes the user will specify a variable to store the data into with the
 // cl::location(x) modifier.
 //
-template <class DataType, class StorageClass> class bits_storage {
+template <class DataType, class StorageClass> class LLVM_CLASS_ABI bits_storage {
   unsigned *Location = nullptr; // Where to store the bits...
 
   template <class T> static unsigned Bit(const T &V) {
@@ -1798,7 +1798,7 @@ template <class DataType, class StorageClass> class bits_storage {
 // Define how to hold bits.  Since we can inherit from a class, we do so.
 // This makes us exactly compatible with the bits in all cases that it is used.
 //
-template <class DataType> class bits_storage<DataType, bool> {
+template <class DataType> class LLVM_CLASS_ABI bits_storage<DataType, bool> {
   unsigned Bits{0}; // Where to store the bits...
 
   template <class T> static unsigned Bit(const T &V) {
@@ -1823,7 +1823,7 @@ template <class DataType> class bits_storage<DataType, bool> {
 //
 template <class DataType, class Storage = bool,
           class ParserClass = parser<DataType>>
-class bits : public Option, public bits_storage<DataType, Storage> {
+class LLVM_CLASS_ABI bits : public Option, public bits_storage<DataType, Storage> {
   std::vector<unsigned> Positions;
   ParserClass Parser;
 
@@ -1900,7 +1900,7 @@ class bits : public Option, public bits_storage<DataType, Storage> {
 // Aliased command line option (alias this name to a preexisting name)
 //
 
-class alias : public Option {
+class LLVM_CLASS_ABI alias : public Option {
   Option *AliasFor;
 
   bool handleOccurrence(unsigned pos, StringRef /*ArgName*/,
@@ -1959,7 +1959,7 @@ class alias : public Option {
 };
 
 // Modifier to set the option an alias aliases.
-struct aliasopt {
+struct LLVM_CLASS_ABI aliasopt {
   Option &Opt;
 
   explicit aliasopt(Option &O) : Opt(O) {}
@@ -1970,20 +1970,20 @@ struct aliasopt {
 // Provide additional help at the end of the normal help 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_CLASS_ABI extrahelp {
   StringRef morehelp;
 
   explicit extrahelp(StringRef help);
 };
 
-void PrintVersionMessage();
+LLVM_FUNC_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_FUNC_ABI void PrintHelpMessage(bool Hidden = false, bool Categorized = false);
 
 //===----------------------------------------------------------------------===//
 // Public interface for accessing registered options.
@@ -2016,7 +2016,7 @@ void PrintHelpMessage(bool Hidden = false, bool Categorized = false);
 /// 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 *> &
+LLVM_FUNC_ABI StringMap<Option *> &
 getRegisteredOptions(SubCommand &Sub = SubCommand::getTopLevel());
 
 /// Use this to get all registered SubCommands from the provided parser.
@@ -2038,7 +2038,7 @@ getRegisteredOptions(SubCommand &Sub = SubCommand::getTopLevel());
 ///
 /// 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_FUNC_ABI iterator_range<typename SmallPtrSet<SubCommand *, 4>::iterator>
 getRegisteredSubcommands();
 
 //===----------------------------------------------------------------------===//
@@ -2057,7 +2057,7 @@ getRegisteredSubcommands();
 /// \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_FUNC_ABI void TokenizeGNUCommandLine(StringRef Source, StringSaver &Saver,
                             SmallVectorImpl<const char *> &NewArgv,
                             bool MarkEOLs = false);
 
@@ -2075,7 +2075,7 @@ void TokenizeGNUCommandLine(StringRef Source, StringSaver &Saver,
 /// \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_FUNC_ABI void TokenizeWindowsCommandLine(StringRef Source, StringSaver &Saver,
                                 SmallVectorImpl<const char *> &NewArgv,
                                 bool MarkEOLs = false);
 
@@ -2083,7 +2083,7 @@ void TokenizeWindowsCommandLine(StringRef Source, StringSaver &Saver,
 /// 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_FUNC_ABI void TokenizeWindowsCommandLineNoCopy(StringRef Source, StringSaver &Saver,
                                       SmallVectorImpl<StringRef> &NewArgv);
 
 /// Tokenizes a Windows full command line, including command name at the start.
@@ -2099,7 +2099,7 @@ void TokenizeWindowsCommandLineNoCopy(StringRef Source, StringSaver &Saver,
 /// if you set MarkEOLs = true, then the first word of every line will be
 /// parsed using the special rules for command names, making this function
 /// suitable for parsing a file full of commands to execute.
-void TokenizeWindowsCommandLineFull(StringRef Source, StringSaver &Saver,
+LLVM_FUNC_ABI void TokenizeWindowsCommandLineFull(StringRef Source, StringSaver &Saver,
                                     SmallVectorImpl<const char *> &NewArgv,
                                     bool MarkEOLs = false);
 
@@ -2118,12 +2118,12 @@ using TokenizerCallback = void (*)(StringRef Source, StringSaver &Saver,
 ///
 /// It works like TokenizeGNUCommandLine with ability to skip comment lines.
 ///
-void tokenizeConfigFile(StringRef Source, StringSaver &Saver,
+LLVM_FUNC_ABI void tokenizeConfigFile(StringRef Source, StringSaver &Saver,
                         SmallVectorImpl<const char *> &NewArgv,
                         bool MarkEOLs = false);
 
 /// Contains options that control response file expansion.
-class ExpansionContext {
+class LLVM_CLASS_ABI ExpansionContext {
   /// Provides persistent storage for parsed strings.
   StringSaver Saver;
 
@@ -2213,19 +2213,19 @@ class ExpansionContext {
 /// environment variable EnvVar and command line options, then expands
 /// response files recursively.
 /// \return true if all @files were expanded successfully or there were none.
-bool expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar,
+LLVM_FUNC_ABI bool expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar,
                          SmallVectorImpl<const char *> &NewArgv);
 
 /// A convenience helper which supports the typical use case of expansion
 /// function call.
-bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer,
+LLVM_FUNC_ABI bool ExpandResponseFiles(StringSaver &Saver, TokenizerCallback Tokenizer,
                          SmallVectorImpl<const char *> &Argv);
 
 /// A convenience helper which concatenates the options specified by the
 /// 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_FUNC_ABI bool expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar,
                          StringSaver &Saver,
                          SmallVectorImpl<const char *> &NewArgv);
 
@@ -2236,7 +2236,7 @@ bool expandResponseFiles(int Argc, const char *const *Argv, const char *EnvVar,
 /// 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.
-void HideUnrelatedOptions(cl::OptionCategory &Category,
+LLVM_FUNC_ABI void HideUnrelatedOptions(cl::OptionCategory &Category,
                           SubCommand &Sub = SubCommand::getTopLevel());
 
 /// Mark all options not part of the categories as cl::ReallyHidden.
@@ -2246,22 +2246,22 @@ void HideUnrelatedOptions(cl::OptionCategory &Category,
 /// 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.
-void HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories,
+LLVM_FUNC_ABI void HideUnrelatedOptions(ArrayRef<const cl::OptionCategory *> Categories,
                           SubCommand &Sub = SubCommand::getTopLevel());
 
 /// 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_FUNC_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_FUNC_ABI void ResetCommandLineParser();
 
 /// Parses `Arg` into the option handler `Handler`.
-bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i);
+LLVM_FUNC_ABI bool ProvidePositionalOption(Option *Handler, StringRef Arg, int i);
 
 } // end namespace cl
 
diff --git a/llvm/include/llvm/Support/Compression.h b/llvm/include/llvm/Support/Compression.h
index a144443345d8ed6..551738ea75dad24 100644
--- a/llvm/include/llvm/Support/Compression.h
+++ b/llvm/include/llvm/Support/Compression.h
@@ -39,16 +39,16 @@ constexpr int BestSpeedCompression = 1;
 constexpr int DefaultCompression = 6;
 constexpr int BestSizeCompression = 9;
 
-bool isAvailable();
+LLVM_FUNC_ABI bool isAvailable();
 
-void compress(ArrayRef<uint8_t> Input,
+LLVM_FUNC_ABI void compress(ArrayRef<uint8_t> Input,
               SmallVectorImpl<uint8_t> &CompressedBuffer,
               int Level = DefaultCompression);
 
-Error decompress(ArrayRef<uint8_t> Input, uint8_t *Output,
+LLVM_FUNC_ABI Error decompress(ArrayRef<uint8_t> Input, uint8_t *Output,
                  size_t &UncompressedSize);
 
-Error decompress(ArrayRef<uint8_t> Input, SmallVectorImpl<uint8_t> &Output,
+LLVM_FUNC_ABI Error decompress(ArrayRef<uint8_t> Input, SmallVectorImpl<uint8_t> &Output,
                  size_t UncompressedSize);
 
 } // End of namespace zlib
@@ -60,16 +60,16 @@ constexpr int BestSpeedCompression = 1;
 constexpr int DefaultCompression = 5;
 constexpr int BestSizeCompression = 12;
 
-bool isAvailable();
+LLVM_FUNC_ABI bool isAvailable();
 
-void compress(ArrayRef<uint8_t> Input,
+LLVM_FUNC_ABI void compress(ArrayRef<uint8_t> Input,
               SmallVectorImpl<uint8_t> &CompressedBuffer,
               int Level = DefaultCompression);
 
-Error decompress(ArrayRef<uint8_t> Input, uint8_t *Output,
+LLVM_FUNC_ABI Error decompress(ArrayRef<uint8_t> Input, uint8_t *Output,
                  size_t &UncompressedSize);
 
-Error decompress(ArrayRef<uint8_t> Input, SmallVectorImpl<uint8_t> &Output,
+LLVM_FUNC_ABI Error decompress(ArrayRef<uint8_t> Input, SmallVectorImpl<uint8_t> &Output,
                  size_t UncompressedSize);
 
 } // End of namespace zstd
@@ -91,7 +91,7 @@ inline Format formatFor(DebugCompressionType Type) {
   llvm_unreachable("");
 }
 
-struct Params {
+struct LLVM_CLASS_ABI Params {
   constexpr Params(Format F)
       : format(F), level(F == Format::Zlib ? zlib::DefaultCompression
                                            : zstd::DefaultCompression) {}
@@ -107,19 +107,19 @@ struct Params {
 // Return nullptr if LLVM was built with support (LLVM_ENABLE_ZLIB,
 // LLVM_ENABLE_ZSTD) for the specified compression format; otherwise
 // return a string literal describing the reason.
-const char *getReasonIfUnsupported(Format F);
+LLVM_FUNC_ABI const char *getReasonIfUnsupported(Format F);
 
 // Compress Input with the specified format P.Format. If Level is -1, use
 // *::DefaultCompression for the format.
-void compress(Params P, ArrayRef<uint8_t> Input,
+LLVM_FUNC_ABI void compress(Params P, ArrayRef<uint8_t> Input,
               SmallVectorImpl<uint8_t> &Output);
 
 // Decompress Input. The uncompressed size must be available.
-Error decompress(DebugCompressionType T, ArrayRef<uint8_t> Input,
+LLVM_FUNC_ABI Error decompress(DebugCompressionType T, ArrayRef<uint8_t> Input,
                  uint8_t *Output, size_t UncompressedSize);
-Error decompress(Format F, ArrayRef<uint8_t> Input,
+LLVM_FUNC_ABI Error decompress(Format F, ArrayRef<uint8_t> Input,
                  SmallVectorImpl<uint8_t> &Output, size_t UncompressedSize);
-Error decompress(DebugCompressionType T, ArrayRef<uint8_t> Input,
+LLVM_FUNC_ABI Error decompress(DebugCompressionType T, ArrayRef<uint8_t> Input,
                  SmallVectorImpl<uint8_t> &Output, size_t UncompressedSize);
 
 } // End of namespace compression
diff --git a/llvm/include/llvm/Support/ConvertEBCDIC.h b/llvm/include/llvm/Support/ConvertEBCDIC.h
index 2ec7404198ce787..658251d7d7faa8c 100644
--- a/llvm/include/llvm/Support/ConvertEBCDIC.h
+++ b/llvm/include/llvm/Support/ConvertEBCDIC.h
@@ -20,10 +20,10 @@
 
 namespace llvm {
 namespace ConverterEBCDIC {
-std::error_code convertToEBCDIC(StringRef Source,
+LLVM_FUNC_ABI std::error_code convertToEBCDIC(StringRef Source,
                                 SmallVectorImpl<char> &Result);
 
-void convertToUTF8(StringRef Source, SmallVectorImpl<char> &Result);
+LLVM_FUNC_ABI void convertToUTF8(StringRef Source, SmallVectorImpl<char> &Result);
 
 } // namespace ConverterEBCDIC
 } // namespace llvm
diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h
index b2fe1bc258b59aa..72e2dfad6e9d397 100644
--- a/llvm/include/llvm/Support/ConvertUTF.h
+++ b/llvm/include/llvm/Support/ConvertUTF.h
@@ -158,7 +158,7 @@ typedef enum {
   lenientConversion
 } ConversionFlags;
 
-ConversionResult ConvertUTF8toUTF16 (
+LLVM_FUNC_ABI ConversionResult ConvertUTF8toUTF16 (
   const UTF8** sourceStart, const UTF8* sourceEnd,
   UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
 
@@ -166,7 +166,7 @@ ConversionResult ConvertUTF8toUTF16 (
  * Convert a partial UTF8 sequence to UTF32.  If the sequence ends in an
  * incomplete code unit sequence, returns \c sourceExhausted.
  */
-ConversionResult ConvertUTF8toUTF32Partial(
+LLVM_FUNC_ABI ConversionResult ConvertUTF8toUTF32Partial(
   const UTF8** sourceStart, const UTF8* sourceEnd,
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
 
@@ -174,33 +174,33 @@ ConversionResult ConvertUTF8toUTF32Partial(
  * Convert a partial UTF8 sequence to UTF32.  If the sequence ends in an
  * incomplete code unit sequence, returns \c sourceIllegal.
  */
-ConversionResult ConvertUTF8toUTF32(
+LLVM_FUNC_ABI ConversionResult ConvertUTF8toUTF32(
   const UTF8** sourceStart, const UTF8* sourceEnd,
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
 
-ConversionResult ConvertUTF16toUTF8 (
+LLVM_FUNC_ABI ConversionResult ConvertUTF16toUTF8 (
   const UTF16** sourceStart, const UTF16* sourceEnd,
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
 
-ConversionResult ConvertUTF32toUTF8 (
+LLVM_FUNC_ABI ConversionResult ConvertUTF32toUTF8 (
   const UTF32** sourceStart, const UTF32* sourceEnd,
   UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
 
-ConversionResult ConvertUTF16toUTF32 (
+LLVM_FUNC_ABI ConversionResult ConvertUTF16toUTF32 (
   const UTF16** sourceStart, const UTF16* sourceEnd,
   UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
 
-ConversionResult ConvertUTF32toUTF16 (
+LLVM_FUNC_ABI ConversionResult ConvertUTF32toUTF16 (
   const UTF32** sourceStart, const UTF32* sourceEnd,
   UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
 
-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
+LLVM_FUNC_ABI Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
 
-Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd);
+LLVM_FUNC_ABI Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd);
 
-unsigned getUTF8SequenceSize(const UTF8 *source, const UTF8 *sourceEnd);
+LLVM_FUNC_ABI unsigned getUTF8SequenceSize(const UTF8 *source, const UTF8 *sourceEnd);
 
-unsigned getNumBytesForUTF8(UTF8 firstByte);
+LLVM_FUNC_ABI unsigned getNumBytesForUTF8(UTF8 firstByte);
 
 /*************************************************************************/
 /* Below are LLVM-specific wrappers of the functions above. */
@@ -218,26 +218,26 @@ class StringRef;
  * the first character which could not be converted.
  * \return true on success.
  */
-bool ConvertUTF8toWide(unsigned WideCharWidth, llvm::StringRef Source,
+LLVM_FUNC_ABI bool ConvertUTF8toWide(unsigned WideCharWidth, llvm::StringRef Source,
                        char *&ResultPtr, const UTF8 *&ErrorPtr);
 
 /**
 * Converts a UTF-8 StringRef to a std::wstring.
 * \return true on success.
 */
-bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result);
+LLVM_FUNC_ABI bool ConvertUTF8toWide(llvm::StringRef Source, std::wstring &Result);
 
 /**
 * Converts a UTF-8 C-string to a std::wstring.
 * \return true on success.
 */
-bool ConvertUTF8toWide(const char *Source, std::wstring &Result);
+LLVM_FUNC_ABI bool ConvertUTF8toWide(const char *Source, std::wstring &Result);
 
 /**
 * Converts a std::wstring to a UTF-8 encoded std::string.
 * \return true on success.
 */
-bool convertWideToUTF8(const std::wstring &Source, std::string &Result);
+LLVM_FUNC_ABI bool convertWideToUTF8(const std::wstring &Source, std::string &Result);
 
 
 /**
@@ -250,7 +250,7 @@ bool convertWideToUTF8(const std::wstring &Source, std::string &Result);
  *
  * \returns true on success.
  */
-bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr);
+LLVM_FUNC_ABI bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr);
 
 /**
  * Convert the first UTF8 sequence in the given source buffer to a UTF32
@@ -283,7 +283,7 @@ inline ConversionResult convertUTF8Sequence(const UTF8 **source,
  * 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_FUNC_ABI bool hasUTF16ByteOrderMark(ArrayRef<char> SrcBytes);
 
 /**
  * Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.
@@ -292,7 +292,7 @@ bool hasUTF16ByteOrderMark(ArrayRef<char> SrcBytes);
  * \param [out] Out Converted UTF-8 is stored here on success.
  * \returns true on success
  */
-bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
+LLVM_FUNC_ABI bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
 
 /**
 * Converts a UTF16 string into a UTF8 std::string.
@@ -301,7 +301,7 @@ bool convertUTF16ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
 * \param [out] Out Converted UTF-8 is stored here on success.
 * \returns true on success
 */
-bool convertUTF16ToUTF8String(ArrayRef<UTF16> Src, std::string &Out);
+LLVM_FUNC_ABI bool convertUTF16ToUTF8String(ArrayRef<UTF16> Src, std::string &Out);
 
 /**
  * Converts a stream of raw bytes assumed to be UTF32 into a UTF8 std::string.
@@ -310,7 +310,7 @@ bool convertUTF16ToUTF8String(ArrayRef<UTF16> Src, std::string &Out);
  * \param [out] Out Converted UTF-8 is stored here on success.
  * \returns true on success
  */
-bool convertUTF32ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
+LLVM_FUNC_ABI bool convertUTF32ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
 
 /**
  * Converts a UTF32 string into a UTF8 std::string.
@@ -319,14 +319,14 @@ bool convertUTF32ToUTF8String(ArrayRef<char> SrcBytes, std::string &Out);
  * \param [out] Out Converted UTF-8 is stored here on success.
  * \returns true on success
  */
-bool convertUTF32ToUTF8String(ArrayRef<UTF32> Src, std::string &Out);
+LLVM_FUNC_ABI bool convertUTF32ToUTF8String(ArrayRef<UTF32> 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_FUNC_ABI bool convertUTF8ToUTF16String(StringRef SrcUTF8,
                               SmallVectorImpl<UTF16> &DstUTF16);
 
 #if defined(_WIN32)
diff --git a/llvm/include/llvm/Support/CrashRecoveryContext.h b/llvm/include/llvm/Support/CrashRecoveryContext.h
index 5374618f4b669a7..97e60d24eebb486 100644
--- a/llvm/include/llvm/Support/CrashRecoveryContext.h
+++ b/llvm/include/llvm/Support/CrashRecoveryContext.h
@@ -44,7 +44,7 @@ class CrashRecoveryContextCleanup;
 /// 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_CLASS_ABI CrashRecoveryContext {
   void *Impl = nullptr;
   CrashRecoveryContextCleanup *head = nullptr;
 
@@ -125,7 +125,7 @@ class CrashRecoveryContext {
 ///
 /// Cleanup handlers are stored in a double list, which is owned and managed by
 /// a crash recovery context.
-class CrashRecoveryContextCleanup {
+class LLVM_CLASS_ABI CrashRecoveryContextCleanup {
 protected:
   CrashRecoveryContext *context = nullptr;
   CrashRecoveryContextCleanup(CrashRecoveryContext *context)
@@ -158,7 +158,7 @@ class CrashRecoveryContextCleanup {
 /// This class factors out creation of a cleanup handler. The latter requires
 /// knowledge of the current recovery context, which is provided by this class.
 template<typename Derived, typename T>
-class CrashRecoveryContextCleanupBase : public CrashRecoveryContextCleanup {
+class LLVM_CLASS_ABI CrashRecoveryContextCleanupBase : public CrashRecoveryContextCleanup {
 protected:
   T *resource;
   CrashRecoveryContextCleanupBase(CrashRecoveryContext *context, T *resource)
@@ -180,7 +180,7 @@ class CrashRecoveryContextCleanupBase : public CrashRecoveryContextCleanup {
 
 /// Cleanup handler that reclaims resource by calling destructor on it.
 template <typename T>
-class CrashRecoveryContextDestructorCleanup : public
+class LLVM_CLASS_ABI CrashRecoveryContextDestructorCleanup : public
   CrashRecoveryContextCleanupBase<CrashRecoveryContextDestructorCleanup<T>, T> {
 public:
   CrashRecoveryContextDestructorCleanup(CrashRecoveryContext *context,
@@ -195,7 +195,7 @@ class CrashRecoveryContextDestructorCleanup : public
 
 /// Cleanup handler that reclaims resource by calling 'delete' on it.
 template <typename T>
-class CrashRecoveryContextDeleteCleanup : public
+class LLVM_CLASS_ABI CrashRecoveryContextDeleteCleanup : public
   CrashRecoveryContextCleanupBase<CrashRecoveryContextDeleteCleanup<T>, T> {
 public:
   CrashRecoveryContextDeleteCleanup(CrashRecoveryContext *context, T *resource)
@@ -207,7 +207,7 @@ class CrashRecoveryContextDeleteCleanup : public
 
 /// Cleanup handler that reclaims resource by calling its method 'Release'.
 template <typename T>
-class CrashRecoveryContextReleaseRefCleanup : public
+class LLVM_CLASS_ABI CrashRecoveryContextReleaseRefCleanup : public
   CrashRecoveryContextCleanupBase<CrashRecoveryContextReleaseRefCleanup<T>, T> {
 public:
   CrashRecoveryContextReleaseRefCleanup(CrashRecoveryContext *context,
@@ -250,7 +250,7 @@ class CrashRecoveryContextReleaseRefCleanup : public
 /// and the resource is reclaimed by cleanup object registered in the recovery
 /// context by the constructor of CrashRecoveryContextCleanupRegistrar.
 template <typename T, typename Cleanup = CrashRecoveryContextDeleteCleanup<T> >
-class CrashRecoveryContextCleanupRegistrar {
+class LLVM_CLASS_ABI CrashRecoveryContextCleanupRegistrar {
   CrashRecoveryContextCleanup *cleanup;
 
 public:
diff --git a/llvm/include/llvm/Support/DJB.h b/llvm/include/llvm/Support/DJB.h
index b0826927f5afca6..49a63ebbf95ef3f 100644
--- a/llvm/include/llvm/Support/DJB.h
+++ b/llvm/include/llvm/Support/DJB.h
@@ -27,7 +27,7 @@ inline uint32_t djbHash(StringRef Buffer, uint32_t H = 5381) {
 
 /// 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_FUNC_ABI uint32_t caseFoldingDjbHash(StringRef Buffer, uint32_t H = 5381);
 } // namespace llvm
 
 #endif // LLVM_SUPPORT_DJB_H
diff --git a/llvm/include/llvm/Support/DOTGraphTraits.h b/llvm/include/llvm/Support/DOTGraphTraits.h
index 0ffd36f699308c3..fba1e24f468486d 100644
--- a/llvm/include/llvm/Support/DOTGraphTraits.h
+++ b/llvm/include/llvm/Support/DOTGraphTraits.h
@@ -26,7 +26,7 @@ namespace llvm {
 /// override all methods here it should inherit so that it can get the default
 /// implementations.
 ///
-struct DefaultDOTGraphTraits {
+struct LLVM_CLASS_ABI DefaultDOTGraphTraits {
 private:
   bool IsSimple;
 
@@ -164,7 +164,7 @@ struct DefaultDOTGraphTraits {
 /// from DefaultDOTGraphTraits if you don't need to override everything.
 ///
 template <typename Ty>
-struct DOTGraphTraits : public DefaultDOTGraphTraits {
+struct LLVM_CLASS_ABI DOTGraphTraits : public DefaultDOTGraphTraits {
   DOTGraphTraits (bool simple=false) : DefaultDOTGraphTraits (simple) {}
 };
 
diff --git a/llvm/include/llvm/Support/DataExtractor.h b/llvm/include/llvm/Support/DataExtractor.h
index c3c0c5dce035761..3884e71e02bd37e 100644
--- a/llvm/include/llvm/Support/DataExtractor.h
+++ b/llvm/include/llvm/Support/DataExtractor.h
@@ -17,7 +17,7 @@
 namespace llvm {
 
 /// An auxiliary type to facilitate extraction of 3-byte entities.
-struct Uint24 {
+struct LLVM_CLASS_ABI Uint24 {
   uint8_t Bytes[3];
   Uint24(uint8_t U) {
     Bytes[0] = Bytes[1] = Bytes[2] = U;
@@ -39,7 +39,7 @@ inline uint24_t getSwappedBytes(uint24_t C) {
   return uint24_t(C.Bytes[2], C.Bytes[1], C.Bytes[0]);
 }
 
-class DataExtractor {
+class LLVM_CLASS_ABI DataExtractor {
   StringRef Data;
   uint8_t IsLittleEndian;
   uint8_t AddressSize;
diff --git a/llvm/include/llvm/Support/DebugCounter.h b/llvm/include/llvm/Support/DebugCounter.h
index b61c1cfa78ae9e8..7ac61ad57269a9b 100644
--- a/llvm/include/llvm/Support/DebugCounter.h
+++ b/llvm/include/llvm/Support/DebugCounter.h
@@ -54,7 +54,7 @@ namespace llvm {
 
 class raw_ostream;
 
-class DebugCounter {
+class LLVM_CLASS_ABI DebugCounter {
 public:
   /// Returns a reference to the singleton instance.
   static DebugCounter &instance();
diff --git a/llvm/include/llvm/Support/DivisionByConstantInfo.h b/llvm/include/llvm/Support/DivisionByConstantInfo.h
index 3c172ca4ba9481e..7f467da60f909ba 100644
--- a/llvm/include/llvm/Support/DivisionByConstantInfo.h
+++ b/llvm/include/llvm/Support/DivisionByConstantInfo.h
@@ -19,14 +19,14 @@
 namespace llvm {
 
 /// Magic data for optimising signed division by a constant.
-struct SignedDivisionByConstantInfo {
+struct LLVM_CLASS_ABI SignedDivisionByConstantInfo {
   static SignedDivisionByConstantInfo get(const APInt &D);
   APInt Magic;          ///< magic number
   unsigned ShiftAmount; ///< shift amount
 };
 
 /// Magic data for optimising unsigned division by a constant.
-struct UnsignedDivisionByConstantInfo {
+struct LLVM_CLASS_ABI UnsignedDivisionByConstantInfo {
   static UnsignedDivisionByConstantInfo
   get(const APInt &D, unsigned LeadingZeros = 0,
       bool AllowEvenDivisorOptimization = true);
diff --git a/llvm/include/llvm/Support/Duration.h b/llvm/include/llvm/Support/Duration.h
index ab340627139647a..7487a82e875d914 100644
--- a/llvm/include/llvm/Support/Duration.h
+++ b/llvm/include/llvm/Support/Duration.h
@@ -18,7 +18,7 @@
 #include <chrono>
 
 namespace llvm {
-class Duration {
+class LLVM_CLASS_ABI Duration {
   std::chrono::milliseconds Value;
   public:
   Duration(std::chrono::milliseconds Value) : Value(Value) {}
diff --git a/llvm/include/llvm/Support/DynamicLibrary.h b/llvm/include/llvm/Support/DynamicLibrary.h
index 2f76eba260ef160..d7698b1c5d3cd4d 100644
--- a/llvm/include/llvm/Support/DynamicLibrary.h
+++ b/llvm/include/llvm/Support/DynamicLibrary.h
@@ -31,7 +31,7 @@ namespace sys {
 /// It also allows for symbols to be defined which don't live in any library,
 /// but rather the main program itself, useful on Windows where the main
 /// executable cannot be searched.
-class DynamicLibrary {
+class LLVM_CLASS_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
index cf8e2e9f9888074..b5c69e31d6b9f17 100644
--- a/llvm/include/llvm/Support/ELFAttributeParser.h
+++ b/llvm/include/llvm/Support/ELFAttributeParser.h
@@ -23,7 +23,7 @@ namespace llvm {
 class StringRef;
 class ScopedPrinter;
 
-class ELFAttributeParser {
+class LLVM_CLASS_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
index e2abe6537385286..83cb6729a37131c 100644
--- a/llvm/include/llvm/Support/ELFAttributes.h
+++ b/llvm/include/llvm/Support/ELFAttributes.h
@@ -16,7 +16,7 @@
 
 namespace llvm {
 
-struct TagNameItem {
+struct LLVM_CLASS_ABI TagNameItem {
   unsigned attr;
   StringRef tagName;
 };
@@ -27,9 +27,9 @@ namespace ELFAttrs {
 
 enum AttrType : unsigned { File = 1, Section = 2, Symbol = 3 };
 
-StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap,
+LLVM_FUNC_ABI StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap,
                            bool hasTagPrefix = true);
-std::optional<unsigned> attrTypeFromString(StringRef tag, TagNameMap tagNameMap);
+LLVM_FUNC_ABI std::optional<unsigned> attrTypeFromString(StringRef tag, TagNameMap tagNameMap);
 
 // Magic numbers for ELF attributes.
 enum AttrMagic { Format_Version = 0x41 };
diff --git a/llvm/include/llvm/Support/Endian.h b/llvm/include/llvm/Support/Endian.h
index 5e7c1e961b9d1e0..17b98d76a4c2a44 100644
--- a/llvm/include/llvm/Support/Endian.h
+++ b/llvm/include/llvm/Support/Endian.h
@@ -33,7 +33,7 @@ namespace detail {
 
 /// ::value is either alignment, or alignof(T) if alignment is 0.
 template<class T, int alignment>
-struct PickAlignment {
+struct LLVM_CLASS_ABI PickAlignment {
  enum { value = alignment == 0 ? alignof(T) : alignment };
 };
 
@@ -203,7 +203,7 @@ namespace detail {
 
 template <typename ValueType, endianness Endian, std::size_t Alignment,
           std::size_t ALIGN = PickAlignment<ValueType, Alignment>::value>
-struct packed_endian_specific_integral {
+struct LLVM_CLASS_ABI packed_endian_specific_integral {
   using value_type = ValueType;
   static constexpr endianness endian = Endian;
   static constexpr std::size_t alignment = Alignment;
diff --git a/llvm/include/llvm/Support/EndianStream.h b/llvm/include/llvm/Support/EndianStream.h
index 439c27b8f89a9ef..332f3f068da5a72 100644
--- a/llvm/include/llvm/Support/EndianStream.h
+++ b/llvm/include/llvm/Support/EndianStream.h
@@ -57,7 +57,7 @@ inline void write(SmallVectorImpl<char> &Out, value_type V, endianness E) {
 }
 
 /// Adapter to write values to a stream in a particular byte order.
-struct Writer {
+struct LLVM_CLASS_ABI Writer {
   raw_ostream &OS;
   endianness Endian;
   Writer(raw_ostream &OS, endianness Endian) : OS(OS), Endian(Endian) {}
diff --git a/llvm/include/llvm/Support/Errc.h b/llvm/include/llvm/Support/Errc.h
index 00557c59a47695b..a3749fd4fd0a97e 100644
--- a/llvm/include/llvm/Support/Errc.h
+++ b/llvm/include/llvm/Support/Errc.h
@@ -82,6 +82,6 @@ inline std::error_code make_error_code(errc E) {
 }
 
 namespace std {
-template <> struct is_error_code_enum<llvm::errc> : std::true_type {};
+template <> struct LLVM_CLASS_ABI is_error_code_enum<llvm::errc> : std::true_type {};
 }
 #endif
diff --git a/llvm/include/llvm/Support/Errno.h b/llvm/include/llvm/Support/Errno.h
index be12e2889b4b7f0..25f6581ac2334d5 100644
--- a/llvm/include/llvm/Support/Errno.h
+++ b/llvm/include/llvm/Support/Errno.h
@@ -24,10 +24,10 @@ namespace sys {
 /// thread-safe variant of strerror() is available.  Be sure to call this
 /// immediately after the function that set errno, or errno may have been
 /// overwritten by an intervening call.
-std::string StrError();
+LLVM_FUNC_ABI std::string StrError();
 
 /// Like the no-argument version above, but uses \p errnum instead of errno.
-std::string StrError(int errnum);
+LLVM_FUNC_ABI std::string StrError(int errnum);
 
 template <typename FailT, typename Fun, typename... Args>
 inline decltype(auto) RetryAfterSignal(const FailT &Fail, const Fun &F,
diff --git a/llvm/include/llvm/Support/ExtensibleRTTI.h b/llvm/include/llvm/Support/ExtensibleRTTI.h
index 2e2b1abb75f4817..7b3f8f5aa121c14 100644
--- a/llvm/include/llvm/Support/ExtensibleRTTI.h
+++ b/llvm/include/llvm/Support/ExtensibleRTTI.h
@@ -68,7 +68,7 @@ namespace llvm {
 ///
 /// This class defines virtual methods, dynamicClassID and isA, that enable
 /// type comparisons.
-class RTTIRoot {
+class LLVM_CLASS_ABI RTTIRoot {
 public:
   virtual ~RTTIRoot() = default;
 
@@ -113,7 +113,7 @@ class RTTIRoot {
 /// };
 ///
 template <typename ThisT, typename ParentT>
-class RTTIExtends : public ParentT {
+class LLVM_CLASS_ABI RTTIExtends : public ParentT {
 public:
   // Inherit constructors from ParentT.
   using ParentT::ParentT;
diff --git a/llvm/include/llvm/Support/FileCollector.h b/llvm/include/llvm/Support/FileCollector.h
index 00a492b91eec2fa..34f848eb3b7892e 100644
--- a/llvm/include/llvm/Support/FileCollector.h
+++ b/llvm/include/llvm/Support/FileCollector.h
@@ -20,7 +20,7 @@ namespace llvm {
 class FileCollectorFileSystem;
 class Twine;
 
-class FileCollectorBase {
+class LLVM_CLASS_ABI FileCollectorBase {
 public:
   FileCollectorBase();
   virtual ~FileCollectorBase();
@@ -67,7 +67,7 @@ class FileCollectorBase {
 ///
 /// 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_CLASS_ABI FileCollector : public FileCollectorBase {
 public:
   /// Helper utility that encapsulates the logic for canonicalizing a virtual
   /// path and a path to copy from.
diff --git a/llvm/include/llvm/Support/FileOutputBuffer.h b/llvm/include/llvm/Support/FileOutputBuffer.h
index ca59f8ec696dacb..f0b76f1b7f9b67b 100644
--- a/llvm/include/llvm/Support/FileOutputBuffer.h
+++ b/llvm/include/llvm/Support/FileOutputBuffer.h
@@ -26,7 +26,7 @@ namespace llvm {
 /// 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_CLASS_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
index 874cf1352b60f3d..ac1577f044464ef 100644
--- a/llvm/include/llvm/Support/FileSystem.h
+++ b/llvm/include/llvm/Support/FileSystem.h
@@ -61,7 +61,7 @@ using file_t = void *;
 using file_t = int;
 #endif
 
-extern const file_t kInvalidFile;
+LLVM_FUNC_ABI extern const file_t kInvalidFile;
 
 /// An enumeration for the file system's view of the type.
 enum class file_type {
@@ -78,7 +78,7 @@ enum class file_type {
 };
 
 /// space_info - Self explanatory.
-struct space_info {
+struct LLVM_CLASS_ABI space_info {
   uint64_t capacity;
   uint64_t free;
   uint64_t available;
@@ -135,7 +135,7 @@ inline perms operator~(perms x) {
 /// 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_CLASS_ABI basic_file_status {
 protected:
   #if defined(LLVM_ON_UNIX)
   time_t fs_st_atime = 0;
@@ -224,8 +224,8 @@ class basic_file_status {
 };
 
 /// 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);
+class LLVM_CLASS_ABI file_status : public basic_file_status {
+  friend LLVM_FUNC_ABI bool equivalent(file_status A, file_status B);
 
   #if defined(LLVM_ON_UNIX)
   dev_t fs_st_dev = 0;
@@ -282,7 +282,7 @@ class file_status : public basic_file_status {
 /// 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_FUNC_ABI void make_absolute(const Twine &current_directory, SmallVectorImpl<char> &path);
 
 /// Make \a path an absolute path.
 ///
@@ -295,7 +295,7 @@ void make_absolute(const Twine &current_directory, SmallVectorImpl<char> &path);
 /// @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_FUNC_ABI std::error_code make_absolute(SmallVectorImpl<char> &path);
 
 /// Create all the non-existent directories in path.
 ///
@@ -303,7 +303,7 @@ std::error_code make_absolute(SmallVectorImpl<char> &path);
 /// @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_FUNC_ABI std::error_code create_directories(const Twine &path,
                                    bool IgnoreExisting = true,
                                    perms Perms = owner_all | group_all);
 
@@ -313,7 +313,7 @@ std::error_code create_directories(const Twine &path,
 /// @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_FUNC_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.
@@ -327,7 +327,7 @@ std::error_code create_directory(const Twine &path, bool IgnoreExisting = true,
 /// @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_FUNC_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.
 ///
@@ -335,7 +335,7 @@ std::error_code create_link(const Twine &to, const Twine &from);
 /// @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_FUNC_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.
@@ -344,28 +344,28 @@ std::error_code create_hard_link(const Twine &to, const Twine &from);
 /// @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_FUNC_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_FUNC_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_FUNC_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_FUNC_ABI std::error_code set_current_path(const Twine &path);
 
 /// Remove path. Equivalent to POSIX remove().
 ///
@@ -373,14 +373,14 @@ std::error_code set_current_path(const Twine &path);
 /// @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_FUNC_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_FUNC_ABI std::error_code remove_directories(const Twine &path, bool IgnoreErrors = true);
 
 /// Rename \a from to \a to.
 ///
@@ -390,19 +390,19 @@ std::error_code remove_directories(const Twine &path, bool IgnoreErrors = true);
 ///
 /// @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_FUNC_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_FUNC_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_FUNC_ABI std::error_code copy_file(const Twine &From, int ToFD);
 
 /// Resize path to size. File is resized as if by POSIX truncate().
 ///
@@ -410,7 +410,7 @@ std::error_code copy_file(const Twine &From, int ToFD);
 /// @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_FUNC_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,
@@ -432,10 +432,10 @@ inline std::error_code resize_file_before_mapping_readwrite(int FD,
 /// @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_FUNC_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_FUNC_ABI ErrorOr<MD5::MD5Result> md5_contents(const Twine &Path);
 
 /// @}
 /// @name Physical Observers
@@ -446,7 +446,7 @@ ErrorOr<MD5::MD5Result> md5_contents(const Twine &Path);
 /// @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_FUNC_ABI bool exists(const basic_file_status &status);
 
 enum class AccessMode { Exist, Write, Execute };
 
@@ -455,7 +455,7 @@ enum class AccessMode { Exist, Write, Execute };
 /// @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_FUNC_ABI std::error_code access(const Twine &Path, AccessMode Mode);
 
 /// Does file exist?
 ///
@@ -469,7 +469,7 @@ inline bool exists(const Twine &Path) {
 ///
 /// @param Path Input path.
 /// @returns True if we can execute it, false otherwise.
-bool can_execute(const Twine &Path);
+LLVM_FUNC_ABI bool can_execute(const Twine &Path);
 
 /// Can we write this file?
 ///
@@ -488,7 +488,7 @@ inline bool can_write(const Twine &Path) {
 ///
 /// @returns True if A and B both represent the same file system entity, false
 ///          otherwise.
-bool equivalent(file_status A, file_status B);
+LLVM_FUNC_ABI bool equivalent(file_status A, file_status B);
 
 /// Do paths represent the same thing?
 ///
@@ -500,7 +500,7 @@ bool equivalent(file_status A, file_status B);
 ///               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_FUNC_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.
@@ -516,10 +516,10 @@ inline bool equivalent(const Twine &A, const Twine &B) {
 ///               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_FUNC_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_FUNC_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.
@@ -541,13 +541,13 @@ inline bool is_local(int FD) {
 /// @param Follow For symbolic links, indicates whether to return the file type
 ///               of the link itself, or of the target.
 /// @returns A value from the file_type enumeration indicating the type of file.
-file_type get_file_type(const Twine &Path, bool Follow = true);
+LLVM_FUNC_ABI file_type get_file_type(const Twine &Path, bool Follow = true);
 
 /// Does status represent a directory?
 ///
 /// @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_FUNC_ABI bool is_directory(const basic_file_status &status);
 
 /// Is path a directory?
 ///
@@ -556,7 +556,7 @@ bool is_directory(const basic_file_status &status);
 ///               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_FUNC_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.
@@ -569,7 +569,7 @@ inline bool is_directory(const Twine &Path) {
 ///
 /// @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_FUNC_ABI bool is_regular_file(const basic_file_status &status);
 
 /// Is path a regular file?
 ///
@@ -578,7 +578,7 @@ bool is_regular_file(const basic_file_status &status);
 ///               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_FUNC_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.
@@ -593,7 +593,7 @@ inline bool is_regular_file(const Twine &Path) {
 ///
 /// @param status A basic_file_status previously returned from status.
 /// @returns status_known(status) && status.type() == file_type::symlink_file.
-bool is_symlink_file(const basic_file_status &status);
+LLVM_FUNC_ABI bool is_symlink_file(const basic_file_status &status);
 
 /// Is path a symlink file?
 ///
@@ -602,7 +602,7 @@ bool is_symlink_file(const basic_file_status &status);
 ///               Undefined otherwise.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform-specific error_code.
-std::error_code is_symlink_file(const Twine &path, bool &result);
+LLVM_FUNC_ABI std::error_code is_symlink_file(const Twine &path, bool &result);
 
 /// Simpler version of is_symlink_file for clients that don't need to
 ///        differentiate between an error and false.
@@ -618,7 +618,7 @@ inline bool is_symlink_file(const Twine &Path) {
 ///
 /// @param status A basic_file_status previously returned from status.
 /// @returns exists(s) && !is_regular_file(s) && !is_directory(s)
-bool is_other(const basic_file_status &status);
+LLVM_FUNC_ABI bool is_other(const basic_file_status &status);
 
 /// Is path something that exists but is not a directory,
 ///        regular file, or symlink?
@@ -628,7 +628,7 @@ bool is_other(const basic_file_status &status);
 ///               file, or a symlink, false if it does not. Undefined otherwise.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform-specific error_code.
-std::error_code is_other(const Twine &path, bool &result);
+LLVM_FUNC_ABI std::error_code is_other(const Twine &path, bool &result);
 
 /// Get file status as if by POSIX stat().
 ///
@@ -638,11 +638,11 @@ std::error_code is_other(const Twine &path, bool &result);
 ///               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_FUNC_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_FUNC_ABI std::error_code status(int FD, file_status &Result);
 
 #ifdef _WIN32
 /// A version for when a file descriptor is already available.
@@ -655,7 +655,7 @@ std::error_code status(file_t FD, file_status &Result);
 /// @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_FUNC_ABI unsigned getUmask();
 
 /// Set file permissions.
 ///
@@ -666,12 +666,12 @@ unsigned getUmask();
 /// @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_FUNC_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_FUNC_ABI std::error_code setPermissions(int FD, perms Permissions);
 
 /// Get file permissions.
 ///
@@ -681,7 +681,7 @@ std::error_code setPermissions(int FD, perms Permissions);
 /// @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_FUNC_ABI ErrorOr<perms> getPermissions(const Twine &Path);
 
 /// Get file size.
 ///
@@ -703,7 +703,7 @@ inline std::error_code file_size(const Twine &Path, uint64_t &Result) {
 /// @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_FUNC_ABI std::error_code setLastAccessAndModificationTime(int FD, TimePoint<> AccessTime,
                                                  TimePoint<> ModificationTime);
 
 /// Simpler version that sets both file modification and access time to the same
@@ -717,7 +717,7 @@ inline std::error_code setLastAccessAndModificationTime(int FD,
 ///
 /// @param s Input file status.
 /// @returns True if status() != status_error.
-bool status_known(const basic_file_status &s);
+LLVM_FUNC_ABI bool status_known(const basic_file_status &s);
 
 /// Is status available?
 ///
@@ -725,7 +725,7 @@ bool status_known(const basic_file_status &s);
 /// @param result Set to true if status() != status_error.
 /// @returns errc::success if result has been successfully set, otherwise a
 ///          platform-specific error_code.
-std::error_code status_known(const Twine &path, bool &result);
+LLVM_FUNC_ABI std::error_code status_known(const Twine &path, bool &result);
 
 enum CreationDisposition : unsigned {
   /// CD_CreateAlways - When opening a file:
@@ -804,7 +804,7 @@ enum OpenFlags : unsigned {
 /// @param Model Name to base unique path off of.
 /// @param ResultPath Set to the file's path.
 /// @param MakeAbsolute Whether to use the system temp directory.
-void createUniquePath(const Twine &Model, SmallVectorImpl<char> &ResultPath,
+LLVM_FUNC_ABI void createUniquePath(const Twine &Model, SmallVectorImpl<char> &ResultPath,
                       bool MakeAbsolute);
 
 /// Create a uniquely named file.
@@ -830,14 +830,14 @@ void createUniquePath(const Twine &Model, SmallVectorImpl<char> &ResultPath,
 /// @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_FUNC_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_FUNC_ABI std::error_code createUniqueFile(const Twine &Model,
                                  SmallVectorImpl<char> &ResultPath,
                                  unsigned Mode = all_read | all_write);
 
@@ -848,7 +848,7 @@ std::error_code createUniqueFile(const Twine &Model,
 ///
 /// The destructor doesn't implicitly discard because there is no way to
 /// properly handle errors in a destructor.
-class TempFile {
+class LLVM_CLASS_ABI TempFile {
   bool Done = false;
   TempFile(StringRef Name, int FD);
 
@@ -893,18 +893,18 @@ class TempFile {
 ///
 /// 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_FUNC_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_FUNC_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_FUNC_ABI std::error_code createUniqueDirectory(const Twine &Prefix,
                                       SmallVectorImpl<char> &ResultPath);
 
 /// Get a unique name, not currently exisiting in the filesystem. Subject
@@ -914,7 +914,7 @@ std::error_code createUniqueDirectory(const Twine &Prefix,
 /// 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
 /// createUniqueFile instead.
-std::error_code getPotentiallyUniqueFileName(const Twine &Model,
+LLVM_FUNC_ABI std::error_code getPotentiallyUniqueFileName(const Twine &Model,
                                              SmallVectorImpl<char> &ResultPath);
 
 /// Get a unique temporary file name, not currently exisiting in the
@@ -925,7 +925,7 @@ std::error_code getPotentiallyUniqueFileName(const Twine &Model,
 /// 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_FUNC_ABI std::error_code
 getPotentiallyUniqueTempFileName(const Twine &Prefix, StringRef Suffix,
                                  SmallVectorImpl<char> &ResultPath);
 
@@ -963,7 +963,7 @@ inline FileAccess &operator|=(FileAccess &A, FileAccess B) {
 /// @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_FUNC_ABI std::error_code openFile(const Twine &Name, int &ResultFD,
                          CreationDisposition Disp, FileAccess Access,
                          OpenFlags Flags, unsigned Mode = 0666);
 
@@ -981,14 +981,14 @@ std::error_code openFile(const Twine &Name, int &ResultFD,
 /// @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_FUNC_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);
+LLVM_FUNC_ABI file_t convertFDToNativeFile(int FD);
 
 #ifndef _WIN32
 inline file_t convertFDToNativeFile(int FD) { return FD; }
@@ -996,15 +996,15 @@ inline file_t convertFDToNativeFile(int FD) { return FD; }
 
 /// Return an open handle to standard in. On Unix, this is typically FD 0.
 /// Returns kInvalidFile when the stream is closed.
-file_t getStdinHandle();
+LLVM_FUNC_ABI file_t getStdinHandle();
 
 /// Return an open handle to standard out. On Unix, this is typically FD 1.
 /// Returns kInvalidFile when the stream is closed.
-file_t getStdoutHandle();
+LLVM_FUNC_ABI file_t getStdoutHandle();
 
 /// Return an open handle to standard error. On Unix, this is typically FD 2.
 /// Returns kInvalidFile when the stream is closed.
-file_t getStderrHandle();
+LLVM_FUNC_ABI file_t getStderrHandle();
 
 /// Reads \p Buf.size() bytes from \p FileHandle into \p Buf. Returns the number
 /// of bytes actually read. On Unix, this is equivalent to `return ::read(FD,
@@ -1013,7 +1013,7 @@ file_t getStderrHandle();
 /// @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_FUNC_ABI Expected<size_t> readNativeFile(file_t FileHandle, MutableArrayRef<char> Buf);
 
 /// Default chunk size for \a readNativeFileToEOF().
 enum : size_t { DefaultReadChunkSize = 4 * 4096 };
@@ -1031,7 +1031,7 @@ enum : size_t { DefaultReadChunkSize = 4 * 4096 };
 /// \param Buffer Where to put the file content.
 /// \param ChunkSize Size of chunks.
 /// \returns The error if EOF was not found.
-Error readNativeFileToEOF(file_t FileHandle, SmallVectorImpl<char> &Buffer,
+LLVM_FUNC_ABI Error readNativeFileToEOF(file_t FileHandle, SmallVectorImpl<char> &Buffer,
                           ssize_t ChunkSize = DefaultReadChunkSize);
 
 /// Reads \p Buf.size() bytes from \p FileHandle at offset \p Offset into \p
@@ -1043,7 +1043,7 @@ Error readNativeFileToEOF(file_t FileHandle, SmallVectorImpl<char> &Buffer,
 /// @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_FUNC_ABI Expected<size_t> readNativeFileSlice(file_t FileHandle,
                                      MutableArrayRef<char> Buf,
                                      uint64_t Offset);
 
@@ -1145,7 +1145,7 @@ inline Expected<file_t> openNativeFileForReadWrite(const Twine &Name,
 ///                 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_FUNC_ABI std::error_code openFileForRead(const Twine &Name, int &ResultFD,
                                 OpenFlags Flags = OF_None,
                                 SmallVectorImpl<char> *RealPath = nullptr);
 
@@ -1161,7 +1161,7 @@ std::error_code openFileForRead(const Twine &Name, int &ResultFD,
 ///                 location.
 /// @returns a platform-specific file descriptor if \a Name has been opened,
 ///          otherwise an error object.
-Expected<file_t>
+LLVM_FUNC_ABI Expected<file_t>
 openNativeFileForRead(const Twine &Name, OpenFlags Flags = OF_None,
                       SmallVectorImpl<char> *RealPath = nullptr);
 
@@ -1186,21 +1186,21 @@ openNativeFileForRead(const Twine &Name, OpenFlags Flags = OF_None,
 /// 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_FUNC_ABI std::error_code
 tryLockFile(int FD,
             std::chrono::milliseconds Timeout = std::chrono::milliseconds(0));
 
 /// Lock the file.
 ///
 /// This function acts as @ref tryLockFile but it waits infinitely.
-std::error_code lockFile(int FD);
+LLVM_FUNC_ABI std::error_code lockFile(int FD);
 
 /// Unlock the file.
 ///
 /// @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_FUNC_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
@@ -1211,7 +1211,7 @@ std::error_code unlockFile(int FD);
 ///
 /// @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_FUNC_ABI std::error_code closeFile(file_t &F);
 
 #ifdef LLVM_ON_UNIX
 /// @brief Change ownership of a file.
@@ -1220,11 +1220,11 @@ std::error_code closeFile(file_t &F);
 /// @param Group The group of the file to change to.
 /// @returns errc::success if successfully updated file ownership, otherwise an
 ///          error code is returned.
-std::error_code changeFileOwnership(int FD, uint32_t Owner, uint32_t Group);
+LLVM_FUNC_ABI std::error_code changeFileOwnership(int FD, uint32_t Owner, uint32_t Group);
 #endif
 
 /// RAII class that facilitates file locking.
-class FileLocker {
+class LLVM_CLASS_ABI FileLocker {
   int FD; ///< Locked file handle.
   FileLocker(int FD) : FD(FD) {}
   friend class llvm::raw_fd_ostream;
@@ -1252,7 +1252,7 @@ class FileLocker {
   }
 };
 
-std::error_code getUniqueID(const Twine Path, UniqueID &Result);
+LLVM_FUNC_ABI std::error_code getUniqueID(const Twine Path, UniqueID &Result);
 
 /// Get disk space usage information.
 ///
@@ -1263,11 +1263,11 @@ std::error_code getUniqueID(const Twine Path, UniqueID &Result);
 /// @returns a space_info structure filled with the capacity, free, and
 /// available space on the device \a Path is on. A platform specific error_code
 /// is returned on error.
-ErrorOr<space_info> disk_space(const Twine &Path);
+LLVM_FUNC_ABI ErrorOr<space_info> disk_space(const Twine &Path);
 
 /// This class represents a memory mapped file. It is based on
 /// boost::iostreams::mapped_file.
-class mapped_file_region {
+class LLVM_CLASS_ABI mapped_file_region {
 public:
   enum mapmode {
     readonly, ///< May only access map via const_data as read only.
@@ -1345,14 +1345,14 @@ class mapped_file_region {
 /// 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_FUNC_ABI std::string getMainExecutable(const char *argv0, void *MainExecAddr);
 
 /// @}
 /// @name Iterators
 /// @{
 
 /// directory_entry - A single entry in a directory.
-class directory_entry {
+class LLVM_CLASS_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
@@ -1402,12 +1402,12 @@ namespace detail {
 
   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_FUNC_ABI std::error_code directory_iterator_construct(DirIterState &, StringRef, bool);
+  LLVM_FUNC_ABI std::error_code directory_iterator_increment(DirIterState &);
+  LLVM_FUNC_ABI std::error_code directory_iterator_destruct(DirIterState &);
 
   /// Keeps state for the directory_iterator.
-  struct DirIterState {
+  struct LLVM_CLASS_ABI DirIterState {
     ~DirIterState() {
       directory_iterator_destruct(*this);
     }
@@ -1421,7 +1421,7 @@ namespace detail {
 /// directory_iterator - Iterates through the entries in path. There is no
 /// operator++ because we need an error_code. If it's really needed we can make
 /// it call report_fatal_error on error.
-class directory_iterator {
+class LLVM_CLASS_ABI directory_iterator {
   std::shared_ptr<detail::DirIterState> State;
   bool FollowSymlinks = true;
 
@@ -1473,7 +1473,7 @@ class directory_iterator {
 namespace detail {
 
   /// Keeps state for the recursive_directory_iterator.
-  struct RecDirIterState {
+  struct LLVM_CLASS_ABI RecDirIterState {
     std::stack<directory_iterator, std::vector<directory_iterator>> Stack;
     uint16_t Level = 0;
     bool HasNoPushRequest = false;
@@ -1483,7 +1483,7 @@ namespace detail {
 
 /// recursive_directory_iterator - Same as directory_iterator except for it
 /// recurses down into child directories.
-class recursive_directory_iterator {
+class LLVM_CLASS_ABI recursive_directory_iterator {
   std::shared_ptr<detail::RecDirIterState> State;
   bool Follow;
 
diff --git a/llvm/include/llvm/Support/FileSystem/UniqueID.h b/llvm/include/llvm/Support/FileSystem/UniqueID.h
index ef3f2597393d772..be1b365fcb7f5de 100644
--- a/llvm/include/llvm/Support/FileSystem/UniqueID.h
+++ b/llvm/include/llvm/Support/FileSystem/UniqueID.h
@@ -24,7 +24,7 @@ namespace llvm {
 namespace sys {
 namespace fs {
 
-class UniqueID {
+class LLVM_CLASS_ABI UniqueID {
   uint64_t Device;
   uint64_t File;
 
@@ -53,7 +53,7 @@ class UniqueID {
 } // end namespace sys
 
 // Support UniqueIDs as DenseMap keys.
-template <> struct DenseMapInfo<llvm::sys::fs::UniqueID> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<llvm::sys::fs::UniqueID> {
   static inline llvm::sys::fs::UniqueID getEmptyKey() {
     auto EmptyKey = DenseMapInfo<std::pair<uint64_t, uint64_t>>::getEmptyKey();
     return {EmptyKey.first, EmptyKey.second};
diff --git a/llvm/include/llvm/Support/FileUtilities.h b/llvm/include/llvm/Support/FileUtilities.h
index 0fd172732251cab..9e11e6e8e24eb97 100644
--- a/llvm/include/llvm/Support/FileUtilities.h
+++ b/llvm/include/llvm/Support/FileUtilities.h
@@ -30,7 +30,7 @@ namespace llvm {
   /// 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_FUNC_ABI int DiffFilesWithTolerance(StringRef FileA,
                              StringRef FileB,
                              double AbsTol, double RelTol,
                              std::string *Error = nullptr);
@@ -40,7 +40,7 @@ namespace llvm {
   /// If an exception is thrown from a region, the object removes the filename
   /// specified (if deleteIt is true).
   ///
-  class FileRemover {
+  class LLVM_CLASS_ABI FileRemover {
     SmallString<128> Filename;
     bool DeleteIt;
   public:
@@ -80,7 +80,7 @@ namespace llvm {
   /// FilePermssionsApplier helps to copy permissions from an input file to
   /// an output one. It memorizes the status of the input file and can apply
   /// permissions and dates to the output file.
-  class FilePermissionsApplier {
+  class LLVM_CLASS_ABI FilePermissionsApplier {
   public:
     static Expected<FilePermissionsApplier> create(StringRef InputFilename);
 
diff --git a/llvm/include/llvm/Support/FormatAdapters.h b/llvm/include/llvm/Support/FormatAdapters.h
index 7a6fa97edaa01e4..e3d12c314caf5c8 100644
--- a/llvm/include/llvm/Support/FormatAdapters.h
+++ b/llvm/include/llvm/Support/FormatAdapters.h
@@ -17,7 +17,7 @@
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
-template <typename T> class FormatAdapter : public detail::format_adapter {
+template <typename T> class LLVM_CLASS_ABI FormatAdapter : public detail::format_adapter {
 protected:
   explicit FormatAdapter(T &&Item) : Item(std::forward<T>(Item)) {}
 
@@ -25,7 +25,7 @@ template <typename T> class FormatAdapter : public detail::format_adapter {
 };
 
 namespace detail {
-template <typename T> class AlignAdapter final : public FormatAdapter<T> {
+template <typename T> class LLVM_CLASS_ABI AlignAdapter final : public FormatAdapter<T> {
   AlignStyle Where;
   size_t Amount;
   char Fill;
@@ -41,7 +41,7 @@ template <typename T> class AlignAdapter final : public FormatAdapter<T> {
   }
 };
 
-template <typename T> class PadAdapter final : public FormatAdapter<T> {
+template <typename T> class LLVM_CLASS_ABI PadAdapter final : public FormatAdapter<T> {
   size_t Left;
   size_t Right;
 
@@ -57,7 +57,7 @@ template <typename T> class PadAdapter final : public FormatAdapter<T> {
   }
 };
 
-template <typename T> class RepeatAdapter final : public FormatAdapter<T> {
+template <typename T> class LLVM_CLASS_ABI RepeatAdapter final : public FormatAdapter<T> {
   size_t Count;
 
 public:
@@ -72,7 +72,7 @@ template <typename T> class RepeatAdapter final : public FormatAdapter<T> {
   }
 };
 
-class ErrorAdapter : public FormatAdapter<Error> {
+class LLVM_CLASS_ABI ErrorAdapter : public FormatAdapter<Error> {
 public:
   ErrorAdapter(Error &&Item) : FormatAdapter(std::move(Item)) {}
   ErrorAdapter(ErrorAdapter &&) = default;
diff --git a/llvm/include/llvm/Support/FormatCommon.h b/llvm/include/llvm/Support/FormatCommon.h
index 337243eae1212ef..24fcf397e6c0550 100644
--- a/llvm/include/llvm/Support/FormatCommon.h
+++ b/llvm/include/llvm/Support/FormatCommon.h
@@ -17,7 +17,7 @@
 namespace llvm {
 enum class AlignStyle { Left, Center, Right };
 
-struct FmtAlign {
+struct LLVM_CLASS_ABI FmtAlign {
   detail::format_adapter &Adapter;
   AlignStyle Where;
   size_t Amount;
diff --git a/llvm/include/llvm/Support/FormatProviders.h b/llvm/include/llvm/Support/FormatProviders.h
index 1b916d493e21ff3..715c87294c5f72a 100644
--- a/llvm/include/llvm/Support/FormatProviders.h
+++ b/llvm/include/llvm/Support/FormatProviders.h
@@ -28,38 +28,38 @@
 namespace llvm {
 namespace detail {
 template <typename T>
-struct use_integral_formatter
+struct LLVM_CLASS_ABI use_integral_formatter
     : public std::integral_constant<
           bool, is_one_of<T, uint8_t, int16_t, uint16_t, int32_t, uint32_t,
                           int64_t, uint64_t, int, unsigned, long, unsigned long,
                           long long, unsigned long long>::value> {};
 
 template <typename T>
-struct use_char_formatter
+struct LLVM_CLASS_ABI use_char_formatter
     : public std::integral_constant<bool, std::is_same_v<T, char>> {};
 
 template <typename T>
-struct is_cstring
+struct LLVM_CLASS_ABI is_cstring
     : public std::integral_constant<bool,
                                     is_one_of<T, char *, const char *>::value> {
 };
 
 template <typename T>
-struct use_string_formatter
+struct LLVM_CLASS_ABI use_string_formatter
     : public std::integral_constant<bool,
                                     std::is_convertible_v<T, llvm::StringRef>> {
 };
 
 template <typename T>
-struct use_pointer_formatter
+struct LLVM_CLASS_ABI use_pointer_formatter
     : public std::integral_constant<bool, std::is_pointer_v<T> &&
                                               !is_cstring<T>::value> {};
 
 template <typename T>
-struct use_double_formatter
+struct LLVM_CLASS_ABI use_double_formatter
     : public std::integral_constant<bool, std::is_floating_point_v<T>> {};
 
-class HelperFunctions {
+class LLVM_CLASS_ABI HelperFunctions {
 protected:
   static std::optional<size_t> parseNumericPrecision(StringRef Str) {
     size_t Prec;
@@ -125,7 +125,7 @@ class HelperFunctions {
 ///
 
 template <typename T>
-struct format_provider<
+struct LLVM_CLASS_ABI format_provider<
     T, std::enable_if_t<detail::use_integral_formatter<T>::value>>
     : public detail::HelperFunctions {
 private:
@@ -174,7 +174,7 @@ struct format_provider<
 /// The default precision is the number of nibbles in a machine word, and in all
 /// cases indicates the minimum number of nibbles to print.
 template <typename T>
-struct format_provider<
+struct LLVM_CLASS_ABI format_provider<
     T, std::enable_if_t<detail::use_pointer_formatter<T>::value>>
     : public detail::HelperFunctions {
 private:
@@ -199,7 +199,7 @@ struct format_provider<
 /// printed up to the null terminator.
 
 template <typename T>
-struct format_provider<
+struct LLVM_CLASS_ABI format_provider<
     T, std::enable_if_t<detail::use_string_formatter<T>::value>> {
   static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) {
     size_t N = StringRef::npos;
@@ -215,7 +215,7 @@ struct format_provider<
 ///
 /// This follows the same rules as the string formatter.
 
-template <> struct format_provider<Twine> {
+template <> struct LLVM_CLASS_ABI format_provider<Twine> {
   static void format(const Twine &V, llvm::raw_ostream &Stream,
                      StringRef Style) {
     format_provider<std::string>::format(V.str(), Stream, Style);
@@ -232,7 +232,7 @@ template <> struct format_provider<Twine> {
 /// character.  Otherwise, it is treated as an integer options string.
 ///
 template <typename T>
-struct format_provider<T,
+struct LLVM_CLASS_ABI format_provider<T,
                        std::enable_if_t<detail::use_char_formatter<T>::value>> {
   static void format(const char &V, llvm::raw_ostream &Stream,
                      StringRef Style) {
@@ -261,7 +261,7 @@ struct format_provider<T,
 ///   |    t    |     true / false     |
 ///   | (empty) |   Equivalent to 't'  |
 ///   ==================================
-template <> struct format_provider<bool> {
+template <> struct LLVM_CLASS_ABI format_provider<bool> {
   static void format(const bool &B, llvm::raw_ostream &Stream,
                      StringRef Style) {
     Stream << StringSwitch<const char *>(Style)
@@ -298,7 +298,7 @@ template <> struct format_provider<bool> {
 /// else.
 
 template <typename T>
-struct format_provider<T,
+struct LLVM_CLASS_ABI format_provider<T,
                        std::enable_if_t<detail::use_double_formatter<T>::value>>
     : public detail::HelperFunctions {
   static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) {
@@ -327,7 +327,7 @@ template <typename IterT>
 using IterValue = typename std::iterator_traits<IterT>::value_type;
 
 template <typename IterT>
-struct range_item_has_provider
+struct LLVM_CLASS_ABI range_item_has_provider
     : public std::integral_constant<
           bool, !uses_missing_provider<IterValue<IterT>>::value> {};
 }
@@ -355,7 +355,7 @@ struct range_item_has_provider
 /// provider can be found for T will result in a compile error.
 ///
 
-template <typename IterT> class format_provider<llvm::iterator_range<IterT>> {
+template <typename IterT> class LLVM_CLASS_ABI format_provider<llvm::iterator_range<IterT>> {
   using value = typename std::iterator_traits<IterT>::value_type;
 
   static StringRef consumeOneOption(StringRef &Style, char Indicator,
diff --git a/llvm/include/llvm/Support/FormatVariadic.h b/llvm/include/llvm/Support/FormatVariadic.h
index 3ac46de25a714da..47195fcf9ad553e 100644
--- a/llvm/include/llvm/Support/FormatVariadic.h
+++ b/llvm/include/llvm/Support/FormatVariadic.h
@@ -46,7 +46,7 @@ namespace llvm {
 
 enum class ReplacementType { Empty, Format, Literal };
 
-struct ReplacementItem {
+struct LLVM_CLASS_ABI ReplacementItem {
   ReplacementItem() = default;
   explicit ReplacementItem(StringRef Literal)
       : Type(ReplacementType::Literal), Spec(Literal) {}
@@ -64,7 +64,7 @@ struct ReplacementItem {
   StringRef Options;
 };
 
-class formatv_object_base {
+class LLVM_CLASS_ABI formatv_object_base {
 protected:
   StringRef Fmt;
   ArrayRef<detail::format_adapter *> Adapters;
@@ -126,7 +126,7 @@ class formatv_object_base {
   operator std::string() const { return str(); }
 };
 
-template <typename Tuple> class formatv_object : public formatv_object_base {
+template <typename Tuple> class LLVM_CLASS_ABI formatv_object : public formatv_object_base {
   // Storage for the parameter adapters.  Since the base class erases the type
   // of the parameters, we have to own the storage for the parameters here, and
   // have the base class store type-erased pointers into this tuple.
diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h
index 3f0938f73bca7ae..c7ac9398b19129c 100644
--- a/llvm/include/llvm/Support/FormatVariadicDetails.h
+++ b/llvm/include/llvm/Support/FormatVariadicDetails.h
@@ -17,11 +17,11 @@
 #include <type_traits>
 
 namespace llvm {
-template <typename T, typename Enable = void> struct format_provider {};
+template <typename T, typename Enable = void> struct LLVM_CLASS_ABI format_provider {};
 class Error;
 
 namespace detail {
-class format_adapter {
+class LLVM_CLASS_ABI format_adapter {
   virtual void anchor();
 
 protected:
@@ -31,7 +31,7 @@ class format_adapter {
   virtual void format(raw_ostream &S, StringRef Options) = 0;
 };
 
-template <typename T> class provider_format_adapter : public format_adapter {
+template <typename T> class LLVM_CLASS_ABI provider_format_adapter : public format_adapter {
   T Item;
 
 public:
@@ -43,7 +43,7 @@ template <typename T> class provider_format_adapter : public format_adapter {
 };
 
 template <typename T>
-class stream_operator_format_adapter : public format_adapter {
+class LLVM_CLASS_ABI stream_operator_format_adapter : public format_adapter {
   T Item;
 
 public:
@@ -59,7 +59,7 @@ template <typename T> class missing_format_adapter;
 // with the signature:
 //   static void format(const T&, raw_stream &, StringRef);
 //
-template <class T> class has_FormatProvider {
+template <class T> class LLVM_CLASS_ABI has_FormatProvider {
 public:
   using Decayed = std::decay_t<T>;
   typedef void (*Signature_format)(const Decayed &, llvm::raw_ostream &,
@@ -75,7 +75,7 @@ template <class T> class has_FormatProvider {
 };
 
 // Test if raw_ostream& << T -> raw_ostream& is findable via ADL.
-template <class T> class has_StreamOperator {
+template <class T> class LLVM_CLASS_ABI has_StreamOperator {
 public:
   using ConstRefT = const std::decay_t<T> &;
 
@@ -94,7 +94,7 @@ template <class T> class has_StreamOperator {
 // Simple template that decides whether a type T should use the member-function
 // based format() invocation.
 template <typename T>
-struct uses_format_member
+struct LLVM_CLASS_ABI uses_format_member
     : public std::integral_constant<
           bool, std::is_base_of_v<format_adapter, std::remove_reference_t<T>>> {
 };
@@ -103,7 +103,7 @@ struct uses_format_member
 // based format() invocation.  The member function takes priority, so this test
 // will only be true if there is not ALSO a format member.
 template <typename T>
-struct uses_format_provider
+struct LLVM_CLASS_ABI uses_format_provider
     : public std::integral_constant<
           bool, !uses_format_member<T>::value && has_FormatProvider<T>::value> {
 };
@@ -111,7 +111,7 @@ struct uses_format_provider
 // Simple template that decides whether a type T should use the operator<<
 // based format() invocation.  This takes last priority.
 template <typename T>
-struct uses_stream_operator
+struct LLVM_CLASS_ABI uses_stream_operator
     : public std::integral_constant<bool, !uses_format_member<T>::value &&
                                               !uses_format_provider<T>::value &&
                                               has_StreamOperator<T>::value> {};
@@ -121,7 +121,7 @@ struct uses_stream_operator
 // that the compiler spits out a nice diagnostic when a type with no format
 // implementation can be located.
 template <typename T>
-struct uses_missing_provider
+struct LLVM_CLASS_ABI uses_missing_provider
     : public std::integral_constant<bool, !uses_format_member<T>::value &&
                                               !uses_format_provider<T>::value &&
                                               !uses_stream_operator<T>::value> {
diff --git a/llvm/include/llvm/Support/FormattedStream.h b/llvm/include/llvm/Support/FormattedStream.h
index 218c8def4872769..85eba59ac4c829d 100644
--- a/llvm/include/llvm/Support/FormattedStream.h
+++ b/llvm/include/llvm/Support/FormattedStream.h
@@ -28,7 +28,7 @@ namespace llvm {
 /// 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_CLASS_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.
   ///
@@ -170,15 +170,15 @@ class formatted_raw_ostream : public raw_ostream {
 
 /// fouts() - This returns a reference to a formatted_raw_ostream for
 /// standard output.  Use it like: fouts() << "foo" << "bar";
-formatted_raw_ostream &fouts();
+LLVM_FUNC_ABI formatted_raw_ostream &fouts();
 
 /// ferrs() - This returns a reference to a formatted_raw_ostream for
 /// standard error.  Use it like: ferrs() << "foo" << "bar";
-formatted_raw_ostream &ferrs();
+LLVM_FUNC_ABI formatted_raw_ostream &ferrs();
 
 /// fdbgs() - This returns a reference to a formatted_raw_ostream for
 /// debug output.  Use it like: fdbgs() << "foo" << "bar";
-formatted_raw_ostream &fdbgs();
+LLVM_FUNC_ABI formatted_raw_ostream &fdbgs();
 
 } // end llvm namespace
 
diff --git a/llvm/include/llvm/Support/GenericDomTree.h b/llvm/include/llvm/Support/GenericDomTree.h
index e9a97beaec60732..46564a75edec4ff 100644
--- a/llvm/include/llvm/Support/GenericDomTree.h
+++ b/llvm/include/llvm/Support/GenericDomTree.h
@@ -52,7 +52,7 @@ struct SemiNCAInfo;
 }  // namespace DomTreeBuilder
 
 /// Base class for the actual dominator tree node.
-template <class NodeT> class DomTreeNodeBase {
+template <class NodeT> class LLVM_CLASS_ABI DomTreeNodeBase {
   friend class PostDominatorTree;
   friend class DominatorTreeBase<NodeT, false>;
   friend class DominatorTreeBase<NodeT, true>;
@@ -224,7 +224,7 @@ bool Verify(const DomTreeT &DT, typename DomTreeT::VerificationLevel VL);
 
 /// Default DomTreeNode traits for NodeT. The default implementation assume a
 /// Function-like NodeT. Can be specialized to support different node types.
-template <typename NodeT> struct DomTreeNodeTraits {
+template <typename NodeT> struct LLVM_CLASS_ABI DomTreeNodeTraits {
   using NodeType = NodeT;
   using NodePtr = NodeT *;
   using ParentPtr = decltype(std::declval<NodePtr>()->getParent());
@@ -241,7 +241,7 @@ template <typename NodeT> struct DomTreeNodeTraits {
 /// This class is a generic template over graph nodes. It is instantiated for
 /// various graphs in the LLVM IR or in the code generator.
 template <typename NodeT, bool IsPostDom>
-class DominatorTreeBase {
+class LLVM_CLASS_ABI DominatorTreeBase {
  public:
   static_assert(std::is_pointer_v<typename GraphTraits<NodeT *>::NodeRef>,
                 "Currently DominatorTreeBase supports only pointer nodes");
diff --git a/llvm/include/llvm/Support/GenericDomTreeConstruction.h b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
index 262ce60e4eee384..eb9b303d8900009 100644
--- a/llvm/include/llvm/Support/GenericDomTreeConstruction.h
+++ b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
@@ -54,7 +54,7 @@ namespace llvm {
 namespace DomTreeBuilder {
 
 template <typename DomTreeT>
-struct SemiNCAInfo {
+struct LLVM_CLASS_ABI SemiNCAInfo {
   using NodePtr = typename DomTreeT::NodePtr;
   using NodeT = typename DomTreeT::NodeType;
   using TreeNodePtr = DomTreeNodeBase<NodeT> *;
diff --git a/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h b/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h
index dfb4179cb62f1cc..ab4039933cea233 100644
--- a/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h
+++ b/llvm/include/llvm/Support/GenericIteratedDominanceFrontier.h
@@ -37,7 +37,7 @@ namespace IDFCalculatorDetail {
 /// Generic utility class used for getting the children of a basic block.
 /// May be specialized if, for example, one wouldn't like to return nullpointer
 /// successors.
-template <class NodeTy, bool IsPostDom> struct ChildrenGetterTy {
+template <class NodeTy, bool IsPostDom> struct LLVM_CLASS_ABI ChildrenGetterTy {
   using NodeRef = typename GraphTraits<NodeTy *>::NodeRef;
   using ChildrenTy = SmallVector<NodeRef, 8>;
 
@@ -55,7 +55,7 @@ template <class NodeTy, bool IsPostDom> struct ChildrenGetterTy {
 /// pruned using the live-in set.
 /// By default, liveness is not used to prune the IDF computation.
 /// The template parameters should be of a CFG block type.
-template <class NodeTy, bool IsPostDom> class IDFCalculatorBase {
+template <class NodeTy, bool IsPostDom> class LLVM_CLASS_ABI IDFCalculatorBase {
 public:
   using OrderedNodeTy =
       std::conditional_t<IsPostDom, Inverse<NodeTy *>, NodeTy *>;
diff --git a/llvm/include/llvm/Support/GenericLoopInfo.h b/llvm/include/llvm/Support/GenericLoopInfo.h
index 7a35e723a6ce7cf..a456b4b1139f73d 100644
--- a/llvm/include/llvm/Support/GenericLoopInfo.h
+++ b/llvm/include/llvm/Support/GenericLoopInfo.h
@@ -57,7 +57,7 @@ template <class N, class M> class LoopBase;
 /// Instances of this class are used to represent loops that are detected in the
 /// flow graph.
 ///
-template <class BlockT, class LoopT> class LoopBase {
+template <class BlockT, class LoopT> class LLVM_CLASS_ABI LoopBase {
   LoopT *ParentLoop;
   // Loops contained entirely within this one.
   std::vector<LoopT *> SubLoops;
@@ -530,7 +530,7 @@ raw_ostream &operator<<(raw_ostream &OS, const LoopBase<BlockT, LoopT> &Loop) {
 /// structures in the specified function.
 ///
 
-template <class BlockT, class LoopT> class LoopInfoBase {
+template <class BlockT, class LoopT> class LLVM_CLASS_ABI LoopInfoBase {
   // BBMap - Mapping of basic blocks to the inner most loop they occur in
   DenseMap<const BlockT *, LoopT *> BBMap;
   std::vector<LoopT *> TopLevelLoops;
diff --git a/llvm/include/llvm/Support/GenericLoopInfoImpl.h b/llvm/include/llvm/Support/GenericLoopInfoImpl.h
index f157163c4195628..600343b21f34840 100644
--- a/llvm/include/llvm/Support/GenericLoopInfoImpl.h
+++ b/llvm/include/llvm/Support/GenericLoopInfoImpl.h
@@ -508,7 +508,7 @@ static void discoverAndMapSubloop(LoopT *L, ArrayRef<BlockT *> Backedges,
 }
 
 /// Populate all loop data in a stable order during a single forward DFS.
-template <class BlockT, class LoopT> class PopulateLoopsDFS {
+template <class BlockT, class LoopT> class LLVM_CLASS_ABI PopulateLoopsDFS {
   typedef GraphTraits<BlockT *> BlockTraits;
   typedef typename BlockTraits::ChildIteratorType SuccIterTy;
 
diff --git a/llvm/include/llvm/Support/GlobPattern.h b/llvm/include/llvm/Support/GlobPattern.h
index d9e0fae86a9bcbc..2730322fc15aa7d 100644
--- a/llvm/include/llvm/Support/GlobPattern.h
+++ b/llvm/include/llvm/Support/GlobPattern.h
@@ -27,7 +27,7 @@ namespace llvm {
 template <typename T> class ArrayRef;
 class StringRef;
 
-class GlobPattern {
+class LLVM_CLASS_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
index b768b95e0af1f15..7ced8c0f7689fb1 100644
--- a/llvm/include/llvm/Support/GraphWriter.h
+++ b/llvm/include/llvm/Support/GraphWriter.h
@@ -38,11 +38,11 @@ namespace llvm {
 
 namespace DOT {  // Private functions...
 
-std::string EscapeString(const std::string &Label);
+LLVM_FUNC_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_FUNC_ABI StringRef getColorString(unsigned NodeNumber);
 
 } // end namespace DOT
 
@@ -58,11 +58,11 @@ enum Name {
 
 } // end namespace GraphProgram
 
-bool DisplayGraph(StringRef Filename, bool wait = true,
+LLVM_FUNC_ABI bool DisplayGraph(StringRef Filename, bool wait = true,
                   GraphProgram::Name program = GraphProgram::DOT);
 
 template<typename GraphType>
-class GraphWriter {
+class LLVM_CLASS_ABI GraphWriter {
   raw_ostream &O;
   const GraphType &G;
   bool RenderUsingHTML = false;
@@ -369,7 +369,7 @@ raw_ostream &WriteGraph(raw_ostream &O, const GraphType &G,
   return O;
 }
 
-std::string createGraphFilename(const Twine &Name, int &FD);
+LLVM_FUNC_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/InitLLVM.h b/llvm/include/llvm/Support/InitLLVM.h
index b42441d645ba5bd..42597b78ba7e2d1 100644
--- a/llvm/include/llvm/Support/InitLLVM.h
+++ b/llvm/include/llvm/Support/InitLLVM.h
@@ -33,7 +33,7 @@
 // InitLLVM calls llvm_shutdown() on destruction, which cleans up
 // ManagedStatic objects.
 namespace llvm {
-class InitLLVM {
+class LLVM_CLASS_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
index 258d6c3a62dc73c..58acb06bfed6623 100644
--- a/llvm/include/llvm/Support/InstructionCost.h
+++ b/llvm/include/llvm/Support/InstructionCost.h
@@ -27,7 +27,7 @@ namespace llvm {
 
 class raw_ostream;
 
-class InstructionCost {
+class LLVM_CLASS_ABI InstructionCost {
 public:
   using CostType = int64_t;
 
diff --git a/llvm/include/llvm/Support/JSON.h b/llvm/include/llvm/Support/JSON.h
index e87cb01ebcab336..50ea8abe3286aba 100644
--- a/llvm/include/llvm/Support/JSON.h
+++ b/llvm/include/llvm/Support/JSON.h
@@ -82,11 +82,11 @@ constexpr bool is_uint_64_bit_v =
 
 /// 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_FUNC_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_FUNC_ABI std::string fixUTF8(llvm::StringRef S);
 
 class Array;
 class ObjectKey;
@@ -95,7 +95,7 @@ template <typename T> Value toJSON(const std::optional<T> &Opt);
 
 /// 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_CLASS_ABI Object {
   using Storage = DenseMap<ObjectKey, Value, llvm::DenseMapInfo<StringRef>>;
   Storage M;
 
@@ -154,14 +154,14 @@ class Object {
   const json::Array *getArray(StringRef K) const;
   json::Array *getArray(StringRef K);
 };
-bool operator==(const Object &LHS, const Object &RHS);
+LLVM_FUNC_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_CLASS_ABI Array {
   std::vector<Value> V;
 
 public:
@@ -204,7 +204,7 @@ class Array {
   template <typename It> iterator insert(const_iterator P, It A, It Z);
   template <typename... Args> iterator emplace(const_iterator P, Args &&...A);
 
-  friend bool operator==(const Array &L, const Array &R);
+  friend LLVM_FUNC_ABI bool operator==(const Array &L, const Array &R);
 };
 inline bool operator!=(const Array &L, const Array &R) { return !(L == R); }
 
@@ -285,7 +285,7 @@ inline bool operator!=(const Array &L, const Array &R) { return !(L == R); }
 /// And parsed:
 ///   Expected<Value> E = json::parse("[1, 2, null]");
 ///   assert(E && E->kind() == Value::Array);
-class Value {
+class LLVM_CLASS_ABI Value {
 public:
   enum Kind {
     Null,
@@ -511,10 +511,10 @@ class Value {
                                       llvm::StringRef, std::string, json::Array,
                                       json::Object>
       Union;
-  friend bool operator==(const Value &, const Value &);
+  friend LLVM_FUNC_ABI bool operator==(const Value &, const Value &);
 };
 
-bool operator==(const Value &, const Value &);
+LLVM_FUNC_ABI bool operator==(const Value &, const Value &);
 inline bool operator!=(const Value &L, const Value &R) { return !(L == R); }
 
 // Array Methods
@@ -563,7 +563,7 @@ inline bool operator==(const Array &L, const Array &R) { return L.V == R.V; }
 ///   - only strings are allowed
 ///   - it's optimized for the string literal case (Owned == nullptr)
 /// Like Value, strings must be UTF-8. See isUTF8 documentation for details.
-class ObjectKey {
+class LLVM_CLASS_ABI ObjectKey {
 public:
   ObjectKey(const char *S) : ObjectKey(StringRef(S)) {}
   ObjectKey(std::string S) : Owned(new std::string(std::move(S))) {
@@ -638,7 +638,7 @@ inline bool Object::erase(StringRef K) {
 /// 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_CLASS_ABI Path {
 public:
   class Root;
 
@@ -825,7 +825,7 @@ template <typename T> Value toJSON(const std::optional<T> &Opt) {
 ///         O.mapOptional("optional_field", R.OptionalField);
 ///   }
 /// \endcode
-class ObjectMapper {
+class LLVM_CLASS_ABI ObjectMapper {
 public:
   /// If O is not an object, this mapper is invalid and an error is reported.
   ObjectMapper(const Value &E, Path P) : O(E.getAsObject()), P(P) {
@@ -876,9 +876,9 @@ class ObjectMapper {
 /// 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_FUNC_ABI llvm::Expected<Value> parse(llvm::StringRef JSON);
 
-class ParseError : public llvm::ErrorInfo<ParseError> {
+class LLVM_CLASS_ABI ParseError : public llvm::ErrorInfo<ParseError> {
   const char *Msg;
   unsigned Line, Column, Offset;
 
@@ -962,7 +962,7 @@ Expected<T> parse(const llvm::StringRef &JSON, const char *RootName = "") {
 /// 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_CLASS_ABI OStream {
  public:
   using Block = llvm::function_ref<void()>;
   // If IndentSize is nonzero, output is pretty-printed.
@@ -1081,7 +1081,7 @@ inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Value &V) {
 /// 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_CLASS_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
index f99788ba6c80461..9f980c753b032d6 100644
--- a/llvm/include/llvm/Support/KnownBits.h
+++ b/llvm/include/llvm/Support/KnownBits.h
@@ -21,7 +21,7 @@
 namespace llvm {
 
 // Struct for tracking the known zeros and ones of a value.
-struct KnownBits {
+struct LLVM_CLASS_ABI KnownBits {
   APInt Zero;
   APInt One;
 
diff --git a/llvm/include/llvm/Support/LEB128.h b/llvm/include/llvm/Support/LEB128.h
index 878b04bd14d4d45..9c0d473dd86d54d 100644
--- a/llvm/include/llvm/Support/LEB128.h
+++ b/llvm/include/llvm/Support/LEB128.h
@@ -199,10 +199,10 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr,
 }
 
 /// Utility function to get the size of the ULEB128-encoded value.
-extern unsigned getULEB128Size(uint64_t Value);
+LLVM_FUNC_ABI extern unsigned getULEB128Size(uint64_t Value);
 
 /// Utility function to get the size of the SLEB128-encoded value.
-extern unsigned getSLEB128Size(int64_t Value);
+LLVM_FUNC_ABI extern unsigned getSLEB128Size(int64_t Value);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Support/LLVMDriver.h b/llvm/include/llvm/Support/LLVMDriver.h
index 1c68f507077708f..bce913002a6a5e5 100644
--- a/llvm/include/llvm/Support/LLVMDriver.h
+++ b/llvm/include/llvm/Support/LLVMDriver.h
@@ -13,7 +13,7 @@
 
 namespace llvm {
 
-struct ToolContext {
+struct LLVM_CLASS_ABI ToolContext {
   const char *Path;
   const char *PrependArg;
   // PrependArg will be added unconditionally by the llvm-driver, but
diff --git a/llvm/include/llvm/Support/LineIterator.h b/llvm/include/llvm/Support/LineIterator.h
index bae202522557ffb..c16c615b9f7af40 100644
--- a/llvm/include/llvm/Support/LineIterator.h
+++ b/llvm/include/llvm/Support/LineIterator.h
@@ -31,7 +31,7 @@ class MemoryBuffer;
 /// character.
 ///
 /// Note that this iterator requires the buffer to be nul terminated.
-class line_iterator {
+class LLVM_CLASS_ABI line_iterator {
   std::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
index e99184a19a1268e..018fed273e438b2 100644
--- a/llvm/include/llvm/Support/Locale.h
+++ b/llvm/include/llvm/Support/Locale.h
@@ -9,8 +9,8 @@ class StringRef;
 namespace sys {
 namespace locale {
 
-int columnWidth(StringRef s);
-bool isPrint(int c);
+LLVM_FUNC_ABI int columnWidth(StringRef s);
+LLVM_FUNC_ABI bool isPrint(int c);
 
 }
 }
diff --git a/llvm/include/llvm/Support/LockFileManager.h b/llvm/include/llvm/Support/LockFileManager.h
index af1c77760abacca..3be641b81fc916e 100644
--- a/llvm/include/llvm/Support/LockFileManager.h
+++ b/llvm/include/llvm/Support/LockFileManager.h
@@ -25,7 +25,7 @@ class StringRef;
 /// 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_CLASS_ABI LockFileManager {
 public:
   /// Describes the state of a lock file.
   enum LockFileState {
diff --git a/llvm/include/llvm/Support/MD5.h b/llvm/include/llvm/Support/MD5.h
index 59dda28760cca72..3f87ec1b5697373 100644
--- a/llvm/include/llvm/Support/MD5.h
+++ b/llvm/include/llvm/Support/MD5.h
@@ -39,7 +39,7 @@ namespace llvm {
 template <unsigned N> class SmallString;
 template <typename T> class ArrayRef;
 
-class MD5 {
+class LLVM_CLASS_ABI MD5 {
 public:
   struct MD5Result : public std::array<uint8_t, 16> {
     SmallString<32> digest() const;
diff --git a/llvm/include/llvm/Support/MSP430AttributeParser.h b/llvm/include/llvm/Support/MSP430AttributeParser.h
index 2fa350872237961..9e43fccaabc7309 100644
--- a/llvm/include/llvm/Support/MSP430AttributeParser.h
+++ b/llvm/include/llvm/Support/MSP430AttributeParser.h
@@ -19,7 +19,7 @@
 #include "llvm/Support/MSP430Attributes.h"
 
 namespace llvm {
-class MSP430AttributeParser : public ELFAttributeParser {
+class LLVM_CLASS_ABI MSP430AttributeParser : public ELFAttributeParser {
   struct DisplayHandler {
     MSP430Attrs::AttrType Attribute;
     Error (MSP430AttributeParser::*Routine)(MSP430Attrs::AttrType);
diff --git a/llvm/include/llvm/Support/MSP430Attributes.h b/llvm/include/llvm/Support/MSP430Attributes.h
index ebec10d15f02174..2c327e932ffd5c4 100644
--- a/llvm/include/llvm/Support/MSP430Attributes.h
+++ b/llvm/include/llvm/Support/MSP430Attributes.h
@@ -24,7 +24,7 @@
 namespace llvm {
 namespace MSP430Attrs {
 
-const TagNameMap &getMSP430AttributeTags();
+LLVM_FUNC_ABI const TagNameMap &getMSP430AttributeTags();
 
 enum AttrType : unsigned {
   // Attribute types in ELF/.MSP430.attributes.
diff --git a/llvm/include/llvm/Support/MSVCErrorWorkarounds.h b/llvm/include/llvm/Support/MSVCErrorWorkarounds.h
index 5424b2fd22c5b76..98e98500ade8b70 100644
--- a/llvm/include/llvm/Support/MSVCErrorWorkarounds.h
+++ b/llvm/include/llvm/Support/MSVCErrorWorkarounds.h
@@ -25,7 +25,7 @@ namespace llvm {
 
 // A default-constructible llvm::Error that is suitable for use with MSVC's
 // std::future implementation which requires default constructible types.
-class MSVCPError : public Error {
+class LLVM_CLASS_ABI MSVCPError : public Error {
 public:
   MSVCPError() { (void)!!*this; }
 
@@ -41,7 +41,7 @@ class MSVCPError : public Error {
 
 // A default-constructible llvm::Expected that is suitable for use with MSVC's
 // std::future implementation, which requires default constructible types.
-template <typename T> class MSVCPExpected : public Expected<T> {
+template <typename T> class LLVM_CLASS_ABI MSVCPExpected : public Expected<T> {
 public:
   MSVCPExpected()
       : Expected<T>(make_error<StringError>("", inconvertibleErrorCode())) {
diff --git a/llvm/include/llvm/Support/ManagedStatic.h b/llvm/include/llvm/Support/ManagedStatic.h
index f1d492d861af2b5..02485f14b8fa6ec 100644
--- a/llvm/include/llvm/Support/ManagedStatic.h
+++ b/llvm/include/llvm/Support/ManagedStatic.h
@@ -20,16 +20,16 @@
 namespace llvm {
 
 /// object_creator - Helper method for ManagedStatic.
-template <class C> struct object_creator {
+template <class C> struct LLVM_CLASS_ABI object_creator {
   static void *call() { return new C(); }
 };
 
 /// object_deleter - Helper method for ManagedStatic.
 ///
-template <typename T> struct object_deleter {
+template <typename T> struct LLVM_CLASS_ABI object_deleter {
   static void call(void *Ptr) { delete (T *)Ptr; }
 };
-template <typename T, size_t N> struct object_deleter<T[N]> {
+template <typename T, size_t N> struct LLVM_CLASS_ABI object_deleter<T[N]> {
   static void call(void *Ptr) { delete[](T *)Ptr; }
 };
 
@@ -47,7 +47,7 @@ template <typename T, size_t N> struct object_deleter<T[N]> {
 #endif
 
 /// ManagedStaticBase - Common base class for ManagedStatic instances.
-class ManagedStaticBase {
+class LLVM_CLASS_ABI ManagedStaticBase {
 protected:
 #ifdef LLVM_USE_CONSTEXPR_CTOR
   mutable std::atomic<void *> Ptr{};
@@ -81,7 +81,7 @@ class ManagedStaticBase {
 ///
 template <class C, class Creator = object_creator<C>,
           class Deleter = object_deleter<C>>
-class ManagedStatic : public ManagedStaticBase {
+class LLVM_CLASS_ABI ManagedStatic : public ManagedStaticBase {
 public:
   // Accessors.
   C &operator*() {
@@ -112,11 +112,11 @@ class ManagedStatic : public ManagedStaticBase {
 };
 
 /// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
-void llvm_shutdown();
+LLVM_FUNC_ABI void llvm_shutdown();
 
 /// llvm_shutdown_obj - This is a simple helper class that calls
 /// llvm_shutdown() when it is destroyed.
-struct llvm_shutdown_obj {
+struct LLVM_CLASS_ABI llvm_shutdown_obj {
   llvm_shutdown_obj() = default;
   ~llvm_shutdown_obj() { llvm_shutdown(); }
 };
diff --git a/llvm/include/llvm/Support/MemAlloc.h b/llvm/include/llvm/Support/MemAlloc.h
index d6012bd5a6985d8..4d024cc4acc631b 100644
--- a/llvm/include/llvm/Support/MemAlloc.h
+++ b/llvm/include/llvm/Support/MemAlloc.h
@@ -71,7 +71,7 @@ LLVM_ATTRIBUTE_RETURNS_NONNULL inline void *safe_realloc(void *Ptr, size_t Sz) {
 /// 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_FUNC_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 +81,7 @@ allocate_buffer(size_t Size, size_t Alignment);
 ///
 /// 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_FUNC_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
index af68710c0e1c9ab..e4ed67e35c11107 100644
--- a/llvm/include/llvm/Support/Memory.h
+++ b/llvm/include/llvm/Support/Memory.h
@@ -29,7 +29,7 @@ namespace sys {
   /// various memory allocation operations.
   /// @see Memory
   /// Memory block abstraction.
-  class MemoryBlock {
+  class LLVM_CLASS_ABI MemoryBlock {
   public:
     MemoryBlock() : Address(nullptr), AllocatedSize(0) {}
     MemoryBlock(void *addr, size_t allocatedSize)
@@ -50,7 +50,7 @@ namespace sys {
   /// MemoryBlock instances.
   /// @since 1.4
   /// An abstraction for memory operations.
-  class Memory {
+  class LLVM_CLASS_ABI Memory {
   public:
     enum ProtectionFlags {
       MF_READ = 0x1000000,
@@ -135,7 +135,7 @@ namespace sys {
   };
 
   /// Owning version of MemoryBlock.
-  class OwningMemoryBlock {
+  class LLVM_CLASS_ABI OwningMemoryBlock {
   public:
     OwningMemoryBlock() = default;
     explicit OwningMemoryBlock(MemoryBlock M) : M(M) {}
diff --git a/llvm/include/llvm/Support/MemoryBuffer.h b/llvm/include/llvm/Support/MemoryBuffer.h
index 0d5c1d91abb44bd..22c681508c856ff 100644
--- a/llvm/include/llvm/Support/MemoryBuffer.h
+++ b/llvm/include/llvm/Support/MemoryBuffer.h
@@ -49,7 +49,7 @@ using file_t = int;
 /// 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_CLASS_ABI MemoryBuffer {
   const char *BufferStart; // Start of the buffer.
   const char *BufferEnd;   // End of the buffer.
 
@@ -179,7 +179,7 @@ class MemoryBuffer {
 /// 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_CLASS_ABI WritableMemoryBuffer : public MemoryBuffer {
 protected:
   WritableMemoryBuffer() = default;
 
@@ -243,7 +243,7 @@ class WritableMemoryBuffer : public MemoryBuffer {
 /// 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_CLASS_ABI WriteThroughMemoryBuffer : public MemoryBuffer {
 protected:
   WriteThroughMemoryBuffer() = default;
 
diff --git a/llvm/include/llvm/Support/MemoryBufferRef.h b/llvm/include/llvm/Support/MemoryBufferRef.h
index 994654c783cb0f8..76928d9cccc04d7 100644
--- a/llvm/include/llvm/Support/MemoryBufferRef.h
+++ b/llvm/include/llvm/Support/MemoryBufferRef.h
@@ -20,7 +20,7 @@ namespace llvm {
 
 class MemoryBuffer;
 
-class MemoryBufferRef {
+class LLVM_CLASS_ABI MemoryBufferRef {
   StringRef Buffer;
   StringRef Identifier;
 
diff --git a/llvm/include/llvm/Support/ModRef.h b/llvm/include/llvm/Support/ModRef.h
index daff3fda0941cc5..ccc456acef4595e 100644
--- a/llvm/include/llvm/Support/ModRef.h
+++ b/llvm/include/llvm/Support/ModRef.h
@@ -54,7 +54,7 @@ enum class ModRefInfo : uint8_t {
 }
 
 /// Debug print ModRefInfo.
-raw_ostream &operator<<(raw_ostream &OS, ModRefInfo MR);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, ModRefInfo MR);
 
 /// The locations at which a function might access memory.
 enum class IRMemLocation {
@@ -70,7 +70,7 @@ enum class IRMemLocation {
   Last = Other,
 };
 
-template <typename LocationEnum> class MemoryEffectsBase {
+template <typename LocationEnum> class LLVM_CLASS_ABI MemoryEffectsBase {
 public:
   using Location = LocationEnum;
 
@@ -269,7 +269,7 @@ template <typename LocationEnum> class MemoryEffectsBase {
 using MemoryEffects = MemoryEffectsBase<IRMemLocation>;
 
 /// Debug print MemoryEffects.
-raw_ostream &operator<<(raw_ostream &OS, MemoryEffects RMRB);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, MemoryEffects RMRB);
 
 // Legacy alias.
 using FunctionModRefBehavior = MemoryEffects;
diff --git a/llvm/include/llvm/Support/Mutex.h b/llvm/include/llvm/Support/Mutex.h
index d835ea50ecc2b9b..db809b4027bf095 100644
--- a/llvm/include/llvm/Support/Mutex.h
+++ b/llvm/include/llvm/Support/Mutex.h
@@ -26,7 +26,7 @@ namespace llvm
     /// indicates whether this mutex should become a no-op when we're not
     /// running in multithreaded mode.
     template<bool mt_only>
-    class SmartMutex {
+    class LLVM_CLASS_ABI SmartMutex {
       std::recursive_mutex impl;
       unsigned acquired = 0;
 
diff --git a/llvm/include/llvm/Support/NativeFormatting.h b/llvm/include/llvm/Support/NativeFormatting.h
index 47433ed7d4f3b63..d849eb3b4ba66f3 100644
--- a/llvm/include/llvm/Support/NativeFormatting.h
+++ b/llvm/include/llvm/Support/NativeFormatting.h
@@ -22,25 +22,25 @@ enum class IntegerStyle {
 };
 enum class HexPrintStyle { Upper, Lower, PrefixUpper, PrefixLower };
 
-size_t getDefaultPrecision(FloatStyle Style);
+LLVM_FUNC_ABI size_t getDefaultPrecision(FloatStyle Style);
 
-bool isPrefixedHexStyle(HexPrintStyle S);
+LLVM_FUNC_ABI bool isPrefixedHexStyle(HexPrintStyle S);
 
-void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits,
+LLVM_FUNC_ABI void write_integer(raw_ostream &S, unsigned int N, size_t MinDigits,
                    IntegerStyle Style);
-void write_integer(raw_ostream &S, int N, size_t MinDigits, IntegerStyle Style);
-void write_integer(raw_ostream &S, unsigned long N, size_t MinDigits,
+LLVM_FUNC_ABI void write_integer(raw_ostream &S, int N, size_t MinDigits, IntegerStyle Style);
+LLVM_FUNC_ABI void write_integer(raw_ostream &S, unsigned long N, size_t MinDigits,
                    IntegerStyle Style);
-void write_integer(raw_ostream &S, long N, size_t MinDigits,
+LLVM_FUNC_ABI void write_integer(raw_ostream &S, long N, size_t MinDigits,
                    IntegerStyle Style);
-void write_integer(raw_ostream &S, unsigned long long N, size_t MinDigits,
+LLVM_FUNC_ABI void write_integer(raw_ostream &S, unsigned long long N, size_t MinDigits,
                    IntegerStyle Style);
-void write_integer(raw_ostream &S, long long N, size_t MinDigits,
+LLVM_FUNC_ABI void write_integer(raw_ostream &S, long long N, size_t MinDigits,
                    IntegerStyle Style);
 
-void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
+LLVM_FUNC_ABI void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
                std::optional<size_t> Width = std::nullopt);
-void write_double(raw_ostream &S, double D, FloatStyle Style,
+LLVM_FUNC_ABI void write_double(raw_ostream &S, double D, FloatStyle Style,
                   std::optional<size_t> Precision = std::nullopt);
 }
 
diff --git a/llvm/include/llvm/Support/OnDiskHashTable.h b/llvm/include/llvm/Support/OnDiskHashTable.h
index ad5a94c15e3a157..6d3eaaadb75720b 100644
--- a/llvm/include/llvm/Support/OnDiskHashTable.h
+++ b/llvm/include/llvm/Support/OnDiskHashTable.h
@@ -56,7 +56,7 @@ namespace llvm {
 ///   static bool EqualKey(key_type_ref Key1, key_type_ref Key2);
 /// };
 /// \endcode
-template <typename Info> class OnDiskChainedHashTableGenerator {
+template <typename Info> class LLVM_CLASS_ABI OnDiskChainedHashTableGenerator {
   /// A single item in the hash table.
   class Item {
   public:
@@ -271,7 +271,7 @@ template <typename Info> class OnDiskChainedHashTableGenerator {
 ///                      offset_type DataLen);
 /// };
 /// \endcode
-template <typename Info> class OnDiskChainedHashTable {
+template <typename Info> class LLVM_CLASS_ABI OnDiskChainedHashTable {
   const typename Info::offset_type NumBuckets;
   const typename Info::offset_type NumEntries;
   const unsigned char *const Buckets;
@@ -428,7 +428,7 @@ template <typename Info> class OnDiskChainedHashTable {
 ///
 /// \copydetails llvm::OnDiskChainedHashTable
 template <typename Info>
-class OnDiskIterableChainedHashTable : public OnDiskChainedHashTable<Info> {
+class LLVM_CLASS_ABI OnDiskIterableChainedHashTable : public OnDiskChainedHashTable<Info> {
   const unsigned char *Payload;
 
 public:
diff --git a/llvm/include/llvm/Support/OptimizedStructLayout.h b/llvm/include/llvm/Support/OptimizedStructLayout.h
index f4574da70a3882d..4f5886792466466 100644
--- a/llvm/include/llvm/Support/OptimizedStructLayout.h
+++ b/llvm/include/llvm/Support/OptimizedStructLayout.h
@@ -43,7 +43,7 @@
 namespace llvm {
 
 /// A field in a structure.
-struct OptimizedStructLayoutField {
+struct LLVM_CLASS_ABI OptimizedStructLayoutField {
   /// A special value for Offset indicating that the field can be moved
   /// anywhere.
   static constexpr uint64_t FlexibleOffset = ~(uint64_t)0;
@@ -136,7 +136,7 @@ struct OptimizedStructLayoutField {
 /// 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_FUNC_ABI std::pair<uint64_t, Align> performOptimizedStructLayout(
                         MutableArrayRef<OptimizedStructLayoutField> Fields);
 
 } // namespace llvm
diff --git a/llvm/include/llvm/Support/PGOOptions.h b/llvm/include/llvm/Support/PGOOptions.h
index 8214b844ab04508..3c3818ea9a98b0d 100644
--- a/llvm/include/llvm/Support/PGOOptions.h
+++ b/llvm/include/llvm/Support/PGOOptions.h
@@ -25,7 +25,7 @@ class FileSystem;
 } // namespace vfs
 
 /// A struct capturing PGO tunables.
-struct PGOOptions {
+struct LLVM_CLASS_ABI PGOOptions {
   enum PGOAction { NoAction, IRInstr, IRUse, SampleUse };
   enum CSPGOAction { NoCSAction, CSIRInstr, CSIRUse };
   PGOOptions(std::string ProfileFile, std::string CSProfileGenFile,
diff --git a/llvm/include/llvm/Support/Parallel.h b/llvm/include/llvm/Support/Parallel.h
index 701246ad570ad52..d9f4b1b93ae4b24 100644
--- a/llvm/include/llvm/Support/Parallel.h
+++ b/llvm/include/llvm/Support/Parallel.h
@@ -28,7 +28,7 @@ namespace parallel {
 // 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;
+LLVM_FUNC_ABI extern ThreadPoolStrategy strategy;
 
 #if LLVM_ENABLE_THREADS
 #define GET_THREAD_INDEX_IMPL                                                  \
@@ -45,19 +45,19 @@ extern ThreadPoolStrategy strategy;
 unsigned getThreadIndex();
 #else
 // Don't access this directly, use the getThreadIndex wrapper.
-extern thread_local unsigned threadIndex;
+LLVM_FUNC_ABI extern thread_local unsigned threadIndex;
 
 inline unsigned getThreadIndex() { GET_THREAD_INDEX_IMPL; }
 #endif
 
-size_t getThreadCount();
+LLVM_FUNC_ABI size_t getThreadCount();
 #else
 inline unsigned getThreadIndex() { return 0; }
 inline size_t getThreadCount() { return 1; }
 #endif
 
 namespace detail {
-class Latch {
+class LLVM_CLASS_ABI Latch {
   uint32_t Count;
   mutable std::mutex Mutex;
   mutable std::condition_variable Cond;
@@ -87,7 +87,7 @@ class Latch {
 };
 } // namespace detail
 
-class TaskGroup {
+class LLVM_CLASS_ABI TaskGroup {
   detail::Latch L;
   bool Parallel;
 
@@ -228,7 +228,7 @@ void parallelSort(RandomAccessIterator Start, RandomAccessIterator End,
   llvm::sort(Start, End, Comp);
 }
 
-void parallelFor(size_t Begin, size_t End, function_ref<void(size_t)> Fn);
+LLVM_FUNC_ABI void parallelFor(size_t Begin, size_t End, function_ref<void(size_t)> Fn);
 
 template <class IterTy, class FuncTy>
 void parallelForEach(IterTy Begin, IterTy End, FuncTy Fn) {
diff --git a/llvm/include/llvm/Support/Path.h b/llvm/include/llvm/Support/Path.h
index d5782b10709b624..d3bd9f4c59069ce 100644
--- a/llvm/include/llvm/Support/Path.h
+++ b/llvm/include/llvm/Support/Path.h
@@ -71,7 +71,7 @@ constexpr bool is_style_windows(Style S) { return !is_style_posix(S); }
 ///   ../        => ..,.
 ///   C:\foo\bar => C:,\,foo,bar
 /// @endcode
-class const_iterator
+class LLVM_CLASS_ABI const_iterator
     : public iterator_facade_base<const_iterator, std::input_iterator_tag,
                                   const StringRef> {
   StringRef Path;          ///< The entire path.
@@ -80,8 +80,8 @@ class const_iterator
   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_FUNC_ABI const_iterator begin(StringRef path, Style style);
+  friend LLVM_FUNC_ABI const_iterator end(StringRef path);
 
 public:
   reference operator*() const { return Component; }
@@ -97,7 +97,7 @@ class const_iterator
 /// This is an input iterator that iterates over the individual components in
 /// \a path in reverse order. The traversal order is exactly reversed from that
 /// of \a const_iterator
-class reverse_iterator
+class LLVM_CLASS_ABI reverse_iterator
     : public iterator_facade_base<reverse_iterator, std::input_iterator_tag,
                                   const StringRef> {
   StringRef Path;          ///< The entire path.
@@ -105,8 +105,8 @@ class reverse_iterator
   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_FUNC_ABI reverse_iterator rbegin(StringRef path, Style style);
+  friend LLVM_FUNC_ABI reverse_iterator rend(StringRef path);
 
 public:
   reference operator*() const { return Component; }
@@ -120,22 +120,22 @@ class reverse_iterator
 /// 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_FUNC_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_FUNC_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_FUNC_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_FUNC_ABI reverse_iterator rend(StringRef path);
 
 /// @}
 /// @name Lexical Modifiers
@@ -153,7 +153,7 @@ reverse_iterator rend(StringRef path);
 /// @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_FUNC_ABI void remove_filename(SmallVectorImpl<char> &path, Style style = Style::native);
 
 /// Replace the file extension of \a path with \a extension.
 ///
@@ -167,7 +167,7 @@ void remove_filename(SmallVectorImpl<char> &path, Style style = Style::native);
 /// @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_FUNC_ABI void replace_extension(SmallVectorImpl<char> &path, const Twine &extension,
                        Style style = Style::native);
 
 /// Replace matching path prefix with another path.
@@ -192,7 +192,7 @@ void replace_extension(SmallVectorImpl<char> &path, const Twine &extension,
 /// @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_FUNC_ABI bool replace_path_prefix(SmallVectorImpl<char> &Path, StringRef OldPrefix,
                          StringRef NewPrefix,
                          Style style = Style::native);
 
@@ -200,7 +200,7 @@ bool replace_path_prefix(SmallVectorImpl<char> &Path, StringRef OldPrefix,
 ///
 /// @param path Input path.
 /// @result The cleaned-up \a path.
-StringRef remove_leading_dotslash(StringRef path, Style style = Style::native);
+LLVM_FUNC_ABI StringRef remove_leading_dotslash(StringRef path, Style style = Style::native);
 
 /// In-place remove any './' and optionally '../' components from a path.
 ///
@@ -208,7 +208,7 @@ StringRef remove_leading_dotslash(StringRef path, Style style = Style::native);
 /// @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_FUNC_ABI bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false,
                  Style style = Style::native);
 
 /// Append to path.
@@ -221,12 +221,12 @@ bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false,
 ///
 /// @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_FUNC_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_FUNC_ABI void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
             const Twine &b = "", const Twine &c = "", const Twine &d = "");
 
 /// Append to path.
@@ -240,7 +240,7 @@ void append(SmallVectorImpl<char> &path, Style style, const Twine &a,
 /// @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_FUNC_ABI void append(SmallVectorImpl<char> &path, const_iterator begin,
             const_iterator end, Style style = Style::native);
 
 /// @}
@@ -253,7 +253,7 @@ void append(SmallVectorImpl<char> &path, const_iterator begin,
 ///
 /// @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_FUNC_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
@@ -261,7 +261,7 @@ void native(const Twine &path, SmallVectorImpl<char> &result,
 /// 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_FUNC_ABI void native(SmallVectorImpl<char> &path, Style style = Style::native);
 
 /// For Windows path styles, convert path to use the preferred path separators.
 /// For other styles, do nothing.
@@ -280,7 +280,7 @@ inline void make_preferred(SmallVectorImpl<char> &path,
 /// @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_FUNC_ABI std::string convert_to_slash(StringRef path, Style style = Style::native);
 
 /// @}
 /// @name Lexical Observers
@@ -296,7 +296,7 @@ std::string convert_to_slash(StringRef path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI StringRef root_name(StringRef path, Style style = Style::native);
 
 /// Get root directory.
 ///
@@ -309,7 +309,7 @@ StringRef root_name(StringRef path, Style style = Style::native);
 /// @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_FUNC_ABI StringRef root_directory(StringRef path, Style style = Style::native);
 
 /// Get root path.
 ///
@@ -317,7 +317,7 @@ StringRef root_directory(StringRef path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI StringRef root_path(StringRef path, Style style = Style::native);
 
 /// Get relative path.
 ///
@@ -329,7 +329,7 @@ StringRef root_path(StringRef path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI StringRef relative_path(StringRef path, Style style = Style::native);
 
 /// Get parent path.
 ///
@@ -341,7 +341,7 @@ StringRef relative_path(StringRef path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI StringRef parent_path(StringRef path, Style style = Style::native);
 
 /// Get filename.
 ///
@@ -355,7 +355,7 @@ StringRef parent_path(StringRef path, Style style = Style::native);
 /// @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_FUNC_ABI StringRef filename(StringRef path, Style style = Style::native);
 
 /// Get stem.
 ///
@@ -373,7 +373,7 @@ StringRef filename(StringRef path, Style style = Style::native);
 ///
 /// @param path Input path.
 /// @result The stem of \a path.
-StringRef stem(StringRef path, Style style = Style::native);
+LLVM_FUNC_ABI StringRef stem(StringRef path, Style style = Style::native);
 
 /// Get extension.
 ///
@@ -389,18 +389,18 @@ StringRef stem(StringRef path, Style style = Style::native);
 ///
 /// @param path Input path.
 /// @result The extension of \a path.
-StringRef extension(StringRef path, Style style = Style::native);
+LLVM_FUNC_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_FUNC_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_FUNC_ABI StringRef get_separator(Style style = Style::native);
 
 /// Get the typical temporary directory for the system, e.g.,
 /// "/var/tmp" or "C:/TEMP"
@@ -411,27 +411,27 @@ StringRef get_separator(Style style = Style::native);
 /// (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_FUNC_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_FUNC_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_FUNC_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_FUNC_ABI bool cache_directory(SmallVectorImpl<char> &result);
 
 /// Has root name?
 ///
@@ -439,7 +439,7 @@ bool cache_directory(SmallVectorImpl<char> &result);
 ///
 /// @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_FUNC_ABI bool has_root_name(const Twine &path, Style style = Style::native);
 
 /// Has root directory?
 ///
@@ -447,7 +447,7 @@ bool has_root_name(const Twine &path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI bool has_root_directory(const Twine &path, Style style = Style::native);
 
 /// Has root path?
 ///
@@ -455,7 +455,7 @@ bool has_root_directory(const Twine &path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI bool has_root_path(const Twine &path, Style style = Style::native);
 
 /// Has relative path?
 ///
@@ -463,7 +463,7 @@ bool has_root_path(const Twine &path, Style style = Style::native);
 ///
 /// @param path Input path.
 /// @result True if the path has a relative path, false otherwise.
-bool has_relative_path(const Twine &path, Style style = Style::native);
+LLVM_FUNC_ABI bool has_relative_path(const Twine &path, Style style = Style::native);
 
 /// Has parent path?
 ///
@@ -471,7 +471,7 @@ bool has_relative_path(const Twine &path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI bool has_parent_path(const Twine &path, Style style = Style::native);
 
 /// Has filename?
 ///
@@ -479,7 +479,7 @@ bool has_parent_path(const Twine &path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI bool has_filename(const Twine &path, Style style = Style::native);
 
 /// Has stem?
 ///
@@ -487,7 +487,7 @@ bool has_filename(const Twine &path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI bool has_stem(const Twine &path, Style style = Style::native);
 
 /// Has extension?
 ///
@@ -495,7 +495,7 @@ bool has_stem(const Twine &path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI bool has_extension(const Twine &path, Style style = Style::native);
 
 /// Is path absolute?
 ///
@@ -514,7 +514,7 @@ bool has_extension(const Twine &path, Style style = Style::native);
 ///
 /// @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_FUNC_ABI bool is_absolute(const Twine &path, Style style = Style::native);
 
 /// Is path absolute using GNU rules?
 ///
@@ -539,13 +539,13 @@ bool is_absolute(const Twine &path, Style style = Style::native);
 /// 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_FUNC_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_FUNC_ABI bool is_relative(const Twine &path, Style style = Style::native);
 
 } // end namespace path
 } // end namespace sys
diff --git a/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h b/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h
index 8ea7a17655bb02b..c872c5506c5dcb3 100644
--- a/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h
+++ b/llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h
@@ -25,7 +25,7 @@ namespace parallel {
 /// TODO: The same approach might be implemented for ThreadPool.
 
 template <typename AllocatorTy>
-class PerThreadAllocator
+class LLVM_CLASS_ABI PerThreadAllocator
     : public AllocatorBase<PerThreadAllocator<AllocatorTy>> {
 public:
   PerThreadAllocator()
diff --git a/llvm/include/llvm/Support/PluginLoader.h b/llvm/include/llvm/Support/PluginLoader.h
index 8a5598f60c89973..f598539ef1e6d58 100644
--- a/llvm/include/llvm/Support/PluginLoader.h
+++ b/llvm/include/llvm/Support/PluginLoader.h
@@ -25,7 +25,7 @@
 #include <string>
 
 namespace llvm {
-  struct PluginLoader {
+  struct LLVM_CLASS_ABI PluginLoader {
     void operator=(const std::string &Filename);
     static unsigned getNumPlugins();
     static std::string& getPlugin(unsigned num);
diff --git a/llvm/include/llvm/Support/PointerLikeTypeTraits.h b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
index 78d47e724151930..98cf3b020dec0eb 100644
--- a/llvm/include/llvm/Support/PointerLikeTypeTraits.h
+++ b/llvm/include/llvm/Support/PointerLikeTypeTraits.h
@@ -28,33 +28,33 @@ template <typename T> struct PointerLikeTypeTraits;
 namespace detail {
 /// A tiny meta function to compute the log2 of a compile time constant.
 template <size_t N>
-struct ConstantLog2
+struct LLVM_CLASS_ABI ConstantLog2
     : std::integral_constant<size_t, ConstantLog2<N / 2>::value + 1> {};
-template <> struct ConstantLog2<1> : std::integral_constant<size_t, 0> {};
+template <> struct LLVM_CLASS_ABI ConstantLog2<1> : std::integral_constant<size_t, 0> {};
 
 // Provide a trait to check if T is pointer-like.
-template <typename T, typename U = void> struct HasPointerLikeTypeTraits {
+template <typename T, typename U = void> struct LLVM_CLASS_ABI HasPointerLikeTypeTraits {
   static const bool value = false;
 };
 
 // sizeof(T) is valid only for a complete T.
 template <typename T>
-struct HasPointerLikeTypeTraits<
+struct LLVM_CLASS_ABI HasPointerLikeTypeTraits<
     T, decltype((sizeof(PointerLikeTypeTraits<T>) + sizeof(T)), void())> {
   static const bool value = true;
 };
 
-template <typename T> struct IsPointerLike {
+template <typename T> struct LLVM_CLASS_ABI IsPointerLike {
   static const bool value = HasPointerLikeTypeTraits<T>::value;
 };
 
-template <typename T> struct IsPointerLike<T *> {
+template <typename T> struct LLVM_CLASS_ABI IsPointerLike<T *> {
   static const bool value = true;
 };
 } // namespace detail
 
 // Provide PointerLikeTypeTraits for non-cvr pointers.
-template <typename T> struct PointerLikeTypeTraits<T *> {
+template <typename T> struct LLVM_CLASS_ABI PointerLikeTypeTraits<T *> {
   static inline void *getAsVoidPointer(T *P) { return P; }
   static inline T *getFromVoidPointer(void *P) { return static_cast<T *>(P); }
 
@@ -62,7 +62,7 @@ template <typename T> struct PointerLikeTypeTraits<T *> {
       detail::ConstantLog2<alignof(T)>::value;
 };
 
-template <> struct PointerLikeTypeTraits<void *> {
+template <> struct LLVM_CLASS_ABI PointerLikeTypeTraits<void *> {
   static inline void *getAsVoidPointer(void *P) { return P; }
   static inline void *getFromVoidPointer(void *P) { return P; }
 
@@ -77,7 +77,7 @@ template <> struct PointerLikeTypeTraits<void *> {
 };
 
 // Provide PointerLikeTypeTraits for const things.
-template <typename T> struct PointerLikeTypeTraits<const T> {
+template <typename T> struct LLVM_CLASS_ABI PointerLikeTypeTraits<const T> {
   typedef PointerLikeTypeTraits<T> NonConst;
 
   static inline const void *getAsVoidPointer(const T P) {
@@ -90,7 +90,7 @@ template <typename T> struct PointerLikeTypeTraits<const T> {
 };
 
 // Provide PointerLikeTypeTraits for const pointers.
-template <typename T> struct PointerLikeTypeTraits<const T *> {
+template <typename T> struct LLVM_CLASS_ABI PointerLikeTypeTraits<const T *> {
   typedef PointerLikeTypeTraits<T *> NonConst;
 
   static inline const void *getAsVoidPointer(const T *P) {
@@ -103,7 +103,7 @@ template <typename T> struct PointerLikeTypeTraits<const T *> {
 };
 
 // Provide PointerLikeTypeTraits for uintptr_t.
-template <> struct PointerLikeTypeTraits<uintptr_t> {
+template <> struct LLVM_CLASS_ABI PointerLikeTypeTraits<uintptr_t> {
   static inline void *getAsVoidPointer(uintptr_t P) {
     return reinterpret_cast<void *>(P);
   }
@@ -123,7 +123,7 @@ template <> struct PointerLikeTypeTraits<uintptr_t> {
 /// customized form of this template explicitly with higher alignment, and
 /// potentially use alignment attributes on functions to satisfy that.
 template <int Alignment, typename FunctionPointerT>
-struct FunctionPointerLikeTypeTraits {
+struct LLVM_CLASS_ABI FunctionPointerLikeTypeTraits {
   static constexpr int NumLowBitsAvailable =
       detail::ConstantLog2<Alignment>::value;
   static inline void *getAsVoidPointer(FunctionPointerT P) {
@@ -145,7 +145,7 @@ struct FunctionPointerLikeTypeTraits {
 /// with weird unaligned function pointers won't work. But all practical systems
 /// we support satisfy this requirement.
 template <typename ReturnT, typename... ParamTs>
-struct PointerLikeTypeTraits<ReturnT (*)(ParamTs...)>
+struct LLVM_CLASS_ABI PointerLikeTypeTraits<ReturnT (*)(ParamTs...)>
     : FunctionPointerLikeTypeTraits<4, ReturnT (*)(ParamTs...)> {};
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/Support/PrettyStackTrace.h b/llvm/include/llvm/Support/PrettyStackTrace.h
index ac25cffde051c9b..ebe2608eee55462 100644
--- a/llvm/include/llvm/Support/PrettyStackTrace.h
+++ b/llvm/include/llvm/Support/PrettyStackTrace.h
@@ -24,7 +24,7 @@ namespace llvm {
   /// Enables dumping a "pretty" stack trace when the program crashes.
   ///
   /// \see PrettyStackTraceEntry
-  void EnablePrettyStackTrace();
+  LLVM_FUNC_ABI void EnablePrettyStackTrace();
 
   /// Enables (or disables) dumping a "pretty" stack trace when the user sends
   /// SIGINFO or SIGUSR1 to the current process.
@@ -35,22 +35,22 @@ namespace llvm {
   ///
   /// \see EnablePrettyStackTrace
   /// \see PrettyStackTraceEntry
-  void EnablePrettyStackTraceOnSigInfoForThisThread(bool ShouldEnable = true);
+  LLVM_FUNC_ABI void EnablePrettyStackTraceOnSigInfoForThisThread(bool ShouldEnable = true);
 
   /// Replaces the generic bug report message that is output upon
   /// a crash.
-  void setBugReportMsg(const char *Msg);
+  LLVM_FUNC_ABI void setBugReportMsg(const char *Msg);
 
   /// Get the bug report message that will be output upon a crash.
-  const char *getBugReportMsg();
+  LLVM_FUNC_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 {
-    friend PrettyStackTraceEntry *ReverseStackTrace(PrettyStackTraceEntry *);
+  class LLVM_CLASS_ABI PrettyStackTraceEntry {
+    friend LLVM_FUNC_ABI PrettyStackTraceEntry *ReverseStackTrace(PrettyStackTraceEntry *);
 
     PrettyStackTraceEntry *NextEntry;
     PrettyStackTraceEntry(const PrettyStackTraceEntry &) = delete;
@@ -69,7 +69,7 @@ namespace llvm {
   /// 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_CLASS_ABI PrettyStackTraceString : public PrettyStackTraceEntry {
     const char *Str;
   public:
     PrettyStackTraceString(const char *str) : Str(str) {}
@@ -79,7 +79,7 @@ namespace llvm {
   /// PrettyStackTraceFormat - This object prints a string (which may use
   /// printf-style formatting but should not contain newlines) to the stream
   /// as the stack trace when a crash occurs.
-  class PrettyStackTraceFormat : public PrettyStackTraceEntry {
+  class LLVM_CLASS_ABI PrettyStackTraceFormat : public PrettyStackTraceEntry {
     llvm::SmallVector<char, 32> Str;
   public:
     PrettyStackTraceFormat(const char *Format, ...);
@@ -88,7 +88,7 @@ namespace llvm {
 
   /// 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_CLASS_ABI PrettyStackTraceProgram : public PrettyStackTraceEntry {
     int ArgC;
     const char *const *ArgV;
   public:
@@ -100,7 +100,7 @@ namespace llvm {
   };
 
   /// Returns the topmost element of the "pretty" stack state.
-  const void *SavePrettyStackState();
+  LLVM_FUNC_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 +109,7 @@ namespace llvm {
   /// 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_FUNC_ABI void RestorePrettyStackState(const void *State);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Support/Printable.h b/llvm/include/llvm/Support/Printable.h
index 12e2129c637d495..3cec33a417471b6 100644
--- a/llvm/include/llvm/Support/Printable.h
+++ b/llvm/include/llvm/Support/Printable.h
@@ -36,7 +36,7 @@ class raw_ostream;
 /// leads to operator << being ambiguous as function has matching constructors
 /// in some STL versions. I have seen the problem on gcc 4.6 libstdc++ and
 /// microsoft STL.
-class Printable {
+class LLVM_CLASS_ABI Printable {
 public:
   std::function<void(raw_ostream &OS)> Print;
   Printable(std::function<void(raw_ostream &OS)> Print)
diff --git a/llvm/include/llvm/Support/Process.h b/llvm/include/llvm/Support/Process.h
index 2e2d0a1595511fb..5102ee63c548c45 100644
--- a/llvm/include/llvm/Support/Process.h
+++ b/llvm/include/llvm/Support/Process.h
@@ -41,7 +41,7 @@ namespace sys {
 
 /// A collection of legacy interfaces for querying information about the
 /// current executing process.
-class Process {
+class LLVM_CLASS_ABI Process {
 public:
   using Pid = int32_t;
 
diff --git a/llvm/include/llvm/Support/Program.h b/llvm/include/llvm/Support/Program.h
index c7a541e46e8ba99..480407cbdac7ec3 100644
--- a/llvm/include/llvm/Support/Program.h
+++ b/llvm/include/llvm/Support/Program.h
@@ -44,7 +44,7 @@ namespace sys {
 #endif
 
   /// This struct encapsulates information about a process.
-  struct ProcessInfo {
+  struct LLVM_CLASS_ABI ProcessInfo {
     enum : procid_t { InvalidPid = 0 };
 
     procid_t Pid;      /// The process identifier.
@@ -57,7 +57,7 @@ namespace sys {
   };
 
   /// This struct encapsulates information about a process execution.
-  struct ProcessStatistics {
+  struct LLVM_CLASS_ABI ProcessStatistics {
     std::chrono::microseconds TotalTime;
     std::chrono::microseconds UserTime;
     uint64_t PeakMemory = 0; ///< Maximum resident set size in KiB.
@@ -76,20 +76,20 @@ namespace sys {
   ///
   /// \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_FUNC_ABI ErrorOr<std::string>
   findProgramByName(StringRef Name, ArrayRef<StringRef> Paths = {});
 
   // These functions change the specified standard stream (stdin or stdout) mode
   // based on the Flags. They return errc::success if the specified stream was
   // changed. Otherwise, a platform dependent error is returned.
-  std::error_code ChangeStdinMode(fs::OpenFlags Flags);
-  std::error_code ChangeStdoutMode(fs::OpenFlags Flags);
+  LLVM_FUNC_ABI std::error_code ChangeStdinMode(fs::OpenFlags Flags);
+  LLVM_FUNC_ABI std::error_code ChangeStdoutMode(fs::OpenFlags Flags);
 
   // 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();
-  std::error_code ChangeStdoutToBinary();
+  LLVM_FUNC_ABI std::error_code ChangeStdinToBinary();
+  LLVM_FUNC_ABI std::error_code ChangeStdoutToBinary();
 
   /// This function executes the program using the arguments provided.  The
   /// invoked program will inherit the stdin, stdout, and stderr file
@@ -102,7 +102,7 @@ namespace sys {
   /// 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
-  int ExecuteAndWait(
+  LLVM_FUNC_ABI int ExecuteAndWait(
       StringRef Program, ///< Path of the program to be executed. It is
       ///< presumed this is the result of the findProgramByName method.
       ArrayRef<StringRef> Args, ///< An array of strings that are passed to the
@@ -147,7 +147,7 @@ namespace sys {
   /// \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_FUNC_ABI ProcessInfo ExecuteNoWait(StringRef Program, ArrayRef<StringRef> Args,
                             std::optional<ArrayRef<StringRef>> Env,
                             ArrayRef<std::optional<StringRef>> Redirects = {},
                             unsigned MemoryLimit = 0,
@@ -157,12 +157,12 @@ namespace sys {
 
   /// Return true if the given arguments fit within system-specific
   /// argument length limits.
-  bool commandLineFitsWithinSystemLimits(StringRef Program,
+  LLVM_FUNC_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_FUNC_ABI bool commandLineFitsWithinSystemLimits(StringRef Program,
                                          ArrayRef<const char *> Args);
 
   /// File encoding options when writing contents that a non-UTF8 tool will
@@ -195,7 +195,7 @@ namespace sys {
   /// 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_FUNC_ABI std::error_code
   writeFileWithEncoding(StringRef FileName, StringRef Contents,
                         WindowsEncodingMethod Encoding = WEM_UTF8);
 
@@ -206,7 +206,7 @@ namespace sys {
   /// \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
+  LLVM_FUNC_ABI ProcessInfo
   Wait(const ProcessInfo &PI, ///< The child process that should be waited on.
        std::optional<unsigned> SecondsToWait, ///< If std::nullopt, waits until
        ///< child has terminated.
@@ -230,7 +230,7 @@ namespace sys {
   );
 
   /// Print a command argument, and optionally quote it.
-  void printArg(llvm::raw_ostream &OS, StringRef Arg, bool Quote);
+  LLVM_FUNC_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
index 5ff943af96e0eec..088f336d3a8b818 100644
--- a/llvm/include/llvm/Support/RISCVAttributeParser.h
+++ b/llvm/include/llvm/Support/RISCVAttributeParser.h
@@ -14,7 +14,7 @@
 #include "llvm/Support/RISCVAttributes.h"
 
 namespace llvm {
-class RISCVAttributeParser : public ELFAttributeParser {
+class LLVM_CLASS_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
index 781e5ff383ad448..0e594cd15596297 100644
--- a/llvm/include/llvm/Support/RISCVAttributes.h
+++ b/llvm/include/llvm/Support/RISCVAttributes.h
@@ -23,7 +23,7 @@
 namespace llvm {
 namespace RISCVAttrs {
 
-const TagNameMap &getRISCVAttributeTags();
+LLVM_FUNC_ABI const TagNameMap &getRISCVAttributeTags();
 
 enum AttrType : unsigned {
   // Attribute types in ELF/.riscv.attributes.
diff --git a/llvm/include/llvm/Support/RISCVISAInfo.h b/llvm/include/llvm/Support/RISCVISAInfo.h
index 9870bfc2bcf30d4..7859a69885ac558 100644
--- a/llvm/include/llvm/Support/RISCVISAInfo.h
+++ b/llvm/include/llvm/Support/RISCVISAInfo.h
@@ -18,12 +18,12 @@
 #include <vector>
 
 namespace llvm {
-struct RISCVExtensionInfo {
+struct LLVM_CLASS_ABI RISCVExtensionInfo {
   unsigned MajorVersion;
   unsigned MinorVersion;
 };
 
-class RISCVISAInfo {
+class LLVM_CLASS_ABI RISCVISAInfo {
 public:
   RISCVISAInfo(const RISCVISAInfo &) = delete;
   RISCVISAInfo &operator=(const RISCVISAInfo &) = delete;
diff --git a/llvm/include/llvm/Support/RWMutex.h b/llvm/include/llvm/Support/RWMutex.h
index e6309fccbf7bac4..eeb79ed56fe11aa 100644
--- a/llvm/include/llvm/Support/RWMutex.h
+++ b/llvm/include/llvm/Support/RWMutex.h
@@ -92,7 +92,7 @@ class RWMutexImpl {
 /// SmartMutex - An R/W mutex with a compile time constant parameter that
 /// indicates whether this mutex should become a no-op when we're not
 /// running in multithreaded mode.
-template <bool mt_only> class SmartRWMutex {
+template <bool mt_only> class LLVM_CLASS_ABI SmartRWMutex {
 #if !defined(LLVM_USE_RW_MUTEX_IMPL)
   std::shared_mutex impl;
 #else
diff --git a/llvm/include/llvm/Support/RandomNumberGenerator.h b/llvm/include/llvm/Support/RandomNumberGenerator.h
index 55d6876cc5e41f4..7b6ca3942ff28c2 100644
--- a/llvm/include/llvm/Support/RandomNumberGenerator.h
+++ b/llvm/include/llvm/Support/RandomNumberGenerator.h
@@ -29,7 +29,7 @@ class StringRef;
 /// 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_CLASS_ABI RandomNumberGenerator {
 
   // 64-bit Mersenne Twister by Matsumoto and Nishimura, 2000
   // http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine
@@ -63,7 +63,7 @@ class RandomNumberGenerator {
 };
 
 // Get random vector of specified size
-std::error_code getRandomBytes(void *Buffer, size_t Size);
+LLVM_FUNC_ABI std::error_code getRandomBytes(void *Buffer, size_t Size);
 }
 
 #endif
diff --git a/llvm/include/llvm/Support/Recycler.h b/llvm/include/llvm/Support/Recycler.h
index 45ff199f4a0c25f..303e4cffd61c11c 100644
--- a/llvm/include/llvm/Support/Recycler.h
+++ b/llvm/include/llvm/Support/Recycler.h
@@ -25,14 +25,14 @@ namespace llvm {
 /// PrintRecyclingAllocatorStats - Helper for RecyclingAllocator for
 /// printing statistics.
 ///
-void PrintRecyclerStats(size_t Size, size_t Align, size_t FreeListSize);
+LLVM_FUNC_ABI void PrintRecyclerStats(size_t Size, size_t Align, size_t FreeListSize);
 
 /// Recycler - This class manages a linked-list of deallocated nodes
 /// and facilitates reusing deallocated memory in place of allocating
 /// new memory.
 ///
 template <class T, size_t Size = sizeof(T), size_t Align = alignof(T)>
-class Recycler {
+class LLVM_CLASS_ABI Recycler {
   struct FreeNode {
     FreeNode *Next;
   };
diff --git a/llvm/include/llvm/Support/RecyclingAllocator.h b/llvm/include/llvm/Support/RecyclingAllocator.h
index 6be387f38b3555d..f3af711d1570cbf 100644
--- a/llvm/include/llvm/Support/RecyclingAllocator.h
+++ b/llvm/include/llvm/Support/RecyclingAllocator.h
@@ -24,7 +24,7 @@ namespace llvm {
 ///
 template <class AllocatorType, class T, size_t Size = sizeof(T),
           size_t Align = alignof(T)>
-class RecyclingAllocator {
+class LLVM_CLASS_ABI RecyclingAllocator {
 private:
   /// Base - Implementation details.
   ///
diff --git a/llvm/include/llvm/Support/Regex.h b/llvm/include/llvm/Support/Regex.h
index 0cac08055936c9d..8efe176d2d70c24 100644
--- a/llvm/include/llvm/Support/Regex.h
+++ b/llvm/include/llvm/Support/Regex.h
@@ -26,7 +26,7 @@ namespace llvm {
   class StringRef;
   template<typename T> class SmallVectorImpl;
 
-  class Regex {
+  class LLVM_CLASS_ABI Regex {
   public:
     enum RegexFlags : unsigned {
       NoFlags = 0,
diff --git a/llvm/include/llvm/Support/Registry.h b/llvm/include/llvm/Support/Registry.h
index 5bb6a254a47f4c3..747c63fa2fb1e0a 100644
--- a/llvm/include/llvm/Support/Registry.h
+++ b/llvm/include/llvm/Support/Registry.h
@@ -24,7 +24,7 @@ namespace llvm {
   /// A simple registry entry which provides only a name, description, and
   /// no-argument constructor.
   template <typename T>
-  class SimpleRegistryEntry {
+  class LLVM_CLASS_ABI SimpleRegistryEntry {
     StringRef Name, Desc;
     std::unique_ptr<T> (*Ctor)();
 
@@ -41,7 +41,7 @@ namespace llvm {
   /// pluggable components (like targets or garbage collectors) "just work" when
   /// linked with an executable.
   template <typename T>
-  class Registry {
+  class LLVM_CLASS_ABI Registry {
   public:
     typedef T type;
     typedef SimpleRegistryEntry<T> entry;
diff --git a/llvm/include/llvm/Support/SHA1.h b/llvm/include/llvm/Support/SHA1.h
index aaa2c914756e90d..0e6dcd40fc293cc 100644
--- a/llvm/include/llvm/Support/SHA1.h
+++ b/llvm/include/llvm/Support/SHA1.h
@@ -24,7 +24,7 @@ template <typename T> class ArrayRef;
 class StringRef;
 
 /// A class that wrap the SHA1 algorithm.
-class SHA1 {
+class LLVM_CLASS_ABI SHA1 {
 public:
   SHA1() { init(); }
 
diff --git a/llvm/include/llvm/Support/SHA256.h b/llvm/include/llvm/Support/SHA256.h
index 449effa0daf893e..f4197e843792942 100644
--- a/llvm/include/llvm/Support/SHA256.h
+++ b/llvm/include/llvm/Support/SHA256.h
@@ -31,7 +31,7 @@ namespace llvm {
 template <typename T> class ArrayRef;
 class StringRef;
 
-class SHA256 {
+class LLVM_CLASS_ABI SHA256 {
 public:
   explicit SHA256() { init(); }
 
diff --git a/llvm/include/llvm/Support/SMLoc.h b/llvm/include/llvm/Support/SMLoc.h
index d71258ebf993924..27252329df2a095 100644
--- a/llvm/include/llvm/Support/SMLoc.h
+++ b/llvm/include/llvm/Support/SMLoc.h
@@ -21,7 +21,7 @@
 namespace llvm {
 
 /// Represents a location in source code.
-class SMLoc {
+class LLVM_CLASS_ABI SMLoc {
   const char *Ptr = nullptr;
 
 public:
@@ -46,7 +46,7 @@ class SMLoc {
 /// SMRange is implemented using a half-open range, as is the convention in C++.
 /// In the string "abc", the range [1,3) represents the substring "bc", and the
 /// range [2,2) represents an empty range between the characters "b" and "c".
-class SMRange {
+class LLVM_CLASS_ABI SMRange {
 public:
   SMLoc Start, End;
 
diff --git a/llvm/include/llvm/Support/SMTAPI.h b/llvm/include/llvm/Support/SMTAPI.h
index 970df1653adf2fc..16aa5998b61add6 100644
--- a/llvm/include/llvm/Support/SMTAPI.h
+++ b/llvm/include/llvm/Support/SMTAPI.h
@@ -24,7 +24,7 @@
 namespace llvm {
 
 /// Generic base class for SMT sorts
-class SMTSort {
+class LLVM_CLASS_ABI SMTSort {
 public:
   SMTSort() = default;
   virtual ~SMTSort() = default;
@@ -98,7 +98,7 @@ class SMTSort {
 using SMTSortRef = const SMTSort *;
 
 /// Generic base class for SMT exprs
-class SMTExpr {
+class LLVM_CLASS_ABI SMTExpr {
 public:
   SMTExpr() = default;
   virtual ~SMTExpr() = default;
@@ -134,7 +134,7 @@ using SMTExprRef = const SMTExpr *;
 /// This class is responsible for wrapping all sorts and expression generation,
 /// through the mk* methods. It also provides methods to create SMT expressions
 /// straight from clang's AST, through the from* methods.
-class SMTSolver {
+class LLVM_CLASS_ABI SMTSolver {
 public:
   SMTSolver() = default;
   virtual ~SMTSolver() = default;
@@ -441,7 +441,7 @@ class SMTSolver {
 using SMTSolverRef = std::shared_ptr<SMTSolver>;
 
 /// Convenience method to create and Z3Solver object
-SMTSolverRef CreateZ3Solver();
+LLVM_FUNC_ABI SMTSolverRef CreateZ3Solver();
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Support/SaveAndRestore.h b/llvm/include/llvm/Support/SaveAndRestore.h
index a137b04fceae3c0..9010e2017198eb3 100644
--- a/llvm/include/llvm/Support/SaveAndRestore.h
+++ b/llvm/include/llvm/Support/SaveAndRestore.h
@@ -21,7 +21,7 @@
 namespace llvm {
 
 /// A utility class that uses RAII to save and restore the value of a variable.
-template <typename T> struct SaveAndRestore {
+template <typename T> struct LLVM_CLASS_ABI SaveAndRestore {
   SaveAndRestore(T &X) : X(X), OldValue(X) {}
   SaveAndRestore(T &X, const T &NewValue) : X(X), OldValue(X) { X = NewValue; }
   SaveAndRestore(T &X, T &&NewValue) : X(X), OldValue(std::move(X)) {
diff --git a/llvm/include/llvm/Support/ScaledNumber.h b/llvm/include/llvm/Support/ScaledNumber.h
index 4804f58c7a24ac3..bae87cdabdc6e9f 100644
--- a/llvm/include/llvm/Support/ScaledNumber.h
+++ b/llvm/include/llvm/Support/ScaledNumber.h
@@ -106,7 +106,7 @@ inline std::pair<uint64_t, int16_t> getAdjusted64(uint64_t Digits,
 /// 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_FUNC_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.
 ///
@@ -136,14 +136,14 @@ inline std::pair<uint64_t, int16_t> getProduct64(uint64_t LHS, uint64_t RHS) {
 /// 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_FUNC_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_FUNC_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.
 ///
@@ -243,7 +243,7 @@ template <class DigitsT> int32_t getLgCeiling(DigitsT Digits, int16_t Scale) {
 /// 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_FUNC_ABI int compareImpl(uint64_t L, uint64_t R, int ScaleDiff);
 
 /// Compare two scaled numbers.
 ///
@@ -418,7 +418,7 @@ inline std::pair<uint64_t, int16_t> getDifference64(uint64_t LDigits,
 namespace llvm {
 
 class raw_ostream;
-class ScaledNumberBase {
+class LLVM_CLASS_ABI ScaledNumberBase {
 public:
   static constexpr int DefaultPrecision = 10;
 
@@ -491,7 +491,7 @@ class ScaledNumberBase {
 ///  1. Turn this into a wrapper around \a APFloat.
 ///  2. Share the algorithm implementations with \a APFloat.
 ///  3. Allow \a ScaledNumber to represent a signed number.
-template <class DigitsT> class ScaledNumber : ScaledNumberBase {
+template <class DigitsT> class LLVM_CLASS_ABI ScaledNumber : ScaledNumberBase {
 public:
   static_assert(!std::numeric_limits<DigitsT>::is_signed,
                 "only unsigned floats supported");
diff --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h
index a5b9c0308357ebd..053fc95735ae286 100644
--- a/llvm/include/llvm/Support/ScopedPrinter.h
+++ b/llvm/include/llvm/Support/ScopedPrinter.h
@@ -22,7 +22,7 @@
 
 namespace llvm {
 
-template <typename T> struct EnumEntry {
+template <typename T> struct LLVM_CLASS_ABI EnumEntry {
   StringRef Name;
   // While Name suffices in most of the cases, in certain cases
   // GNU style and LLVM style of ELFDumper do not
@@ -38,7 +38,7 @@ template <typename T> struct EnumEntry {
   constexpr EnumEntry(StringRef N, T V) : Name(N), AltName(N), Value(V) {}
 };
 
-struct HexNumber {
+struct LLVM_CLASS_ABI HexNumber {
   // To avoid sign-extension we have to explicitly cast to the appropriate
   // unsigned type. The overloads are here so that every type that is implicitly
   // convertible to an integer (including enums and endian helpers) can be used
@@ -58,7 +58,7 @@ struct HexNumber {
   uint64_t Value;
 };
 
-struct FlagEntry {
+struct LLVM_CLASS_ABI FlagEntry {
   FlagEntry(StringRef Name, char Value)
       : Name(Name), Value(static_cast<unsigned char>(Value)) {}
   FlagEntry(StringRef Name, signed char Value)
@@ -81,7 +81,7 @@ struct FlagEntry {
   uint64_t Value;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const HexNumber &Value);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const HexNumber &Value);
 
 template <class T> std::string to_string(const T &Value) {
   std::string number;
@@ -98,7 +98,7 @@ std::string enumToString(T Value, ArrayRef<EnumEntry<TEnum>> EnumValues) {
   return utohexstr(Value, true);
 }
 
-class ScopedPrinter {
+class LLVM_CLASS_ABI ScopedPrinter {
 public:
   enum class ScopedPrinterKind {
     Base,
@@ -542,7 +542,7 @@ ScopedPrinter::printHex<support::ulittle16_t>(StringRef Label,
 
 struct DelimitedScope;
 
-class JSONScopedPrinter : public ScopedPrinter {
+class LLVM_CLASS_ABI JSONScopedPrinter : public ScopedPrinter {
 private:
   enum class Scope {
     Array,
@@ -839,7 +839,7 @@ class JSONScopedPrinter : public ScopedPrinter {
   }
 };
 
-struct DelimitedScope {
+struct LLVM_CLASS_ABI DelimitedScope {
   DelimitedScope(ScopedPrinter &W) : W(&W) {}
   DelimitedScope() : W(nullptr) {}
   virtual ~DelimitedScope() = default;
@@ -847,7 +847,7 @@ struct DelimitedScope {
   ScopedPrinter *W;
 };
 
-struct DictScope : DelimitedScope {
+struct LLVM_CLASS_ABI DictScope : DelimitedScope {
   explicit DictScope() = default;
   explicit DictScope(ScopedPrinter &W) : DelimitedScope(W) { W.objectBegin(); }
 
@@ -866,7 +866,7 @@ struct DictScope : DelimitedScope {
   }
 };
 
-struct ListScope : DelimitedScope {
+struct LLVM_CLASS_ABI ListScope : DelimitedScope {
   explicit ListScope() = default;
   explicit ListScope(ScopedPrinter &W) : DelimitedScope(W) { W.arrayBegin(); }
 
diff --git a/llvm/include/llvm/Support/Signals.h b/llvm/include/llvm/Support/Signals.h
index 87c5d389ef48f3f..609ec544892f05e 100644
--- a/llvm/include/llvm/Support/Signals.h
+++ b/llvm/include/llvm/Support/Signals.h
@@ -26,16 +26,16 @@ namespace sys {
 
   /// This function runs all the registered interrupt handlers, including the
   /// removal of files registered by RemoveFileOnSignal.
-  void RunInterruptHandlers();
+  LLVM_FUNC_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_FUNC_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.
-  void DontRemoveFileOnSignal(StringRef Filename);
+  LLVM_FUNC_ABI void DontRemoveFileOnSignal(StringRef Filename);
 
   /// When an error signal (such as SIGABRT or SIGSEGV) is delivered to the
   /// process, print a stack trace and then exit.
@@ -45,26 +45,26 @@ namespace sys {
   ///        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_FUNC_ABI void PrintStackTraceOnErrorSignal(StringRef Argv0,
                                     bool DisableCrashReporting = false);
 
   /// Disable all system dialog boxes that appear when the process crashes.
-  void DisableSystemDialogsOnCrash();
+  LLVM_FUNC_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_FUNC_ABI void PrintStackTrace(raw_ostream &OS, int Depth = 0);
 
   // Run all registered signal handlers.
-  void RunSignalHandlers();
+  LLVM_FUNC_ABI void RunSignalHandlers();
 
   using SignalHandlerCallback = void (*)(void *);
 
   /// 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_FUNC_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
@@ -75,7 +75,7 @@ namespace sys {
   /// 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_FUNC_ABI void SetInterruptFunction(void (*IF)());
 
   /// Registers a function to be called when an "info" signal is delivered to
   /// the process.
@@ -87,7 +87,7 @@ namespace sys {
   /// functions.  An null function pointer disables the current installed
   /// function.  Note also that the handler may be executed on a different
   /// thread on some platforms.
-  void SetInfoSignalFunction(void (*Handler)());
+  LLVM_FUNC_ABI void SetInfoSignalFunction(void (*Handler)());
 
   /// Registers a function to be called in a "one-shot" manner when a pipe
   /// signal is delivered to the process (i.e., on a failed write to a pipe).
@@ -103,11 +103,11 @@ namespace sys {
   /// functions.  A null handler pointer disables the current installed
   /// function.  Note also that the handler may be executed on a
   /// different thread on some platforms.
-  void SetOneShotPipeSignalFunction(void (*Handler)());
+  LLVM_FUNC_ABI void SetOneShotPipeSignalFunction(void (*Handler)());
 
   /// On Unix systems and Windows, this function exits with an "IO error" exit
   /// code.
-  void DefaultOneShotPipeSignalHandler();
+  LLVM_FUNC_ABI void DefaultOneShotPipeSignalHandler();
 
 #ifdef _WIN32
   /// Windows does not support signals and this handler must be called manually.
@@ -121,9 +121,9 @@ namespace sys {
   /// - create a core/mini dump of the exception context whenever possible
   /// Context is a system-specific failure context: it is the signal type on
   /// Unix; the ExceptionContext on Windows.
-  void CleanupOnSignal(uintptr_t Context);
+  LLVM_FUNC_ABI void CleanupOnSignal(uintptr_t Context);
 
-  void unregisterHandlers();
+  LLVM_FUNC_ABI void unregisterHandlers();
 } // End sys namespace
 } // End llvm namespace
 
diff --git a/llvm/include/llvm/Support/Signposts.h b/llvm/include/llvm/Support/Signposts.h
index 8a2d7a639bdd712..e078c868a3438f1 100644
--- a/llvm/include/llvm/Support/Signposts.h
+++ b/llvm/include/llvm/Support/Signposts.h
@@ -25,7 +25,7 @@ class StringRef;
 
 /// Manages the emission of signposts into the recording method supported by
 /// the OS.
-class SignpostEmitter {
+class LLVM_CLASS_ABI SignpostEmitter {
   std::unique_ptr<SignpostEmitterImpl> Impl;
 
 public:
diff --git a/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h b/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h
index a730ce8cce223b9..7bc9cec289f60b1 100644
--- a/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h
+++ b/llvm/include/llvm/Support/SmallVectorMemoryBuffer.h
@@ -27,7 +27,7 @@ namespace llvm {
 /// 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_CLASS_ABI SmallVectorMemoryBuffer : public MemoryBuffer {
 public:
   /// Construct a SmallVectorMemoryBuffer from the given SmallVector r-value.
   SmallVectorMemoryBuffer(SmallVectorImpl<char> &&SV,
diff --git a/llvm/include/llvm/Support/SourceMgr.h b/llvm/include/llvm/Support/SourceMgr.h
index b01ece4840090cf..ef587f861d86518 100644
--- a/llvm/include/llvm/Support/SourceMgr.h
+++ b/llvm/include/llvm/Support/SourceMgr.h
@@ -29,7 +29,7 @@ class SMFixIt;
 
 /// This owns the files read by a parser, handles include stacks,
 /// and handles diagnostic wrangling.
-class SourceMgr {
+class LLVM_CLASS_ABI SourceMgr {
 public:
   enum DiagKind {
     DK_Error,
@@ -254,7 +254,7 @@ class SourceMgr {
 };
 
 /// Represents a single fixit, a replacement of one range of text with another.
-class SMFixIt {
+class LLVM_CLASS_ABI SMFixIt {
   SMRange Range;
 
   std::string Text;
@@ -279,7 +279,7 @@ class SMFixIt {
 
 /// Instances of this class encapsulate one diagnostic report, allowing
 /// printing to a raw_ostream as a caret diagnostic.
-class SMDiagnostic {
+class LLVM_CLASS_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
index 77b0af06fb588ba..77d289f501b6cb1 100644
--- a/llvm/include/llvm/Support/SpecialCaseList.h
+++ b/llvm/include/llvm/Support/SpecialCaseList.h
@@ -67,7 +67,7 @@ namespace vfs {
 class FileSystem;
 }
 
-class SpecialCaseList {
+class LLVM_CLASS_ABI SpecialCaseList {
 public:
   /// Parses the special case list entries from files. On failure, returns
   /// 0 and writes an error message to string.
diff --git a/llvm/include/llvm/Support/StringSaver.h b/llvm/include/llvm/Support/StringSaver.h
index 6d911c9b65cb5f7..9766814a149a26c 100644
--- a/llvm/include/llvm/Support/StringSaver.h
+++ b/llvm/include/llvm/Support/StringSaver.h
@@ -19,7 +19,7 @@ namespace llvm {
 
 /// Saves strings in the provided stable storage and returns a
 /// StringRef with a stable character pointer.
-class StringSaver final {
+class LLVM_CLASS_ABI StringSaver final {
   BumpPtrAllocator &Alloc;
 
 public:
@@ -42,7 +42,7 @@ class StringSaver final {
 ///
 /// Compared to StringPool, it performs fewer allocations but doesn't support
 /// refcounting/deletion.
-class UniqueStringSaver final {
+class LLVM_CLASS_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
index 7ab495e78e73b0d..7ad7d04d3ba426a 100644
--- a/llvm/include/llvm/Support/SuffixTree.h
+++ b/llvm/include/llvm/Support/SuffixTree.h
@@ -38,7 +38,7 @@
 #include "llvm/Support/SuffixTreeNode.h"
 
 namespace llvm {
-class SuffixTree {
+class LLVM_CLASS_ABI SuffixTree {
 public:
   /// Each element is an integer representing an instruction in the module.
   ArrayRef<unsigned> Str;
diff --git a/llvm/include/llvm/Support/SuffixTreeNode.h b/llvm/include/llvm/Support/SuffixTreeNode.h
index 96c1588782a2b02..e63dcb7494b6349 100644
--- a/llvm/include/llvm/Support/SuffixTreeNode.h
+++ b/llvm/include/llvm/Support/SuffixTreeNode.h
@@ -31,7 +31,7 @@
 namespace llvm {
 
 /// A node in a suffix tree which represents a substring or suffix.
-struct SuffixTreeNode {
+struct LLVM_CLASS_ABI SuffixTreeNode {
 public:
   /// Represents an undefined index in the suffix tree.
   static const unsigned EmptyIdx = -1;
@@ -72,7 +72,7 @@ struct SuffixTreeNode {
 };
 
 // A node with two or more children, or the root.
-struct SuffixTreeInternalNode : SuffixTreeNode {
+struct LLVM_CLASS_ABI SuffixTreeInternalNode : SuffixTreeNode {
 private:
   /// The end index of this node's substring in the main string.
   ///
@@ -136,7 +136,7 @@ struct SuffixTreeInternalNode : SuffixTreeNode {
 };
 
 // A node representing a suffix.
-struct SuffixTreeLeafNode : SuffixTreeNode {
+struct LLVM_CLASS_ABI SuffixTreeLeafNode : SuffixTreeNode {
 private:
   /// The start index of the suffix represented by this leaf.
   unsigned SuffixIdx = EmptyIdx;
diff --git a/llvm/include/llvm/Support/SystemUtils.h b/llvm/include/llvm/Support/SystemUtils.h
index bba1d34112f7a80..b68a86eaf8b04a4 100644
--- a/llvm/include/llvm/Support/SystemUtils.h
+++ b/llvm/include/llvm/Support/SystemUtils.h
@@ -23,7 +23,7 @@ class raw_ostream;
 /// 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
-bool CheckBitcodeOutputToConsole(
+LLVM_FUNC_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
index 706324a603da502..50b06a486750af0 100644
--- a/llvm/include/llvm/Support/TarWriter.h
+++ b/llvm/include/llvm/Support/TarWriter.h
@@ -16,7 +16,7 @@
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
-class TarWriter {
+class LLVM_CLASS_ABI TarWriter {
 public:
   static Expected<std::unique_ptr<TarWriter>> create(StringRef OutputPath,
                                                      StringRef BaseDir);
diff --git a/llvm/include/llvm/Support/ThreadPool.h b/llvm/include/llvm/Support/ThreadPool.h
index d25347f0d7d3809..386b2b30007c1fd 100644
--- a/llvm/include/llvm/Support/ThreadPool.h
+++ b/llvm/include/llvm/Support/ThreadPool.h
@@ -50,7 +50,7 @@ class ThreadPoolTaskGroup;
 /// available threads are used up by tasks waiting for a task that has no thread
 /// left to run on (this includes waiting on the returned future). It should be
 /// generally safe to wait() for a group as long as groups do not form a cycle.
-class ThreadPool {
+class LLVM_CLASS_ABI ThreadPool {
 public:
   /// Construct a pool using the hardware strategy \p S for mapping hardware
   /// execution resources (threads, cores, CPUs)
@@ -222,7 +222,7 @@ class ThreadPool {
 /// groups can run on the same threadpool but can be waited for separately.
 /// It is even possible for tasks of one group to submit and wait for tasks
 /// of another group, as long as this does not form a loop.
-class ThreadPoolTaskGroup {
+class LLVM_CLASS_ABI ThreadPoolTaskGroup {
 public:
   /// The ThreadPool argument is the thread pool to forward calls to.
   ThreadPoolTaskGroup(ThreadPool &Pool) : Pool(Pool) {}
diff --git a/llvm/include/llvm/Support/Threading.h b/llvm/include/llvm/Support/Threading.h
index ba6c531ab4db214..cc346c9e360b924 100644
--- a/llvm/include/llvm/Support/Threading.h
+++ b/llvm/include/llvm/Support/Threading.h
@@ -113,7 +113,7 @@ constexpr bool llvm_is_multithreaded() { return LLVM_ENABLE_THREADS; }
   }
 
   /// This tells how a thread pool will be used
-  class ThreadPoolStrategy {
+  class LLVM_CLASS_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
@@ -149,7 +149,7 @@ constexpr bool llvm_is_multithreaded() { return LLVM_ENABLE_THREADS; }
   /// 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.
-  std::optional<ThreadPoolStrategy>
+  LLVM_FUNC_ABI std::optional<ThreadPoolStrategy>
   get_threadpool_strategy(StringRef Num, ThreadPoolStrategy Default = {});
 
   /// Returns a thread strategy for tasks requiring significant memory or other
@@ -202,11 +202,11 @@ constexpr bool llvm_is_multithreaded() { return LLVM_ENABLE_THREADS; }
   /// 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_FUNC_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.
-  uint32_t get_max_thread_name_length();
+  LLVM_FUNC_ABI uint32_t get_max_thread_name_length();
 
   /// Set the name of the current thread.  Setting a thread's name can
   /// be helpful for enabling useful diagnostics under a debugger or when
@@ -214,7 +214,7 @@ constexpr bool llvm_is_multithreaded() { return LLVM_ENABLE_THREADS; }
   /// 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_FUNC_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
@@ -222,20 +222,20 @@ constexpr bool llvm_is_multithreaded() { return LLVM_ENABLE_THREADS; }
   /// 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_FUNC_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_FUNC_ABI llvm::BitVector get_thread_affinity_mask();
 
   /// Returns how many physical CPUs or NUMA groups the system has.
-  unsigned get_cpus();
+  LLVM_FUNC_ABI unsigned get_cpus();
 
   /// Returns how many 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 get_physical_cores();
+  LLVM_FUNC_ABI int get_physical_cores();
 
   enum class ThreadPriority {
     /// Lower the current thread's priority as much as possible. Can be used
@@ -253,7 +253,7 @@ constexpr bool llvm_is_multithreaded() { return LLVM_ENABLE_THREADS; }
     Default = 2,
   };
   enum class SetThreadPriorityResult { FAILURE, SUCCESS };
-  SetThreadPriorityResult set_thread_priority(ThreadPriority Priority);
+  LLVM_FUNC_ABI SetThreadPriorityResult set_thread_priority(ThreadPriority Priority);
 }
 
 #endif
diff --git a/llvm/include/llvm/Support/TimeProfiler.h b/llvm/include/llvm/Support/TimeProfiler.h
index 1305bcf6c0fab5e..782534f625c2b91 100644
--- a/llvm/include/llvm/Support/TimeProfiler.h
+++ b/llvm/include/llvm/Support/TimeProfiler.h
@@ -85,19 +85,19 @@ namespace llvm {
 class raw_pwrite_stream;
 
 struct TimeTraceProfiler;
-TimeTraceProfiler *getTimeTraceProfilerInstance();
+LLVM_FUNC_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_FUNC_ABI void timeTraceProfilerInitialize(unsigned TimeTraceGranularity,
                                  StringRef ProcName);
 
 /// Cleanup the time trace profiler, if it was initialized.
-void timeTraceProfilerCleanup();
+LLVM_FUNC_ABI void timeTraceProfilerCleanup();
 
 /// Finish a time trace profiler running on a worker thread.
-void timeTraceProfilerFinishThread();
+LLVM_FUNC_ABI void timeTraceProfilerFinishThread();
 
 /// Is the time trace profiler enabled, i.e. initialized?
 inline bool timeTraceProfilerEnabled() {
@@ -107,32 +107,32 @@ inline bool timeTraceProfilerEnabled() {
 /// 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_FUNC_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_FUNC_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_FUNC_ABI void timeTraceProfilerBegin(StringRef Name, StringRef Detail);
+LLVM_FUNC_ABI void timeTraceProfilerBegin(StringRef Name,
                             llvm::function_ref<std::string()> Detail);
 
 /// Manually end the last time section.
-void timeTraceProfilerEnd();
+LLVM_FUNC_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
 /// the section; and when it is destroyed, it stops it. If the time profiler
 /// is not initialized, the overhead is a single branch.
-struct TimeTraceScope {
+struct LLVM_CLASS_ABI TimeTraceScope {
 
   TimeTraceScope() = delete;
   TimeTraceScope(const TimeTraceScope &) = delete;
diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h
index 4edf63e42bca67c..d8b07d526ec9b7f 100644
--- a/llvm/include/llvm/Support/Timer.h
+++ b/llvm/include/llvm/Support/Timer.h
@@ -23,7 +23,7 @@ namespace llvm {
 class TimerGroup;
 class raw_ostream;
 
-class TimeRecord {
+class LLVM_CLASS_ABI TimeRecord {
   double WallTime = 0.0;             ///< Wall clock time elapsed in seconds.
   double UserTime = 0.0;             ///< User time elapsed.
   double SystemTime = 0.0;           ///< System time elapsed.
@@ -77,7 +77,7 @@ class TimeRecord {
 /// 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_CLASS_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.
@@ -141,7 +141,7 @@ class Timer {
 /// 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_CLASS_ABI TimeRegion {
   Timer *T;
   TimeRegion(const TimeRegion &) = delete;
 
@@ -161,7 +161,7 @@ class TimeRegion {
 /// 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_CLASS_ABI NamedRegionTimer : public TimeRegion {
   explicit NamedRegionTimer(StringRef Name, StringRef Description,
                             StringRef GroupName,
                             StringRef GroupDescription, bool Enabled = true);
@@ -171,7 +171,7 @@ struct NamedRegionTimer : public TimeRegion {
 /// 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_CLASS_ABI TimerGroup {
   struct PrintRecord {
     TimeRecord Time;
     std::string Name;
@@ -241,7 +241,7 @@ class TimerGroup {
 
 private:
   friend class Timer;
-  friend void PrintStatisticsJSON(raw_ostream &OS);
+  friend LLVM_FUNC_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
index 8bf27c5dff5872a..1aba7106fea02ff 100644
--- a/llvm/include/llvm/Support/ToolOutputFile.h
+++ b/llvm/include/llvm/Support/ToolOutputFile.h
@@ -24,7 +24,7 @@ namespace llvm {
 ///   - The file is automatically deleted if the process is killed.
 ///   - The file is automatically deleted when the ToolOutputFile
 ///     object is destroyed unless the client calls keep().
-class ToolOutputFile {
+class LLVM_CLASS_ABI ToolOutputFile {
   /// This class is declared before the raw_fd_ostream so that it is constructed
   /// before the raw_fd_ostream is constructed and destructed after the
   /// raw_fd_ostream is destructed. It installs cleanups in its constructor and
diff --git a/llvm/include/llvm/Support/TrailingObjects.h b/llvm/include/llvm/Support/TrailingObjects.h
index f8a546b5c85aaae..cd261be54acdb34 100644
--- a/llvm/include/llvm/Support/TrailingObjects.h
+++ b/llvm/include/llvm/Support/TrailingObjects.h
@@ -59,7 +59,7 @@ namespace llvm {
 namespace trailing_objects_internal {
 /// Helper template to calculate the max alignment requirement for a set of
 /// objects.
-template <typename First, typename... Rest> class AlignmentCalcHelper {
+template <typename First, typename... Rest> class LLVM_CLASS_ABI AlignmentCalcHelper {
 private:
   enum {
     FirstAlignment = alignof(First),
@@ -72,13 +72,13 @@ template <typename First, typename... Rest> class AlignmentCalcHelper {
   };
 };
 
-template <typename First> class AlignmentCalcHelper<First> {
+template <typename First> class LLVM_CLASS_ABI AlignmentCalcHelper<First> {
 public:
   enum { Alignment = alignof(First) };
 };
 
 /// The base class for TrailingObjects* classes.
-class TrailingObjectsBase {
+class LLVM_CLASS_ABI TrailingObjectsBase {
 protected:
   /// OverloadToken's purpose is to allow specifying function overloads
   /// for different types, without actually taking the types as
@@ -91,7 +91,7 @@ class TrailingObjectsBase {
 // Just a little helper for transforming a type pack into the same
 // number of a different type. e.g.:
 //   ExtractSecondType<Foo..., int>::type
-template <typename Ty1, typename Ty2> struct ExtractSecondType {
+template <typename Ty1, typename Ty2> struct LLVM_CLASS_ABI ExtractSecondType {
   typedef Ty2 type;
 };
 
@@ -105,14 +105,14 @@ template <typename Ty1, typename Ty2> struct ExtractSecondType {
 
 template <int Align, typename BaseTy, typename TopTrailingObj, typename PrevTy,
           typename... MoreTys>
-class TrailingObjectsImpl {
+class LLVM_CLASS_ABI TrailingObjectsImpl {
   // The main template definition is never used -- the two
   // specializations cover all possibilities.
 };
 
 template <int Align, typename BaseTy, typename TopTrailingObj, typename PrevTy,
           typename NextTy, typename... MoreTys>
-class TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy, NextTy,
+class LLVM_CLASS_ABI TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy, NextTy,
                           MoreTys...>
     : public TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, NextTy,
                                  MoreTys...> {
@@ -187,7 +187,7 @@ class TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy, NextTy,
 // The base case of the TrailingObjectsImpl inheritance recursion,
 // when there's no more trailing types.
 template <int Align, typename BaseTy, typename TopTrailingObj, typename PrevTy>
-class alignas(Align) TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy>
+class LLVM_CLASS_ABI alignas(Align) TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy>
     : public TrailingObjectsBase {
 protected:
   // This is a dummy method, only here so the "using" doesn't fail --
@@ -209,7 +209,7 @@ class alignas(Align) TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy>
 /// See the file comment for details on the usage of the
 /// TrailingObjects type.
 template <typename BaseTy, typename... TrailingTys>
-class TrailingObjects : private trailing_objects_internal::TrailingObjectsImpl<
+class LLVM_CLASS_ABI TrailingObjects : private trailing_objects_internal::TrailingObjectsImpl<
                             trailing_objects_internal::AlignmentCalcHelper<
                                 TrailingTys...>::Alignment,
                             BaseTy, TrailingObjects<BaseTy, TrailingTys...>,
diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
index 9683c82b2278fee..bc7908df0e65865 100644
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -30,10 +30,10 @@ namespace llvm {
 
 /// 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_FUNC_ABI void reportInvalidSizeRequest(const char *Msg);
 
 /// StackOffset holds a fixed and a scalable offset in bytes.
-class StackOffset {
+class LLVM_CLASS_ABI StackOffset {
   int64_t Fixed = 0;
   int64_t Scalable = 0;
 
@@ -88,7 +88,7 @@ class StackOffset {
 namespace details {
 
 // Base class for ElementCount and TypeSize below.
-template <typename LeafTy, typename ValueTy> class FixedOrScalableQuantity {
+template <typename LeafTy, typename ValueTy> class LLVM_CLASS_ABI FixedOrScalableQuantity {
 public:
   using ScalarTy = ValueTy;
 
@@ -276,7 +276,7 @@ template <typename LeafTy, typename ValueTy> class FixedOrScalableQuantity {
 //  - ElementCount::getFixed(1) : A scalar value.
 //  - ElementCount::getFixed(2) : A vector type holding 2 values.
 //  - ElementCount::getScalable(4) : A scalable vector type holding 4 values.
-class ElementCount
+class LLVM_CLASS_ABI ElementCount
     : public details::FixedOrScalableQuantity<ElementCount, unsigned> {
   constexpr ElementCount(ScalarTy MinVal, bool Scalable)
       : FixedOrScalableQuantity(MinVal, Scalable) {}
@@ -311,7 +311,7 @@ class ElementCount
 // Stores the size of a type. 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 details::FixedOrScalableQuantity<TypeSize, uint64_t> {
+class LLVM_CLASS_ABI TypeSize : public details::FixedOrScalableQuantity<TypeSize, uint64_t> {
   TypeSize(const FixedOrScalableQuantity<TypeSize, uint64_t> &V)
       : FixedOrScalableQuantity(V) {}
 
@@ -416,7 +416,7 @@ operator<<(raw_ostream &OS,
   return OS;
 }
 
-template <> struct DenseMapInfo<ElementCount, void> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<ElementCount, void> {
   static inline ElementCount getEmptyKey() {
     return ElementCount::getScalable(~0U);
   }
diff --git a/llvm/include/llvm/Support/Unicode.h b/llvm/include/llvm/Support/Unicode.h
index 6c343245c803c3c..56f4f8febbc6763 100644
--- a/llvm/include/llvm/Support/Unicode.h
+++ b/llvm/include/llvm/Support/Unicode.h
@@ -37,10 +37,10 @@ enum ColumnWidthErrors {
 ///
 /// Printable codepoints are those in the categories L, M, N, P, S and Zs
 /// \return true if the character is considered printable.
-bool isPrintable(int UCS);
+LLVM_FUNC_ABI bool isPrintable(int UCS);
 
 // Formatting codepoints are codepoints in the Cf category.
-bool isFormatting(int UCS);
+LLVM_FUNC_ABI bool isFormatting(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
@@ -56,11 +56,11 @@ bool isFormatting(int UCS);
 ///   * 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_FUNC_ABI int columnWidthUTF8(StringRef Text);
 
 /// Fold input unicode character according the Simple unicode case folding
 /// rules.
-int foldCharSimple(int C);
+LLVM_FUNC_ABI int foldCharSimple(int C);
 
 /// Maps the name or the alias of a Unicode character to its associated
 /// codepoints.
@@ -68,22 +68,22 @@ int foldCharSimple(int C);
 /// For compatibility with the semantics of named character escape sequences in
 /// C++, this mapping does an exact match sensitive to casing and spacing.
 /// \return The codepoint of the corresponding character, if any.
-std::optional<char32_t> nameToCodepointStrict(StringRef Name);
+LLVM_FUNC_ABI std::optional<char32_t> nameToCodepointStrict(StringRef Name);
 
-struct LooseMatchingResult {
+struct LLVM_CLASS_ABI LooseMatchingResult {
   char32_t CodePoint;
   SmallString<64> Name;
 };
 
-std::optional<LooseMatchingResult> nameToCodepointLooseMatching(StringRef Name);
+LLVM_FUNC_ABI std::optional<LooseMatchingResult> nameToCodepointLooseMatching(StringRef Name);
 
-struct MatchForCodepointName {
+struct LLVM_CLASS_ABI MatchForCodepointName {
   std::string Name;
   uint32_t Distance = 0;
   char32_t Value = 0;
 };
 
-SmallVector<MatchForCodepointName>
+LLVM_FUNC_ABI SmallVector<MatchForCodepointName>
 nearestMatchesForCodepointName(StringRef Pattern, std::size_t MaxMatchesCount);
 
 } // namespace unicode
diff --git a/llvm/include/llvm/Support/UnicodeCharRanges.h b/llvm/include/llvm/Support/UnicodeCharRanges.h
index 73d3603b74df01e..44299c068e46e26 100644
--- a/llvm/include/llvm/Support/UnicodeCharRanges.h
+++ b/llvm/include/llvm/Support/UnicodeCharRanges.h
@@ -20,7 +20,7 @@ namespace llvm {
 namespace sys {
 
 /// Represents a closed range of Unicode code points [Lower, Upper].
-struct UnicodeCharRange {
+struct LLVM_CLASS_ABI UnicodeCharRange {
   uint32_t Lower;
   uint32_t Upper;
 };
@@ -35,7 +35,7 @@ inline bool operator<(UnicodeCharRange Range, uint32_t Value) {
 /// Holds a reference to an ordered array of UnicodeCharRange and allows
 /// to quickly check if a code point is contained in the set represented by this
 /// array.
-class UnicodeCharSet {
+class LLVM_CLASS_ABI UnicodeCharSet {
 public:
   typedef ArrayRef<UnicodeCharRange> CharRanges;
 
diff --git a/llvm/include/llvm/Support/Valgrind.h b/llvm/include/llvm/Support/Valgrind.h
index b0d68f8a49cfca9..8fb34a132d62f1e 100644
--- a/llvm/include/llvm/Support/Valgrind.h
+++ b/llvm/include/llvm/Support/Valgrind.h
@@ -21,11 +21,11 @@
 namespace llvm {
 namespace sys {
   // True if Valgrind is controlling this process.
-  bool RunningOnValgrind();
+  LLVM_FUNC_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.
-  void ValgrindDiscardTranslations(const void *Addr, size_t Len);
+  LLVM_FUNC_ABI void ValgrindDiscardTranslations(const void *Addr, size_t Len);
 } // namespace sys
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Support/VersionTuple.h b/llvm/include/llvm/Support/VersionTuple.h
index c40cb80ece7efa7..76b57966d31c83f 100644
--- a/llvm/include/llvm/Support/VersionTuple.h
+++ b/llvm/include/llvm/Support/VersionTuple.h
@@ -29,7 +29,7 @@ class raw_ostream;
 class StringRef;
 
 /// Represents a version number in the form major[.minor[.subminor[.build]]].
-class VersionTuple {
+class LLVM_CLASS_ABI VersionTuple {
   unsigned Major : 32;
 
   unsigned Minor : 31;
@@ -191,10 +191,10 @@ class VersionTuple {
 };
 
 /// Print a version number.
-raw_ostream &operator<<(raw_ostream &Out, const VersionTuple &V);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &Out, const VersionTuple &V);
 
 // Provide DenseMapInfo for version tuples.
-template <> struct DenseMapInfo<VersionTuple> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<VersionTuple> {
   static inline VersionTuple getEmptyKey() { return VersionTuple(0x7FFFFFFF); }
   static inline VersionTuple getTombstoneKey() {
     return VersionTuple(0x7FFFFFFE);
diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h
index 879399a998f733d..a4e53eb80265acf 100644
--- a/llvm/include/llvm/Support/VirtualFileSystem.h
+++ b/llvm/include/llvm/Support/VirtualFileSystem.h
@@ -45,7 +45,7 @@ class Twine;
 namespace vfs {
 
 /// The result of a \p status operation.
-class Status {
+class LLVM_CLASS_ABI Status {
   std::string Name;
   llvm::sys::fs::UniqueID UID;
   llvm::sys::TimePoint<> MTime;
@@ -111,7 +111,7 @@ class Status {
 };
 
 /// Represents an open file.
-class File {
+class LLVM_CLASS_ABI File {
 public:
   /// Destroy the file after closing it (if open).
   /// Sub-classes should generally call close() inside their destructors.  We
@@ -148,7 +148,7 @@ class File {
 
 /// A member of a directory, yielded by a directory_iterator.
 /// Only information available on most platforms is included.
-class directory_entry {
+class LLVM_CLASS_ABI directory_entry {
   std::string Path;
   llvm::sys::fs::file_type Type = llvm::sys::fs::file_type::type_unknown;
 
@@ -165,7 +165,7 @@ namespace detail {
 
 /// An interface for virtual file systems to provide an iterator over the
 /// (non-recursive) contents of a directory.
-struct DirIterImpl {
+struct LLVM_CLASS_ABI DirIterImpl {
   virtual ~DirIterImpl();
 
   /// Sets \c CurrentEntry to the next entry in the directory on success,
@@ -179,7 +179,7 @@ struct DirIterImpl {
 
 /// An input iterator over the entries in a virtual path, similar to
 /// llvm::sys::fs::directory_iterator.
-class directory_iterator {
+class LLVM_CLASS_ABI directory_iterator {
   std::shared_ptr<detail::DirIterImpl> Impl; // Input iterator semantics on copy
 
 public:
@@ -220,7 +220,7 @@ class FileSystem;
 namespace detail {
 
 /// Keeps state for the recursive_directory_iterator.
-struct RecDirIterState {
+struct LLVM_CLASS_ABI RecDirIterState {
   std::stack<directory_iterator, std::vector<directory_iterator>> Stack;
   bool HasNoPushRequest = false;
 };
@@ -229,7 +229,7 @@ struct RecDirIterState {
 
 /// 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_CLASS_ABI recursive_directory_iterator {
   FileSystem *FS;
   std::shared_ptr<detail::RecDirIterState>
       State; // Input iterator semantics on copy.
@@ -265,7 +265,7 @@ class recursive_directory_iterator {
 };
 
 /// The virtual file system interface.
-class FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem> {
+class LLVM_CLASS_ABI FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem> {
 public:
   virtual ~FileSystem();
 
@@ -346,13 +346,13 @@ class FileSystem : public llvm::ThreadSafeRefCountedBase<FileSystem> {
 /// the operating system.
 /// The working directory is linked to the process's working directory.
 /// (This is usually thread-hostile).
-IntrusiveRefCntPtr<FileSystem> getRealFileSystem();
+LLVM_FUNC_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_FUNC_ABI std::unique_ptr<FileSystem> createPhysicalFileSystem();
 
 /// A file system that allows overlaying one \p AbstractFileSystem on top
 /// of another.
@@ -364,7 +364,7 @@ std::unique_ptr<FileSystem> createPhysicalFileSystem();
 /// 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_CLASS_ABI OverlayFileSystem : public FileSystem {
   using FileSystemList = SmallVector<IntrusiveRefCntPtr<FileSystem>, 1>;
 
   /// The stack of file systems, implemented as a list in order of
@@ -421,7 +421,7 @@ class OverlayFileSystem : public FileSystem {
 /// 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_CLASS_ABI ProxyFileSystem : public FileSystem {
 public:
   explicit ProxyFileSystem(IntrusiveRefCntPtr<FileSystem> FS)
       : FS(std::move(FS)) {}
@@ -464,7 +464,7 @@ namespace detail {
 class InMemoryDirectory;
 class InMemoryNode;
 
-struct NewInMemoryNodeInfo {
+struct LLVM_CLASS_ABI NewInMemoryNodeInfo {
   llvm::sys::fs::UniqueID DirUID;
   StringRef Path;
   StringRef Name;
@@ -478,7 +478,7 @@ struct NewInMemoryNodeInfo {
   Status makeStatus() const;
 };
 
-class NamedNodeOrError {
+class LLVM_CLASS_ABI NamedNodeOrError {
   ErrorOr<std::pair<llvm::SmallString<128>, const detail::InMemoryNode *>>
       Value;
 
@@ -499,7 +499,7 @@ class NamedNodeOrError {
 } // namespace detail
 
 /// An in-memory file system.
-class InMemoryFileSystem : public FileSystem {
+class LLVM_CLASS_ABI InMemoryFileSystem : public FileSystem {
   std::unique_ptr<detail::InMemoryDirectory> Root;
   std::string WorkingDirectory;
   bool UseNormalizedPaths = true;
@@ -612,17 +612,17 @@ class InMemoryFileSystem : public FileSystem {
 };
 
 /// Get a globally unique ID for a virtual file or directory.
-llvm::sys::fs::UniqueID getNextVirtualUniqueID();
+LLVM_FUNC_ABI llvm::sys::fs::UniqueID getNextVirtualUniqueID();
 
 /// Gets a \p FileSystem for a virtual file system described in YAML
 /// format.
-std::unique_ptr<FileSystem>
+LLVM_FUNC_ABI std::unique_ptr<FileSystem>
 getVFSFromYAML(std::unique_ptr<llvm::MemoryBuffer> Buffer,
                llvm::SourceMgr::DiagHandlerTy DiagHandler,
                StringRef YAMLFilePath, void *DiagContext = nullptr,
                IntrusiveRefCntPtr<FileSystem> ExternalFS = getRealFileSystem());
 
-struct YAMLVFSEntry {
+struct LLVM_CLASS_ABI YAMLVFSEntry {
   template <typename T1, typename T2>
   YAMLVFSEntry(T1 &&VPath, T2 &&RPath, bool IsDirectory = false)
       : VPath(std::forward<T1>(VPath)), RPath(std::forward<T2>(RPath)),
@@ -740,7 +740,7 @@ class RedirectingFileSystemParser;
 /// FIXME: 'use-external-name' causes behaviour that's inconsistent with how
 /// "real" filesystems behave. Maybe there should be a separate channel for
 /// this information.
-class RedirectingFileSystem : public vfs::FileSystem {
+class LLVM_CLASS_ABI RedirectingFileSystem : public vfs::FileSystem {
 public:
   enum EntryKind { EK_Directory, EK_DirectoryRemap, EK_File };
   enum NameKind { NK_NotSet, NK_External, NK_Virtual };
@@ -1057,14 +1057,14 @@ class RedirectingFileSystem : public vfs::FileSystem {
 /// 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_FUNC_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_CLASS_ABI YAMLVFSWriter {
   std::vector<YAMLVFSEntry> Mappings;
   std::optional<bool> IsCaseSensitive;
   std::optional<bool> IsOverlayRelative;
diff --git a/llvm/include/llvm/Support/Watchdog.h b/llvm/include/llvm/Support/Watchdog.h
index 281595e8f272252..a8e2aec151b1eaf 100644
--- a/llvm/include/llvm/Support/Watchdog.h
+++ b/llvm/include/llvm/Support/Watchdog.h
@@ -22,7 +22,7 @@ namespace llvm {
     /// that must complete in a given amount of time. Failure to complete before
     /// the timeout is an unrecoverable situation and no mechanisms to attempt
     /// to handle it are provided.
-    class Watchdog {
+    class LLVM_CLASS_ABI Watchdog {
     public:
       Watchdog(unsigned int seconds);
       ~Watchdog();
diff --git a/llvm/include/llvm/Support/Win64EH.h b/llvm/include/llvm/Support/Win64EH.h
index f7c06d6c77bc3f5..6bfe4a513cc9809 100644
--- a/llvm/include/llvm/Support/Win64EH.h
+++ b/llvm/include/llvm/Support/Win64EH.h
@@ -139,14 +139,14 @@ enum {
 };
 
 /// RuntimeFunction - An entry in the table of functions with unwind info.
-struct RuntimeFunction {
+struct LLVM_CLASS_ABI RuntimeFunction {
   support::ulittle32_t StartAddress;
   support::ulittle32_t EndAddress;
   support::ulittle32_t UnwindInfoOffset;
 };
 
 /// UnwindInfo - An entry in the exception table.
-struct UnwindInfo {
+struct LLVM_CLASS_ABI UnwindInfo {
   uint8_t VersionAndFlags;
   uint8_t PrologSize;
   uint8_t NumCodes;
diff --git a/llvm/include/llvm/Support/WindowsError.h b/llvm/include/llvm/Support/WindowsError.h
index 12624a2fab81e0b..0393160da8161fb 100644
--- a/llvm/include/llvm/Support/WindowsError.h
+++ b/llvm/include/llvm/Support/WindowsError.h
@@ -13,7 +13,7 @@
 #include <system_error>
 
 namespace llvm {
-std::error_code mapWindowsError(unsigned EV);
+LLVM_FUNC_ABI std::error_code mapWindowsError(unsigned EV);
 }
 
 #endif
diff --git a/llvm/include/llvm/Support/WithColor.h b/llvm/include/llvm/Support/WithColor.h
index 5838013f2b1fd93..4c7c8921740d4c9 100644
--- a/llvm/include/llvm/Support/WithColor.h
+++ b/llvm/include/llvm/Support/WithColor.h
@@ -21,7 +21,7 @@ namespace cl {
 class OptionCategory;
 }
 
-extern cl::OptionCategory &getColorCategory();
+LLVM_FUNC_ABI extern cl::OptionCategory &getColorCategory();
 
 // Symbolic names for various syntax elements.
 enum class HighlightColor {
@@ -51,7 +51,7 @@ enum class ColorMode {
 
 /// An RAII object that temporarily switches an output stream to a specific
 /// color.
-class WithColor {
+class LLVM_CLASS_ABI WithColor {
 public:
   using AutoDetectFunctionType = bool (*)(const raw_ostream &OS);
 
diff --git a/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h b/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
index 43d73a1b9e78bf4..47c47f497a74c17 100644
--- a/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
+++ b/llvm/include/llvm/Support/X86DisassemblerDecoderCommon.h
@@ -455,7 +455,7 @@ enum OperandType {
 #undef ENUM_ENTRY
 
 /// The specification for how to extract and interpret one operand.
-struct OperandSpecifier {
+struct LLVM_CLASS_ABI OperandSpecifier {
   uint8_t encoding;
   uint8_t type;
 };
diff --git a/llvm/include/llvm/Support/YAMLParser.h b/llvm/include/llvm/Support/YAMLParser.h
index 5280c0f9b94151a..1a33ce50ec2a14a 100644
--- a/llvm/include/llvm/Support/YAMLParser.h
+++ b/llvm/include/llvm/Support/YAMLParser.h
@@ -66,25 +66,25 @@ struct Token;
 
 /// 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_FUNC_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_FUNC_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_FUNC_ABI std::string escape(StringRef Input, bool EscapePrintable = true);
 
 /// Parse \p S as a bool according to https://yaml.org/type/bool.html.
-std::optional<bool> parseBool(StringRef S);
+LLVM_FUNC_ABI std::optional<bool> parseBool(StringRef S);
 
 /// This class represents a YAML stream potentially containing multiple
 ///        documents.
-class Stream {
+class LLVM_CLASS_ABI Stream {
 public:
   /// This keeps a reference to the string referenced by \p Input.
   Stream(StringRef Input, SourceMgr &, bool ShowColors = true,
@@ -117,7 +117,7 @@ class Stream {
 };
 
 /// Abstract base class for all Nodes.
-class Node {
+class LLVM_CLASS_ABI Node {
   virtual void anchor();
 
 public:
@@ -195,7 +195,7 @@ class Node {
 ///
 /// Example:
 ///   !!null null
-class NullNode final : public Node {
+class LLVM_CLASS_ABI NullNode final : public Node {
   void anchor() override;
 
 public:
@@ -210,7 +210,7 @@ class NullNode final : public Node {
 ///
 /// Example:
 ///   Adena
-class ScalarNode final : public Node {
+class LLVM_CLASS_ABI ScalarNode final : public Node {
   void anchor() override;
 
 public:
@@ -253,7 +253,7 @@ class ScalarNode final : public Node {
 ///   |
 ///     Hello
 ///     World
-class BlockScalarNode final : public Node {
+class LLVM_CLASS_ABI BlockScalarNode final : public Node {
   void anchor() override;
 
 public:
@@ -283,7 +283,7 @@ class BlockScalarNode final : public Node {
 ///
 /// Example:
 ///   Section: .text
-class KeyValueNode final : public Node {
+class LLVM_CLASS_ABI KeyValueNode final : public Node {
   void anchor() override;
 
 public:
@@ -326,7 +326,7 @@ class KeyValueNode final : public Node {
 ///
 /// BaseT must have a ValueT* member named CurrentEntry and a member function
 /// increment() which must set CurrentEntry to 0 to create an end iterator.
-template <class BaseT, class ValueT> class basic_collection_iterator {
+template <class BaseT, class ValueT> class LLVM_CLASS_ABI basic_collection_iterator {
 public:
   using iterator_category = std::input_iterator_tag;
   using value_type = ValueT;
@@ -412,7 +412,7 @@ template <class CollectionType> void skip(CollectionType &C) {
 /// Example:
 ///   Name: _main
 ///   Scope: Global
-class MappingNode final : public Node {
+class LLVM_CLASS_ABI MappingNode final : public Node {
   void anchor() override;
 
 public:
@@ -460,7 +460,7 @@ class MappingNode final : public Node {
 /// Example:
 ///   - Hello
 ///   - World
-class SequenceNode final : public Node {
+class LLVM_CLASS_ABI SequenceNode final : public Node {
   void anchor() override;
 
 public:
@@ -512,7 +512,7 @@ class SequenceNode final : public Node {
 ///
 /// Example:
 ///   *AnchorName
-class AliasNode final : public Node {
+class LLVM_CLASS_ABI AliasNode final : public Node {
   void anchor() override;
 
 public:
@@ -529,7 +529,7 @@ class AliasNode final : public Node {
 
 /// A YAML Stream is a sequence of Documents. A document contains a root
 ///        node.
-class Document {
+class LLVM_CLASS_ABI Document {
 public:
   Document(Stream &ParentStream);
 
@@ -586,7 +586,7 @@ class Document {
 };
 
 /// Iterator abstraction for Documents over a Stream.
-class document_iterator {
+class LLVM_CLASS_ABI document_iterator {
 public:
   document_iterator() = default;
   document_iterator(std::unique_ptr<Document> &D) : Doc(&D) {}
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
index 0ed4d02e319d01f..e423347b12a0cac 100644
--- a/llvm/include/llvm/Support/YAMLTraits.h
+++ b/llvm/include/llvm/Support/YAMLTraits.h
@@ -46,7 +46,7 @@ enum class NodeKind : uint8_t {
   Sequence,
 };
 
-struct EmptyContext {};
+struct LLVM_CLASS_ABI EmptyContext {};
 
 /// This class should be specialized by any type that needs to be converted
 /// to/from a YAML mapping.  For example:
@@ -59,7 +59,7 @@ struct EmptyContext {};
 ///       }
 ///     };
 template<class T>
-struct MappingTraits {
+struct LLVM_CLASS_ABI MappingTraits {
   // Must provide:
   // static void mapping(IO &io, T &fields);
   // Optionally may provide:
@@ -82,7 +82,7 @@ struct MappingTraits {
 ///         ++c.TimesMapped;
 ///       }
 ///     };
-template <class T, class Context> struct MappingContextTraits {
+template <class T, class Context> struct LLVM_CLASS_ABI MappingContextTraits {
   // Must provide:
   // static void mapping(IO &io, T &fields, Context &Ctx);
   // Optionally may provide:
@@ -104,7 +104,7 @@ template <class T, class Context> struct MappingContextTraits {
 ///           io.enumCase(value, "green", cGreen);
 ///         }
 ///       };
-template <typename T, typename Enable = void> struct ScalarEnumerationTraits {
+template <typename T, typename Enable = void> struct LLVM_CLASS_ABI ScalarEnumerationTraits {
   // Must provide:
   // static void enumeration(IO &io, T &value);
 };
@@ -120,7 +120,7 @@ template <typename T, typename Enable = void> struct ScalarEnumerationTraits {
 ///          io.bitSetCase(value, "round", flagRound);
 ///        }
 ///      };
-template <typename T, typename Enable = void> struct ScalarBitSetTraits {
+template <typename T, typename Enable = void> struct LLVM_CLASS_ABI ScalarBitSetTraits {
   // Must provide:
   // static void bitset(IO &io, T &value);
 };
@@ -146,7 +146,7 @@ enum class QuotingType { None, Single, Double };
 ///      }
 ///      static QuotingType mustQuote(StringRef) { return QuotingType::Single; }
 ///    };
-template <typename T, typename Enable = void> struct ScalarTraits {
+template <typename T, typename Enable = void> struct LLVM_CLASS_ABI ScalarTraits {
   // Must provide:
   //
   // Function to write the value as a string:
@@ -177,7 +177,7 @@ template <typename T, typename Enable = void> struct ScalarTraits {
 ///      }
 ///    };
 template <typename T>
-struct BlockScalarTraits {
+struct LLVM_CLASS_ABI BlockScalarTraits {
   // Must provide:
   //
   // Function to write the value as a string:
@@ -213,7 +213,7 @@ struct BlockScalarTraits {
 ///        return QuotingType::Single;
 ///      }
 ///    };
-template <typename T> struct TaggedScalarTraits {
+template <typename T> struct LLVM_CLASS_ABI TaggedScalarTraits {
   // Must provide:
   //
   // Function to write the value and tag as strings:
@@ -244,7 +244,7 @@ template <typename T> struct TaggedScalarTraits {
 ///      }
 ///    };
 template<typename T, typename EnableIf = void>
-struct SequenceTraits {
+struct LLVM_CLASS_ABI SequenceTraits {
   // Must provide:
   // static size_t size(IO &io, T &seq);
   // static T::value_type& element(IO &io, T &seq, size_t index);
@@ -257,7 +257,7 @@ struct SequenceTraits {
 /// This class should be specialized by any type for which vectors of that
 /// type need to be converted to/from a YAML sequence.
 template<typename T, typename EnableIf = void>
-struct SequenceElementTraits {
+struct LLVM_CLASS_ABI SequenceElementTraits {
   // Must provide:
   // static const bool flow;
 };
@@ -265,7 +265,7 @@ struct SequenceElementTraits {
 /// This class should be specialized by any type that needs to be converted
 /// to/from a list of YAML documents.
 template<typename T>
-struct DocumentListTraits {
+struct LLVM_CLASS_ABI DocumentListTraits {
   // Must provide:
   // static size_t size(IO &io, T &seq);
   // static T::value_type& element(IO &io, T &seq, size_t index);
@@ -275,7 +275,7 @@ struct DocumentListTraits {
 /// to/from a YAML mapping in the case where the names of the keys are not known
 /// in advance, e.g. a string map.
 template <typename T>
-struct CustomMappingTraits {
+struct LLVM_CLASS_ABI CustomMappingTraits {
   // static void inputOne(IO &io, StringRef key, T &elem);
   // static void output(IO &io, T &elem);
 };
@@ -297,7 +297,7 @@ struct CustomMappingTraits {
 ///      }
 ///      // ...
 ///    };
-template <typename T> struct PolymorphicTraits {
+template <typename T> struct LLVM_CLASS_ABI PolymorphicTraits {
   // Must provide:
   // static NodeKind getKind(const T &poly);
   // static scalar_type &getAsScalar(T &poly);
@@ -311,7 +311,7 @@ struct MissingTrait;
 
 // Test if ScalarEnumerationTraits<T> is defined on type T.
 template <class T>
-struct has_ScalarEnumerationTraits
+struct LLVM_CLASS_ABI has_ScalarEnumerationTraits
 {
   using Signature_enumeration = void (*)(class IO&, T&);
 
@@ -327,7 +327,7 @@ struct has_ScalarEnumerationTraits
 
 // Test if ScalarBitSetTraits<T> is defined on type T.
 template <class T>
-struct has_ScalarBitSetTraits
+struct LLVM_CLASS_ABI has_ScalarBitSetTraits
 {
   using Signature_bitset = void (*)(class IO&, T&);
 
@@ -342,7 +342,7 @@ struct has_ScalarBitSetTraits
 
 // Test if ScalarTraits<T> is defined on type T.
 template <class T>
-struct has_ScalarTraits
+struct LLVM_CLASS_ABI has_ScalarTraits
 {
   using Signature_input = StringRef (*)(StringRef, void*, T&);
   using Signature_output = void (*)(const T&, void*, raw_ostream&);
@@ -362,7 +362,7 @@ struct has_ScalarTraits
 
 // Test if BlockScalarTraits<T> is defined on type T.
 template <class T>
-struct has_BlockScalarTraits
+struct LLVM_CLASS_ABI has_BlockScalarTraits
 {
   using Signature_input = StringRef (*)(StringRef, void *, T &);
   using Signature_output = void (*)(const T &, void *, raw_ostream &);
@@ -379,7 +379,7 @@ struct has_BlockScalarTraits
 };
 
 // Test if TaggedScalarTraits<T> is defined on type T.
-template <class T> struct has_TaggedScalarTraits {
+template <class T> struct LLVM_CLASS_ABI has_TaggedScalarTraits {
   using Signature_input = StringRef (*)(StringRef, StringRef, void *, T &);
   using Signature_output = void (*)(const T &, void *, raw_ostream &,
                                     raw_ostream &);
@@ -397,7 +397,7 @@ template <class T> struct has_TaggedScalarTraits {
 };
 
 // Test if MappingContextTraits<T> is defined on type T.
-template <class T, class Context> struct has_MappingTraits {
+template <class T, class Context> struct LLVM_CLASS_ABI has_MappingTraits {
   using Signature_mapping = void (*)(class IO &, T &, Context &);
 
   template <typename U>
@@ -411,7 +411,7 @@ template <class T, class Context> struct has_MappingTraits {
 };
 
 // Test if MappingTraits<T> is defined on type T.
-template <class T> struct has_MappingTraits<T, EmptyContext> {
+template <class T> struct LLVM_CLASS_ABI has_MappingTraits<T, EmptyContext> {
   using Signature_mapping = void (*)(class IO &, T &);
 
   template <typename U>
@@ -423,7 +423,7 @@ template <class T> struct has_MappingTraits<T, EmptyContext> {
 };
 
 // Test if MappingContextTraits<T>::validate() is defined on type T.
-template <class T, class Context> struct has_MappingValidateTraits {
+template <class T, class Context> struct LLVM_CLASS_ABI has_MappingValidateTraits {
   using Signature_validate = std::string (*)(class IO &, T &, Context &);
 
   template <typename U>
@@ -437,7 +437,7 @@ template <class T, class Context> struct has_MappingValidateTraits {
 };
 
 // Test if MappingTraits<T>::validate() is defined on type T.
-template <class T> struct has_MappingValidateTraits<T, EmptyContext> {
+template <class T> struct LLVM_CLASS_ABI has_MappingValidateTraits<T, EmptyContext> {
   using Signature_validate = std::string (*)(class IO &, T &);
 
   template <typename U>
@@ -449,7 +449,7 @@ template <class T> struct has_MappingValidateTraits<T, EmptyContext> {
 };
 
 // Test if MappingContextTraits<T>::enumInput() is defined on type T.
-template <class T, class Context> struct has_MappingEnumInputTraits {
+template <class T, class Context> struct LLVM_CLASS_ABI has_MappingEnumInputTraits {
   using Signature_validate = void (*)(class IO &, T &);
 
   template <typename U>
@@ -462,7 +462,7 @@ template <class T, class Context> struct has_MappingEnumInputTraits {
 };
 
 // Test if MappingTraits<T>::enumInput() is defined on type T.
-template <class T> struct has_MappingEnumInputTraits<T, EmptyContext> {
+template <class T> struct LLVM_CLASS_ABI has_MappingEnumInputTraits<T, EmptyContext> {
   using Signature_validate = void (*)(class IO &, T &);
 
   template <typename U>
@@ -475,7 +475,7 @@ template <class T> struct has_MappingEnumInputTraits<T, EmptyContext> {
 
 // Test if SequenceTraits<T> is defined on type T.
 template <class T>
-struct has_SequenceMethodTraits
+struct LLVM_CLASS_ABI has_SequenceMethodTraits
 {
   using Signature_size = size_t (*)(class IO&, T&);
 
@@ -490,7 +490,7 @@ struct has_SequenceMethodTraits
 
 // Test if CustomMappingTraits<T> is defined on type T.
 template <class T>
-struct has_CustomMappingTraits
+struct LLVM_CLASS_ABI has_CustomMappingTraits
 {
   using Signature_input = void (*)(IO &io, StringRef key, T &v);
 
@@ -507,7 +507,7 @@ struct has_CustomMappingTraits
 // has_FlowTraits<int> will cause an error with some compilers because
 // it subclasses int.  Using this wrapper only instantiates the
 // real has_FlowTraits only if the template type is a class.
-template <typename T, bool Enabled = std::is_class_v<T>> class has_FlowTraits {
+template <typename T, bool Enabled = std::is_class_v<T>> class LLVM_CLASS_ABI has_FlowTraits {
 public:
    static const bool value = false;
 };
@@ -516,7 +516,7 @@ template <typename T, bool Enabled = std::is_class_v<T>> class has_FlowTraits {
 // for members, so test for ambiguity cause by the base and derived
 // classes both defining the member.
 template <class T>
-struct has_FlowTraits<T, true>
+struct LLVM_CLASS_ABI has_FlowTraits<T, true>
 {
   struct Fallback { bool flow; };
   struct Derived : T, Fallback { };
@@ -532,12 +532,12 @@ struct has_FlowTraits<T, true>
 
 // Test if SequenceTraits<T> is defined on type T
 template<typename T>
-struct has_SequenceTraits : public std::integral_constant<bool,
+struct LLVM_CLASS_ABI has_SequenceTraits : public std::integral_constant<bool,
                                       has_SequenceMethodTraits<T>::value > { };
 
 // Test if DocumentListTraits<T> is defined on type T
 template <class T>
-struct has_DocumentListTraits
+struct LLVM_CLASS_ABI has_DocumentListTraits
 {
   using Signature_size = size_t (*)(class IO &, T &);
 
@@ -550,7 +550,7 @@ struct has_DocumentListTraits
   static bool const value = (sizeof(test<DocumentListTraits<T>>(nullptr))==1);
 };
 
-template <class T> struct has_PolymorphicTraits {
+template <class T> struct LLVM_CLASS_ABI has_PolymorphicTraits {
   using Signature_getKind = NodeKind (*)(const T &);
 
   template <typename U>
@@ -744,7 +744,7 @@ inline QuotingType needsQuotes(StringRef S) {
 }
 
 template <typename T, typename Context>
-struct missingTraits
+struct LLVM_CLASS_ABI missingTraits
     : public std::integral_constant<bool,
                                     !has_ScalarEnumerationTraits<T>::value &&
                                         !has_ScalarBitSetTraits<T>::value &&
@@ -758,19 +758,19 @@ struct missingTraits
                                         !has_PolymorphicTraits<T>::value> {};
 
 template <typename T, typename Context>
-struct validatedMappingTraits
+struct LLVM_CLASS_ABI validatedMappingTraits
     : public std::integral_constant<
           bool, has_MappingTraits<T, Context>::value &&
                     has_MappingValidateTraits<T, Context>::value> {};
 
 template <typename T, typename Context>
-struct unvalidatedMappingTraits
+struct LLVM_CLASS_ABI unvalidatedMappingTraits
     : public std::integral_constant<
           bool, has_MappingTraits<T, Context>::value &&
                     !has_MappingValidateTraits<T, Context>::value> {};
 
 // Base class for Input and Output.
-class IO {
+class LLVM_CLASS_ABI IO {
 public:
   IO(void *Ctxt = nullptr);
   virtual ~IO();
@@ -1185,91 +1185,91 @@ yamlize(IO &io, T &Seq, bool, Context &Ctx) {
 }
 
 template<>
-struct ScalarTraits<bool> {
+struct LLVM_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_ABI ScalarTraits<double> {
   static void output(const double &, void *, raw_ostream &);
   static StringRef input(StringRef, void *, double &);
   static QuotingType mustQuote(StringRef) { return QuotingType::None; }
@@ -1279,7 +1279,7 @@ struct ScalarTraits<double> {
 // type.  This way endian aware types are supported whenever the traits are
 // defined for the underlying type.
 template <typename value_type, support::endianness endian, size_t alignment>
-struct ScalarTraits<support::detail::packed_endian_specific_integral<
+struct LLVM_CLASS_ABI ScalarTraits<support::detail::packed_endian_specific_integral<
                         value_type, endian, alignment>,
                     std::enable_if_t<has_ScalarTraits<value_type>::value>> {
   using endian_type =
@@ -1303,7 +1303,7 @@ struct ScalarTraits<support::detail::packed_endian_specific_integral<
 };
 
 template <typename value_type, support::endianness endian, size_t alignment>
-struct ScalarEnumerationTraits<
+struct LLVM_CLASS_ABI ScalarEnumerationTraits<
     support::detail::packed_endian_specific_integral<value_type, endian,
                                                      alignment>,
     std::enable_if_t<has_ScalarEnumerationTraits<value_type>::value>> {
@@ -1319,7 +1319,7 @@ struct ScalarEnumerationTraits<
 };
 
 template <typename value_type, support::endianness endian, size_t alignment>
-struct ScalarBitSetTraits<
+struct LLVM_CLASS_ABI ScalarBitSetTraits<
     support::detail::packed_endian_specific_integral<value_type, endian,
                                                      alignment>,
     std::enable_if_t<has_ScalarBitSetTraits<value_type>::value>> {
@@ -1336,7 +1336,7 @@ struct ScalarBitSetTraits<
 // Utility for use within MappingTraits<>::mapping() method
 // to [de]normalize an object for use with YAML conversion.
 template <typename TNorm, typename TFinal>
-struct MappingNormalization {
+struct LLVM_CLASS_ABI MappingNormalization {
   MappingNormalization(IO &i_o, TFinal &Obj)
       : io(i_o), BufPtr(nullptr), Result(Obj) {
     if ( io.outputting() ) {
@@ -1368,7 +1368,7 @@ struct MappingNormalization {
 // Utility for use within MappingTraits<>::mapping() method
 // to [de]normalize an object for use with YAML conversion.
 template <typename TNorm, typename TFinal>
-struct MappingNormalizationHeap {
+struct LLVM_CLASS_ABI MappingNormalizationHeap {
   MappingNormalizationHeap(IO &i_o, TFinal &Obj, BumpPtrAllocator *allocator)
     : io(i_o), Result(Obj) {
     if ( io.outputting() ) {
@@ -1414,7 +1414,7 @@ struct MappingNormalizationHeap {
 /// the mapRequired() method calls may not be in the same order
 /// as the keys in the document.
 ///
-class Input : public IO {
+class LLVM_CLASS_ABI Input : public IO {
 public:
   // Construct a yaml Input object from a StringRef and optional
   // user-data. The DiagHandler can be specified to provide
@@ -1577,7 +1577,7 @@ class Input : public IO {
 /// The Output class is used to generate a yaml document from in-memory structs
 /// and vectors.
 ///
-class Output : public IO {
+class LLVM_CLASS_ABI Output : public IO {
 public:
   Output(raw_ostream &, void *Ctxt = nullptr, int WrapColumn = 70);
   ~Output() override;
@@ -1734,34 +1734,34 @@ LLVM_YAML_STRONG_TYPEDEF(uint32_t, Hex32)
 LLVM_YAML_STRONG_TYPEDEF(uint64_t, Hex64)
 
 template<>
-struct ScalarTraits<Hex8> {
+struct LLVM_CLASS_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_CLASS_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_CLASS_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_CLASS_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_CLASS_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; }
@@ -1942,17 +1942,17 @@ operator<<(Output &yout, T &seq) {
   return yout;
 }
 
-template <bool B> struct IsFlowSequenceBase {};
-template <> struct IsFlowSequenceBase<true> { static const bool flow = true; };
+template <bool B> struct LLVM_CLASS_ABI IsFlowSequenceBase {};
+template <> struct LLVM_CLASS_ABI IsFlowSequenceBase<true> { static const bool flow = true; };
 
 template <typename T, typename U = void>
-struct IsResizable : std::false_type {};
+struct LLVM_CLASS_ABI IsResizable : std::false_type {};
 
 template <typename T>
-struct IsResizable<T, std::void_t<decltype(std::declval<T>().resize(0))>>
+struct LLVM_CLASS_ABI IsResizable<T, std::void_t<decltype(std::declval<T>().resize(0))>>
     : public std::true_type {};
 
-template <typename T, bool B> struct IsResizableBase {
+template <typename T, bool B> struct LLVM_CLASS_ABI IsResizableBase {
   using type = typename T::value_type;
 
   static type &element(IO &io, T &seq, size_t index) {
@@ -1962,7 +1962,7 @@ template <typename T, bool B> struct IsResizableBase {
   }
 };
 
-template <typename T> struct IsResizableBase<T, false> {
+template <typename T> struct LLVM_CLASS_ABI IsResizableBase<T, false> {
   using type = typename T::value_type;
 
   static type &element(IO &io, T &seq, size_t index) {
@@ -1976,57 +1976,57 @@ template <typename T> struct IsResizableBase<T, false> {
 };
 
 template <typename T, bool Flow>
-struct SequenceTraitsImpl
+struct LLVM_CLASS_ABI SequenceTraitsImpl
     : IsFlowSequenceBase<Flow>, IsResizableBase<T, IsResizable<T>::value> {
   static size_t size(IO &io, T &seq) { return seq.size(); }
 };
 
 // Simple helper to check an expression can be used as a bool-valued template
 // argument.
-template <bool> struct CheckIsBool { static const bool value = true; };
+template <bool> struct LLVM_CLASS_ABI CheckIsBool { static const bool value = true; };
 
 // If T has SequenceElementTraits, then vector<T> and SmallVector<T, N> have
 // SequenceTraits that do the obvious thing.
 template <typename T>
-struct SequenceTraits<
+struct LLVM_CLASS_ABI SequenceTraits<
     std::vector<T>,
     std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
     : SequenceTraitsImpl<std::vector<T>, SequenceElementTraits<T>::flow> {};
 template <typename T, unsigned N>
-struct SequenceTraits<
+struct LLVM_CLASS_ABI SequenceTraits<
     SmallVector<T, N>,
     std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
     : SequenceTraitsImpl<SmallVector<T, N>, SequenceElementTraits<T>::flow> {};
 template <typename T>
-struct SequenceTraits<
+struct LLVM_CLASS_ABI SequenceTraits<
     SmallVectorImpl<T>,
     std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
     : SequenceTraitsImpl<SmallVectorImpl<T>, SequenceElementTraits<T>::flow> {};
 template <typename T>
-struct SequenceTraits<
+struct LLVM_CLASS_ABI SequenceTraits<
     MutableArrayRef<T>,
     std::enable_if_t<CheckIsBool<SequenceElementTraits<T>::flow>::value>>
     : SequenceTraitsImpl<MutableArrayRef<T>, SequenceElementTraits<T>::flow> {};
 
 // Sequences of fundamental types use flow formatting.
 template <typename T>
-struct SequenceElementTraits<T, std::enable_if_t<std::is_fundamental_v<T>>> {
+struct LLVM_CLASS_ABI SequenceElementTraits<T, std::enable_if_t<std::is_fundamental_v<T>>> {
   static const bool flow = true;
 };
 
 // Sequences of strings use block formatting.
-template<> struct SequenceElementTraits<std::string> {
+template<> struct LLVM_CLASS_ABI SequenceElementTraits<std::string> {
   static const bool flow = false;
 };
-template<> struct SequenceElementTraits<StringRef> {
+template<> struct LLVM_CLASS_ABI SequenceElementTraits<StringRef> {
   static const bool flow = false;
 };
-template<> struct SequenceElementTraits<std::pair<std::string, std::string>> {
+template<> struct LLVM_CLASS_ABI SequenceElementTraits<std::pair<std::string, std::string>> {
   static const bool flow = false;
 };
 
 /// Implementation of CustomMappingTraits for std::map<std::string, T>.
-template <typename T> struct StdMapStringCustomMappingTraitsImpl {
+template <typename T> struct LLVM_CLASS_ABI StdMapStringCustomMappingTraitsImpl {
   using map_type = std::map<std::string, T>;
 
   static void inputOne(IO &io, StringRef key, map_type &v) {
diff --git a/llvm/include/llvm/Support/circular_raw_ostream.h b/llvm/include/llvm/Support/circular_raw_ostream.h
index 859a575c362a7b8..7c54ee8f5589c44 100644
--- a/llvm/include/llvm/Support/circular_raw_ostream.h
+++ b/llvm/include/llvm/Support/circular_raw_ostream.h
@@ -22,7 +22,7 @@ namespace llvm {
   /// to a circular buffer, or can pass it through directly to an
   /// underlying stream if specified with a buffer of zero.
   ///
-  class circular_raw_ostream : public raw_ostream {
+  class LLVM_CLASS_ABI circular_raw_ostream : public raw_ostream {
   public:
     /// TAKE_OWNERSHIP - Tell this stream that it owns the underlying
     /// stream and is responsible for cleanup, memory management
diff --git a/llvm/include/llvm/Support/raw_os_ostream.h b/llvm/include/llvm/Support/raw_os_ostream.h
index 3c9f4e94b1efb1b..f6265658d967a40 100644
--- a/llvm/include/llvm/Support/raw_os_ostream.h
+++ b/llvm/include/llvm/Support/raw_os_ostream.h
@@ -22,7 +22,7 @@ namespace llvm {
 /// 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_CLASS_ABI raw_os_ostream : public raw_ostream {
   std::ostream &OS;
 
   /// write_impl - See raw_ostream::write_impl.
diff --git a/llvm/include/llvm/Support/thread.h b/llvm/include/llvm/Support/thread.h
index 01f7a6049fd0844..f874cfb5e04ba32 100644
--- a/llvm/include/llvm/Support/thread.h
+++ b/llvm/include/llvm/Support/thread.h
@@ -36,7 +36,7 @@ namespace llvm {
 
 /// LLVM thread following std::thread interface with added constructor to
 /// specify stack size.
-class thread {
+class LLVM_CLASS_ABI thread {
   template <typename CalleeTuple> static void GenericThreadProxy(void *Ptr) {
     std::unique_ptr<CalleeTuple> Callee(static_cast<CalleeTuple *>(Ptr));
     std::apply(
@@ -114,13 +114,13 @@ class thread {
   native_handle_type Thread;
 };
 
-thread::native_handle_type
+LLVM_FUNC_ABI LLVM_FUNC_ABI thread::native_handle_type
 llvm_execute_on_thread_impl(thread::start_routine_type ThreadFunc, void *Arg,
                             std::optional<unsigned> StackSizeInBytes);
-void llvm_thread_join_impl(thread::native_handle_type Thread);
-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();
+LLVM_FUNC_ABI LLVM_FUNC_ABI void llvm_thread_join_impl(thread::native_handle_type Thread);
+LLVM_FUNC_ABI LLVM_FUNC_ABI void llvm_thread_detach_impl(thread::native_handle_type Thread);
+LLVM_FUNC_ABI LLVM_FUNC_ABI thread::id llvm_thread_get_id_impl(thread::native_handle_type Thread);
+LLVM_FUNC_ABI LLVM_FUNC_ABI thread::id llvm_thread_get_current_id_impl();
 
 template <class Function, class... Args>
 thread::thread(std::optional<unsigned> StackSizeInBytes, Function &&f,
diff --git a/llvm/include/llvm/Support/xxhash.h b/llvm/include/llvm/Support/xxhash.h
index 7e26fb663047acc..39e63fee012e732 100644
--- a/llvm/include/llvm/Support/xxhash.h
+++ b/llvm/include/llvm/Support/xxhash.h
@@ -43,8 +43,8 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-uint64_t xxHash64(llvm::StringRef Data);
-uint64_t xxHash64(llvm::ArrayRef<uint8_t> Data);
+LLVM_FUNC_ABI uint64_t xxHash64(llvm::StringRef Data);
+LLVM_FUNC_ABI uint64_t xxHash64(llvm::ArrayRef<uint8_t> Data);
 }
 
 #endif
diff --git a/llvm/include/llvm/TableGen/Error.h b/llvm/include/llvm/TableGen/Error.h
index 93c1ee002571042..6632671de251e07 100644
--- a/llvm/include/llvm/TableGen/Error.h
+++ b/llvm/include/llvm/TableGen/Error.h
@@ -20,33 +20,33 @@
 
 namespace llvm {
 
-void PrintNote(const Twine &Msg);
-void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg);
+LLVM_FUNC_ABI void PrintNote(const Twine &Msg);
+LLVM_FUNC_ABI void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg);
 
-[[noreturn]] void PrintFatalNote(const Twine &Msg);
-[[noreturn]] void PrintFatalNote(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
-[[noreturn]] void PrintFatalNote(const Record *Rec, const Twine &Msg);
-[[noreturn]] void PrintFatalNote(const RecordVal *RecVal, const Twine &Msg);
+[[noreturn]] LLVM_FUNC_ABI void PrintFatalNote(const Twine &Msg);
+[[noreturn]] LLVM_FUNC_ABI void PrintFatalNote(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
+[[noreturn]] LLVM_FUNC_ABI void PrintFatalNote(const Record *Rec, const Twine &Msg);
+[[noreturn]] LLVM_FUNC_ABI void PrintFatalNote(const RecordVal *RecVal, const Twine &Msg);
 
-void PrintWarning(const Twine &Msg);
-void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
-void PrintWarning(const char *Loc, const Twine &Msg);
+LLVM_FUNC_ABI void PrintWarning(const Twine &Msg);
+LLVM_FUNC_ABI void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
+LLVM_FUNC_ABI void PrintWarning(const char *Loc, const Twine &Msg);
 
-void PrintError(const Twine &Msg);
-void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
-void PrintError(const char *Loc, const Twine &Msg);
-void PrintError(const Record *Rec, const Twine &Msg);
-void PrintError(const RecordVal *RecVal, const Twine &Msg);
+LLVM_FUNC_ABI void PrintError(const Twine &Msg);
+LLVM_FUNC_ABI void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
+LLVM_FUNC_ABI void PrintError(const char *Loc, const Twine &Msg);
+LLVM_FUNC_ABI void PrintError(const Record *Rec, const Twine &Msg);
+LLVM_FUNC_ABI void PrintError(const RecordVal *RecVal, const Twine &Msg);
 
-[[noreturn]] void PrintFatalError(const Twine &Msg);
-[[noreturn]] void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
-[[noreturn]] void PrintFatalError(const Record *Rec, const Twine &Msg);
-[[noreturn]] void PrintFatalError(const RecordVal *RecVal, const Twine &Msg);
+[[noreturn]] LLVM_FUNC_ABI void PrintFatalError(const Twine &Msg);
+[[noreturn]] LLVM_FUNC_ABI void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
+[[noreturn]] LLVM_FUNC_ABI void PrintFatalError(const Record *Rec, const Twine &Msg);
+[[noreturn]] LLVM_FUNC_ABI void PrintFatalError(const RecordVal *RecVal, const Twine &Msg);
 
-void CheckAssert(SMLoc Loc, Init *Condition, Init *Message);
+LLVM_FUNC_ABI void CheckAssert(SMLoc Loc, Init *Condition, Init *Message);
 
-extern SourceMgr SrcMgr;
-extern unsigned ErrorsPrinted;
+LLVM_FUNC_ABI extern SourceMgr SrcMgr;
+LLVM_FUNC_ABI extern unsigned ErrorsPrinted;
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/TableGen/Main.h b/llvm/include/llvm/TableGen/Main.h
index c983da3c9201ab5..426db0c63098ba3 100644
--- a/llvm/include/llvm/TableGen/Main.h
+++ b/llvm/include/llvm/TableGen/Main.h
@@ -25,7 +25,7 @@ class RecordKeeper;
 /// Returns true on error, false otherwise.
 using TableGenMainFn = bool (raw_ostream &OS, RecordKeeper &Records);
 
-int TableGenMain(const char *argv0,
+LLVM_FUNC_ABI int TableGenMain(const char *argv0,
                  std::function<TableGenMainFn> MainFn = nullptr);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/TableGen/Parser.h b/llvm/include/llvm/TableGen/Parser.h
index 36771d57eac6b32..b7e06852daad05b 100644
--- a/llvm/include/llvm/TableGen/Parser.h
+++ b/llvm/include/llvm/TableGen/Parser.h
@@ -28,7 +28,7 @@ class SourceMgr;
 ///
 /// NOTE: TableGen currently relies on global state within a given parser
 ///       invocation, so this function is not thread-safe.
-bool TableGenParseFile(SourceMgr &InputSrcMgr, RecordKeeper &Records);
+LLVM_FUNC_ABI bool TableGenParseFile(SourceMgr &InputSrcMgr, RecordKeeper &Records);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/TableGen/Record.h b/llvm/include/llvm/TableGen/Record.h
index d6d717c4679c6d9..89c4df728e3bebe 100644
--- a/llvm/include/llvm/TableGen/Record.h
+++ b/llvm/include/llvm/TableGen/Record.h
@@ -56,7 +56,7 @@ class TypedInit;
 //  Type Classes
 //===----------------------------------------------------------------------===//
 
-class RecTy {
+class LLVM_CLASS_ABI RecTy {
 public:
   /// Subclass discriminator (for dyn_cast<> et al.)
   enum RecTyKind {
@@ -107,7 +107,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const RecTy &Ty) {
 }
 
 /// 'bit' - Represent a single bit
-class BitRecTy : public RecTy {
+class LLVM_CLASS_ABI BitRecTy : public RecTy {
   friend detail::RecordKeeperImpl;
 
   BitRecTy(RecordKeeper &RK) : RecTy(BitRecTyKind, RK) {}
@@ -125,7 +125,7 @@ class BitRecTy : public RecTy {
 };
 
 /// 'bits<n>' - Represent a fixed number of bits
-class BitsRecTy : public RecTy {
+class LLVM_CLASS_ABI BitsRecTy : public RecTy {
   unsigned Size;
 
   explicit BitsRecTy(RecordKeeper &RK, unsigned Sz)
@@ -146,7 +146,7 @@ class BitsRecTy : public RecTy {
 };
 
 /// 'int' - Represent an integer value of no particular size
-class IntRecTy : public RecTy {
+class LLVM_CLASS_ABI IntRecTy : public RecTy {
   friend detail::RecordKeeperImpl;
 
   IntRecTy(RecordKeeper &RK) : RecTy(IntRecTyKind, RK) {}
@@ -164,7 +164,7 @@ class IntRecTy : public RecTy {
 };
 
 /// 'string' - Represent an string value
-class StringRecTy : public RecTy {
+class LLVM_CLASS_ABI StringRecTy : public RecTy {
   friend detail::RecordKeeperImpl;
 
   StringRecTy(RecordKeeper &RK) : RecTy(StringRecTyKind, RK) {}
@@ -183,7 +183,7 @@ class StringRecTy : public RecTy {
 
 /// 'list<Ty>' - Represent a list of element values, all of which must be of
 /// the specified type. The type is stored in ElementTy.
-class ListRecTy : public RecTy {
+class LLVM_CLASS_ABI ListRecTy : public RecTy {
   friend ListRecTy *RecTy::getListTy();
 
   RecTy *ElementTy;
@@ -207,7 +207,7 @@ class ListRecTy : public RecTy {
 };
 
 /// 'dag' - Represent a dag fragment
-class DagRecTy : public RecTy {
+class LLVM_CLASS_ABI DagRecTy : public RecTy {
   friend detail::RecordKeeperImpl;
 
   DagRecTy(RecordKeeper &RK) : RecTy(DagRecTyKind, RK) {}
@@ -226,7 +226,7 @@ class DagRecTy : public RecTy {
 ///
 /// The list of superclasses is non-redundant, i.e. only contains classes that
 /// are not the superclass of some other listed class.
-class RecordRecTy final : public RecTy, public FoldingSetNode,
+class LLVM_CLASS_ABI RecordRecTy final : public RecTy, public FoldingSetNode,
                           public TrailingObjects<RecordRecTy, Record *> {
   friend class Record;
   friend detail::RecordKeeperImpl;
@@ -272,13 +272,13 @@ class RecordRecTy final : public RecTy, public FoldingSetNode,
 
 /// Find a common type that T1 and T2 convert to.
 /// Return 0 if no such type exists.
-RecTy *resolveTypes(RecTy *T1, RecTy *T2);
+LLVM_FUNC_ABI RecTy *resolveTypes(RecTy *T1, RecTy *T2);
 
 //===----------------------------------------------------------------------===//
 //  Initializer Classes
 //===----------------------------------------------------------------------===//
 
-class Init {
+class LLVM_CLASS_ABI Init {
 protected:
   /// Discriminator enum (for isa<>, dyn_cast<>, et al.)
   ///
@@ -410,7 +410,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const Init &I) {
 
 /// This is the common superclass of types that have a specific,
 /// explicit type, stored in ValueTy.
-class TypedInit : public Init {
+class LLVM_CLASS_ABI TypedInit : public Init {
   RecTy *ValueTy;
 
 protected:
@@ -444,7 +444,7 @@ class TypedInit : public Init {
 };
 
 /// '?' - Represents an uninitialized value.
-class UnsetInit : public Init {
+class LLVM_CLASS_ABI UnsetInit : public Init {
   friend detail::RecordKeeperImpl;
 
   /// The record keeper that initialized this Init.
@@ -483,7 +483,7 @@ class UnsetInit : public Init {
 };
 
 // Represent an argument.
-class ArgumentInit : public Init, public FoldingSetNode {
+class LLVM_CLASS_ABI ArgumentInit : public Init, public FoldingSetNode {
   Init *Value;
 
 protected:
@@ -516,7 +516,7 @@ class ArgumentInit : public Init, public FoldingSetNode {
 };
 
 /// 'true'/'false' - Represent a concrete initializer for a bit.
-class BitInit final : public TypedInit {
+class LLVM_CLASS_ABI BitInit final : public TypedInit {
   friend detail::RecordKeeperImpl;
 
   bool Value;
@@ -548,7 +548,7 @@ class BitInit final : public TypedInit {
 
 /// '{ a, b, c }' - Represents an initializer for a BitsRecTy value.
 /// It contains a vector of bits, whose size is determined by the type.
-class BitsInit final : public TypedInit, public FoldingSetNode,
+class LLVM_CLASS_ABI BitsInit final : public TypedInit, public FoldingSetNode,
                        public TrailingObjects<BitsInit, Init *> {
   unsigned NumBits;
 
@@ -599,7 +599,7 @@ class BitsInit final : public TypedInit, public FoldingSetNode,
 };
 
 /// '7' - Represent an initialization by a literal integer value.
-class IntInit : public TypedInit {
+class LLVM_CLASS_ABI IntInit : public TypedInit {
   int64_t Value;
 
   explicit IntInit(RecordKeeper &RK, int64_t V)
@@ -629,7 +629,7 @@ class IntInit : public TypedInit {
 };
 
 /// "anonymous_n" - Represent an anonymous record name
-class AnonymousNameInit : public TypedInit {
+class LLVM_CLASS_ABI AnonymousNameInit : public TypedInit {
   unsigned Value;
 
   explicit AnonymousNameInit(RecordKeeper &RK, unsigned V)
@@ -659,7 +659,7 @@ class AnonymousNameInit : public TypedInit {
 };
 
 /// "foo" - Represent an initialization by a string value.
-class StringInit : public TypedInit {
+class LLVM_CLASS_ABI StringInit : public TypedInit {
 public:
   enum StringFormat {
     SF_String, // Format as "text"
@@ -714,7 +714,7 @@ class StringInit : public TypedInit {
 
 /// [AL, AH, CL] - Represent a list of defs
 ///
-class ListInit final : public TypedInit, public FoldingSetNode,
+class LLVM_CLASS_ABI ListInit final : public TypedInit, public FoldingSetNode,
                        public TrailingObjects<ListInit, Init *> {
   unsigned NumValues;
 
@@ -779,7 +779,7 @@ class ListInit final : public TypedInit, public FoldingSetNode,
 
 /// Base class for operators
 ///
-class OpInit : public TypedInit {
+class LLVM_CLASS_ABI OpInit : public TypedInit {
 protected:
   explicit OpInit(InitKind K, RecTy *Type, uint8_t Opc)
     : TypedInit(K, Type, Opc) {}
@@ -804,7 +804,7 @@ class OpInit : public TypedInit {
 
 /// !op (X) - Transform an init.
 ///
-class UnOpInit : public OpInit, public FoldingSetNode {
+class LLVM_CLASS_ABI UnOpInit : public OpInit, public FoldingSetNode {
 public:
   enum UnaryOp : uint8_t {
     TOLOWER,
@@ -864,7 +864,7 @@ class UnOpInit : public OpInit, public FoldingSetNode {
 };
 
 /// !op (X, Y) - Combine two inits.
-class BinOpInit : public OpInit, public FoldingSetNode {
+class LLVM_CLASS_ABI BinOpInit : public OpInit, public FoldingSetNode {
 public:
   enum BinaryOp : uint8_t {
     ADD,
@@ -951,7 +951,7 @@ class BinOpInit : public OpInit, public FoldingSetNode {
 };
 
 /// !op (X, Y, Z) - Combine two inits.
-class TernOpInit : public OpInit, public FoldingSetNode {
+class LLVM_CLASS_ABI TernOpInit : public OpInit, public FoldingSetNode {
 public:
   enum TernaryOp : uint8_t {
     SUBST,
@@ -1025,7 +1025,7 @@ class TernOpInit : public OpInit, public FoldingSetNode {
 /// !cond(condition_1: value1, ... , condition_n: value)
 /// Selects the first value for which condition is true.
 /// Otherwise reports an error.
-class CondOpInit final : public TypedInit, public FoldingSetNode,
+class LLVM_CLASS_ABI CondOpInit final : public TypedInit, public FoldingSetNode,
                       public TrailingObjects<CondOpInit, Init *> {
   unsigned NumConds;
   RecTy *ValType;
@@ -1100,7 +1100,7 @@ class CondOpInit final : public TypedInit, public FoldingSetNode,
 };
 
 /// !foldl (a, b, expr, start, lst) - Fold over a list.
-class FoldOpInit : public TypedInit, public FoldingSetNode {
+class LLVM_CLASS_ABI FoldOpInit : public TypedInit, public FoldingSetNode {
 private:
   Init *Start;
   Init *List;
@@ -1137,7 +1137,7 @@ class FoldOpInit : public TypedInit, public FoldingSetNode {
 };
 
 /// !isa<type>(expr) - Dynamically determine the type of an expression.
-class IsAOpInit : public TypedInit, public FoldingSetNode {
+class LLVM_CLASS_ABI IsAOpInit : public TypedInit, public FoldingSetNode {
 private:
   RecTy *CheckType;
   Init *Expr;
@@ -1171,7 +1171,7 @@ class IsAOpInit : public TypedInit, public FoldingSetNode {
 
 /// !exists<type>(expr) - Dynamically determine if a record of `type` named
 /// `expr` exists.
-class ExistsOpInit : public TypedInit, public FoldingSetNode {
+class LLVM_CLASS_ABI ExistsOpInit : public TypedInit, public FoldingSetNode {
 private:
   RecTy *CheckType;
   Init *Expr;
@@ -1204,7 +1204,7 @@ class ExistsOpInit : public TypedInit, public FoldingSetNode {
 };
 
 /// 'Opcode' - Represent a reference to an entire variable object.
-class VarInit : public TypedInit {
+class LLVM_CLASS_ABI VarInit : public TypedInit {
   Init *VarName;
 
   explicit VarInit(Init *VN, RecTy *T)
@@ -1241,7 +1241,7 @@ class VarInit : public TypedInit {
 };
 
 /// Opcode{0} - Represent access to one bit of a variable or field.
-class VarBitInit final : public TypedInit {
+class LLVM_CLASS_ABI VarBitInit final : public TypedInit {
   TypedInit *TI;
   unsigned Bit;
 
@@ -1278,7 +1278,7 @@ class VarBitInit final : public TypedInit {
 };
 
 /// AL - Represent a reference to a 'def' in the description
-class DefInit : public TypedInit {
+class LLVM_CLASS_ABI DefInit : public TypedInit {
   friend class Record;
 
   Record *Def;
@@ -1313,7 +1313,7 @@ class DefInit : public TypedInit {
 
 /// classname<targs...> - Represent an uninstantiated anonymous class
 /// instantiation.
-class VarDefInit final : public TypedInit,
+class LLVM_CLASS_ABI VarDefInit final : public TypedInit,
                          public FoldingSetNode,
                          public TrailingObjects<VarDefInit, ArgumentInit *> {
   Record *Class;
@@ -1368,7 +1368,7 @@ class VarDefInit final : public TypedInit,
 };
 
 /// X.Y - Represent a reference to a subfield of a variable
-class FieldInit : public TypedInit {
+class LLVM_CLASS_ABI FieldInit : public TypedInit {
   Init *Rec;                // Record we are referring to
   StringInit *FieldName;    // Field we are accessing
 
@@ -1411,7 +1411,7 @@ class FieldInit : public TypedInit {
 /// (v a, b) - Represent a DAG tree value.  DAG inits are required
 /// to have at least one value then a (possibly empty) list of arguments.  Each
 /// argument can have a name associated with it.
-class DagInit final : public TypedInit, public FoldingSetNode,
+class LLVM_CLASS_ABI DagInit final : public TypedInit, public FoldingSetNode,
                       public TrailingObjects<DagInit, Init *, StringInit *> {
   friend TrailingObjects;
 
@@ -1510,7 +1510,7 @@ class DagInit final : public TypedInit, public FoldingSetNode,
 
 /// This class represents a field in a record, including its name, type,
 /// value, and source location.
-class RecordVal {
+class LLVM_CLASS_ABI RecordVal {
   friend class Record;
 
 public:
@@ -1598,7 +1598,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const RecordVal &RV) {
   return OS;
 }
 
-class Record {
+class LLVM_CLASS_ABI Record {
 public:
   struct AssertionInfo {
     SMLoc Loc;
@@ -1911,9 +1911,9 @@ class Record {
   DagInit *getValueAsDag(StringRef FieldName) const;
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const Record &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Record &R);
 
-class RecordKeeper {
+class LLVM_CLASS_ABI RecordKeeper {
   using RecordMap = std::map<std::string, std::unique_ptr<Record>, std::less<>>;
   using GlobalMap = std::map<std::string, Init *, std::less<>>;
 
@@ -2049,7 +2049,7 @@ class RecordKeeper {
 };
 
 /// Sorting predicate to sort record pointers by name.
-struct LessRecord {
+struct LLVM_CLASS_ABI LessRecord {
   bool operator()(const Record *Rec1, const Record *Rec2) const {
     return StringRef(Rec1->getName()).compare_numeric(Rec2->getName()) < 0;
   }
@@ -2059,7 +2059,7 @@ struct LessRecord {
 /// unique ID. If you just need a deterministic order, use this, since it
 /// just compares two `unsigned`; the other sorting predicates require
 /// string manipulation.
-struct LessRecordByID {
+struct LLVM_CLASS_ABI LessRecordByID {
   bool operator()(const Record *LHS, const Record *RHS) const {
     return LHS->getID() < RHS->getID();
   }
@@ -2067,13 +2067,13 @@ struct LessRecordByID {
 
 /// Sorting predicate to sort record pointers by their
 /// name field.
-struct LessRecordFieldName {
+struct LLVM_CLASS_ABI LessRecordFieldName {
   bool operator()(const Record *Rec1, const Record *Rec2) const {
     return Rec1->getValueAsString("Name") < Rec2->getValueAsString("Name");
   }
 };
 
-struct LessRecordRegister {
+struct LLVM_CLASS_ABI LessRecordRegister {
   struct RecordParts {
     SmallVector<std::pair< bool, StringRef>, 4> Parts;
 
@@ -2150,7 +2150,7 @@ struct LessRecordRegister {
   }
 };
 
-raw_ostream &operator<<(raw_ostream &OS, const RecordKeeper &RK);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const RecordKeeper &RK);
 
 //===----------------------------------------------------------------------===//
 //  Resolvers
@@ -2158,7 +2158,7 @@ raw_ostream &operator<<(raw_ostream &OS, const RecordKeeper &RK);
 
 /// Interface for looking up the initializer for a variable name, used by
 /// Init::resolveReferences.
-class Resolver {
+class LLVM_CLASS_ABI Resolver {
   Record *CurRec;
   bool IsFinal = false;
 
@@ -2186,7 +2186,7 @@ class Resolver {
 };
 
 /// Resolve arbitrary mappings.
-class MapResolver final : public Resolver {
+class LLVM_CLASS_ABI MapResolver final : public Resolver {
   struct MappedValue {
     Init *V;
     bool Resolved;
@@ -2212,7 +2212,7 @@ class MapResolver final : public Resolver {
 };
 
 /// Resolve all variables from a record except for unset variables.
-class RecordResolver final : public Resolver {
+class LLVM_CLASS_ABI RecordResolver final : public Resolver {
   DenseMap<Init *, Init *> Cache;
   SmallVector<Init *, 4> Stack;
   Init *Name = nullptr;
@@ -2228,7 +2228,7 @@ class RecordResolver final : public Resolver {
 };
 
 /// Delegate resolving to a sub-resolver, but shadow some variable names.
-class ShadowResolver final : public Resolver {
+class LLVM_CLASS_ABI ShadowResolver final : public Resolver {
   Resolver &R;
   DenseSet<Init *> Shadowed;
 
@@ -2249,7 +2249,7 @@ class ShadowResolver final : public Resolver {
 
 /// (Optionally) delegate resolving to a sub-resolver, and keep track whether
 /// there were unresolved references.
-class TrackUnresolvedResolver final : public Resolver {
+class LLVM_CLASS_ABI TrackUnresolvedResolver final : public Resolver {
   Resolver *R;
   bool FoundUnresolved = false;
 
@@ -2264,7 +2264,7 @@ class TrackUnresolvedResolver final : public Resolver {
 
 /// Do not resolve anything, but keep track of whether a given variable was
 /// referenced.
-class HasReferenceResolver final : public Resolver {
+class LLVM_CLASS_ABI HasReferenceResolver final : public Resolver {
   Init *VarNameToTrack;
   bool Found = false;
 
@@ -2277,8 +2277,8 @@ class HasReferenceResolver final : public Resolver {
   Init *resolve(Init *VarName) override;
 };
 
-void EmitDetailedRecords(RecordKeeper &RK, raw_ostream &OS);
-void EmitJSON(RecordKeeper &RK, raw_ostream &OS);
+LLVM_FUNC_ABI void EmitDetailedRecords(RecordKeeper &RK, raw_ostream &OS);
+LLVM_FUNC_ABI void EmitJSON(RecordKeeper &RK, raw_ostream &OS);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/TableGen/SetTheory.h b/llvm/include/llvm/TableGen/SetTheory.h
index 146905451b2711a..9420bf7423d051c 100644
--- a/llvm/include/llvm/TableGen/SetTheory.h
+++ b/llvm/include/llvm/TableGen/SetTheory.h
@@ -63,7 +63,7 @@ class DagInit;
 class Init;
 class Record;
 
-class SetTheory {
+class LLVM_CLASS_ABI SetTheory {
 public:
   using RecVec = std::vector<Record *>;
   using RecSet = SmallSetVector<Record *, 16>;
diff --git a/llvm/include/llvm/TableGen/StringMatcher.h b/llvm/include/llvm/TableGen/StringMatcher.h
index 856a3cd7a689613..ab2c25e6c5561eb 100644
--- a/llvm/include/llvm/TableGen/StringMatcher.h
+++ b/llvm/include/llvm/TableGen/StringMatcher.h
@@ -28,7 +28,7 @@ class raw_ostream;
 ///
 /// If a match is found, the code in Matches[i].second is executed; control must
 /// not exit this code fragment.  If nothing matches, execution falls through.
-class StringMatcher {
+class LLVM_CLASS_ABI StringMatcher {
 public:
   using StringPair = std::pair<std::string, std::string>;
 
diff --git a/llvm/include/llvm/TableGen/TableGenBackend.h b/llvm/include/llvm/TableGen/TableGenBackend.h
index 560927078e1343c..560cc3a2b84c0c7 100644
--- a/llvm/include/llvm/TableGen/TableGenBackend.h
+++ b/llvm/include/llvm/TableGen/TableGenBackend.h
@@ -26,13 +26,13 @@ class raw_ostream;
 namespace TableGen::Emitter {
 using FnT = void (*)(RecordKeeper &Records, raw_ostream &OS);
 
-struct OptCreatorT {
+struct LLVM_CLASS_ABI OptCreatorT {
   static void *call();
 };
 
-extern ManagedStatic<cl::opt<FnT>, OptCreatorT> Action;
+LLVM_FUNC_ABI extern ManagedStatic<cl::opt<FnT>, OptCreatorT> Action;
 
-struct Opt {
+struct LLVM_CLASS_ABI Opt {
   Opt(StringRef Name, FnT CB, StringRef Desc, bool ByDefault = false) {
     if (ByDefault)
       Action->setInitialValue(CB);
@@ -40,7 +40,7 @@ struct Opt {
   }
 };
 
-template <class EmitterC> class OptClass : Opt {
+template <class EmitterC> class LLVM_CLASS_ABI OptClass : Opt {
   static void run(RecordKeeper &RK, raw_ostream &OS) { EmitterC(RK).run(OS); }
 
 public:
@@ -51,7 +51,7 @@ template <class EmitterC> class OptClass : Opt {
 
 /// emitSourceFileHeader - Output an LLVM style file header to the specified
 /// raw_ostream.
-void emitSourceFileHeader(StringRef Desc, raw_ostream &OS);
+LLVM_FUNC_ABI void emitSourceFileHeader(StringRef Desc, raw_ostream &OS);
 
 } // End llvm namespace
 
diff --git a/llvm/include/llvm/Target/CGPassBuilderOption.h b/llvm/include/llvm/Target/CGPassBuilderOption.h
index 08969ee7c22a910..f8a4b2bd22c82a6 100644
--- a/llvm/include/llvm/Target/CGPassBuilderOption.h
+++ b/llvm/include/llvm/Target/CGPassBuilderOption.h
@@ -26,7 +26,7 @@ enum class RegAllocType { Default, Basic, Fast, Greedy, PBQP };
 
 // Not one-on-one but mostly corresponding to commandline options in
 // TargetPassConfig.cpp.
-struct CGPassBuilderOption {
+struct LLVM_CLASS_ABI CGPassBuilderOption {
   std::optional<bool> OptimizeRegAlloc;
   std::optional<bool> EnableIPRA;
   bool DebugPM = false;
@@ -56,7 +56,7 @@ struct CGPassBuilderOption {
   std::optional<bool> EnableGlobalISelOption;
 };
 
-CGPassBuilderOption getCGPassBuilderOption();
+LLVM_FUNC_ABI CGPassBuilderOption getCGPassBuilderOption();
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Target/TargetIntrinsicInfo.h b/llvm/include/llvm/Target/TargetIntrinsicInfo.h
index ef571b15153e7db..1a33a97ff172b41 100644
--- a/llvm/include/llvm/Target/TargetIntrinsicInfo.h
+++ b/llvm/include/llvm/Target/TargetIntrinsicInfo.h
@@ -27,7 +27,7 @@ class Type;
 ///
 /// TargetIntrinsicInfo - Interface to description of machine instruction set
 ///
-class TargetIntrinsicInfo {
+class LLVM_CLASS_ABI TargetIntrinsicInfo {
   TargetIntrinsicInfo(const TargetIntrinsicInfo &) = delete;
   void operator=(const TargetIntrinsicInfo &) = delete;
 public:
diff --git a/llvm/include/llvm/Target/TargetLoweringObjectFile.h b/llvm/include/llvm/Target/TargetLoweringObjectFile.h
index 4ebbf95466c9e37..5c801330a08f55b 100644
--- a/llvm/include/llvm/Target/TargetLoweringObjectFile.h
+++ b/llvm/include/llvm/Target/TargetLoweringObjectFile.h
@@ -43,7 +43,7 @@ class StringRef;
 class TargetMachine;
 class DSOLocalEquivalent;
 
-class TargetLoweringObjectFile : public MCObjectFileInfo {
+class LLVM_CLASS_ABI TargetLoweringObjectFile : public MCObjectFileInfo {
   /// Name-mangler for global names.
   Mangler *Mang = nullptr;
 
diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
index 7599aa7ff492d9f..71b5512c880211f 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/include/llvm/Target/TargetMachine.h
@@ -76,7 +76,7 @@ struct MachineFunctionInfo;
 /// machine.  All target-specific information should be accessible through this
 /// interface.
 ///
-class TargetMachine {
+class LLVM_CLASS_ABI TargetMachine {
 protected: // Can only create subclasses.
   TargetMachine(const Target &T, StringRef DataLayoutString,
                 const Triple &TargetTriple, StringRef CPU, StringRef FS,
@@ -417,7 +417,7 @@ class TargetMachine {
 /// This class describes a target machine that is implemented with the LLVM
 /// target-independent code generator.
 ///
-class LLVMTargetMachine : public TargetMachine {
+class LLVM_CLASS_ABI LLVMTargetMachine : public TargetMachine {
 protected: // Can only create subclasses.
   LLVMTargetMachine(const Target &T, StringRef DataLayoutString,
                     const Triple &TT, StringRef CPU, StringRef FS,
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index ee6598fda4fbb7d..fa1f54bf184b3e7 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -122,7 +122,7 @@ namespace llvm {
     Never,
   };
 
-  class TargetOptions {
+  class LLVM_CLASS_ABI TargetOptions {
   public:
     TargetOptions()
         : UnsafeFPMath(false), NoInfsFPMath(false), NoNaNsFPMath(false),
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index 594f70a4e60a013..f2ab96ee7afbd3f 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -162,7 +162,7 @@ enum ArchExtKind : uint64_t {
 // Typically these correspond to Arm Architecture extensions, unlike
 // SubtargetFeature which may represent either an actual extension or some
 // internal LLVM property.
-struct ExtensionInfo {
+struct LLVM_CLASS_ABI ExtensionInfo {
   StringRef Name;              // Human readable name, e.g. "profile".
   ArchExtKind ID;              // Corresponding to the ArchExtKind, this
                                // extensions representation in the bitfield.
@@ -269,7 +269,7 @@ inline constexpr ExtensionInfo Extensions[] = {
 enum ArchProfile { AProfile = 'A', RProfile = 'R', InvalidProfile = '?' };
 
 // Information about a specific architecture, e.g. V8.1-A
-struct ArchInfo {
+struct LLVM_CLASS_ABI ArchInfo {
   VersionTuple Version;  // Architecture version, major + minor.
   ArchProfile Profile;   // Architecuture profile
   StringRef Name;        // Human readable name, e.g. "armv8.1-a"
@@ -343,7 +343,7 @@ static constexpr std::array<const ArchInfo *, 16> ArchInfos = {
 };
 
 // Details of a specific CPU.
-struct CpuInfo {
+struct LLVM_CLASS_ABI CpuInfo {
   StringRef Name; // Name, as written for -mcpu.
   const ArchInfo &Arch;
   uint64_t DefaultExtensions; // Default extensions for this CPU. These will be
@@ -546,36 +546,36 @@ inline constexpr CpuInfo CpuInfos[] = {
 };
 
 // An alias for a CPU.
-struct CpuAlias {
+struct LLVM_CLASS_ABI CpuAlias {
   StringRef Alias;
   StringRef Name;
 };
 
 inline constexpr CpuAlias CpuAliases[] = {{"grace", "neoverse-v2"}};
 
-bool getExtensionFeatures(uint64_t Extensions,
+LLVM_FUNC_ABI bool getExtensionFeatures(uint64_t Extensions,
                           std::vector<StringRef> &Features);
 
-StringRef getArchExtFeature(StringRef ArchExt);
-StringRef resolveCPUAlias(StringRef CPU);
+LLVM_FUNC_ABI StringRef getArchExtFeature(StringRef ArchExt);
+LLVM_FUNC_ABI StringRef resolveCPUAlias(StringRef CPU);
 
 // Information by Name
-std::optional<ArchInfo> getArchForCpu(StringRef CPU);
+LLVM_FUNC_ABI std::optional<ArchInfo> getArchForCpu(StringRef CPU);
 
 // Parser
-std::optional<ArchInfo> parseArch(StringRef Arch);
-std::optional<ExtensionInfo> parseArchExtension(StringRef Extension);
+LLVM_FUNC_ABI std::optional<ArchInfo> parseArch(StringRef Arch);
+LLVM_FUNC_ABI std::optional<ExtensionInfo> parseArchExtension(StringRef Extension);
 // Given the name of a CPU or alias, return the correponding CpuInfo.
-std::optional<CpuInfo> parseCpu(StringRef Name);
+LLVM_FUNC_ABI std::optional<CpuInfo> parseCpu(StringRef Name);
 // Used by target parser tests
-void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
+LLVM_FUNC_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
 
-bool isX18ReservedByDefault(const Triple &TT);
+LLVM_FUNC_ABI bool isX18ReservedByDefault(const Triple &TT);
 
 // For given feature names, return a bitmask corresponding to the entries of
 // AArch64::CPUFeatures. The values in CPUFeatures are not bitmasks
 // themselves, they are sequential (0, 1, 2, 3, ...).
-uint64_t getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs);
+LLVM_FUNC_ABI uint64_t getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs);
 
 } // namespace AArch64
 } // namespace llvm
diff --git a/llvm/include/llvm/TargetParser/ARMTargetParser.h b/llvm/include/llvm/TargetParser/ARMTargetParser.h
index a7c63f8ff469376..a1cdab22908c1cb 100644
--- a/llvm/include/llvm/TargetParser/ARMTargetParser.h
+++ b/llvm/include/llvm/TargetParser/ARMTargetParser.h
@@ -70,7 +70,7 @@ enum ArchExtKind : uint64_t {
 };
 
 // List of Arch Extension names.
-struct ExtName {
+struct LLVM_CLASS_ABI ExtName {
   StringRef Name;
   uint64_t ID;
   StringRef Feature;
@@ -85,7 +85,7 @@ const ExtName ARCHExtNames[] = {
 
 // List of HWDiv names (use getHWDivSynonym) and which architectural
 // features they correspond to (use getHWDivFeatures).
-const struct {
+const struct LLVM_CLASS_ABI {
   StringRef Name;
   uint64_t ID;
 } HWDivNames[] = {
@@ -105,7 +105,7 @@ enum class ArchKind {
 // The same CPU can have multiple arches and can be default on multiple arches.
 // When finding the Arch for a CPU, first-found prevails. Sort them accordingly.
 // When this becomes table-generated, we'd probably need two tables.
-struct CpuNames {
+struct LLVM_CLASS_ABI CpuNames {
   StringRef Name;
   ArchKind ArchID;
   bool Default; // is $Name the default CPU for $ArchID ?
@@ -157,7 +157,7 @@ enum class ProfileKind { INVALID = 0, A, R, M };
 // features they correspond to (use getFPUFeatures).
 // The entries must appear in the order listed in ARM::FPUKind for correct
 // indexing
-struct FPUName {
+struct LLVM_CLASS_ABI FPUName {
   StringRef Name;
   FPUKind ID;
   FPUVersion FPUVer;
@@ -178,7 +178,7 @@ static const FPUName FPUNames[] = {
 // FIXME: SubArch values were simplified to fit into the expectations
 // of the triples and are not conforming with their official names.
 // Check to see if the expectation should be changed.
-struct ArchNames {
+struct LLVM_CLASS_ABI ArchNames {
   StringRef Name;
   StringRef CPUAttr; // CPU class in build attributes.
   StringRef ArchFeature;
@@ -214,51 +214,51 @@ inline ArchKind &operator--(ArchKind &Kind) {
 }
 
 // Information by ID
-StringRef getFPUName(FPUKind FPUKind);
-FPUVersion getFPUVersion(FPUKind FPUKind);
-NeonSupportLevel getFPUNeonSupportLevel(FPUKind FPUKind);
-FPURestriction getFPURestriction(FPUKind FPUKind);
-
-bool getFPUFeatures(FPUKind FPUKind, std::vector<StringRef> &Features);
-bool getHWDivFeatures(uint64_t HWDivKind, std::vector<StringRef> &Features);
-bool getExtensionFeatures(uint64_t Extensions,
+LLVM_FUNC_ABI StringRef getFPUName(FPUKind FPUKind);
+LLVM_FUNC_ABI FPUVersion getFPUVersion(FPUKind FPUKind);
+LLVM_FUNC_ABI NeonSupportLevel getFPUNeonSupportLevel(FPUKind FPUKind);
+LLVM_FUNC_ABI FPURestriction getFPURestriction(FPUKind FPUKind);
+
+LLVM_FUNC_ABI bool getFPUFeatures(FPUKind FPUKind, std::vector<StringRef> &Features);
+LLVM_FUNC_ABI bool getHWDivFeatures(uint64_t HWDivKind, std::vector<StringRef> &Features);
+LLVM_FUNC_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_FUNC_ABI StringRef getArchName(ArchKind AK);
+LLVM_FUNC_ABI unsigned getArchAttr(ArchKind AK);
+LLVM_FUNC_ABI StringRef getCPUAttr(ArchKind AK);
+LLVM_FUNC_ABI StringRef getSubArch(ArchKind AK);
+LLVM_FUNC_ABI StringRef getArchExtName(uint64_t ArchExtKind);
+LLVM_FUNC_ABI StringRef getArchExtFeature(StringRef ArchExt);
+LLVM_FUNC_ABI bool appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK, StringRef ArchExt,
                            std::vector<StringRef> &Features,
                            FPUKind &ArgFPUKind);
-ArchKind convertV9toV8(ArchKind AK);
+LLVM_FUNC_ABI ArchKind convertV9toV8(ArchKind AK);
 
 // Information by Name
-FPUKind getDefaultFPU(StringRef CPU, ArchKind AK);
-uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK);
-StringRef getDefaultCPU(StringRef Arch);
-StringRef getCanonicalArchName(StringRef Arch);
-StringRef getFPUSynonym(StringRef FPU);
+LLVM_FUNC_ABI FPUKind getDefaultFPU(StringRef CPU, ArchKind AK);
+LLVM_FUNC_ABI uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK);
+LLVM_FUNC_ABI StringRef getDefaultCPU(StringRef Arch);
+LLVM_FUNC_ABI StringRef getCanonicalArchName(StringRef Arch);
+LLVM_FUNC_ABI StringRef getFPUSynonym(StringRef FPU);
 
 // Parser
-uint64_t parseHWDiv(StringRef HWDiv);
-FPUKind parseFPU(StringRef FPU);
-ArchKind parseArch(StringRef Arch);
-uint64_t parseArchExt(StringRef ArchExt);
-ArchKind parseCPUArch(StringRef CPU);
-ProfileKind parseArchProfile(StringRef Arch);
-unsigned parseArchVersion(StringRef Arch);
+LLVM_FUNC_ABI uint64_t parseHWDiv(StringRef HWDiv);
+LLVM_FUNC_ABI FPUKind parseFPU(StringRef FPU);
+LLVM_FUNC_ABI ArchKind parseArch(StringRef Arch);
+LLVM_FUNC_ABI uint64_t parseArchExt(StringRef ArchExt);
+LLVM_FUNC_ABI ArchKind parseCPUArch(StringRef CPU);
+LLVM_FUNC_ABI ProfileKind parseArchProfile(StringRef Arch);
+LLVM_FUNC_ABI unsigned parseArchVersion(StringRef Arch);
 
-void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
-StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU);
+LLVM_FUNC_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
+LLVM_FUNC_ABI StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU);
 
 /// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting.
 ///
 /// \param Arch the architecture name (e.g., "armv7s"). If it is an empty
 /// string then the triple's arch name is used.
-StringRef getARMCPUForArch(const llvm::Triple &Triple, StringRef MArch = {});
+LLVM_FUNC_ABI StringRef getARMCPUForArch(const llvm::Triple &Triple, StringRef MArch = {});
 
 } // namespace ARM
 } // namespace llvm
diff --git a/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h b/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h
index 0e9bae86fed558f..6e8c8d84a50af10 100644
--- a/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h
+++ b/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h
@@ -24,27 +24,27 @@ enum class ISAKind { INVALID = 0, ARM, THUMB, AARCH64 };
 enum class EndianKind { INVALID = 0, LITTLE, BIG };
 
 /// Converts e.g. "armv8" -> "armv8-a"
-StringRef getArchSynonym(StringRef Arch);
+LLVM_FUNC_ABI StringRef getArchSynonym(StringRef Arch);
 
 /// MArch is expected to be of the form (arm|thumb)?(eb)?(v.+)?(eb)?, but
 /// (iwmmxt|xscale)(eb)? is also permitted. If the former, return
 /// "v.+", if the latter, return unmodified string, minus 'eb'.
 /// If invalid, return empty string.
-StringRef getCanonicalArchName(StringRef Arch);
+LLVM_FUNC_ABI StringRef getCanonicalArchName(StringRef Arch);
 
 // ARM, Thumb, AArch64
-ISAKind parseArchISA(StringRef Arch);
+LLVM_FUNC_ABI ISAKind parseArchISA(StringRef Arch);
 
 // Little/Big endian
-EndianKind parseArchEndian(StringRef Arch);
+LLVM_FUNC_ABI EndianKind parseArchEndian(StringRef Arch);
 
-struct ParsedBranchProtection {
+struct LLVM_CLASS_ABI ParsedBranchProtection {
   StringRef Scope;
   StringRef Key;
   bool BranchTargetEnforcement;
 };
 
-bool parseBranchProtection(StringRef Spec, ParsedBranchProtection &PBP,
+LLVM_FUNC_ABI bool parseBranchProtection(StringRef Spec, ParsedBranchProtection &PBP,
                            StringRef &Err);
 
 } // namespace ARM
diff --git a/llvm/include/llvm/TargetParser/CSKYTargetParser.h b/llvm/include/llvm/TargetParser/CSKYTargetParser.h
index 5a9f95056801e37..c0c2b33515d1c1d 100644
--- a/llvm/include/llvm/TargetParser/CSKYTargetParser.h
+++ b/llvm/include/llvm/TargetParser/CSKYTargetParser.h
@@ -115,7 +115,7 @@ enum class ArchKind {
 
 // List of Arch Extension names.
 // FIXME: TableGen this.
-struct ExtName {
+struct LLVM_CLASS_ABI ExtName {
   const char *NameCStr;
   size_t NameLength;
   uint64_t ID;
@@ -132,7 +132,7 @@ const CSKY::ExtName CSKYARCHExtNames[] = {
 };
 
 // List of CPU names and their arches.
-template <typename T> struct CpuNames {
+template <typename T> struct LLVM_CLASS_ABI CpuNames {
   const char *NameCStr;
   size_t NameLength;
   T ArchID;
@@ -149,7 +149,7 @@ const CpuNames<CSKY::ArchKind> CPUNames[] = {
 // FIXME: TableGen this.
 // The entries must appear in the order listed in CSKY::CSKYFPUKind for correct
 // indexing
-struct FPUName {
+struct LLVM_CLASS_ABI FPUName {
   const char *NameCStr;
   size_t NameLength;
   CSKYFPUKind ID;
@@ -164,7 +164,7 @@ static const FPUName FPUNames[] = {
 };
 
 // List of canonical arch names.
-template <typename T> struct ArchNames {
+template <typename T> struct LLVM_CLASS_ABI ArchNames {
   const char *NameCStr;
   size_t NameLength;
   T ID;
@@ -177,25 +177,25 @@ const ArchNames<CSKY::ArchKind> ARCHNames[] = {
 #include "llvm/TargetParser/CSKYTargetParser.def"
 };
 
-StringRef getArchName(ArchKind AK);
-StringRef getDefaultCPU(StringRef Arch);
-StringRef getArchExtName(uint64_t ArchExtKind);
-StringRef getArchExtFeature(StringRef ArchExt);
-uint64_t getDefaultExtensions(StringRef CPU);
-bool getExtensionFeatures(uint64_t Extensions,
+LLVM_FUNC_ABI StringRef getArchName(ArchKind AK);
+LLVM_FUNC_ABI StringRef getDefaultCPU(StringRef Arch);
+LLVM_FUNC_ABI StringRef getArchExtName(uint64_t ArchExtKind);
+LLVM_FUNC_ABI StringRef getArchExtFeature(StringRef ArchExt);
+LLVM_FUNC_ABI uint64_t getDefaultExtensions(StringRef CPU);
+LLVM_FUNC_ABI bool getExtensionFeatures(uint64_t Extensions,
                           std::vector<StringRef> &Features);
 
 // Information by ID
-StringRef getFPUName(unsigned FPUKind);
-FPUVersion getFPUVersion(unsigned FPUKind);
+LLVM_FUNC_ABI StringRef getFPUName(unsigned FPUKind);
+LLVM_FUNC_ABI FPUVersion getFPUVersion(unsigned FPUKind);
 
-bool getFPUFeatures(CSKYFPUKind Kind, std::vector<StringRef> &Features);
+LLVM_FUNC_ABI bool getFPUFeatures(CSKYFPUKind Kind, std::vector<StringRef> &Features);
 
 // Parser
-ArchKind parseArch(StringRef Arch);
-ArchKind parseCPUArch(StringRef CPU);
-uint64_t parseArchExt(StringRef ArchExt);
-void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
+LLVM_FUNC_ABI ArchKind parseArch(StringRef Arch);
+LLVM_FUNC_ABI ArchKind parseCPUArch(StringRef CPU);
+LLVM_FUNC_ABI uint64_t parseArchExt(StringRef ArchExt);
+LLVM_FUNC_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values);
 
 } // namespace CSKY
 
diff --git a/llvm/include/llvm/TargetParser/Host.h b/llvm/include/llvm/TargetParser/Host.h
index 2c86d26c395ce7d..976c1ff80f9f566 100644
--- a/llvm/include/llvm/TargetParser/Host.h
+++ b/llvm/include/llvm/TargetParser/Host.h
@@ -31,18 +31,18 @@ namespace sys {
   ///   CPU_TYPE-VENDOR-OPERATING_SYSTEM
   /// or
   ///   CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM
-  std::string getDefaultTargetTriple();
+  LLVM_FUNC_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_FUNC_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_FUNC_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
@@ -54,20 +54,20 @@ namespace sys {
   /// all valid LLVM feature names.
   ///
   /// \return - True on success.
-  bool getHostCPUFeatures(StringMap<bool, MallocAllocator> &Features);
+  LLVM_FUNC_ABI bool getHostCPUFeatures(StringMap<bool, MallocAllocator> &Features);
 
   /// This is a function compatible with cl::AddExtraVersionPrinter, which adds
   /// info about the current target triple and detected CPU.
-  void printDefaultTargetAndDetectedCPU(raw_ostream &OS);
+  LLVM_FUNC_ABI void printDefaultTargetAndDetectedCPU(raw_ostream &OS);
 
   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 getHostCPUNameForRISCV(StringRef ProcCpuinfoContent);
-  StringRef getHostCPUNameForSPARC(StringRef ProcCpuinfoContent);
-  StringRef getHostCPUNameForBPF();
+  LLVM_FUNC_ABI StringRef getHostCPUNameForPowerPC(StringRef ProcCpuinfoContent);
+  LLVM_FUNC_ABI StringRef getHostCPUNameForARM(StringRef ProcCpuinfoContent);
+  LLVM_FUNC_ABI StringRef getHostCPUNameForS390x(StringRef ProcCpuinfoContent);
+  LLVM_FUNC_ABI StringRef getHostCPUNameForRISCV(StringRef ProcCpuinfoContent);
+  LLVM_FUNC_ABI StringRef getHostCPUNameForSPARC(StringRef ProcCpuinfoContent);
+  LLVM_FUNC_ABI StringRef getHostCPUNameForBPF();
 
   /// Helper functions to extract CPU details from CPUID on x86.
   namespace x86 {
@@ -80,7 +80,7 @@ namespace sys {
   /// Returns the host CPU's vendor.
   /// MaxLeaf: if a non-nullptr pointer is specified, the EAX value will be
   /// assigned to its pointee.
-  VendorSignatures getVendorSignature(unsigned *MaxLeaf = nullptr);
+  LLVM_FUNC_ABI VendorSignatures getVendorSignature(unsigned *MaxLeaf = nullptr);
   } // namespace x86
   }
 }
diff --git a/llvm/include/llvm/TargetParser/LoongArchTargetParser.h b/llvm/include/llvm/TargetParser/LoongArchTargetParser.h
index b715a0078eca80a..652b952b3ef4a42 100644
--- a/llvm/include/llvm/TargetParser/LoongArchTargetParser.h
+++ b/llvm/include/llvm/TargetParser/LoongArchTargetParser.h
@@ -52,7 +52,7 @@ enum FeatureKind : uint32_t {
   FK_UAL = 1 << 8,
 };
 
-struct FeatureInfo {
+struct LLVM_CLASS_ABI FeatureInfo {
   StringRef Name;
   FeatureKind Kind;
 };
@@ -62,14 +62,14 @@ enum class ArchKind {
 #include "LoongArchTargetParser.def"
 };
 
-struct ArchInfo {
+struct LLVM_CLASS_ABI ArchInfo {
   StringRef Name;
   ArchKind Kind;
   uint32_t Features;
 };
 
-ArchKind parseArch(StringRef Arch);
-bool getArchFeatures(StringRef Arch, std::vector<StringRef> &Features);
+LLVM_FUNC_ABI ArchKind parseArch(StringRef Arch);
+LLVM_FUNC_ABI bool getArchFeatures(StringRef Arch, std::vector<StringRef> &Features);
 
 } // namespace LoongArch
 
diff --git a/llvm/include/llvm/TargetParser/RISCVTargetParser.h b/llvm/include/llvm/TargetParser/RISCVTargetParser.h
index d4ab3ad48439f23..cf70d6b57ddbc61 100644
--- a/llvm/include/llvm/TargetParser/RISCVTargetParser.h
+++ b/llvm/include/llvm/TargetParser/RISCVTargetParser.h
@@ -27,11 +27,11 @@ namespace RISCV {
 // We use 64 bits as the known part in the scalable vector types.
 static constexpr unsigned RVVBitsPerBlock = 64;
 
-bool parseCPU(StringRef CPU, bool IsRV64);
-bool parseTuneCPU(StringRef CPU, bool IsRV64);
-StringRef getMArchFromMcpu(StringRef CPU);
-void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
-void fillValidTuneCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
+LLVM_FUNC_ABI bool parseCPU(StringRef CPU, bool IsRV64);
+LLVM_FUNC_ABI bool parseTuneCPU(StringRef CPU, bool IsRV64);
+LLVM_FUNC_ABI StringRef getMArchFromMcpu(StringRef CPU);
+LLVM_FUNC_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
+LLVM_FUNC_ABI void fillValidTuneCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
 
 } // namespace RISCV
 } // namespace llvm
diff --git a/llvm/include/llvm/TargetParser/SubtargetFeature.h b/llvm/include/llvm/TargetParser/SubtargetFeature.h
index 9f64929a669ff26..9c228faa6df8652 100644
--- a/llvm/include/llvm/TargetParser/SubtargetFeature.h
+++ b/llvm/include/llvm/TargetParser/SubtargetFeature.h
@@ -39,7 +39,7 @@ const unsigned MAX_SUBTARGET_FEATURES = MAX_SUBTARGET_WORDS * 64;
 /// This is a constexpr reimplementation of a subset of std::bitset. It would be
 /// nice to use std::bitset directly, but it doesn't support constant
 /// initialization.
-class FeatureBitset {
+class LLVM_CLASS_ABI FeatureBitset {
   static_assert((MAX_SUBTARGET_FEATURES % 64) == 0,
                 "Should be a multiple of 64!");
   std::array<uint64_t, MAX_SUBTARGET_WORDS> Bits{};
@@ -161,7 +161,7 @@ class FeatureBitset {
 };
 
 /// Class used to store the subtarget bits in the tables created by tablegen.
-class FeatureBitArray : public FeatureBitset {
+class LLVM_CLASS_ABI FeatureBitArray : public FeatureBitset {
 public:
   constexpr FeatureBitArray(const std::array<uint64_t, MAX_SUBTARGET_WORDS> &B)
       : FeatureBitset(B) {}
@@ -179,7 +179,7 @@ class FeatureBitArray : public FeatureBitset {
 /// Each of the remaining features is prefixed with + or - indicating whether
 /// that feature should be enabled or disabled contrary to the cpu
 /// specification.
-class SubtargetFeatures {
+class LLVM_CLASS_ABI SubtargetFeatures {
   std::vector<std::string> Features;    ///< Subtarget features as a vector
 
 public:
diff --git a/llvm/include/llvm/TargetParser/TargetParser.h b/llvm/include/llvm/TargetParser/TargetParser.h
index c5712bf247f8666..cb3ed71ea546aaa 100644
--- a/llvm/include/llvm/TargetParser/TargetParser.h
+++ b/llvm/include/llvm/TargetParser/TargetParser.h
@@ -110,7 +110,7 @@ enum GPUKind : uint32_t {
 };
 
 /// Instruction set architecture version.
-struct IsaVersion {
+struct LLVM_CLASS_ABI IsaVersion {
   unsigned Major;
   unsigned Minor;
   unsigned Stepping;
@@ -143,25 +143,25 @@ enum ArchFeatureKind : uint32_t {
   FEATURE_WGP = 1 << 9,
 };
 
-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_FUNC_ABI StringRef getArchNameAMDGCN(GPUKind AK);
+LLVM_FUNC_ABI StringRef getArchNameR600(GPUKind AK);
+LLVM_FUNC_ABI StringRef getCanonicalArchName(const Triple &T, StringRef Arch);
+LLVM_FUNC_ABI GPUKind parseArchAMDGCN(StringRef CPU);
+LLVM_FUNC_ABI GPUKind parseArchR600(StringRef CPU);
+LLVM_FUNC_ABI unsigned getArchAttrAMDGCN(GPUKind AK);
+LLVM_FUNC_ABI unsigned getArchAttrR600(GPUKind AK);
 
-void fillValidArchListAMDGCN(SmallVectorImpl<StringRef> &Values);
-void fillValidArchListR600(SmallVectorImpl<StringRef> &Values);
+LLVM_FUNC_ABI void fillValidArchListAMDGCN(SmallVectorImpl<StringRef> &Values);
+LLVM_FUNC_ABI void fillValidArchListR600(SmallVectorImpl<StringRef> &Values);
 
-IsaVersion getIsaVersion(StringRef GPU);
+LLVM_FUNC_ABI IsaVersion getIsaVersion(StringRef GPU);
 
 /// Fills Features map with default values for given target GPU
-void fillAMDGPUFeatureMap(StringRef GPU, const Triple &T,
+LLVM_FUNC_ABI void fillAMDGPUFeatureMap(StringRef GPU, const Triple &T,
                           StringMap<bool> &Features);
 
 /// Inserts wave size feature for given GPU into features map
-bool insertWaveSizeFeature(StringRef GPU, const Triple &T,
+LLVM_FUNC_ABI bool insertWaveSizeFeature(StringRef GPU, const Triple &T,
                            StringMap<bool> &Features, std::string &ErrorMsg);
 
 } // namespace AMDGPU
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index 6f8809bae8744fe..353982188223312 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -42,7 +42,7 @@ namespace llvm {
 ///
 /// See autoconf/config.guess for a glimpse into what configuration names
 /// look like in practice.
-class Triple {
+class LLVM_CLASS_ABI Triple {
 public:
   enum ArchType {
     UnknownArch,
diff --git a/llvm/include/llvm/TargetParser/X86TargetParser.h b/llvm/include/llvm/TargetParser/X86TargetParser.h
index 1a0e05cd5e20d39..0aea189a4a03558 100644
--- a/llvm/include/llvm/TargetParser/X86TargetParser.h
+++ b/llvm/include/llvm/TargetParser/X86TargetParser.h
@@ -141,34 +141,34 @@ enum CPUKind {
 
 /// 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_FUNC_ABI CPUKind parseArchX86(StringRef CPU, bool Only64Bit = false);
+LLVM_FUNC_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_FUNC_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values,
                           bool Only64Bit = false);
 /// Provide a list of valid -mtune names.
-void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values,
+LLVM_FUNC_ABI void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values,
                           bool Only64Bit = false);
 
 /// Get the key feature prioritizing target multiversioning.
-ProcessorFeatures getKeyFeature(CPUKind Kind);
+LLVM_FUNC_ABI ProcessorFeatures getKeyFeature(CPUKind Kind);
 
 /// Fill in the features that \p CPU supports into \p Features.
 /// "+" will be append in front of each feature if IfNeedPlus is true.
-void getFeaturesForCPU(StringRef CPU, SmallVectorImpl<StringRef> &Features,
+LLVM_FUNC_ABI void getFeaturesForCPU(StringRef CPU, SmallVectorImpl<StringRef> &Features,
                        bool IfNeedPlus = false);
 
 /// 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_FUNC_ABI void updateImpliedFeatures(StringRef Feature, bool Enabled,
                            StringMap<bool> &Features);
 
-char getCPUDispatchMangling(StringRef Name);
-bool validateCPUSpecificCPUDispatch(StringRef Name);
-uint64_t getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs);
-unsigned getFeaturePriority(ProcessorFeatures Feat);
+LLVM_FUNC_ABI char getCPUDispatchMangling(StringRef Name);
+LLVM_FUNC_ABI bool validateCPUSpecificCPUDispatch(StringRef Name);
+LLVM_FUNC_ABI uint64_t getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs);
+LLVM_FUNC_ABI unsigned getFeaturePriority(ProcessorFeatures Feat);
 
 } // namespace X86
 } // namespace llvm
diff --git a/llvm/include/llvm/Testing/Annotations/Annotations.h b/llvm/include/llvm/Testing/Annotations/Annotations.h
index cba192d12bcb79d..12f32fb354cc259 100644
--- a/llvm/include/llvm/Testing/Annotations/Annotations.h
+++ b/llvm/include/llvm/Testing/Annotations/Annotations.h
@@ -51,7 +51,7 @@ class raw_ostream;
 ///          2. making characters for marking points and ranges configurable,
 ///          3. changing the syntax to something less commonly used,
 ///          4. ...
-class Annotations {
+class LLVM_CLASS_ABI Annotations {
 public:
   /// Two offsets pointing to a continuous substring. End is not included, i.e.
   /// represents a half-open range.
@@ -126,7 +126,7 @@ class Annotations {
   llvm::StringMap<llvm::SmallVector<size_t, 1>> Ranges;
 };
 
-llvm::raw_ostream &operator<<(llvm::raw_ostream &O,
+LLVM_FUNC_ABI llvm::raw_ostream &operator<<(llvm::raw_ostream &O,
                               const llvm::Annotations::Range &R);
 
 } // namespace llvm
diff --git a/llvm/include/llvm/Testing/Support/Error.h b/llvm/include/llvm/Testing/Support/Error.h
index 6987b0c38e342d2..4d0ed1ce7d434b7 100644
--- a/llvm/include/llvm/Testing/Support/Error.h
+++ b/llvm/include/llvm/Testing/Support/Error.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 namespace detail {
-ErrorHolder TakeError(Error Err);
+LLVM_FUNC_ABI ErrorHolder TakeError(Error Err);
 
 template <typename T> ExpectedHolder<T> TakeExpected(Expected<T> &Exp) {
   return {TakeError(Exp.takeError()), Exp};
@@ -29,7 +29,7 @@ template <typename T> ExpectedHolder<T> TakeExpected(Expected<T> &&Exp) {
 }
 
 template <typename T>
-class ValueMatchesMono
+class LLVM_CLASS_ABI ValueMatchesMono
     : public testing::MatcherInterface<const ExpectedHolder<T> &> {
 public:
   explicit ValueMatchesMono(const testing::Matcher<T> &Matcher)
@@ -67,7 +67,7 @@ class ValueMatchesMono
 };
 
 template<typename M>
-class ValueMatchesPoly {
+class LLVM_CLASS_ABI ValueMatchesPoly {
 public:
   explicit ValueMatchesPoly(const M &Matcher) : Matcher(Matcher) {}
 
@@ -82,7 +82,7 @@ class ValueMatchesPoly {
 };
 
 template <typename InfoT>
-class ErrorMatchesMono : public testing::MatcherInterface<const ErrorHolder &> {
+class LLVM_CLASS_ABI ErrorMatchesMono : public testing::MatcherInterface<const ErrorHolder &> {
 public:
   explicit ErrorMatchesMono(std::optional<testing::Matcher<InfoT &>> Matcher)
       : Matcher(std::move(Matcher)) {}
@@ -129,7 +129,7 @@ class ErrorMatchesMono : public testing::MatcherInterface<const ErrorHolder &> {
   std::optional<testing::Matcher<InfoT &>> Matcher;
 };
 
-class ErrorMessageMatches
+class LLVM_CLASS_ABI ErrorMessageMatches
     : public testing::MatcherInterface<const ErrorHolder &> {
 public:
   explicit ErrorMessageMatches(
diff --git a/llvm/include/llvm/Testing/Support/SupportHelpers.h b/llvm/include/llvm/Testing/Support/SupportHelpers.h
index e82c413bea769f5..bcf9caf4e5e2970 100644
--- a/llvm/include/llvm/Testing/Support/SupportHelpers.h
+++ b/llvm/include/llvm/Testing/Support/SupportHelpers.h
@@ -23,13 +23,13 @@
 
 namespace llvm {
 namespace detail {
-struct ErrorHolder {
+struct LLVM_CLASS_ABI ErrorHolder {
   std::vector<std::shared_ptr<ErrorInfoBase>> Infos;
 
   bool Success() const { return Infos.empty(); }
 };
 
-template <typename T> struct ExpectedHolder : public ErrorHolder {
+template <typename T> struct LLVM_CLASS_ABI ExpectedHolder : public ErrorHolder {
   ExpectedHolder(ErrorHolder Err, Expected<T> &Exp)
       : ErrorHolder(std::move(Err)), Exp(Exp) {}
 
@@ -59,7 +59,7 @@ void PrintTo(const ExpectedHolder<T> &Item, std::ostream *Out) {
   }
 }
 
-template <class InnerMatcher> class ValueIsMatcher {
+template <class InnerMatcher> class LLVM_CLASS_ABI ValueIsMatcher {
 public:
   explicit ValueIsMatcher(InnerMatcher ValueMatcher)
       : ValueMatcher(ValueMatcher) {}
@@ -107,11 +107,11 @@ detail::ValueIsMatcher<InnerMatcher> ValueIs(const InnerMatcher &ValueMatcher) {
 }
 namespace unittest {
 
-SmallString<128> getInputFileDirectory(const char *Argv0);
+LLVM_FUNC_ABI SmallString<128> getInputFileDirectory(const char *Argv0);
 
 /// A RAII object that creates a temporary directory upon initialization and
 /// removes it upon destruction.
-class TempDir {
+class LLVM_CLASS_ABI TempDir {
   SmallString<128> Path;
 
 public:
@@ -171,7 +171,7 @@ class TempDir {
 /// removes it upon destruction.
 ///
 /// The link may be a soft or a hard link, depending on the platform.
-class TempLink {
+class LLVM_CLASS_ABI TempLink {
   SmallString<128> Path;
 
 public:
@@ -201,7 +201,7 @@ class TempLink {
 
 /// A RAII object that creates a file upon initialization and
 /// removes it upon destruction.
-class TempFile {
+class LLVM_CLASS_ABI TempFile {
   SmallString<128> Path;
 
 public:
diff --git a/llvm/include/llvm/TextAPI/Architecture.h b/llvm/include/llvm/TextAPI/Architecture.h
index ece107731f1ceb3..7d1adcf6cbefc8d 100644
--- a/llvm/include/llvm/TextAPI/Architecture.h
+++ b/llvm/include/llvm/TextAPI/Architecture.h
@@ -33,24 +33,24 @@ enum Architecture : uint8_t {
 };
 
 /// Convert a CPU Type and Subtype pair to an architecture slice.
-Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType);
+LLVM_FUNC_ABI Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType);
 
 /// Convert a name to an architecture slice.
-Architecture getArchitectureFromName(StringRef Name);
+LLVM_FUNC_ABI Architecture getArchitectureFromName(StringRef Name);
 
 /// Convert an architecture slice to a string.
-StringRef getArchitectureName(Architecture Arch);
+LLVM_FUNC_ABI StringRef getArchitectureName(Architecture Arch);
 
 /// Convert an architecture slice to a CPU Type and Subtype pair.
-std::pair<uint32_t, uint32_t> getCPUTypeFromArchitecture(Architecture Arch);
+LLVM_FUNC_ABI std::pair<uint32_t, uint32_t> getCPUTypeFromArchitecture(Architecture Arch);
 
 /// Convert a target to an architecture slice.
-Architecture mapToArchitecture(const llvm::Triple &Target);
+LLVM_FUNC_ABI Architecture mapToArchitecture(const llvm::Triple &Target);
 
 /// Check if architecture is 64 bit.
-bool is64Bit(Architecture);
+LLVM_FUNC_ABI bool is64Bit(Architecture);
 
-raw_ostream &operator<<(raw_ostream &OS, Architecture Arch);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, Architecture Arch);
 
 } // end namespace MachO.
 } // end namespace llvm.
diff --git a/llvm/include/llvm/TextAPI/ArchitectureSet.h b/llvm/include/llvm/TextAPI/ArchitectureSet.h
index 1555a047d0e7a42..48c056a156f4804 100644
--- a/llvm/include/llvm/TextAPI/ArchitectureSet.h
+++ b/llvm/include/llvm/TextAPI/ArchitectureSet.h
@@ -27,7 +27,7 @@ class raw_ostream;
 
 namespace MachO {
 
-class ArchitectureSet {
+class LLVM_CLASS_ABI ArchitectureSet {
 private:
   using ArchSetType = uint32_t;
 
@@ -164,7 +164,7 @@ inline ArchitectureSet operator|(const Architecture &lhs,
   return ArchitectureSet(lhs) | ArchitectureSet(rhs);
 }
 
-raw_ostream &operator<<(raw_ostream &OS, ArchitectureSet Set);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, ArchitectureSet Set);
 
 } // end namespace MachO.
 } // end namespace llvm.
diff --git a/llvm/include/llvm/TextAPI/InterfaceFile.h b/llvm/include/llvm/TextAPI/InterfaceFile.h
index 4431d07b02d5819..0bdcc40abccc817 100644
--- a/llvm/include/llvm/TextAPI/InterfaceFile.h
+++ b/llvm/include/llvm/TextAPI/InterfaceFile.h
@@ -78,7 +78,7 @@ enum FileType : unsigned {
 // clang-format on
 
 /// Reference to an interface file.
-class InterfaceFileRef {
+class LLVM_CLASS_ABI InterfaceFileRef {
 public:
   InterfaceFileRef() = default;
 
@@ -124,14 +124,14 @@ class InterfaceFileRef {
 
 } // end namespace MachO.
 
-struct SymbolsMapKey {
+struct LLVM_CLASS_ABI SymbolsMapKey {
   MachO::SymbolKind Kind;
   StringRef Name;
 
   SymbolsMapKey(MachO::SymbolKind Kind, StringRef Name)
       : Kind(Kind), Name(Name) {}
 };
-template <> struct DenseMapInfo<SymbolsMapKey> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<SymbolsMapKey> {
   static inline SymbolsMapKey getEmptyKey() {
     return SymbolsMapKey(MachO::SymbolKind::GlobalSymbol, StringRef{});
   }
@@ -153,7 +153,7 @@ template <> struct DenseMapInfo<SymbolsMapKey> {
 namespace MachO {
 
 /// Defines the interface file.
-class InterfaceFile {
+class LLVM_CLASS_ABI InterfaceFile {
 public:
   /// Set the path from which this file was generated (if applicable).
   ///
diff --git a/llvm/include/llvm/TextAPI/PackedVersion.h b/llvm/include/llvm/TextAPI/PackedVersion.h
index 983f7d1623efdef..dcc52afd3dcedb5 100644
--- a/llvm/include/llvm/TextAPI/PackedVersion.h
+++ b/llvm/include/llvm/TextAPI/PackedVersion.h
@@ -24,7 +24,7 @@ class StringRef;
 
 namespace MachO {
 
-class PackedVersion {
+class LLVM_CLASS_ABI PackedVersion {
   uint32_t Version{0};
 
 public:
diff --git a/llvm/include/llvm/TextAPI/Platform.h b/llvm/include/llvm/TextAPI/Platform.h
index 56938e85b219658..5a3c6fc9b98a384 100644
--- a/llvm/include/llvm/TextAPI/Platform.h
+++ b/llvm/include/llvm/TextAPI/Platform.h
@@ -23,14 +23,14 @@ namespace MachO {
 using PlatformSet = SmallSet<PlatformType, 3>;
 using PlatformVersionSet = SmallSet<std::pair<PlatformType, VersionTuple>, 3>;
 
-PlatformType mapToPlatformType(PlatformType Platform, bool WantSim);
-PlatformType mapToPlatformType(const Triple &Target);
-PlatformSet mapToPlatformSet(ArrayRef<Triple> Targets);
-StringRef getPlatformName(PlatformType Platform);
-PlatformType getPlatformFromName(StringRef Name);
-std::string getOSAndEnvironmentName(PlatformType Platform,
+LLVM_FUNC_ABI PlatformType mapToPlatformType(PlatformType Platform, bool WantSim);
+LLVM_FUNC_ABI PlatformType mapToPlatformType(const Triple &Target);
+LLVM_FUNC_ABI PlatformSet mapToPlatformSet(ArrayRef<Triple> Targets);
+LLVM_FUNC_ABI StringRef getPlatformName(PlatformType Platform);
+LLVM_FUNC_ABI PlatformType getPlatformFromName(StringRef Name);
+LLVM_FUNC_ABI std::string getOSAndEnvironmentName(PlatformType Platform,
                                     std::string Version = "");
-VersionTuple mapToSupportedOSVersion(const Triple &Triple);
+LLVM_FUNC_ABI VersionTuple mapToSupportedOSVersion(const Triple &Triple);
 
 } // end namespace MachO.
 } // end namespace llvm.
diff --git a/llvm/include/llvm/TextAPI/Symbol.h b/llvm/include/llvm/TextAPI/Symbol.h
index ab62a2b2cb99153..d6df88d9a65f6df 100644
--- a/llvm/include/llvm/TextAPI/Symbol.h
+++ b/llvm/include/llvm/TextAPI/Symbol.h
@@ -66,7 +66,7 @@ constexpr StringLiteral ObjC2EHTypePrefix = "_OBJC_EHTYPE_$_";
 constexpr StringLiteral ObjC2IVarPrefix = "_OBJC_IVAR_$_";
 
 using TargetList = SmallVector<Target, 5>;
-class Symbol {
+class LLVM_CLASS_ABI Symbol {
 public:
   Symbol(SymbolKind Kind, StringRef Name, TargetList Targets, SymbolFlags Flags)
       : Name(Name), Targets(std::move(Targets)), Kind(Kind), Flags(Flags) {}
diff --git a/llvm/include/llvm/TextAPI/Target.h b/llvm/include/llvm/TextAPI/Target.h
index a889cb6f9934f9e..75221c0ed5116eb 100644
--- a/llvm/include/llvm/TextAPI/Target.h
+++ b/llvm/include/llvm/TextAPI/Target.h
@@ -26,7 +26,7 @@ namespace MachO {
 // This is similar to a llvm Triple, but the triple doesn't have all the
 // information we need. For example there is no enum value for x86_64h. The
 // only way to get that information is to parse the triple string.
-class Target {
+class LLVM_CLASS_ABI Target {
 public:
   Target() = default;
   Target(Architecture Arch, PlatformType Platform,
@@ -67,13 +67,13 @@ inline bool operator!=(const Target &LHS, const Architecture &RHS) {
   return LHS.Arch != RHS;
 }
 
-PlatformVersionSet mapToPlatformVersionSet(ArrayRef<Target> Targets);
-PlatformSet mapToPlatformSet(ArrayRef<Target> Targets);
-ArchitectureSet mapToArchitectureSet(ArrayRef<Target> Targets);
+LLVM_FUNC_ABI PlatformVersionSet mapToPlatformVersionSet(ArrayRef<Target> Targets);
+LLVM_FUNC_ABI PlatformSet mapToPlatformSet(ArrayRef<Target> Targets);
+LLVM_FUNC_ABI ArchitectureSet mapToArchitectureSet(ArrayRef<Target> Targets);
 
-std::string getTargetTripleName(const Target &Targ);
+LLVM_FUNC_ABI std::string getTargetTripleName(const Target &Targ);
 
-raw_ostream &operator<<(raw_ostream &OS, const Target &Target);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const Target &Target);
 
 } // namespace MachO
 } // namespace llvm
diff --git a/llvm/include/llvm/TextAPI/TextAPIReader.h b/llvm/include/llvm/TextAPI/TextAPIReader.h
index 19f1a00cf883c0e..acd4d2d55c307d0 100644
--- a/llvm/include/llvm/TextAPI/TextAPIReader.h
+++ b/llvm/include/llvm/TextAPI/TextAPIReader.h
@@ -20,7 +20,7 @@ namespace MachO {
 
 class InterfaceFile;
 
-class TextAPIReader {
+class LLVM_CLASS_ABI TextAPIReader {
 public:
   static Expected<std::unique_ptr<InterfaceFile>>
   get(MemoryBufferRef InputBuffer);
diff --git a/llvm/include/llvm/TextAPI/TextAPIWriter.h b/llvm/include/llvm/TextAPI/TextAPIWriter.h
index 9e24c069b80cc1b..119b3f2128bac3f 100644
--- a/llvm/include/llvm/TextAPI/TextAPIWriter.h
+++ b/llvm/include/llvm/TextAPI/TextAPIWriter.h
@@ -20,7 +20,7 @@ namespace MachO {
 
 class InterfaceFile;
 
-class TextAPIWriter {
+class LLVM_CLASS_ABI TextAPIWriter {
 public:
   TextAPIWriter() = delete;
 
diff --git a/llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h b/llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
index 4d4e0128ecee112..4eadc9ebe8a4ad7 100644
--- a/llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
+++ b/llvm/include/llvm/ToolDrivers/llvm-dlltool/DlltoolDriver.h
@@ -19,7 +19,7 @@
 namespace llvm {
 template <typename T> class ArrayRef;
 
-int dlltoolDriverMain(ArrayRef<const char *> ArgsArr);
+LLVM_FUNC_ABI int dlltoolDriverMain(ArrayRef<const char *> ArgsArr);
 } // namespace llvm
 
 #endif
diff --git a/llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h b/llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h
index badfa57ddf8d6e0..1d8f770c8a3e819 100644
--- a/llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h
+++ b/llvm/include/llvm/ToolDrivers/llvm-lib/LibDriver.h
@@ -19,7 +19,7 @@
 namespace llvm {
 template <typename T> class ArrayRef;
 
-int libDriverMain(ArrayRef<const char *> ARgs);
+LLVM_FUNC_ABI int libDriverMain(ArrayRef<const char *> ARgs);
 
 }
 
diff --git a/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h b/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h
index c7d4124a0b3853e..858058adfedf71d 100644
--- a/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h
+++ b/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h
@@ -20,7 +20,7 @@
 
 namespace llvm {
 
-class AggressiveInstCombinePass
+class LLVM_CLASS_ABI AggressiveInstCombinePass
     : public PassInfoMixin<AggressiveInstCombinePass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/CFGuard.h b/llvm/include/llvm/Transforms/CFGuard.h
index 35ed6144dbe8f56..170be4c5d73c022 100644
--- a/llvm/include/llvm/Transforms/CFGuard.h
+++ b/llvm/include/llvm/Transforms/CFGuard.h
@@ -18,10 +18,10 @@ namespace llvm {
 class FunctionPass;
 
 /// Insert Control FLow Guard checks on indirect function calls.
-FunctionPass *createCFGuardCheckPass();
+LLVM_FUNC_ABI FunctionPass *createCFGuardCheckPass();
 
 /// Insert Control FLow Guard dispatches on indirect function calls.
-FunctionPass *createCFGuardDispatchPass();
+LLVM_FUNC_ABI FunctionPass *createCFGuardDispatchPass();
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h b/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h
index 19c727952cfcc2e..26810ba788af3cf 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 class Module;
 
-struct CoroCleanupPass : PassInfoMixin<CoroCleanupPass> {
+struct LLVM_CLASS_ABI CoroCleanupPass : PassInfoMixin<CoroCleanupPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
   static bool isRequired() { return true; }
 };
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h b/llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h
index 6433072c332d825..6447e02def4e1e5 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h
@@ -18,7 +18,7 @@ class Module;
 
 // Only runs passes in the contained pass manager if the module contains any
 // coroutine intrinsic declarations.
-struct CoroConditionalWrapper : PassInfoMixin<CoroConditionalWrapper> {
+struct LLVM_CLASS_ABI CoroConditionalWrapper : PassInfoMixin<CoroConditionalWrapper> {
   CoroConditionalWrapper(ModulePassManager &&);
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
   static bool isRequired() { return true; }
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h b/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h
index 71b312dbf5170e2..b1481eb65fa3f1a 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h
@@ -24,7 +24,7 @@ namespace llvm {
 
 class Module;
 
-struct CoroEarlyPass : PassInfoMixin<CoroEarlyPass> {
+struct LLVM_CLASS_ABI CoroEarlyPass : PassInfoMixin<CoroEarlyPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroElide.h b/llvm/include/llvm/Transforms/Coroutines/CoroElide.h
index b458584374da5f0..f855ee6453f3f43 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroElide.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroElide.h
@@ -23,7 +23,7 @@ namespace llvm {
 
 class Function;
 
-struct CoroElidePass : PassInfoMixin<CoroElidePass> {
+struct LLVM_CLASS_ABI CoroElidePass : PassInfoMixin<CoroElidePass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h b/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
index c0ce3cf648efb56..89d327b8f65f08e 100644
--- a/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
+++ b/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h
@@ -22,7 +22,7 @@
 
 namespace llvm {
 
-struct CoroSplitPass : PassInfoMixin<CoroSplitPass> {
+struct LLVM_CLASS_ABI CoroSplitPass : PassInfoMixin<CoroSplitPass> {
   const std::function<bool(Instruction &)> MaterializableCallback;
 
   CoroSplitPass(bool OptimizeFrame = false);
diff --git a/llvm/include/llvm/Transforms/IPO.h b/llvm/include/llvm/Transforms/IPO.h
index a509ea9ecadd0d0..be8b2a7b93ae542 100644
--- a/llvm/include/llvm/Transforms/IPO.h
+++ b/llvm/include/llvm/Transforms/IPO.h
@@ -29,29 +29,29 @@ class raw_ostream;
 /// createDeadArgEliminationPass - This pass removes arguments from functions
 /// which are not used by the body of the function.
 ///
-ModulePass *createDeadArgEliminationPass();
+LLVM_FUNC_ABI ModulePass *createDeadArgEliminationPass();
 
 /// DeadArgHacking pass - Same as DAE, but delete arguments of external
 /// functions as well.  This is definitely not safe, and should only be used by
 /// bugpoint.
-ModulePass *createDeadArgHackingPass();
+LLVM_FUNC_ABI ModulePass *createDeadArgHackingPass();
 
 //===----------------------------------------------------------------------===//
 //
 /// createLoopExtractorPass - This pass extracts all natural loops from the
 /// program into a function if it can.
 ///
-Pass *createLoopExtractorPass();
+LLVM_FUNC_ABI Pass *createLoopExtractorPass();
 
 /// createSingleLoopExtractorPass - This pass extracts one natural loop from the
 /// program into a function if it can.  This is used by bugpoint.
 ///
-Pass *createSingleLoopExtractorPass();
+LLVM_FUNC_ABI Pass *createSingleLoopExtractorPass();
 
 //===----------------------------------------------------------------------===//
 /// createBarrierNoopPass - This pass is purely a module pass barrier in a pass
 /// manager.
-ModulePass *createBarrierNoopPass();
+LLVM_FUNC_ABI ModulePass *createBarrierNoopPass();
 
 /// What to do with the summary when running passes that operate on it.
 enum class PassSummaryAction {
diff --git a/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h b/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h
index 6dac984a66bab81..637aca969ee84ed 100644
--- a/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h
+++ b/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h
@@ -30,7 +30,7 @@ class Pass;
 /// be the simplest possible pass to remove always_inline function definitions'
 /// uses by inlining them. The \c GlobalDCE pass can be used to remove these
 /// functions once all users are gone.
-class AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
+class LLVM_CLASS_ABI AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
   bool InsertLifetime;
 
 public:
@@ -43,7 +43,7 @@ class AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
 
 /// Create a legacy pass manager instance of a pass to inline and remove
 /// functions marked as "always_inline".
-Pass *createAlwaysInlinerLegacyPass(bool InsertLifetime = true);
+LLVM_FUNC_ABI Pass *createAlwaysInlinerLegacyPass(bool InsertLifetime = true);
 
 }
 
diff --git a/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h b/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h
index f2cd083c37af40e..aac0ebc68ecc618 100644
--- a/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h
+++ b/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h
@@ -22,7 +22,7 @@ namespace llvm {
 class Module;
 
 /// Pass to convert @llvm.global.annotations to !annotation metadata.
-struct Annotation2MetadataPass : public PassInfoMixin<Annotation2MetadataPass> {
+struct LLVM_CLASS_ABI Annotation2MetadataPass : public PassInfoMixin<Annotation2MetadataPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h b/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
index 60b8350f221af8f..5e994f37e5a044e 100644
--- a/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
+++ b/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
@@ -21,7 +21,7 @@ namespace llvm {
 /// This pass walks the functions in each SCC and for each one tries to
 /// transform it and all of its callers to replace indirect arguments with
 /// direct (by-value) arguments.
-class ArgumentPromotionPass : public PassInfoMixin<ArgumentPromotionPass> {
+class LLVM_CLASS_ABI ArgumentPromotionPass : public PassInfoMixin<ArgumentPromotionPass> {
   unsigned MaxElements;
 
 public:
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 1bd31cd558b7446..27973780903d0a4 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -168,7 +168,7 @@ enum class GPUAddressSpace : unsigned {
 };
 
 /// Return true iff \p M target a GPU (and we can use GPU AS reasoning).
-bool isGPU(const Module &M);
+LLVM_FUNC_ABI bool isGPU(const Module &M);
 
 /// Flags to distinguish intra-procedural queries from *potentially*
 /// inter-procedural queries. Not that information can be valid for both and
@@ -179,7 +179,7 @@ enum ValueScope : uint8_t {
   AnyScope = Intraprocedural | Interprocedural,
 };
 
-struct ValueAndContext : public std::pair<Value *, const Instruction *> {
+struct LLVM_CLASS_ABI ValueAndContext : public std::pair<Value *, const Instruction *> {
   using Base = std::pair<Value *, const Instruction *>;
   ValueAndContext(const Base &B) : Base(B) {}
   ValueAndContext(Value &V, const Instruction *CtxI) : Base(&V, CtxI) {}
@@ -191,7 +191,7 @@ struct ValueAndContext : public std::pair<Value *, const Instruction *> {
 
 /// Return true if \p I is a `nosync` instruction. Use generic reasoning and
 /// potentially the corresponding AANoSync.
-bool isNoSyncInst(Attributor &A, const Instruction &I,
+LLVM_FUNC_ABI bool isNoSyncInst(Attributor &A, const Instruction &I,
                   const AbstractAttribute &QueryingAA);
 
 /// Return true if \p V is dynamically unique, that is, there are no two
@@ -199,22 +199,22 @@ bool isNoSyncInst(Attributor &A, const Instruction &I,
 /// Note: If \p ForAnalysisOnly is set we only check that the Attributor will
 /// never use \p V to represent two "instances" not that \p V could not
 /// technically represent them.
-bool isDynamicallyUnique(Attributor &A, const AbstractAttribute &QueryingAA,
+LLVM_FUNC_ABI bool isDynamicallyUnique(Attributor &A, const AbstractAttribute &QueryingAA,
                          const Value &V, bool ForAnalysisOnly = true);
 
 /// Return true if \p V is a valid value in \p Scope, that is a constant or an
 /// instruction/argument of \p Scope.
-bool isValidInScope(const Value &V, const Function *Scope);
+LLVM_FUNC_ABI bool isValidInScope(const Value &V, const Function *Scope);
 
 /// Return true if the value of \p VAC is a valid at the position of \p VAC,
 /// that is a constant, an argument of the same function, or an instruction in
 /// that function that dominates the position.
-bool isValidAtPosition(const ValueAndContext &VAC, InformationCache &InfoCache);
+LLVM_FUNC_ABI bool isValidAtPosition(const ValueAndContext &VAC, InformationCache &InfoCache);
 
 /// Try to convert \p V to type \p Ty without introducing new instructions. If
 /// this is not possible return `nullptr`. Note: this function basically knows
 /// how to cast various constants.
-Value *getWithType(Value &V, Type &Ty);
+LLVM_FUNC_ABI Value *getWithType(Value &V, Type &Ty);
 
 /// Return the combination of \p A and \p B such that the result is a possible
 /// value of both. \p B is potentially casted to match the type \p Ty or the
@@ -224,13 +224,13 @@ Value *getWithType(Value &V, Type &Ty);
 ///        X + none  => X
 /// not_none + undef => not_none
 ///          V1 + V2 => nullptr
-std::optional<Value *>
+LLVM_FUNC_ABI std::optional<Value *>
 combineOptionalValuesInAAValueLatice(const std::optional<Value *> &A,
                                      const std::optional<Value *> &B, Type *Ty);
 
 /// Helper to represent an access offset and size, with logic to deal with
 /// uncertainty and check for overlapping accesses.
-struct RangeTy {
+struct LLVM_CLASS_ABI RangeTy {
   int64_t Offset = Unassigned;
   int64_t Size = Unassigned;
 
@@ -319,7 +319,7 @@ inline bool operator==(const RangeTy &A, const RangeTy &B) {
 inline bool operator!=(const RangeTy &A, const RangeTy &B) { return !(A == B); }
 
 /// Return the initial value of \p Obj with type \p Ty if that is a constant.
-Constant *getInitialValueForObj(Attributor &A, Value &Obj, Type &Ty,
+LLVM_FUNC_ABI Constant *getInitialValueForObj(Attributor &A, Value &Obj, Type &Ty,
                                 const TargetLibraryInfo *TLI,
                                 const DataLayout &DL,
                                 RangeTy *RangePtr = nullptr);
@@ -335,7 +335,7 @@ Constant *getInitialValueForObj(Attributor &A, Value &Obj, Type &Ty,
 /// \returns True if the assumed potential copies are all in \p PotentialValues,
 ///          false if something went wrong and the copies could not be
 ///          determined.
-bool getPotentiallyLoadedValues(
+LLVM_FUNC_ABI bool getPotentiallyLoadedValues(
     Attributor &A, LoadInst &LI, SmallSetVector<Value *, 4> &PotentialValues,
     SmallSetVector<Instruction *, 4> &PotentialValueOrigins,
     const AbstractAttribute &QueryingAA, bool &UsedAssumedInformation,
@@ -350,19 +350,19 @@ bool getPotentiallyLoadedValues(
 /// \returns True if the assumed potential copies are all in \p PotentialCopies,
 ///          false if something went wrong and the copies could not be
 ///          determined.
-bool getPotentialCopiesOfStoredValue(
+LLVM_FUNC_ABI bool getPotentialCopiesOfStoredValue(
     Attributor &A, StoreInst &SI, SmallSetVector<Value *, 4> &PotentialCopies,
     const AbstractAttribute &QueryingAA, bool &UsedAssumedInformation,
     bool OnlyExact = false);
 
 /// Return true if \p IRP is readonly. This will query respective AAs that
 /// deduce the information and introduce dependences for \p QueryingAA.
-bool isAssumedReadOnly(Attributor &A, const IRPosition &IRP,
+LLVM_FUNC_ABI bool isAssumedReadOnly(Attributor &A, const IRPosition &IRP,
                        const AbstractAttribute &QueryingAA, bool &IsKnown);
 
 /// Return true if \p IRP is readnone. This will query respective AAs that
 /// deduce the information and introduce dependences for \p QueryingAA.
-bool isAssumedReadNone(Attributor &A, const IRPosition &IRP,
+LLVM_FUNC_ABI bool isAssumedReadNone(Attributor &A, const IRPosition &IRP,
                        const AbstractAttribute &QueryingAA, bool &IsKnown);
 
 /// Return true if \p ToI is potentially reachable from \p FromI without running
@@ -373,33 +373,33 @@ bool isAssumedReadNone(Attributor &A, const IRPosition &IRP,
 /// reached. If the query is not interested in callers beyond a certain point,
 /// e.g., a GPU kernel entry or the function containing an alloca, the
 /// \p GoBackwardsCB should return false.
-bool isPotentiallyReachable(
+LLVM_FUNC_ABI bool isPotentiallyReachable(
     Attributor &A, const Instruction &FromI, const Instruction &ToI,
     const AbstractAttribute &QueryingAA,
     const AA::InstExclusionSetTy *ExclusionSet = nullptr,
     std::function<bool(const Function &F)> GoBackwardsCB = nullptr);
 
 /// Same as above but it is sufficient to reach any instruction in \p ToFn.
-bool isPotentiallyReachable(
+LLVM_FUNC_ABI bool isPotentiallyReachable(
     Attributor &A, const Instruction &FromI, const Function &ToFn,
     const AbstractAttribute &QueryingAA,
     const AA::InstExclusionSetTy *ExclusionSet = nullptr,
     std::function<bool(const Function &F)> GoBackwardsCB = nullptr);
 
 /// Return true if \p Obj is assumed to be a thread local object.
-bool isAssumedThreadLocalObject(Attributor &A, Value &Obj,
+LLVM_FUNC_ABI bool isAssumedThreadLocalObject(Attributor &A, Value &Obj,
                                 const AbstractAttribute &QueryingAA);
 
 /// Return true if \p I is potentially affected by a barrier.
-bool isPotentiallyAffectedByBarrier(Attributor &A, const Instruction &I,
+LLVM_FUNC_ABI bool isPotentiallyAffectedByBarrier(Attributor &A, const Instruction &I,
                                     const AbstractAttribute &QueryingAA);
-bool isPotentiallyAffectedByBarrier(Attributor &A, ArrayRef<const Value *> Ptrs,
+LLVM_FUNC_ABI bool isPotentiallyAffectedByBarrier(Attributor &A, ArrayRef<const Value *> Ptrs,
                                     const AbstractAttribute &QueryingAA,
                                     const Instruction *CtxI);
 } // namespace AA
 
 template <>
-struct DenseMapInfo<AA::ValueAndContext>
+struct LLVM_CLASS_ABI DenseMapInfo<AA::ValueAndContext>
     : public DenseMapInfo<AA::ValueAndContext::Base> {
   using Base = DenseMapInfo<AA::ValueAndContext::Base>;
   static inline AA::ValueAndContext getEmptyKey() {
@@ -419,7 +419,7 @@ struct DenseMapInfo<AA::ValueAndContext>
 };
 
 template <>
-struct DenseMapInfo<AA::ValueScope> : public DenseMapInfo<unsigned char> {
+struct LLVM_CLASS_ABI DenseMapInfo<AA::ValueScope> : public DenseMapInfo<unsigned char> {
   using Base = DenseMapInfo<unsigned char>;
   static inline AA::ValueScope getEmptyKey() {
     return AA::ValueScope(Base::getEmptyKey());
@@ -437,7 +437,7 @@ struct DenseMapInfo<AA::ValueScope> : public DenseMapInfo<unsigned char> {
 };
 
 template <>
-struct DenseMapInfo<const AA::InstExclusionSetTy *>
+struct LLVM_CLASS_ABI DenseMapInfo<const AA::InstExclusionSetTy *>
     : public DenseMapInfo<void *> {
   using super = DenseMapInfo<void *>;
   static inline const AA::InstExclusionSetTy *getEmptyKey() {
@@ -473,7 +473,7 @@ struct DenseMapInfo<const AA::InstExclusionSetTy *>
 
 /// The value passed to the line option that defines the maximal initialization
 /// chain length.
-extern unsigned MaxInitializationChainLength;
+LLVM_FUNC_ABI extern unsigned MaxInitializationChainLength;
 
 ///{
 enum class ChangeStatus {
@@ -481,10 +481,10 @@ enum class ChangeStatus {
   UNCHANGED,
 };
 
-ChangeStatus operator|(ChangeStatus l, ChangeStatus r);
-ChangeStatus &operator|=(ChangeStatus &l, ChangeStatus r);
-ChangeStatus operator&(ChangeStatus l, ChangeStatus r);
-ChangeStatus &operator&=(ChangeStatus &l, ChangeStatus r);
+LLVM_FUNC_ABI ChangeStatus operator|(ChangeStatus l, ChangeStatus r);
+LLVM_FUNC_ABI ChangeStatus &operator|=(ChangeStatus &l, ChangeStatus r);
+LLVM_FUNC_ABI ChangeStatus operator&(ChangeStatus l, ChangeStatus r);
+LLVM_FUNC_ABI ChangeStatus &operator&=(ChangeStatus &l, ChangeStatus r);
 
 enum class DepClassTy {
   REQUIRED, ///< The target cannot be valid if the source is not.
@@ -494,7 +494,7 @@ enum class DepClassTy {
 ///}
 
 /// The data structure for the nodes of a dependency graph
-struct AADepGraphNode {
+struct LLVM_CLASS_ABI AADepGraphNode {
 public:
   virtual ~AADepGraphNode() = default;
   using DepTy = PointerIntPair<AADepGraphNode *, 1>;
@@ -537,7 +537,7 @@ struct AADepGraphNode {
 /// Note that in this graph if there is an edge from A to B (A -> B),
 /// then it means that B depends on A, and when the state of A is
 /// updated, node B should also be updated
-struct AADepGraph {
+struct LLVM_CLASS_ABI AADepGraph {
   AADepGraph() = default;
   ~AADepGraph() = default;
 
@@ -573,7 +573,7 @@ struct AADepGraph {
 /// as well as a distinction between call sites and functions. Finally, there
 /// are floating values that do not have a corresponding attribute list
 /// position.
-struct IRPosition {
+struct LLVM_CLASS_ABI IRPosition {
   // NOTE: In the future this definition can be changed to support recursive
   // functions.
   using CallBaseContext = CallBase;
@@ -1064,7 +1064,7 @@ struct IRPosition {
 };
 
 /// Helper that allows IRPosition as a key in a DenseMap.
-template <> struct DenseMapInfo<IRPosition> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<IRPosition> {
   static inline IRPosition getEmptyKey() { return IRPosition::EmptyKey; }
   static inline IRPosition getTombstoneKey() {
     return IRPosition::TombstoneKey;
@@ -1103,7 +1103,7 @@ template <> struct DenseMapInfo<IRPosition> {
 ///   - the position the call site argument is associated with if it is not
 ///     anchored to the call site, e.g., if it is an argument then the argument
 ///     (IRP_ARGUMENT)
-class SubsumingPositionIterator {
+class LLVM_CLASS_ABI SubsumingPositionIterator {
   SmallVector<IRPosition, 4> IRPositions;
   using iterator = decltype(IRPositions)::iterator;
 
@@ -1114,7 +1114,7 @@ class SubsumingPositionIterator {
 };
 
 /// Wrapper for FunctionAnalysisManager.
-struct AnalysisGetter {
+struct LLVM_CLASS_ABI AnalysisGetter {
   // The client may be running the old pass manager, in which case, we need to
   // map the requested Analysis to its equivalent wrapper in the old pass
   // manager. The scheme implemented here does not require every Analysis to be
@@ -1184,7 +1184,7 @@ constexpr bool AnalysisGetter::HasLegacyWrapper<
 /// Attributor::registerAA(...), need more information, especially if it is not
 /// reusable, it is advised to inherit from the InformationCache and cast the
 /// instance down in the abstract attributes.
-struct InformationCache {
+struct LLVM_CLASS_ABI InformationCache {
   InformationCache(const Module &M, AnalysisGetter &AG,
                    BumpPtrAllocator &Allocator, SetVector<Function *> *CGSCC,
                    bool UseExplorer = true)
@@ -1387,7 +1387,7 @@ struct InformationCache {
 };
 
 /// Configuration for the Attributor.
-struct AttributorConfig {
+struct LLVM_CLASS_ABI AttributorConfig {
 
   AttributorConfig(CallGraphUpdater &CGUpdater) : CGUpdater(CGUpdater) {}
 
@@ -1467,7 +1467,7 @@ struct AttributorConfig {
 ///
 /// NOTE: The mechanics of adding a new "concrete" abstract attribute are
 ///       described in the file comment.
-struct Attributor {
+struct LLVM_CLASS_ABI Attributor {
 
   /// Constructor
   ///
@@ -2539,7 +2539,7 @@ struct Attributor {
 /// attribute can inherit from them to get the abstract state interface and
 /// additional methods to directly modify the state based if needed. See the
 /// class comments for help.
-struct AbstractState {
+struct LLVM_CLASS_ABI AbstractState {
   virtual ~AbstractState() = default;
 
   /// Return if this abstract state is in a valid state. If false, no
@@ -2578,7 +2578,7 @@ struct AbstractState {
 /// state will catch up with the assumed one, for a pessimistic fixpoint it is
 /// the other way around.
 template <typename base_ty, base_ty BestState, base_ty WorstState>
-struct IntegerStateBase : public AbstractState {
+struct LLVM_CLASS_ABI IntegerStateBase : public AbstractState {
   using base_t = base_ty;
 
   IntegerStateBase() = default;
@@ -2679,7 +2679,7 @@ struct IntegerStateBase : public AbstractState {
 /// Specialization of the integer state for a bit-wise encoding.
 template <typename base_ty = uint32_t, base_ty BestState = ~base_ty(0),
           base_ty WorstState = 0>
-struct BitIntegerState
+struct LLVM_CLASS_ABI BitIntegerState
     : public IntegerStateBase<base_ty, BestState, WorstState> {
   using super = IntegerStateBase<base_ty, BestState, WorstState>;
   using base_t = base_ty;
@@ -2741,7 +2741,7 @@ struct BitIntegerState
 /// the best state and 0 the worst.
 template <typename base_ty = uint32_t, base_ty BestState = ~base_ty(0),
           base_ty WorstState = 0>
-struct IncIntegerState
+struct LLVM_CLASS_ABI IncIntegerState
     : public IntegerStateBase<base_ty, BestState, WorstState> {
   using super = IntegerStateBase<base_ty, BestState, WorstState>;
   using base_t = base_ty;
@@ -2789,7 +2789,7 @@ struct IncIntegerState
 /// Specialization of the integer state for a decreasing value, hence 0 is the
 /// best state and ~0u the worst.
 template <typename base_ty = uint32_t>
-struct DecIntegerState : public IntegerStateBase<base_ty, 0, ~base_ty(0)> {
+struct LLVM_CLASS_ABI DecIntegerState : public IntegerStateBase<base_ty, 0, ~base_ty(0)> {
   using base_t = base_ty;
 
   /// Take maximum of assumed and \p Value.
@@ -2823,7 +2823,7 @@ struct DecIntegerState : public IntegerStateBase<base_ty, 0, ~base_ty(0)> {
 };
 
 /// Simple wrapper for a single bit (boolean) state.
-struct BooleanState : public IntegerStateBase<bool, true, false> {
+struct LLVM_CLASS_ABI BooleanState : public IntegerStateBase<bool, true, false> {
   using super = IntegerStateBase<bool, true, false>;
   using base_t = IntegerStateBase::base_t;
 
@@ -2865,7 +2865,7 @@ struct BooleanState : public IntegerStateBase<bool, true, false> {
 };
 
 /// State for an integer range.
-struct IntegerRangeState : public AbstractState {
+struct LLVM_CLASS_ABI IntegerRangeState : public AbstractState {
 
   /// Bitwidth of the associated value.
   uint32_t BitWidth;
@@ -2977,7 +2977,7 @@ struct IntegerRangeState : public AbstractState {
 /// This represents a state containing a set of values. The interface supports
 /// modelling sets that contain all possible elements. The state's internal
 /// value is modified using union or intersection operations.
-template <typename BaseTy> struct SetState : public AbstractState {
+template <typename BaseTy> struct LLVM_CLASS_ABI SetState : public AbstractState {
   /// A wrapper around a set that has semantics for handling unions and
   /// intersections with a "universal" set that contains all elements.
   struct SetContents {
@@ -3108,7 +3108,7 @@ template <typename BaseTy> struct SetState : public AbstractState {
 
 /// Helper to tie a abstract state implementation to an abstract attribute.
 template <typename StateTy, typename BaseType, class... Ts>
-struct StateWrapper : public BaseType, public StateTy {
+struct LLVM_CLASS_ABI StateWrapper : public BaseType, public StateTy {
   /// Provide static access to the type of the state.
   using StateType = StateTy;
 
@@ -3124,7 +3124,7 @@ struct StateWrapper : public BaseType, public StateTy {
 
 /// Helper class that provides common functionality to manifest IR attributes.
 template <Attribute::AttrKind AK, typename BaseType, typename AAType>
-struct IRAttribute : public BaseType {
+struct LLVM_CLASS_ABI IRAttribute : public BaseType {
   IRAttribute(const IRPosition &IRP) : BaseType(IRP) {}
 
   /// Most boolean IRAttribute AAs don't do anything non-trivial
@@ -3219,7 +3219,7 @@ struct IRAttribute : public BaseType {
 ///       both directions will be added in the future.
 /// NOTE: The mechanics of adding a new "concrete" abstract attribute are
 ///       described in the file comment.
-struct AbstractAttribute : public IRPosition, public AADepGraphNode {
+struct LLVM_CLASS_ABI AbstractAttribute : public IRPosition, public AADepGraphNode {
   using StateType = AbstractState;
 
   AbstractAttribute(const IRPosition &IRP) : IRPosition(IRP) {}
@@ -3348,11 +3348,11 @@ struct AbstractAttribute : public IRPosition, public AADepGraphNode {
 /// Forward declarations of output streams for debug purposes.
 ///
 ///{
-raw_ostream &operator<<(raw_ostream &OS, const AbstractAttribute &AA);
-raw_ostream &operator<<(raw_ostream &OS, ChangeStatus S);
-raw_ostream &operator<<(raw_ostream &OS, IRPosition::Kind);
-raw_ostream &operator<<(raw_ostream &OS, const IRPosition &);
-raw_ostream &operator<<(raw_ostream &OS, const AbstractState &State);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const AbstractAttribute &AA);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, ChangeStatus S);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, IRPosition::Kind);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const IRPosition &);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const AbstractState &State);
 template <typename base_ty, base_ty BestState, base_ty WorstState>
 raw_ostream &
 operator<<(raw_ostream &OS,
@@ -3360,13 +3360,13 @@ operator<<(raw_ostream &OS,
   return OS << "(" << S.getKnown() << "-" << S.getAssumed() << ")"
             << static_cast<const AbstractState &>(S);
 }
-raw_ostream &operator<<(raw_ostream &OS, const IntegerRangeState &State);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const IntegerRangeState &State);
 ///}
 
-struct AttributorPass : public PassInfoMixin<AttributorPass> {
+struct LLVM_CLASS_ABI AttributorPass : public PassInfoMixin<AttributorPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
-struct AttributorCGSCCPass : public PassInfoMixin<AttributorCGSCCPass> {
+struct LLVM_CLASS_ABI AttributorCGSCCPass : public PassInfoMixin<AttributorCGSCCPass> {
   PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
                         LazyCallGraph &CG, CGSCCUpdateResult &UR);
 };
@@ -3387,7 +3387,7 @@ ChangeStatus clampStateAndIndicateChange(StateType &S, const StateType &R) {
 /// ----------------------------------------------------------------------------
 
 /// An abstract attribute for the returned values of a function.
-struct AAReturnedValues
+struct LLVM_CLASS_ABI AAReturnedValues
     : public IRAttribute<Attribute::Returned, AbstractAttribute,
                          AAReturnedValues> {
   AAReturnedValues(const IRPosition &IRP, Attributor &A) : IRAttribute(IRP) {}
@@ -3433,7 +3433,7 @@ struct AAReturnedValues
   static const char ID;
 };
 
-struct AANoUnwind
+struct LLVM_CLASS_ABI AANoUnwind
     : public IRAttribute<Attribute::NoUnwind,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AANoUnwind> {
@@ -3463,7 +3463,7 @@ struct AANoUnwind
   static const char ID;
 };
 
-struct AANoSync
+struct LLVM_CLASS_ABI AANoSync
     : public IRAttribute<Attribute::NoSync,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AANoSync> {
@@ -3517,7 +3517,7 @@ struct AANoSync
 };
 
 /// An abstract interface for all nonnull attributes.
-struct AAMustProgress
+struct LLVM_CLASS_ABI AAMustProgress
     : public IRAttribute<Attribute::MustProgress,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AAMustProgress> {
@@ -3550,7 +3550,7 @@ struct AAMustProgress
 };
 
 /// An abstract interface for all nonnull attributes.
-struct AANonNull
+struct LLVM_CLASS_ABI AANonNull
     : public IRAttribute<Attribute::NonNull,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AANonNull> {
@@ -3601,7 +3601,7 @@ struct AANonNull
 };
 
 /// An abstract attribute for norecurse.
-struct AANoRecurse
+struct LLVM_CLASS_ABI AANoRecurse
     : public IRAttribute<Attribute::NoRecurse,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AANoRecurse> {
@@ -3632,7 +3632,7 @@ struct AANoRecurse
 };
 
 /// An abstract attribute for willreturn.
-struct AAWillReturn
+struct LLVM_CLASS_ABI AAWillReturn
     : public IRAttribute<Attribute::WillReturn,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AAWillReturn> {
@@ -3694,7 +3694,7 @@ struct AAWillReturn
 };
 
 /// An abstract attribute for undefined behavior.
-struct AAUndefinedBehavior
+struct LLVM_CLASS_ABI AAUndefinedBehavior
     : public StateWrapper<BooleanState, AbstractAttribute> {
   using Base = StateWrapper<BooleanState, AbstractAttribute>;
   AAUndefinedBehavior(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
@@ -3732,7 +3732,7 @@ struct AAUndefinedBehavior
 };
 
 /// An abstract interface to determine reachability of point A to B.
-struct AAIntraFnReachability
+struct LLVM_CLASS_ABI AAIntraFnReachability
     : public StateWrapper<BooleanState, AbstractAttribute> {
   using Base = StateWrapper<BooleanState, AbstractAttribute>;
   AAIntraFnReachability(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
@@ -3765,7 +3765,7 @@ struct AAIntraFnReachability
 };
 
 /// An abstract interface for all noalias attributes.
-struct AANoAlias
+struct LLVM_CLASS_ABI AANoAlias
     : public IRAttribute<Attribute::NoAlias,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AANoAlias> {
@@ -3811,7 +3811,7 @@ struct AANoAlias
 };
 
 /// An AbstractAttribute for nofree.
-struct AANoFree
+struct LLVM_CLASS_ABI AANoFree
     : public IRAttribute<Attribute::NoFree,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AANoFree> {
@@ -3850,7 +3850,7 @@ struct AANoFree
 };
 
 /// An AbstractAttribute for noreturn.
-struct AANoReturn
+struct LLVM_CLASS_ABI AANoReturn
     : public IRAttribute<Attribute::NoReturn,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AANoReturn> {
@@ -3881,7 +3881,7 @@ struct AANoReturn
 };
 
 /// An abstract interface for liveness abstract attribute.
-struct AAIsDead
+struct LLVM_CLASS_ABI AAIsDead
     : public StateWrapper<BitIntegerState<uint8_t, 3, 0>, AbstractAttribute> {
   using Base = StateWrapper<BitIntegerState<uint8_t, 3, 0>, AbstractAttribute>;
   AAIsDead(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
@@ -3970,7 +3970,7 @@ struct AAIsDead
 };
 
 /// State for dereferenceable attribute
-struct DerefState : AbstractState {
+struct LLVM_CLASS_ABI DerefState : AbstractState {
 
   static DerefState getBestState() { return DerefState(); }
   static DerefState getBestState(const DerefState &) { return getBestState(); }
@@ -4113,7 +4113,7 @@ struct DerefState : AbstractState {
 };
 
 /// An abstract interface for all dereferenceable attribute.
-struct AADereferenceable
+struct LLVM_CLASS_ABI AADereferenceable
     : public IRAttribute<Attribute::Dereferenceable,
                          StateWrapper<DerefState, AbstractAttribute>,
                          AADereferenceable> {
@@ -4167,7 +4167,7 @@ struct AADereferenceable
 using AAAlignmentStateType =
     IncIntegerState<uint64_t, Value::MaximumAlignment, 1>;
 /// An abstract interface for all align attributes.
-struct AAAlign
+struct LLVM_CLASS_ABI AAAlign
     : public IRAttribute<Attribute::Alignment,
                          StateWrapper<AAAlignmentStateType, AbstractAttribute>,
                          AAAlign> {
@@ -4208,7 +4208,7 @@ struct AAAlign
 /// instance.
 /// TODO: We should make it a ternary AA tracking uniqueness, and uniqueness
 /// wrt. the Attributor analysis separately.
-struct AAInstanceInfo : public StateWrapper<BooleanState, AbstractAttribute> {
+struct LLVM_CLASS_ABI AAInstanceInfo : public StateWrapper<BooleanState, AbstractAttribute> {
   AAInstanceInfo(const IRPosition &IRP, Attributor &A)
       : StateWrapper<BooleanState, AbstractAttribute>(IRP) {}
 
@@ -4245,7 +4245,7 @@ struct AAInstanceInfo : public StateWrapper<BooleanState, AbstractAttribute> {
 };
 
 /// An abstract interface for all nocapture attributes.
-struct AANoCapture
+struct LLVM_CLASS_ABI AANoCapture
     : public IRAttribute<
           Attribute::NoCapture,
           StateWrapper<BitIntegerState<uint16_t, 7, 0>, AbstractAttribute>,
@@ -4325,7 +4325,7 @@ struct AANoCapture
   static const char ID;
 };
 
-struct ValueSimplifyStateType : public AbstractState {
+struct LLVM_CLASS_ABI ValueSimplifyStateType : public AbstractState {
 
   ValueSimplifyStateType(Type *Ty) : Ty(Ty) {}
 
@@ -4400,7 +4400,7 @@ struct ValueSimplifyStateType : public AbstractState {
 };
 
 /// An abstract interface for value simplify abstract attribute.
-struct AAValueSimplify
+struct LLVM_CLASS_ABI AAValueSimplify
     : public StateWrapper<ValueSimplifyStateType, AbstractAttribute, Type *> {
   using Base = StateWrapper<ValueSimplifyStateType, AbstractAttribute, Type *>;
   AAValueSimplify(const IRPosition &IRP, Attributor &A)
@@ -4437,7 +4437,7 @@ struct AAValueSimplify
   friend struct Attributor;
 };
 
-struct AAHeapToStack : public StateWrapper<BooleanState, AbstractAttribute> {
+struct LLVM_CLASS_ABI AAHeapToStack : public StateWrapper<BooleanState, AbstractAttribute> {
   using Base = StateWrapper<BooleanState, AbstractAttribute>;
   AAHeapToStack(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
 
@@ -4476,7 +4476,7 @@ struct AAHeapToStack : public StateWrapper<BooleanState, AbstractAttribute> {
 /// (=nocapture), it is (for now) not written (=readonly & noalias), we know
 /// what values are necessary to make the private copy look like the original
 /// one, and the values we need can be loaded (=dereferenceable).
-struct AAPrivatizablePtr
+struct LLVM_CLASS_ABI AAPrivatizablePtr
     : public StateWrapper<BooleanState, AbstractAttribute> {
   using Base = StateWrapper<BooleanState, AbstractAttribute>;
   AAPrivatizablePtr(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
@@ -4521,7 +4521,7 @@ struct AAPrivatizablePtr
 
 /// An abstract interface for memory access kind related attributes
 /// (readnone/readonly/writeonly).
-struct AAMemoryBehavior
+struct LLVM_CLASS_ABI AAMemoryBehavior
     : public IRAttribute<
           Attribute::ReadNone,
           StateWrapper<BitIntegerState<uint8_t, 3>, AbstractAttribute>,
@@ -4596,7 +4596,7 @@ struct AAMemoryBehavior
 
 /// An abstract interface for all memory location attributes
 /// (readnone/argmemonly/inaccessiblememonly/inaccessibleorargmemonly).
-struct AAMemoryLocation
+struct LLVM_CLASS_ABI AAMemoryLocation
     : public IRAttribute<
           Attribute::ReadNone,
           StateWrapper<BitIntegerState<uint32_t, 511>, AbstractAttribute>,
@@ -4777,7 +4777,7 @@ struct AAMemoryLocation
 };
 
 /// An abstract interface for range value analysis.
-struct AAValueConstantRange
+struct LLVM_CLASS_ABI AAValueConstantRange
     : public StateWrapper<IntegerRangeState, AbstractAttribute, uint32_t> {
   using Base = StateWrapper<IntegerRangeState, AbstractAttribute, uint32_t>;
   AAValueConstantRange(const IRPosition &IRP, Attributor &A)
@@ -4849,7 +4849,7 @@ struct AAValueConstantRange
 /// that the target position can take). That never happens naturally, we only
 /// force it. As for the conditions under which we force it, see
 /// AAPotentialConstantValues.
-template <typename MemberTy> struct PotentialValuesState : AbstractState {
+template <typename MemberTy> struct LLVM_CLASS_ABI PotentialValuesState : AbstractState {
   using SetTy = SmallSetVector<MemberTy, 8>;
 
   PotentialValuesState() : IsValidState(true), UndefIsContained(false) {}
@@ -5028,9 +5028,9 @@ using PotentialConstantIntValuesState = PotentialValuesState<APInt>;
 using PotentialLLVMValuesState =
     PotentialValuesState<std::pair<AA::ValueAndContext, AA::ValueScope>>;
 
-raw_ostream &operator<<(raw_ostream &OS,
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS,
                         const PotentialConstantIntValuesState &R);
-raw_ostream &operator<<(raw_ostream &OS, const PotentialLLVMValuesState &R);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const PotentialLLVMValuesState &R);
 
 /// An abstract interface for potential values analysis.
 ///
@@ -5047,7 +5047,7 @@ raw_ostream &operator<<(raw_ostream &OS, const PotentialLLVMValuesState &R);
 ///      operator we do not currently handle).
 ///
 /// For non constant integers see AAPotentialValues.
-struct AAPotentialConstantValues
+struct LLVM_CLASS_ABI AAPotentialConstantValues
     : public StateWrapper<PotentialConstantIntValuesState, AbstractAttribute> {
   using Base = StateWrapper<PotentialConstantIntValuesState, AbstractAttribute>;
   AAPotentialConstantValues(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
@@ -5107,7 +5107,7 @@ struct AAPotentialConstantValues
   static const char ID;
 };
 
-struct AAPotentialValues
+struct LLVM_CLASS_ABI AAPotentialValues
     : public StateWrapper<PotentialLLVMValuesState, AbstractAttribute> {
   using Base = StateWrapper<PotentialLLVMValuesState, AbstractAttribute>;
   AAPotentialValues(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
@@ -5150,7 +5150,7 @@ struct AAPotentialValues
 };
 
 /// An abstract interface for all noundef attributes.
-struct AANoUndef
+struct LLVM_CLASS_ABI AANoUndef
     : public IRAttribute<Attribute::NoUndef,
                          StateWrapper<BooleanState, AbstractAttribute>,
                          AANoUndef> {
@@ -5191,7 +5191,7 @@ struct AANoUndef
   static const char ID;
 };
 
-struct AANoFPClass
+struct LLVM_CLASS_ABI AANoFPClass
     : public IRAttribute<
           Attribute::NoFPClass,
           StateWrapper<BitIntegerState<uint32_t, fcAllFlags, fcNone>,
@@ -5244,7 +5244,7 @@ struct AACallEdges;
 /// An Iterator for call edges, creates AACallEdges attributes in a lazy way.
 /// This iterator becomes invalid if the underlying edge list changes.
 /// So This shouldn't outlive a iteration of Attributor.
-class AACallEdgeIterator
+class LLVM_CLASS_ABI AACallEdgeIterator
     : public iterator_adaptor_base<AACallEdgeIterator,
                                    SetVector<Function *>::iterator> {
   AACallEdgeIterator(Attributor &A, SetVector<Function *>::iterator Begin)
@@ -5259,7 +5259,7 @@ class AACallEdgeIterator
   friend AttributorCallGraph;
 };
 
-struct AACallGraphNode {
+struct LLVM_CLASS_ABI AACallGraphNode {
   AACallGraphNode(Attributor &A) : A(A) {}
   virtual ~AACallGraphNode() = default;
 
@@ -5280,7 +5280,7 @@ struct AACallGraphNode {
 /// An abstract state for querying live call edges.
 /// This interface uses the Attributor's optimistic liveness
 /// information to compute the edges that are alive.
-struct AACallEdges : public StateWrapper<BooleanState, AbstractAttribute>,
+struct LLVM_CLASS_ABI AACallEdges : public StateWrapper<BooleanState, AbstractAttribute>,
                      AACallGraphNode {
   using Base = StateWrapper<BooleanState, AbstractAttribute>;
 
@@ -5329,7 +5329,7 @@ struct AACallEdges : public StateWrapper<BooleanState, AbstractAttribute>,
 };
 
 // Synthetic root node for the Attributor's internal call graph.
-struct AttributorCallGraph : public AACallGraphNode {
+struct LLVM_CLASS_ABI AttributorCallGraph : public AACallGraphNode {
   AttributorCallGraph(Attributor &A) : AACallGraphNode(A) {}
   virtual ~AttributorCallGraph() = default;
 
@@ -5352,7 +5352,7 @@ struct AttributorCallGraph : public AACallGraphNode {
   void print();
 };
 
-template <> struct GraphTraits<AACallGraphNode *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<AACallGraphNode *> {
   using NodeRef = AACallGraphNode *;
   using ChildIteratorType = AACallEdgeIterator;
 
@@ -5366,7 +5366,7 @@ template <> struct GraphTraits<AACallGraphNode *> {
 };
 
 template <>
-struct GraphTraits<AttributorCallGraph *>
+struct LLVM_CLASS_ABI GraphTraits<AttributorCallGraph *>
     : public GraphTraits<AACallGraphNode *> {
   using nodes_iterator = AACallEdgeIterator;
 
@@ -5384,7 +5384,7 @@ struct GraphTraits<AttributorCallGraph *>
 };
 
 template <>
-struct DOTGraphTraits<AttributorCallGraph *> : public DefaultDOTGraphTraits {
+struct LLVM_CLASS_ABI DOTGraphTraits<AttributorCallGraph *> : public DefaultDOTGraphTraits {
   DOTGraphTraits(bool Simple = false) : DefaultDOTGraphTraits(Simple) {}
 
   std::string getNodeLabel(const AACallGraphNode *Node,
@@ -5400,7 +5400,7 @@ struct DOTGraphTraits<AttributorCallGraph *> : public DefaultDOTGraphTraits {
   }
 };
 
-struct AAExecutionDomain
+struct LLVM_CLASS_ABI AAExecutionDomain
     : public StateWrapper<BooleanState, AbstractAttribute> {
   using Base = StateWrapper<BooleanState, AbstractAttribute>;
   AAExecutionDomain(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
@@ -5477,7 +5477,7 @@ struct AAExecutionDomain
 };
 
 /// An abstract Attribute for computing reachability between functions.
-struct AAInterFnReachability
+struct LLVM_CLASS_ABI AAInterFnReachability
     : public StateWrapper<BooleanState, AbstractAttribute> {
   using Base = StateWrapper<BooleanState, AbstractAttribute>;
 
@@ -5519,7 +5519,7 @@ struct AAInterFnReachability
 
 /// An abstract Attribute for determining the necessity of the convergent
 /// attribute.
-struct AANonConvergent : public StateWrapper<BooleanState, AbstractAttribute> {
+struct LLVM_CLASS_ABI AANonConvergent : public StateWrapper<BooleanState, AbstractAttribute> {
   using Base = StateWrapper<BooleanState, AbstractAttribute>;
 
   AANonConvergent(const IRPosition &IRP, Attributor &A) : Base(IRP) {}
@@ -5551,7 +5551,7 @@ struct AANonConvergent : public StateWrapper<BooleanState, AbstractAttribute> {
 };
 
 /// An abstract interface for struct information.
-struct AAPointerInfo : public AbstractAttribute {
+struct LLVM_CLASS_ABI AAPointerInfo : public AbstractAttribute {
   AAPointerInfo(const IRPosition &IRP) : AbstractAttribute(IRP) {}
 
   /// See AbstractAttribute::isValidIRPositionForInit
@@ -5946,7 +5946,7 @@ struct AAPointerInfo : public AbstractAttribute {
 };
 
 /// An abstract attribute for getting assumption information.
-struct AAAssumptionInfo
+struct LLVM_CLASS_ABI AAAssumptionInfo
     : public StateWrapper<SetState<StringRef>, AbstractAttribute,
                           DenseSet<StringRef>> {
   using Base =
@@ -5980,7 +5980,7 @@ struct AAAssumptionInfo
 };
 
 /// An abstract attribute for getting all assumption underlying objects.
-struct AAUnderlyingObjects : AbstractAttribute {
+struct LLVM_CLASS_ABI AAUnderlyingObjects : AbstractAttribute {
   AAUnderlyingObjects(const IRPosition &IRP) : AbstractAttribute(IRP) {}
 
   /// See AbstractAttribute::isValidIRPositionForInit
@@ -6018,7 +6018,7 @@ struct AAUnderlyingObjects : AbstractAttribute {
                           AA::ValueScope Scope = AA::Interprocedural) const = 0;
 };
 
-raw_ostream &operator<<(raw_ostream &, const AAPointerInfo::Access &);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &, const AAPointerInfo::Access &);
 
 /// Run options, used by the pass manager.
 enum AttributorRunOption {
diff --git a/llvm/include/llvm/Transforms/IPO/BlockExtractor.h b/llvm/include/llvm/Transforms/IPO/BlockExtractor.h
index b596e24732f1e67..f10db3afc50ebf5 100644
--- a/llvm/include/llvm/Transforms/IPO/BlockExtractor.h
+++ b/llvm/include/llvm/Transforms/IPO/BlockExtractor.h
@@ -23,7 +23,7 @@
 namespace llvm {
 class BasicBlock;
 
-struct BlockExtractorPass : PassInfoMixin<BlockExtractorPass> {
+struct LLVM_CLASS_ABI BlockExtractorPass : PassInfoMixin<BlockExtractorPass> {
   BlockExtractorPass(std::vector<std::vector<BasicBlock *>> &&GroupsOfBlocks,
                      bool EraseFunctions);
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h b/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h
index 89af01b7e8f2bbf..48f62651f12fe6c 100644
--- a/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h
+++ b/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h
@@ -24,7 +24,7 @@
 
 namespace llvm {
 
-class CalledValuePropagationPass
+class LLVM_CLASS_ABI CalledValuePropagationPass
     : public PassInfoMixin<CalledValuePropagationPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
diff --git a/llvm/include/llvm/Transforms/IPO/ConstantMerge.h b/llvm/include/llvm/Transforms/IPO/ConstantMerge.h
index 1a3e0fd20f7aaa0..75fd52466df32b4 100644
--- a/llvm/include/llvm/Transforms/IPO/ConstantMerge.h
+++ b/llvm/include/llvm/Transforms/IPO/ConstantMerge.h
@@ -27,7 +27,7 @@ namespace llvm {
 class Module;
 
 /// A pass that merges duplicate global constants into a single constant.
-class ConstantMergePass : public PassInfoMixin<ConstantMergePass> {
+class LLVM_CLASS_ABI ConstantMergePass : public PassInfoMixin<ConstantMergePass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
 };
diff --git a/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h b/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h
index 709a63a4f8a2a70..d04c3f349e9e45a 100644
--- a/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h
+++ b/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h
@@ -18,7 +18,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class CrossDSOCFIPass : public PassInfoMixin<CrossDSOCFIPass> {
+class LLVM_CLASS_ABI CrossDSOCFIPass : public PassInfoMixin<CrossDSOCFIPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h b/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h
index 1193946d20ed4a9..c11763303cd1c78 100644
--- a/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h
+++ b/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h
@@ -36,7 +36,7 @@ class Use;
 class Value;
 
 /// Eliminate dead arguments (and return values) from functions.
-class DeadArgumentEliminationPass
+class LLVM_CLASS_ABI DeadArgumentEliminationPass
     : public PassInfoMixin<DeadArgumentEliminationPass> {
 public:
   /// Struct that represents (part of) either a return value or a function
diff --git a/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h b/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h
index 4ddbc4ba0ae6f5a..6dae40ea5521059 100644
--- a/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h
+++ b/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h
@@ -22,7 +22,7 @@ namespace llvm {
 class Module;
 
 /// A pass that transforms external global definitions into declarations.
-class EliminateAvailableExternallyPass
+class LLVM_CLASS_ABI EliminateAvailableExternallyPass
     : public PassInfoMixin<EliminateAvailableExternallyPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
diff --git a/llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h b/llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h
index 47303a8e8618b1d..534f832de79d06a 100644
--- a/llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h
+++ b/llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h
@@ -26,7 +26,7 @@ class Module;
 class ModulePass;
 class Pass;
 
-struct EmbedBitcodeOptions {
+struct LLVM_CLASS_ABI EmbedBitcodeOptions {
   EmbedBitcodeOptions() : EmbedBitcodeOptions(false, false) {}
   EmbedBitcodeOptions(bool IsThinLTO, bool EmitLTOSummary)
       : IsThinLTO(IsThinLTO), EmitLTOSummary(EmitLTOSummary) {}
@@ -36,7 +36,7 @@ struct EmbedBitcodeOptions {
 
 /// Pass embeds a copy of the module optimized with the provided pass pipeline
 /// into a global variable.
-class EmbedBitcodePass : public PassInfoMixin<EmbedBitcodePass> {
+class LLVM_CLASS_ABI EmbedBitcodePass : public PassInfoMixin<EmbedBitcodePass> {
   bool IsThinLTO;
   bool EmitLTOSummary;
   ModulePassManager MPM;
diff --git a/llvm/include/llvm/Transforms/IPO/ExtractGV.h b/llvm/include/llvm/Transforms/IPO/ExtractGV.h
index df68ed63d176a72..e7947a19159378f 100644
--- a/llvm/include/llvm/Transforms/IPO/ExtractGV.h
+++ b/llvm/include/llvm/Transforms/IPO/ExtractGV.h
@@ -15,7 +15,7 @@
 
 namespace llvm {
 
-class ExtractGVPass : public PassInfoMixin<ExtractGVPass> {
+class LLVM_CLASS_ABI ExtractGVPass : public PassInfoMixin<ExtractGVPass> {
 private:
   SetVector<GlobalValue *> Named;
   bool deleteStuff;
diff --git a/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h
index d52e296e103797e..e3ab0039e7d3958 100644
--- a/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h
+++ b/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h
@@ -21,7 +21,7 @@ class Module;
 
 /// Pass which forces specific function attributes into the IR, primarily as
 /// a debugging tool.
-struct ForceFunctionAttrsPass : PassInfoMixin<ForceFunctionAttrsPass> {
+struct LLVM_CLASS_ABI ForceFunctionAttrsPass : PassInfoMixin<ForceFunctionAttrsPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
 };
 
diff --git a/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h
index 320efbb22b20519..dbea0145dc000a3 100644
--- a/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h
+++ b/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h
@@ -29,11 +29,11 @@ class Function;
 class Module;
 
 /// Returns the memory access properties of this copy of the function.
-MemoryEffects computeFunctionBodyMemoryAccess(Function &F, AAResults &AAR);
+LLVM_FUNC_ABI MemoryEffects computeFunctionBodyMemoryAccess(Function &F, AAResults &AAR);
 
 /// Propagate function attributes for function summaries along the index's
 /// callgraph during thinlink
-bool thinLTOPropagateFunctionAttrs(
+LLVM_FUNC_ABI bool thinLTOPropagateFunctionAttrs(
     ModuleSummaryIndex &Index,
     function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
         isPrevailing);
@@ -47,7 +47,7 @@ bool thinLTOPropagateFunctionAttrs(
 /// access memory, or only read memory, and give them the readnone/readonly
 /// attribute. It also discovers function arguments that are not captured by
 /// the function and marks them with the nocapture attribute.
-struct PostOrderFunctionAttrsPass : PassInfoMixin<PostOrderFunctionAttrsPass> {
+struct LLVM_CLASS_ABI PostOrderFunctionAttrsPass : PassInfoMixin<PostOrderFunctionAttrsPass> {
   PostOrderFunctionAttrsPass(bool SkipNonRecursive = false)
       : SkipNonRecursive(SkipNonRecursive) {}
   PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
@@ -70,7 +70,7 @@ struct PostOrderFunctionAttrsPass : PassInfoMixin<PostOrderFunctionAttrsPass> {
 // FIXME: Currently there is no RPO CGSCC pass structure to slide into and so
 // this is a boring module pass, but eventually it should be an RPO CGSCC pass
 // when such infrastructure is available.
-class ReversePostOrderFunctionAttrsPass
+class LLVM_CLASS_ABI ReversePostOrderFunctionAttrsPass
     : public PassInfoMixin<ReversePostOrderFunctionAttrsPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/IPO/FunctionImport.h b/llvm/include/llvm/Transforms/IPO/FunctionImport.h
index aca2543c164ff79..44239f34f81e772 100644
--- a/llvm/include/llvm/Transforms/IPO/FunctionImport.h
+++ b/llvm/include/llvm/Transforms/IPO/FunctionImport.h
@@ -31,7 +31,7 @@ class Module;
 
 /// The function importer is automatically importing function from other modules
 /// based on the provided summary informations.
-class FunctionImporter {
+class LLVM_CLASS_ABI FunctionImporter {
 public:
   /// Set of functions to import from a source module. Each entry is a set
   /// containing all the GUIDs of all functions to import for a source module.
@@ -127,7 +127,7 @@ class FunctionImporter {
 };
 
 /// The function importing pass
-class FunctionImportPass : public PassInfoMixin<FunctionImportPass> {
+class LLVM_CLASS_ABI FunctionImportPass : public PassInfoMixin<FunctionImportPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
@@ -148,7 +148,7 @@ class FunctionImportPass : public PassInfoMixin<FunctionImportPass> {
 /// \p ExportLists contains for each Module the set of globals (GUID) that will
 /// be imported by another module, or referenced by such a function. I.e. this
 /// is the set of globals that need to be promoted/renamed appropriately.
-void ComputeCrossModuleImport(
+LLVM_FUNC_ABI void ComputeCrossModuleImport(
     const ModuleSummaryIndex &Index,
     const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
     function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
@@ -164,7 +164,7 @@ void ComputeCrossModuleImport(
 ///
 /// \p ImportList will be populated with a map that can be passed to
 /// FunctionImporter::importFunctions() above (see description there).
-void ComputeCrossModuleImportForModule(
+LLVM_FUNC_ABI void ComputeCrossModuleImportForModule(
     StringRef ModulePath,
     function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
         isPrevailing,
@@ -175,7 +175,7 @@ void ComputeCrossModuleImportForModule(
 ///
 /// \p ImportList will be populated with a map that can be passed to
 /// FunctionImporter::importFunctions() above (see description there).
-void ComputeCrossModuleImportForModuleFromIndex(
+LLVM_FUNC_ABI void ComputeCrossModuleImportForModuleFromIndex(
     StringRef ModulePath, const ModuleSummaryIndex &Index,
     FunctionImporter::ImportMapTy &ImportList);
 
@@ -188,7 +188,7 @@ enum class PrevailingType { Yes, No, Unknown };
 /// SamplePGO when needed. Normally this is done during
 /// computeDeadSymbolsAndUpdateIndirectCalls, but can be called standalone
 /// when that is not called (e.g. during testing).
-void updateIndirectCalls(ModuleSummaryIndex &Index);
+LLVM_FUNC_ABI void updateIndirectCalls(ModuleSummaryIndex &Index);
 
 /// Compute all the symbols that are "dead": i.e these that can't be reached
 /// in the graph from any of the given symbols listed in
@@ -197,14 +197,14 @@ void updateIndirectCalls(ModuleSummaryIndex &Index);
 /// predicate returns status of symbol.
 /// Also update call edges for indirect calls to local functions added from
 /// SamplePGO when needed.
-void computeDeadSymbolsAndUpdateIndirectCalls(
+LLVM_FUNC_ABI void computeDeadSymbolsAndUpdateIndirectCalls(
     ModuleSummaryIndex &Index,
     const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols,
     function_ref<PrevailingType(GlobalValue::GUID)> isPrevailing);
 
 /// Compute dead symbols and run constant propagation in combined index
 /// after that.
-void computeDeadSymbolsWithConstProp(
+LLVM_FUNC_ABI void computeDeadSymbolsWithConstProp(
     ModuleSummaryIndex &Index,
     const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols,
     function_ref<PrevailingType(GlobalValue::GUID)> isPrevailing,
@@ -212,7 +212,7 @@ void computeDeadSymbolsWithConstProp(
 
 /// Converts value \p GV to declaration, or replaces with a declaration if
 /// it is an alias. Returns true if converted, false if replaced.
-bool convertToDeclaration(GlobalValue &GV);
+LLVM_FUNC_ABI bool convertToDeclaration(GlobalValue &GV);
 
 /// Compute the set of summaries needed for a ThinLTO backend compilation of
 /// \p ModulePath.
@@ -224,14 +224,14 @@ bool convertToDeclaration(GlobalValue &GV);
 /// \p ModuleToSummariesForIndex will be populated with the needed summaries
 /// from each required module path. Use a std::map instead of StringMap to get
 /// stable order for bitcode emission.
-void gatherImportedSummariesForModule(
+LLVM_FUNC_ABI void gatherImportedSummariesForModule(
     StringRef ModulePath,
     const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
     const FunctionImporter::ImportMapTy &ImportList,
     std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex);
 
 /// Emit into \p OutputFilename the files module \p ModulePath will import from.
-std::error_code EmitImportsFiles(
+LLVM_FUNC_ABI std::error_code EmitImportsFiles(
     StringRef ModulePath, StringRef OutputFilename,
     const std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex);
 
@@ -241,13 +241,13 @@ std::error_code EmitImportsFiles(
 ///    and consider visibility from other definitions for ELF) in \p TheModule
 /// 2. (optional) Apply propagated function attributes to \p TheModule if
 ///    PropagateAttrs is true
-void thinLTOFinalizeInModule(Module &TheModule,
+LLVM_FUNC_ABI void thinLTOFinalizeInModule(Module &TheModule,
                              const GVSummaryMapTy &DefinedGlobals,
                              bool PropagateAttrs);
 
 /// Internalize \p TheModule based on the information recorded in the summaries
 /// during global summary-based analysis.
-void thinLTOInternalizeModule(Module &TheModule,
+LLVM_FUNC_ABI void thinLTOInternalizeModule(Module &TheModule,
                               const GVSummaryMapTy &DefinedGlobals);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h b/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
index 0dca5ae6697eae2..8366a2a708ae5b3 100644
--- a/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
+++ b/llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
@@ -76,7 +76,7 @@ using ConstMap = DenseMap<Value *, Constant *>;
 
 // Specialization signature, used to uniquely designate a specialization within
 // a function.
-struct SpecSig {
+struct LLVM_CLASS_ABI SpecSig {
   // Hashing support, used to distinguish between ordinary, empty, or tombstone
   // keys.
   unsigned Key = 0;
@@ -98,7 +98,7 @@ struct SpecSig {
 };
 
 // Specialization instance.
-struct Spec {
+struct LLVM_CLASS_ABI Spec {
   // Original function.
   Function *F;
 
@@ -120,7 +120,7 @@ struct Spec {
       : F(F), Sig(S), Score(Score) {}
 };
 
-class InstCostVisitor : public InstVisitor<InstCostVisitor, Constant *> {
+class LLVM_CLASS_ABI InstCostVisitor : public InstVisitor<InstCostVisitor, Constant *> {
   const DataLayout &DL;
   BlockFrequencyInfo &BFI;
   TargetTransformInfo &TTI;
@@ -155,7 +155,7 @@ class InstCostVisitor : public InstVisitor<InstCostVisitor, Constant *> {
   Constant *visitBinaryOperator(BinaryOperator &I);
 };
 
-class FunctionSpecializer {
+class LLVM_CLASS_ABI FunctionSpecializer {
 
   /// The IPSCCP Solver.
   SCCPSolver &Solver;
diff --git a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
index 9072df72d12e372..0b5aa37d1845df5 100644
--- a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
+++ b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h
@@ -34,7 +34,7 @@ class Module;
 class Value;
 
 /// Pass to remove unused function declarations.
-class GlobalDCEPass : public PassInfoMixin<GlobalDCEPass> {
+class LLVM_CLASS_ABI GlobalDCEPass : public PassInfoMixin<GlobalDCEPass> {
 public:
   GlobalDCEPass(bool InLTOPostLink = false) : InLTOPostLink(InLTOPostLink) {}
 
diff --git a/llvm/include/llvm/Transforms/IPO/GlobalOpt.h b/llvm/include/llvm/Transforms/IPO/GlobalOpt.h
index f75c99c64343ecb..c7494393ef92b6f 100644
--- a/llvm/include/llvm/Transforms/IPO/GlobalOpt.h
+++ b/llvm/include/llvm/Transforms/IPO/GlobalOpt.h
@@ -23,7 +23,7 @@ namespace llvm {
 class Module;
 
 /// Optimize globals that never have their address taken.
-class GlobalOptPass : public PassInfoMixin<GlobalOptPass> {
+class LLVM_CLASS_ABI GlobalOptPass : public PassInfoMixin<GlobalOptPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/IPO/GlobalSplit.h b/llvm/include/llvm/Transforms/IPO/GlobalSplit.h
index e7f158cc55d08dd..81e3a9cbeb26b96 100644
--- a/llvm/include/llvm/Transforms/IPO/GlobalSplit.h
+++ b/llvm/include/llvm/Transforms/IPO/GlobalSplit.h
@@ -24,7 +24,7 @@ namespace llvm {
 class Module;
 
 /// Pass to perform split of global variables.
-class GlobalSplitPass : public PassInfoMixin<GlobalSplitPass> {
+class LLVM_CLASS_ABI GlobalSplitPass : public PassInfoMixin<GlobalSplitPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h b/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h
index 493073661a5492c..7d70fe4c626a702 100644
--- a/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h
+++ b/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h
@@ -31,7 +31,7 @@ class CodeExtractorAnalysisCache;
 /// A 0-sized SmallVector is slightly cheaper to move than a std::vector.
 using BlockSequence = SmallVector<BasicBlock *, 0>;
 
-class HotColdSplitting {
+class LLVM_CLASS_ABI HotColdSplitting {
 public:
   HotColdSplitting(ProfileSummaryInfo *ProfSI,
                    function_ref<BlockFrequencyInfo *(Function &)> GBFI,
@@ -59,7 +59,7 @@ class HotColdSplitting {
 };
 
 /// Pass to outline cold regions.
-class HotColdSplittingPass : public PassInfoMixin<HotColdSplittingPass> {
+class LLVM_CLASS_ABI HotColdSplittingPass : public PassInfoMixin<HotColdSplittingPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/IPO/IROutliner.h b/llvm/include/llvm/Transforms/IPO/IROutliner.h
index 2f21deab0b56c91..770d76c8527baac 100644
--- a/llvm/include/llvm/Transforms/IPO/IROutliner.h
+++ b/llvm/include/llvm/Transforms/IPO/IROutliner.h
@@ -61,7 +61,7 @@ class OptimizationRemarkEmitter;
 /// sequence of instructions. This includes what values need to be hoisted to
 /// arguments from the extracted function, inputs and outputs to the region, and
 /// mapping from the extracted function arguments to overall function arguments.
-struct OutlinableRegion {
+struct LLVM_CLASS_ABI OutlinableRegion {
   /// Describes the region of code.
   IRSimilarityCandidate *Candidate = nullptr;
 
@@ -197,7 +197,7 @@ struct OutlinableRegion {
 /// to identify the similar regions of code, and then extracts the similar
 /// sections into a single function.  See the above for an example as to
 /// how code is extracted and consolidated into a single function.
-class IROutliner {
+class LLVM_CLASS_ABI IROutliner {
 public:
   IROutliner(function_ref<TargetTransformInfo &(Function &)> GTTI,
              function_ref<IRSimilarityIdentifier &(Module &)> GIRSI,
@@ -442,7 +442,7 @@ class IROutliner {
 };
 
 /// Pass to outline similar regions.
-class IROutlinerPass : public PassInfoMixin<IROutlinerPass> {
+class LLVM_CLASS_ABI IROutlinerPass : public PassInfoMixin<IROutlinerPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h
index 68fadcd0989643e..c76af26e1265a9d 100644
--- a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h
+++ b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h
@@ -23,7 +23,7 @@ class Module;
 
 /// A pass which infers function attributes from the names and signatures of
 /// function declarations in a module.
-struct InferFunctionAttrsPass : PassInfoMixin<InferFunctionAttrsPass> {
+struct LLVM_CLASS_ABI InferFunctionAttrsPass : PassInfoMixin<InferFunctionAttrsPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/IPO/Inliner.h b/llvm/include/llvm/Transforms/IPO/Inliner.h
index b9ab31191c47913..51a8c1f0724bb45 100644
--- a/llvm/include/llvm/Transforms/IPO/Inliner.h
+++ b/llvm/include/llvm/Transforms/IPO/Inliner.h
@@ -33,7 +33,7 @@ namespace llvm {
 /// every attempt to be simpler. DCE of functions requires complex reasoning
 /// about comdat groups, etc. Instead, it is expected that other more focused
 /// passes be composed to achieve the same end result.
-class InlinerPass : public PassInfoMixin<InlinerPass> {
+class LLVM_CLASS_ABI InlinerPass : public PassInfoMixin<InlinerPass> {
 public:
   InlinerPass(bool OnlyMandatory = false,
               ThinOrFullLTOPhase LTOPhase = ThinOrFullLTOPhase::None)
@@ -59,7 +59,7 @@ class InlinerPass : public PassInfoMixin<InlinerPass> {
 /// module-wide state, that need to keep track of inter-inliner pass runs, for
 /// a given module. An InlineAdvisor is configured and kept alive for the
 /// duration of the ModuleInlinerWrapperPass::run.
-class ModuleInlinerWrapperPass
+class LLVM_CLASS_ABI ModuleInlinerWrapperPass
     : public PassInfoMixin<ModuleInlinerWrapperPass> {
 public:
   ModuleInlinerWrapperPass(
diff --git a/llvm/include/llvm/Transforms/IPO/Internalize.h b/llvm/include/llvm/Transforms/IPO/Internalize.h
index 3ccef96f6ab4d3a..c26cfe5580ac8f4 100644
--- a/llvm/include/llvm/Transforms/IPO/Internalize.h
+++ b/llvm/include/llvm/Transforms/IPO/Internalize.h
@@ -32,7 +32,7 @@ class Module;
 
 /// A pass that internalizes all functions and variables other than those that
 /// must be preserved according to \c MustPreserveGV.
-class InternalizePass : public PassInfoMixin<InternalizePass> {
+class LLVM_CLASS_ABI InternalizePass : public PassInfoMixin<InternalizePass> {
   struct ComdatInfo {
     // The number of members. A comdat with one member which is not externally
     // visible can be freely dropped.
diff --git a/llvm/include/llvm/Transforms/IPO/LoopExtractor.h b/llvm/include/llvm/Transforms/IPO/LoopExtractor.h
index 06971e7c8a2196f..1620877a1a2ae3b 100644
--- a/llvm/include/llvm/Transforms/IPO/LoopExtractor.h
+++ b/llvm/include/llvm/Transforms/IPO/LoopExtractor.h
@@ -21,7 +21,7 @@
 
 namespace llvm {
 
-struct LoopExtractorPass : public PassInfoMixin<LoopExtractorPass> {
+struct LLVM_CLASS_ABI LoopExtractorPass : public PassInfoMixin<LoopExtractorPass> {
   LoopExtractorPass(unsigned NumLoops = ~0) : NumLoops(NumLoops) {}
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
   void printPipeline(raw_ostream &OS,
diff --git a/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h b/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
index 105d7823afc346f..f86f72d6cf487a2 100644
--- a/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
+++ b/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h
@@ -31,7 +31,7 @@ class raw_ostream;
 
 namespace lowertypetests {
 
-struct BitSetInfo {
+struct LLVM_CLASS_ABI BitSetInfo {
   // The indices of the set bits in the bitset.
   std::set<uint64_t> Bits;
 
@@ -59,7 +59,7 @@ struct BitSetInfo {
   void print(raw_ostream &OS) const;
 };
 
-struct BitSetBuilder {
+struct LLVM_CLASS_ABI BitSetBuilder {
   SmallVector<uint64_t, 16> Offsets;
   uint64_t Min = std::numeric_limits<uint64_t>::max();
   uint64_t Max = 0;
@@ -124,7 +124,7 @@ struct BitSetBuilder {
 /// to be laid out, and calls addFragment for each bit set passing the object
 /// indices of its referenced globals. It then assembles a layout from the
 /// computed layout in the Fragments field.
-struct GlobalLayoutBuilder {
+struct LLVM_CLASS_ABI GlobalLayoutBuilder {
   /// The computed layout. Each element of this vector contains a fragment of
   /// layout (which may be empty) consisting of object indices.
   std::vector<std::vector<uint64_t>> Fragments;
@@ -172,7 +172,7 @@ struct GlobalLayoutBuilder {
 /// because for one thing it gives us better packing (the more bins there are,
 /// the less evenly they will be filled), and for another, the instruction
 /// sequences can be slightly shorter, both on x86 and ARM.
-struct ByteArrayBuilder {
+struct LLVM_CLASS_ABI ByteArrayBuilder {
   /// The byte array built so far.
   std::vector<uint8_t> Bytes;
 
@@ -194,11 +194,11 @@ struct ByteArrayBuilder {
                 uint64_t &AllocByteOffset, uint8_t &AllocMask);
 };
 
-bool isJumpTableCanonical(Function *F);
+LLVM_FUNC_ABI bool isJumpTableCanonical(Function *F);
 
 } // end namespace lowertypetests
 
-class LowerTypeTestsPass : public PassInfoMixin<LowerTypeTestsPass> {
+class LLVM_CLASS_ABI LowerTypeTestsPass : public PassInfoMixin<LowerTypeTestsPass> {
   bool UseCommandLine = false;
 
   ModuleSummaryIndex *ExportSummary = nullptr;
diff --git a/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h b/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h
index 88e3aa2722a73e9..0fef3ace8a70a1a 100644
--- a/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h
+++ b/llvm/include/llvm/Transforms/IPO/MemProfContextDisambiguation.h
@@ -28,7 +28,7 @@ class GlobalValueSummary;
 class Module;
 class OptimizationRemarkEmitter;
 
-class MemProfContextDisambiguation
+class LLVM_CLASS_ABI MemProfContextDisambiguation
     : public PassInfoMixin<MemProfContextDisambiguation> {
   /// Run the context disambiguator on \p M, returns true if any changes made.
   bool processModule(
diff --git a/llvm/include/llvm/Transforms/IPO/MergeFunctions.h b/llvm/include/llvm/Transforms/IPO/MergeFunctions.h
index 67c17b2ebe6aeb0..be004688b7748df 100644
--- a/llvm/include/llvm/Transforms/IPO/MergeFunctions.h
+++ b/llvm/include/llvm/Transforms/IPO/MergeFunctions.h
@@ -23,7 +23,7 @@ namespace llvm {
 class Module;
 
 /// Merge identical functions.
-class MergeFunctionsPass : public PassInfoMixin<MergeFunctionsPass> {
+class LLVM_CLASS_ABI MergeFunctionsPass : public PassInfoMixin<MergeFunctionsPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/IPO/ModuleInliner.h b/llvm/include/llvm/Transforms/IPO/ModuleInliner.h
index def16aecc095800..441677221552b5d 100644
--- a/llvm/include/llvm/Transforms/IPO/ModuleInliner.h
+++ b/llvm/include/llvm/Transforms/IPO/ModuleInliner.h
@@ -25,7 +25,7 @@ namespace llvm {
 /// heuristics in the module level such like PriorityInlineOrder. It can be
 /// tuned with a number of parameters to control what cost model is used and
 /// what tradeoffs are made when making the decision.
-class ModuleInlinerPass : public PassInfoMixin<ModuleInlinerPass> {
+class LLVM_CLASS_ABI ModuleInlinerPass : public PassInfoMixin<ModuleInlinerPass> {
 public:
   ModuleInlinerPass(InlineParams Params = getInlineParams(),
                     InliningAdvisorMode Mode = InliningAdvisorMode::Default,
diff --git a/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h b/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
index 0039c9678fc5086..a43b5265f07ea74 100644
--- a/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
+++ b/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h
@@ -25,21 +25,21 @@ using Kernel = Function *;
 using KernelSet = SetVector<Kernel>;
 
 /// Helper to determine if \p M contains OpenMP.
-bool containsOpenMP(Module &M);
+LLVM_FUNC_ABI bool containsOpenMP(Module &M);
 
 /// Helper to determine if \p M is a OpenMP target offloading device module.
-bool isOpenMPDevice(Module &M);
+LLVM_FUNC_ABI bool isOpenMPDevice(Module &M);
 
 /// Return true iff \p Fn is a GPU kernel; \p Fn has the "kernel" attribute.
-bool isKernel(Function &Fn);
+LLVM_FUNC_ABI bool isKernel(Function &Fn);
 
 /// Get OpenMP device kernels in \p M.
-KernelSet getDeviceKernels(Module &M);
+LLVM_FUNC_ABI KernelSet getDeviceKernels(Module &M);
 
 } // namespace omp
 
 /// OpenMP optimizations pass.
-class OpenMPOptPass : public PassInfoMixin<OpenMPOptPass> {
+class LLVM_CLASS_ABI OpenMPOptPass : public PassInfoMixin<OpenMPOptPass> {
 public:
   OpenMPOptPass() = default;
   OpenMPOptPass(ThinOrFullLTOPhase LTOPhase) : LTOPhase(LTOPhase) {}
@@ -50,7 +50,7 @@ class OpenMPOptPass : public PassInfoMixin<OpenMPOptPass> {
   const ThinOrFullLTOPhase LTOPhase = ThinOrFullLTOPhase::None;
 };
 
-class OpenMPOptCGSCCPass : public PassInfoMixin<OpenMPOptCGSCCPass> {
+class LLVM_CLASS_ABI OpenMPOptCGSCCPass : public PassInfoMixin<OpenMPOptCGSCCPass> {
 public:
   OpenMPOptCGSCCPass() = default;
   OpenMPOptCGSCCPass(ThinOrFullLTOPhase LTOPhase) : LTOPhase(LTOPhase) {}
diff --git a/llvm/include/llvm/Transforms/IPO/PartialInlining.h b/llvm/include/llvm/Transforms/IPO/PartialInlining.h
index a56beeb6d0b2dbe..f7098cf836b4dca 100644
--- a/llvm/include/llvm/Transforms/IPO/PartialInlining.h
+++ b/llvm/include/llvm/Transforms/IPO/PartialInlining.h
@@ -22,7 +22,7 @@ namespace llvm {
 class Module;
 
 /// Pass to remove unused function declarations.
-class PartialInlinerPass : public PassInfoMixin<PartialInlinerPass> {
+class LLVM_CLASS_ABI PartialInlinerPass : public PassInfoMixin<PartialInlinerPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
 };
diff --git a/llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h b/llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h
index df9eff8128b66f4..465a75a43313fe9 100644
--- a/llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h
+++ b/llvm/include/llvm/Transforms/IPO/ProfiledCallGraph.h
@@ -24,7 +24,7 @@ namespace sampleprof {
 
 struct ProfiledCallGraphNode;
 
-struct ProfiledCallGraphEdge {
+struct LLVM_CLASS_ABI ProfiledCallGraphEdge {
   ProfiledCallGraphEdge(ProfiledCallGraphNode *Source,
                         ProfiledCallGraphNode *Target, uint64_t Weight)
       : Source(Source), Target(Target), Weight(Weight) {}
@@ -37,7 +37,7 @@ struct ProfiledCallGraphEdge {
   operator ProfiledCallGraphNode *() const { return Target; }
 };
 
-struct ProfiledCallGraphNode {
+struct LLVM_CLASS_ABI ProfiledCallGraphNode {
 
   // Sort edges by callee names only since all edges to be compared are from
   // same caller. Edge weights are not considered either because for the same
@@ -60,7 +60,7 @@ struct ProfiledCallGraphNode {
   edges Edges;
 };
 
-class ProfiledCallGraph {
+class LLVM_CLASS_ABI ProfiledCallGraph {
 public:
   using iterator = ProfiledCallGraphNode::iterator;
 
@@ -212,7 +212,7 @@ class ProfiledCallGraph {
 
 } // end namespace sampleprof
 
-template <> struct GraphTraits<ProfiledCallGraphNode *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<ProfiledCallGraphNode *> {
   using NodeType = ProfiledCallGraphNode;
   using NodeRef = ProfiledCallGraphNode *;
   using EdgeType = NodeType::edge;
@@ -224,7 +224,7 @@ template <> struct GraphTraits<ProfiledCallGraphNode *> {
 };
 
 template <>
-struct GraphTraits<ProfiledCallGraph *>
+struct LLVM_CLASS_ABI GraphTraits<ProfiledCallGraph *>
     : public GraphTraits<ProfiledCallGraphNode *> {
   static NodeRef getEntryNode(ProfiledCallGraph *PCG) {
     return PCG->getEntryNode();
diff --git a/llvm/include/llvm/Transforms/IPO/SCCP.h b/llvm/include/llvm/Transforms/IPO/SCCP.h
index dbb59e16a8d1a7f..f2177465e9a95ed 100644
--- a/llvm/include/llvm/Transforms/IPO/SCCP.h
+++ b/llvm/include/llvm/Transforms/IPO/SCCP.h
@@ -33,7 +33,7 @@ class Module;
 ///   false - disabling the transformation.
 /// Intended use is to create a default object, modify parameters with
 /// additional setters and then pass it to IPSCCP.
-struct IPSCCPOptions {
+struct LLVM_CLASS_ABI IPSCCPOptions {
   bool AllowFuncSpec;
 
   IPSCCPOptions(bool AllowFuncSpec = true) : AllowFuncSpec(AllowFuncSpec) {}
@@ -46,7 +46,7 @@ struct IPSCCPOptions {
 };
 
 /// Pass to perform interprocedural constant propagation.
-class IPSCCPPass : public PassInfoMixin<IPSCCPPass> {
+class LLVM_CLASS_ABI IPSCCPPass : public PassInfoMixin<IPSCCPPass> {
   IPSCCPOptions Options;
 
 public:
diff --git a/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h b/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
index 24d0b71b7e4fbdb..dfaecfb4fd73d00 100644
--- a/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
+++ b/llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
@@ -33,7 +33,7 @@ class Instruction;
 // Internal trie tree representation used for tracking context tree and sample
 // profiles. The path from root node to a given node represents the context of
 // that nodes' profile.
-class ContextTrieNode {
+class LLVM_CLASS_ABI ContextTrieNode {
 public:
   ContextTrieNode(ContextTrieNode *Parent = nullptr,
                   StringRef FName = StringRef(),
@@ -88,7 +88,7 @@ class ContextTrieNode {
 // accurate post-inline profile for functions. Internally context profiles
 // are organized in a trie, with each node representing profile for specific
 // calling context and the context is identified by path from root to the node.
-class SampleContextTracker {
+class LLVM_CLASS_ABI SampleContextTracker {
 public:
   using ContextSamplesTy = std::vector<FunctionSamples *>;
 
diff --git a/llvm/include/llvm/Transforms/IPO/SampleProfile.h b/llvm/include/llvm/Transforms/IPO/SampleProfile.h
index e94f6ba55cd0dd4..197e2bc63607832 100644
--- a/llvm/include/llvm/Transforms/IPO/SampleProfile.h
+++ b/llvm/include/llvm/Transforms/IPO/SampleProfile.h
@@ -24,19 +24,19 @@ namespace llvm {
 
 class Module;
 
-extern cl::opt<int> SampleHotCallSiteThreshold;
-extern cl::opt<int> SampleColdCallSiteThreshold;
-extern cl::opt<int> ProfileInlineGrowthLimit;
-extern cl::opt<int> ProfileInlineLimitMin;
-extern cl::opt<int> ProfileInlineLimitMax;
-extern cl::opt<bool> SortProfiledSCC;
+LLVM_FUNC_ABI extern cl::opt<int> SampleHotCallSiteThreshold;
+LLVM_FUNC_ABI extern cl::opt<int> SampleColdCallSiteThreshold;
+LLVM_FUNC_ABI extern cl::opt<int> ProfileInlineGrowthLimit;
+LLVM_FUNC_ABI extern cl::opt<int> ProfileInlineLimitMin;
+LLVM_FUNC_ABI extern cl::opt<int> ProfileInlineLimitMax;
+LLVM_FUNC_ABI extern cl::opt<bool> SortProfiledSCC;
 
 namespace vfs {
 class FileSystem;
 } // namespace vfs
 
 /// The sample profiler data loader pass.
-class SampleProfileLoaderPass : public PassInfoMixin<SampleProfileLoaderPass> {
+class LLVM_CLASS_ABI SampleProfileLoaderPass : public PassInfoMixin<SampleProfileLoaderPass> {
 public:
   SampleProfileLoaderPass(
       std::string File = "", std::string RemappingFile = "",
diff --git a/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h b/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
index fccfcb3ab62313e..64ac3f714d35a5c 100644
--- a/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
+++ b/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
@@ -46,7 +46,7 @@ using FuncProbeFactorMap = StringMap<ProbeFactorMap>;
 // violation of updating probe factors. In principle, the sum of distribution
 // factor for a probe should be identical before and after a pass. For a
 // function pass, the factor sum for a probe would be typically 100%.
-class PseudoProbeVerifier {
+class LLVM_CLASS_ABI PseudoProbeVerifier {
 public:
   void registerCallbacks(PassInstrumentationCallbacks &PIC);
 
@@ -72,7 +72,7 @@ class PseudoProbeVerifier {
 /// Sample profile pseudo prober.
 ///
 /// Insert pseudo probes for block sampling and value sampling.
-class SampleProfileProber {
+class LLVM_CLASS_ABI SampleProfileProber {
 public:
   // Give an empty module id when the prober is not used for instrumentation.
   SampleProfileProber(Function &F, const std::string &CurModuleUniqueId);
@@ -106,7 +106,7 @@ class SampleProfileProber {
   uint32_t LastProbeId;
 };
 
-class SampleProfileProbePass : public PassInfoMixin<SampleProfileProbePass> {
+class LLVM_CLASS_ABI SampleProfileProbePass : public PassInfoMixin<SampleProfileProbePass> {
   TargetMachine *TM;
 
 public:
@@ -126,7 +126,7 @@ class SampleProfileProbePass : public PassInfoMixin<SampleProfileProbePass> {
 // pass updates distribution factors for each pseudo probe at the end of the
 // prelink pipeline, to reflect an estimated portion of the real execution
 // count.
-class PseudoProbeUpdatePass : public PassInfoMixin<PseudoProbeUpdatePass> {
+class LLVM_CLASS_ABI PseudoProbeUpdatePass : public PassInfoMixin<PseudoProbeUpdatePass> {
   void runOnFunction(Function &F, FunctionAnalysisManager &FAM);
 
 public:
diff --git a/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h b/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h
index 7947bb7acf0cf13..4c0d8d65fb93beb 100644
--- a/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h
+++ b/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h
@@ -24,7 +24,7 @@ namespace llvm {
 class Module;
 
 /// Pass to remove unused function declarations.
-struct StripDeadPrototypesPass : PassInfoMixin<StripDeadPrototypesPass> {
+struct LLVM_CLASS_ABI StripDeadPrototypesPass : PassInfoMixin<StripDeadPrototypesPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
 };
 
diff --git a/llvm/include/llvm/Transforms/IPO/StripSymbols.h b/llvm/include/llvm/Transforms/IPO/StripSymbols.h
index 3e5425e3e3d5bdc..daf6c9c7c88233a 100644
--- a/llvm/include/llvm/Transforms/IPO/StripSymbols.h
+++ b/llvm/include/llvm/Transforms/IPO/StripSymbols.h
@@ -27,19 +27,19 @@
 
 namespace llvm {
 
-struct StripSymbolsPass : PassInfoMixin<StripSymbolsPass> {
+struct LLVM_CLASS_ABI StripSymbolsPass : PassInfoMixin<StripSymbolsPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
-struct StripNonDebugSymbolsPass : PassInfoMixin<StripNonDebugSymbolsPass> {
+struct LLVM_CLASS_ABI StripNonDebugSymbolsPass : PassInfoMixin<StripNonDebugSymbolsPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
-struct StripDebugDeclarePass : PassInfoMixin<StripDebugDeclarePass> {
+struct LLVM_CLASS_ABI StripDebugDeclarePass : PassInfoMixin<StripDebugDeclarePass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
-struct StripDeadDebugInfoPass : PassInfoMixin<StripDeadDebugInfoPass> {
+struct LLVM_CLASS_ABI StripDeadDebugInfoPass : PassInfoMixin<StripDeadDebugInfoPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h b/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h
index 36c3450b60e5f42..aee61d52eaedf0a 100644
--- a/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h
+++ b/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h
@@ -15,7 +15,7 @@
 namespace llvm {
 class Module;
 
-class SyntheticCountsPropagation
+class LLVM_CLASS_ABI SyntheticCountsPropagation
     : public PassInfoMixin<SyntheticCountsPropagation> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
diff --git a/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h b/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
index c48488d367af5e0..beaf45d0d7ee128 100644
--- a/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
+++ b/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h
@@ -23,7 +23,7 @@ namespace llvm {
 class Module;
 class raw_ostream;
 
-class ThinLTOBitcodeWriterPass
+class LLVM_CLASS_ABI ThinLTOBitcodeWriterPass
     : public PassInfoMixin<ThinLTOBitcodeWriterPass> {
   raw_ostream &OS;
   raw_ostream *ThinLinkOS;
diff --git a/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h b/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
index 89a569ae7f59481..a00eb45acb51290 100644
--- a/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
+++ b/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h
@@ -37,7 +37,7 @@ namespace wholeprogramdevirt {
 
 // A bit vector that keeps track of which bits are used. We use this to
 // pack constant values compactly before and after each virtual table.
-struct AccumBitVector {
+struct LLVM_CLASS_ABI AccumBitVector {
   std::vector<uint8_t> Bytes;
 
   // Bits in BytesUsed[I] are 1 if matching bit in Bytes[I] is used, 0 if not.
@@ -86,7 +86,7 @@ struct AccumBitVector {
 };
 
 // The bits that will be stored before and after a particular vtable.
-struct VTableBits {
+struct LLVM_CLASS_ABI VTableBits {
   // The vtable global.
   GlobalVariable *GV;
 
@@ -104,7 +104,7 @@ struct VTableBits {
 };
 
 // Information about a member of a particular type identifier.
-struct TypeMemberInfo {
+struct LLVM_CLASS_ABI TypeMemberInfo {
   // The VTableBits for the vtable.
   VTableBits *Bits;
 
@@ -117,7 +117,7 @@ struct TypeMemberInfo {
 };
 
 // A virtual call target, i.e. an entry in a particular vtable.
-struct VirtualCallTarget {
+struct LLVM_CLASS_ABI VirtualCallTarget {
   VirtualCallTarget(GlobalValue *Fn, const TypeMemberInfo *TM);
 
   // For testing only.
@@ -202,26 +202,26 @@ struct VirtualCallTarget {
 // Find the minimum offset that we may store a value of size Size bits at. If
 // IsAfter is set, look for an offset before the object, otherwise look for an
 // offset after the object.
-uint64_t findLowestOffset(ArrayRef<VirtualCallTarget> Targets, bool IsAfter,
+LLVM_FUNC_ABI uint64_t findLowestOffset(ArrayRef<VirtualCallTarget> Targets, bool IsAfter,
                           uint64_t Size);
 
 // Set the stored value in each of Targets to VirtualCallTarget::RetVal at the
 // given allocation offset before the vtable address. Stores the computed
 // byte/bit offset to OffsetByte/OffsetBit.
-void setBeforeReturnValues(MutableArrayRef<VirtualCallTarget> Targets,
+LLVM_FUNC_ABI void setBeforeReturnValues(MutableArrayRef<VirtualCallTarget> Targets,
                            uint64_t AllocBefore, unsigned BitWidth,
                            int64_t &OffsetByte, uint64_t &OffsetBit);
 
 // Set the stored value in each of Targets to VirtualCallTarget::RetVal at the
 // given allocation offset after the vtable address. Stores the computed
 // byte/bit offset to OffsetByte/OffsetBit.
-void setAfterReturnValues(MutableArrayRef<VirtualCallTarget> Targets,
+LLVM_FUNC_ABI void setAfterReturnValues(MutableArrayRef<VirtualCallTarget> Targets,
                           uint64_t AllocAfter, unsigned BitWidth,
                           int64_t &OffsetByte, uint64_t &OffsetBit);
 
 } // end namespace wholeprogramdevirt
 
-struct WholeProgramDevirtPass : public PassInfoMixin<WholeProgramDevirtPass> {
+struct LLVM_CLASS_ABI WholeProgramDevirtPass : public PassInfoMixin<WholeProgramDevirtPass> {
   ModuleSummaryIndex *ExportSummary;
   const ModuleSummaryIndex *ImportSummary;
   bool UseCommandLine = false;
@@ -235,17 +235,17 @@ struct WholeProgramDevirtPass : public PassInfoMixin<WholeProgramDevirtPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
 };
 
-struct VTableSlotSummary {
+struct LLVM_CLASS_ABI VTableSlotSummary {
   StringRef TypeID;
   uint64_t ByteOffset;
 };
-bool hasWholeProgramVisibility(bool WholeProgramVisibilityEnabledInLTO);
-void updatePublicTypeTestCalls(Module &M,
+LLVM_FUNC_ABI bool hasWholeProgramVisibility(bool WholeProgramVisibilityEnabledInLTO);
+LLVM_FUNC_ABI void updatePublicTypeTestCalls(Module &M,
                                bool WholeProgramVisibilityEnabledInLTO);
-void updateVCallVisibilityInModule(
+LLVM_FUNC_ABI void updateVCallVisibilityInModule(
     Module &M, bool WholeProgramVisibilityEnabledInLTO,
     const DenseSet<GlobalValue::GUID> &DynamicExportSymbols);
-void updateVCallVisibilityInIndex(
+LLVM_FUNC_ABI void updateVCallVisibilityInIndex(
     ModuleSummaryIndex &Index, bool WholeProgramVisibilityEnabledInLTO,
     const DenseSet<GlobalValue::GUID> &DynamicExportSymbols);
 
@@ -256,13 +256,13 @@ void updateVCallVisibilityInIndex(
 /// locating the corresponding WPD resolution is recorded for the ValueInfo
 /// in case it is exported by cross module importing (in which case the
 /// devirtualized target name will need adjustment).
-void runWholeProgramDevirtOnIndex(
+LLVM_FUNC_ABI void runWholeProgramDevirtOnIndex(
     ModuleSummaryIndex &Summary, std::set<GlobalValue::GUID> &ExportedGUIDs,
     std::map<ValueInfo, std::vector<VTableSlotSummary>> &LocalWPDTargetsMap);
 
 /// Call after cross-module importing to update the recorded single impl
 /// devirt target names for any locals that were exported.
-void updateIndexWPDForExports(
+LLVM_FUNC_ABI void updateIndexWPDForExports(
     ModuleSummaryIndex &Summary,
     function_ref<bool(StringRef, ValueInfo)> isExported,
     std::map<ValueInfo, std::vector<VTableSlotSummary>> &LocalWPDTargetsMap);
diff --git a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
index 6970937ab503296..defbc4831bc9c86 100644
--- a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
+++ b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h
@@ -28,7 +28,7 @@ namespace llvm {
 
 static constexpr unsigned InstCombineDefaultMaxIterations = 1000;
 
-struct InstCombineOptions {
+struct LLVM_CLASS_ABI InstCombineOptions {
   bool UseLoopInfo = false;
   unsigned MaxIterations = InstCombineDefaultMaxIterations;
 
@@ -45,7 +45,7 @@ struct InstCombineOptions {
   }
 };
 
-class InstCombinePass : public PassInfoMixin<InstCombinePass> {
+class LLVM_CLASS_ABI InstCombinePass : public PassInfoMixin<InstCombinePass> {
 private:
   InstructionWorklist Worklist;
   InstCombineOptions Options;
@@ -62,7 +62,7 @@ class InstCombinePass : public PassInfoMixin<InstCombinePass> {
 ///
 /// This is a basic whole-function wrapper around the instcombine utility. It
 /// will try to combine all instructions in the function.
-class InstructionCombiningPass : public FunctionPass {
+class LLVM_CLASS_ABI InstructionCombiningPass : public FunctionPass {
   InstructionWorklist Worklist;
 
 public:
@@ -86,7 +86,7 @@ class InstructionCombiningPass : public FunctionPass {
 // into:
 //    %Z = add int 2, %X
 //
-FunctionPass *createInstructionCombiningPass();
+LLVM_FUNC_ABI FunctionPass *createInstructionCombiningPass();
 }
 
 #undef DEBUG_TYPE
diff --git a/llvm/include/llvm/Transforms/Instrumentation.h b/llvm/include/llvm/Transforms/Instrumentation.h
index 72a9d09a019864e..afc2e36c05b1497 100644
--- a/llvm/include/llvm/Transforms/Instrumentation.h
+++ b/llvm/include/llvm/Transforms/Instrumentation.h
@@ -38,21 +38,21 @@ class CallBase;
 /// that must remain in the entry block up before the split point. Static
 /// allocas and llvm.localescape calls, for example, must remain in the entry
 /// block.
-BasicBlock::iterator PrepareToSplitEntryBlock(BasicBlock &BB,
+LLVM_FUNC_ABI BasicBlock::iterator PrepareToSplitEntryBlock(BasicBlock &BB,
                                               BasicBlock::iterator IP);
 
 // Create a constant for Str so that we can pass it to the run-time lib.
-GlobalVariable *createPrivateGlobalForString(Module &M, StringRef Str,
+LLVM_FUNC_ABI GlobalVariable *createPrivateGlobalForString(Module &M, StringRef Str,
                                              bool AllowMerging,
                                              const char *NamePrefix = "");
 
 // Returns F.getComdat() if it exists.
 // Otherwise creates a new comdat, sets F's comdat, and returns it.
 // Returns nullptr on failure.
-Comdat *getOrCreateFunctionComdat(Function &F, Triple &T);
+LLVM_FUNC_ABI Comdat *getOrCreateFunctionComdat(Function &F, Triple &T);
 
 // Insert GCOV profiling instrumentation
-struct GCOVOptions {
+struct LLVM_CLASS_ABI GCOVOptions {
   static GCOVOptions getDefault();
 
   // Specify whether to emit .gcno files.
@@ -98,13 +98,13 @@ namespace pgo {
 // If \p AttachProfToDirectCall is true, a prof metadata is attached to the
 // new direct call to contain \p Count.
 // Returns the promoted direct call instruction.
-CallBase &promoteIndirectCall(CallBase &CB, Function *F, uint64_t Count,
+LLVM_FUNC_ABI CallBase &promoteIndirectCall(CallBase &CB, Function *F, uint64_t Count,
                               uint64_t TotalCount, bool AttachProfToDirectCall,
                               OptimizationRemarkEmitter *ORE);
 } // namespace pgo
 
 /// Options for the frontend instrumentation based profiling pass.
-struct InstrProfOptions {
+struct LLVM_CLASS_ABI InstrProfOptions {
   // Add the 'noredzone' attribute to added runtime library calls.
   bool NoRedZone = false;
 
@@ -124,7 +124,7 @@ struct InstrProfOptions {
 };
 
 // Options for sanitizer coverage instrumentation.
-struct SanitizerCoverageOptions {
+struct LLVM_CLASS_ABI SanitizerCoverageOptions {
   enum Type {
     SCK_None = 0,
     SCK_Function,
@@ -178,7 +178,7 @@ static inline uint32_t scaleBranchCount(uint64_t Count, uint64_t Scale) {
 // Some non-call instructions may be missing debug info, but when inserting
 // instrumentation calls, some builds (e.g. LTO) want calls to have debug info
 // if the enclosing function does.
-struct InstrumentationIRBuilder : IRBuilder<> {
+struct LLVM_CLASS_ABI InstrumentationIRBuilder : IRBuilder<> {
   static void ensureDebugInfo(IRBuilder<> &IRB, const Function &F) {
     if (IRB.getCurrentDebugLocation())
       return;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
index 0cb701021ab407e..0824c0cd5993090 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
@@ -21,7 +21,7 @@ namespace llvm {
 class Module;
 class raw_ostream;
 
-struct AddressSanitizerOptions {
+struct LLVM_CLASS_ABI AddressSanitizerOptions {
   bool CompileKernel = false;
   bool Recover = false;
   bool UseAfterScope = false;
@@ -34,7 +34,7 @@ struct AddressSanitizerOptions {
 ///
 /// This adds 'asan.module_ctor' to 'llvm.global_ctors'. This pass may also
 /// run intependently of the function address sanitizer.
-class AddressSanitizerPass : public PassInfoMixin<AddressSanitizerPass> {
+class LLVM_CLASS_ABI AddressSanitizerPass : public PassInfoMixin<AddressSanitizerPass> {
 public:
   AddressSanitizerPass(const AddressSanitizerOptions &Options,
                        bool UseGlobalGC = true, bool UseOdrIndicator = true,
@@ -53,7 +53,7 @@ class AddressSanitizerPass : public PassInfoMixin<AddressSanitizerPass> {
   AsanCtorKind ConstructorKind;
 };
 
-struct ASanAccessInfo {
+struct LLVM_CLASS_ABI ASanAccessInfo {
   const int32_t Packed;
   const uint8_t AccessSizeIndex;
   const bool IsWrite;
diff --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
index 1bbf120e3f5d84d..8b4e06f50818d6b 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
@@ -23,7 +23,7 @@
 
 namespace llvm {
 
-class InterestingMemoryOperand {
+class LLVM_CLASS_ABI InterestingMemoryOperand {
 public:
   Use *PtrUse;
   bool IsWrite;
@@ -55,7 +55,7 @@ class InterestingMemoryOperand {
 };
 
 // Get AddressSanitizer parameters.
-void getAddressSanitizerParams(const Triple &TargetTriple, int LongSize,
+LLVM_FUNC_ABI void getAddressSanitizerParams(const Triple &TargetTriple, int LongSize,
                                bool IsKasan, uint64_t *ShadowBase,
                                int *MappingScale, bool *OrShadowOffset);
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/BlockCoverageInference.h b/llvm/include/llvm/Transforms/Instrumentation/BlockCoverageInference.h
index 28e2f26432dd2fd..c5a8c2c1bd5d649 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/BlockCoverageInference.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/BlockCoverageInference.h
@@ -27,7 +27,7 @@ class Function;
 class BasicBlock;
 class DotFuncBCIInfo;
 
-class BlockCoverageInference {
+class LLVM_CLASS_ABI BlockCoverageInference {
   friend class DotFuncBCIInfo;
 
 public:
diff --git a/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h b/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
index e2703bd4cc6e50b..929a82e71eb00b1 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
@@ -17,7 +17,7 @@ class Function;
 
 /// A pass to instrument code and perform run-time bounds checking on loads,
 /// stores, and other memory intrinsics.
-struct BoundsCheckingPass : PassInfoMixin<BoundsCheckingPass> {
+struct LLVM_CLASS_ABI BoundsCheckingPass : PassInfoMixin<BoundsCheckingPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
diff --git a/llvm/include/llvm/Transforms/Instrumentation/CFGMST.h b/llvm/include/llvm/Transforms/Instrumentation/CFGMST.h
index 66530a3e7da0b9d..23ceb32011f9cb0 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/CFGMST.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/CFGMST.h
@@ -37,7 +37,7 @@ namespace llvm {
 ///
 /// Implements a Union-find algorithm to compute Minimum Spanning Tree
 /// for a given CFG.
-template <class Edge, class BBInfo> class CFGMST {
+template <class Edge, class BBInfo> class LLVM_CLASS_ABI CFGMST {
 public:
   Function &F;
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h b/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h
index 561dd7a53e98c15..073534b279f9f3e 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h
@@ -17,7 +17,7 @@
 
 namespace llvm {
 class Module;
-class CGProfilePass : public PassInfoMixin<CGProfilePass> {
+class LLVM_CLASS_ABI CGProfilePass : public PassInfoMixin<CGProfilePass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h b/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
index 4f4ac2df4bba638..493497d12494cab 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-class ControlHeightReductionPass :
+class LLVM_CLASS_ABI ControlHeightReductionPass :
       public PassInfoMixin<ControlHeightReductionPass> {
 public:
   ControlHeightReductionPass();
diff --git a/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h
index a1fcc401fdc5986..28f2abf2186fcac 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h
@@ -16,7 +16,7 @@
 namespace llvm {
 class Module;
 
-class DataFlowSanitizerPass : public PassInfoMixin<DataFlowSanitizerPass> {
+class LLVM_CLASS_ABI DataFlowSanitizerPass : public PassInfoMixin<DataFlowSanitizerPass> {
 private:
   std::vector<std::string> ABIListFiles;
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h b/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h
index 42d337bb71dbb1b..4976824206fe209 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 /// The gcov-style instrumentation pass
-class GCOVProfilerPass : public PassInfoMixin<GCOVProfilerPass> {
+class LLVM_CLASS_ABI GCOVProfilerPass : public PassInfoMixin<GCOVProfilerPass> {
 public:
   GCOVProfilerPass(const GCOVOptions &Options = GCOVOptions::getDefault()) : GCOVOpts(Options) { }
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
index 05c17195272f377..4cabb9cc7f5cdf0 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
@@ -22,7 +22,7 @@ class Module;
 class StringRef;
 class raw_ostream;
 
-struct HWAddressSanitizerOptions {
+struct LLVM_CLASS_ABI HWAddressSanitizerOptions {
   HWAddressSanitizerOptions()
       : HWAddressSanitizerOptions(false, false, false){};
   HWAddressSanitizerOptions(bool CompileKernel, bool Recover,
@@ -37,7 +37,7 @@ struct HWAddressSanitizerOptions {
 /// This is a public interface to the hardware address sanitizer pass for
 /// instrumenting code to check for various memory errors at runtime, similar to
 /// AddressSanitizer but based on partial hardware assistance.
-class HWAddressSanitizerPass : public PassInfoMixin<HWAddressSanitizerPass> {
+class LLVM_CLASS_ABI HWAddressSanitizerPass : public PassInfoMixin<HWAddressSanitizerPass> {
 public:
   explicit HWAddressSanitizerPass(HWAddressSanitizerOptions Options)
       : Options(Options){};
diff --git a/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h b/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h
index dc18f71b011faff..a0633f986d17c12 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h
@@ -18,7 +18,7 @@ namespace llvm {
 class Module;
 
 /// The instrumentation pass for recording function order.
-class InstrOrderFilePass : public PassInfoMixin<InstrOrderFilePass> {
+class LLVM_CLASS_ABI InstrOrderFilePass : public PassInfoMixin<InstrOrderFilePass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h b/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
index 16da3bea77cef01..408f06acd3e5e76 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h
@@ -32,7 +32,7 @@ using LoadStorePair = std::pair<Instruction *, Instruction *>;
 /// Instrumentation based profiling lowering pass. This pass lowers
 /// the profile instrumented code generated by FE or the IR based
 /// instrumentation pass.
-class InstrProfiling : public PassInfoMixin<InstrProfiling> {
+class LLVM_CLASS_ABI InstrProfiling : public PassInfoMixin<InstrProfiling> {
 public:
   InstrProfiling() : IsCS(false) {}
   InstrProfiling(const InstrProfOptions &Options, bool IsCS = false)
diff --git a/llvm/include/llvm/Transforms/Instrumentation/KCFI.h b/llvm/include/llvm/Transforms/Instrumentation/KCFI.h
index 1eb2def3482ab76..e2a39c61879e372 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/KCFI.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/KCFI.h
@@ -18,7 +18,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class KCFIPass : public PassInfoMixin<KCFIPass> {
+class LLVM_CLASS_ABI KCFIPass : public PassInfoMixin<KCFIPass> {
 public:
   static bool isRequired() { return true; }
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h b/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
index 6fabbf783940f79..15176b1dcff3378 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h
@@ -33,7 +33,7 @@ class FileSystem;
 /// calls to the MemProfiler runtime library functions. The runtime library
 /// essentially replaces malloc() and free() with custom implementations that
 /// record data about the allocations.
-class MemProfilerPass : public PassInfoMixin<MemProfilerPass> {
+class LLVM_CLASS_ABI MemProfilerPass : public PassInfoMixin<MemProfilerPass> {
 public:
   explicit MemProfilerPass();
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
@@ -42,14 +42,14 @@ class MemProfilerPass : public PassInfoMixin<MemProfilerPass> {
 
 /// Public interface to the memory profiler module pass for instrumenting code
 /// to profile memory allocations and accesses.
-class ModuleMemProfilerPass : public PassInfoMixin<ModuleMemProfilerPass> {
+class LLVM_CLASS_ABI ModuleMemProfilerPass : public PassInfoMixin<ModuleMemProfilerPass> {
 public:
   explicit ModuleMemProfilerPass();
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
 
-class MemProfUsePass : public PassInfoMixin<MemProfUsePass> {
+class LLVM_CLASS_ABI MemProfUsePass : public PassInfoMixin<MemProfUsePass> {
 public:
   explicit MemProfUsePass(std::string MemoryProfileFile,
                           IntrusiveRefCntPtr<vfs::FileSystem> FS = nullptr);
diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
index c25d15756b139ee..82c017ba02d0c9b 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
@@ -22,7 +22,7 @@ class Module;
 class StringRef;
 class raw_ostream;
 
-struct MemorySanitizerOptions {
+struct LLVM_CLASS_ABI MemorySanitizerOptions {
   MemorySanitizerOptions() : MemorySanitizerOptions(0, false, false, false){};
   MemorySanitizerOptions(int TrackOrigins, bool Recover, bool Kernel)
       : MemorySanitizerOptions(TrackOrigins, Recover, Kernel, false) {}
@@ -40,7 +40,7 @@ struct MemorySanitizerOptions {
 /// inserts calls to runtime library functions. If the functions aren't declared
 /// yet, the pass inserts the declarations. Otherwise the existing globals are
 /// used.
-struct MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {
+struct LLVM_CLASS_ABI MemorySanitizerPass : public PassInfoMixin<MemorySanitizerPass> {
   MemorySanitizerPass(MemorySanitizerOptions Options) : Options(Options) {}
 
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h b/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
index 66e4b72b2de2e56..acdddda614c5c08 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
@@ -25,7 +25,7 @@
 
 namespace llvm {
 
-extern cl::opt<bool> DebugInfoCorrelate;
+LLVM_FUNC_ABI extern cl::opt<bool> DebugInfoCorrelate;
 
 class Function;
 class Instruction;
@@ -41,7 +41,7 @@ class FileSystem;
 // can be run after LTO/ThinLTO linking. Lld linker needs to see
 // all the COMDAT variables before linking. So we have this pass
 // always run before linking for CSPGO.
-class PGOInstrumentationGenCreateVar
+class LLVM_CLASS_ABI PGOInstrumentationGenCreateVar
     : public PassInfoMixin<PGOInstrumentationGenCreateVar> {
 public:
   PGOInstrumentationGenCreateVar(std::string CSInstrName = "")
@@ -53,7 +53,7 @@ class PGOInstrumentationGenCreateVar
 };
 
 /// The instrumentation (profile-instr-gen) pass for IR based PGO.
-class PGOInstrumentationGen : public PassInfoMixin<PGOInstrumentationGen> {
+class LLVM_CLASS_ABI PGOInstrumentationGen : public PassInfoMixin<PGOInstrumentationGen> {
 public:
   PGOInstrumentationGen(bool IsCS = false) : IsCS(IsCS) {}
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
@@ -64,7 +64,7 @@ class PGOInstrumentationGen : public PassInfoMixin<PGOInstrumentationGen> {
 };
 
 /// The profile annotation (profile-instr-use) pass for IR based PGO.
-class PGOInstrumentationUse : public PassInfoMixin<PGOInstrumentationUse> {
+class LLVM_CLASS_ABI PGOInstrumentationUse : public PassInfoMixin<PGOInstrumentationUse> {
 public:
   PGOInstrumentationUse(std::string Filename = "",
                         std::string RemappingFilename = "", bool IsCS = false,
@@ -81,7 +81,7 @@ class PGOInstrumentationUse : public PassInfoMixin<PGOInstrumentationUse> {
 };
 
 /// The indirect function call promotion pass.
-class PGOIndirectCallPromotion : public PassInfoMixin<PGOIndirectCallPromotion> {
+class LLVM_CLASS_ABI PGOIndirectCallPromotion : public PassInfoMixin<PGOIndirectCallPromotion> {
 public:
   PGOIndirectCallPromotion(bool IsInLTO = false, bool SamplePGO = false)
       : InLTO(IsInLTO), SamplePGO(SamplePGO) {}
@@ -94,17 +94,17 @@ class PGOIndirectCallPromotion : public PassInfoMixin<PGOIndirectCallPromotion>
 };
 
 /// The profile size based optimization pass for memory intrinsics.
-class PGOMemOPSizeOpt : public PassInfoMixin<PGOMemOPSizeOpt> {
+class LLVM_CLASS_ABI PGOMemOPSizeOpt : public PassInfoMixin<PGOMemOPSizeOpt> {
 public:
   PGOMemOPSizeOpt() = default;
 
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
-void setProfMetadata(Module *M, Instruction *TI, ArrayRef<uint64_t> EdgeCounts,
+LLVM_FUNC_ABI void setProfMetadata(Module *M, Instruction *TI, ArrayRef<uint64_t> EdgeCounts,
                      uint64_t MaxCount);
 
-void setIrrLoopHeaderMetadata(Module *M, Instruction *TI, uint64_t Count);
+LLVM_FUNC_ABI void setIrrLoopHeaderMetadata(Module *M, Instruction *TI, uint64_t Count);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h b/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h
index 28e3af7c40f1e0b..cdf3cb13adee68a 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-struct PoisonCheckingPass : public PassInfoMixin<PoisonCheckingPass> {
+struct LLVM_CLASS_ABI PoisonCheckingPass : public PassInfoMixin<PoisonCheckingPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h b/llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h
index 140428cda4c88ec..1ec6f999c50292d 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h
@@ -21,7 +21,7 @@
 
 namespace llvm {
 
-struct SanitizerBinaryMetadataOptions {
+struct LLVM_CLASS_ABI SanitizerBinaryMetadataOptions {
   bool Covered = false;
   bool Atomics = false;
   bool UAR = false;
@@ -48,7 +48,7 @@ inline constexpr char kSanitizerBinaryMetadataAtomicsSection[] =
 /// metadata for binary analysis sanitizers.
 //
 /// The pass should be inserted after optimizations.
-class SanitizerBinaryMetadataPass
+class LLVM_CLASS_ABI SanitizerBinaryMetadataPass
     : public PassInfoMixin<SanitizerBinaryMetadataPass> {
 public:
   explicit SanitizerBinaryMetadataPass(
diff --git a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
index d2e31eb78c4a783..2cf036dd3b1ba34 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
@@ -28,7 +28,7 @@ class Module;
 /// pass instruments functions for coverage, adds initialization calls to the
 /// module for trace PC guards and 8bit counters if they are requested, and
 /// appends globals to llvm.compiler.used.
-class SanitizerCoveragePass : public PassInfoMixin<SanitizerCoveragePass> {
+class LLVM_CLASS_ABI SanitizerCoveragePass : public PassInfoMixin<SanitizerCoveragePass> {
 public:
   explicit SanitizerCoveragePass(
       SanitizerCoverageOptions Options = SanitizerCoverageOptions(),
diff --git a/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
index cde17227cc1590a..2e4864735be2147 100644
--- a/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
+++ b/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
@@ -25,7 +25,7 @@ class Module;
 /// Instruments functions to detect race conditions reads. This function pass
 /// inserts calls to runtime library functions. If the functions aren't declared
 /// yet, the pass inserts the declarations. Otherwise the existing globals are
-struct ThreadSanitizerPass : public PassInfoMixin<ThreadSanitizerPass> {
+struct LLVM_CLASS_ABI ThreadSanitizerPass : public PassInfoMixin<ThreadSanitizerPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
   static bool isRequired() { return true; }
 };
@@ -33,7 +33,7 @@ struct ThreadSanitizerPass : public PassInfoMixin<ThreadSanitizerPass> {
 /// A module pass for tsan instrumentation.
 ///
 /// Create ctor and init functions.
-struct ModuleThreadSanitizerPass
+struct LLVM_CLASS_ABI ModuleThreadSanitizerPass
   : public PassInfoMixin<ModuleThreadSanitizerPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
   static bool isRequired() { return true; }
diff --git a/llvm/include/llvm/Transforms/ObjCARC.h b/llvm/include/llvm/Transforms/ObjCARC.h
index d675eca43874a91..f92c1b9b1f722eb 100644
--- a/llvm/include/llvm/Transforms/ObjCARC.h
+++ b/llvm/include/llvm/Transforms/ObjCARC.h
@@ -25,25 +25,25 @@ class Pass;
 //
 // ObjCARCContract - Late ObjC ARC cleanups.
 //
-Pass *createObjCARCContractPass();
+LLVM_FUNC_ABI Pass *createObjCARCContractPass();
 
-struct ObjCARCOptPass : public PassInfoMixin<ObjCARCOptPass> {
+struct LLVM_CLASS_ABI ObjCARCOptPass : public PassInfoMixin<ObjCARCOptPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
-struct ObjCARCContractPass : public PassInfoMixin<ObjCARCContractPass> {
+struct LLVM_CLASS_ABI ObjCARCContractPass : public PassInfoMixin<ObjCARCContractPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
-struct ObjCARCAPElimPass : public PassInfoMixin<ObjCARCAPElimPass> {
+struct LLVM_CLASS_ABI ObjCARCAPElimPass : public PassInfoMixin<ObjCARCAPElimPass> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
 
-struct ObjCARCExpandPass : public PassInfoMixin<ObjCARCExpandPass> {
+struct LLVM_CLASS_ABI ObjCARCExpandPass : public PassInfoMixin<ObjCARCExpandPass> {
   PreservedAnalyses run(Function &M, FunctionAnalysisManager &AM);
 };
 
-struct PAEvalPass : public PassInfoMixin<PAEvalPass> {
+struct LLVM_CLASS_ABI PAEvalPass : public PassInfoMixin<PAEvalPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index ffbe70f6193dcd0..d6c1bb6660488cd 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -29,7 +29,7 @@ class Pass;
 // RedundantDbgInstElimination - This pass removes redundant dbg intrinsics
 // without modifying the CFG of the function.  It is a FunctionPass.
 //
-Pass *createRedundantDbgInstEliminationPass();
+LLVM_FUNC_ABI Pass *createRedundantDbgInstEliminationPass();
 
 //===----------------------------------------------------------------------===//
 //
@@ -38,7 +38,7 @@ Pass *createRedundantDbgInstEliminationPass();
 // their other instructions become dead, to eliminate chains of dead
 // computations.
 //
-FunctionPass *createDeadCodeEliminationPass();
+LLVM_FUNC_ABI FunctionPass *createDeadCodeEliminationPass();
 
 
 //===----------------------------------------------------------------------===//
@@ -47,7 +47,7 @@ FunctionPass *createDeadCodeEliminationPass();
 // that (optimistically) combines multiple guards into one to have fewer checks
 // at runtime.
 //
-FunctionPass *createGuardWideningPass();
+LLVM_FUNC_ABI FunctionPass *createGuardWideningPass();
 
 
 //===----------------------------------------------------------------------===//
@@ -57,52 +57,52 @@ FunctionPass *createGuardWideningPass();
 // to widen guards into preheader or a single guard within loop if that's not
 // possible.
 //
-Pass *createLoopGuardWideningPass();
+LLVM_FUNC_ABI Pass *createLoopGuardWideningPass();
 
 
 //===----------------------------------------------------------------------===//
 //
 // SROA - Replace aggregates or pieces of aggregates with scalar SSA values.
 //
-FunctionPass *createSROAPass(bool PreserveCFG = true);
+LLVM_FUNC_ABI FunctionPass *createSROAPass(bool PreserveCFG = true);
 
 //===----------------------------------------------------------------------===//
 //
 // LICM - This pass is a loop invariant code motion and memory promotion pass.
 //
-Pass *createLICMPass();
+LLVM_FUNC_ABI Pass *createLICMPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopSink - This pass sinks invariants from preheader to loop body where
 // frequency is lower than loop preheader.
 //
-Pass *createLoopSinkPass();
+LLVM_FUNC_ABI Pass *createLoopSinkPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopPredication - This pass does loop predication on guards.
 //
-Pass *createLoopPredicationPass();
+LLVM_FUNC_ABI Pass *createLoopPredicationPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopStrengthReduce - This pass is strength reduces GEP instructions that use
 // a loop's canonical induction variable as one of their indices.
 //
-Pass *createLoopStrengthReducePass();
+LLVM_FUNC_ABI Pass *createLoopStrengthReducePass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopInstSimplify - This pass simplifies instructions in a loop's body.
 //
-Pass *createLoopInstSimplifyPass();
+LLVM_FUNC_ABI Pass *createLoopInstSimplifyPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopUnroll - This pass is a simple loop unrolling pass.
 //
-Pass *createLoopUnrollPass(int OptLevel = 2, bool OnlyWhenForced = false,
+LLVM_FUNC_ABI Pass *createLoopUnrollPass(int OptLevel = 2, bool OnlyWhenForced = false,
                            bool ForgetAllSCEV = false, int Threshold = -1,
                            int Count = -1, int AllowPartial = -1,
                            int Runtime = -1, int UpperBound = -1,
@@ -112,7 +112,7 @@ Pass *createLoopUnrollPass(int OptLevel = 2, bool OnlyWhenForced = false,
 //
 // LoopRotate - This pass is a simple loop rotating pass.
 //
-Pass *createLoopRotatePass(int MaxHeaderSize = -1, bool PrepareForLTO = false);
+LLVM_FUNC_ABI Pass *createLoopRotatePass(int MaxHeaderSize = -1, bool PrepareForLTO = false);
 
 //===----------------------------------------------------------------------===//
 //
@@ -120,8 +120,8 @@ Pass *createLoopRotatePass(int MaxHeaderSize = -1, bool PrepareForLTO = false);
 // references. In basically undoes the PromoteMemoryToRegister pass to make cfg
 // hacking easier.
 //
-FunctionPass *createDemoteRegisterToMemoryPass();
-extern char &DemoteRegisterToMemoryID;
+LLVM_FUNC_ABI FunctionPass *createDemoteRegisterToMemoryPass();
+LLVM_FUNC_ABI extern char &DemoteRegisterToMemoryID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -130,14 +130,14 @@ extern char &DemoteRegisterToMemoryID;
 //
 // For example:  4 + (x + 5)  ->  x + (4 + 5)
 //
-FunctionPass *createReassociatePass();
+LLVM_FUNC_ABI FunctionPass *createReassociatePass();
 
 //===----------------------------------------------------------------------===//
 //
 // CFGSimplification - Merge basic blocks, eliminate unreachable blocks,
 // simplify terminator instructions, convert switches to lookup tables, etc.
 //
-FunctionPass *createCFGSimplificationPass(
+LLVM_FUNC_ABI FunctionPass *createCFGSimplificationPass(
     SimplifyCFGOptions Options = SimplifyCFGOptions(),
     std::function<bool(const Function &)> Ftor = nullptr);
 
@@ -146,7 +146,7 @@ FunctionPass *createCFGSimplificationPass(
 // FlattenCFG - flatten CFG, reduce number of conditional branches by using
 // parallel-and and parallel-or mode, etc...
 //
-FunctionPass *createFlattenCFGPass();
+LLVM_FUNC_ABI FunctionPass *createFlattenCFGPass();
 
 //===----------------------------------------------------------------------===//
 //
@@ -155,64 +155,64 @@ FunctionPass *createFlattenCFGPass();
 ///
 /// When \p SkipUniformRegions is true the structizer will not structurize
 /// regions that only contain uniform branches.
-Pass *createStructurizeCFGPass(bool SkipUniformRegions = false);
+LLVM_FUNC_ABI Pass *createStructurizeCFGPass(bool SkipUniformRegions = false);
 
 //===----------------------------------------------------------------------===//
 //
 // TailCallElimination - This pass eliminates call instructions to the current
 // function which occur immediately before return instructions.
 //
-FunctionPass *createTailCallEliminationPass();
+LLVM_FUNC_ABI FunctionPass *createTailCallEliminationPass();
 
 //===----------------------------------------------------------------------===//
 //
 // EarlyCSE - This pass performs a simple and fast CSE pass over the dominator
 // tree.
 //
-FunctionPass *createEarlyCSEPass(bool UseMemorySSA = false);
+LLVM_FUNC_ABI FunctionPass *createEarlyCSEPass(bool UseMemorySSA = false);
 
 //===----------------------------------------------------------------------===//
 //
 // MergedLoadStoreMotion - This pass merges loads and stores in diamonds. Loads
 // are hoisted into the header, while stores sink into the footer.
 //
-FunctionPass *createMergedLoadStoreMotionPass(bool SplitFooterBB = false);
+LLVM_FUNC_ABI FunctionPass *createMergedLoadStoreMotionPass(bool SplitFooterBB = false);
 
 //===----------------------------------------------------------------------===//
 //
 // ConstantHoisting - This pass prepares a function for expensive constants.
 //
-FunctionPass *createConstantHoistingPass();
+LLVM_FUNC_ABI FunctionPass *createConstantHoistingPass();
 
 //===----------------------------------------------------------------------===//
 //
 // Sink - Code Sinking
 //
-FunctionPass *createSinkingPass();
+LLVM_FUNC_ABI FunctionPass *createSinkingPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LowerAtomic - Lower atomic intrinsics to non-atomic form
 //
-Pass *createLowerAtomicPass();
+LLVM_FUNC_ABI Pass *createLowerAtomicPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LowerGuardIntrinsic - Lower guard intrinsics to normal control flow.
 //
-Pass *createLowerGuardIntrinsicPass();
+LLVM_FUNC_ABI Pass *createLowerGuardIntrinsicPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LowerWidenableCondition - Lower widenable condition to i1 true.
 //
-Pass *createLowerWidenableConditionPass();
+LLVM_FUNC_ABI Pass *createLowerWidenableConditionPass();
 
 //===----------------------------------------------------------------------===//
 //
 // MergeICmps - Merge integer comparison chains into a memcmp
 //
-Pass *createMergeICmpsLegacyPass();
+LLVM_FUNC_ABI Pass *createMergeICmpsLegacyPass();
 
 //===----------------------------------------------------------------------===//
 //
@@ -221,84 +221,84 @@ Pass *createMergeICmpsLegacyPass();
 // on the target. If AddressSpace is left to its default value, it will be
 // obtained from the TargetTransformInfo.
 //
-FunctionPass *createInferAddressSpacesPass(unsigned AddressSpace = ~0u);
-extern char &InferAddressSpacesID;
+LLVM_FUNC_ABI FunctionPass *createInferAddressSpacesPass(unsigned AddressSpace = ~0u);
+LLVM_FUNC_ABI extern char &InferAddressSpacesID;
 
 //===----------------------------------------------------------------------===//
 //
 // LowerExpectIntrinsics - Removes llvm.expect intrinsics and creates
 // "block_weights" metadata.
-FunctionPass *createLowerExpectIntrinsicPass();
+LLVM_FUNC_ABI FunctionPass *createLowerExpectIntrinsicPass();
 
 //===----------------------------------------------------------------------===//
 //
 // TLSVariableHoist - This pass reduce duplicated TLS address call.
 //
-FunctionPass *createTLSVariableHoistPass();
+LLVM_FUNC_ABI FunctionPass *createTLSVariableHoistPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LowerConstantIntrinsicss - Expand any remaining llvm.objectsize and
 // llvm.is.constant intrinsic calls, even for the unknown cases.
 //
-FunctionPass *createLowerConstantIntrinsicsPass();
+LLVM_FUNC_ABI FunctionPass *createLowerConstantIntrinsicsPass();
 
 //===----------------------------------------------------------------------===//
 //
 // PartiallyInlineLibCalls - Tries to inline the fast path of library
 // calls such as sqrt.
 //
-FunctionPass *createPartiallyInlineLibCallsPass();
+LLVM_FUNC_ABI FunctionPass *createPartiallyInlineLibCallsPass();
 
 //===----------------------------------------------------------------------===//
 //
 // SeparateConstOffsetFromGEP - Split GEPs for better CSE
 //
-FunctionPass *createSeparateConstOffsetFromGEPPass(bool LowerGEP = false);
+LLVM_FUNC_ABI FunctionPass *createSeparateConstOffsetFromGEPPass(bool LowerGEP = false);
 
 //===----------------------------------------------------------------------===//
 //
 // SpeculativeExecution - Aggressively hoist instructions to enable
 // speculative execution on targets where branches are expensive.
 //
-FunctionPass *createSpeculativeExecutionPass();
+LLVM_FUNC_ABI FunctionPass *createSpeculativeExecutionPass();
 
 // Same as createSpeculativeExecutionPass, but does nothing unless
 // TargetTransformInfo::hasBranchDivergence() is true.
-FunctionPass *createSpeculativeExecutionIfHasBranchDivergencePass();
+LLVM_FUNC_ABI FunctionPass *createSpeculativeExecutionIfHasBranchDivergencePass();
 
 //===----------------------------------------------------------------------===//
 //
 // StraightLineStrengthReduce - This pass strength-reduces some certain
 // instruction patterns in straight-line code.
 //
-FunctionPass *createStraightLineStrengthReducePass();
+LLVM_FUNC_ABI FunctionPass *createStraightLineStrengthReducePass();
 
 //===----------------------------------------------------------------------===//
 //
 // NaryReassociate - Simplify n-ary operations by reassociation.
 //
-FunctionPass *createNaryReassociatePass();
+LLVM_FUNC_ABI FunctionPass *createNaryReassociatePass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopDataPrefetch - Perform data prefetching in loops.
 //
-FunctionPass *createLoopDataPrefetchPass();
+LLVM_FUNC_ABI FunctionPass *createLoopDataPrefetchPass();
 
 //===----------------------------------------------------------------------===//
 //
 // LoopSimplifyCFG - This pass performs basic CFG simplification on loops,
 // primarily to help other loop passes.
 //
-Pass *createLoopSimplifyCFGPass();
+LLVM_FUNC_ABI Pass *createLoopSimplifyCFGPass();
 
 //===----------------------------------------------------------------------===//
 //
 // This pass does instruction simplification on each
 // instruction in a function.
 //
-FunctionPass *createInstSimplifyLegacyPass();
+LLVM_FUNC_ABI FunctionPass *createInstSimplifyLegacyPass();
 
 
 //===----------------------------------------------------------------------===//
@@ -306,7 +306,7 @@ FunctionPass *createInstSimplifyLegacyPass();
 // createScalarizeMaskedMemIntrinPass - Replace masked load, store, gather
 // and scatter intrinsics with scalar code when target doesn't support them.
 //
-FunctionPass *createScalarizeMaskedMemIntrinLegacyPass();
+LLVM_FUNC_ABI FunctionPass *createScalarizeMaskedMemIntrinLegacyPass();
 } // End llvm namespace
 
 #endif
diff --git a/llvm/include/llvm/Transforms/Scalar/ADCE.h b/llvm/include/llvm/Transforms/Scalar/ADCE.h
index 4b53757482d122f..786e1e553072cc8 100644
--- a/llvm/include/llvm/Transforms/Scalar/ADCE.h
+++ b/llvm/include/llvm/Transforms/Scalar/ADCE.h
@@ -29,7 +29,7 @@ class Function;
 /// instructions are dead until proven otherwise. This allows it to eliminate
 /// dead computations that other DCE passes do not catch, particularly involving
 /// loop computations.
-struct ADCEPass : PassInfoMixin<ADCEPass> {
+struct LLVM_CLASS_ABI ADCEPass : PassInfoMixin<ADCEPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
 };
 
diff --git a/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h b/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h
index 9c057fd6d7c2701..7bc7c216c39c3d8 100644
--- a/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h
+++ b/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h
@@ -27,7 +27,7 @@ class DominatorTree;
 class ScalarEvolution;
 class SCEV;
 
-struct AlignmentFromAssumptionsPass
+struct LLVM_CLASS_ABI AlignmentFromAssumptionsPass
     : public PassInfoMixin<AlignmentFromAssumptionsPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 
diff --git a/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h b/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h
index 66713f7cd2e94f8..79a35fa0c531644 100644
--- a/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h
+++ b/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 class Function;
 
-struct AnnotationRemarksPass : public PassInfoMixin<AnnotationRemarksPass> {
+struct LLVM_CLASS_ABI AnnotationRemarksPass : public PassInfoMixin<AnnotationRemarksPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   static bool isRequired() { return true; }
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/BDCE.h b/llvm/include/llvm/Transforms/Scalar/BDCE.h
index c7df1ac9ca79b01..d63c6dc8a66fca0 100644
--- a/llvm/include/llvm/Transforms/Scalar/BDCE.h
+++ b/llvm/include/llvm/Transforms/Scalar/BDCE.h
@@ -24,7 +24,7 @@ namespace llvm {
 class Function;
 
 // The Bit-Tracking Dead Code Elimination pass.
-struct BDCEPass : PassInfoMixin<BDCEPass> {
+struct LLVM_CLASS_ABI BDCEPass : PassInfoMixin<BDCEPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 }
diff --git a/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h b/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h
index 0dc26db470aae05..84cbf62b336e9c5 100644
--- a/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h
+++ b/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 class Function;
 
-struct CallSiteSplittingPass : PassInfoMixin<CallSiteSplittingPass> {
+struct LLVM_CLASS_ABI CallSiteSplittingPass : PassInfoMixin<CallSiteSplittingPass> {
   /// Run the pass over the function.
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h b/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h
index 94fa04582a80a3f..436f4fec74d175f 100644
--- a/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h
+++ b/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h
@@ -67,7 +67,7 @@ namespace consthoist {
 
 /// Keeps track of the user of a constant and the operand index where the
 /// constant is used.
-struct ConstantUser {
+struct LLVM_CLASS_ABI ConstantUser {
   Instruction *Inst;
   unsigned OpndIdx;
 
@@ -77,7 +77,7 @@ struct ConstantUser {
 using ConstantUseListType = SmallVector<ConstantUser, 8>;
 
 /// Keeps track of a constant candidate and its uses.
-struct ConstantCandidate {
+struct LLVM_CLASS_ABI ConstantCandidate {
   ConstantUseListType Uses;
   // If the candidate is a ConstantExpr (currely only constant GEP expressions
   // whose base pointers are GlobalVariables are supported), ConstInt records
@@ -98,7 +98,7 @@ struct ConstantCandidate {
 
 /// This represents a constant that has been rebased with respect to a
 /// base constant. The difference to the base constant is recorded in Offset.
-struct RebasedConstantInfo {
+struct LLVM_CLASS_ABI RebasedConstantInfo {
   ConstantUseListType Uses;
   Constant *Offset;
   Type *Ty;
@@ -110,7 +110,7 @@ struct RebasedConstantInfo {
 using RebasedConstantListType = SmallVector<RebasedConstantInfo, 4>;
 
 /// A base constant and all its rebased constants.
-struct ConstantInfo {
+struct LLVM_CLASS_ABI ConstantInfo {
   // If the candidate is a ConstantExpr (currely only constant GEP expressions
   // whose base pointers are GlobalVariables are supported), ConstInt records
   // its offset from the base GV, ConstExpr tracks the candidate GEP expr.
@@ -121,7 +121,7 @@ struct ConstantInfo {
 
 } // end namespace consthoist
 
-class ConstantHoistingPass : public PassInfoMixin<ConstantHoistingPass> {
+class LLVM_CLASS_ABI ConstantHoistingPass : public PassInfoMixin<ConstantHoistingPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 
diff --git a/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h b/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h
index 6db317bc2b90e4a..0ba3dc81cea7ec1 100644
--- a/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class ConstraintEliminationPass
+class LLVM_CLASS_ABI ConstraintEliminationPass
     : public PassInfoMixin<ConstraintEliminationPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
diff --git a/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h b/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h
index 9767d40e98e68c1..4e7ae977acefe8b 100644
--- a/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h
+++ b/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 class Function;
 
-struct CorrelatedValuePropagationPass
+struct LLVM_CLASS_ABI CorrelatedValuePropagationPass
     : PassInfoMixin<CorrelatedValuePropagationPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/DCE.h b/llvm/include/llvm/Transforms/Scalar/DCE.h
index 34c35000038015b..195b9bbdfffac93 100644
--- a/llvm/include/llvm/Transforms/Scalar/DCE.h
+++ b/llvm/include/llvm/Transforms/Scalar/DCE.h
@@ -21,12 +21,12 @@ namespace llvm {
 class Function;
 
 /// Basic Dead Code Elimination pass.
-class DCEPass : public PassInfoMixin<DCEPass> {
+class LLVM_CLASS_ABI DCEPass : public PassInfoMixin<DCEPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
-class RedundantDbgInstEliminationPass
+class LLVM_CLASS_ABI RedundantDbgInstEliminationPass
     : public PassInfoMixin<RedundantDbgInstEliminationPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h b/llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h
index b7b0824b67e4d22..4029a5309d661ed 100644
--- a/llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h
+++ b/llvm/include/llvm/Transforms/Scalar/DFAJumpThreading.h
@@ -20,7 +20,7 @@ namespace llvm {
 
 class Function;
 
-struct DFAJumpThreadingPass : PassInfoMixin<DFAJumpThreadingPass> {
+struct LLVM_CLASS_ABI DFAJumpThreadingPass : PassInfoMixin<DFAJumpThreadingPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h b/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h
index 73e82c7c97aaba6..3b21d3b68a1f46f 100644
--- a/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h
@@ -26,7 +26,7 @@ class Function;
 
 /// This class implements a trivial dead store elimination. We consider
 /// only the redundant stores that are local to a single Basic Block.
-class DSEPass : public PassInfoMixin<DSEPass> {
+class LLVM_CLASS_ABI DSEPass : public PassInfoMixin<DSEPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h b/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h
index bb490af353ea449..8872022daeb7f12 100644
--- a/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h
+++ b/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 /// Hoist/decompose integer division and remainder instructions to enable CFG
 /// improvements and better codegen.
-struct DivRemPairsPass : public PassInfoMixin<DivRemPairsPass> {
+struct LLVM_CLASS_ABI DivRemPairsPass : public PassInfoMixin<DivRemPairsPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h b/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h
index 14a65c0d9919ee9..12a9358f8afab3b 100644
--- a/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h
+++ b/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h
@@ -28,7 +28,7 @@ class Function;
 /// canonicalize things as it goes. It is intended to be fast and catch obvious
 /// cases so that instcombine and other passes are more effective. It is
 /// expected that a later pass of GVN will catch the interesting/hard cases.
-struct EarlyCSEPass : PassInfoMixin<EarlyCSEPass> {
+struct LLVM_CLASS_ABI EarlyCSEPass : PassInfoMixin<EarlyCSEPass> {
   EarlyCSEPass(bool UseMemorySSA = false) : UseMemorySSA(UseMemorySSA) {}
 
   /// Run the pass over the function.
diff --git a/llvm/include/llvm/Transforms/Scalar/FlattenCFG.h b/llvm/include/llvm/Transforms/Scalar/FlattenCFG.h
index fdf5c09be42105a..c72b85792546fe9 100644
--- a/llvm/include/llvm/Transforms/Scalar/FlattenCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/FlattenCFG.h
@@ -18,7 +18,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-struct FlattenCFGPass : PassInfoMixin<FlattenCFGPass> {
+struct LLVM_CLASS_ABI FlattenCFGPass : PassInfoMixin<FlattenCFGPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Scalar/Float2Int.h b/llvm/include/llvm/Transforms/Scalar/Float2Int.h
index 63e0c3f24bf3277..d35403d5e80d5c0 100644
--- a/llvm/include/llvm/Transforms/Scalar/Float2Int.h
+++ b/llvm/include/llvm/Transforms/Scalar/Float2Int.h
@@ -29,7 +29,7 @@ class LLVMContext;
 class Type;
 class Value;
 
-class Float2IntPass : public PassInfoMixin<Float2IntPass> {
+class LLVM_CLASS_ABI Float2IntPass : public PassInfoMixin<Float2IntPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 
diff --git a/llvm/include/llvm/Transforms/Scalar/GVN.h b/llvm/include/llvm/Transforms/Scalar/GVN.h
index 0a00e3af03d2fd0..6a21e48f3805511 100644
--- a/llvm/include/llvm/Transforms/Scalar/GVN.h
+++ b/llvm/include/llvm/Transforms/Scalar/GVN.h
@@ -56,7 +56,7 @@ class TargetLibraryInfo;
 class Value;
 /// A private "module" namespace for types and utilities used by GVN. These
 /// are implementation details and should not be used by clients.
-namespace LLVM_LIBRARY_VISIBILITY gvn {
+namespace gvn LLVM_LIBRARY_VISIBILITY {
 
 struct AvailableValue;
 struct AvailableValueInBlock;
@@ -71,7 +71,7 @@ class GVNLegacyPass;
 ///      None - relying on a global default.
 /// Intended use is to create a default object, modify parameters with
 /// additional setters and then pass it to GVN.
-struct GVNOptions {
+struct LLVM_CLASS_ABI GVNOptions {
   std::optional<bool> AllowPRE;
   std::optional<bool> AllowLoadPRE;
   std::optional<bool> AllowLoadInLoopPRE;
@@ -114,7 +114,7 @@ struct GVNOptions {
 ///
 /// FIXME: We should have a good summary of the GVN algorithm implemented by
 /// this particular pass here.
-class GVNPass : public PassInfoMixin<GVNPass> {
+class LLVM_CLASS_ABI GVNPass : public PassInfoMixin<GVNPass> {
   GVNOptions Options;
 
 public:
@@ -376,18 +376,18 @@ class GVNPass : public PassInfoMixin<GVNPass> {
 
 /// Create a legacy GVN pass. This also allows parameterizing whether or not
 /// MemDep is enabled.
-FunctionPass *createGVNPass(bool NoMemDepAnalysis = false);
+LLVM_FUNC_ABI FunctionPass *createGVNPass(bool NoMemDepAnalysis = false);
 
 /// A simple and fast domtree-based GVN pass to hoist common expressions
 /// from sibling branches.
-struct GVNHoistPass : PassInfoMixin<GVNHoistPass> {
+struct LLVM_CLASS_ABI GVNHoistPass : PassInfoMixin<GVNHoistPass> {
   /// Run the pass over the function.
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
 /// Uses an "inverted" value numbering to decide the similarity of
 /// expressions and sinks similar expressions into successors.
-struct GVNSinkPass : PassInfoMixin<GVNSinkPass> {
+struct LLVM_CLASS_ABI GVNSinkPass : PassInfoMixin<GVNSinkPass> {
   /// Run the pass over the function.
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/GVNExpression.h b/llvm/include/llvm/Transforms/Scalar/GVNExpression.h
index 2433890d0df8020..dd91a552df711f1 100644
--- a/llvm/include/llvm/Transforms/Scalar/GVNExpression.h
+++ b/llvm/include/llvm/Transforms/Scalar/GVNExpression.h
@@ -57,7 +57,7 @@ enum ExpressionType {
   ET_BasicEnd
 };
 
-class Expression {
+class LLVM_CLASS_ABI Expression {
 private:
   ExpressionType EType;
   unsigned Opcode;
@@ -133,7 +133,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const Expression &E) {
   return OS;
 }
 
-class BasicExpression : public Expression {
+class LLVM_CLASS_ABI BasicExpression : public Expression {
 private:
   using RecyclerType = ArrayRecycler<Value *>;
   using RecyclerCapacity = RecyclerType::Capacity;
@@ -240,7 +240,7 @@ class BasicExpression : public Expression {
   }
 };
 
-class op_inserter {
+class LLVM_CLASS_ABI op_inserter {
 private:
   using Container = BasicExpression;
 
@@ -265,7 +265,7 @@ class op_inserter {
   op_inserter &operator++(int) { return *this; }
 };
 
-class MemoryExpression : public BasicExpression {
+class LLVM_CLASS_ABI MemoryExpression : public BasicExpression {
 private:
   const MemoryAccess *MemoryLeader;
 
@@ -298,7 +298,7 @@ class MemoryExpression : public BasicExpression {
   void setMemoryLeader(const MemoryAccess *ML) { MemoryLeader = ML; }
 };
 
-class CallExpression final : public MemoryExpression {
+class LLVM_CLASS_ABI CallExpression final : public MemoryExpression {
 private:
   CallInst *Call;
 
@@ -325,7 +325,7 @@ class CallExpression final : public MemoryExpression {
   }
 };
 
-class LoadExpression final : public MemoryExpression {
+class LLVM_CLASS_ABI LoadExpression final : public MemoryExpression {
 private:
   LoadInst *Load;
 
@@ -367,7 +367,7 @@ class LoadExpression final : public MemoryExpression {
   }
 };
 
-class StoreExpression final : public MemoryExpression {
+class LLVM_CLASS_ABI StoreExpression final : public MemoryExpression {
 private:
   StoreInst *Store;
   Value *StoredValue;
@@ -408,7 +408,7 @@ class StoreExpression final : public MemoryExpression {
   }
 };
 
-class AggregateValueExpression final : public BasicExpression {
+class LLVM_CLASS_ABI AggregateValueExpression final : public BasicExpression {
 private:
   unsigned MaxIntOperands;
   unsigned NumIntOperands = 0;
@@ -477,7 +477,7 @@ class AggregateValueExpression final : public BasicExpression {
   }
 };
 
-class int_op_inserter {
+class LLVM_CLASS_ABI int_op_inserter {
 private:
   using Container = AggregateValueExpression;
 
@@ -502,7 +502,7 @@ class int_op_inserter {
   int_op_inserter &operator++(int) { return *this; }
 };
 
-class PHIExpression final : public BasicExpression {
+class LLVM_CLASS_ABI PHIExpression final : public BasicExpression {
 private:
   BasicBlock *BB;
 
@@ -538,7 +538,7 @@ class PHIExpression final : public BasicExpression {
   }
 };
 
-class DeadExpression final : public Expression {
+class LLVM_CLASS_ABI DeadExpression final : public Expression {
 public:
   DeadExpression() : Expression(ET_Dead) {}
   DeadExpression(const DeadExpression &) = delete;
@@ -549,7 +549,7 @@ class DeadExpression final : public Expression {
   }
 };
 
-class VariableExpression final : public Expression {
+class LLVM_CLASS_ABI VariableExpression final : public Expression {
 private:
   Value *VariableValue;
 
@@ -585,7 +585,7 @@ class VariableExpression final : public Expression {
   }
 };
 
-class ConstantExpression final : public Expression {
+class LLVM_CLASS_ABI ConstantExpression final : public Expression {
 private:
   Constant *ConstantValue = nullptr;
 
@@ -622,7 +622,7 @@ class ConstantExpression final : public Expression {
   }
 };
 
-class UnknownExpression final : public Expression {
+class LLVM_CLASS_ABI UnknownExpression final : public Expression {
 private:
   Instruction *Inst;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/GuardWidening.h b/llvm/include/llvm/Transforms/Scalar/GuardWidening.h
index 5f9aba64d8bddad..e13034fc9d7cc4e 100644
--- a/llvm/include/llvm/Transforms/Scalar/GuardWidening.h
+++ b/llvm/include/llvm/Transforms/Scalar/GuardWidening.h
@@ -25,7 +25,7 @@ class LPMUpdater;
 class Loop;
 class Function;
 
-struct GuardWideningPass : public PassInfoMixin<GuardWideningPass> {
+struct LLVM_CLASS_ABI GuardWideningPass : public PassInfoMixin<GuardWideningPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h b/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h
index f5446e4767d2688..1ff3cb91b6037a0 100644
--- a/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h
+++ b/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h
@@ -19,7 +19,7 @@ class Loop;
 class raw_ostream;
 
 /// Printer pass for the \c IVUsers for a loop.
-class IVUsersPrinterPass : public PassInfoMixin<IVUsersPrinterPass> {
+class LLVM_CLASS_ABI IVUsersPrinterPass : public PassInfoMixin<IVUsersPrinterPass> {
   raw_ostream &OS;
 
 public:
diff --git a/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h b/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h
index 9589919b06408e9..47d39e9b8b52899 100644
--- a/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h
+++ b/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h
@@ -23,7 +23,7 @@ namespace llvm {
 class Loop;
 class LPMUpdater;
 
-class IndVarSimplifyPass : public PassInfoMixin<IndVarSimplifyPass> {
+class LLVM_CLASS_ABI IndVarSimplifyPass : public PassInfoMixin<IndVarSimplifyPass> {
   /// Perform IV widening during the pass.
   bool WidenIndVars;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h b/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h
index 291edd5a33e65a9..c1d39353e8e1985 100644
--- a/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-class IRCEPass : public PassInfoMixin<IRCEPass> {
+class LLVM_CLASS_ABI IRCEPass : public PassInfoMixin<IRCEPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h b/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h
index f23143034d56b39..b25984eb5f5be9c 100644
--- a/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h
+++ b/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-struct InferAddressSpacesPass : PassInfoMixin<InferAddressSpacesPass> {
+struct LLVM_CLASS_ABI InferAddressSpacesPass : PassInfoMixin<InferAddressSpacesPass> {
   InferAddressSpacesPass();
   InferAddressSpacesPass(unsigned AddressSpace);
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h b/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h
index 54b9c3e7f30f161..65c54951b130344 100644
--- a/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h
+++ b/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h
@@ -30,7 +30,7 @@ namespace llvm {
 /// restricted transform at a pass granularity. However, for a much more
 /// powerful and comprehensive peephole optimization engine, see the
 /// `instcombine` pass instead.
-class InstSimplifyPass : public PassInfoMixin<InstSimplifyPass> {
+class LLVM_CLASS_ABI InstSimplifyPass : public PassInfoMixin<InstSimplifyPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/JumpThreading.h b/llvm/include/llvm/Transforms/Scalar/JumpThreading.h
index 1ce6d4dcb25535f..990a6efc9bb013c 100644
--- a/llvm/include/llvm/Transforms/Scalar/JumpThreading.h
+++ b/llvm/include/llvm/Transforms/Scalar/JumpThreading.h
@@ -76,7 +76,7 @@ enum ConstantPreference { WantInteger, WantBlockAddress };
 ///
 /// In this case, the unconditional branch at the end of the first if can be
 /// revectored to the false side of the second if.
-class JumpThreadingPass : public PassInfoMixin<JumpThreadingPass> {
+class LLVM_CLASS_ABI JumpThreadingPass : public PassInfoMixin<JumpThreadingPass> {
   Function *F = nullptr;
   FunctionAnalysisManager *FAM = nullptr;
   TargetLibraryInfo *TLI = nullptr;
diff --git a/llvm/include/llvm/Transforms/Scalar/LICM.h b/llvm/include/llvm/Transforms/Scalar/LICM.h
index 030196a2b3b9f55..1bbf7c75f475025 100644
--- a/llvm/include/llvm/Transforms/Scalar/LICM.h
+++ b/llvm/include/llvm/Transforms/Scalar/LICM.h
@@ -43,10 +43,10 @@ class LPMUpdater;
 class Loop;
 class LoopNest;
 
-extern cl::opt<unsigned> SetLicmMssaOptCap;
-extern cl::opt<unsigned> SetLicmMssaNoAccForPromotionCap;
+LLVM_FUNC_ABI extern cl::opt<unsigned> SetLicmMssaOptCap;
+LLVM_FUNC_ABI extern cl::opt<unsigned> SetLicmMssaNoAccForPromotionCap;
 
-struct LICMOptions {
+struct LLVM_CLASS_ABI LICMOptions {
   unsigned MssaOptCap;
   unsigned MssaNoAccForPromotionCap;
   bool AllowSpeculation;
@@ -64,7 +64,7 @@ struct LICMOptions {
 };
 
 /// Performs Loop Invariant Code Motion Pass.
-class LICMPass : public PassInfoMixin<LICMPass> {
+class LLVM_CLASS_ABI LICMPass : public PassInfoMixin<LICMPass> {
   LICMOptions Opts;
 
 public:
@@ -82,7 +82,7 @@ class LICMPass : public PassInfoMixin<LICMPass> {
 };
 
 /// Performs LoopNest Invariant Code Motion Pass.
-class LNICMPass : public PassInfoMixin<LNICMPass> {
+class LLVM_CLASS_ABI LNICMPass : public PassInfoMixin<LNICMPass> {
   LICMOptions Opts;
 
 public:
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h b/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h
index cc65792b0262959..77b74d8149daa06 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h
@@ -18,7 +18,7 @@ class Function;
 class raw_ostream;
 
 /// Printer pass for the \c LoopAccessInfo results.
-class LoopAccessInfoPrinterPass
+class LLVM_CLASS_ABI LoopAccessInfoPrinterPass
     : public PassInfoMixin<LoopAccessInfoPrinterPass> {
   raw_ostream &OS;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h b/llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h
index 4c995f61fe81f97..452a8840982f90b 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopBoundSplit.h
@@ -32,7 +32,7 @@ class Loop;
 ///                                  C
 ///                                }
 ///                              }
-class LoopBoundSplitPass : public PassInfoMixin<LoopBoundSplitPass> {
+class LLVM_CLASS_ABI LoopBoundSplitPass : public PassInfoMixin<LoopBoundSplitPass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h b/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h
index 35ee3164aa6a8c3..1340c940dc000ab 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h
@@ -21,7 +21,7 @@ namespace llvm {
 class Function;
 
 /// An optimization pass inserting data prefetches in loops.
-class LoopDataPrefetchPass : public PassInfoMixin<LoopDataPrefetchPass> {
+class LLVM_CLASS_ABI LoopDataPrefetchPass : public PassInfoMixin<LoopDataPrefetchPass> {
 public:
   LoopDataPrefetchPass() = default;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h b/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h
index 3ba4ac42b584f57..dab3b21dbce56ad 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h
@@ -22,7 +22,7 @@ namespace llvm {
 class Loop;
 class LPMUpdater;
 
-class LoopDeletionPass : public PassInfoMixin<LoopDeletionPass> {
+class LLVM_CLASS_ABI LoopDeletionPass : public PassInfoMixin<LoopDeletionPass> {
 public:
   LoopDeletionPass() = default;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h b/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h
index 8a455c1b0225712..a33e4b063dec3d8 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h
@@ -23,7 +23,7 @@ namespace llvm {
 
 class Function;
 
-class LoopDistributePass : public PassInfoMixin<LoopDistributePass> {
+class LLVM_CLASS_ABI LoopDistributePass : public PassInfoMixin<LoopDistributePass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h b/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h
index e531c919a48ea56..beaf907f0bbe620 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h
@@ -21,7 +21,7 @@ namespace llvm {
 class LPMUpdater;
 class LoopNest;
 
-class LoopFlattenPass : public PassInfoMixin<LoopFlattenPass> {
+class LLVM_CLASS_ABI LoopFlattenPass : public PassInfoMixin<LoopFlattenPass> {
 public:
   LoopFlattenPass() = default;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopFuse.h b/llvm/include/llvm/Transforms/Scalar/LoopFuse.h
index 4dc81f8133ddc22..72164639f7785aa 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopFuse.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopFuse.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 class Function;
 
-class LoopFusePass : public PassInfoMixin<LoopFusePass> {
+class LLVM_CLASS_ABI LoopFusePass : public PassInfoMixin<LoopFusePass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h b/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
index 1766d481cd3fe06..776f87b03d01587 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
@@ -26,7 +26,7 @@ class LPMUpdater;
 
 /// Options to disable Loop Idiom Recognize, which can be shared with other
 /// passes.
-struct DisableLIRP {
+struct LLVM_CLASS_ABI DisableLIRP {
   /// When true, the entire pass is disabled.
   static bool All;
 
@@ -38,7 +38,7 @@ struct DisableLIRP {
 };
 
 /// Performs Loop Idiom Recognize Pass.
-class LoopIdiomRecognizePass : public PassInfoMixin<LoopIdiomRecognizePass> {
+class LLVM_CLASS_ABI LoopIdiomRecognizePass : public PassInfoMixin<LoopIdiomRecognizePass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h b/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h
index 9c40b4a1bd2f6e6..25e0903ddad99a4 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h
@@ -23,7 +23,7 @@ class Loop;
 class LPMUpdater;
 
 /// Performs Loop Inst Simplify Pass.
-class LoopInstSimplifyPass : public PassInfoMixin<LoopInstSimplifyPass> {
+class LLVM_CLASS_ABI LoopInstSimplifyPass : public PassInfoMixin<LoopInstSimplifyPass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h b/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h
index b76711a604bd1d6..9057088df0d1815 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h
@@ -18,7 +18,7 @@ namespace llvm {
 class LPMUpdater;
 class LoopNest;
 
-struct LoopInterchangePass : public PassInfoMixin<LoopInterchangePass> {
+struct LLVM_CLASS_ABI LoopInterchangePass : public PassInfoMixin<LoopInterchangePass> {
   PreservedAnalyses run(LoopNest &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h b/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h
index 40d19fa8f8c01e0..b4c1d68a4728892 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h
@@ -25,7 +25,7 @@ class Function;
 
 /// Pass to forward loads in a loop around the backedge to subsequent
 /// iterations.
-struct LoopLoadEliminationPass : public PassInfoMixin<LoopLoadEliminationPass> {
+struct LLVM_CLASS_ABI LoopLoadEliminationPass : public PassInfoMixin<LoopLoadEliminationPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
index 4515ab88996a763..3dd53e77210d89f 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
@@ -67,7 +67,7 @@ using HasRunOnLoopT = decltype(std::declval<PassT>().run(
 // See the comments on the definition of the specialization for details on how
 // it differs from the primary template.
 template <>
-class PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
+class LLVM_CLASS_ABI PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
                   LPMUpdater &>
     : public PassInfoMixin<
           PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
@@ -221,7 +221,7 @@ typedef PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
 /// the extra parameters from a transformation's run method to the
 /// AnalysisManager's getResult.
 template <typename AnalysisT>
-struct RequireAnalysisPass<AnalysisT, Loop, LoopAnalysisManager,
+struct LLVM_CLASS_ABI RequireAnalysisPass<AnalysisT, Loop, LoopAnalysisManager,
                            LoopStandardAnalysisResults &, LPMUpdater &>
     : PassInfoMixin<
           RequireAnalysisPass<AnalysisT, Loop, LoopAnalysisManager,
@@ -260,7 +260,7 @@ class FunctionToLoopPassAdaptor;
 /// inserted recursively. On the other hand, in loop-nest mode, only top-level
 /// loops are contained in the worklist and the addition of new (top-level)
 /// loops will not trigger the addition of their subloops.
-class LPMUpdater {
+class LLVM_CLASS_ABI LPMUpdater {
 public:
   /// This can be queried by loop passes which run other loop passes (like pass
   /// managers) to know whether the loop needs to be skipped due to updates to
@@ -432,7 +432,7 @@ std::optional<PreservedAnalyses> LoopPassManager::runSinglePass(
 /// processed in loop-nest mode. Please refer to the various specializations of
 /// \fn createLoopFunctionToLoopPassAdaptor to see when loop mode and loop-nest
 /// mode are used.
-class FunctionToLoopPassAdaptor
+class LLVM_CLASS_ABI FunctionToLoopPassAdaptor
     : public PassInfoMixin<FunctionToLoopPassAdaptor> {
 public:
   using PassConceptT =
@@ -539,7 +539,7 @@ createFunctionToLoopPassAdaptor<LoopPassManager>(
 }
 
 /// Pass for printing a loop's contents as textual IR.
-class PrintLoopPass : public PassInfoMixin<PrintLoopPass> {
+class LLVM_CLASS_ABI PrintLoopPass : public PassInfoMixin<PrintLoopPass> {
   raw_ostream &OS;
   std::string Banner;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPredication.h b/llvm/include/llvm/Transforms/Scalar/LoopPredication.h
index 264189f988c1722..84e254eeed73004 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopPredication.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopPredication.h
@@ -23,7 +23,7 @@ namespace llvm {
 class LPMUpdater;
 class Loop;
 /// Performs Loop Predication Pass.
-class LoopPredicationPass : public PassInfoMixin<LoopPredicationPass> {
+class LLVM_CLASS_ABI LoopPredicationPass : public PassInfoMixin<LoopPredicationPass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopReroll.h b/llvm/include/llvm/Transforms/Scalar/LoopReroll.h
index 0e9a92d4b020832..a4dbf2c038f57cc 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopReroll.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopReroll.h
@@ -15,7 +15,7 @@
 
 namespace llvm {
 
-class LoopRerollPass : public PassInfoMixin<LoopRerollPass> {
+class LLVM_CLASS_ABI LoopRerollPass : public PassInfoMixin<LoopRerollPass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopRotation.h b/llvm/include/llvm/Transforms/Scalar/LoopRotation.h
index 89b8a4f35b3e840..df518903f738838 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopRotation.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopRotation.h
@@ -22,7 +22,7 @@ class LPMUpdater;
 class Loop;
 
 /// A simple loop rotation transformation.
-class LoopRotatePass : public PassInfoMixin<LoopRotatePass> {
+class LLVM_CLASS_ABI LoopRotatePass : public PassInfoMixin<LoopRotatePass> {
 public:
   LoopRotatePass(bool EnableHeaderDuplication = true,
                  bool PrepareForLTO = false);
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h
index e35265f40291b34..3802ef929899e8c 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h
@@ -26,7 +26,7 @@ class LPMUpdater;
 class Loop;
 
 /// Performs basic CFG simplifications to assist other loop passes.
-class LoopSimplifyCFGPass : public PassInfoMixin<LoopSimplifyCFGPass> {
+class LLVM_CLASS_ABI LoopSimplifyCFGPass : public PassInfoMixin<LoopSimplifyCFGPass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopSink.h b/llvm/include/llvm/Transforms/Scalar/LoopSink.h
index 08736bad9750344..4507ea9052fb57e 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopSink.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopSink.h
@@ -31,7 +31,7 @@ class Function;
 /// We do this as a separate pass so that during normal optimization all
 /// invariant operations can be held outside the loop body to simplify
 /// fundamental analyses and transforms of the loop.
-class LoopSinkPass : public PassInfoMixin<LoopSinkPass> {
+class LLVM_CLASS_ABI LoopSinkPass : public PassInfoMixin<LoopSinkPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h b/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h
index 3f8269a68ab1843..2fb55e5fdf66b83 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h
@@ -31,7 +31,7 @@ class Loop;
 class LPMUpdater;
 
 /// Performs Loop Strength Reduce Pass.
-class LoopStrengthReducePass : public PassInfoMixin<LoopStrengthReducePass> {
+class LLVM_CLASS_ABI LoopStrengthReducePass : public PassInfoMixin<LoopStrengthReducePass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &AR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h b/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h
index 9a6b7bfc124d101..720765609797723 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h
@@ -18,7 +18,7 @@ class LPMUpdater;
 class LoopNest;
 
 /// A simple loop rotation transformation.
-class LoopUnrollAndJamPass : public PassInfoMixin<LoopUnrollAndJamPass> {
+class LLVM_CLASS_ABI LoopUnrollAndJamPass : public PassInfoMixin<LoopUnrollAndJamPass> {
   const int OptLevel;
 
 public:
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h b/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h
index 696abf9cfd5c759..e38f881b4091953 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h
@@ -17,14 +17,14 @@
 
 namespace llvm {
 
-extern cl::opt<bool> ForgetSCEVInLoopUnroll;
+LLVM_FUNC_ABI extern cl::opt<bool> ForgetSCEVInLoopUnroll;
 
 class Function;
 class Loop;
 class LPMUpdater;
 
 /// Loop unroll pass that only does full loop unrolling and peeling.
-class LoopFullUnrollPass : public PassInfoMixin<LoopFullUnrollPass> {
+class LLVM_CLASS_ABI LoopFullUnrollPass : public PassInfoMixin<LoopFullUnrollPass> {
   const int OptLevel;
 
   /// If false, use a cost model to determine whether unrolling of a loop is
@@ -59,7 +59,7 @@ class LoopFullUnrollPass : public PassInfoMixin<LoopFullUnrollPass> {
 /// Intended use is to create a default object, modify parameters with
 /// additional setters and then pass it to LoopUnrollPass.
 ///
-struct LoopUnrollOptions {
+struct LLVM_CLASS_ABI LoopUnrollOptions {
   std::optional<bool> AllowPartial;
   std::optional<bool> AllowPeeling;
   std::optional<bool> AllowRuntime;
@@ -131,7 +131,7 @@ struct LoopUnrollOptions {
 /// Loop unroll pass that will support both full and partial unrolling.
 /// It is a function pass to have access to function and module analyses.
 /// It will also put loops into canonical form (simplified and LCSSA).
-class LoopUnrollPass : public PassInfoMixin<LoopUnrollPass> {
+class LLVM_CLASS_ABI LoopUnrollPass : public PassInfoMixin<LoopUnrollPass> {
   LoopUnrollOptions UnrollOpts;
 
 public:
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h b/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h
index eee9ad538b0ec16..6b644d8fa858ec2 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h
@@ -17,7 +17,7 @@ namespace llvm {
 class LPMUpdater;
 class Loop;
 
-class LoopVersioningLICMPass : public PassInfoMixin<LoopVersioningLICMPass> {
+class LLVM_CLASS_ABI LoopVersioningLICMPass : public PassInfoMixin<LoopVersioningLICMPass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
                         LoopStandardAnalysisResults &LAR, LPMUpdater &U);
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h b/llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h
index b484a6679a988f5..b24e7d3a2d65dce 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h
@@ -20,7 +20,7 @@
 namespace llvm {
 
 /// A pass that lowers atomic intrinsic into non-atomic intrinsics.
-class LowerAtomicPass : public PassInfoMixin<LowerAtomicPass> {
+class LLVM_CLASS_ABI LowerAtomicPass : public PassInfoMixin<LowerAtomicPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
   static bool isRequired() { return true; }
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h b/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h
index 7747ed98cbd9646..ef9d9ad98cd163a 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 class Function;
 
-struct LowerConstantIntrinsicsPass :
+struct LLVM_CLASS_ABI LowerConstantIntrinsicsPass :
     PassInfoMixin<LowerConstantIntrinsicsPass> {
 public:
   explicit LowerConstantIntrinsicsPass() = default;
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h b/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
index 61ca1a18f562e96..9b76d8796b25222 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 class Function;
 
-struct LowerExpectIntrinsicPass : PassInfoMixin<LowerExpectIntrinsicPass> {
+struct LLVM_CLASS_ABI LowerExpectIntrinsicPass : PassInfoMixin<LowerExpectIntrinsicPass> {
   /// Run the pass over the function.
   ///
   /// This will lower all of the expect intrinsic calls in this function into
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h b/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
index cffe7ede71e4b8c..f973cefe2e61696 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-struct LowerGuardIntrinsicPass : PassInfoMixin<LowerGuardIntrinsicPass> {
+struct LLVM_CLASS_ABI LowerGuardIntrinsicPass : PassInfoMixin<LowerGuardIntrinsicPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h b/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h
index 0bcd681e8601a8e..62d90f219e45882 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h
@@ -17,7 +17,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-class LowerMatrixIntrinsicsPass
+class LLVM_CLASS_ABI LowerMatrixIntrinsicsPass
     : public PassInfoMixin<LowerMatrixIntrinsicsPass> {
   bool Minimal;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h b/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h
index d2a966390ab2a06..b139a3734d908cb 100644
--- a/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h
+++ b/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 
-struct LowerWidenableConditionPass : PassInfoMixin<LowerWidenableConditionPass> {
+struct LLVM_CLASS_ABI LowerWidenableConditionPass : PassInfoMixin<LowerWidenableConditionPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h b/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
index 1e195a81ef22fde..3a6750891d8799e 100644
--- a/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
+++ b/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h
@@ -38,7 +38,7 @@
 
 namespace llvm {
 
-struct MakeGuardsExplicitPass : public PassInfoMixin<MakeGuardsExplicitPass> {
+struct LLVM_CLASS_ABI MakeGuardsExplicitPass : public PassInfoMixin<MakeGuardsExplicitPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h b/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h
index e8c5da6d67b16db..8a58fb9e9c11c0d 100644
--- a/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h
+++ b/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h
@@ -38,7 +38,7 @@ class StoreInst;
 class TargetLibraryInfo;
 class Value;
 
-class MemCpyOptPass : public PassInfoMixin<MemCpyOptPass> {
+class LLVM_CLASS_ABI MemCpyOptPass : public PassInfoMixin<MemCpyOptPass> {
   TargetLibraryInfo *TLI = nullptr;
   AAResults *AA = nullptr;
   AssumptionCache *AC = nullptr;
diff --git a/llvm/include/llvm/Transforms/Scalar/MergeICmps.h b/llvm/include/llvm/Transforms/Scalar/MergeICmps.h
index 287e4a8a484f508..9e6493192f26b93 100644
--- a/llvm/include/llvm/Transforms/Scalar/MergeICmps.h
+++ b/llvm/include/llvm/Transforms/Scalar/MergeICmps.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 class Function;
 
-struct MergeICmpsPass
+struct LLVM_CLASS_ABI MergeICmpsPass
     : PassInfoMixin<MergeICmpsPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h b/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
index d7c60f500038c37..dd7737d2c63b7c2 100644
--- a/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
+++ b/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
@@ -29,7 +29,7 @@
 
 namespace llvm {
 class Function;
-struct MergedLoadStoreMotionOptions {
+struct LLVM_CLASS_ABI MergedLoadStoreMotionOptions {
   bool SplitFooterBB;
   MergedLoadStoreMotionOptions(bool SplitFooterBB = false)
       : SplitFooterBB(SplitFooterBB) {}
@@ -40,7 +40,7 @@ struct MergedLoadStoreMotionOptions {
   }
 };
 
-class MergedLoadStoreMotionPass
+class LLVM_CLASS_ABI MergedLoadStoreMotionPass
     : public PassInfoMixin<MergedLoadStoreMotionPass> {
   MergedLoadStoreMotionOptions Options;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h b/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h
index 4614a9c7b2ac833..0ffa9c09c743a3e 100644
--- a/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h
+++ b/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h
@@ -100,7 +100,7 @@ class TargetTransformInfo;
 class Type;
 class Value;
 
-class NaryReassociatePass : public PassInfoMixin<NaryReassociatePass> {
+class LLVM_CLASS_ABI NaryReassociatePass : public PassInfoMixin<NaryReassociatePass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 
diff --git a/llvm/include/llvm/Transforms/Scalar/NewGVN.h b/llvm/include/llvm/Transforms/Scalar/NewGVN.h
index 6b225cb8a171eb5..67c0a5f1720748e 100644
--- a/llvm/include/llvm/Transforms/Scalar/NewGVN.h
+++ b/llvm/include/llvm/Transforms/Scalar/NewGVN.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 class Function;
 
-class NewGVNPass : public PassInfoMixin<NewGVNPass> {
+class LLVM_CLASS_ABI NewGVNPass : public PassInfoMixin<NewGVNPass> {
 public:
   /// Run the pass over the function.
   PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
diff --git a/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h b/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h
index 03964150d75278b..b4805487a1ff37e 100644
--- a/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h
+++ b/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h
@@ -20,7 +20,7 @@
 
 namespace llvm {
 class Function;
-class PartiallyInlineLibCallsPass
+class LLVM_CLASS_ABI PartiallyInlineLibCallsPass
     : public PassInfoMixin<PartiallyInlineLibCallsPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h b/llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h
index a325d4181ad755d..86623ca7ce901a8 100644
--- a/llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h
+++ b/llvm/include/llvm/Transforms/Scalar/PlaceSafepoints.h
@@ -57,7 +57,7 @@ namespace llvm {
 
 class TargetLibraryInfo;
 
-class PlaceSafepointsPass : public PassInfoMixin<PlaceSafepointsPass> {
+class LLVM_CLASS_ABI PlaceSafepointsPass : public PassInfoMixin<PlaceSafepointsPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 
diff --git a/llvm/include/llvm/Transforms/Scalar/Reassociate.h b/llvm/include/llvm/Transforms/Scalar/Reassociate.h
index e1888ba908d113b..79cbad0f9cc1842 100644
--- a/llvm/include/llvm/Transforms/Scalar/Reassociate.h
+++ b/llvm/include/llvm/Transforms/Scalar/Reassociate.h
@@ -44,7 +44,7 @@ class Value;
 /// These are implementation details and should not be used by clients.
 namespace reassociate {
 
-struct ValueEntry {
+struct LLVM_CLASS_ABI ValueEntry {
   unsigned Rank;
   Value *Op;
 
@@ -57,7 +57,7 @@ inline bool operator<(const ValueEntry &LHS, const ValueEntry &RHS) {
 
 /// Utility class representing a base and exponent pair which form one
 /// factor of some product.
-struct Factor {
+struct LLVM_CLASS_ABI Factor {
   Value *Base;
   unsigned Power;
 
@@ -69,7 +69,7 @@ class XorOpnd;
 } // end namespace reassociate
 
 /// Reassociate commutative expressions.
-class ReassociatePass : public PassInfoMixin<ReassociatePass> {
+class LLVM_CLASS_ABI ReassociatePass : public PassInfoMixin<ReassociatePass> {
 public:
   using OrderedSet =
       SetVector<AssertingVH<Instruction>, std::deque<AssertingVH<Instruction>>>;
diff --git a/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h b/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h
index dc86c1bd51dd879..ff7924dd12b339d 100644
--- a/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h
+++ b/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 
-class RegToMemPass : public PassInfoMixin<RegToMemPass> {
+class LLVM_CLASS_ABI RegToMemPass : public PassInfoMixin<RegToMemPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h b/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
index fc5a490dc8247f9..cbc9a4f61a6c1c1 100644
--- a/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
+++ b/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h
@@ -27,7 +27,7 @@ class Module;
 class TargetTransformInfo;
 class TargetLibraryInfo;
 
-struct RewriteStatepointsForGC : public PassInfoMixin<RewriteStatepointsForGC> {
+struct LLVM_CLASS_ABI RewriteStatepointsForGC : public PassInfoMixin<RewriteStatepointsForGC> {
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 
   bool runOnFunction(Function &F, DominatorTree &, TargetTransformInfo &,
diff --git a/llvm/include/llvm/Transforms/Scalar/SCCP.h b/llvm/include/llvm/Transforms/Scalar/SCCP.h
index ae083bcb047d526..1695bcbeb45efa6 100644
--- a/llvm/include/llvm/Transforms/Scalar/SCCP.h
+++ b/llvm/include/llvm/Transforms/Scalar/SCCP.h
@@ -27,7 +27,7 @@ namespace llvm {
 class Function;
 
 /// This pass performs function-level constant propagation and merging.
-class SCCPPass : public PassInfoMixin<SCCPPass> {
+class LLVM_CLASS_ABI SCCPPass : public PassInfoMixin<SCCPPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/SROA.h b/llvm/include/llvm/Transforms/Scalar/SROA.h
index aa8f7e6abfd923c..64c0923020ac223 100644
--- a/llvm/include/llvm/Transforms/Scalar/SROA.h
+++ b/llvm/include/llvm/Transforms/Scalar/SROA.h
@@ -41,14 +41,14 @@ class Use;
 
 /// A private "module" namespace for types and utilities used by SROA. These
 /// are implementation details and should not be used by clients.
-namespace LLVM_LIBRARY_VISIBILITY sroa {
+namespace sroa LLVM_LIBRARY_VISIBILITY {
 
 class AllocaSliceRewriter;
 class AllocaSlices;
 class Partition;
 class SROALegacyPass;
 
-class SelectHandSpeculativity {
+class LLVM_CLASS_ABI SelectHandSpeculativity {
   unsigned char Storage = 0; // None are speculatable by default.
   using TrueVal = Bitfield::Element<bool, 0, 1>;  // Low 0'th bit.
   using FalseVal = Bitfield::Element<bool, 1, 1>; // Low 1'th bit.
@@ -94,7 +94,7 @@ enum class SROAOptions : bool { ModifyCFG, PreserveCFG };
 ///    onto insert and extract operations on a vector value, and convert them to
 ///    this form. By doing so, it will enable promotion of vector aggregates to
 ///    SSA vector values.
-class SROAPass : public PassInfoMixin<SROAPass> {
+class LLVM_CLASS_ABI SROAPass : public PassInfoMixin<SROAPass> {
   LLVMContext *C = nullptr;
   DomTreeUpdater *DTU = nullptr;
   AssumptionCache *AC = nullptr;
diff --git a/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h b/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h
index f5ea32121ebe6d7..45f354c2f81b407 100644
--- a/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h
+++ b/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h
@@ -21,7 +21,7 @@
 
 namespace llvm {
 
-struct ScalarizeMaskedMemIntrinPass
+struct LLVM_CLASS_ABI ScalarizeMaskedMemIntrinPass
     : public PassInfoMixin<ScalarizeMaskedMemIntrinPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/Scalarizer.h b/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
index 4acc490be70a7dd..bcd1bce600f3173 100644
--- a/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
+++ b/llvm/include/llvm/Transforms/Scalar/Scalarizer.h
@@ -27,7 +27,7 @@ namespace llvm {
 class Function;
 class FunctionPass;
 
-struct ScalarizerPassOptions {
+struct LLVM_CLASS_ABI ScalarizerPassOptions {
   // These options correspond 1:1 to cl::opt options defined in
   // Scalarizer.cpp. When the cl::opt are specified, they take precedence.
   // When the cl::opt are not specified, the present optional values allow to
@@ -37,7 +37,7 @@ struct ScalarizerPassOptions {
   std::optional<unsigned> ScalarizeMinBits;
 };
 
-class ScalarizerPass : public PassInfoMixin<ScalarizerPass> {
+class LLVM_CLASS_ABI ScalarizerPass : public PassInfoMixin<ScalarizerPass> {
   ScalarizerPassOptions Options;
 
 public:
@@ -54,7 +54,7 @@ class ScalarizerPass : public PassInfoMixin<ScalarizerPass> {
 };
 
 /// Create a legacy pass manager instance of the Scalarizer pass
-FunctionPass *createScalarizerPass();
+LLVM_FUNC_ABI FunctionPass *createScalarizerPass();
 
 }
 
diff --git a/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h b/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h
index ca4a689d1e1a093..3a048afc182595c 100644
--- a/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h
+++ b/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class SeparateConstOffsetFromGEPPass
+class LLVM_CLASS_ABI SeparateConstOffsetFromGEPPass
     : public PassInfoMixin<SeparateConstOffsetFromGEPPass> {
   bool LowerGEP;
 
diff --git a/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h b/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
index c0b34baa9fbf6ae..9ad10d7e4b0bb79 100644
--- a/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
+++ b/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h
@@ -65,7 +65,7 @@ class raw_ostream;
 /// Because partial unswitching of switches is extremely unlikely to be possible
 /// in practice and significantly complicates the implementation, this pass does
 /// not currently implement that in any mode.
-class SimpleLoopUnswitchPass : public PassInfoMixin<SimpleLoopUnswitchPass> {
+class LLVM_CLASS_ABI SimpleLoopUnswitchPass : public PassInfoMixin<SimpleLoopUnswitchPass> {
   bool NonTrivial;
   bool Trivial;
 
@@ -83,7 +83,7 @@ class SimpleLoopUnswitchPass : public PassInfoMixin<SimpleLoopUnswitchPass> {
 /// Create the legacy pass object for the simple loop unswitcher.
 ///
 /// See the documentaion for `SimpleLoopUnswitchPass` for details.
-Pass *createSimpleLoopUnswitchLegacyPass(bool NonTrivial = false);
+LLVM_FUNC_ABI Pass *createSimpleLoopUnswitchLegacyPass(bool NonTrivial = false);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
index 82bd2099af03e3d..f36c0618ca96cc6 100644
--- a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h
@@ -27,7 +27,7 @@ namespace llvm {
 /// or remove control flow to put the CFG into a canonical form expected by
 /// other passes of the mid-level optimizer. Depending on the specified options,
 /// it may further optimize control-flow to create non-canonical forms.
-class SimplifyCFGPass : public PassInfoMixin<SimplifyCFGPass> {
+class LLVM_CLASS_ABI SimplifyCFGPass : public PassInfoMixin<SimplifyCFGPass> {
   SimplifyCFGOptions Options;
 
 public:
diff --git a/llvm/include/llvm/Transforms/Scalar/Sink.h b/llvm/include/llvm/Transforms/Scalar/Sink.h
index ea93197a071bab5..3f04e18112c8c57 100644
--- a/llvm/include/llvm/Transforms/Scalar/Sink.h
+++ b/llvm/include/llvm/Transforms/Scalar/Sink.h
@@ -22,7 +22,7 @@ namespace llvm {
 class Function;
 
 /// Move instructions into successor blocks when possible.
-class SinkingPass : public PassInfoMixin<SinkingPass> {
+class LLVM_CLASS_ABI SinkingPass : public PassInfoMixin<SinkingPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h b/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h
index 086dc76c22d45cb..1526773b1c86cb8 100644
--- a/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h
+++ b/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h
@@ -67,7 +67,7 @@
 
 namespace llvm {
 class TargetTransformInfo;
-class SpeculativeExecutionPass
+class LLVM_CLASS_ABI SpeculativeExecutionPass
     : public PassInfoMixin<SpeculativeExecutionPass> {
 public:
   SpeculativeExecutionPass(bool OnlyIfDivergentTarget = false);
diff --git a/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h b/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h
index eda294a0720d353..85045ff77f09f14 100644
--- a/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h
+++ b/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class StraightLineStrengthReducePass
+class LLVM_CLASS_ABI StraightLineStrengthReducePass
     : public PassInfoMixin<StraightLineStrengthReducePass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h b/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h
index 8e8db441326c764..ab43902699c6d65 100644
--- a/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h
+++ b/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h
@@ -13,7 +13,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-struct StructurizeCFGPass : PassInfoMixin<StructurizeCFGPass> {
+struct LLVM_CLASS_ABI StructurizeCFGPass : PassInfoMixin<StructurizeCFGPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h b/llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h
index 95e67e79050c67a..73bd94de35b9d9e 100644
--- a/llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h
+++ b/llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h
@@ -82,7 +82,7 @@ namespace tlshoist {
 
 /// Keeps track of the user of a TLS variable and the operand index
 /// where the variable is used.
-struct TLSUser {
+struct LLVM_CLASS_ABI TLSUser {
   Instruction *Inst;
   unsigned OpndIdx;
 
@@ -90,7 +90,7 @@ struct TLSUser {
 };
 
 /// Keeps track of a TLS variable candidate and its users.
-struct TLSCandidate {
+struct LLVM_CLASS_ABI TLSCandidate {
   SmallVector<TLSUser, 8> Users;
 
   /// Add the user to the use list and update the cost.
@@ -101,7 +101,7 @@ struct TLSCandidate {
 
 } // end namespace tlshoist
 
-class TLSVariableHoistPass : public PassInfoMixin<TLSVariableHoistPass> {
+class LLVM_CLASS_ABI TLSVariableHoistPass : public PassInfoMixin<TLSVariableHoistPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 
diff --git a/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h b/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h
index 152ea060e86b326..b54ae8c40440eac 100644
--- a/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h
+++ b/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h
@@ -59,7 +59,7 @@ namespace llvm {
 
 class Function;
 
-struct TailCallElimPass : PassInfoMixin<TailCallElimPass> {
+struct LLVM_CLASS_ABI TailCallElimPass : PassInfoMixin<TailCallElimPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 }
diff --git a/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h b/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h
index f809810cb98d4ae..34cd17e6311b92a 100644
--- a/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h
+++ b/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 // New pass manager boilerplate.
-class WarnMissedTransformationsPass
+class LLVM_CLASS_ABI WarnMissedTransformationsPass
     : public PassInfoMixin<WarnMissedTransformationsPass> {
 public:
   explicit WarnMissedTransformationsPass() = default;
diff --git a/llvm/include/llvm/Transforms/Utils.h b/llvm/include/llvm/Transforms/Utils.h
index 34f504aed71c7bf..8aab29caf62e6ce 100644
--- a/llvm/include/llvm/Transforms/Utils.h
+++ b/llvm/include/llvm/Transforms/Utils.h
@@ -27,16 +27,16 @@ class Pass;
 // LowerInvoke - This pass removes invoke instructions, converting them to call
 // instructions.
 //
-FunctionPass *createLowerInvokePass();
-extern char &LowerInvokePassID;
+LLVM_FUNC_ABI FunctionPass *createLowerInvokePass();
+LLVM_FUNC_ABI extern char &LowerInvokePassID;
 
 //===----------------------------------------------------------------------===//
 //
 // LowerSwitch - This pass converts SwitchInst instructions into a sequence of
 // chained binary branch instructions.
 //
-FunctionPass *createLowerSwitchPass();
-extern char &LowerSwitchID;
+LLVM_FUNC_ABI FunctionPass *createLowerSwitchPass();
+LLVM_FUNC_ABI extern char &LowerSwitchID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -49,16 +49,16 @@ extern char &LowerSwitchID;
 // This pass obviously invalidates the CFG, but can update forward dominator
 // (set, immediate dominators, tree, and frontier) information.
 //
-FunctionPass *createBreakCriticalEdgesPass();
-extern char &BreakCriticalEdgesID;
+LLVM_FUNC_ABI FunctionPass *createBreakCriticalEdgesPass();
+LLVM_FUNC_ABI extern char &BreakCriticalEdgesID;
 
 //===----------------------------------------------------------------------===//
 //
 // LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop
 // optimizations.
 //
-Pass *createLCSSAPass();
-extern char &LCSSAID;
+LLVM_FUNC_ABI Pass *createLCSSAPass();
+LLVM_FUNC_ABI extern char &LCSSAID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -72,7 +72,7 @@ extern char &LCSSAID;
 //   %Y = load i32* %X
 //   ret i32 %Y
 //
-FunctionPass *createPromoteMemoryToRegisterPass(bool IsForced = false);
+LLVM_FUNC_ABI FunctionPass *createPromoteMemoryToRegisterPass(bool IsForced = false);
 
 //===----------------------------------------------------------------------===//
 //
@@ -82,8 +82,8 @@ FunctionPass *createPromoteMemoryToRegisterPass(bool IsForced = false);
 //
 //   AU.addRequiredID(LoopSimplifyID);
 //
-Pass *createLoopSimplifyPass();
-extern char &LoopSimplifyID;
+LLVM_FUNC_ABI Pass *createLoopSimplifyPass();
+LLVM_FUNC_ABI extern char &LoopSimplifyID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -91,27 +91,27 @@ extern char &LoopSimplifyID;
 // blocks branch to N, and then N distributes control flow to all the original
 // exit blocks.
 //
-FunctionPass *createUnifyLoopExitsPass();
+LLVM_FUNC_ABI FunctionPass *createUnifyLoopExitsPass();
 
 //===----------------------------------------------------------------------===//
 //
 // FixIrreducible - Convert each SCC with irreducible control-flow
 // into a natural loop.
 //
-FunctionPass *createFixIrreduciblePass();
+LLVM_FUNC_ABI FunctionPass *createFixIrreduciblePass();
 
 //===----------------------------------------------------------------------===//
 //
 // CanonicalizeFreezeInLoops - Canonicalize freeze instructions in loops so they
 // don't block SCEV.
 //
-Pass *createCanonicalizeFreezeInLoopsPass();
+LLVM_FUNC_ABI Pass *createCanonicalizeFreezeInLoopsPass();
 
 //===----------------------------------------------------------------------===//
 // LowerGlobalDtorsLegacy - Lower @llvm.global_dtors by creating wrapper
 // functions that are registered in @llvm.global_ctors and which contain a call
 // to `__cxa_atexit` to register their destructor functions.
-ModulePass *createLowerGlobalDtorsLegacyPass();
+LLVM_FUNC_ABI ModulePass *createLowerGlobalDtorsLegacyPass();
 } // namespace llvm
 
 #endif
diff --git a/llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h b/llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h
index 6627fb8f24b2bb7..bb9637c17149b69 100644
--- a/llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h
+++ b/llvm/include/llvm/Transforms/Utils/AMDGPUEmitPrintf.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-Value *emitAMDGPUPrintfCall(IRBuilder<> &Builder, ArrayRef<Value *> Args,
+LLVM_FUNC_ABI Value *emitAMDGPUPrintfCall(IRBuilder<> &Builder, ArrayRef<Value *> Args,
                             bool isBuffered);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h b/llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h
index 7e437e1ff663cc9..e1a9cac6104bc46 100644
--- a/llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h
+++ b/llvm/include/llvm/Transforms/Utils/ASanStackFrameLayout.h
@@ -28,7 +28,7 @@ static const int kAsanStackUseAfterReturnMagic = 0xf5;
 static const int kAsanStackUseAfterScopeMagic = 0xf8;
 
 // Input/output data struct for ComputeASanStackFrameLayout.
-struct ASanStackVariableDescription {
+struct LLVM_CLASS_ABI ASanStackVariableDescription {
   const char *Name;    // Name of the variable that will be displayed by asan
                        // if a stack-related bug is reported.
   uint64_t Size;       // Size of the variable in bytes.
@@ -42,13 +42,13 @@ struct ASanStackVariableDescription {
 };
 
 // Output data struct for ComputeASanStackFrameLayout.
-struct ASanStackFrameLayout {
+struct LLVM_CLASS_ABI ASanStackFrameLayout {
   uint64_t Granularity;     // Shadow granularity.
   uint64_t FrameAlignment;  // Alignment for the entire frame.
   uint64_t FrameSize;       // Size of the frame in bytes.
 };
 
-ASanStackFrameLayout ComputeASanStackFrameLayout(
+LLVM_FUNC_ABI ASanStackFrameLayout ComputeASanStackFrameLayout(
     // The array of stack variables. The elements may get reordered and changed.
     SmallVectorImpl<ASanStackVariableDescription> &Vars,
     // AddressSanitizer's shadow granularity. Usually 8, may also be 16, 32, 64.
@@ -59,19 +59,19 @@ ASanStackFrameLayout ComputeASanStackFrameLayout(
     uint64_t MinHeaderSize);
 
 // Compute frame description, see DescribeAddressIfStack in ASan runtime.
-SmallString<64> ComputeASanStackFrameDescription(
+LLVM_FUNC_ABI SmallString<64> ComputeASanStackFrameDescription(
     const SmallVectorImpl<ASanStackVariableDescription> &Vars);
 
 // Returns shadow bytes with marked red zones. This shadow represents the state
 // if the stack frame when all local variables are inside of the own scope.
-SmallVector<uint8_t, 64>
+LLVM_FUNC_ABI SmallVector<uint8_t, 64>
 GetShadowBytes(const SmallVectorImpl<ASanStackVariableDescription> &Vars,
                const ASanStackFrameLayout &Layout);
 
 // Returns shadow bytes with marked red zones and after scope. This shadow
 // represents the state if the stack frame when all local variables are outside
 // of the own scope.
-SmallVector<uint8_t, 64> GetShadowBytesAfterScope(
+LLVM_FUNC_ABI SmallVector<uint8_t, 64> GetShadowBytesAfterScope(
     // The array of stack variables. The elements may get reordered and changed.
     const SmallVectorImpl<ASanStackVariableDescription> &Vars,
     const ASanStackFrameLayout &Layout);
diff --git a/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h b/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h
index cb739e8b0ea9076..81dbb223d4a9b6a 100644
--- a/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h
+++ b/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 class Function;
 
-class AddDiscriminatorsPass : public PassInfoMixin<AddDiscriminatorsPass> {
+class LLVM_CLASS_ABI AddDiscriminatorsPass : public PassInfoMixin<AddDiscriminatorsPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
   static bool isRequired() { return true; }
diff --git a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
index 6312855d1877ce1..3b00d34822eab0a 100644
--- a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
+++ b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
@@ -31,7 +31,7 @@ class DominatorTree;
 /// from the given instruction.
 /// If no information derived from \p I, this call returns null.
 /// The returned instruction is not inserted anywhere.
-AssumeInst *buildAssumeFromInst(Instruction *I);
+LLVM_FUNC_ABI AssumeInst *buildAssumeFromInst(Instruction *I);
 
 /// Calls BuildAssumeFromInst and if the resulting llvm.assume is valid insert
 /// if before I. This is usually what need to be done to salvage the knowledge
@@ -41,32 +41,32 @@ AssumeInst *buildAssumeFromInst(Instruction *I);
 /// The DominatorTree can optionally be provided to enable cross-block
 /// reasoning.
 /// This returns if a change was made.
-bool salvageKnowledge(Instruction *I, AssumptionCache *AC = nullptr,
+LLVM_FUNC_ABI bool salvageKnowledge(Instruction *I, AssumptionCache *AC = nullptr,
                       DominatorTree *DT = nullptr);
 
 /// Build and return a new assume created from the provided knowledge
 /// if the knowledge in the assume is fully redundant this will return nullptr
-AssumeInst *buildAssumeFromKnowledge(ArrayRef<RetainedKnowledge> Knowledge,
+LLVM_FUNC_ABI AssumeInst *buildAssumeFromKnowledge(ArrayRef<RetainedKnowledge> Knowledge,
                                      Instruction *CtxI,
                                      AssumptionCache *AC = nullptr,
                                      DominatorTree *DT = nullptr);
 
 /// This pass attempts to minimize the number of assume without loosing any
 /// information.
-struct AssumeSimplifyPass : public PassInfoMixin<AssumeSimplifyPass> {
+struct LLVM_CLASS_ABI AssumeSimplifyPass : public PassInfoMixin<AssumeSimplifyPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
 /// This pass will try to build an llvm.assume for every instruction in the
 /// function. Its main purpose is testing.
-struct AssumeBuilderPass : public PassInfoMixin<AssumeBuilderPass> {
+struct LLVM_CLASS_ABI AssumeBuilderPass : public PassInfoMixin<AssumeBuilderPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
 /// canonicalize the RetainedKnowledge RK. it is assumed that RK is part of
 /// Assume. This will return an empty RetainedKnowledge if the knowledge is
 /// useless.
-RetainedKnowledge simplifyRetainedKnowledge(AssumeInst *Assume,
+LLVM_FUNC_ABI RetainedKnowledge simplifyRetainedKnowledge(AssumeInst *Assume,
                                             RetainedKnowledge RK,
                                             AssumptionCache *AC,
                                             DominatorTree *DT);
diff --git a/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h b/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
index 713788bf2657e97..1c84122a65c643e 100644
--- a/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -47,12 +47,12 @@ class Value;
 /// instruction. If \p Updates is specified, collect all necessary DT updates
 /// into this vector. If \p KeepOneInputPHIs is true, one-input Phis in
 /// successors of blocks being deleted will be preserved.
-void detachDeadBlocks(ArrayRef <BasicBlock *> BBs,
+LLVM_FUNC_ABI void detachDeadBlocks(ArrayRef <BasicBlock *> BBs,
                       SmallVectorImpl<DominatorTree::UpdateType> *Updates,
                       bool KeepOneInputPHIs = false);
 
 /// Delete the specified block, which must have no predecessors.
-void DeleteDeadBlock(BasicBlock *BB, DomTreeUpdater *DTU = nullptr,
+LLVM_FUNC_ABI void DeleteDeadBlock(BasicBlock *BB, DomTreeUpdater *DTU = nullptr,
                      bool KeepOneInputPHIs = false);
 
 /// Delete the specified blocks from \p BB. The set of deleted blocks must have
@@ -61,28 +61,28 @@ void DeleteDeadBlock(BasicBlock *BB, DomTreeUpdater *DTU = nullptr,
 /// relevant loop info updates should be done before this function is called.
 /// If \p KeepOneInputPHIs is true, one-input Phis in successors of blocks
 /// being deleted will be preserved.
-void DeleteDeadBlocks(ArrayRef <BasicBlock *> BBs,
+LLVM_FUNC_ABI void DeleteDeadBlocks(ArrayRef <BasicBlock *> BBs,
                       DomTreeUpdater *DTU = nullptr,
                       bool KeepOneInputPHIs = false);
 
 /// Delete all basic blocks from \p F that are not reachable from its entry
 /// node. If \p KeepOneInputPHIs is true, one-input Phis in successors of
 /// blocks being deleted will be preserved.
-bool EliminateUnreachableBlocks(Function &F, DomTreeUpdater *DTU = nullptr,
+LLVM_FUNC_ABI bool EliminateUnreachableBlocks(Function &F, DomTreeUpdater *DTU = nullptr,
                                 bool KeepOneInputPHIs = false);
 
 /// We know that BB has one predecessor. If there are any single-entry PHI nodes
 /// in it, fold them away. This handles the case when all entries to the PHI
 /// nodes in a block are guaranteed equal, such as when the block has exactly
 /// one predecessor.
-bool FoldSingleEntryPHINodes(BasicBlock *BB,
+LLVM_FUNC_ABI bool FoldSingleEntryPHINodes(BasicBlock *BB,
                              MemoryDependenceResults *MemDep = nullptr);
 
 /// Examine each PHI in the given block and delete it if it is dead. Also
 /// recursively delete any operands that become dead as a result. This includes
 /// tracing the def-use list from the PHI to see if it is ultimately unused or
 /// if it reaches an unused cycle. Return true if any PHIs were deleted.
-bool DeleteDeadPHIs(BasicBlock *BB, const TargetLibraryInfo *TLI = nullptr,
+LLVM_FUNC_ABI bool DeleteDeadPHIs(BasicBlock *BB, const TargetLibraryInfo *TLI = nullptr,
                     MemorySSAUpdater *MSSAU = nullptr);
 
 /// Attempts to merge a block into its predecessor, if possible. The return
@@ -94,7 +94,7 @@ bool DeleteDeadPHIs(BasicBlock *BB, const TargetLibraryInfo *TLI = nullptr,
 /// BB, and BB will still be merged into its predecessor and removed.
 /// If \p DT is not nullptr, update it directly; in that case, DTU must be
 /// nullptr.
-bool MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU = nullptr,
+LLVM_FUNC_ABI bool MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU = nullptr,
                                LoopInfo *LI = nullptr,
                                MemorySSAUpdater *MSSAU = nullptr,
                                MemoryDependenceResults *MemDep = nullptr,
@@ -108,42 +108,42 @@ bool MergeBlockIntoPredecessor(BasicBlock *BB, DomTreeUpdater *DTU = nullptr,
 /// must be in L. In addition, This utility calls on another utility:
 /// MergeBlockIntoPredecessor. Blocks are successfully merged when the call to
 /// MergeBlockIntoPredecessor returns true.
-bool MergeBlockSuccessorsIntoGivenBlocks(
+LLVM_FUNC_ABI bool MergeBlockSuccessorsIntoGivenBlocks(
     SmallPtrSetImpl<BasicBlock *> &MergeBlocks, Loop *L = nullptr,
     DomTreeUpdater *DTU = nullptr, LoopInfo *LI = nullptr);
 
 /// Try to remove redundant dbg.value instructions from given basic block.
 /// Returns true if at least one instruction was removed. Remove redundant
 /// pseudo ops when RemovePseudoOp is true.
-bool RemoveRedundantDbgInstrs(BasicBlock *BB);
+LLVM_FUNC_ABI bool RemoveRedundantDbgInstrs(BasicBlock *BB);
 
 /// Replace all uses of an instruction (specified by BI) with a value, then
 /// remove and delete the original instruction.
-void ReplaceInstWithValue(BasicBlock::iterator &BI, Value *V);
+LLVM_FUNC_ABI void ReplaceInstWithValue(BasicBlock::iterator &BI, Value *V);
 
 /// Replace the instruction specified by BI with the instruction specified by I.
 /// Copies DebugLoc from BI to I, if I doesn't already have a DebugLoc. The
 /// original instruction is deleted and BI is updated to point to the new
 /// instruction.
-void ReplaceInstWithInst(BasicBlock *BB, BasicBlock::iterator &BI,
+LLVM_FUNC_ABI void ReplaceInstWithInst(BasicBlock *BB, BasicBlock::iterator &BI,
                          Instruction *I);
 
 /// Replace the instruction specified by From with the instruction specified by
 /// To. Copies DebugLoc from BI to I, if I doesn't already have a DebugLoc.
-void ReplaceInstWithInst(Instruction *From, Instruction *To);
+LLVM_FUNC_ABI void ReplaceInstWithInst(Instruction *From, Instruction *To);
 
 /// Check if we can prove that all paths starting from this block converge
 /// to a block that either has a @llvm.experimental.deoptimize call
 /// prior to its terminating return instruction or is terminated by unreachable.
 /// All blocks in the traversed sequence must have an unique successor, maybe
 /// except for the last one.
-bool IsBlockFollowedByDeoptOrUnreachable(const BasicBlock *BB);
+LLVM_FUNC_ABI bool IsBlockFollowedByDeoptOrUnreachable(const BasicBlock *BB);
 
 /// Option class for critical edge splitting.
 ///
 /// This provides a builder interface for overriding the default options used
 /// during critical edge splitting.
-struct CriticalEdgeSplittingOptions {
+struct LLVM_CLASS_ABI CriticalEdgeSplittingOptions {
   DominatorTree *DT;
   PostDominatorTree *PDT;
   LoopInfo *LI;
@@ -193,7 +193,7 @@ struct CriticalEdgeSplittingOptions {
 /// exit block. This function inserts the new PHIs, as needed. Preds is a list
 /// of preds inside the loop, SplitBB is the new loop exit block, and DestBB is
 /// the old loop exit, now the successor of SplitBB.
-void createPHIsForSplitLoopExit(ArrayRef<BasicBlock *> Preds,
+LLVM_FUNC_ABI void createPHIsForSplitLoopExit(ArrayRef<BasicBlock *> Preds,
                                 BasicBlock *SplitBB, BasicBlock *DestBB);
 
 /// If this edge is a critical edge, insert a new node to split the critical
@@ -212,14 +212,14 @@ void createPHIsForSplitLoopExit(ArrayRef<BasicBlock *> Preds,
 /// IndirectBrInst.  Splitting these edges will almost always create an invalid
 /// program because the address of the new block won't be the one that is jumped
 /// to.
-BasicBlock *SplitCriticalEdge(Instruction *TI, unsigned SuccNum,
+LLVM_FUNC_ABI BasicBlock *SplitCriticalEdge(Instruction *TI, unsigned SuccNum,
                               const CriticalEdgeSplittingOptions &Options =
                                   CriticalEdgeSplittingOptions(),
                               const Twine &BBName = "");
 
 /// If it is known that an edge is critical, SplitKnownCriticalEdge can be
 /// called directly, rather than calling SplitCriticalEdge first.
-BasicBlock *SplitKnownCriticalEdge(Instruction *TI, unsigned SuccNum,
+LLVM_FUNC_ABI BasicBlock *SplitKnownCriticalEdge(Instruction *TI, unsigned SuccNum,
                                    const CriticalEdgeSplittingOptions &Options =
                                        CriticalEdgeSplittingOptions(),
                                    const Twine &BBName = "");
@@ -243,28 +243,28 @@ SplitCriticalEdge(BasicBlock *Src, BasicBlock *Dst,
 
 /// Loop over all of the edges in the CFG, breaking critical edges as they are
 /// found. Returns the number of broken edges.
-unsigned SplitAllCriticalEdges(Function &F,
+LLVM_FUNC_ABI unsigned SplitAllCriticalEdges(Function &F,
                                const CriticalEdgeSplittingOptions &Options =
                                    CriticalEdgeSplittingOptions());
 
 /// Split the edge connecting the specified blocks, and return the newly created
 /// basic block between \p From and \p To.
-BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To,
+LLVM_FUNC_ABI BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To,
                       DominatorTree *DT = nullptr, LoopInfo *LI = nullptr,
                       MemorySSAUpdater *MSSAU = nullptr,
                       const Twine &BBName = "");
 
 /// Sets the unwind edge of an instruction to a particular successor.
-void setUnwindEdgeTo(Instruction *TI, BasicBlock *Succ);
+LLVM_FUNC_ABI void setUnwindEdgeTo(Instruction *TI, BasicBlock *Succ);
 
 /// Replaces all uses of OldPred with the NewPred block in all PHINodes in a
 /// block.
-void updatePhiNodes(BasicBlock *DestBB, BasicBlock *OldPred,
+LLVM_FUNC_ABI void updatePhiNodes(BasicBlock *DestBB, BasicBlock *OldPred,
                     BasicBlock *NewPred, PHINode *Until = nullptr);
 
 /// Split the edge connect the specficed blocks in the case that \p Succ is an
 /// Exception Handling Block
-BasicBlock *ehAwareSplitEdge(BasicBlock *BB, BasicBlock *Succ,
+LLVM_FUNC_ABI BasicBlock *ehAwareSplitEdge(BasicBlock *BB, BasicBlock *Succ,
                              LandingPadInst *OriginalPad = nullptr,
                              PHINode *LandingPadReplacement = nullptr,
                              const CriticalEdgeSplittingOptions &Options =
@@ -281,7 +281,7 @@ BasicBlock *ehAwareSplitEdge(BasicBlock *BB, BasicBlock *Succ,
 /// branch. The new block with name \p BBName is returned.
 ///
 /// FIXME: deprecated, switch to the DomTreeUpdater-based one.
-BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt, DominatorTree *DT,
+LLVM_FUNC_ABI BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt, DominatorTree *DT,
                        LoopInfo *LI = nullptr,
                        MemorySSAUpdater *MSSAU = nullptr,
                        const Twine &BBName = "", bool Before = false);
@@ -294,7 +294,7 @@ BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt, DominatorTree *DT,
 /// Everything before \p SplitPt stays in \p Old and everything starting with \p
 /// SplitPt moves to a new block. The two blocks are joined by an unconditional
 /// branch. The new block with name \p BBName is returned.
-BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt,
+LLVM_FUNC_ABI BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt,
                        DomTreeUpdater *DTU = nullptr, LoopInfo *LI = nullptr,
                        MemorySSAUpdater *MSSAU = nullptr,
                        const Twine &BBName = "", bool Before = false);
@@ -304,7 +304,7 @@ BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt,
 /// instructions after \p SplitPt stay in the old block. The new block and the
 /// old block are joined by inserting an unconditional branch to the end of the
 /// new block. The new block with name \p BBName is returned.
-BasicBlock *splitBlockBefore(BasicBlock *Old, Instruction *SplitPt,
+LLVM_FUNC_ABI BasicBlock *splitBlockBefore(BasicBlock *Old, Instruction *SplitPt,
                              DomTreeUpdater *DTU, LoopInfo *LI,
                              MemorySSAUpdater *MSSAU, const Twine &BBName = "");
 
@@ -324,7 +324,7 @@ BasicBlock *splitBlockBefore(BasicBlock *Old, Instruction *SplitPt,
 /// split is an exit of a loop with other exits).
 ///
 /// FIXME: deprecated, switch to the DomTreeUpdater-based one.
-BasicBlock *SplitBlockPredecessors(BasicBlock *BB, ArrayRef<BasicBlock *> Preds,
+LLVM_FUNC_ABI BasicBlock *SplitBlockPredecessors(BasicBlock *BB, ArrayRef<BasicBlock *> Preds,
                                    const char *Suffix, DominatorTree *DT,
                                    LoopInfo *LI = nullptr,
                                    MemorySSAUpdater *MSSAU = nullptr,
@@ -344,7 +344,7 @@ BasicBlock *SplitBlockPredecessors(BasicBlock *BB, ArrayRef<BasicBlock *> Preds,
 /// no other analyses. In particular, it does not preserve LoopSimplify
 /// (because it's complicated to handle the case where one of the edges being
 /// split is an exit of a loop with other exits).
-BasicBlock *SplitBlockPredecessors(BasicBlock *BB, ArrayRef<BasicBlock *> Preds,
+LLVM_FUNC_ABI BasicBlock *SplitBlockPredecessors(BasicBlock *BB, ArrayRef<BasicBlock *> Preds,
                                    const char *Suffix,
                                    DomTreeUpdater *DTU = nullptr,
                                    LoopInfo *LI = nullptr,
@@ -364,7 +364,7 @@ BasicBlock *SplitBlockPredecessors(BasicBlock *BB, ArrayRef<BasicBlock *> Preds,
 /// split is an exit of a loop with other exits).
 ///
 /// FIXME: deprecated, switch to the DomTreeUpdater-based one.
-void SplitLandingPadPredecessors(BasicBlock *OrigBB,
+LLVM_FUNC_ABI void SplitLandingPadPredecessors(BasicBlock *OrigBB,
                                  ArrayRef<BasicBlock *> Preds,
                                  const char *Suffix, const char *Suffix2,
                                  SmallVectorImpl<BasicBlock *> &NewBBs,
@@ -383,7 +383,7 @@ void SplitLandingPadPredecessors(BasicBlock *OrigBB,
 /// no other analyses. In particular, it does not preserve LoopSimplify
 /// (because it's complicated to handle the case where one of the edges being
 /// split is an exit of a loop with other exits).
-void SplitLandingPadPredecessors(
+LLVM_FUNC_ABI void SplitLandingPadPredecessors(
     BasicBlock *OrigBB, ArrayRef<BasicBlock *> Preds, const char *Suffix,
     const char *Suffix2, SmallVectorImpl<BasicBlock *> &NewBBs,
     DomTreeUpdater *DTU = nullptr, LoopInfo *LI = nullptr,
@@ -393,7 +393,7 @@ void SplitLandingPadPredecessors(
 /// which ends in an unconditional branch. If the return instruction returns a
 /// value defined by a PHI, propagate the right value into the return. It
 /// returns the new return instruction in the predecessor.
-ReturnInst *FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB,
+LLVM_FUNC_ABI ReturnInst *FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB,
                                        BasicBlock *Pred,
                                        DomTreeUpdater *DTU = nullptr);
 
@@ -418,7 +418,7 @@ ReturnInst *FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB,
 /// Returns the NewBasicBlock's terminator.
 ///
 /// Updates DTU and LI if given.
-Instruction *SplitBlockAndInsertIfThen(Value *Cond, Instruction *SplitBefore,
+LLVM_FUNC_ABI Instruction *SplitBlockAndInsertIfThen(Value *Cond, Instruction *SplitBefore,
                                        bool Unreachable,
                                        MDNode *BranchWeights = nullptr,
                                        DomTreeUpdater *DTU = nullptr,
@@ -441,7 +441,7 @@ Instruction *SplitBlockAndInsertIfThen(Value *Cond, Instruction *SplitBefore,
 ///   Tail
 ///
 /// Updates DT if given.
-void SplitBlockAndInsertIfThenElse(Value *Cond, Instruction *SplitBefore,
+LLVM_FUNC_ABI void SplitBlockAndInsertIfThenElse(Value *Cond, Instruction *SplitBefore,
                                    Instruction **ThenTerm,
                                    Instruction **ElseTerm,
                                    MDNode *BranchWeights = nullptr,
@@ -451,7 +451,7 @@ void SplitBlockAndInsertIfThenElse(Value *Cond, Instruction *SplitBefore,
 /// that \p End is assumed > 0, and thus not checked on entry) at \p
 /// SplitBefore.  Returns the first insert point in the loop body, and the
 /// PHINode for the induction variable (i.e. "i" above).
-std::pair<Instruction*, Value*>
+LLVM_FUNC_ABI std::pair<Instruction*, Value*>
 SplitBlockAndInsertSimpleForLoop(Value *End, Instruction *SplitBefore);
 
 /// Utility function for performing a given action on each lane of a vector
@@ -462,7 +462,7 @@ SplitBlockAndInsertSimpleForLoop(Value *End, Instruction *SplitBefore);
 /// IRBuilder whose insert point is correctly set for instantiating the
 /// given index, and a value which is (at runtime) the index to access.
 /// This index *may* be a constant.
-void SplitBlockAndInsertForEachLane(ElementCount EC, Type *IndexTy,
+LLVM_FUNC_ABI void SplitBlockAndInsertForEachLane(ElementCount EC, Type *IndexTy,
     Instruction *InsertBefore,
     std::function<void(IRBuilderBase&, Value*)> Func);
 
@@ -474,7 +474,7 @@ void SplitBlockAndInsertForEachLane(ElementCount EC, Type *IndexTy,
 /// arguments an IRBuilder whose insert point is correctly set for instantiating
 /// the given index, and a value which is (at runtime) the index to access. This
 /// index *may* be a constant.
-void SplitBlockAndInsertForEachLane(
+LLVM_FUNC_ABI void SplitBlockAndInsertForEachLane(
     Value *End, Instruction *InsertBefore,
     std::function<void(IRBuilderBase &, Value *)> Func);
 
@@ -486,7 +486,7 @@ void SplitBlockAndInsertForEachLane(
 ///
 /// This does no checking to see if the true/false blocks have large or unsavory
 /// instructions in them.
-BranchInst *GetIfCondition(BasicBlock *BB, BasicBlock *&IfTrue,
+LLVM_FUNC_ABI BranchInst *GetIfCondition(BasicBlock *BB, BasicBlock *&IfTrue,
                            BasicBlock *&IfFalse);
 
 // Split critical edges where the source of the edge is an indirectbr
@@ -510,7 +510,7 @@ BranchInst *GetIfCondition(BasicBlock *BB, BasicBlock *&IfTrue,
 // If BPI and BFI aren't non-null, BPI/BFI will be updated accordingly.
 // When `IgnoreBlocksWithoutPHI` is set to `true` critical edges leading to a
 // block without phi-instructions will not be split.
-bool SplitIndirectBrCriticalEdges(Function &F, bool IgnoreBlocksWithoutPHI,
+LLVM_FUNC_ABI bool SplitIndirectBrCriticalEdges(Function &F, bool IgnoreBlocksWithoutPHI,
                                   BranchProbabilityInfo *BPI = nullptr,
                                   BlockFrequencyInfo *BFI = nullptr);
 
@@ -583,7 +583,7 @@ bool SplitIndirectBrCriticalEdges(Function &F, bool IgnoreBlocksWithoutPHI,
 ///    for the caller to accomplish, since each specific use of this function
 ///    may have additional information which simplifies this fixup. For example,
 ///    see restoreSSA() in the UnifyLoopExits pass.
-BasicBlock *CreateControlFlowHub(
+LLVM_FUNC_ABI BasicBlock *CreateControlFlowHub(
     DomTreeUpdater *DTU, SmallVectorImpl<BasicBlock *> &GuardBlocks,
     const SetVector<BasicBlock *> &Predecessors,
     const SetVector<BasicBlock *> &Successors, const StringRef Prefix,
@@ -591,7 +591,7 @@ BasicBlock *CreateControlFlowHub(
 
 // Utility function for inverting branch condition and for swapping its
 // successors
-void InvertBranch(BranchInst *PBI, IRBuilderBase &Builder);
+LLVM_FUNC_ABI void InvertBranch(BranchInst *PBI, IRBuilderBase &Builder);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h b/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h
index 3223c26092b70c1..7f76d85406b19c8 100644
--- a/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h
+++ b/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h
@@ -23,7 +23,7 @@
 namespace llvm {
 
 class Function;
-struct BreakCriticalEdgesPass : public PassInfoMixin<BreakCriticalEdgesPass> {
+struct LLVM_CLASS_ABI BreakCriticalEdgesPass : public PassInfoMixin<BreakCriticalEdgesPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h b/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
index 1a0dafe127888ce..4693565bdb74f42 100644
--- a/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
+++ b/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
@@ -29,16 +29,16 @@ namespace llvm {
   /// If the library function is unavailable, this doesn't modify it.
   ///
   /// Returns true if any attributes were set and false otherwise.
-  bool inferNonMandatoryLibFuncAttrs(Module *M, StringRef Name,
+  LLVM_FUNC_ABI bool inferNonMandatoryLibFuncAttrs(Module *M, StringRef Name,
                                      const TargetLibraryInfo &TLI);
-  bool inferNonMandatoryLibFuncAttrs(Function &F, const TargetLibraryInfo &TLI);
+  LLVM_FUNC_ABI bool inferNonMandatoryLibFuncAttrs(Function &F, const TargetLibraryInfo &TLI);
 
   /// Calls getOrInsertFunction() and then makes sure to add mandatory
   /// argument attributes.
-  FunctionCallee getOrInsertLibFunc(Module *M, const TargetLibraryInfo &TLI,
+  LLVM_FUNC_ABI FunctionCallee getOrInsertLibFunc(Module *M, const TargetLibraryInfo &TLI,
                                     LibFunc TheLibFunc, FunctionType *T,
                                     AttributeList AttributeList);
-  FunctionCallee getOrInsertLibFunc(Module *M, const TargetLibraryInfo &TLI,
+  LLVM_FUNC_ABI FunctionCallee getOrInsertLibFunc(Module *M, const TargetLibraryInfo &TLI,
                                     LibFunc TheLibFunc, FunctionType *T);
   template <typename... ArgsTy>
   FunctionCallee getOrInsertLibFunc(Module *M, const TargetLibraryInfo &TLI,
@@ -65,141 +65,141 @@ namespace llvm {
 
   /// Check whether the library function is available on target and also that
   /// it in the current Module is a Function with the right type.
-  bool isLibFuncEmittable(const Module *M, const TargetLibraryInfo *TLI,
+  LLVM_FUNC_ABI bool isLibFuncEmittable(const Module *M, const TargetLibraryInfo *TLI,
                           LibFunc TheLibFunc);
-  bool isLibFuncEmittable(const Module *M, const TargetLibraryInfo *TLI,
+  LLVM_FUNC_ABI bool isLibFuncEmittable(const Module *M, const TargetLibraryInfo *TLI,
                           StringRef Name);
 
   /// Check whether the overloaded floating point function
   /// corresponding to \a Ty is available.
-  bool hasFloatFn(const Module *M, const TargetLibraryInfo *TLI, Type *Ty,
+  LLVM_FUNC_ABI bool hasFloatFn(const Module *M, const TargetLibraryInfo *TLI, Type *Ty,
                   LibFunc DoubleFn, LibFunc FloatFn, LibFunc LongDoubleFn);
 
   /// Get the name of the overloaded floating point function
   /// corresponding to \a Ty. Return the LibFunc in \a TheLibFunc.
-  StringRef getFloatFn(const Module *M, const TargetLibraryInfo *TLI, Type *Ty,
+  LLVM_FUNC_ABI StringRef getFloatFn(const Module *M, const TargetLibraryInfo *TLI, Type *Ty,
                        LibFunc DoubleFn, LibFunc FloatFn, LibFunc LongDoubleFn,
                        LibFunc &TheLibFunc);
 
   /// Return V if it is an i8*, otherwise cast it to i8*.
-  Value *castToCStr(Value *V, IRBuilderBase &B);
+  LLVM_FUNC_ABI Value *castToCStr(Value *V, IRBuilderBase &B);
 
   /// Emit a call to the strlen function to the builder, for the specified
   /// pointer. Ptr is required to be some pointer type, and the return value has
   /// 'size_t' type.
-  Value *emitStrLen(Value *Ptr, IRBuilderBase &B, const DataLayout &DL,
+  LLVM_FUNC_ABI Value *emitStrLen(Value *Ptr, IRBuilderBase &B, const DataLayout &DL,
                     const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strdup function to the builder, for the specified
   /// pointer. Ptr is required to be some pointer type, and the return value has
   /// 'i8*' type.
-  Value *emitStrDup(Value *Ptr, IRBuilderBase &B, const TargetLibraryInfo *TLI);
+  LLVM_FUNC_ABI Value *emitStrDup(Value *Ptr, IRBuilderBase &B, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strchr function to the builder, for the specified
   /// pointer and character. Ptr is required to be some pointer type, and the
   /// return value has 'i8*' type.
-  Value *emitStrChr(Value *Ptr, char C, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStrChr(Value *Ptr, char C, IRBuilderBase &B,
                     const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strncmp function to the builder.
-  Value *emitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilderBase &B,
                      const DataLayout &DL, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strcpy function to the builder, for the specified
   /// pointer arguments.
-  Value *emitStrCpy(Value *Dst, Value *Src, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStrCpy(Value *Dst, Value *Src, IRBuilderBase &B,
                     const TargetLibraryInfo *TLI);
 
   /// Emit a call to the stpcpy function to the builder, for the specified
   /// pointer arguments.
-  Value *emitStpCpy(Value *Dst, Value *Src, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStpCpy(Value *Dst, Value *Src, IRBuilderBase &B,
                     const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strncpy function to the builder, for the specified
   /// pointer arguments and length.
-  Value *emitStrNCpy(Value *Dst, Value *Src, Value *Len, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStrNCpy(Value *Dst, Value *Src, Value *Len, IRBuilderBase &B,
                      const TargetLibraryInfo *TLI);
 
   /// Emit a call to the stpncpy function to the builder, for the specified
   /// pointer arguments and length.
-  Value *emitStpNCpy(Value *Dst, Value *Src, Value *Len, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStpNCpy(Value *Dst, Value *Src, Value *Len, IRBuilderBase &B,
                      const TargetLibraryInfo *TLI);
 
   /// Emit a call to the __memcpy_chk function to the builder. This expects that
   /// the Len and ObjSize have type 'size_t' and Dst/Src are pointers.
-  Value *emitMemCpyChk(Value *Dst, Value *Src, Value *Len, Value *ObjSize,
+  LLVM_FUNC_ABI Value *emitMemCpyChk(Value *Dst, Value *Src, Value *Len, Value *ObjSize,
                        IRBuilderBase &B, const DataLayout &DL,
                        const TargetLibraryInfo *TLI);
 
   /// Emit a call to the mempcpy function.
-  Value *emitMemPCpy(Value *Dst, Value *Src, Value *Len, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitMemPCpy(Value *Dst, Value *Src, Value *Len, IRBuilderBase &B,
                      const DataLayout &DL, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the memchr function. This assumes that Ptr is a pointer,
   /// Val is an 'int' value, and Len is an 'size_t' value.
-  Value *emitMemChr(Value *Ptr, Value *Val, Value *Len, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitMemChr(Value *Ptr, Value *Val, Value *Len, IRBuilderBase &B,
                     const DataLayout &DL, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the memrchr function, analogously to emitMemChr.
-  Value *emitMemRChr(Value *Ptr, Value *Val, Value *Len, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitMemRChr(Value *Ptr, Value *Val, Value *Len, IRBuilderBase &B,
                     const DataLayout &DL, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the memcmp function.
-  Value *emitMemCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitMemCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilderBase &B,
                     const DataLayout &DL, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the bcmp function.
-  Value *emitBCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitBCmp(Value *Ptr1, Value *Ptr2, Value *Len, IRBuilderBase &B,
                   const DataLayout &DL, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the memccpy function.
-  Value *emitMemCCpy(Value *Ptr1, Value *Ptr2, Value *Val, Value *Len,
+  LLVM_FUNC_ABI Value *emitMemCCpy(Value *Ptr1, Value *Ptr2, Value *Val, Value *Len,
                      IRBuilderBase &B, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the snprintf function.
-  Value *emitSNPrintf(Value *Dest, Value *Size, Value *Fmt,
+  LLVM_FUNC_ABI Value *emitSNPrintf(Value *Dest, Value *Size, Value *Fmt,
                       ArrayRef<Value *> Args, IRBuilderBase &B,
                       const TargetLibraryInfo *TLI);
 
   /// Emit a call to the sprintf function.
-  Value *emitSPrintf(Value *Dest, Value *Fmt, ArrayRef<Value *> VariadicArgs,
+  LLVM_FUNC_ABI Value *emitSPrintf(Value *Dest, Value *Fmt, ArrayRef<Value *> VariadicArgs,
                      IRBuilderBase &B, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strcat function.
-  Value *emitStrCat(Value *Dest, Value *Src, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStrCat(Value *Dest, Value *Src, IRBuilderBase &B,
                     const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strlcpy function.
-  Value *emitStrLCpy(Value *Dest, Value *Src, Value *Size, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStrLCpy(Value *Dest, Value *Src, Value *Size, IRBuilderBase &B,
                      const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strlcat function.
-  Value *emitStrLCat(Value *Dest, Value *Src, Value *Size, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStrLCat(Value *Dest, Value *Src, Value *Size, IRBuilderBase &B,
                      const TargetLibraryInfo *TLI);
 
   /// Emit a call to the strncat function.
-  Value *emitStrNCat(Value *Dest, Value *Src, Value *Size, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitStrNCat(Value *Dest, Value *Src, Value *Size, IRBuilderBase &B,
                      const TargetLibraryInfo *TLI);
 
   /// Emit a call to the vsnprintf function.
-  Value *emitVSNPrintf(Value *Dest, Value *Size, Value *Fmt, Value *VAList,
+  LLVM_FUNC_ABI Value *emitVSNPrintf(Value *Dest, Value *Size, Value *Fmt, Value *VAList,
                        IRBuilderBase &B, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the vsprintf function.
-  Value *emitVSPrintf(Value *Dest, Value *Fmt, Value *VAList, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitVSPrintf(Value *Dest, Value *Fmt, Value *VAList, IRBuilderBase &B,
                       const TargetLibraryInfo *TLI);
 
   /// Emit a call to the unary function named 'Name' (e.g.  'floor'). This
   /// function is known to take a single of type matching 'Op' and returns one
   /// value with the same type. If 'Op' is a long double, 'l' is added as the
   /// suffix of name, if 'Op' is a float, we add a 'f' suffix.
-  Value *emitUnaryFloatFnCall(Value *Op, const TargetLibraryInfo *TLI,
+  LLVM_FUNC_ABI Value *emitUnaryFloatFnCall(Value *Op, const TargetLibraryInfo *TLI,
                               StringRef Name, IRBuilderBase &B,
                               const AttributeList &Attrs);
 
   /// Emit a call to the unary function DoubleFn, FloatFn or LongDoubleFn,
   /// depending of the type of Op.
-  Value *emitUnaryFloatFnCall(Value *Op, const TargetLibraryInfo *TLI,
+  LLVM_FUNC_ABI Value *emitUnaryFloatFnCall(Value *Op, const TargetLibraryInfo *TLI,
                               LibFunc DoubleFn, LibFunc FloatFn,
                               LibFunc LongDoubleFn, IRBuilderBase &B,
                               const AttributeList &Attrs);
@@ -208,59 +208,59 @@ namespace llvm {
   /// function is known to take type matching 'Op1' and 'Op2' and return one
   /// value with the same type. If 'Op1/Op2' are long double, 'l' is added as
   /// the suffix of name, if 'Op1/Op2' are float, we add a 'f' suffix.
-  Value *emitBinaryFloatFnCall(Value *Op1, Value *Op2,
+  LLVM_FUNC_ABI Value *emitBinaryFloatFnCall(Value *Op1, Value *Op2,
                                const TargetLibraryInfo *TLI,
                                StringRef Name, IRBuilderBase &B,
                                const AttributeList &Attrs);
 
   /// Emit a call to the binary function DoubleFn, FloatFn or LongDoubleFn,
   /// depending of the type of Op1.
-  Value *emitBinaryFloatFnCall(Value *Op1, Value *Op2,
+  LLVM_FUNC_ABI Value *emitBinaryFloatFnCall(Value *Op1, Value *Op2,
                                const TargetLibraryInfo *TLI, LibFunc DoubleFn,
                                LibFunc FloatFn, LibFunc LongDoubleFn,
                                IRBuilderBase &B, const AttributeList &Attrs);
 
   /// Emit a call to the putchar function. This assumes that Char is an 'int'.
-  Value *emitPutChar(Value *Char, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitPutChar(Value *Char, IRBuilderBase &B,
                      const TargetLibraryInfo *TLI);
 
   /// Emit a call to the puts function. This assumes that Str is some pointer.
-  Value *emitPutS(Value *Str, IRBuilderBase &B, const TargetLibraryInfo *TLI);
+  LLVM_FUNC_ABI Value *emitPutS(Value *Str, IRBuilderBase &B, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the fputc function. This assumes that Char is an 'int', and
   /// File is a pointer to FILE.
-  Value *emitFPutC(Value *Char, Value *File, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitFPutC(Value *Char, Value *File, IRBuilderBase &B,
                    const TargetLibraryInfo *TLI);
 
   /// Emit a call to the fputs function. Str is required to be a pointer and
   /// File is a pointer to FILE.
-  Value *emitFPutS(Value *Str, Value *File, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitFPutS(Value *Str, Value *File, IRBuilderBase &B,
                    const TargetLibraryInfo *TLI);
 
   /// Emit a call to the fwrite function. This assumes that Ptr is a pointer,
   /// Size is an 'size_t', and File is a pointer to FILE.
-  Value *emitFWrite(Value *Ptr, Value *Size, Value *File, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitFWrite(Value *Ptr, Value *Size, Value *File, IRBuilderBase &B,
                     const DataLayout &DL, const TargetLibraryInfo *TLI);
 
   /// Emit a call to the malloc function.
-  Value *emitMalloc(Value *Num, IRBuilderBase &B, const DataLayout &DL,
+  LLVM_FUNC_ABI Value *emitMalloc(Value *Num, IRBuilderBase &B, const DataLayout &DL,
                     const TargetLibraryInfo *TLI);
 
   /// Emit a call to the calloc function.
-  Value *emitCalloc(Value *Num, Value *Size, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitCalloc(Value *Num, Value *Size, IRBuilderBase &B,
                     const TargetLibraryInfo &TLI);
 
   /// Emit a call to the hot/cold operator new function.
-  Value *emitHotColdNew(Value *Num, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitHotColdNew(Value *Num, IRBuilderBase &B,
                         const TargetLibraryInfo *TLI, LibFunc NewFunc,
                         uint8_t HotCold);
-  Value *emitHotColdNewNoThrow(Value *Num, Value *NoThrow, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitHotColdNewNoThrow(Value *Num, Value *NoThrow, IRBuilderBase &B,
                                const TargetLibraryInfo *TLI, LibFunc NewFunc,
                                uint8_t HotCold);
-  Value *emitHotColdNewAligned(Value *Num, Value *Align, IRBuilderBase &B,
+  LLVM_FUNC_ABI Value *emitHotColdNewAligned(Value *Num, Value *Align, IRBuilderBase &B,
                                const TargetLibraryInfo *TLI, LibFunc NewFunc,
                                uint8_t HotCold);
-  Value *emitHotColdNewAlignedNoThrow(Value *Num, Value *Align, Value *NoThrow,
+  LLVM_FUNC_ABI Value *emitHotColdNewAlignedNoThrow(Value *Num, Value *Align, Value *NoThrow,
                                       IRBuilderBase &B,
                                       const TargetLibraryInfo *TLI,
                                       LibFunc NewFunc, uint8_t HotCold);
diff --git a/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h b/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h
index abaff302fd21b18..ee7c7d83db8cc99 100644
--- a/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h
+++ b/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h
@@ -28,7 +28,7 @@ namespace llvm {
 class BasicBlock;
 class Value;
 
-struct DivRemMapKey {
+struct LLVM_CLASS_ABI DivRemMapKey {
   bool SignedOp;
   AssertingVH<Value> Dividend;
   AssertingVH<Value> Divisor;
@@ -39,7 +39,7 @@ struct DivRemMapKey {
       : SignedOp(InSignedOp), Dividend(InDividend), Divisor(InDivisor) {}
 };
 
-template <> struct DenseMapInfo<DivRemMapKey> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<DivRemMapKey> {
   static bool isEqual(const DivRemMapKey &Val1, const DivRemMapKey &Val2) {
     return Val1.SignedOp == Val2.SignedOp && Val1.Dividend == Val2.Dividend &&
            Val1.Divisor == Val2.Divisor;
@@ -67,7 +67,7 @@ template <> struct DenseMapInfo<DivRemMapKey> {
 ///
 /// This optimization may add basic blocks immediately after BB; for obvious
 /// reasons, you shouldn't pass those blocks to bypassSlowDivision.
-bool bypassSlowDivision(
+LLVM_FUNC_ABI bool bypassSlowDivision(
     BasicBlock *BB, const DenseMap<unsigned int, unsigned int> &BypassWidth);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h b/llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
index f571ce542afee86..1182811ec401fe1 100644
--- a/llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
+++ b/llvm/include/llvm/Transforms/Utils/CallGraphUpdater.h
@@ -27,7 +27,7 @@ class CallGraphSCC;
 /// Wrapper to unify "old style" CallGraph and "new style" LazyCallGraph. This
 /// simplifies the interface and the call sites, e.g., new and old pass manager
 /// passes can share the same code.
-class CallGraphUpdater {
+class LLVM_CLASS_ABI CallGraphUpdater {
   /// Containers for functions which we did replace or want to delete when
   /// `finalize` is called. This can happen explicitly or as part of the
   /// destructor. Dead functions in comdat sections are tracked separately
diff --git a/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h b/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
index 159e53f50c3c1c4..988e2bdc3e67c5c 100644
--- a/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/CallPromotionUtils.h
@@ -30,7 +30,7 @@ class Value;
 /// match exactly, they must at least be bitcast compatible. If \p FailureReason
 /// is non-null and the indirect call cannot be promoted, the failure reason
 /// will be stored in it.
-bool isLegalToPromote(const CallBase &CB, Function *Callee,
+LLVM_FUNC_ABI bool isLegalToPromote(const CallBase &CB, Function *Callee,
                       const char **FailureReason = nullptr);
 
 /// Promote the given indirect call site to unconditionally call \p Callee.
@@ -40,7 +40,7 @@ bool isLegalToPromote(const CallBase &CB, Function *Callee,
 /// of the callee, bitcast instructions are inserted where appropriate. If \p
 /// RetBitCast is non-null, it will be used to store the return value bitcast,
 /// if created.
-CallBase &promoteCall(CallBase &CB, Function *Callee,
+LLVM_FUNC_ABI CallBase &promoteCall(CallBase &CB, Function *Callee,
                       CastInst **RetBitCast = nullptr);
 
 /// Promote the given indirect call site to conditionally call \p Callee.
@@ -50,7 +50,7 @@ CallBase &promoteCall(CallBase &CB, Function *Callee,
 /// indirect call site is promoted, placed in the "then" block, and returned. If
 /// \p BranchWeights is non-null, it will be used to set !prof metadata on the
 /// new conditional branch.
-CallBase &promoteCallWithIfThenElse(CallBase &CB, Function *Callee,
+LLVM_FUNC_ABI CallBase &promoteCallWithIfThenElse(CallBase &CB, Function *Callee,
                                     MDNode *BranchWeights = nullptr);
 
 /// Try to promote (devirtualize) a virtual call on an Alloca. Return true on
@@ -74,7 +74,7 @@ CallBase &promoteCallWithIfThenElse(CallBase &CB, Function *Callee,
 ///     [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI4Impl to i8*),
 ///     i8* bitcast (void (%class.Impl*)* @_ZN4Impl3RunEv to i8*)] }
 ///
-bool tryPromoteCall(CallBase &CB);
+LLVM_FUNC_ABI bool tryPromoteCall(CallBase &CB);
 
 /// Predicate and clone the given call site.
 ///
@@ -83,7 +83,7 @@ bool tryPromoteCall(CallBase &CB);
 /// callee. The original call site is moved into the "else" block, and a clone
 /// of the call site is placed in the "then" block. The cloned instruction is
 /// returned.
-CallBase &versionCallSite(CallBase &CB, Value *Callee, MDNode *BranchWeights);
+LLVM_FUNC_ABI CallBase &versionCallSite(CallBase &CB, Value *Callee, MDNode *BranchWeights);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h b/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h
index 96414df506f8069..7a5a0a55f0f200d 100644
--- a/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h
+++ b/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h
@@ -21,7 +21,7 @@ namespace llvm {
 class Module;
 
 /// Simple pass that canonicalizes aliases.
-class CanonicalizeAliasesPass : public PassInfoMixin<CanonicalizeAliasesPass> {
+class LLVM_CLASS_ABI CanonicalizeAliasesPass : public PassInfoMixin<CanonicalizeAliasesPass> {
 public:
   CanonicalizeAliasesPass() = default;
 
diff --git a/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h b/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h
index 28418513df92ef0..c78e871cf356a03 100644
--- a/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h
+++ b/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h
@@ -22,7 +22,7 @@ class Loop;
 class LPMUpdater;
 
 /// A pass that canonicalizes freeze instructions in a loop.
-class CanonicalizeFreezeInLoopsPass
+class LLVM_CLASS_ABI CanonicalizeFreezeInLoopsPass
     : public PassInfoMixin<CanonicalizeFreezeInLoopsPass> {
 public:
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
diff --git a/llvm/include/llvm/Transforms/Utils/Cloning.h b/llvm/include/llvm/Transforms/Utils/Cloning.h
index 29ac1eddeec4a8f..dba8b29f1cf9666 100644
--- a/llvm/include/llvm/Transforms/Utils/Cloning.h
+++ b/llvm/include/llvm/Transforms/Utils/Cloning.h
@@ -46,20 +46,20 @@ class ReturnInst;
 class DomTreeUpdater;
 
 /// Return an exact copy of the specified module
-std::unique_ptr<Module> CloneModule(const Module &M);
-std::unique_ptr<Module> CloneModule(const Module &M, ValueToValueMapTy &VMap);
+LLVM_FUNC_ABI std::unique_ptr<Module> CloneModule(const Module &M);
+LLVM_FUNC_ABI std::unique_ptr<Module> CloneModule(const Module &M, ValueToValueMapTy &VMap);
 
 /// Return a copy of the specified module. The ShouldCloneDefinition function
 /// controls whether a specific GlobalValue's definition is cloned. If the
 /// function returns false, the module copy will contain an external reference
 /// in place of the global definition.
-std::unique_ptr<Module>
+LLVM_FUNC_ABI std::unique_ptr<Module>
 CloneModule(const Module &M, ValueToValueMapTy &VMap,
             function_ref<bool(const GlobalValue *)> ShouldCloneDefinition);
 
 /// This struct can be used to capture information about code
 /// being cloned, while it is being cloned.
-struct ClonedCodeInfo {
+struct LLVM_CLASS_ABI ClonedCodeInfo {
   /// This is set to true if the cloned code contains a normal call instruction.
   bool ContainsCalls = false;
 
@@ -116,7 +116,7 @@ struct ClonedCodeInfo {
 /// If you would like to collect additional information about the cloned
 /// function, you can specify a ClonedCodeInfo object with the optional fifth
 /// parameter.
-BasicBlock *CloneBasicBlock(const BasicBlock *BB, ValueToValueMapTy &VMap,
+LLVM_FUNC_ABI BasicBlock *CloneBasicBlock(const BasicBlock *BB, ValueToValueMapTy &VMap,
                             const Twine &NameSuffix = "", Function *F = nullptr,
                             ClonedCodeInfo *CodeInfo = nullptr,
                             DebugInfoFinder *DIFinder = nullptr);
@@ -132,7 +132,7 @@ BasicBlock *CloneBasicBlock(const BasicBlock *BB, ValueToValueMapTy &VMap,
 ///
 /// \pre VMap contains no non-identity GlobalValue mappings.
 ///
-Function *CloneFunction(Function *F, ValueToValueMapTy &VMap,
+LLVM_FUNC_ABI Function *CloneFunction(Function *F, ValueToValueMapTy &VMap,
                         ClonedCodeInfo *CodeInfo = nullptr);
 
 enum class CloneFunctionChangeType {
@@ -166,7 +166,7 @@ enum class CloneFunctionChangeType {
 /// FIXME: Consider simplifying this function by splitting out \a
 /// CloneFunctionMetadataInto() and expecting / updating callers to call it
 /// first when / how it's needed.
-void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
+LLVM_FUNC_ABI void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
                        ValueToValueMapTy &VMap, CloneFunctionChangeType Changes,
                        SmallVectorImpl<ReturnInst *> &Returns,
                        const char *NameSuffix = "",
@@ -174,7 +174,7 @@ void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
                        ValueMapTypeRemapper *TypeMapper = nullptr,
                        ValueMaterializer *Materializer = nullptr);
 
-void CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
+LLVM_FUNC_ABI void CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
                                const Instruction *StartingInst,
                                ValueToValueMapTy &VMap, bool ModuleLevelChanges,
                                SmallVectorImpl<ReturnInst *> &Returns,
@@ -192,7 +192,7 @@ void CloneAndPruneIntoFromInst(Function *NewFunc, const Function *OldFunc,
 /// If ModuleLevelChanges is false, VMap contains no non-identity GlobalValue
 /// mappings.
 ///
-void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
+LLVM_FUNC_ABI void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
                                ValueToValueMapTy &VMap, bool ModuleLevelChanges,
                                SmallVectorImpl<ReturnInst*> &Returns,
                                const char *NameSuffix = "",
@@ -200,7 +200,7 @@ void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
 
 /// This class captures the data input to the InlineFunction call, and records
 /// the auxiliary results produced by it.
-class InlineFunctionInfo {
+class LLVM_CLASS_ABI InlineFunctionInfo {
 public:
   explicit InlineFunctionInfo(
       function_ref<AssumptionCache &(Function &)> GetAssumptionCache = nullptr,
@@ -264,7 +264,7 @@ class InlineFunctionInfo {
 ///
 /// The callee's function attributes are merged into the callers' if
 /// MergeAttributes is set to true.
-InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
+LLVM_FUNC_ABI InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
                             bool MergeAttributes = false,
                             AAResults *CalleeAAR = nullptr,
                             bool InsertLifetime = true,
@@ -276,14 +276,14 @@ InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
 /// Updates LoopInfo and DominatorTree assuming the loop is dominated by block
 /// \p LoopDomBB.  Insert the new blocks before block specified in \p Before.
 /// Note: Only innermost loops are supported.
-Loop *cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB,
+LLVM_FUNC_ABI Loop *cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB,
                              Loop *OrigLoop, ValueToValueMapTy &VMap,
                              const Twine &NameSuffix, LoopInfo *LI,
                              DominatorTree *DT,
                              SmallVectorImpl<BasicBlock *> &Blocks);
 
 /// Remaps instructions in \p Blocks using the mapping in \p VMap.
-void remapInstructionsInBlocks(ArrayRef<BasicBlock *> Blocks,
+LLVM_FUNC_ABI void remapInstructionsInBlocks(ArrayRef<BasicBlock *> Blocks,
                                ValueToValueMapTy &VMap);
 
 /// Split edge between BB and PredBB and duplicate all non-Phi instructions
@@ -292,7 +292,7 @@ void remapInstructionsInBlocks(ArrayRef<BasicBlock *> Blocks,
 /// we replace them with the uses of corresponding Phi inputs. ValueMapping
 /// is used to map the original instructions from BB to their newly-created
 /// copies. Returns the split block.
-BasicBlock *DuplicateInstructionsInSplitBetween(BasicBlock *BB,
+LLVM_FUNC_ABI BasicBlock *DuplicateInstructionsInSplitBetween(BasicBlock *BB,
                                                 BasicBlock *PredBB,
                                                 Instruction *StopAt,
                                                 ValueToValueMapTy &ValueMapping,
@@ -301,20 +301,20 @@ BasicBlock *DuplicateInstructionsInSplitBetween(BasicBlock *BB,
 /// Updates profile information by adjusting the entry count by adding
 /// EntryDelta then scaling callsite information by the new count divided by the
 /// old count. VMap is used during inlinng to also update the new clone
-void updateProfileCallee(
+LLVM_FUNC_ABI void updateProfileCallee(
     Function *Callee, int64_t EntryDelta,
     const ValueMap<const Value *, WeakTrackingVH> *VMap = nullptr);
 
 /// Find the 'llvm.experimental.noalias.scope.decl' intrinsics in the specified
 /// basic blocks and extract their scope. These are candidates for duplication
 /// when cloning.
-void identifyNoAliasScopesToClone(
+LLVM_FUNC_ABI void identifyNoAliasScopesToClone(
     ArrayRef<BasicBlock *> BBs, SmallVectorImpl<MDNode *> &NoAliasDeclScopes);
 
 /// Find the 'llvm.experimental.noalias.scope.decl' intrinsics in the specified
 /// instruction range and extract their scope. These are candidates for
 /// duplication when cloning.
-void identifyNoAliasScopesToClone(
+LLVM_FUNC_ABI void identifyNoAliasScopesToClone(
     BasicBlock::iterator Start, BasicBlock::iterator End,
     SmallVectorImpl<MDNode *> &NoAliasDeclScopes);
 
@@ -323,7 +323,7 @@ void identifyNoAliasScopesToClone(
 /// Afterwards, the ClonedScopes contains the mapping of the original scope
 /// MDNode onto the cloned scope.
 /// Be aware that the cloned scopes are still part of the original scope domain.
-void cloneNoAliasScopes(
+LLVM_FUNC_ABI void cloneNoAliasScopes(
     ArrayRef<MDNode *> NoAliasDeclScopes,
     DenseMap<MDNode *, MDNode *> &ClonedScopes,
     StringRef Ext, LLVMContext &Context);
@@ -331,21 +331,21 @@ void cloneNoAliasScopes(
 /// Adapt the metadata for the specified instruction according to the
 /// provided mapping. This is normally used after cloning an instruction, when
 /// some noalias scopes needed to be cloned.
-void adaptNoAliasScopes(
+LLVM_FUNC_ABI void adaptNoAliasScopes(
     llvm::Instruction *I, const DenseMap<MDNode *, MDNode *> &ClonedScopes,
     LLVMContext &Context);
 
 /// Clone the specified noalias decl scopes. Then adapt all instructions in the
 /// NewBlocks basicblocks to the cloned versions.
 /// 'Ext' will be added to the duplicate scope names.
-void cloneAndAdaptNoAliasScopes(ArrayRef<MDNode *> NoAliasDeclScopes,
+LLVM_FUNC_ABI void cloneAndAdaptNoAliasScopes(ArrayRef<MDNode *> NoAliasDeclScopes,
                                 ArrayRef<BasicBlock *> NewBlocks,
                                 LLVMContext &Context, StringRef Ext);
 
 /// Clone the specified noalias decl scopes. Then adapt all instructions in the
 /// [IStart, IEnd] (IEnd included !) range to the cloned versions. 'Ext' will be
 /// added to the duplicate scope names.
-void cloneAndAdaptNoAliasScopes(ArrayRef<MDNode *> NoAliasDeclScopes,
+LLVM_FUNC_ABI void cloneAndAdaptNoAliasScopes(ArrayRef<MDNode *> NoAliasDeclScopes,
                                 Instruction *IStart, Instruction *IEnd,
                                 LLVMContext &Context, StringRef Ext);
 } // end namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/CodeExtractor.h b/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
index f7ef661ba3fa88f..9f28ffe23319dcc 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeExtractor.h
@@ -44,7 +44,7 @@ class Value;
 /// other mutating operations on the IR occur.
 ///
 /// Constructing this object is O(n) in the size of the function.
-class CodeExtractorAnalysisCache {
+class LLVM_CLASS_ABI CodeExtractorAnalysisCache {
   /// The allocas in the function.
   SmallVector<AllocaInst *, 16> Allocas;
 
@@ -83,7 +83,7 @@ class CodeExtractorAnalysisCache {
   ///    function to arguments.
   /// 3) Add allocas for any scalar outputs, adding all of the outputs' allocas
   ///    as arguments, and inserting stores to the arguments for any scalars.
-  class CodeExtractor {
+  class LLVM_CLASS_ABI CodeExtractor {
     using ValueSet = SetVector<Value *>;
 
     // Various bits of state computed on construction.
diff --git a/llvm/include/llvm/Transforms/Utils/CodeLayout.h b/llvm/include/llvm/Transforms/Utils/CodeLayout.h
index 4a292088422c244..81d94631361e6e4 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeLayout.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeLayout.h
@@ -35,7 +35,7 @@ using EdgeCountT = std::pair<EdgeT, uint64_t>;
 /// \p EdgeCounts: The execution counts of every edge (jump) in the profile. The
 ///    map also defines the edges in CFG and should include 0-count edges.
 /// \returns The best block order found.
-std::vector<uint64_t>
+LLVM_FUNC_ABI std::vector<uint64_t>
 applyExtTspLayout(const std::vector<uint64_t> &NodeSizes,
                   const std::vector<uint64_t> &NodeCounts,
                   const std::vector<EdgeCountT> &EdgeCounts);
@@ -44,13 +44,13 @@ applyExtTspLayout(const std::vector<uint64_t> &NodeSizes,
 /// the better the order is. The score is designed to reflect the locality of
 /// the given order, which is anti-correlated with the number of I-cache misses
 /// in a typical execution of the function.
-double calcExtTspScore(const std::vector<uint64_t> &Order,
+LLVM_FUNC_ABI double calcExtTspScore(const std::vector<uint64_t> &Order,
                        const std::vector<uint64_t> &NodeSizes,
                        const std::vector<uint64_t> &NodeCounts,
                        const std::vector<EdgeCountT> &EdgeCounts);
 
 /// Estimate the "quality" of the current node order in CFG.
-double calcExtTspScore(const std::vector<uint64_t> &NodeSizes,
+LLVM_FUNC_ABI double calcExtTspScore(const std::vector<uint64_t> &NodeSizes,
                        const std::vector<uint64_t> &NodeCounts,
                        const std::vector<EdgeCountT> &EdgeCounts);
 
diff --git a/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h b/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
index 212ae1f87f914b2..2f62472b1dbd21a 100644
--- a/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
@@ -27,19 +27,19 @@ class PostDominatorTree;
 /// Return true if \p I0 and \p I1 are control flow equivalent.
 /// Two instructions are control flow equivalent if their basic blocks are
 /// control flow equivalent.
-bool isControlFlowEquivalent(const Instruction &I0, const Instruction &I1,
+LLVM_FUNC_ABI bool isControlFlowEquivalent(const Instruction &I0, const Instruction &I1,
                              const DominatorTree &DT,
                              const PostDominatorTree &PDT);
 
 /// Return true if \p BB0 and \p BB1 are control flow equivalent.
 /// Two basic blocks are control flow equivalent if when one executes, the other
 /// is guaranteed to execute.
-bool isControlFlowEquivalent(const BasicBlock &BB0, const BasicBlock &BB1,
+LLVM_FUNC_ABI bool isControlFlowEquivalent(const BasicBlock &BB0, const BasicBlock &BB1,
                              const DominatorTree &DT,
                              const PostDominatorTree &PDT);
 
 /// Return true if \p I can be safely moved before \p InsertPoint.
-bool isSafeToMoveBefore(Instruction &I, Instruction &InsertPoint,
+LLVM_FUNC_ABI bool isSafeToMoveBefore(Instruction &I, Instruction &InsertPoint,
                         DominatorTree &DT,
                         const PostDominatorTree *PDT = nullptr,
                         DependenceInfo *DI = nullptr,
@@ -47,21 +47,21 @@ bool isSafeToMoveBefore(Instruction &I, Instruction &InsertPoint,
 
 /// Return true if all instructions (except the terminator) in \p BB can be
 /// safely moved before \p InsertPoint.
-bool isSafeToMoveBefore(BasicBlock &BB, Instruction &InsertPoint,
+LLVM_FUNC_ABI bool isSafeToMoveBefore(BasicBlock &BB, Instruction &InsertPoint,
                         DominatorTree &DT,
                         const PostDominatorTree *PDT = nullptr,
                         DependenceInfo *DI = nullptr);
 
 /// Move instructions, in an order-preserving manner, from \p FromBB to the
 /// beginning of \p ToBB when proven safe.
-void moveInstructionsToTheBeginning(BasicBlock &FromBB, BasicBlock &ToBB,
+LLVM_FUNC_ABI void moveInstructionsToTheBeginning(BasicBlock &FromBB, BasicBlock &ToBB,
                                     DominatorTree &DT,
                                     const PostDominatorTree &PDT,
                                     DependenceInfo &DI);
 
 /// Move instructions, in an order-preserving manner, from \p FromBB to the end
 /// of \p ToBB when proven safe.
-void moveInstructionsToTheEnd(BasicBlock &FromBB, BasicBlock &ToBB,
+LLVM_FUNC_ABI void moveInstructionsToTheEnd(BasicBlock &FromBB, BasicBlock &ToBB,
                               DominatorTree &DT, const PostDominatorTree &PDT,
                               DependenceInfo &DI);
 
@@ -69,13 +69,13 @@ void moveInstructionsToTheEnd(BasicBlock &FromBB, BasicBlock &ToBB,
 /// equivalent but they do not strictly dominate and post-dominate each
 /// other, we determine if \p ThisBlock is reached after \p OtherBlock
 /// in the control flow.
-bool nonStrictlyPostDominate(const BasicBlock *ThisBlock,
+LLVM_FUNC_ABI bool nonStrictlyPostDominate(const BasicBlock *ThisBlock,
                              const BasicBlock *OtherBlock,
                              const DominatorTree *DT,
                              const PostDominatorTree *PDT);
 
 // Check if I0 is reached before I1 in the control flow.
-bool isReachedBefore(const Instruction *I0, const Instruction *I1,
+LLVM_FUNC_ABI bool isReachedBefore(const Instruction *I0, const Instruction *I1,
                      const DominatorTree *DT, const PostDominatorTree *PDT);
 
 } // end namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/CountVisits.h b/llvm/include/llvm/Transforms/Utils/CountVisits.h
index 84926b714fd3528..f61ebce4c399e52 100644
--- a/llvm/include/llvm/Transforms/Utils/CountVisits.h
+++ b/llvm/include/llvm/Transforms/Utils/CountVisits.h
@@ -17,7 +17,7 @@ namespace llvm {
 
 class Function;
 
-struct CountVisitsPass : PassInfoMixin<CountVisitsPass> {
+struct LLVM_CLASS_ABI CountVisitsPass : PassInfoMixin<CountVisitsPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
 
 private:
diff --git a/llvm/include/llvm/Transforms/Utils/CtorUtils.h b/llvm/include/llvm/Transforms/Utils/CtorUtils.h
index d1b9fe9386665a3..0ff292e34bd96b9 100644
--- a/llvm/include/llvm/Transforms/Utils/CtorUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/CtorUtils.h
@@ -23,7 +23,7 @@ class Module;
 
 /// Call "ShouldRemove" for every entry in M's global_ctor list and remove the
 /// entries for which it returns true.  Return true if anything changed.
-bool optimizeGlobalCtorsList(
+LLVM_FUNC_ABI bool optimizeGlobalCtorsList(
     Module &M, function_ref<bool(uint32_t, Function *)> ShouldRemove);
 
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/Debugify.h b/llvm/include/llvm/Transforms/Utils/Debugify.h
index 5a51d1f5c27ac01..855c5c7240d94dc 100644
--- a/llvm/include/llvm/Transforms/Utils/Debugify.h
+++ b/llvm/include/llvm/Transforms/Utils/Debugify.h
@@ -32,7 +32,7 @@ using WeakInstValueMap =
     llvm::MapVector<const llvm::Instruction *, llvm::WeakVH>;
 
 /// Used to track the Debug Info Metadata information.
-struct DebugInfoPerPass {
+struct LLVM_CLASS_ABI DebugInfoPerPass {
   // This maps a function name to its associated DISubprogram.
   DebugFnMap DIFunctions;
   // This maps an instruction and the info about whether it has !dbg attached.
@@ -55,14 +55,14 @@ class DIBuilder;
 /// \param ApplyToMF A call back that will add debug information to the
 ///                  MachineFunction for a Function. If nullptr, then the
 ///                  MachineFunction (if any) will not be modified.
-bool applyDebugifyMetadata(
+LLVM_FUNC_ABI bool applyDebugifyMetadata(
     Module &M, iterator_range<Module::iterator> Functions, StringRef Banner,
     std::function<bool(DIBuilder &, Function &)> ApplyToMF);
 
 /// Strip out all of the metadata and debug info inserted by debugify. If no
 /// llvm.debugify module-level named metadata is present, this is a no-op.
 /// Returns true if any change was made.
-bool stripDebugifyMetadata(Module &M);
+LLVM_FUNC_ABI bool stripDebugifyMetadata(Module &M);
 
 /// Collect original debug information before a pass.
 ///
@@ -71,7 +71,7 @@ bool stripDebugifyMetadata(Module &M);
 /// \param DebugInfoBeforePass DI metadata before a pass.
 /// \param Banner A prefix string to add to debug/error messages.
 /// \param NameOfWrappedPass A name of a pass to add to debug/error messages.
-bool collectDebugInfoMetadata(Module &M,
+LLVM_FUNC_ABI bool collectDebugInfoMetadata(Module &M,
                               iterator_range<Module::iterator> Functions,
                               DebugInfoPerPass &DebugInfoBeforePass,
                               StringRef Banner, StringRef NameOfWrappedPass);
@@ -83,7 +83,7 @@ bool collectDebugInfoMetadata(Module &M,
 /// \param DebugInfoBeforePass DI metadata before a pass.
 /// \param Banner A prefix string to add to debug/error messages.
 /// \param NameOfWrappedPass A name of a pass to add to debug/error messages.
-bool checkDebugInfoMetadata(Module &M,
+LLVM_FUNC_ABI bool checkDebugInfoMetadata(Module &M,
                             iterator_range<Module::iterator> Functions,
                             DebugInfoPerPass &DebugInfoBeforePass,
                             StringRef Banner, StringRef NameOfWrappedPass,
@@ -93,16 +93,16 @@ bool checkDebugInfoMetadata(Module &M,
 /// Used to check whether we track synthetic or original debug info.
 enum class DebugifyMode { NoDebugify, SyntheticDebugInfo, OriginalDebugInfo };
 
-llvm::ModulePass *createDebugifyModulePass(
+LLVM_FUNC_ABI llvm::ModulePass *createDebugifyModulePass(
     enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
     llvm::StringRef NameOfWrappedPass = "",
     DebugInfoPerPass *DebugInfoBeforePass = nullptr);
-llvm::FunctionPass *createDebugifyFunctionPass(
+LLVM_FUNC_ABI llvm::FunctionPass *createDebugifyFunctionPass(
     enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
     llvm::StringRef NameOfWrappedPass = "",
     DebugInfoPerPass *DebugInfoBeforePass = nullptr);
 
-class NewPMDebugifyPass : public llvm::PassInfoMixin<NewPMDebugifyPass> {
+class LLVM_CLASS_ABI NewPMDebugifyPass : public llvm::PassInfoMixin<NewPMDebugifyPass> {
   llvm::StringRef NameOfWrappedPass;
   DebugInfoPerPass *DebugInfoBeforePass = nullptr;
   enum DebugifyMode Mode = DebugifyMode::NoDebugify;
@@ -119,7 +119,7 @@ class NewPMDebugifyPass : public llvm::PassInfoMixin<NewPMDebugifyPass> {
 
 /// Track how much `debugify` information (in the `synthetic` mode only)
 /// has been lost.
-struct DebugifyStatistics {
+struct LLVM_CLASS_ABI DebugifyStatistics {
   /// Number of missing dbg.values.
   unsigned NumDbgValuesMissing = 0;
 
@@ -146,21 +146,21 @@ struct DebugifyStatistics {
 /// Map pass names to a per-pass DebugifyStatistics instance.
 using DebugifyStatsMap = llvm::MapVector<llvm::StringRef, DebugifyStatistics>;
 
-llvm::ModulePass *createCheckDebugifyModulePass(
+LLVM_FUNC_ABI llvm::ModulePass *createCheckDebugifyModulePass(
     bool Strip = false, llvm::StringRef NameOfWrappedPass = "",
     DebugifyStatsMap *StatsMap = nullptr,
     enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
     DebugInfoPerPass *DebugInfoBeforePass = nullptr,
     llvm::StringRef OrigDIVerifyBugsReportFilePath = "");
 
-llvm::FunctionPass *createCheckDebugifyFunctionPass(
+LLVM_FUNC_ABI llvm::FunctionPass *createCheckDebugifyFunctionPass(
     bool Strip = false, llvm::StringRef NameOfWrappedPass = "",
     DebugifyStatsMap *StatsMap = nullptr,
     enum DebugifyMode Mode = DebugifyMode::SyntheticDebugInfo,
     DebugInfoPerPass *DebugInfoBeforePass = nullptr,
     llvm::StringRef OrigDIVerifyBugsReportFilePath = "");
 
-class NewPMCheckDebugifyPass
+class LLVM_CLASS_ABI NewPMCheckDebugifyPass
     : public llvm::PassInfoMixin<NewPMCheckDebugifyPass> {
   llvm::StringRef NameOfWrappedPass;
   llvm::StringRef OrigDIVerifyBugsReportFilePath;
@@ -184,9 +184,9 @@ class NewPMCheckDebugifyPass
 };
 
 namespace llvm {
-void exportDebugifyStats(StringRef Path, const DebugifyStatsMap &Map);
+LLVM_FUNC_ABI void exportDebugifyStats(StringRef Path, const DebugifyStatsMap &Map);
 
-class DebugifyEachInstrumentation {
+class LLVM_CLASS_ABI DebugifyEachInstrumentation {
   llvm::StringRef OrigDIVerifyBugsReportFilePath = "";
   DebugInfoPerPass *DebugInfoBeforePass = nullptr;
   enum DebugifyMode Mode = DebugifyMode::NoDebugify;
@@ -225,7 +225,7 @@ class DebugifyEachInstrumentation {
 /// needed.
 /// NOTE: We support legacy custom pass manager only.
 /// TODO: Add New PM support for custom pass manager.
-class DebugifyCustomPassManager : public legacy::PassManager {
+class LLVM_CLASS_ABI DebugifyCustomPassManager : public legacy::PassManager {
   StringRef OrigDIVerifyBugsReportFilePath;
   DebugifyStatsMap *DIStatsMap = nullptr;
   DebugInfoPerPass *DebugInfoBeforePass = nullptr;
diff --git a/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h b/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h
index fe2775f69cca50f..8ad915601ca1d0d 100644
--- a/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h
+++ b/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 class Function;
 
-struct EntryExitInstrumenterPass
+struct LLVM_CLASS_ABI EntryExitInstrumenterPass
     : public PassInfoMixin<EntryExitInstrumenterPass> {
   EntryExitInstrumenterPass(bool PostInlining) : PostInlining(PostInlining) {}
 
diff --git a/llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h b/llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h
index 4c829dfabe1cd59..8311003945d3152 100644
--- a/llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h
+++ b/llvm/include/llvm/Transforms/Utils/EscapeEnumerator.h
@@ -27,7 +27,7 @@ class DomTreeUpdater;
 /// to finding the existing return and unwind instructions, it also (if
 /// necessary) transforms any call instructions into invokes and sends them to
 /// a landing pad.
-class EscapeEnumerator {
+class LLVM_CLASS_ABI EscapeEnumerator {
   Function &F;
   const char *CleanupBBName;
 
diff --git a/llvm/include/llvm/Transforms/Utils/Evaluator.h b/llvm/include/llvm/Transforms/Utils/Evaluator.h
index d87bdd26d1e1b06..d1a52c9fa32bdf1 100644
--- a/llvm/include/llvm/Transforms/Utils/Evaluator.h
+++ b/llvm/include/llvm/Transforms/Utils/Evaluator.h
@@ -35,7 +35,7 @@ class TargetLibraryInfo;
 /// instruction.  Changes to global variables are stored in a mapping that can
 /// be iterated over after the evaluation is complete.  Once an evaluation call
 /// fails, the evaluation object should not be reused.
-class Evaluator {
+class LLVM_CLASS_ABI Evaluator {
   struct MutableAggregate;
 
   /// The evaluator represents values either as a Constant*, or as a
diff --git a/llvm/include/llvm/Transforms/Utils/FixIrreducible.h b/llvm/include/llvm/Transforms/Utils/FixIrreducible.h
index 0d76879e9f489ef..0c2ec0ec7304dc9 100644
--- a/llvm/include/llvm/Transforms/Utils/FixIrreducible.h
+++ b/llvm/include/llvm/Transforms/Utils/FixIrreducible.h
@@ -13,7 +13,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-struct FixIrreduciblePass : PassInfoMixin<FixIrreduciblePass> {
+struct LLVM_CLASS_ABI FixIrreduciblePass : PassInfoMixin<FixIrreduciblePass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/FunctionComparator.h b/llvm/include/llvm/Transforms/Utils/FunctionComparator.h
index 4239db35230ca4f..1ec092eb0819714 100644
--- a/llvm/include/llvm/Transforms/Utils/FunctionComparator.h
+++ b/llvm/include/llvm/Transforms/Utils/FunctionComparator.h
@@ -52,7 +52,7 @@ class Value;
 /// necessary. Note that if we were guaranteed unique names, we could just
 /// compare those, but this would not work for stripped bitcodes or for those
 /// few symbols without a name.
-class GlobalNumberState {
+class LLVM_CLASS_ABI GlobalNumberState {
   struct Config : ValueMapConfig<GlobalValue *> {
     enum { FollowRAUW = false };
   };
@@ -91,7 +91,7 @@ class GlobalNumberState {
 /// they will generate machine code with the same behaviour. DataLayout is
 /// used if available. The comparator always fails conservatively (erring on the
 /// side of claiming that two functions are different).
-class FunctionComparator {
+class LLVM_CLASS_ABI FunctionComparator {
 public:
   FunctionComparator(const Function *F1, const Function *F2,
                      GlobalNumberState* GN)
diff --git a/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h b/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h
index 53c8a5b22051ce9..0c934348ad292be 100644
--- a/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/FunctionImportUtils.h
@@ -23,7 +23,7 @@ class Module;
 
 /// Class to handle necessary GlobalValue changes required by ThinLTO
 /// function importing, including linkage changes and any necessary renaming.
-class FunctionImportGlobalProcessing {
+class LLVM_CLASS_ABI FunctionImportGlobalProcessing {
   /// The Module which we are exporting or importing functions from.
   Module &M;
 
@@ -126,7 +126,7 @@ class FunctionImportGlobalProcessing {
 
 /// Perform in-place global value handling on the given Module for
 /// exported local functions renamed and promoted for ThinLTO.
-bool renameModuleForThinLTO(
+LLVM_FUNC_ABI bool renameModuleForThinLTO(
     Module &M, const ModuleSummaryIndex &Index,
     bool ClearDSOLocalOnDeclarations,
     SetVector<GlobalValue *> *GlobalsToImport = nullptr);
diff --git a/llvm/include/llvm/Transforms/Utils/GlobalStatus.h b/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
index 6efa07f02cb9c4a..5a25c42b7bd8217 100644
--- a/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
+++ b/llvm/include/llvm/Transforms/Utils/GlobalStatus.h
@@ -23,12 +23,12 @@ class Value;
 /// Note that constants cannot be cyclic, so this test is pretty easy to
 /// implement recursively.
 ///
-bool isSafeToDestroyConstant(const Constant *C);
+LLVM_FUNC_ABI bool isSafeToDestroyConstant(const Constant *C);
 
 /// As we analyze each global, keep track of some information about it.  If we
 /// find out that the address of the global is taken, none of this info will be
 /// accurate.
-struct GlobalStatus {
+struct LLVM_CLASS_ABI GlobalStatus {
   /// True if the global's address is used in a comparison.
   bool IsCompared = false;
 
diff --git a/llvm/include/llvm/Transforms/Utils/GuardUtils.h b/llvm/include/llvm/Transforms/Utils/GuardUtils.h
index c3f49c0271fde0c..92cc0c41643e6d5 100644
--- a/llvm/include/llvm/Transforms/Utils/GuardUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/GuardUtils.h
@@ -28,18 +28,18 @@ class Value;
 /// deoptimize function \p DeoptIntrinsic.  If 'UseWC' is set, preserve the
 /// widenable nature of the guard by lowering to equivelent form.  If not set,
 /// lower to a form without widenable semantics.
-void makeGuardControlFlowExplicit(Function *DeoptIntrinsic, CallInst *Guard,
+LLVM_FUNC_ABI void makeGuardControlFlowExplicit(Function *DeoptIntrinsic, CallInst *Guard,
                                   bool UseWC);
 
 /// Given a branch we know is widenable (defined per Analysis/GuardUtils.h),
 /// widen it such that condition 'NewCond' is also known to hold on the taken
 /// path.  Branch remains widenable after transform.
-void widenWidenableBranch(BranchInst *WidenableBR, Value *NewCond);
+LLVM_FUNC_ABI void widenWidenableBranch(BranchInst *WidenableBR, Value *NewCond);
 
 /// Given a branch we know is widenable (defined per Analysis/GuardUtils.h),
 /// *set* it's condition such that (only) 'Cond' is known to hold on the taken
 /// path and that the branch remains widenable after transform.
-void setWidenableBranchCond(BranchInst *WidenableBR, Value *Cond);
+LLVM_FUNC_ABI void setWidenableBranchCond(BranchInst *WidenableBR, Value *Cond);
 
 } // llvm
 
diff --git a/llvm/include/llvm/Transforms/Utils/HelloWorld.h b/llvm/include/llvm/Transforms/Utils/HelloWorld.h
index f4beb523d0cd277..0198000db50ea18 100644
--- a/llvm/include/llvm/Transforms/Utils/HelloWorld.h
+++ b/llvm/include/llvm/Transforms/Utils/HelloWorld.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class HelloWorldPass : public PassInfoMixin<HelloWorldPass> {
+class LLVM_CLASS_ABI HelloWorldPass : public PassInfoMixin<HelloWorldPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h b/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h
index f2399ef10efb18d..c19ca3000dfba1a 100644
--- a/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h
+++ b/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h
@@ -18,7 +18,7 @@
 
 namespace llvm {
 class Function;
-class InjectTLIMappings : public PassInfoMixin<InjectTLIMappings> {
+class LLVM_CLASS_ABI InjectTLIMappings : public PassInfoMixin<InjectTLIMappings> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/InstructionNamer.h b/llvm/include/llvm/Transforms/Utils/InstructionNamer.h
index e7e92d792017c98..3709d2f6b9c39fe 100644
--- a/llvm/include/llvm/Transforms/Utils/InstructionNamer.h
+++ b/llvm/include/llvm/Transforms/Utils/InstructionNamer.h
@@ -13,7 +13,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-struct InstructionNamerPass : PassInfoMixin<InstructionNamerPass> {
+struct LLVM_CLASS_ABI InstructionNamerPass : PassInfoMixin<InstructionNamerPass> {
   PreservedAnalyses run(Function &, FunctionAnalysisManager &);
 };
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/InstructionWorklist.h b/llvm/include/llvm/Transforms/Utils/InstructionWorklist.h
index c8f20636965e835..1003a791fb7c161 100644
--- a/llvm/include/llvm/Transforms/Utils/InstructionWorklist.h
+++ b/llvm/include/llvm/Transforms/Utils/InstructionWorklist.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 /// InstructionWorklist - This is the worklist management logic for
 /// InstCombine and other simplification passes.
-class InstructionWorklist {
+class LLVM_CLASS_ABI InstructionWorklist {
   SmallVector<Instruction *, 256> Worklist;
   DenseMap<Instruction *, unsigned> WorklistMap;
   /// These instructions will be added in reverse order after the current
diff --git a/llvm/include/llvm/Transforms/Utils/IntegerDivision.h b/llvm/include/llvm/Transforms/Utils/IntegerDivision.h
index aaf0c950d09df40..bcad8554130a7af 100644
--- a/llvm/include/llvm/Transforms/Utils/IntegerDivision.h
+++ b/llvm/include/llvm/Transforms/Utils/IntegerDivision.h
@@ -31,7 +31,7 @@ namespace llvm {
   /// 32bit and 64bit scalar division.
   ///
   /// Replace Rem with generated code.
-  bool expandRemainder(BinaryOperator *Rem);
+  LLVM_FUNC_ABI bool expandRemainder(BinaryOperator *Rem);
 
   /// Generate code to divide two integers, replacing Div with the generated
   /// code. This currently generates code similarly to compiler-rt's
@@ -40,7 +40,7 @@ namespace llvm {
   /// 32bit and 64bit scalar division.
   ///
   /// Replace Div with generated code.
-  bool expandDivision(BinaryOperator* Div);
+  LLVM_FUNC_ABI bool expandDivision(BinaryOperator* Div);
 
   /// Generate code to calculate the remainder of two integers, replacing Rem
   /// with the generated code. Uses ExpandReminder with a 32bit Rem which
@@ -48,26 +48,26 @@ namespace llvm {
   /// 32 bit arithmetic.
   ///
   /// Replace Rem with generated code.
-  bool expandRemainderUpTo32Bits(BinaryOperator *Rem);
+  LLVM_FUNC_ABI bool expandRemainderUpTo32Bits(BinaryOperator *Rem);
 
   /// Generate code to calculate the remainder of two integers, replacing Rem
   /// with the generated code. Uses ExpandReminder with a 64bit Rem.
   ///
   /// Replace Rem with generated code.
-  bool expandRemainderUpTo64Bits(BinaryOperator *Rem);
+  LLVM_FUNC_ABI bool expandRemainderUpTo64Bits(BinaryOperator *Rem);
 
   /// Generate code to divide two integers, replacing Div with the generated
   /// code. Uses ExpandDivision with a 32bit Div which makes it useful for
   /// targets with little or no support for less than 32 bit arithmetic.
   ///
   /// Replace Rem with generated code.
-  bool expandDivisionUpTo32Bits(BinaryOperator *Div);
+  LLVM_FUNC_ABI bool expandDivisionUpTo32Bits(BinaryOperator *Div);
 
   /// Generate code to divide two integers, replacing Div with the generated
   /// code. Uses ExpandDivision with a 64bit Div.
   ///
   /// Replace Rem with generated code.
-  bool expandDivisionUpTo64Bits(BinaryOperator *Div);
+  LLVM_FUNC_ABI bool expandDivisionUpTo64Bits(BinaryOperator *Div);
 
 } // End llvm namespace
 
diff --git a/llvm/include/llvm/Transforms/Utils/LCSSA.h b/llvm/include/llvm/Transforms/Utils/LCSSA.h
index a39e4a38cdf67c8..b4544d704038890 100644
--- a/llvm/include/llvm/Transforms/Utils/LCSSA.h
+++ b/llvm/include/llvm/Transforms/Utils/LCSSA.h
@@ -35,7 +35,7 @@
 namespace llvm {
 
 /// Converts loops into loop-closed SSA form.
-class LCSSAPass : public PassInfoMixin<LCSSAPass> {
+class LLVM_CLASS_ABI LCSSAPass : public PassInfoMixin<LCSSAPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h b/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h
index 960952ce1876562..25db2c1d1e4a9bf 100644
--- a/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h
+++ b/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h
@@ -16,7 +16,7 @@
 
 namespace llvm {
 
-class LibCallsShrinkWrapPass : public PassInfoMixin<LibCallsShrinkWrapPass> {
+class LLVM_CLASS_ABI LibCallsShrinkWrapPass : public PassInfoMixin<LibCallsShrinkWrapPass> {
 public:
   static StringRef name() { return "LibCallsShrinkWrapPass"; }
 
diff --git a/llvm/include/llvm/Transforms/Utils/Local.h b/llvm/include/llvm/Transforms/Utils/Local.h
index b8fa1614eda7d47..488a0b9a54b21b2 100644
--- a/llvm/include/llvm/Transforms/Utils/Local.h
+++ b/llvm/include/llvm/Transforms/Utils/Local.h
@@ -60,7 +60,7 @@ class TargetTransformInfo;
 /// Also calls RecursivelyDeleteTriviallyDeadInstructions() on any branch/switch
 /// conditions and indirectbr addresses this might make dead if
 /// DeleteDeadConditions is true.
-bool ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions = false,
+LLVM_FUNC_ABI bool ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions = false,
                             const TargetLibraryInfo *TLI = nullptr,
                             DomTreeUpdater *DTU = nullptr);
 
@@ -71,13 +71,13 @@ bool ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions = false,
 /// Return true if the result produced by the instruction is not used, and the
 /// instruction will return. Certain side-effecting instructions are also
 /// considered dead if there are no uses of the instruction.
-bool isInstructionTriviallyDead(Instruction *I,
+LLVM_FUNC_ABI bool isInstructionTriviallyDead(Instruction *I,
                                 const TargetLibraryInfo *TLI = nullptr);
 
 /// Return true if the result produced by the instruction would have no side
 /// effects if it was not used. This is equivalent to checking whether
 /// isInstructionTriviallyDead would be true if the use count was 0.
-bool wouldInstructionBeTriviallyDead(Instruction *I,
+LLVM_FUNC_ABI bool wouldInstructionBeTriviallyDead(Instruction *I,
                                      const TargetLibraryInfo *TLI = nullptr);
 
 /// Return true if the result produced by the instruction has no side effects on
@@ -85,13 +85,13 @@ bool wouldInstructionBeTriviallyDead(Instruction *I,
 /// wouldInstructionBeTriviallyDead which is based on the assumption
 /// that the use count will be 0. An example usage of this API is for
 /// identifying instructions that can be sunk down to use(s).
-bool wouldInstructionBeTriviallyDeadOnUnusedPaths(
+LLVM_FUNC_ABI bool wouldInstructionBeTriviallyDeadOnUnusedPaths(
     Instruction *I, const TargetLibraryInfo *TLI = nullptr);
 
 /// If the specified value is a trivially dead instruction, delete it.
 /// If that makes any of its operands trivially dead, delete them too,
 /// recursively. Return true if any instructions were deleted.
-bool RecursivelyDeleteTriviallyDeadInstructions(
+LLVM_FUNC_ABI bool RecursivelyDeleteTriviallyDeadInstructions(
     Value *V, const TargetLibraryInfo *TLI = nullptr,
     MemorySSAUpdater *MSSAU = nullptr,
     std::function<void(Value *)> AboutToDeleteCallback =
@@ -105,7 +105,7 @@ bool RecursivelyDeleteTriviallyDeadInstructions(
 ///
 /// `DeadInsts` will be used as scratch storage for this routine and will be
 /// empty afterward.
-void RecursivelyDeleteTriviallyDeadInstructions(
+LLVM_FUNC_ABI void RecursivelyDeleteTriviallyDeadInstructions(
     SmallVectorImpl<WeakTrackingVH> &DeadInsts,
     const TargetLibraryInfo *TLI = nullptr, MemorySSAUpdater *MSSAU = nullptr,
     std::function<void(Value *)> AboutToDeleteCallback =
@@ -115,7 +115,7 @@ void RecursivelyDeleteTriviallyDeadInstructions(
 /// instructions that are not trivially dead. These will be ignored.
 /// Returns true if any changes were made, i.e. any instructions trivially dead
 /// were found and deleted.
-bool RecursivelyDeleteTriviallyDeadInstructionsPermissive(
+LLVM_FUNC_ABI bool RecursivelyDeleteTriviallyDeadInstructionsPermissive(
     SmallVectorImpl<WeakTrackingVH> &DeadInsts,
     const TargetLibraryInfo *TLI = nullptr, MemorySSAUpdater *MSSAU = nullptr,
     std::function<void(Value *)> AboutToDeleteCallback =
@@ -126,7 +126,7 @@ bool RecursivelyDeleteTriviallyDeadInstructionsPermissive(
 /// by a trivially dead instruction, delete it. If that makes any of its
 /// operands trivially dead, delete them too, recursively. Return true if a
 /// change was made.
-bool RecursivelyDeleteDeadPHINode(PHINode *PN,
+LLVM_FUNC_ABI bool RecursivelyDeleteDeadPHINode(PHINode *PN,
                                   const TargetLibraryInfo *TLI = nullptr,
                                   MemorySSAUpdater *MSSAU = nullptr);
 
@@ -135,14 +135,14 @@ bool RecursivelyDeleteDeadPHINode(PHINode *PN,
 ///
 /// This returns true if it changed the code, note that it can delete
 /// instructions in other blocks as well in this block.
-bool SimplifyInstructionsInBlock(BasicBlock *BB,
+LLVM_FUNC_ABI bool SimplifyInstructionsInBlock(BasicBlock *BB,
                                  const TargetLibraryInfo *TLI = nullptr);
 
 /// Replace all the uses of an SSA value in @llvm.dbg intrinsics with
 /// undef. This is useful for signaling that a variable, e.g. has been
 /// found dead and hence it's unavailable at a given program point.
 /// Returns true if the dbg values have been changed.
-bool replaceDbgUsesWithUndef(Instruction *I);
+LLVM_FUNC_ABI bool replaceDbgUsesWithUndef(Instruction *I);
 
 //===----------------------------------------------------------------------===//
 //  Control Flow Graph Restructuring.
@@ -151,19 +151,19 @@ bool replaceDbgUsesWithUndef(Instruction *I);
 /// BB is a block with one predecessor and its predecessor is known to have one
 /// successor (BB!). Eliminate the edge between them, moving the instructions in
 /// the predecessor into BB. This deletes the predecessor block.
-void MergeBasicBlockIntoOnlyPred(BasicBlock *BB, DomTreeUpdater *DTU = nullptr);
+LLVM_FUNC_ABI void MergeBasicBlockIntoOnlyPred(BasicBlock *BB, DomTreeUpdater *DTU = nullptr);
 
 /// BB is known to contain an unconditional branch, and contains no instructions
 /// other than PHI nodes, potential debug intrinsics and the branch. If
 /// possible, eliminate BB by rewriting all the predecessors to branch to the
 /// successor block and return true. If we can't transform, return false.
-bool TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
+LLVM_FUNC_ABI bool TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB,
                                              DomTreeUpdater *DTU = nullptr);
 
 /// Check for and eliminate duplicate PHI nodes in this block. This doesn't try
 /// to be clever about PHI nodes which differ only in the order of the incoming
 /// values, but instcombine orders them so it usually won't matter.
-bool EliminateDuplicatePHINodes(BasicBlock *BB);
+LLVM_FUNC_ABI bool EliminateDuplicatePHINodes(BasicBlock *BB);
 
 /// This function is used to do simplification of a CFG.  For example, it
 /// adjusts branches to branches to eliminate the extra hop, it eliminates
@@ -171,8 +171,8 @@ bool EliminateDuplicatePHINodes(BasicBlock *BB);
 /// It returns true if a modification was made, possibly deleting the basic
 /// block that was pointed to. LoopHeaders is an optional input parameter
 /// providing the set of loop headers that SimplifyCFG should not eliminate.
-extern cl::opt<bool> RequireAndPreserveDomTree;
-bool simplifyCFG(BasicBlock *BB, const TargetTransformInfo &TTI,
+LLVM_FUNC_ABI extern cl::opt<bool> RequireAndPreserveDomTree;
+LLVM_FUNC_ABI bool simplifyCFG(BasicBlock *BB, const TargetTransformInfo &TTI,
                  DomTreeUpdater *DTU = nullptr,
                  const SimplifyCFGOptions &Options = {},
                  ArrayRef<WeakVH> LoopHeaders = {});
@@ -180,12 +180,12 @@ bool simplifyCFG(BasicBlock *BB, const TargetTransformInfo &TTI,
 /// This function is used to flatten a CFG. For example, it uses parallel-and
 /// and parallel-or mode to collapse if-conditions and merge if-regions with
 /// identical statements.
-bool FlattenCFG(BasicBlock *BB, AAResults *AA = nullptr);
+LLVM_FUNC_ABI bool FlattenCFG(BasicBlock *BB, AAResults *AA = nullptr);
 
 /// If this basic block is ONLY a setcc and a branch, and if a predecessor
 /// branches to us and one of our successors, fold the setcc into the
 /// predecessor and use logical operations to pick the right destination.
-bool FoldBranchToCommonDest(BranchInst *BI, llvm::DomTreeUpdater *DTU = nullptr,
+LLVM_FUNC_ABI bool FoldBranchToCommonDest(BranchInst *BI, llvm::DomTreeUpdater *DTU = nullptr,
                             MemorySSAUpdater *MSSAU = nullptr,
                             const TargetTransformInfo *TTI = nullptr,
                             unsigned BonusInstThreshold = 1);
@@ -195,14 +195,14 @@ bool FoldBranchToCommonDest(BranchInst *BI, llvm::DomTreeUpdater *DTU = nullptr,
 /// This allows the CFG to be changed around without fear of invalidating the
 /// SSA information for the value. It returns the pointer to the alloca inserted
 /// to create a stack slot for X.
-AllocaInst *DemoteRegToStack(Instruction &X,
+LLVM_FUNC_ABI AllocaInst *DemoteRegToStack(Instruction &X,
                              bool VolatileLoads = false,
                              Instruction *AllocaPoint = nullptr);
 
 /// This function takes a virtual register computed by a phi node and replaces
 /// it with a slot in the stack frame, allocated via alloca. The phi node is
 /// deleted and it returns the pointer to the alloca inserted.
-AllocaInst *DemotePHIToStack(PHINode *P, Instruction *AllocaPoint = nullptr);
+LLVM_FUNC_ABI AllocaInst *DemotePHIToStack(PHINode *P, Instruction *AllocaPoint = nullptr);
 
 /// Try to ensure that the alignment of \p V is at least \p PrefAlign bytes. If
 /// the owning object can be modified and has an alignment less than \p
@@ -213,7 +213,7 @@ AllocaInst *DemotePHIToStack(PHINode *P, Instruction *AllocaPoint = nullptr);
 /// so if alignment is important, a more reliable approach is to simply align
 /// all global variables and allocation instructions to their preferred
 /// alignment from the beginning.
-Align getOrEnforceKnownAlignment(Value *V, MaybeAlign PrefAlign,
+LLVM_FUNC_ABI Align getOrEnforceKnownAlignment(Value *V, MaybeAlign PrefAlign,
                                  const DataLayout &DL,
                                  const Instruction *CxtI = nullptr,
                                  AssumptionCache *AC = nullptr,
@@ -231,10 +231,10 @@ inline Align getKnownAlignment(Value *V, const DataLayout &DL,
 /// attributes, debug information, etc. The call is not placed in a block and it
 /// will not have a name. The invoke instruction is not removed, nor are the
 /// uses replaced by the new call.
-CallInst *createCallMatchingInvoke(InvokeInst *II);
+LLVM_FUNC_ABI CallInst *createCallMatchingInvoke(InvokeInst *II);
 
 /// This function converts the specified invoke into a normal call.
-CallInst *changeToCall(InvokeInst *II, DomTreeUpdater *DTU = nullptr);
+LLVM_FUNC_ABI CallInst *changeToCall(InvokeInst *II, DomTreeUpdater *DTU = nullptr);
 
 ///===---------------------------------------------------------------------===//
 ///  Dbg Intrinsic utilities
@@ -242,25 +242,25 @@ CallInst *changeToCall(InvokeInst *II, DomTreeUpdater *DTU = nullptr);
 
 /// Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
 /// that has an associated llvm.dbg.declare intrinsic.
-void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
+LLVM_FUNC_ABI void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
                                      StoreInst *SI, DIBuilder &Builder);
 
 /// Inserts a llvm.dbg.value intrinsic before a load of an alloca'd value
 /// that has an associated llvm.dbg.declare intrinsic.
-void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
+LLVM_FUNC_ABI void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
                                      LoadInst *LI, DIBuilder &Builder);
 
 /// Inserts a llvm.dbg.value intrinsic after a phi that has an associated
 /// llvm.dbg.declare intrinsic.
-void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
+LLVM_FUNC_ABI void ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII,
                                      PHINode *LI, DIBuilder &Builder);
 
 /// Lowers llvm.dbg.declare intrinsics into appropriate set of
 /// llvm.dbg.value intrinsics.
-bool LowerDbgDeclare(Function &F);
+LLVM_FUNC_ABI bool LowerDbgDeclare(Function &F);
 
 /// Propagate dbg.value intrinsics through the newly inserted PHIs.
-void insertDebugValuesForPHIs(BasicBlock *BB,
+LLVM_FUNC_ABI void insertDebugValuesForPHIs(BasicBlock *BB,
                               SmallVectorImpl<PHINode *> &InsertedPHIs);
 
 /// Replaces llvm.dbg.declare instruction when the address it
@@ -268,7 +268,7 @@ void insertDebugValuesForPHIs(BasicBlock *BB,
 /// additional DW_OP_deref is prepended to the expression. If Offset
 /// is non-zero, a constant displacement is added to the expression
 /// (between the optional Deref operations). Offset can be negative.
-bool replaceDbgDeclare(Value *Address, Value *NewAddress, DIBuilder &Builder,
+LLVM_FUNC_ABI bool replaceDbgDeclare(Value *Address, Value *NewAddress, DIBuilder &Builder,
                        uint8_t DIExprFlags, int Offset);
 
 /// Replaces multiple llvm.dbg.value instructions when the alloca it describes
@@ -276,19 +276,19 @@ bool replaceDbgDeclare(Value *Address, Value *NewAddress, DIBuilder &Builder,
 /// is added to the expression (after the mandatory Deref). Offset can be
 /// negative. New llvm.dbg.value instructions are inserted at the locations of
 /// the instructions they replace.
-void replaceDbgValueForAlloca(AllocaInst *AI, Value *NewAllocaAddress,
+LLVM_FUNC_ABI void replaceDbgValueForAlloca(AllocaInst *AI, Value *NewAllocaAddress,
                               DIBuilder &Builder, int Offset = 0);
 
 /// Assuming the instruction \p I is going to be deleted, attempt to salvage
 /// debug users of \p I by writing the effect of \p I in a DIExpression. If it
 /// cannot be salvaged changes its debug uses to undef.
-void salvageDebugInfo(Instruction &I);
+LLVM_FUNC_ABI void salvageDebugInfo(Instruction &I);
 
 
 /// Implementation of salvageDebugInfo, applying only to instructions in
 /// \p Insns, rather than all debug users from findDbgUsers( \p I).
 /// Mark undef if salvaging cannot be completed.
-void salvageDebugInfoForDbgValues(Instruction &I,
+LLVM_FUNC_ABI void salvageDebugInfoForDbgValues(Instruction &I,
                                   ArrayRef<DbgVariableIntrinsic *> Insns);
 
 /// Given an instruction \p I and DIExpression \p DIExpr operating on
@@ -312,7 +312,7 @@ void salvageDebugInfoForDbgValues(Instruction &I,
 ///   Return = %a
 ///   Ops = llvm::dwarf::DW_OP_LLVM_arg0 llvm::dwarf::DW_OP_add
 ///   AdditionalValues = %b
-Value *salvageDebugInfoImpl(Instruction &I, uint64_t CurrentLocOps,
+LLVM_FUNC_ABI Value *salvageDebugInfoImpl(Instruction &I, uint64_t CurrentLocOps,
                             SmallVectorImpl<uint64_t> &Ops,
                             SmallVectorImpl<Value *> &AdditionalValues);
 
@@ -330,7 +330,7 @@ Value *salvageDebugInfoImpl(Instruction &I, uint64_t CurrentLocOps,
 /// If a debug user cannot be preserved without reordering variable updates or
 /// introducing a use-before-def, it is either salvaged (\ref salvageDebugInfo)
 /// or deleted. Returns true if any debug users were updated.
-bool replaceAllDbgUsesWith(Instruction &From, Value &To, Instruction &DomPoint,
+LLVM_FUNC_ABI bool replaceAllDbgUsesWith(Instruction &From, Value &To, Instruction &DomPoint,
                            DominatorTree &DT);
 
 /// Remove all instructions from a basic block other than its terminator
@@ -338,12 +338,12 @@ bool replaceAllDbgUsesWith(Instruction &From, Value &To, Instruction &DomPoint,
 /// is the number of instructions (excluding debug info intrinsics) that have
 /// been removed, and the second element is the number of debug info intrinsics
 /// that have been removed.
-std::pair<unsigned, unsigned>
+LLVM_FUNC_ABI std::pair<unsigned, unsigned>
 removeAllNonTerminatorAndEHPadInstructions(BasicBlock *BB);
 
 /// Insert an unreachable instruction before the specified
 /// instruction, making it and the rest of the code in the block dead.
-unsigned changeToUnreachable(Instruction *I, bool PreserveLCSSA = false,
+LLVM_FUNC_ABI unsigned changeToUnreachable(Instruction *I, bool PreserveLCSSA = false,
                              DomTreeUpdater *DTU = nullptr,
                              MemorySSAUpdater *MSSAU = nullptr);
 
@@ -351,7 +351,7 @@ unsigned changeToUnreachable(Instruction *I, bool PreserveLCSSA = false,
 /// block.  This also splits the basic block where CI is located, because
 /// InvokeInst is a terminator instruction.  Returns the newly split basic
 /// block.
-BasicBlock *changeToInvokeAndSplitBasicBlock(CallInst *CI,
+LLVM_FUNC_ABI BasicBlock *changeToInvokeAndSplitBasicBlock(CallInst *CI,
                                              BasicBlock *UnwindEdge,
                                              DomTreeUpdater *DTU = nullptr);
 
@@ -362,12 +362,12 @@ BasicBlock *changeToInvokeAndSplitBasicBlock(CallInst *CI,
 ///
 /// \param BB  Block whose terminator will be replaced.  Its terminator must
 ///            have an unwind successor.
-Instruction *removeUnwindEdge(BasicBlock *BB, DomTreeUpdater *DTU = nullptr);
+LLVM_FUNC_ABI Instruction *removeUnwindEdge(BasicBlock *BB, DomTreeUpdater *DTU = nullptr);
 
 /// Remove all blocks that can not be reached from the function's entry.
 ///
 /// Returns true if any basic block was removed.
-bool removeUnreachableBlocks(Function &F, DomTreeUpdater *DTU = nullptr,
+LLVM_FUNC_ABI bool removeUnreachableBlocks(Function &F, DomTreeUpdater *DTU = nullptr,
                              MemorySSAUpdater *MSSAU = nullptr);
 
 /// Combine the metadata of two instructions so that K can replace J. Some
@@ -375,7 +375,7 @@ bool removeUnreachableBlocks(Function &F, DomTreeUpdater *DTU = nullptr,
 /// J in the original IR.
 ///
 /// Metadata not listed as known via KnownIDs is removed
-void combineMetadata(Instruction *K, const Instruction *J,
+LLVM_FUNC_ABI void combineMetadata(Instruction *K, const Instruction *J,
                      ArrayRef<unsigned> KnownIDs, bool DoesKMove);
 
 /// Combine the metadata of two instructions so that K can replace J. This
@@ -384,29 +384,29 @@ void combineMetadata(Instruction *K, const Instruction *J,
 /// K cannot be hoisted.
 ///
 /// Unknown metadata is removed.
-void combineMetadataForCSE(Instruction *K, const Instruction *J,
+LLVM_FUNC_ABI void combineMetadataForCSE(Instruction *K, const Instruction *J,
                            bool DoesKMove);
 
 /// Copy the metadata from the source instruction to the destination (the
 /// replacement for the source instruction).
-void copyMetadataForLoad(LoadInst &Dest, const LoadInst &Source);
+LLVM_FUNC_ABI void copyMetadataForLoad(LoadInst &Dest, const LoadInst &Source);
 
 /// Patch the replacement so that it is not more restrictive than the value
 /// being replaced. It assumes that the replacement does not get moved from
 /// its original position.
-void patchReplacementInstruction(Instruction *I, Value *Repl);
+LLVM_FUNC_ABI void patchReplacementInstruction(Instruction *I, Value *Repl);
 
 // Replace each use of 'From' with 'To', if that use does not belong to basic
 // block where 'From' is defined. Returns the number of replacements made.
-unsigned replaceNonLocalUsesWith(Instruction *From, Value *To);
+LLVM_FUNC_ABI unsigned replaceNonLocalUsesWith(Instruction *From, Value *To);
 
 /// Replace each use of 'From' with 'To' if that use is dominated by
 /// the given edge.  Returns the number of replacements made.
-unsigned replaceDominatedUsesWith(Value *From, Value *To, DominatorTree &DT,
+LLVM_FUNC_ABI unsigned replaceDominatedUsesWith(Value *From, Value *To, DominatorTree &DT,
                                   const BasicBlockEdge &Edge);
 /// Replace each use of 'From' with 'To' if that use is dominated by
 /// the end of the given BasicBlock. Returns the number of replacements made.
-unsigned replaceDominatedUsesWith(Value *From, Value *To, DominatorTree &DT,
+LLVM_FUNC_ABI unsigned replaceDominatedUsesWith(Value *From, Value *To, DominatorTree &DT,
                                   const BasicBlock *BB);
 
 /// Return true if this call calls a gc leaf function.
@@ -417,30 +417,30 @@ unsigned replaceDominatedUsesWith(Value *From, Value *To, DominatorTree &DT,
 ///
 /// Most passes can and should ignore this information, and it is only used
 /// during lowering by the GC infrastructure.
-bool callsGCLeafFunction(const CallBase *Call, const TargetLibraryInfo &TLI);
+LLVM_FUNC_ABI bool callsGCLeafFunction(const CallBase *Call, const TargetLibraryInfo &TLI);
 
 /// Copy a nonnull metadata node to a new load instruction.
 ///
 /// This handles mapping it to range metadata if the new load is an integer
 /// load instead of a pointer load.
-void copyNonnullMetadata(const LoadInst &OldLI, MDNode *N, LoadInst &NewLI);
+LLVM_FUNC_ABI void copyNonnullMetadata(const LoadInst &OldLI, MDNode *N, LoadInst &NewLI);
 
 /// Copy a range metadata node to a new load instruction.
 ///
 /// This handles mapping it to nonnull metadata if the new load is a pointer
 /// load instead of an integer load and the range doesn't cover null.
-void copyRangeMetadata(const DataLayout &DL, const LoadInst &OldLI, MDNode *N,
+LLVM_FUNC_ABI void copyRangeMetadata(const DataLayout &DL, const LoadInst &OldLI, MDNode *N,
                        LoadInst &NewLI);
 
 /// Remove the debug intrinsic instructions for the given instruction.
-void dropDebugUsers(Instruction &I);
+LLVM_FUNC_ABI void dropDebugUsers(Instruction &I);
 
 /// Hoist all of the instructions in the \p IfBlock to the dominant block
 /// \p DomBlock, by moving its instructions to the insertion point \p InsertPt.
 ///
 /// The moved instructions receive the insertion point debug location values
 /// (DILocations) and their debug intrinsic instructions are removed.
-void hoistAllInstructionsInto(BasicBlock *DomBlock, Instruction *InsertPt,
+LLVM_FUNC_ABI void hoistAllInstructionsInto(BasicBlock *DomBlock, Instruction *InsertPt,
                               BasicBlock *BB);
 
 //===----------------------------------------------------------------------===//
@@ -458,7 +458,7 @@ void hoistAllInstructionsInto(BasicBlock *DomBlock, Instruction *InsertPt,
 /// to BW / 4 nodes to be searched, so is significantly faster.
 ///
 /// This function returns true on a successful match or false otherwise.
-bool recognizeBSwapOrBitReverseIdiom(
+LLVM_FUNC_ABI bool recognizeBSwapOrBitReverseIdiom(
     Instruction *I, bool MatchBSwaps, bool MatchBitReversals,
     SmallVectorImpl<Instruction *> &InsertedInsts);
 
@@ -470,7 +470,7 @@ bool recognizeBSwapOrBitReverseIdiom(
 /// and mark it with NoBuiltin if so.  To be used by sanitizers that intend
 /// to intercept string functions and want to avoid converting them to target
 /// specific instructions.
-void maybeMarkSanitizerLibraryCallNoBuiltin(CallInst *CI,
+LLVM_FUNC_ABI void maybeMarkSanitizerLibraryCallNoBuiltin(CallInst *CI,
                                             const TargetLibraryInfo *TLI);
 
 //===----------------------------------------------------------------------===//
@@ -479,14 +479,14 @@ void maybeMarkSanitizerLibraryCallNoBuiltin(CallInst *CI,
 
 /// Given an instruction, is it legal to set operand OpIdx to a non-constant
 /// value?
-bool canReplaceOperandWithVariable(const Instruction *I, unsigned OpIdx);
+LLVM_FUNC_ABI bool canReplaceOperandWithVariable(const Instruction *I, unsigned OpIdx);
 
 //===----------------------------------------------------------------------===//
 //  Value helper functions
 //
 
 /// Invert the given true/false value, possibly reusing an existing copy.
-Value *invertCondition(Value *Condition);
+LLVM_FUNC_ABI Value *invertCondition(Value *Condition);
 
 
 //===----------------------------------------------------------------------===//
@@ -495,7 +495,7 @@ Value *invertCondition(Value *Condition);
 
 /// If we can infer one attribute from another on the declaration of a
 /// function, explicitly materialize the maximal set in the IR.
-bool inferAttributesFromOthers(Function &F);
+LLVM_FUNC_ABI bool inferAttributesFromOthers(Function &F);
 
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Transforms/Utils/LoopPeel.h b/llvm/include/llvm/Transforms/Utils/LoopPeel.h
index e1f941c6f47f408..0f38d247a145e14 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopPeel.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopPeel.h
@@ -20,22 +20,22 @@
 
 namespace llvm {
 
-bool canPeel(const Loop *L);
+LLVM_FUNC_ABI bool canPeel(const Loop *L);
 
 /// VMap is the value-map that maps instructions from the original loop to
 /// instructions in the last peeled-off iteration.
-bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
+LLVM_FUNC_ABI bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
               DominatorTree &DT, AssumptionCache *AC, bool PreserveLCSSA,
               ValueToValueMapTy &VMap);
 
-TargetTransformInfo::PeelingPreferences
+LLVM_FUNC_ABI TargetTransformInfo::PeelingPreferences
 gatherPeelingPreferences(Loop *L, ScalarEvolution &SE,
                          const TargetTransformInfo &TTI,
                          std::optional<bool> UserAllowPeeling,
                          std::optional<bool> UserAllowProfileBasedPeeling,
                          bool UnrollingSpecficValues = false);
 
-void computePeelCount(Loop *L, unsigned LoopSize,
+LLVM_FUNC_ABI void computePeelCount(Loop *L, unsigned LoopSize,
                       TargetTransformInfo::PeelingPreferences &PP,
                       unsigned TripCount, DominatorTree &DT,
                       ScalarEvolution &SE, AssumptionCache *AC = nullptr,
diff --git a/llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h b/llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h
index 79f38fad4a9f0d7..78c6926b3eb850a 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopRotationUtils.h
@@ -32,7 +32,7 @@ class TargetTransformInfo;
 /// header. If the loop header's size exceeds the threshold, the loop rotation
 /// will give up. The flag IsUtilMode controls the heuristic used in the
 /// LoopRotation. If it is true, the profitability heuristic will be ignored.
-bool LoopRotation(Loop *L, LoopInfo *LI, const TargetTransformInfo *TTI,
+LLVM_FUNC_ABI bool LoopRotation(Loop *L, LoopInfo *LI, const TargetTransformInfo *TTI,
                   AssumptionCache *AC, DominatorTree *DT, ScalarEvolution *SE,
                   MemorySSAUpdater *MSSAU, const SimplifyQuery &SQ,
                   bool RotationOnly, unsigned Threshold, bool IsUtilMode,
diff --git a/llvm/include/llvm/Transforms/Utils/LoopSimplify.h b/llvm/include/llvm/Transforms/Utils/LoopSimplify.h
index bbdc4c24191ec4b..43887b13342c1d2 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopSimplify.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopSimplify.h
@@ -51,7 +51,7 @@ class MemorySSAUpdater;
 class ScalarEvolution;
 
 /// This pass is responsible for loop canonicalization.
-class LoopSimplifyPass : public PassInfoMixin<LoopSimplifyPass> {
+class LLVM_CLASS_ABI LoopSimplifyPass : public PassInfoMixin<LoopSimplifyPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
@@ -62,7 +62,7 @@ class LoopSimplifyPass : public PassInfoMixin<LoopSimplifyPass> {
 /// it into a simplified loop nest with preheaders and single backedges. It will
 /// update \c DominatorTree, \c LoopInfo, \c ScalarEvolution and \c MemorySSA
 /// analyses if they're non-null, and LCSSA if \c PreserveLCSSA is true.
-bool simplifyLoop(Loop *L, DominatorTree *DT, LoopInfo *LI, ScalarEvolution *SE,
+LLVM_FUNC_ABI bool simplifyLoop(Loop *L, DominatorTree *DT, LoopInfo *LI, ScalarEvolution *SE,
                   AssumptionCache *AC, MemorySSAUpdater *MSSAU,
                   bool PreserveLCSSA);
 
diff --git a/llvm/include/llvm/Transforms/Utils/LoopUtils.h b/llvm/include/llvm/Transforms/Utils/LoopUtils.h
index 004c994e4574f45..68c72c22e68bba4 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopUtils.h
@@ -51,7 +51,7 @@ typedef std::pair<const RuntimeCheckingPtrGroup *,
 template <typename T, unsigned N> class SmallSetVector;
 template <typename T, unsigned N> class SmallPriorityWorklist;
 
-BasicBlock *InsertPreheaderForLoop(Loop *L, DominatorTree *DT, LoopInfo *LI,
+LLVM_FUNC_ABI BasicBlock *InsertPreheaderForLoop(Loop *L, DominatorTree *DT, LoopInfo *LI,
                                    MemorySSAUpdater *MSSAU, bool PreserveLCSSA);
 
 /// Ensure that all exit blocks of the loop are dedicated exits.
@@ -59,7 +59,7 @@ BasicBlock *InsertPreheaderForLoop(Loop *L, DominatorTree *DT, LoopInfo *LI,
 /// For any loop exit block with non-loop predecessors, we split the loop
 /// predecessors to use a dedicated loop exit block. We update the dominator
 /// tree and loop info if provided, and will preserve LCSSA if requested.
-bool formDedicatedExitBlocks(Loop *L, DominatorTree *DT, LoopInfo *LI,
+LLVM_FUNC_ABI bool formDedicatedExitBlocks(Loop *L, DominatorTree *DT, LoopInfo *LI,
                              MemorySSAUpdater *MSSAU, bool PreserveLCSSA);
 
 /// Ensures LCSSA form for every instruction from the Worklist in the scope of
@@ -80,7 +80,7 @@ bool formDedicatedExitBlocks(Loop *L, DominatorTree *DT, LoopInfo *LI,
 ///
 /// If \p InsertedPHIs is not nullptr, inserted phis will be added to this
 /// vector.
-bool formLCSSAForInstructions(
+LLVM_FUNC_ABI bool formLCSSAForInstructions(
     SmallVectorImpl<Instruction *> &Worklist, const DominatorTree &DT,
     const LoopInfo &LI, ScalarEvolution *SE,
     SmallVectorImpl<PHINode *> *PHIsToRemove = nullptr,
@@ -98,7 +98,7 @@ bool formLCSSAForInstructions(
 /// If ScalarEvolution is passed in, it will be preserved.
 ///
 /// Returns true if any modifications are made to the loop.
-bool formLCSSA(Loop &L, const DominatorTree &DT, const LoopInfo *LI,
+LLVM_FUNC_ABI bool formLCSSA(Loop &L, const DominatorTree &DT, const LoopInfo *LI,
                ScalarEvolution *SE);
 
 /// Put a loop nest into LCSSA form.
@@ -110,13 +110,13 @@ bool formLCSSA(Loop &L, const DominatorTree &DT, const LoopInfo *LI,
 /// If ScalarEvolution is passed in, it will be preserved.
 ///
 /// Returns true if any modifications are made to the loop.
-bool formLCSSARecursively(Loop &L, const DominatorTree &DT, const LoopInfo *LI,
+LLVM_FUNC_ABI bool formLCSSARecursively(Loop &L, const DominatorTree &DT, const LoopInfo *LI,
                           ScalarEvolution *SE);
 
 /// Flags controlling how much is checked when sinking or hoisting
 /// instructions.  The number of memory access in the loop (and whether there
 /// are too many) is determined in the constructors when using MemorySSA.
-class SinkAndHoistLICMFlags {
+class LLVM_CLASS_ABI SinkAndHoistLICMFlags {
 public:
   // Explicitly set limits.
   SinkAndHoistLICMFlags(unsigned LicmMssaOptCap,
@@ -149,7 +149,7 @@ class SinkAndHoistLICMFlags {
 /// arguments. Diagnostics is emitted via \p ORE. It returns changed status.
 /// \p CurLoop is a loop to do sinking on. \p OutermostLoop is used only when
 /// this function is called by \p sinkRegionForLoopNest.
-bool sinkRegion(DomTreeNode *, AAResults *, LoopInfo *, DominatorTree *,
+LLVM_FUNC_ABI bool sinkRegion(DomTreeNode *, AAResults *, LoopInfo *, DominatorTree *,
                 TargetLibraryInfo *, TargetTransformInfo *, Loop *CurLoop,
                 MemorySSAUpdater &, ICFLoopSafetyInfo *,
                 SinkAndHoistLICMFlags &, OptimizationRemarkEmitter *,
@@ -157,7 +157,7 @@ bool sinkRegion(DomTreeNode *, AAResults *, LoopInfo *, DominatorTree *,
 
 /// Call sinkRegion on loops contained within the specified loop
 /// in order from innermost to outermost.
-bool sinkRegionForLoopNest(DomTreeNode *, AAResults *, LoopInfo *,
+LLVM_FUNC_ABI bool sinkRegionForLoopNest(DomTreeNode *, AAResults *, LoopInfo *,
                            DominatorTree *, TargetLibraryInfo *,
                            TargetTransformInfo *, Loop *, MemorySSAUpdater &,
                            ICFLoopSafetyInfo *, SinkAndHoistLICMFlags &,
@@ -173,7 +173,7 @@ bool sinkRegionForLoopNest(DomTreeNode *, AAResults *, LoopInfo *,
 /// Diagnostics is emitted via \p ORE. It returns changed status.
 /// \p AllowSpeculation is whether values should be hoisted even if they are not
 /// guaranteed to execute in the loop, but are safe to speculatively execute.
-bool hoistRegion(DomTreeNode *, AAResults *, LoopInfo *, DominatorTree *,
+LLVM_FUNC_ABI bool hoistRegion(DomTreeNode *, AAResults *, LoopInfo *, DominatorTree *,
                  AssumptionCache *, TargetLibraryInfo *, Loop *,
                  MemorySSAUpdater &, ScalarEvolution *, ICFLoopSafetyInfo *,
                  SinkAndHoistLICMFlags &, OptimizationRemarkEmitter *, bool,
@@ -182,7 +182,7 @@ bool hoistRegion(DomTreeNode *, AAResults *, LoopInfo *, DominatorTree *,
 /// Return true if the induction variable \p IV in a Loop whose latch is
 /// \p LatchBlock would become dead if the exit test \p Cond were removed.
 /// Conservatively returns false if analysis is insufficient.
-bool isAlmostDeadIV(PHINode *IV, BasicBlock *LatchBlock, Value *Cond);
+LLVM_FUNC_ABI bool isAlmostDeadIV(PHINode *IV, BasicBlock *LatchBlock, Value *Cond);
 
 /// This function deletes dead loops. The caller of this function needs to
 /// guarantee that the loop is infact dead.
@@ -195,13 +195,13 @@ bool isAlmostDeadIV(PHINode *IV, BasicBlock *LatchBlock, Value *Cond);
 /// and \p MSSA if pointers to those are provided.
 /// It also updates the loop PM if an updater struct is provided.
 
-void deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
+LLVM_FUNC_ABI void deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
                     LoopInfo *LI, MemorySSA *MSSA = nullptr);
 
 /// Remove the backedge of the specified loop.  Handles loop nests and general
 /// loop structures subject to the precondition that the loop has no parent
 /// loop and has a single latch block.  Preserves all listed analyses.
-void breakLoopBackedge(Loop *L, DominatorTree &DT, ScalarEvolution &SE,
+LLVM_FUNC_ABI void breakLoopBackedge(Loop *L, DominatorTree &DT, ScalarEvolution &SE,
                        LoopInfo &LI, MemorySSA *MSSA);
 
 /// Try to promote memory values to scalars by sinking stores out of
@@ -214,7 +214,7 @@ void breakLoopBackedge(Loop *L, DominatorTree &DT, ScalarEvolution &SE,
 /// Diagnostics is emitted via \p ORE. It returns changed status.
 /// \p AllowSpeculation is whether values should be hoisted even if they are not
 /// guaranteed to execute in the loop, but are safe to speculatively execute.
-bool promoteLoopAccessesToScalars(
+LLVM_FUNC_ABI bool promoteLoopAccessesToScalars(
     const SmallSetVector<Value *, 8> &, SmallVectorImpl<BasicBlock *> &,
     SmallVectorImpl<Instruction *> &, SmallVectorImpl<MemoryAccess *> &,
     PredIteratorCache &, LoopInfo *, DominatorTree *, AssumptionCache *AC,
@@ -224,17 +224,17 @@ bool promoteLoopAccessesToScalars(
 
 /// Does a BFS from a given node to all of its children inside a given loop.
 /// The returned vector of nodes includes the starting point.
-SmallVector<DomTreeNode *, 16> collectChildrenInLoop(DomTreeNode *N,
+LLVM_FUNC_ABI SmallVector<DomTreeNode *, 16> collectChildrenInLoop(DomTreeNode *N,
                                                      const Loop *CurLoop);
 
 /// Returns the instructions that use values defined in the loop.
-SmallVector<Instruction *, 8> findDefsUsedOutsideOfLoop(Loop *L);
+LLVM_FUNC_ABI SmallVector<Instruction *, 8> findDefsUsedOutsideOfLoop(Loop *L);
 
 /// Find a combination of metadata ("llvm.loop.vectorize.width" and
 /// "llvm.loop.vectorize.scalable.enable") for a loop and use it to construct a
 /// ElementCount. If the metadata "llvm.loop.vectorize.width" cannot be found
 /// then std::nullopt is returned.
-std::optional<ElementCount>
+LLVM_FUNC_ABI std::optional<ElementCount>
 getOptionalElementCountLoopAttribute(const Loop *TheLoop);
 
 /// Create a new loop identifier for a loop created from a loop transformation.
@@ -261,16 +261,16 @@ getOptionalElementCountLoopAttribute(const Loop *TheLoop);
 ///         @p OrigLoopID: The original identifier can be reused.
 ///         nullptr      : The new loop has no attributes.
 ///         MDNode*      : A new unique loop identifier.
-std::optional<MDNode *>
+LLVM_FUNC_ABI std::optional<MDNode *>
 makeFollowupLoopID(MDNode *OrigLoopID, ArrayRef<StringRef> FollowupAttrs,
                    const char *InheritOptionsAttrsPrefix = "",
                    bool AlwaysNew = false);
 
 /// Look for the loop attribute that disables all transformation heuristic.
-bool hasDisableAllTransformsHint(const Loop *L);
+LLVM_FUNC_ABI bool hasDisableAllTransformsHint(const Loop *L);
 
 /// Look for the loop attribute that disables the LICM transformation heuristics.
-bool hasDisableLICMTransformsHint(const Loop *L);
+LLVM_FUNC_ABI bool hasDisableLICMTransformsHint(const Loop *L);
 
 /// The mode sets how eager a transformation should be applied.
 enum TransformationMode {
@@ -301,17 +301,17 @@ enum TransformationMode {
 
 /// @{
 /// Get the mode for LLVM's supported loop transformations.
-TransformationMode hasUnrollTransformation(const Loop *L);
-TransformationMode hasUnrollAndJamTransformation(const Loop *L);
-TransformationMode hasVectorizeTransformation(const Loop *L);
-TransformationMode hasDistributeTransformation(const Loop *L);
-TransformationMode hasLICMVersioningTransformation(const Loop *L);
+LLVM_FUNC_ABI TransformationMode hasUnrollTransformation(const Loop *L);
+LLVM_FUNC_ABI TransformationMode hasUnrollAndJamTransformation(const Loop *L);
+LLVM_FUNC_ABI TransformationMode hasVectorizeTransformation(const Loop *L);
+LLVM_FUNC_ABI TransformationMode hasDistributeTransformation(const Loop *L);
+LLVM_FUNC_ABI TransformationMode hasLICMVersioningTransformation(const Loop *L);
 /// @}
 
 /// Set input string into loop metadata by keeping other values intact.
 /// If the string is already in loop metadata update value if it is
 /// different.
-void addStringMetadataToLoop(Loop *TheLoop, const char *MDString,
+LLVM_FUNC_ABI void addStringMetadataToLoop(Loop *TheLoop, const char *MDString,
                              unsigned V = 0);
 
 /// Returns a loop's estimated trip count based on branch weight metadata.
@@ -319,7 +319,7 @@ void addStringMetadataToLoop(Loop *TheLoop, const char *MDString,
 /// initialized with weight of loop's latch leading to the exit.
 /// Returns 0 when the count is estimated to be 0, or std::nullopt when a
 /// meaningful estimate can not be made.
-std::optional<unsigned>
+LLVM_FUNC_ABI std::optional<unsigned>
 getLoopEstimatedTripCount(Loop *L,
                           unsigned *EstimatedLoopInvocationWeight = nullptr);
 
@@ -328,20 +328,20 @@ getLoopEstimatedTripCount(Loop *L,
 /// through latch. Returns true if metadata is successfully updated, false
 /// otherwise. Note that loop must have a latch block which controls loop exit
 /// in order to succeed.
-bool setLoopEstimatedTripCount(Loop *L, unsigned EstimatedTripCount,
+LLVM_FUNC_ABI bool setLoopEstimatedTripCount(Loop *L, unsigned EstimatedTripCount,
                                unsigned EstimatedLoopInvocationWeight);
 
 /// Check inner loop (L) backedge count is known to be invariant on all
 /// iterations of its outer loop. If the loop has no parent, this is trivially
 /// true.
-bool hasIterationCountInvariantInParent(Loop *L, ScalarEvolution &SE);
+LLVM_FUNC_ABI bool hasIterationCountInvariantInParent(Loop *L, ScalarEvolution &SE);
 
 /// Helper to consistently add the set of standard passes to a loop pass's \c
 /// AnalysisUsage.
 ///
 /// All loop passes should call this as part of implementing their \c
 /// getAnalysisUsage.
-void getLoopAnalysisUsage(AnalysisUsage &AU);
+LLVM_FUNC_ABI void getLoopAnalysisUsage(AnalysisUsage &AU);
 
 /// Returns true if is legal to hoist or sink this instruction disregarding the
 /// possible introduction of faults.  Reasoning about potential faulting
@@ -352,17 +352,17 @@ void getLoopAnalysisUsage(AnalysisUsage &AU);
 /// to assess the legality of duplicating atomic loads.  Generally, this is
 /// true when moving out of loop and not true when moving into loops.
 /// If \p ORE is set use it to emit optimization remarks.
-bool canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
+LLVM_FUNC_ABI bool canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
                         Loop *CurLoop, MemorySSAUpdater &MSSAU,
                         bool TargetExecutesOncePerLoop,
                         SinkAndHoistLICMFlags &LICMFlags,
                         OptimizationRemarkEmitter *ORE = nullptr);
 
 /// Returns the min/max intrinsic used when expanding a min/max reduction.
-Intrinsic::ID getMinMaxReductionIntrinsicOp(RecurKind RK);
+LLVM_FUNC_ABI Intrinsic::ID getMinMaxReductionIntrinsicOp(RecurKind RK);
 
 /// Returns the comparison predicate used when expanding a min/max reduction.
-CmpInst::Predicate getMinMaxReductionPredicate(RecurKind RK);
+LLVM_FUNC_ABI CmpInst::Predicate getMinMaxReductionPredicate(RecurKind RK);
 
 /// See RecurrenceDescriptor::isSelectCmpPattern for a description of the
 /// pattern we are trying to match. In this pattern we are only ever selecting
@@ -370,21 +370,21 @@ CmpInst::Predicate getMinMaxReductionPredicate(RecurKind RK);
 /// value. This function uses \p LoopExitInst to determine 2), which we then use
 /// to select between \p Left and \p Right. Any lane value in \p Left that
 /// matches 2) will be merged into \p Right.
-Value *createSelectCmpOp(IRBuilderBase &Builder, Value *StartVal, RecurKind RK,
+LLVM_FUNC_ABI Value *createSelectCmpOp(IRBuilderBase &Builder, Value *StartVal, RecurKind RK,
                          Value *Left, Value *Right);
 
 /// Returns a Min/Max operation corresponding to MinMaxRecurrenceKind.
 /// The Builder's fast-math-flags must be set to propagate the expected values.
-Value *createMinMaxOp(IRBuilderBase &Builder, RecurKind RK, Value *Left,
+LLVM_FUNC_ABI Value *createMinMaxOp(IRBuilderBase &Builder, RecurKind RK, Value *Left,
                       Value *Right);
 
 /// Generates an ordered vector reduction using extracts to reduce the value.
-Value *getOrderedReduction(IRBuilderBase &Builder, Value *Acc, Value *Src,
+LLVM_FUNC_ABI Value *getOrderedReduction(IRBuilderBase &Builder, Value *Acc, Value *Src,
                            unsigned Op, RecurKind MinMaxKind = RecurKind::None);
 
 /// Generates a vector reduction using shufflevectors to reduce the value.
 /// Fast-math-flags are propagated using the IRBuilder's setting.
-Value *getShuffleReduction(IRBuilderBase &Builder, Value *Src, unsigned Op,
+LLVM_FUNC_ABI Value *getShuffleReduction(IRBuilderBase &Builder, Value *Src, unsigned Op,
                            RecurKind MinMaxKind = RecurKind::None);
 
 /// Create a target reduction of the given vector. The reduction operation
@@ -393,14 +393,14 @@ Value *getShuffleReduction(IRBuilderBase &Builder, Value *Src, unsigned Op,
 /// The target is queried to determine if intrinsics or shuffle sequences are
 /// required to implement the reduction.
 /// Fast-math-flags are propagated using the IRBuilder's setting.
-Value *createSimpleTargetReduction(IRBuilderBase &B,
+LLVM_FUNC_ABI Value *createSimpleTargetReduction(IRBuilderBase &B,
                                    const TargetTransformInfo *TTI, Value *Src,
                                    RecurKind RdxKind);
 
 /// Create a target reduction of the given vector \p Src for a reduction of the
 /// kind RecurKind::SelectICmp or RecurKind::SelectFCmp. The reduction operation
 /// is described by \p Desc.
-Value *createSelectCmpTargetReduction(IRBuilderBase &B,
+LLVM_FUNC_ABI Value *createSelectCmpTargetReduction(IRBuilderBase &B,
                                       const TargetTransformInfo *TTI,
                                       Value *Src,
                                       const RecurrenceDescriptor &Desc,
@@ -410,13 +410,13 @@ Value *createSelectCmpTargetReduction(IRBuilderBase &B,
 /// The target is queried to determine if intrinsics or shuffle sequences are
 /// required to implement the reduction.
 /// Fast-math-flags are propagated using the RecurrenceDescriptor.
-Value *createTargetReduction(IRBuilderBase &B, const TargetTransformInfo *TTI,
+LLVM_FUNC_ABI Value *createTargetReduction(IRBuilderBase &B, const TargetTransformInfo *TTI,
                              const RecurrenceDescriptor &Desc, Value *Src,
                              PHINode *OrigPhi = nullptr);
 
 /// Create an ordered reduction intrinsic using the given recurrence
 /// descriptor \p Desc.
-Value *createOrderedReduction(IRBuilderBase &B,
+LLVM_FUNC_ABI Value *createOrderedReduction(IRBuilderBase &B,
                               const RecurrenceDescriptor &Desc, Value *Src,
                               Value *Start);
 
@@ -426,32 +426,32 @@ Value *createOrderedReduction(IRBuilderBase &B,
 /// when intersecting.
 /// Flag set: NSW, NUW (if IncludeWrapFlags is true), exact, and all of
 /// fast-math.
-void propagateIRFlags(Value *I, ArrayRef<Value *> VL, Value *OpValue = nullptr,
+LLVM_FUNC_ABI void propagateIRFlags(Value *I, ArrayRef<Value *> VL, Value *OpValue = nullptr,
                       bool IncludeWrapFlags = true);
 
 /// Returns true if we can prove that \p S is defined and always negative in
 /// loop \p L.
-bool isKnownNegativeInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE);
+LLVM_FUNC_ABI bool isKnownNegativeInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE);
 
 /// Returns true if we can prove that \p S is defined and always non-negative in
 /// loop \p L.
-bool isKnownNonNegativeInLoop(const SCEV *S, const Loop *L,
+LLVM_FUNC_ABI bool isKnownNonNegativeInLoop(const SCEV *S, const Loop *L,
                               ScalarEvolution &SE);
 /// Returns true if we can prove that \p S is defined and always positive in
 /// loop \p L.
-bool isKnownPositiveInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE);
+LLVM_FUNC_ABI bool isKnownPositiveInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE);
 
 /// Returns true if we can prove that \p S is defined and always non-positive in
 /// loop \p L.
-bool isKnownNonPositiveInLoop(const SCEV *S, const Loop *L,
+LLVM_FUNC_ABI bool isKnownNonPositiveInLoop(const SCEV *S, const Loop *L,
                               ScalarEvolution &SE);
 
 /// Returns true if \p S is defined and never is equal to signed/unsigned max.
-bool cannotBeMaxInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE,
+LLVM_FUNC_ABI bool cannotBeMaxInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE,
                        bool Signed);
 
 /// Returns true if \p S is defined and never is equal to signed/unsigned min.
-bool cannotBeMinInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE,
+LLVM_FUNC_ABI bool cannotBeMinInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE,
                        bool Signed);
 
 enum ReplaceExitVal {
@@ -467,7 +467,7 @@ enum ReplaceExitVal {
 /// outside of the loop that use the final values of the current expressions.
 /// Return the number of loop exit values that have been replaced, and the
 /// corresponding phi node will be added to DeadInsts.
-int rewriteLoopExitValues(Loop *L, LoopInfo *LI, TargetLibraryInfo *TLI,
+LLVM_FUNC_ABI int rewriteLoopExitValues(Loop *L, LoopInfo *LI, TargetLibraryInfo *TLI,
                           ScalarEvolution *SE, const TargetTransformInfo *TTI,
                           SCEVExpander &Rewriter, DominatorTree *DT,
                           ReplaceExitVal ReplaceExitValue,
@@ -487,7 +487,7 @@ int rewriteLoopExitValues(Loop *L, LoopInfo *LI, TargetLibraryInfo *TLI,
 ///
 /// This utility may be useful for such optimizations as unroller and
 /// vectorizer as it's typical transformation for them.
-void setProfileInfoAfterUnrolling(Loop *OrigLoop, Loop *UnrolledLoop,
+LLVM_FUNC_ABI void setProfileInfoAfterUnrolling(Loop *OrigLoop, Loop *UnrolledLoop,
                                   Loop *RemainderLoop, uint64_t UF);
 
 /// Utility that implements appending of loops onto a worklist given a range.
@@ -513,26 +513,26 @@ void appendReversedLoopsToWorklist(RangeT &&,
 /// loop nest into the next. Calls appendReversedLoopsToWorklist with the
 /// already reversed loops in LI.
 /// FIXME: Consider changing the order in LoopInfo.
-void appendLoopsToWorklist(LoopInfo &, SmallPriorityWorklist<Loop *, 4> &);
+LLVM_FUNC_ABI void appendLoopsToWorklist(LoopInfo &, SmallPriorityWorklist<Loop *, 4> &);
 
 /// Recursively clone the specified loop and all of its children,
 /// mapping the blocks with the specified map.
-Loop *cloneLoop(Loop *L, Loop *PL, ValueToValueMapTy &VM,
+LLVM_FUNC_ABI Loop *cloneLoop(Loop *L, Loop *PL, ValueToValueMapTy &VM,
                 LoopInfo *LI, LPPassManager *LPM);
 
 /// Add code that checks at runtime if the accessed arrays in \p PointerChecks
 /// overlap. Returns the final comparator value or NULL if no check is needed.
-Value *
+LLVM_FUNC_ABI Value *
 addRuntimeChecks(Instruction *Loc, Loop *TheLoop,
                  const SmallVectorImpl<RuntimePointerCheck> &PointerChecks,
                  SCEVExpander &Expander);
 
-Value *addDiffRuntimeChecks(
+LLVM_FUNC_ABI Value *addDiffRuntimeChecks(
     Instruction *Loc, ArrayRef<PointerDiffInfo> Checks, SCEVExpander &Expander,
     function_ref<Value *(IRBuilderBase &, unsigned)> GetVF, unsigned IC);
 
 /// Struct to hold information about a partially invariant condition.
-struct IVConditionInfo {
+struct LLVM_CLASS_ABI IVConditionInfo {
   /// Instructions that need to be duplicated and checked for the unswitching
   /// condition.
   SmallVector<Instruction *> InstToDuplicate;
@@ -560,7 +560,7 @@ struct IVConditionInfo {
 /// If the branch condition of the header is partially invariant, return a pair
 /// containing the instructions to duplicate and a boolean Constant to update
 /// the condition in the loops created for the true or false successors.
-std::optional<IVConditionInfo> hasPartialIVCondition(const Loop &L,
+LLVM_FUNC_ABI std::optional<IVConditionInfo> hasPartialIVCondition(const Loop &L,
                                                      unsigned MSSAThreshold,
                                                      const MemorySSA &MSSA,
                                                      AAResults &AA);
diff --git a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
index 8c4ec94a481f600..ac4f6e7f2e3fbb9 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
@@ -39,7 +39,7 @@ template <typename T> class ArrayRef;
 ///
 /// It currently only supports single-exit loops and assumes that the loop
 /// already has a preheader.
-class LoopVersioning {
+class LLVM_CLASS_ABI LoopVersioning {
 public:
   /// Expects LoopAccessInfo, Loop, LoopInfo, DominatorTree as input.
   /// It uses runtime check provided by the user. If \p UseLAIChecks is true,
@@ -148,7 +148,7 @@ class LoopVersioning {
 /// Expose LoopVersioning as a pass.  Currently this is only used for
 /// unit-testing.  It adds all memchecks necessary to remove all may-aliasing
 /// array accesses from the loop.
-class LoopVersioningPass : public PassInfoMixin<LoopVersioningPass> {
+class LLVM_CLASS_ABI LoopVersioningPass : public PassInfoMixin<LoopVersioningPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/LowerAtomic.h b/llvm/include/llvm/Transforms/Utils/LowerAtomic.h
index 04c0bb8ed4afc1a..957147559318d33 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerAtomic.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerAtomic.h
@@ -22,16 +22,16 @@ namespace llvm {
 class IRBuilderBase;
 
 /// Convert the given Cmpxchg into primitive load and compare.
-bool lowerAtomicCmpXchgInst(AtomicCmpXchgInst *CXI);
+LLVM_FUNC_ABI bool lowerAtomicCmpXchgInst(AtomicCmpXchgInst *CXI);
 
 /// Convert the given RMWI into primitive load and stores,
 /// assuming that doing so is legal. Return true if the lowering
 /// succeeds.
-bool lowerAtomicRMWInst(AtomicRMWInst *RMWI);
+LLVM_FUNC_ABI bool lowerAtomicRMWInst(AtomicRMWInst *RMWI);
 
 /// Emit IR to implement the given atomicrmw operation on values in registers,
 /// returning the new value.
-Value *buildAtomicRMWValue(AtomicRMWInst::BinOp Op, IRBuilderBase &Builder,
+LLVM_FUNC_ABI Value *buildAtomicRMWValue(AtomicRMWInst::BinOp Op, IRBuilderBase &Builder,
                            Value *Loaded, Value *Val);
 }
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h b/llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h
index dc340b24e4b83f5..b783eb6722f24ee 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h
@@ -19,7 +19,7 @@
 
 namespace llvm {
 
-class LowerGlobalDtorsPass : public PassInfoMixin<LowerGlobalDtorsPass> {
+class LLVM_CLASS_ABI LowerGlobalDtorsPass : public PassInfoMixin<LowerGlobalDtorsPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/LowerIFunc.h b/llvm/include/llvm/Transforms/Utils/LowerIFunc.h
index f9438a99377b089..ecd0bdb0ba5b6a7 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerIFunc.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerIFunc.h
@@ -17,7 +17,7 @@ namespace llvm {
 /// Pass to replace calls to ifuncs with indirect calls. This could be used to
 /// support ifunc on systems where the program loader does not natively support
 /// it. Constant initializer uses of ifuncs are not handled.
-class LowerIFuncPass : public PassInfoMixin<LowerIFuncPass> {
+class LLVM_CLASS_ABI LowerIFuncPass : public PassInfoMixin<LowerIFuncPass> {
 public:
   LowerIFuncPass() = default;
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerInvoke.h b/llvm/include/llvm/Transforms/Utils/LowerInvoke.h
index 8a577ca7b625108..b4dc9fea6231bd1 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerInvoke.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerInvoke.h
@@ -20,7 +20,7 @@
 
 namespace llvm {
 
-class LowerInvokePass : public PassInfoMixin<LowerInvokePass> {
+class LLVM_CLASS_ABI LowerInvokePass : public PassInfoMixin<LowerInvokePass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h b/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h
index 94653e3201d4fe9..82fb553505c0edb 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerMemIntrinsics.h
@@ -33,7 +33,7 @@ struct Align;
 
 /// Emit a loop implementing the semantics of llvm.memcpy where the size is not
 /// a compile-time constant. Loop will be insterted at \p InsertBefore.
-void createMemCpyLoopUnknownSize(
+LLVM_FUNC_ABI void createMemCpyLoopUnknownSize(
     Instruction *InsertBefore, Value *SrcAddr, Value *DstAddr, Value *CopyLen,
     Align SrcAlign, Align DestAlign, bool SrcIsVolatile, bool DstIsVolatile,
     bool CanOverlap, const TargetTransformInfo &TTI,
@@ -41,25 +41,25 @@ void createMemCpyLoopUnknownSize(
 
 /// Emit a loop implementing the semantics of an llvm.memcpy whose size is a
 /// compile time constant. Loop is inserted at \p InsertBefore.
-void createMemCpyLoopKnownSize(
+LLVM_FUNC_ABI void createMemCpyLoopKnownSize(
     Instruction *InsertBefore, Value *SrcAddr, Value *DstAddr,
     ConstantInt *CopyLen, Align SrcAlign, Align DestAlign, bool SrcIsVolatile,
     bool DstIsVolatile, bool CanOverlap, const TargetTransformInfo &TTI,
     std::optional<uint32_t> AtomicCpySize = std::nullopt);
 
 /// Expand \p MemCpy as a loop. \p MemCpy is not deleted.
-void expandMemCpyAsLoop(MemCpyInst *MemCpy, const TargetTransformInfo &TTI,
+LLVM_FUNC_ABI void expandMemCpyAsLoop(MemCpyInst *MemCpy, const TargetTransformInfo &TTI,
                         ScalarEvolution *SE = nullptr);
 
 /// Expand \p MemMove as a loop. \p MemMove is not deleted. Returns true if the
 /// memmove was lowered.
-bool expandMemMoveAsLoop(MemMoveInst *MemMove, const TargetTransformInfo &TTI);
+LLVM_FUNC_ABI bool expandMemMoveAsLoop(MemMoveInst *MemMove, const TargetTransformInfo &TTI);
 
 /// Expand \p MemSet as a loop. \p MemSet is not deleted.
-void expandMemSetAsLoop(MemSetInst *MemSet);
+LLVM_FUNC_ABI void expandMemSetAsLoop(MemSetInst *MemSet);
 
 /// Expand \p AtomicMemCpy as a loop. \p AtomicMemCpy is not deleted.
-void expandAtomicMemCpyAsLoop(AtomicMemCpyInst *AtomicMemCpy,
+LLVM_FUNC_ABI void expandAtomicMemCpyAsLoop(AtomicMemCpyInst *AtomicMemCpy,
                               const TargetTransformInfo &TTI,
                               ScalarEvolution *SE);
 
diff --git a/llvm/include/llvm/Transforms/Utils/LowerSwitch.h b/llvm/include/llvm/Transforms/Utils/LowerSwitch.h
index bdc8a9dbbedb63f..e2162bf55ebca33 100644
--- a/llvm/include/llvm/Transforms/Utils/LowerSwitch.h
+++ b/llvm/include/llvm/Transforms/Utils/LowerSwitch.h
@@ -19,7 +19,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-struct LowerSwitchPass : public PassInfoMixin<LowerSwitchPass> {
+struct LLVM_CLASS_ABI LowerSwitchPass : public PassInfoMixin<LowerSwitchPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/MatrixUtils.h b/llvm/include/llvm/Transforms/Utils/MatrixUtils.h
index 751d30a74ee96b2..043e63a2498abe7 100644
--- a/llvm/include/llvm/Transforms/Utils/MatrixUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/MatrixUtils.h
@@ -29,7 +29,7 @@ class IRBuilderBase;
 ///   for ColumnLoop.Index = 0..NumColumns
 ///     for RowLoop.Index = 0..NumRows
 ///       for KLoop.Index = 0..NumInner
-struct TileInfo {
+struct LLVM_CLASS_ABI TileInfo {
   /// Number of rows of the matrix.
   unsigned NumRows;
 
diff --git a/llvm/include/llvm/Transforms/Utils/Mem2Reg.h b/llvm/include/llvm/Transforms/Utils/Mem2Reg.h
index 005aeb3213c3ad8..2389e101ed7a366 100644
--- a/llvm/include/llvm/Transforms/Utils/Mem2Reg.h
+++ b/llvm/include/llvm/Transforms/Utils/Mem2Reg.h
@@ -21,7 +21,7 @@ namespace llvm {
 
 class Function;
 
-class PromotePass : public PassInfoMixin<PromotePass> {
+class LLVM_CLASS_ABI PromotePass : public PassInfoMixin<PromotePass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h b/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
index bf40230ef4a7193..5fb200c58d0384c 100644
--- a/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
+++ b/llvm/include/llvm/Transforms/Utils/MemoryOpRemark.h
@@ -33,7 +33,7 @@ class StoreInst;
 
 // FIXME: Once we get to more remarks like this one, we need to re-evaluate how
 // much of this logic should actually go into the remark emitter.
-struct MemoryOpRemark {
+struct LLVM_CLASS_ABI MemoryOpRemark {
   OptimizationRemarkEmitter &ORE;
   StringRef RemarkPass;
   const DataLayout &DL;
@@ -95,7 +95,7 @@ struct MemoryOpRemark {
 };
 
 /// Special case for -ftrivial-auto-var-init remarks.
-struct AutoInitRemark : public MemoryOpRemark {
+struct LLVM_CLASS_ABI AutoInitRemark : public MemoryOpRemark {
   AutoInitRemark(OptimizationRemarkEmitter &ORE, StringRef RemarkPass,
                  const DataLayout &DL, const TargetLibraryInfo &TLI)
       : MemoryOpRemark(ORE, RemarkPass, DL, TLI) {}
diff --git a/llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h b/llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h
index 183679d18f9a647..714f56a85e6cc57 100644
--- a/llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h
+++ b/llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h
@@ -35,34 +35,34 @@ namespace memtag {
 // Returns whether Ends covered all possible exits. If they did not,
 // the caller should remove Ends to ensure that work done at the other
 // exits does not happen outside of the lifetime.
-bool forAllReachableExits(const DominatorTree &DT, const PostDominatorTree &PDT,
+LLVM_FUNC_ABI bool forAllReachableExits(const DominatorTree &DT, const PostDominatorTree &PDT,
                           const LoopInfo &LI, const Instruction *Start,
                           const SmallVectorImpl<IntrinsicInst *> &Ends,
                           const SmallVectorImpl<Instruction *> &RetVec,
                           llvm::function_ref<void(Instruction *)> Callback);
 
-bool isStandardLifetime(const SmallVectorImpl<IntrinsicInst *> &LifetimeStart,
+LLVM_FUNC_ABI bool isStandardLifetime(const SmallVectorImpl<IntrinsicInst *> &LifetimeStart,
                         const SmallVectorImpl<IntrinsicInst *> &LifetimeEnd,
                         const DominatorTree *DT, const LoopInfo *LI,
                         size_t MaxLifetimes);
 
-Instruction *getUntagLocationIfFunctionExit(Instruction &Inst);
+LLVM_FUNC_ABI Instruction *getUntagLocationIfFunctionExit(Instruction &Inst);
 
-struct AllocaInfo {
+struct LLVM_CLASS_ABI AllocaInfo {
   AllocaInst *AI;
   SmallVector<IntrinsicInst *, 2> LifetimeStart;
   SmallVector<IntrinsicInst *, 2> LifetimeEnd;
   SmallVector<DbgVariableIntrinsic *, 2> DbgVariableIntrinsics;
 };
 
-struct StackInfo {
+struct LLVM_CLASS_ABI StackInfo {
   MapVector<AllocaInst *, AllocaInfo> AllocasToInstrument;
   SmallVector<Instruction *, 4> UnrecognizedLifetimes;
   SmallVector<Instruction *, 8> RetVec;
   bool CallsReturnTwice = false;
 };
 
-class StackInfoBuilder {
+class LLVM_CLASS_ABI StackInfoBuilder {
 public:
   StackInfoBuilder(const StackSafetyGlobalInfo *SSI) : SSI(SSI) {}
 
@@ -75,8 +75,8 @@ class StackInfoBuilder {
   const StackSafetyGlobalInfo *SSI;
 };
 
-uint64_t getAllocaSizeInBytes(const AllocaInst &AI);
-void alignAndPadAlloca(memtag::AllocaInfo &Info, llvm::Align Align);
+LLVM_FUNC_ABI uint64_t getAllocaSizeInBytes(const AllocaInst &AI);
+LLVM_FUNC_ABI void alignAndPadAlloca(memtag::AllocaInfo &Info, llvm::Align Align);
 
 } // namespace memtag
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/MetaRenamer.h b/llvm/include/llvm/Transforms/Utils/MetaRenamer.h
index 3dc8fb22a4d2448..3d13c9d371bddf3 100644
--- a/llvm/include/llvm/Transforms/Utils/MetaRenamer.h
+++ b/llvm/include/llvm/Transforms/Utils/MetaRenamer.h
@@ -19,7 +19,7 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-struct MetaRenamerPass : PassInfoMixin<MetaRenamerPass> {
+struct LLVM_CLASS_ABI MetaRenamerPass : PassInfoMixin<MetaRenamerPass> {
   PreservedAnalyses run(Module &, ModuleAnalysisManager &);
 };
 } // namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/MisExpect.h b/llvm/include/llvm/Transforms/Utils/MisExpect.h
index 77107c7771efc4b..097cafa34ee7a74 100644
--- a/llvm/include/llvm/Transforms/Utils/MisExpect.h
+++ b/llvm/include/llvm/Transforms/Utils/MisExpect.h
@@ -35,7 +35,7 @@ namespace misexpect {
 ///
 /// \param I The Instruction being checked
 /// \param RealWeights A vector of profile weights for each target block
-void checkBackendInstrumentation(Instruction &I,
+LLVM_FUNC_ABI void checkBackendInstrumentation(Instruction &I,
                                  const llvm::ArrayRef<uint32_t> RealWeights);
 
 /// checkFrontendInstrumentation - compares PGO counters to the thresholds used
@@ -49,7 +49,7 @@ void checkBackendInstrumentation(Instruction &I,
 /// \param I The Instruction being checked
 /// \param ExpectedWeights A vector of the expected weights for each target
 /// block, this determines the threshold values used when emiting diagnostics
-void checkFrontendInstrumentation(Instruction &I,
+LLVM_FUNC_ABI void checkFrontendInstrumentation(Instruction &I,
                                   const ArrayRef<uint32_t> ExpectedWeights);
 
 /// veryifyMisExpect - compares RealWeights to the thresholds used
@@ -59,7 +59,7 @@ void checkFrontendInstrumentation(Instruction &I,
 /// \param I The Instruction being checked
 /// \param RealWeights A vector of profile weights from the profile data
 /// \param ExpectedWeights A vector of the weights attatch by llvm.expect
-void verifyMisExpect(Instruction &I, ArrayRef<uint32_t> RealWeights,
+LLVM_FUNC_ABI void verifyMisExpect(Instruction &I, ArrayRef<uint32_t> RealWeights,
                      const ArrayRef<uint32_t> ExpectedWeights);
 
 /// checkExpectAnnotations - compares PGO counters to the thresholds used
@@ -73,7 +73,7 @@ void verifyMisExpect(Instruction &I, ArrayRef<uint32_t> RealWeights,
 /// \param I The Instruction being checked
 /// \param ExistingWeights A vector of profile weights for each target block
 /// \param IsFrontend A boolean describing if this is Frontend instrumentation
-void checkExpectAnnotations(Instruction &I,
+LLVM_FUNC_ABI void checkExpectAnnotations(Instruction &I,
                             const ArrayRef<uint32_t> ExistingWeights,
                             bool IsFrontend);
 
diff --git a/llvm/include/llvm/Transforms/Utils/ModuleUtils.h b/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
index 2a83eefde31e829..a6c12e3bd3f6dc1 100644
--- a/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
@@ -38,30 +38,30 @@ class Type;
 /// This wraps the function in the appropriate structure and stores it along
 /// side other global constructors. For details see
 /// https://llvm.org/docs/LangRef.html#the-llvm-global-ctors-global-variable
-void appendToGlobalCtors(Module &M, Function *F, int Priority,
+LLVM_FUNC_ABI void appendToGlobalCtors(Module &M, Function *F, int Priority,
                          Constant *Data = nullptr);
 
 /// Same as appendToGlobalCtors(), but for global dtors.
-void appendToGlobalDtors(Module &M, Function *F, int Priority,
+LLVM_FUNC_ABI void appendToGlobalDtors(Module &M, Function *F, int Priority,
                          Constant *Data = nullptr);
 
 /// Sets the KCFI type for the function. Used for compiler-generated functions
 /// that are indirectly called in instrumented code.
-void setKCFIType(Module &M, Function &F, StringRef MangledType);
+LLVM_FUNC_ABI void setKCFIType(Module &M, Function &F, StringRef MangledType);
 
-FunctionCallee declareSanitizerInitFunction(Module &M, StringRef InitName,
+LLVM_FUNC_ABI FunctionCallee declareSanitizerInitFunction(Module &M, StringRef InitName,
                                             ArrayRef<Type *> InitArgTypes,
                                             bool Weak = false);
 
 /// Creates sanitizer constructor function.
 /// \return Returns pointer to constructor.
-Function *createSanitizerCtor(Module &M, StringRef CtorName);
+LLVM_FUNC_ABI Function *createSanitizerCtor(Module &M, StringRef CtorName);
 
 /// Creates sanitizer constructor function, and calls sanitizer's init
 /// function from it.
 /// \return Returns pair of pointers to constructor, and init functions
 /// respectively.
-std::pair<Function *, FunctionCallee> createSanitizerCtorAndInitFunctions(
+LLVM_FUNC_ABI std::pair<Function *, FunctionCallee> createSanitizerCtorAndInitFunctions(
     Module &M, StringRef CtorName, StringRef InitName,
     ArrayRef<Type *> InitArgTypes, ArrayRef<Value *> InitArgs,
     StringRef VersionCheckName = StringRef(), bool Weak = false);
@@ -73,7 +73,7 @@ std::pair<Function *, FunctionCallee> createSanitizerCtorAndInitFunctions(
 ///
 /// \return Returns pair of pointers to constructor, and init functions
 /// respectively.
-std::pair<Function *, FunctionCallee> getOrCreateSanitizerCtorAndInitFunctions(
+LLVM_FUNC_ABI std::pair<Function *, FunctionCallee> getOrCreateSanitizerCtorAndInitFunctions(
     Module &M, StringRef CtorName, StringRef InitName,
     ArrayRef<Type *> InitArgTypes, ArrayRef<Value *> InitArgs,
     function_ref<void(Function *, FunctionCallee)> FunctionsCreatedCallback,
@@ -81,18 +81,18 @@ std::pair<Function *, FunctionCallee> getOrCreateSanitizerCtorAndInitFunctions(
 
 /// Rename all the anon globals in the module using a hash computed from
 /// the list of public globals in the module.
-bool nameUnamedGlobals(Module &M);
+LLVM_FUNC_ABI bool nameUnamedGlobals(Module &M);
 
 /// Adds global values to the llvm.used list.
-void appendToUsed(Module &M, ArrayRef<GlobalValue *> Values);
+LLVM_FUNC_ABI void appendToUsed(Module &M, ArrayRef<GlobalValue *> Values);
 
 /// Adds global values to the llvm.compiler.used list.
-void appendToCompilerUsed(Module &M, ArrayRef<GlobalValue *> Values);
+LLVM_FUNC_ABI void appendToCompilerUsed(Module &M, ArrayRef<GlobalValue *> Values);
 
 /// Removes global values from the llvm.used and llvm.compiler.used arrays. \p
 /// ShouldRemove should return true for any initializer field that should not be
 /// included in the replacement global.
-void removeFromUsedLists(Module &M,
+LLVM_FUNC_ABI void removeFromUsedLists(Module &M,
                          function_ref<bool(Constant *)> ShouldRemove);
 
 /// Filter out potentially dead comdat functions where other entries keep the
@@ -108,7 +108,7 @@ void removeFromUsedLists(Module &M,
 /// After this routine finishes, the only remaining `Function`s in \p
 /// DeadComdatFunctions are those where every member of the comdat is listed
 /// and thus removing them is safe (provided *all* are removed).
-void filterDeadComdatFunctions(
+LLVM_FUNC_ABI void filterDeadComdatFunctions(
     SmallVectorImpl<Function *> &DeadComdatFunctions);
 
 /// Produce a unique identifier for this module by taking the MD5 sum of
@@ -121,12 +121,12 @@ void filterDeadComdatFunctions(
 /// If the module has no strong external symbols (such a module may still have a
 /// semantic effect if it performs global initialization), we cannot produce a
 /// unique identifier for this module, so we return the empty string.
-std::string getUniqueModuleId(Module *M);
+LLVM_FUNC_ABI std::string getUniqueModuleId(Module *M);
 
 /// Embed the memory buffer \p Buf into the module \p M as a global using the
 /// specified section name. Also provide a metadata entry to identify it in the
 /// module using the same section name.
-void embedBufferInModule(Module &M, MemoryBufferRef Buf, StringRef SectionName,
+LLVM_FUNC_ABI void embedBufferInModule(Module &M, MemoryBufferRef Buf, StringRef SectionName,
                          Align Alignment = Align(1));
 
 /// Lower all calls to ifuncs by replacing uses with indirect calls loaded out
@@ -141,14 +141,14 @@ void embedBufferInModule(Module &M, MemoryBufferRef Buf, StringRef SectionName,
 ///
 /// The processed ifuncs without remaining users will be removed from the
 /// module.
-bool lowerGlobalIFuncUsersAsGlobalCtor(
+LLVM_FUNC_ABI bool lowerGlobalIFuncUsersAsGlobalCtor(
     Module &M, ArrayRef<GlobalIFunc *> IFuncsToLower = {});
 
 class CallInst;
 namespace VFABI {
 /// Overwrite the Vector Function ABI variants attribute with the names provide
 /// in \p VariantMappings.
-void setVectorVariantNames(CallInst *CI, ArrayRef<std::string> VariantMappings);
+LLVM_FUNC_ABI void setVectorVariantNames(CallInst *CI, ArrayRef<std::string> VariantMappings);
 } // End VFABI namespace
 } // End llvm namespace
 
diff --git a/llvm/include/llvm/Transforms/Utils/MoveAutoInit.h b/llvm/include/llvm/Transforms/Utils/MoveAutoInit.h
index 86cc076ef2f1cb9..a5e2b31d603e456 100644
--- a/llvm/include/llvm/Transforms/Utils/MoveAutoInit.h
+++ b/llvm/include/llvm/Transforms/Utils/MoveAutoInit.h
@@ -21,7 +21,7 @@
 
 namespace llvm {
 
-class MoveAutoInitPass : public PassInfoMixin<MoveAutoInitPass> {
+class LLVM_CLASS_ABI MoveAutoInitPass : public PassInfoMixin<MoveAutoInitPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h b/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
index ef56312ec6b5a0e..87e0b2b68950bdd 100644
--- a/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
+++ b/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h
@@ -20,7 +20,7 @@
 namespace llvm {
 
 /// Simple pass that provides a name to every anonymous globals.
-class NameAnonGlobalPass : public PassInfoMixin<NameAnonGlobalPass> {
+class LLVM_CLASS_ABI NameAnonGlobalPass : public PassInfoMixin<NameAnonGlobalPass> {
 public:
   NameAnonGlobalPass() = default;
 
diff --git a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
index ec473f03d8ce92c..6b58f8fb38e4c21 100644
--- a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
+++ b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h
@@ -73,14 +73,14 @@ enum PredicateType { PT_Branch, PT_Assume, PT_Switch };
 
 /// Constraint for a predicate of the form "cmp Pred Op, OtherOp", where Op
 /// is the value the constraint applies to (the ssa.copy result).
-struct PredicateConstraint {
+struct LLVM_CLASS_ABI PredicateConstraint {
   CmpInst::Predicate Predicate;
   Value *OtherOp;
 };
 
 // Base class for all predicate information we provide.
 // All of our predicate information has at least a comparison.
-class PredicateBase : public ilist_node<PredicateBase> {
+class LLVM_CLASS_ABI PredicateBase : public ilist_node<PredicateBase> {
 public:
   PredicateType Type;
   // The original operand before we renamed it.
@@ -114,7 +114,7 @@ class PredicateBase : public ilist_node<PredicateBase> {
 // Provides predicate information for assumes.  Since assumes are always true,
 // we simply provide the assume instruction, so you can tell your relative
 // position to it.
-class PredicateAssume : public PredicateBase {
+class LLVM_CLASS_ABI PredicateAssume : public PredicateBase {
 public:
   IntrinsicInst *AssumeInst;
   PredicateAssume(Value *Op, IntrinsicInst *AssumeInst, Value *Condition)
@@ -128,7 +128,7 @@ class PredicateAssume : public PredicateBase {
 // Mixin class for edge predicates.  The FROM block is the block where the
 // predicate originates, and the TO block is the block where the predicate is
 // valid.
-class PredicateWithEdge : public PredicateBase {
+class LLVM_CLASS_ABI PredicateWithEdge : public PredicateBase {
 public:
   BasicBlock *From;
   BasicBlock *To;
@@ -144,7 +144,7 @@ class PredicateWithEdge : public PredicateBase {
 };
 
 // Provides predicate information for branches.
-class PredicateBranch : public PredicateWithEdge {
+class LLVM_CLASS_ABI PredicateBranch : public PredicateWithEdge {
 public:
   // If true, SplitBB is the true successor, otherwise it's the false successor.
   bool TrueEdge;
@@ -158,7 +158,7 @@ class PredicateBranch : public PredicateWithEdge {
   }
 };
 
-class PredicateSwitch : public PredicateWithEdge {
+class LLVM_CLASS_ABI PredicateSwitch : public PredicateWithEdge {
 public:
   Value *CaseValue;
   // This is the switch instruction.
@@ -176,7 +176,7 @@ class PredicateSwitch : public PredicateWithEdge {
 
 /// Encapsulates PredicateInfo, including all data associated with memory
 /// accesses.
-class PredicateInfo {
+class LLVM_CLASS_ABI PredicateInfo {
 public:
   PredicateInfo(Function &, DominatorTree &, AssumptionCache &);
   ~PredicateInfo();
@@ -213,7 +213,7 @@ class PredicateInfo {
 // This pass does eager building and then printing of PredicateInfo. It is used
 // by
 // the tests to be able to build, dump, and verify PredicateInfo.
-class PredicateInfoPrinterLegacyPass : public FunctionPass {
+class LLVM_CLASS_ABI PredicateInfoPrinterLegacyPass : public FunctionPass {
 public:
   PredicateInfoPrinterLegacyPass();
 
@@ -223,7 +223,7 @@ class PredicateInfoPrinterLegacyPass : public FunctionPass {
 };
 
 /// Printer pass for \c PredicateInfo.
-class PredicateInfoPrinterPass
+class LLVM_CLASS_ABI PredicateInfoPrinterPass
     : public PassInfoMixin<PredicateInfoPrinterPass> {
   raw_ostream &OS;
 
@@ -233,7 +233,7 @@ class PredicateInfoPrinterPass
 };
 
 /// Verifier pass for \c PredicateInfo.
-struct PredicateInfoVerifierPass : PassInfoMixin<PredicateInfoVerifierPass> {
+struct LLVM_CLASS_ABI PredicateInfoVerifierPass : PassInfoMixin<PredicateInfoVerifierPass> {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
diff --git a/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h b/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h
index f9bf610d0ed1a9a..ca225c6e9fae5cf 100644
--- a/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h
+++ b/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h
@@ -29,7 +29,7 @@ class AssumptionCache;
 /// (transitively) using this alloca. This also enforces that there is only
 /// ever one layer of bitcasts or GEPs between the alloca and the lifetime
 /// markers.
-bool isAllocaPromotable(const AllocaInst *AI);
+LLVM_FUNC_ABI bool isAllocaPromotable(const AllocaInst *AI);
 
 /// Promote the specified list of alloca instructions into scalar
 /// registers, inserting PHI nodes as appropriate.
@@ -38,7 +38,7 @@ bool isAllocaPromotable(const AllocaInst *AI);
 /// does not modify the CFG of the function at all.  All allocas must be from
 /// the same function.
 ///
-void PromoteMemToReg(ArrayRef<AllocaInst *> Allocas, DominatorTree &DT,
+LLVM_FUNC_ABI void PromoteMemToReg(ArrayRef<AllocaInst *> Allocas, DominatorTree &DT,
                      AssumptionCache *AC = nullptr);
 
 } // End llvm namespace
diff --git a/llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h b/llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h
index c4377c42bd5c723..8618d2b81af313e 100644
--- a/llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h
+++ b/llvm/include/llvm/Transforms/Utils/RelLookupTableConverter.h
@@ -59,7 +59,7 @@ namespace llvm {
 class Module;
 
 // Pass that converts lookup tables to relative lookup tables.
-class RelLookupTableConverterPass
+class LLVM_CLASS_ABI RelLookupTableConverterPass
     : public PassInfoMixin<RelLookupTableConverterPass> {
 public:
   RelLookupTableConverterPass() = default;
diff --git a/llvm/include/llvm/Transforms/Utils/SCCPSolver.h b/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
index 7c907e117ec6111..963c600ab518273 100644
--- a/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
+++ b/llvm/include/llvm/Transforms/Utils/SCCPSolver.h
@@ -41,7 +41,7 @@ class Value;
 class ValueLatticeElement;
 
 /// Helper struct shared between Function Specialization and SCCP Solver.
-struct ArgInfo {
+struct LLVM_CLASS_ABI ArgInfo {
   Argument *Formal; // The Formal argument being analysed.
   Constant *Actual; // A corresponding actual constant argument.
 
@@ -65,7 +65,7 @@ class SCCPInstVisitor;
 /// SCCPSolver - This interface class is a general purpose solver for Sparse
 /// Conditional Constant Propagation (SCCP).
 ///
-class SCCPSolver {
+class LLVM_CLASS_ABI SCCPSolver {
   std::unique_ptr<SCCPInstVisitor> Visitor;
 
 public:
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdater.h b/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
index 6c62d4fed4808af..dda52c97d6cd3e8 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdater.h
@@ -37,7 +37,7 @@ class DbgValueInst;
 /// This is used when code duplication or another unstructured
 /// transformation wants to rewrite a set of uses of one value with uses of a
 /// set of values.
-class SSAUpdater {
+class LLVM_CLASS_ABI SSAUpdater {
   friend class SSAUpdaterTraits<SSAUpdater>;
 
 private:
@@ -145,7 +145,7 @@ class SSAUpdater {
 ///
 /// Clients of this class are expected to subclass this and implement the
 /// virtual methods.
-class LoadAndStorePromoter {
+class LLVM_CLASS_ABI LoadAndStorePromoter {
 protected:
   SSAUpdater &SSA;
 
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h b/llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h
index 5cf569a84431ebe..86d949c1c95331d 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdaterBulk.h
@@ -37,7 +37,7 @@ class DominatorTree;
 /// used for book-keeping. That helps to share some common computations between
 /// updates of different uses (which is not the case when traditional SSAUpdater
 /// is used).
-class SSAUpdaterBulk {
+class LLVM_CLASS_ABI SSAUpdaterBulk {
   struct RewriteInfo {
     DenseMap<BasicBlock *, Value *> Defines;
     SmallVector<Use *, 4> Uses;
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h b/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
index 8af392eeb7b9bad..91543e6451bc884 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
@@ -28,7 +28,7 @@ namespace llvm {
 template<typename T> class SSAUpdaterTraits;
 
 template<typename UpdaterT>
-class SSAUpdaterImpl {
+class LLVM_CLASS_ABI SSAUpdaterImpl {
 private:
   UpdaterT *Updater;
 
diff --git a/llvm/include/llvm/Transforms/Utils/SampleProfileInference.h b/llvm/include/llvm/Transforms/Utils/SampleProfileInference.h
index 3245b8f226570ee..212a5982d092711 100644
--- a/llvm/include/llvm/Transforms/Utils/SampleProfileInference.h
+++ b/llvm/include/llvm/Transforms/Utils/SampleProfileInference.h
@@ -24,7 +24,7 @@ namespace llvm {
 struct FlowJump;
 
 /// A wrapper of a binary basic block.
-struct FlowBlock {
+struct LLVM_CLASS_ABI FlowBlock {
   uint64_t Index;
   uint64_t Weight{0};
   bool HasUnknownWeight{true};
@@ -41,7 +41,7 @@ struct FlowBlock {
 };
 
 /// A wrapper of a jump between two basic blocks.
-struct FlowJump {
+struct LLVM_CLASS_ABI FlowJump {
   uint64_t Source;
   uint64_t Target;
   uint64_t Weight{0};
@@ -51,7 +51,7 @@ struct FlowJump {
 };
 
 /// A wrapper of binary function with basic blocks and jumps.
-struct FlowFunction {
+struct LLVM_CLASS_ABI FlowFunction {
   /// Basic blocks in the function.
   std::vector<FlowBlock> Blocks;
   /// Jumps between the basic blocks.
@@ -63,7 +63,7 @@ struct FlowFunction {
 /// Various thresholds and options controlling the behavior of the profile
 /// inference algorithm. Default values are tuned for several large-scale
 /// applications, and can be modified via corresponding command-line flags.
-struct ProfiParams {
+struct LLVM_CLASS_ABI ProfiParams {
   /// Evenly distribute flow when there are multiple equally likely options.
   bool EvenFlowDistribution{false};
 
@@ -113,11 +113,11 @@ struct ProfiParams {
   const int64_t CostUnlikely = ((int64_t)1) << 30;
 };
 
-void applyFlowInference(const ProfiParams &Params, FlowFunction &Func);
-void applyFlowInference(FlowFunction &Func);
+LLVM_FUNC_ABI void applyFlowInference(const ProfiParams &Params, FlowFunction &Func);
+LLVM_FUNC_ABI void applyFlowInference(FlowFunction &Func);
 
 /// Sample profile inference pass.
-template <typename FT> class SampleProfileInference {
+template <typename FT> class LLVM_CLASS_ABI SampleProfileInference {
 public:
   using NodeRef = typename GraphTraits<FT *>::NodeRef;
   using BasicBlockT = typename std::remove_pointer<NodeRef>::type;
diff --git a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h
index 5ec3d3be87c23cd..7083974a5d0c817 100644
--- a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h
+++ b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseUtil.h
@@ -26,14 +26,14 @@ using namespace sampleprof;
 class ProfileSummaryInfo;
 class Module;
 
-extern cl::opt<unsigned> SampleProfileMaxPropagateIterations;
-extern cl::opt<unsigned> SampleProfileRecordCoverage;
-extern cl::opt<unsigned> SampleProfileSampleCoverage;
-extern cl::opt<bool> NoWarnSampleUnused;
+LLVM_FUNC_ABI extern cl::opt<unsigned> SampleProfileMaxPropagateIterations;
+LLVM_FUNC_ABI extern cl::opt<unsigned> SampleProfileRecordCoverage;
+LLVM_FUNC_ABI extern cl::opt<unsigned> SampleProfileSampleCoverage;
+LLVM_FUNC_ABI extern cl::opt<bool> NoWarnSampleUnused;
 
 namespace sampleprofutil {
 
-class SampleCoverageTracker {
+class LLVM_CLASS_ABI SampleCoverageTracker {
 public:
   bool markSamplesUsed(const FunctionSamples *FS, uint32_t LineOffset,
                        uint32_t Discriminator, uint64_t Samples);
@@ -87,11 +87,11 @@ class SampleCoverageTracker {
 };
 
 /// Return true if the given callsite is hot wrt to hot cutoff threshold.
-bool callsiteIsHot(const FunctionSamples *CallsiteFS, ProfileSummaryInfo *PSI,
+LLVM_FUNC_ABI bool callsiteIsHot(const FunctionSamples *CallsiteFS, ProfileSummaryInfo *PSI,
                    bool ProfAccForSymsInList);
 
 /// Create a global variable to flag FSDiscriminators are used.
-void createFSDiscriminatorVariable(Module *M);
+LLVM_FUNC_ABI void createFSDiscriminatorVariable(Module *M);
 
 } // end of namespace sampleprofutil
 } // end of namespace llvm
diff --git a/llvm/include/llvm/Transforms/Utils/SanitizerStats.h b/llvm/include/llvm/Transforms/Utils/SanitizerStats.h
index 36f0f341f46af13..6dd8a95f84cd71f 100644
--- a/llvm/include/llvm/Transforms/Utils/SanitizerStats.h
+++ b/llvm/include/llvm/Transforms/Utils/SanitizerStats.h
@@ -30,7 +30,7 @@ enum SanitizerStatKind {
   SanStat_CFI_ICall,
 };
 
-struct SanitizerStatReport {
+struct LLVM_CLASS_ABI SanitizerStatReport {
   SanitizerStatReport(Module *M);
 
   /// Generates code into B that increments a location-specific counter tagged
diff --git a/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h b/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
index ac51ae6159f190e..ff3df76760fe65e 100644
--- a/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
+++ b/llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
@@ -27,11 +27,11 @@
 #include "llvm/Support/InstructionCost.h"
 
 namespace llvm {
-extern cl::opt<unsigned> SCEVCheapExpansionBudget;
+LLVM_FUNC_ABI extern cl::opt<unsigned> SCEVCheapExpansionBudget;
 
 /// struct for holding enough information to help calculate the cost of the
 /// given SCEV when expanded into IR.
-struct SCEVOperand {
+struct LLVM_CLASS_ABI SCEVOperand {
   explicit SCEVOperand(unsigned Opc, int Idx, const SCEV *S) :
     ParentOpcode(Opc), OperandIdx(Idx), S(S) { }
   /// LLVM instruction opcode that uses the operand.
@@ -48,7 +48,7 @@ struct SCEVOperand {
 /// Clients should create an instance of this class when rewriting is needed,
 /// and destroy it when finished to allow the release of the associated
 /// memory.
-class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
+class LLVM_CLASS_ABI SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
   ScalarEvolution &SE;
   const DataLayout &DL;
 
@@ -510,7 +510,7 @@ class SCEVExpander : public SCEVVisitor<SCEVExpander, Value *> {
 
 /// Helper to remove instructions inserted during SCEV expansion, unless they
 /// are marked as used.
-class SCEVExpanderCleaner {
+class LLVM_CLASS_ABI SCEVExpanderCleaner {
   SCEVExpander &Expander;
 
   /// Indicates whether the result of the expansion is used. If false, the
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h b/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
index 304e8c0ec6e9bdb..1cd1483fc9b4ae7 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyCFGOptions.h
@@ -22,7 +22,7 @@ namespace llvm {
 
 class AssumptionCache;
 
-struct SimplifyCFGOptions {
+struct LLVM_CLASS_ABI SimplifyCFGOptions {
   int BonusInstThreshold = 1;
   bool ForwardSwitchCondToPhi = false;
   bool ConvertSwitchRangeToICmp = false;
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h b/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h
index 3ebb8bfb65620b8..c07af0fc1c9b196 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyIndVar.h
@@ -33,7 +33,7 @@ class TargetTransformInfo;
 
 /// Interface for visiting interesting IV users that are recognized but not
 /// simplified by this utility.
-class IVVisitor {
+class LLVM_CLASS_ABI IVVisitor {
 protected:
   const DominatorTree *DT = nullptr;
 
@@ -49,21 +49,21 @@ class IVVisitor {
 
 /// simplifyUsersOfIV - Simplify instructions that use this induction variable
 /// by using ScalarEvolution to analyze the IV's recurrence.
-bool simplifyUsersOfIV(PHINode *CurrIV, ScalarEvolution *SE, DominatorTree *DT,
+LLVM_FUNC_ABI bool simplifyUsersOfIV(PHINode *CurrIV, ScalarEvolution *SE, DominatorTree *DT,
                        LoopInfo *LI, const TargetTransformInfo *TTI,
                        SmallVectorImpl<WeakTrackingVH> &Dead,
                        SCEVExpander &Rewriter, IVVisitor *V = nullptr);
 
 /// SimplifyLoopIVs - Simplify users of induction variables within this
 /// loop. This does not actually change or add IVs.
-bool simplifyLoopIVs(Loop *L, ScalarEvolution *SE, DominatorTree *DT,
+LLVM_FUNC_ABI bool simplifyLoopIVs(Loop *L, ScalarEvolution *SE, DominatorTree *DT,
                      LoopInfo *LI, const TargetTransformInfo *TTI,
                      SmallVectorImpl<WeakTrackingVH> &Dead);
 
 /// Collect information about induction variables that are used by sign/zero
 /// extend operations. This information is recorded by CollectExtend and provides
 /// the input to WidenIV.
-struct WideIVInfo {
+struct LLVM_CLASS_ABI WideIVInfo {
   PHINode *NarrowIV = nullptr;
 
   // Widest integer type created [sz]ext
@@ -75,7 +75,7 @@ struct WideIVInfo {
 
 /// Widen Induction Variables - Extend the width of an IV to cover its
 /// widest uses.
-PHINode *createWideIV(const WideIVInfo &WI,
+LLVM_FUNC_ABI PHINode *createWideIV(const WideIVInfo &WI,
     LoopInfo *LI, ScalarEvolution *SE, SCEVExpander &Rewriter,
     DominatorTree *DT, SmallVectorImpl<WeakTrackingVH> &DeadInsts,
     unsigned &NumElimExt, unsigned &NumWidened,
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
index 7588ddcca86f3f2..6540e4b672ff84c 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
@@ -37,7 +37,7 @@ class ProfileSummaryInfo;
 /// Other optimizations can also be done, but it's possible to disable them and
 /// only simplify needless use of the checking versions (when the object size
 /// is unknown) by passing true for OnlyLowerUnknownSize.
-class FortifiedLibCallSimplifier {
+class LLVM_CLASS_ABI FortifiedLibCallSimplifier {
 private:
   const TargetLibraryInfo *TLI;
   bool OnlyLowerUnknownSize;
@@ -99,7 +99,7 @@ class FortifiedLibCallSimplifier {
 /// LibCallSimplifier - This class implements a collection of optimizations
 /// that replace well formed calls to library functions with a more optimal
 /// form.  For example, replacing 'printf("Hello!")' with 'puts("Hello!")'.
-class LibCallSimplifier {
+class LLVM_CLASS_ABI LibCallSimplifier {
 private:
   FortifiedLibCallSimplifier FortifiedSimplifier;
   const DataLayout &DL;
diff --git a/llvm/include/llvm/Transforms/Utils/SizeOpts.h b/llvm/include/llvm/Transforms/Utils/SizeOpts.h
index ed629aa4ec54ec8..b3a82187726109d 100644
--- a/llvm/include/llvm/Transforms/Utils/SizeOpts.h
+++ b/llvm/include/llvm/Transforms/Utils/SizeOpts.h
@@ -18,15 +18,15 @@
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
-extern cl::opt<bool> EnablePGSO;
-extern cl::opt<bool> PGSOLargeWorkingSetSizeOnly;
-extern cl::opt<bool> PGSOColdCodeOnly;
-extern cl::opt<bool> PGSOColdCodeOnlyForInstrPGO;
-extern cl::opt<bool> PGSOColdCodeOnlyForSamplePGO;
-extern cl::opt<bool> PGSOColdCodeOnlyForPartialSamplePGO;
-extern cl::opt<bool> ForcePGSO;
-extern cl::opt<int> PgsoCutoffInstrProf;
-extern cl::opt<int> PgsoCutoffSampleProf;
+LLVM_FUNC_ABI extern cl::opt<bool> EnablePGSO;
+LLVM_FUNC_ABI extern cl::opt<bool> PGSOLargeWorkingSetSizeOnly;
+LLVM_FUNC_ABI extern cl::opt<bool> PGSOColdCodeOnly;
+LLVM_FUNC_ABI extern cl::opt<bool> PGSOColdCodeOnlyForInstrPGO;
+LLVM_FUNC_ABI extern cl::opt<bool> PGSOColdCodeOnlyForSamplePGO;
+LLVM_FUNC_ABI extern cl::opt<bool> PGSOColdCodeOnlyForPartialSamplePGO;
+LLVM_FUNC_ABI extern cl::opt<bool> ForcePGSO;
+LLVM_FUNC_ABI extern cl::opt<int> PgsoCutoffInstrProf;
+LLVM_FUNC_ABI extern cl::opt<int> PgsoCutoffSampleProf;
 
 class BasicBlock;
 class BlockFrequencyInfo;
@@ -91,13 +91,13 @@ bool shouldOptimizeForSizeImpl(BlockTOrBlockFreq BBOrBlockFreq,
 
 /// Returns true if function \p F is suggested to be size-optimized based on the
 /// profile.
-bool shouldOptimizeForSize(const Function *F, ProfileSummaryInfo *PSI,
+LLVM_FUNC_ABI bool shouldOptimizeForSize(const Function *F, ProfileSummaryInfo *PSI,
                            BlockFrequencyInfo *BFI,
                            PGSOQueryType QueryType = PGSOQueryType::Other);
 
 /// Returns true if basic block \p BB is suggested to be size-optimized based on
 /// the profile.
-bool shouldOptimizeForSize(const BasicBlock *BB, ProfileSummaryInfo *PSI,
+LLVM_FUNC_ABI bool shouldOptimizeForSize(const BasicBlock *BB, ProfileSummaryInfo *PSI,
                            BlockFrequencyInfo *BFI,
                            PGSOQueryType QueryType = PGSOQueryType::Other);
 
diff --git a/llvm/include/llvm/Transforms/Utils/SplitModule.h b/llvm/include/llvm/Transforms/Utils/SplitModule.h
index d01724ad5740417..e974c8d66211264 100644
--- a/llvm/include/llvm/Transforms/Utils/SplitModule.h
+++ b/llvm/include/llvm/Transforms/Utils/SplitModule.h
@@ -33,7 +33,7 @@ class Module;
 ///   module.
 /// - Internal symbols defined in module-level inline asm should be visible to
 ///   each partition.
-void SplitModule(
+LLVM_FUNC_ABI void SplitModule(
     Module &M, unsigned N,
     function_ref<void(std::unique_ptr<Module> MPart)> ModuleCallback,
     bool PreserveLocals = false);
diff --git a/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h b/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h
index 2f741bfe203c137..f443d2ac037829d 100644
--- a/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h
+++ b/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 class Function;
 
-class StripGCRelocates : public PassInfoMixin<StripGCRelocates> {
+class LLVM_CLASS_ABI StripGCRelocates : public PassInfoMixin<StripGCRelocates> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h b/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h
index c51d52b54043869..ff992f5b1ac5901 100644
--- a/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h
+++ b/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h
@@ -16,7 +16,7 @@ namespace llvm {
 
 class Module;
 
-class StripNonLineTableDebugInfoPass
+class LLVM_CLASS_ABI StripNonLineTableDebugInfoPass
     : public PassInfoMixin<StripNonLineTableDebugInfoPass> {
 public:
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h b/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h
index cfd4bb95fc4b4b4..33c2ea08401a873 100644
--- a/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h
+++ b/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h
@@ -66,7 +66,7 @@ namespace SymbolRewriter {
 /// be rewritten or providing a (posix compatible) regular expression that will
 /// select the symbols to rewrite.  This descriptor list is passed to the
 /// SymbolRewriter pass.
-class RewriteDescriptor {
+class LLVM_CLASS_ABI RewriteDescriptor {
 public:
   enum class Type {
     Invalid,        /// invalid
@@ -92,7 +92,7 @@ class RewriteDescriptor {
 
 using RewriteDescriptorList = std::list<std::unique_ptr<RewriteDescriptor>>;
 
-class RewriteMapParser {
+class LLVM_CLASS_ABI RewriteMapParser {
 public:
   bool parse(const std::string &MapFile, RewriteDescriptorList *Descriptors);
 
@@ -115,7 +115,7 @@ class RewriteMapParser {
 
 } // end namespace SymbolRewriter
 
-class RewriteSymbolPass : public PassInfoMixin<RewriteSymbolPass> {
+class LLVM_CLASS_ABI RewriteSymbolPass : public PassInfoMixin<RewriteSymbolPass> {
 public:
   RewriteSymbolPass() { loadAndParseMapFiles(); }
 
diff --git a/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
index ac5f0defb1c22fe..e61e96da7290417 100644
--- a/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
+++ b/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
@@ -20,7 +20,7 @@
 
 namespace llvm {
 
-class UnifyFunctionExitNodesLegacyPass : public FunctionPass {
+class LLVM_CLASS_ABI UnifyFunctionExitNodesLegacyPass : public FunctionPass {
 public:
   static char ID; // Pass identification, replacement for typeid
   UnifyFunctionExitNodesLegacyPass();
@@ -31,9 +31,9 @@ class UnifyFunctionExitNodesLegacyPass : public FunctionPass {
   bool runOnFunction(Function &F) override;
 };
 
-Pass *createUnifyFunctionExitNodesPass();
+LLVM_FUNC_ABI Pass *createUnifyFunctionExitNodesPass();
 
-class UnifyFunctionExitNodesPass
+class LLVM_CLASS_ABI UnifyFunctionExitNodesPass
     : public PassInfoMixin<UnifyFunctionExitNodesPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h b/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h
index 2bc80295655d56f..4e1af5873fde397 100644
--- a/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h
+++ b/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h
@@ -14,7 +14,7 @@
 
 namespace llvm {
 
-class UnifyLoopExitsPass : public PassInfoMixin<UnifyLoopExitsPass> {
+class LLVM_CLASS_ABI UnifyLoopExitsPass : public PassInfoMixin<UnifyLoopExitsPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
diff --git a/llvm/include/llvm/Transforms/Utils/UnrollLoop.h b/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
index 10de4938e8dd7c4..b49780521428f56 100644
--- a/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
+++ b/llvm/include/llvm/Transforms/Utils/UnrollLoop.h
@@ -47,7 +47,7 @@ const char *const LLVMLoopUnrollFollowupRemainder =
     "llvm.loop.unroll.followup_remainder";
 /// @}
 
-const Loop* addClonedBlockToLoopInfo(BasicBlock *OriginalBB,
+LLVM_FUNC_ABI const Loop* addClonedBlockToLoopInfo(BasicBlock *OriginalBB,
                                      BasicBlock *ClonedBB, LoopInfo *LI,
                                      NewLoopsMap &NewLoops);
 
@@ -66,7 +66,7 @@ enum class LoopUnrollResult {
   FullyUnrolled
 };
 
-struct UnrollLoopOptions {
+struct LLVM_CLASS_ABI UnrollLoopOptions {
   unsigned Count;
   bool Force;
   bool Runtime;
@@ -75,21 +75,21 @@ struct UnrollLoopOptions {
   bool ForgetAllSCEV;
 };
 
-LoopUnrollResult UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
+LLVM_FUNC_ABI LoopUnrollResult UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
                             ScalarEvolution *SE, DominatorTree *DT,
                             AssumptionCache *AC,
                             const llvm::TargetTransformInfo *TTI,
                             OptimizationRemarkEmitter *ORE, bool PreserveLCSSA,
                             Loop **RemainderLoop = nullptr);
 
-bool UnrollRuntimeLoopRemainder(
+LLVM_FUNC_ABI bool UnrollRuntimeLoopRemainder(
     Loop *L, unsigned Count, bool AllowExpensiveTripCount,
     bool UseEpilogRemainder, bool UnrollRemainder, bool ForgetAllSCEV,
     LoopInfo *LI, ScalarEvolution *SE, DominatorTree *DT, AssumptionCache *AC,
     const TargetTransformInfo *TTI, bool PreserveLCSSA,
     Loop **ResultLoop = nullptr);
 
-LoopUnrollResult UnrollAndJamLoop(Loop *L, unsigned Count, unsigned TripCount,
+LLVM_FUNC_ABI LoopUnrollResult UnrollAndJamLoop(Loop *L, unsigned Count, unsigned TripCount,
                                   unsigned TripMultiple, bool UnrollRemainder,
                                   LoopInfo *LI, ScalarEvolution *SE,
                                   DominatorTree *DT, AssumptionCache *AC,
@@ -97,10 +97,10 @@ LoopUnrollResult UnrollAndJamLoop(Loop *L, unsigned Count, unsigned TripCount,
                                   OptimizationRemarkEmitter *ORE,
                                   Loop **EpilogueLoop = nullptr);
 
-bool isSafeToUnrollAndJam(Loop *L, ScalarEvolution &SE, DominatorTree &DT,
+LLVM_FUNC_ABI bool isSafeToUnrollAndJam(Loop *L, ScalarEvolution &SE, DominatorTree &DT,
                           DependenceInfo &DI, LoopInfo &LI);
 
-bool computeUnrollCount(Loop *L, const TargetTransformInfo &TTI,
+LLVM_FUNC_ABI bool computeUnrollCount(Loop *L, const TargetTransformInfo &TTI,
                         DominatorTree &DT, LoopInfo *LI, AssumptionCache *AC,
                         ScalarEvolution &SE,
                         const SmallPtrSetImpl<const Value *> &EphValues,
@@ -111,14 +111,14 @@ bool computeUnrollCount(Loop *L, const TargetTransformInfo &TTI,
                         TargetTransformInfo::PeelingPreferences &PP,
                         bool &UseUpperBound);
 
-void simplifyLoopAfterUnroll(Loop *L, bool SimplifyIVs, LoopInfo *LI,
+LLVM_FUNC_ABI void simplifyLoopAfterUnroll(Loop *L, bool SimplifyIVs, LoopInfo *LI,
                              ScalarEvolution *SE, DominatorTree *DT,
                              AssumptionCache *AC,
                              const TargetTransformInfo *TTI);
 
-MDNode *GetUnrollMetadata(MDNode *LoopID, StringRef Name);
+LLVM_FUNC_ABI MDNode *GetUnrollMetadata(MDNode *LoopID, StringRef Name);
 
-TargetTransformInfo::UnrollingPreferences gatherUnrollingPreferences(
+LLVM_FUNC_ABI TargetTransformInfo::UnrollingPreferences gatherUnrollingPreferences(
     Loop *L, ScalarEvolution &SE, const TargetTransformInfo &TTI,
     BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
     llvm::OptimizationRemarkEmitter &ORE, int OptLevel,
@@ -127,7 +127,7 @@ TargetTransformInfo::UnrollingPreferences gatherUnrollingPreferences(
     std::optional<bool> UserUpperBound,
     std::optional<unsigned> UserFullUnrollMaxCount);
 
-InstructionCost ApproximateLoopSize(const Loop *L, unsigned &NumCalls,
+LLVM_FUNC_ABI InstructionCost ApproximateLoopSize(const Loop *L, unsigned &NumCalls,
     bool &NotDuplicatable, bool &Convergent, const TargetTransformInfo &TTI,
     const SmallPtrSetImpl<const Value *> &EphValues, unsigned BEInsns);
 
diff --git a/llvm/include/llvm/Transforms/Utils/VNCoercion.h b/llvm/include/llvm/Transforms/Utils/VNCoercion.h
index 8fb185d9c81f4e3..82734be9896c7fe 100644
--- a/llvm/include/llvm/Transforms/Utils/VNCoercion.h
+++ b/llvm/include/llvm/Transforms/Utils/VNCoercion.h
@@ -36,7 +36,7 @@ class DataLayout;
 namespace VNCoercion {
 /// Return true if CoerceAvailableValueToLoadType would succeed if it was
 /// called.
-bool canCoerceMustAliasedValueToLoad(Value *StoredVal, Type *LoadTy,
+LLVM_FUNC_ABI bool canCoerceMustAliasedValueToLoad(Value *StoredVal, Type *LoadTy,
                                      const DataLayout &DL);
 
 /// If we saw a store of a value to memory, and then a load from a must-aliased
@@ -45,7 +45,7 @@ bool canCoerceMustAliasedValueToLoad(Value *StoredVal, Type *LoadTy,
 /// IRBuilder used to insert new instructions.
 ///
 /// If we can't do it, return null.
-Value *coerceAvailableValueToLoadType(Value *StoredVal, Type *LoadedTy,
+LLVM_FUNC_ABI Value *coerceAvailableValueToLoadType(Value *StoredVal, Type *LoadedTy,
                                       IRBuilderBase &IRB, const DataLayout &DL);
 
 /// This function determines whether a value for the pointer LoadPtr can be
@@ -53,7 +53,7 @@ Value *coerceAvailableValueToLoadType(Value *StoredVal, Type *LoadedTy,
 ///
 /// On success, it returns the offset into DepSI that extraction would start.
 /// On failure, it returns -1.
-int analyzeLoadFromClobberingStore(Type *LoadTy, Value *LoadPtr,
+LLVM_FUNC_ABI int analyzeLoadFromClobberingStore(Type *LoadTy, Value *LoadPtr,
                                    StoreInst *DepSI, const DataLayout &DL);
 
 /// This function determines whether a value for the pointer LoadPtr can be
@@ -61,7 +61,7 @@ int analyzeLoadFromClobberingStore(Type *LoadTy, Value *LoadPtr,
 ///
 /// On success, it returns the offset into DepLI that extraction would start.
 /// On failure, it returns -1.
-int analyzeLoadFromClobberingLoad(Type *LoadTy, Value *LoadPtr, LoadInst *DepLI,
+LLVM_FUNC_ABI int analyzeLoadFromClobberingLoad(Type *LoadTy, Value *LoadPtr, LoadInst *DepLI,
                                   const DataLayout &DL);
 
 /// This function determines whether a value for the pointer LoadPtr can be
@@ -69,30 +69,30 @@ int analyzeLoadFromClobberingLoad(Type *LoadTy, Value *LoadPtr, LoadInst *DepLI,
 ///
 /// On success, it returns the offset into DepMI that extraction would start.
 /// On failure, it returns -1.
-int analyzeLoadFromClobberingMemInst(Type *LoadTy, Value *LoadPtr,
+LLVM_FUNC_ABI int analyzeLoadFromClobberingMemInst(Type *LoadTy, Value *LoadPtr,
                                      MemIntrinsic *DepMI, const DataLayout &DL);
 
 /// If analyzeLoadFromClobberingStore/Load returned an offset, this function
 /// can be used to actually perform the extraction of the bits from the store.
 /// It inserts instructions to do so at InsertPt, and returns the extracted
 /// value.
-Value *getValueForLoad(Value *SrcVal, unsigned Offset, Type *LoadTy,
+LLVM_FUNC_ABI Value *getValueForLoad(Value *SrcVal, unsigned Offset, Type *LoadTy,
                             Instruction *InsertPt, const DataLayout &DL);
 // This is the same as getValueForLoad, except it performs no insertion.
 // It only allows constant inputs.
-Constant *getConstantValueForLoad(Constant *SrcVal, unsigned Offset,
+LLVM_FUNC_ABI Constant *getConstantValueForLoad(Constant *SrcVal, unsigned Offset,
                                   Type *LoadTy, const DataLayout &DL);
 
 /// If analyzeLoadFromClobberingMemInst returned an offset, this function can be
 /// used to actually perform the extraction of the bits from the memory
 /// intrinsic.  It inserts instructions to do so at InsertPt, and returns the
 /// extracted value.
-Value *getMemInstValueForLoad(MemIntrinsic *SrcInst, unsigned Offset,
+LLVM_FUNC_ABI Value *getMemInstValueForLoad(MemIntrinsic *SrcInst, unsigned Offset,
                               Type *LoadTy, Instruction *InsertPt,
                               const DataLayout &DL);
 // This is the same as getStoreValueForLoad, except it performs no insertion.
 // It returns nullptr if it cannot produce a constant.
-Constant *getConstantMemInstValueForLoad(MemIntrinsic *SrcInst, unsigned Offset,
+LLVM_FUNC_ABI Constant *getConstantMemInstValueForLoad(MemIntrinsic *SrcInst, unsigned Offset,
                                          Type *LoadTy, const DataLayout &DL);
 }
 }
diff --git a/llvm/include/llvm/Transforms/Utils/ValueMapper.h b/llvm/include/llvm/Transforms/Utils/ValueMapper.h
index 38b5e0e8e106cd6..26fe4e6d58a6ac4 100644
--- a/llvm/include/llvm/Transforms/Utils/ValueMapper.h
+++ b/llvm/include/llvm/Transforms/Utils/ValueMapper.h
@@ -34,7 +34,7 @@ using ValueToValueMapTy = ValueMap<const Value *, WeakTrackingVH>;
 
 /// This is a class that can be implemented by clients to remap types when
 /// cloning constants and instructions.
-class ValueMapTypeRemapper {
+class LLVM_CLASS_ABI ValueMapTypeRemapper {
   virtual void anchor(); // Out of line method.
 
 public:
@@ -47,7 +47,7 @@ class ValueMapTypeRemapper {
 
 /// This is a class that can be implemented by clients to materialize Values on
 /// demand.
-class ValueMaterializer {
+class LLVM_CLASS_ABI ValueMaterializer {
   virtual void anchor(); // Out of line method.
 
 protected:
@@ -142,7 +142,7 @@ inline RemapFlags operator|(RemapFlags LHS, RemapFlags RHS) {
 ///
 /// TODO: Update callers of \a RemapInstruction() and \a MapValue() (etc.) to
 /// use \a ValueMapper directly.
-class ValueMapper {
+class LLVM_CLASS_ABI ValueMapper {
   void *pImpl;
 
 public:
diff --git a/llvm/include/llvm/Transforms/Vectorize.h b/llvm/include/llvm/Transforms/Vectorize.h
index 1db501e0aeb0e0f..cf92789252f6747 100644
--- a/llvm/include/llvm/Transforms/Vectorize.h
+++ b/llvm/include/llvm/Transforms/Vectorize.h
@@ -22,7 +22,7 @@ class Pass;
 // LoadStoreVectorizer - Create vector loads and stores, but leave scalar
 // operations.
 //
-Pass *createLoadStoreVectorizerPass();
+LLVM_FUNC_ABI Pass *createLoadStoreVectorizerPass();
 
 } // End llvm namespace
 
diff --git a/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h b/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
index 0f8a57a463daaeb..444975a60b16d11 100644
--- a/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
+++ b/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h
@@ -16,13 +16,13 @@ namespace llvm {
 class Pass;
 class Function;
 
-class LoadStoreVectorizerPass : public PassInfoMixin<LoadStoreVectorizerPass> {
+class LLVM_CLASS_ABI LoadStoreVectorizerPass : public PassInfoMixin<LoadStoreVectorizerPass> {
 public:
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
 };
 
 /// Create a legacy pass manager instance of the LoadStoreVectorizer pass
-Pass *createLoadStoreVectorizerPass();
+LLVM_FUNC_ABI Pass *createLoadStoreVectorizerPass();
 
 }
 
diff --git a/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h b/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
index e8cef241a35fffc..ff09a1687300e40 100644
--- a/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
+++ b/llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
@@ -59,7 +59,7 @@ class Type;
 /// We cannot write all values to metadata, as the mere presence of some info,
 /// for example 'force', means a decision has been made. So, we need to be
 /// careful NOT to add them if the user hasn't specifically asked so.
-class LoopVectorizeHints {
+class LLVM_CLASS_ABI LoopVectorizeHints {
   enum HintKind {
     HK_WIDTH,
     HK_INTERLEAVE,
@@ -212,7 +212,7 @@ class LoopVectorizeHints {
 /// example, by specifying #pragma clang loop vectorize or -ffast-math. Late
 /// evaluation should be used only when diagnostics can generated that can be
 /// followed by a non-expert user.
-class LoopVectorizationRequirements {
+class LLVM_CLASS_ABI LoopVectorizationRequirements {
 public:
   /// Track the 1st floating-point instruction that can not be reassociated.
   void addExactFPMathInst(Instruction *I) {
@@ -239,7 +239,7 @@ class LoopVectorizationRequirements {
 /// etc. This code reflects the capabilities of InnerLoopVectorizer.
 /// This class is also used by InnerLoopVectorizer for identifying
 /// induction variable and the different reduction variables.
-class LoopVectorizationLegality {
+class LLVM_CLASS_ABI LoopVectorizationLegality {
 public:
   LoopVectorizationLegality(
       Loop *L, PredicatedScalarEvolution &PSE, DominatorTree *DT,
diff --git a/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h b/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
index d400e2deebb1526..e45b3a88b11dcbf 100644
--- a/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
+++ b/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h
@@ -77,12 +77,12 @@ class ScalarEvolution;
 class TargetLibraryInfo;
 class TargetTransformInfo;
 
-extern cl::opt<bool> EnableLoopInterleaving;
-extern cl::opt<bool> EnableLoopVectorization;
+LLVM_FUNC_ABI extern cl::opt<bool> EnableLoopInterleaving;
+LLVM_FUNC_ABI extern cl::opt<bool> EnableLoopVectorization;
 
 /// A marker to determine if extra passes after loop vectorization should be
 /// run.
-struct ShouldRunExtraVectorPasses
+struct LLVM_CLASS_ABI ShouldRunExtraVectorPasses
     : public AnalysisInfoMixin<ShouldRunExtraVectorPasses> {
   static AnalysisKey Key;
   struct Result {
@@ -102,7 +102,7 @@ struct ShouldRunExtraVectorPasses
 /// vectorization, if requested. LoopVectorize caches the
 /// ShouldRunExtraVectorPasses analysis to request extra simplifications, if
 /// they could be beneficial.
-struct ExtraVectorPassManager : public FunctionPassManager {
+struct LLVM_CLASS_ABI ExtraVectorPassManager : public FunctionPassManager {
   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM) {
     auto PA = PreservedAnalyses::all();
     if (AM.getCachedResult<ShouldRunExtraVectorPasses>(F))
@@ -112,7 +112,7 @@ struct ExtraVectorPassManager : public FunctionPassManager {
   }
 };
 
-struct LoopVectorizeOptions {
+struct LLVM_CLASS_ABI LoopVectorizeOptions {
   /// If false, consider all loops for interleaving.
   /// If true, only loops that explicitly request interleaving are considered.
   bool InterleaveOnlyWhenForced;
@@ -149,7 +149,7 @@ struct LoopVectorizeOptions {
 };
 
 /// Storage for information about made changes.
-struct LoopVectorizeResult {
+struct LLVM_CLASS_ABI LoopVectorizeResult {
   bool MadeAnyChange;
   bool MadeCFGChange;
 
@@ -158,7 +158,7 @@ struct LoopVectorizeResult {
 };
 
 /// The LoopVectorize Pass.
-struct LoopVectorizePass : public PassInfoMixin<LoopVectorizePass> {
+struct LLVM_CLASS_ABI LoopVectorizePass : public PassInfoMixin<LoopVectorizePass> {
 private:
   /// If false, consider all loops for interleaving.
   /// If true, only loops that explicitly request interleaving are considered.
@@ -203,14 +203,14 @@ struct LoopVectorizePass : public PassInfoMixin<LoopVectorizePass> {
 /// purposes along with the corresponding optimization remark \p RemarkName.
 /// If \p I is passed, it is an instruction that prevents vectorization.
 /// Otherwise, the loop \p TheLoop is used for the location of the remark.
-void reportVectorizationFailure(const StringRef DebugMsg,
+LLVM_FUNC_ABI void reportVectorizationFailure(const StringRef DebugMsg,
     const StringRef OREMsg, const StringRef ORETag,
     OptimizationRemarkEmitter *ORE, Loop *TheLoop, Instruction *I = nullptr);
 
 /// Reports an informative message: print \p Msg for debugging purposes as well
 /// as an optimization remark. Uses either \p I as location of the remark, or
 /// otherwise \p TheLoop.
-void reportVectorizationInfo(const StringRef OREMsg, const StringRef ORETag,
+LLVM_FUNC_ABI void reportVectorizationInfo(const StringRef OREMsg, const StringRef ORETag,
                              OptimizationRemarkEmitter *ORE, Loop *TheLoop,
                              Instruction *I = nullptr);
 
diff --git a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
index 082dcbe41fc929c..613c0fa52bf1b04 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
@@ -55,7 +55,7 @@ class BoUpSLP;
 
 } // end namespace slpvectorizer
 
-struct SLPVectorizerPass : public PassInfoMixin<SLPVectorizerPass> {
+struct LLVM_CLASS_ABI SLPVectorizerPass : public PassInfoMixin<SLPVectorizerPass> {
   using StoreList = SmallVector<StoreInst *, 8>;
   using StoreListMap = MapVector<Value *, StoreList>;
   using GEPList = SmallVector<GetElementPtrInst *, 8>;
diff --git a/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h b/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h
index da41a90b9062a00..f1ec53372bfa3d9 100644
--- a/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h
+++ b/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h
@@ -21,7 +21,7 @@
 namespace llvm {
 
 /// Optimize scalar/vector interactions in IR using target cost models.
-class VectorCombinePass : public PassInfoMixin<VectorCombinePass> {
+class LLVM_CLASS_ABI VectorCombinePass : public PassInfoMixin<VectorCombinePass> {
   /// If true, only perform beneficial early IR transforms. Do not introduce new
   /// vector operations.
   bool TryEarlyFoldsOnly;
diff --git a/llvm/include/llvm/WindowsDriver/MSVCPaths.h b/llvm/include/llvm/WindowsDriver/MSVCPaths.h
index 29a41dbc9ed60e3..d5244d35fda72da 100644
--- a/llvm/include/llvm/WindowsDriver/MSVCPaths.h
+++ b/llvm/include/llvm/WindowsDriver/MSVCPaths.h
@@ -37,15 +37,15 @@ enum class ToolsetLayout {
 // Windows SDKs and VC Toolchains group their contents into subdirectories based
 // on the target architecture. This function converts an llvm::Triple::ArchType
 // to the corresponding subdirectory name.
-const char *archToWindowsSDKArch(llvm::Triple::ArchType Arch);
+LLVM_FUNC_ABI const char *archToWindowsSDKArch(llvm::Triple::ArchType Arch);
 
 // Similar to the above function, but for Visual Studios before VS2017.
-const char *archToLegacyVCArch(llvm::Triple::ArchType Arch);
+LLVM_FUNC_ABI const char *archToLegacyVCArch(llvm::Triple::ArchType Arch);
 
 // Similar to the above function, but for DevDiv internal builds.
-const char *archToDevDivInternalArch(llvm::Triple::ArchType Arch);
+LLVM_FUNC_ABI const char *archToDevDivInternalArch(llvm::Triple::ArchType Arch);
 
-bool appendArchToWindowsSDKLibPath(int SDKMajor, llvm::SmallString<128> LibPath,
+LLVM_FUNC_ABI bool appendArchToWindowsSDKLibPath(int SDKMajor, llvm::SmallString<128> LibPath,
                                    llvm::Triple::ArchType Arch,
                                    std::string &path);
 
@@ -53,19 +53,19 @@ bool appendArchToWindowsSDKLibPath(int SDKMajor, llvm::SmallString<128> LibPath,
 // a given target architecture.
 // VS2017 changed the VC toolchain layout, so this should be used instead
 // of hardcoding paths.
-std::string getSubDirectoryPath(SubDirectoryType Type, ToolsetLayout VSLayout,
+LLVM_FUNC_ABI std::string getSubDirectoryPath(SubDirectoryType Type, ToolsetLayout VSLayout,
                                 const std::string &VCToolChainPath,
                                 llvm::Triple::ArchType TargetArch,
                                 llvm::StringRef SubdirParent = "");
 
 // Check if the Include path of a specified version of Visual Studio contains
 // specific header files. If not, they are probably shipped with Universal CRT.
-bool useUniversalCRT(ToolsetLayout VSLayout, const std::string &VCToolChainPath,
+LLVM_FUNC_ABI bool useUniversalCRT(ToolsetLayout VSLayout, const std::string &VCToolChainPath,
                      llvm::Triple::ArchType TargetArch,
                      llvm::vfs::FileSystem &VFS);
 
 /// Get Windows SDK installation directory.
-bool getWindowsSDKDir(vfs::FileSystem &VFS,
+LLVM_FUNC_ABI bool getWindowsSDKDir(vfs::FileSystem &VFS,
                       std::optional<llvm::StringRef> WinSdkDir,
                       std::optional<llvm::StringRef> WinSdkVersion,
                       std::optional<llvm::StringRef> WinSysRoot,
@@ -73,21 +73,21 @@ bool getWindowsSDKDir(vfs::FileSystem &VFS,
                       std::string &WindowsSDKIncludeVersion,
                       std::string &WindowsSDKLibVersion);
 
-bool getUniversalCRTSdkDir(vfs::FileSystem &VFS,
+LLVM_FUNC_ABI bool getUniversalCRTSdkDir(vfs::FileSystem &VFS,
                            std::optional<llvm::StringRef> WinSdkDir,
                            std::optional<llvm::StringRef> WinSdkVersion,
                            std::optional<llvm::StringRef> WinSysRoot,
                            std::string &Path, std::string &UCRTVersion);
 
 // Check command line arguments to try and find a toolchain.
-bool findVCToolChainViaCommandLine(
+LLVM_FUNC_ABI bool findVCToolChainViaCommandLine(
     vfs::FileSystem &VFS, std::optional<llvm::StringRef> VCToolsDir,
     std::optional<llvm::StringRef> VCToolsVersion,
     std::optional<llvm::StringRef> WinSysRoot, std::string &Path,
     ToolsetLayout &VSLayout);
 
 // Check various environment variables to try and find a toolchain.
-bool findVCToolChainViaEnvironment(vfs::FileSystem &VFS, std::string &Path,
+LLVM_FUNC_ABI bool findVCToolChainViaEnvironment(vfs::FileSystem &VFS, std::string &Path,
                                    ToolsetLayout &VSLayout);
 
 // Query the Setup Config server for installs, then pick the newest version
@@ -96,7 +96,7 @@ bool findVCToolChainViaEnvironment(vfs::FileSystem &VFS, std::string &Path,
 //
 // This is the preferred way to discover new Visual Studios, as they're no
 // longer listed in the registry.
-bool
+LLVM_FUNC_ABI bool
 findVCToolChainViaSetupConfig(vfs::FileSystem &VFS,
                               std::optional<llvm::StringRef> VCToolsVersion,
                               std::string &Path, ToolsetLayout &VSLayout);
@@ -104,7 +104,7 @@ findVCToolChainViaSetupConfig(vfs::FileSystem &VFS,
 // Look in the registry for Visual Studio installs, and use that to get
 // a toolchain path. VS2017 and newer don't get added to the registry.
 // So if we find something here, we know that it's an older version.
-bool findVCToolChainViaRegistry(std::string &Path, ToolsetLayout &VSLayout);
+LLVM_FUNC_ABI bool findVCToolChainViaRegistry(std::string &Path, ToolsetLayout &VSLayout);
 
 } // namespace llvm
 
diff --git a/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h b/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h
index efbef51f17f5da9..d06e8c181242375 100644
--- a/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h
+++ b/llvm/include/llvm/WindowsManifest/WindowsManifestMerger.h
@@ -35,9 +35,9 @@ class MemoryBufferRef;
 
 namespace windows_manifest {
 
-bool isAvailable();
+LLVM_FUNC_ABI bool isAvailable();
 
-class WindowsManifestError : public ErrorInfo<WindowsManifestError, ECError> {
+class LLVM_CLASS_ABI WindowsManifestError : public ErrorInfo<WindowsManifestError, ECError> {
 public:
   static char ID;
   WindowsManifestError(const Twine &Msg);
@@ -47,7 +47,7 @@ class WindowsManifestError : public ErrorInfo<WindowsManifestError, ECError> {
   std::string Msg;
 };
 
-class WindowsManifestMerger {
+class LLVM_CLASS_ABI WindowsManifestMerger {
 public:
   WindowsManifestMerger();
   ~WindowsManifestMerger();
diff --git a/llvm/include/llvm/XRay/BlockIndexer.h b/llvm/include/llvm/XRay/BlockIndexer.h
index 02315002e69b99c..1a2c69bfe0dc332 100644
--- a/llvm/include/llvm/XRay/BlockIndexer.h
+++ b/llvm/include/llvm/XRay/BlockIndexer.h
@@ -24,7 +24,7 @@ namespace xray {
 
 // The BlockIndexer will gather all related records associated with a
 // process+thread and group them by 'Block'.
-class BlockIndexer : public RecordVisitor {
+class LLVM_CLASS_ABI BlockIndexer : public RecordVisitor {
 public:
   struct Block {
     uint64_t ProcessID;
diff --git a/llvm/include/llvm/XRay/BlockPrinter.h b/llvm/include/llvm/XRay/BlockPrinter.h
index 5c445e231114e83..b0a44bb9560a052 100644
--- a/llvm/include/llvm/XRay/BlockPrinter.h
+++ b/llvm/include/llvm/XRay/BlockPrinter.h
@@ -21,7 +21,7 @@
 namespace llvm {
 namespace xray {
 
-class BlockPrinter : public RecordVisitor {
+class LLVM_CLASS_ABI BlockPrinter : public RecordVisitor {
   enum class State {
     Start,
     Preamble,
diff --git a/llvm/include/llvm/XRay/BlockVerifier.h b/llvm/include/llvm/XRay/BlockVerifier.h
index 83b0da89a664cbb..7d15a7c624b1002 100644
--- a/llvm/include/llvm/XRay/BlockVerifier.h
+++ b/llvm/include/llvm/XRay/BlockVerifier.h
@@ -21,7 +21,7 @@
 namespace llvm {
 namespace xray {
 
-class BlockVerifier : public RecordVisitor {
+class LLVM_CLASS_ABI BlockVerifier : public RecordVisitor {
 public:
   // We force State elements to be size_t, to be used as indices for containers.
   enum class State : std::size_t {
diff --git a/llvm/include/llvm/XRay/FDRRecordConsumer.h b/llvm/include/llvm/XRay/FDRRecordConsumer.h
index 90132c380d9143e..a5d444988993700 100644
--- a/llvm/include/llvm/XRay/FDRRecordConsumer.h
+++ b/llvm/include/llvm/XRay/FDRRecordConsumer.h
@@ -18,7 +18,7 @@
 namespace llvm {
 namespace xray {
 
-class RecordConsumer {
+class LLVM_CLASS_ABI RecordConsumer {
 public:
   virtual Error consume(std::unique_ptr<Record> R) = 0;
   virtual ~RecordConsumer() = default;
@@ -26,7 +26,7 @@ class RecordConsumer {
 
 // This consumer will collect all the records into a vector of records, in
 // arrival order.
-class LogBuilderConsumer : public RecordConsumer {
+class LLVM_CLASS_ABI LogBuilderConsumer : public RecordConsumer {
   std::vector<std::unique_ptr<Record>> &Records;
 
 public:
@@ -39,7 +39,7 @@ class LogBuilderConsumer : public RecordConsumer {
 // A PipelineConsumer applies a set of visitors to every consumed Record, in the
 // order by which the visitors are added to the pipeline in the order of
 // appearance.
-class PipelineConsumer : public RecordConsumer {
+class LLVM_CLASS_ABI PipelineConsumer : public RecordConsumer {
   std::vector<RecordVisitor *> Visitors;
 
 public:
diff --git a/llvm/include/llvm/XRay/FDRRecordProducer.h b/llvm/include/llvm/XRay/FDRRecordProducer.h
index 9a85b0e76f7bab5..8abdc24c0161155 100644
--- a/llvm/include/llvm/XRay/FDRRecordProducer.h
+++ b/llvm/include/llvm/XRay/FDRRecordProducer.h
@@ -17,7 +17,7 @@
 namespace llvm {
 namespace xray {
 
-class RecordProducer {
+class LLVM_CLASS_ABI RecordProducer {
 public:
   /// All producer implementations must yield either an Error or a non-nullptr
   /// unique_ptr<Record>.
@@ -25,7 +25,7 @@ class RecordProducer {
   virtual ~RecordProducer() = default;
 };
 
-class FileBasedRecordProducer : public RecordProducer {
+class LLVM_CLASS_ABI FileBasedRecordProducer : public RecordProducer {
   const XRayFileHeader &Header;
   DataExtractor &E;
   uint64_t &OffsetPtr;
diff --git a/llvm/include/llvm/XRay/FDRRecords.h b/llvm/include/llvm/XRay/FDRRecords.h
index e6391a4fb322788..8d3b0d000c40d1e 100644
--- a/llvm/include/llvm/XRay/FDRRecords.h
+++ b/llvm/include/llvm/XRay/FDRRecords.h
@@ -29,7 +29,7 @@ namespace xray {
 class RecordVisitor;
 class RecordInitializer;
 
-class Record {
+class LLVM_CLASS_ABI Record {
 public:
   enum class RecordKind {
     RK_Metadata,
@@ -69,7 +69,7 @@ class Record {
   virtual ~Record() = default;
 };
 
-class MetadataRecord : public Record {
+class LLVM_CLASS_ABI MetadataRecord : public Record {
 public:
   enum class MetadataType : unsigned {
     Unknown,
@@ -108,7 +108,7 @@ class MetadataRecord : public Record {
 // What follows are specific Metadata record types which encapsulate the
 // information associated with specific metadata record types in an FDR mode
 // log.
-class BufferExtents : public MetadataRecord {
+class LLVM_CLASS_ABI BufferExtents : public MetadataRecord {
   uint64_t Size = 0;
   friend class RecordInitializer;
 
@@ -131,7 +131,7 @@ class BufferExtents : public MetadataRecord {
   }
 };
 
-class WallclockRecord : public MetadataRecord {
+class LLVM_CLASS_ABI WallclockRecord : public MetadataRecord {
   uint64_t Seconds = 0;
   uint32_t Nanos = 0;
   friend class RecordInitializer;
@@ -156,7 +156,7 @@ class WallclockRecord : public MetadataRecord {
   }
 };
 
-class NewCPUIDRecord : public MetadataRecord {
+class LLVM_CLASS_ABI NewCPUIDRecord : public MetadataRecord {
   uint16_t CPUId = 0;
   uint64_t TSC = 0;
   friend class RecordInitializer;
@@ -182,7 +182,7 @@ class NewCPUIDRecord : public MetadataRecord {
   }
 };
 
-class TSCWrapRecord : public MetadataRecord {
+class LLVM_CLASS_ABI TSCWrapRecord : public MetadataRecord {
   uint64_t BaseTSC = 0;
   friend class RecordInitializer;
 
@@ -204,7 +204,7 @@ class TSCWrapRecord : public MetadataRecord {
   }
 };
 
-class CustomEventRecord : public MetadataRecord {
+class LLVM_CLASS_ABI CustomEventRecord : public MetadataRecord {
   int32_t Size = 0;
   uint64_t TSC = 0;
   uint16_t CPU = 0;
@@ -233,7 +233,7 @@ class CustomEventRecord : public MetadataRecord {
   }
 };
 
-class CustomEventRecordV5 : public MetadataRecord {
+class LLVM_CLASS_ABI CustomEventRecordV5 : public MetadataRecord {
   int32_t Size = 0;
   int32_t Delta = 0;
   std::string Data{};
@@ -260,7 +260,7 @@ class CustomEventRecordV5 : public MetadataRecord {
   }
 };
 
-class TypedEventRecord : public MetadataRecord {
+class LLVM_CLASS_ABI TypedEventRecord : public MetadataRecord {
   int32_t Size = 0;
   int32_t Delta = 0;
   uint16_t EventType = 0;
@@ -289,7 +289,7 @@ class TypedEventRecord : public MetadataRecord {
   }
 };
 
-class CallArgRecord : public MetadataRecord {
+class LLVM_CLASS_ABI CallArgRecord : public MetadataRecord {
   uint64_t Arg = 0;
   friend class RecordInitializer;
 
@@ -311,7 +311,7 @@ class CallArgRecord : public MetadataRecord {
   }
 };
 
-class PIDRecord : public MetadataRecord {
+class LLVM_CLASS_ABI PIDRecord : public MetadataRecord {
   int32_t PID = 0;
   friend class RecordInitializer;
 
@@ -334,7 +334,7 @@ class PIDRecord : public MetadataRecord {
   }
 };
 
-class NewBufferRecord : public MetadataRecord {
+class LLVM_CLASS_ABI NewBufferRecord : public MetadataRecord {
   int32_t TID = 0;
   friend class RecordInitializer;
 
@@ -357,7 +357,7 @@ class NewBufferRecord : public MetadataRecord {
   }
 };
 
-class EndBufferRecord : public MetadataRecord {
+class LLVM_CLASS_ABI EndBufferRecord : public MetadataRecord {
 public:
   EndBufferRecord()
       : MetadataRecord(RecordKind::RK_Metadata_EndOfBuffer,
@@ -370,7 +370,7 @@ class EndBufferRecord : public MetadataRecord {
   }
 };
 
-class FunctionRecord : public Record {
+class LLVM_CLASS_ABI FunctionRecord : public Record {
   RecordTypes Kind;
   int32_t FuncId = 0;
   uint32_t Delta = 0;
@@ -397,7 +397,7 @@ class FunctionRecord : public Record {
   }
 };
 
-class RecordVisitor {
+class LLVM_CLASS_ABI RecordVisitor {
 public:
   virtual ~RecordVisitor() = default;
 
@@ -416,7 +416,7 @@ class RecordVisitor {
   virtual Error visit(TypedEventRecord &) = 0;
 };
 
-class RecordInitializer : public RecordVisitor {
+class LLVM_CLASS_ABI RecordInitializer : public RecordVisitor {
   DataExtractor &E;
   uint64_t &OffsetPtr;
   uint16_t Version;
diff --git a/llvm/include/llvm/XRay/FDRTraceExpander.h b/llvm/include/llvm/XRay/FDRTraceExpander.h
index 2f46c4ab1798287..53587e8b9e22287 100644
--- a/llvm/include/llvm/XRay/FDRTraceExpander.h
+++ b/llvm/include/llvm/XRay/FDRTraceExpander.h
@@ -21,7 +21,7 @@
 namespace llvm {
 namespace xray {
 
-class TraceExpander : public RecordVisitor {
+class LLVM_CLASS_ABI TraceExpander : public RecordVisitor {
   // Type-erased callback for handling individual XRayRecord instances.
   function_ref<void(const XRayRecord &)> C;
   int32_t PID = 0;
diff --git a/llvm/include/llvm/XRay/FDRTraceWriter.h b/llvm/include/llvm/XRay/FDRTraceWriter.h
index ffa8717055b537d..689e5ecbebcfc5c 100644
--- a/llvm/include/llvm/XRay/FDRTraceWriter.h
+++ b/llvm/include/llvm/XRay/FDRTraceWriter.h
@@ -27,7 +27,7 @@ namespace xray {
 /// generate various kinds of execution traces without using the XRay runtime.
 /// Note that this writer does not do any validation, but uses the types of
 /// records defined in the FDRRecords.h file.
-class FDRTraceWriter : public RecordVisitor {
+class LLVM_CLASS_ABI FDRTraceWriter : public RecordVisitor {
 public:
   // Construct an FDRTraceWriter associated with an output stream.
   explicit FDRTraceWriter(raw_ostream &O, const XRayFileHeader &H);
diff --git a/llvm/include/llvm/XRay/FileHeaderReader.h b/llvm/include/llvm/XRay/FileHeaderReader.h
index c385129dbe1419f..07d9a316f7d89fa 100644
--- a/llvm/include/llvm/XRay/FileHeaderReader.h
+++ b/llvm/include/llvm/XRay/FileHeaderReader.h
@@ -24,7 +24,7 @@ namespace xray {
 
 /// Convenience function for loading the file header given a data extractor at a
 /// specified offset.
-Expected<XRayFileHeader> readBinaryFormatHeader(DataExtractor &HeaderExtractor,
+LLVM_FUNC_ABI Expected<XRayFileHeader> readBinaryFormatHeader(DataExtractor &HeaderExtractor,
                                                 uint64_t &OffsetPtr);
 
 } // namespace xray
diff --git a/llvm/include/llvm/XRay/Graph.h b/llvm/include/llvm/XRay/Graph.h
index d599ec36116569d..b1dd4b06ed72a8e 100644
--- a/llvm/include/llvm/XRay/Graph.h
+++ b/llvm/include/llvm/XRay/Graph.h
@@ -71,7 +71,7 @@ namespace xray {
 ///
 template <typename VertexAttribute, typename EdgeAttribute,
           typename VI = int32_t>
-class Graph {
+class LLVM_CLASS_ABI Graph {
 public:
   /// These objects are used to name edges and vertices in the graph.
   typedef VI VertexIdentifier;
diff --git a/llvm/include/llvm/XRay/InstrumentationMap.h b/llvm/include/llvm/XRay/InstrumentationMap.h
index b3eb96d9725ed72..ce84f8ee73ab8dd 100644
--- a/llvm/include/llvm/XRay/InstrumentationMap.h
+++ b/llvm/include/llvm/XRay/InstrumentationMap.h
@@ -32,10 +32,10 @@ class InstrumentationMap;
 
 /// Loads the instrumentation map from |Filename|. This auto-deduces the type of
 /// the instrumentation map.
-Expected<InstrumentationMap> loadInstrumentationMap(StringRef Filename);
+LLVM_FUNC_ABI Expected<InstrumentationMap> loadInstrumentationMap(StringRef Filename);
 
 /// Represents an XRay instrumentation sled entry from an object file.
-struct SledEntry {
+struct LLVM_CLASS_ABI SledEntry {
   /// Each entry here represents the kinds of supported instrumentation map
   /// entries.
   enum class FunctionKinds { ENTRY, EXIT, TAIL, LOG_ARGS_ENTER, CUSTOM_EVENT };
@@ -55,7 +55,7 @@ struct SledEntry {
   unsigned char Version;
 };
 
-struct YAMLXRaySledEntry {
+struct LLVM_CLASS_ABI YAMLXRaySledEntry {
   int32_t FuncId;
   yaml::Hex64 Address;
   yaml::Hex64 Function;
@@ -73,7 +73,7 @@ struct YAMLXRaySledEntry {
 /// We also provide raw access to the actual instrumentation map entries we find
 /// associated with a particular object file.
 ///
-class InstrumentationMap {
+class LLVM_CLASS_ABI InstrumentationMap {
 public:
   using FunctionAddressMap = std::unordered_map<int32_t, uint64_t>;
   using FunctionAddressReverseMap = std::unordered_map<uint64_t, int32_t>;
@@ -84,7 +84,7 @@ class InstrumentationMap {
   FunctionAddressMap FunctionAddresses;
   FunctionAddressReverseMap FunctionIds;
 
-  friend Expected<InstrumentationMap> loadInstrumentationMap(StringRef);
+  friend LLVM_FUNC_ABI Expected<InstrumentationMap> loadInstrumentationMap(StringRef);
 
 public:
   /// Provides a raw accessor to the unordered map of function addresses.
@@ -104,7 +104,7 @@ class InstrumentationMap {
 
 namespace yaml {
 
-template <> struct ScalarEnumerationTraits<xray::SledEntry::FunctionKinds> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<xray::SledEntry::FunctionKinds> {
   static void enumeration(IO &IO, xray::SledEntry::FunctionKinds &Kind) {
     IO.enumCase(Kind, "function-enter", xray::SledEntry::FunctionKinds::ENTRY);
     IO.enumCase(Kind, "function-exit", xray::SledEntry::FunctionKinds::EXIT);
@@ -116,7 +116,7 @@ template <> struct ScalarEnumerationTraits<xray::SledEntry::FunctionKinds> {
   }
 };
 
-template <> struct MappingTraits<xray::YAMLXRaySledEntry> {
+template <> struct LLVM_CLASS_ABI MappingTraits<xray::YAMLXRaySledEntry> {
   static void mapping(IO &IO, xray::YAMLXRaySledEntry &Entry) {
     IO.mapRequired("id", Entry.FuncId);
     IO.mapRequired("address", Entry.Address);
diff --git a/llvm/include/llvm/XRay/Profile.h b/llvm/include/llvm/XRay/Profile.h
index 721a5c67e1d3827..ab8a4f2a09d5163 100644
--- a/llvm/include/llvm/XRay/Profile.h
+++ b/llvm/include/llvm/XRay/Profile.h
@@ -35,21 +35,21 @@ class Trace;
 ///
 /// For any errors encountered in the loading of the profile data from
 /// |Filename|, this function will return an Error condition appropriately.
-Expected<Profile> loadProfile(StringRef Filename);
+LLVM_FUNC_ABI Expected<Profile> loadProfile(StringRef Filename);
 
 /// This algorithm will merge two Profile instances into a single Profile
 /// instance, aggregating blocks by Thread ID.
-Profile mergeProfilesByThread(const Profile &L, const Profile &R);
+LLVM_FUNC_ABI Profile mergeProfilesByThread(const Profile &L, const Profile &R);
 
 /// This algorithm will merge two Profile instances into a single Profile
 /// instance, aggregating blocks by function call stack.
-Profile mergeProfilesByStack(const Profile &L, const Profile &R);
+LLVM_FUNC_ABI Profile mergeProfilesByStack(const Profile &L, const Profile &R);
 
 /// This function takes a Trace and creates a Profile instance from it.
-Expected<Profile> profileFromTrace(const Trace &T);
+LLVM_FUNC_ABI Expected<Profile> profileFromTrace(const Trace &T);
 
 /// Profile instances are thread-compatible.
-class Profile {
+class LLVM_CLASS_ABI Profile {
 public:
   using ThreadID = uint64_t;
   using PathID = unsigned;
diff --git a/llvm/include/llvm/XRay/RecordPrinter.h b/llvm/include/llvm/XRay/RecordPrinter.h
index 13ecf23b39060d0..5296c50e0f398d9 100644
--- a/llvm/include/llvm/XRay/RecordPrinter.h
+++ b/llvm/include/llvm/XRay/RecordPrinter.h
@@ -20,7 +20,7 @@
 namespace llvm {
 namespace xray {
 
-class RecordPrinter : public RecordVisitor {
+class LLVM_CLASS_ABI RecordPrinter : public RecordVisitor {
   raw_ostream &OS;
   std::string Delim;
 
diff --git a/llvm/include/llvm/XRay/Trace.h b/llvm/include/llvm/XRay/Trace.h
index ec405f069d0c55e..10ab515017950de 100644
--- a/llvm/include/llvm/XRay/Trace.h
+++ b/llvm/include/llvm/XRay/Trace.h
@@ -44,14 +44,14 @@ namespace xray {
 ///     // Handle the error here.
 ///   }
 ///
-class Trace {
+class LLVM_CLASS_ABI Trace {
   XRayFileHeader FileHeader;
   using RecordVector = std::vector<XRayRecord>;
   RecordVector Records;
 
   typedef std::vector<XRayRecord>::const_iterator citerator;
 
-  friend Expected<Trace> loadTrace(const DataExtractor &, bool);
+  friend LLVM_FUNC_ABI Expected<Trace> loadTrace(const DataExtractor &, bool);
 
 public:
   using size_type = RecordVector::size_type;
@@ -69,11 +69,11 @@ class Trace {
 
 /// This function will attempt to load XRay trace records from the provided
 /// |Filename|.
-Expected<Trace> loadTraceFile(StringRef Filename, bool Sort = false);
+LLVM_FUNC_ABI Expected<Trace> loadTraceFile(StringRef Filename, bool Sort = false);
 
 /// This function will attempt to load XRay trace records from the provided
 /// DataExtractor.
-Expected<Trace> loadTrace(const DataExtractor &Extractor, bool Sort = false);
+LLVM_FUNC_ABI Expected<Trace> loadTrace(const DataExtractor &Extractor, bool Sort = false);
 
 } // namespace xray
 } // namespace llvm
diff --git a/llvm/include/llvm/XRay/XRayRecord.h b/llvm/include/llvm/XRay/XRayRecord.h
index 221df9670acddc0..dc6eca6ead2397a 100644
--- a/llvm/include/llvm/XRay/XRayRecord.h
+++ b/llvm/include/llvm/XRay/XRayRecord.h
@@ -25,7 +25,7 @@ namespace xray {
 /// XRay traces all have a header providing some top-matter information useful
 /// to help tools determine how to interpret the information available in the
 /// trace.
-struct XRayFileHeader {
+struct LLVM_CLASS_ABI XRayFileHeader {
   /// Version of the XRay implementation that produced this file.
   uint16_t Version = 0;
 
@@ -67,7 +67,7 @@ enum class RecordTypes {
 /// An XRayRecord is the denormalized view of data associated in a trace. These
 /// records may not correspond to actual entries in the raw traces, but they are
 /// the logical representation of records in a higher-level event log.
-struct XRayRecord {
+struct LLVM_CLASS_ABI XRayRecord {
   /// RecordType values are used as "sub-types" which have meaning in the
   /// context of the `Type` below. For function call and custom event records,
   /// the RecordType is always 0, while for typed events we store the type in
diff --git a/llvm/include/llvm/XRay/YAMLXRayRecord.h b/llvm/include/llvm/XRay/YAMLXRayRecord.h
index 2b81a368df5a3a2..6c0dbd728a85237 100644
--- a/llvm/include/llvm/XRay/YAMLXRayRecord.h
+++ b/llvm/include/llvm/XRay/YAMLXRayRecord.h
@@ -21,7 +21,7 @@
 namespace llvm {
 namespace xray {
 
-struct YAMLXRayFileHeader {
+struct LLVM_CLASS_ABI YAMLXRayFileHeader {
   uint16_t Version;
   uint16_t Type;
   bool ConstantTSC;
@@ -29,7 +29,7 @@ struct YAMLXRayFileHeader {
   uint64_t CycleFrequency;
 };
 
-struct YAMLXRayRecord {
+struct LLVM_CLASS_ABI YAMLXRayRecord {
   uint16_t RecordType;
   uint16_t CPU;
   RecordTypes Type;
@@ -42,7 +42,7 @@ struct YAMLXRayRecord {
   std::string Data;
 };
 
-struct YAMLXRayTrace {
+struct LLVM_CLASS_ABI YAMLXRayTrace {
   YAMLXRayFileHeader Header;
   std::vector<YAMLXRayRecord> Records;
 };
@@ -53,7 +53,7 @@ namespace yaml {
 
 // YAML Traits
 // -----------
-template <> struct ScalarEnumerationTraits<xray::RecordTypes> {
+template <> struct LLVM_CLASS_ABI ScalarEnumerationTraits<xray::RecordTypes> {
   static void enumeration(IO &IO, xray::RecordTypes &Type) {
     IO.enumCase(Type, "function-enter", xray::RecordTypes::ENTER);
     IO.enumCase(Type, "function-exit", xray::RecordTypes::EXIT);
@@ -64,7 +64,7 @@ template <> struct ScalarEnumerationTraits<xray::RecordTypes> {
   }
 };
 
-template <> struct MappingTraits<xray::YAMLXRayFileHeader> {
+template <> struct LLVM_CLASS_ABI MappingTraits<xray::YAMLXRayFileHeader> {
   static void mapping(IO &IO, xray::YAMLXRayFileHeader &Header) {
     IO.mapRequired("version", Header.Version);
     IO.mapRequired("type", Header.Type);
@@ -74,7 +74,7 @@ template <> struct MappingTraits<xray::YAMLXRayFileHeader> {
   }
 };
 
-template <> struct MappingTraits<xray::YAMLXRayRecord> {
+template <> struct LLVM_CLASS_ABI MappingTraits<xray::YAMLXRayRecord> {
   static void mapping(IO &IO, xray::YAMLXRayRecord &Record) {
     IO.mapRequired("type", Record.RecordType);
     IO.mapOptional("func-id", Record.FuncId);
@@ -91,7 +91,7 @@ template <> struct MappingTraits<xray::YAMLXRayRecord> {
   static constexpr bool flow = true;
 };
 
-template <> struct MappingTraits<xray::YAMLXRayTrace> {
+template <> struct LLVM_CLASS_ABI MappingTraits<xray::YAMLXRayTrace> {
   static void mapping(IO &IO, xray::YAMLXRayTrace &Trace) {
     // A trace file contains two parts, the header and the list of all the
     // trace records.
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-actions.h b/third-party/unittest/googlemock/include/gmock/gmock-actions.h
index de58b18edc1d859..14eaf680be19eb6 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-actions.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-actions.h
@@ -84,11 +84,11 @@ namespace internal {
 //
 // This primary template is used when kDefaultConstructible is true.
 template <typename T, bool kDefaultConstructible>
-struct BuiltInDefaultValueGetter {
+struct LLVM_CLASS_ABI BuiltInDefaultValueGetter {
   static T Get() { return T(); }
 };
 template <typename T>
-struct BuiltInDefaultValueGetter<T, false> {
+struct LLVM_CLASS_ABI BuiltInDefaultValueGetter<T, false> {
   static T Get() {
     Assert(false, __FILE__, __LINE__,
            "Default action undefined for the function return type.");
@@ -106,7 +106,7 @@ struct BuiltInDefaultValueGetter<T, false> {
 // other type T, the built-in default T value is undefined, and the
 // function will abort the process.
 template <typename T>
-class BuiltInDefaultValue {
+class LLVM_CLASS_ABI BuiltInDefaultValue {
  public:
   // This function returns true if and only if type T has a built-in default
   // value.
@@ -123,7 +123,7 @@ class BuiltInDefaultValue {
 // This partial specialization says that we use the same built-in
 // default value for T and const T.
 template <typename T>
-class BuiltInDefaultValue<const T> {
+class LLVM_CLASS_ABI BuiltInDefaultValue<const T> {
  public:
   static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
   static T Get() { return BuiltInDefaultValue<T>::Get(); }
@@ -132,7 +132,7 @@ class BuiltInDefaultValue<const T> {
 // This partial specialization defines the default values for pointer
 // types.
 template <typename T>
-class BuiltInDefaultValue<T*> {
+class LLVM_CLASS_ABI BuiltInDefaultValue<T*> {
  public:
   static bool Exists() { return true; }
   static T* Get() { return nullptr; }
@@ -194,7 +194,7 @@ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0);
 //   // Sets the default value for type T to be foo.
 //   DefaultValue<T>::Set(foo);
 template <typename T>
-class DefaultValue {
+class LLVM_CLASS_ABI DefaultValue {
  public:
   // Sets the default value for type T; requires T to be
   // copy-constructable and have a public destructor.
@@ -269,7 +269,7 @@ class DefaultValue {
 // This partial specialization allows a user to set default values for
 // reference types.
 template <typename T>
-class DefaultValue<T&> {
+class LLVM_CLASS_ABI DefaultValue<T&> {
  public:
   // Sets the default value for type T&.
   static void Set(T& x) {  // NOLINT
@@ -303,7 +303,7 @@ class DefaultValue<T&> {
 // This specialization allows DefaultValue<void>::Get() to
 // compile.
 template <>
-class DefaultValue<void> {
+class LLVM_CLASS_ABI DefaultValue<void> {
  public:
   static bool Exists() { return true; }
   static void Get() {}
@@ -319,7 +319,7 @@ T* DefaultValue<T&>::address_ = nullptr;
 
 // Implement this interface to define an action for function type F.
 template <typename F>
-class ActionInterface {
+class LLVM_CLASS_ABI ActionInterface {
  public:
   typedef typename internal::Function<F>::Result Result;
   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
@@ -345,7 +345,7 @@ class ActionInterface {
 // concrete action (including its current state), and an Action<F>
 // object as a handle to it.
 template <typename F>
-class Action {
+class LLVM_CLASS_ABI Action {
   // Adapter class to allow constructing Action from a legacy ActionInterface.
   // New code should create Actions from functors instead.
   struct ActionAdapter {
@@ -431,7 +431,7 @@ class Action {
 // the definition of Return(void) and SetArgumentPointee<N>(value) for
 // complete examples.
 template <typename Impl>
-class PolymorphicAction {
+class LLVM_CLASS_ABI PolymorphicAction {
  public:
   explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
 
@@ -488,7 +488,7 @@ namespace internal {
 // Helper struct to specialize ReturnAction to execute a move instead of a copy
 // on return. Useful for move-only types, but could be used on any type.
 template <typename T>
-struct ByMoveWrapper {
+struct LLVM_CLASS_ABI ByMoveWrapper {
   explicit ByMoveWrapper(T value) : payload(std::move(value)) {}
   T payload;
 };
@@ -521,7 +521,7 @@ struct ByMoveWrapper {
 // of gtl::Container() is passed into Return.
 //
 template <typename R>
-class ReturnAction {
+class LLVM_CLASS_ABI ReturnAction {
  public:
   // Constructs a ReturnAction object from the value to be returned.
   // 'value' is passed by value instead of by const reference in order
@@ -612,7 +612,7 @@ class ReturnAction {
 };
 
 // Implements the ReturnNull() action.
-class ReturnNullAction {
+class LLVM_CLASS_ABI ReturnNullAction {
  public:
   // Allows ReturnNull() to be used in any pointer-returning function. In C++11
   // this is enforced by returning nullptr, and in non-C++11 by asserting a
@@ -624,7 +624,7 @@ class ReturnNullAction {
 };
 
 // Implements the Return() action.
-class ReturnVoidAction {
+class LLVM_CLASS_ABI ReturnVoidAction {
  public:
   // Allows Return() to be used in any void-returning function.
   template <typename Result, typename ArgumentTuple>
@@ -637,7 +637,7 @@ class ReturnVoidAction {
 // in any function that returns a reference to the type of x,
 // regardless of the argument types.
 template <typename T>
-class ReturnRefAction {
+class LLVM_CLASS_ABI ReturnRefAction {
  public:
   // Constructs a ReturnRefAction object from the reference to be returned.
   explicit ReturnRefAction(T& ref) : ref_(ref) {}  // NOLINT
@@ -682,7 +682,7 @@ class ReturnRefAction {
 // used in any function that returns a reference to the type of x,
 // regardless of the argument types.
 template <typename T>
-class ReturnRefOfCopyAction {
+class LLVM_CLASS_ABI ReturnRefOfCopyAction {
  public:
   // Constructs a ReturnRefOfCopyAction object from the reference to
   // be returned.
@@ -726,7 +726,7 @@ class ReturnRefOfCopyAction {
 };
 
 // Implements the polymorphic DoDefault() action.
-class DoDefaultAction {
+class LLVM_CLASS_ABI DoDefaultAction {
  public:
   // This template type conversion operator allows DoDefault() to be
   // used in any function.
@@ -737,7 +737,7 @@ class DoDefaultAction {
 // Implements the Assign action to set a given pointer referent to a
 // particular value.
 template <typename T1, typename T2>
-class AssignAction {
+class LLVM_CLASS_ABI AssignAction {
  public:
   AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}
 
@@ -758,7 +758,7 @@ class AssignAction {
 // Implements the SetErrnoAndReturn action to simulate return from
 // various system calls and libc functions.
 template <typename T>
-class SetErrnoAndReturnAction {
+class LLVM_CLASS_ABI SetErrnoAndReturnAction {
  public:
   SetErrnoAndReturnAction(int errno_value, T result)
       : errno_(errno_value),
@@ -781,7 +781,7 @@ class SetErrnoAndReturnAction {
 // Implements the SetArgumentPointee<N>(x) action for any function
 // whose N-th argument (0-based) is a pointer to x's type.
 template <size_t N, typename A, typename = void>
-struct SetArgumentPointeeAction {
+struct LLVM_CLASS_ABI SetArgumentPointeeAction {
   A value;
 
   template <typename... Args>
@@ -792,7 +792,7 @@ struct SetArgumentPointeeAction {
 
 // Implements the Invoke(object_ptr, &Class::Method) action.
 template <class Class, typename MethodPtr>
-struct InvokeMethodAction {
+struct LLVM_CLASS_ABI InvokeMethodAction {
   Class* const obj_ptr;
   const MethodPtr method_ptr;
 
@@ -808,7 +808,7 @@ struct InvokeMethodAction {
 // function pointer or a functor.  InvokeWithoutArgs(f) can be used as an
 // Action<F> as long as f's type is compatible with F.
 template <typename FunctionImpl>
-struct InvokeWithoutArgsAction {
+struct LLVM_CLASS_ABI InvokeWithoutArgsAction {
   FunctionImpl function_impl;
 
   // Allows InvokeWithoutArgs(f) to be used as any action whose type is
@@ -821,7 +821,7 @@ struct InvokeWithoutArgsAction {
 
 // Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
 template <class Class, typename MethodPtr>
-struct InvokeMethodWithoutArgsAction {
+struct LLVM_CLASS_ABI InvokeMethodWithoutArgsAction {
   Class* const obj_ptr;
   const MethodPtr method_ptr;
 
@@ -836,7 +836,7 @@ struct InvokeMethodWithoutArgsAction {
 
 // Implements the IgnoreResult(action) action.
 template <typename A>
-class IgnoreResultAction {
+class LLVM_CLASS_ABI IgnoreResultAction {
  public:
   explicit IgnoreResultAction(const A& action) : action_(action) {}
 
@@ -889,7 +889,7 @@ class IgnoreResultAction {
 };
 
 template <typename InnerAction, size_t... I>
-struct WithArgsAction {
+struct LLVM_CLASS_ABI WithArgsAction {
   InnerAction action;
 
   // The inner action could be anything convertible to Action<X>.
@@ -907,7 +907,7 @@ struct WithArgsAction {
 };
 
 template <typename... Actions>
-struct DoAllAction {
+struct LLVM_CLASS_ABI DoAllAction {
  private:
   template <typename... Args, size_t... I>
   std::vector<Action<void(Args...)>> Convert(IndexSequence<I...>) const {
@@ -919,7 +919,7 @@ struct DoAllAction {
 
   template <typename R, typename... Args>
   operator Action<R(Args...)>() const {  // NOLINT
-    struct Op {
+    struct LLVM_CLASS_ABI Op {
       std::vector<Action<void(Args...)>> converted;
       Action<R(Args...)> last;
       R operator()(Args... args) const {
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h b/third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h
index 32c57b3b327240b..dcede0b42d5a4af 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h
@@ -64,7 +64,7 @@ namespace testing {
 // management as Cardinality objects can now be copied like plain values.
 
 // The implementation of a cardinality.
-class CardinalityInterface {
+class LLVM_CLASS_ABI CardinalityInterface {
  public:
   virtual ~CardinalityInterface() {}
 
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-generated-actions.h b/third-party/unittest/googlemock/include/gmock/gmock-generated-actions.h
index c538dce8d2726fb..ac13ccd6436f6ea 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-generated-actions.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-generated-actions.h
@@ -66,11 +66,11 @@ namespace internal {
 // instead of testing::internal.  However, this is an INTERNAL TYPE
 // and subject to change without notice, so a user MUST NOT USE THIS
 // TYPE DIRECTLY.
-struct ExcessiveArg {};
+struct LLVM_CLASS_ABI ExcessiveArg {};
 
 // A helper class needed for implementing the ACTION* macros.
 template <typename Result, class Impl>
-class ActionHelper {
+class LLVM_CLASS_ABI ActionHelper {
  public:
   static Result Perform(Impl* impl, const ::std::tuple<>& args) {
     return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
@@ -1637,7 +1637,7 @@ namespace invoke_argument {
 
 // Appears in InvokeArgumentAdl's argument list to help avoid
 // accidental calls to user functions of the same name.
-struct AdlTag {};
+struct LLVM_CLASS_ABI AdlTag {};
 
 // InvokeArgumentAdl - a helper for InvokeArgument.
 // The basic overloads are provided here for generic functors.
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-matchers.h b/third-party/unittest/googlemock/include/gmock/gmock-matchers.h
index 8d636f48c67d6e9..78b116948dee6d4 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-matchers.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-matchers.h
@@ -95,7 +95,7 @@ namespace testing {
 // plain values.
 
 // A match result listener that stores the explanation in a string.
-class StringMatchResultListener : public MatchResultListener {
+class LLVM_CLASS_ABI StringMatchResultListener : public MatchResultListener {
  public:
   StringMatchResultListener() : MatchResultListener(&ss_) {}
 
@@ -126,7 +126,7 @@ namespace internal {
 // Matcher but is not one yet; for example, Eq(value)) or a value (for
 // example, "hello").
 template <typename T, typename M>
-class MatcherCastImpl {
+class LLVM_CLASS_ABI MatcherCastImpl {
  public:
   static Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
     // M can be a polymorphic matcher, in which case we want to use
@@ -191,7 +191,7 @@ class MatcherCastImpl {
 // is already a Matcher.  This only compiles when type T can be
 // statically converted to type U.
 template <typename T, typename U>
-class MatcherCastImpl<T, Matcher<U> > {
+class LLVM_CLASS_ABI MatcherCastImpl<T, Matcher<U> > {
  public:
   static Matcher<T> Cast(const Matcher<U>& source_matcher) {
     return Matcher<T>(new Impl(source_matcher));
@@ -240,7 +240,7 @@ class MatcherCastImpl<T, Matcher<U> > {
 // This even more specialized version is used for efficiently casting
 // a matcher to its own type.
 template <typename T>
-class MatcherCastImpl<T, Matcher<T> > {
+class LLVM_CLASS_ABI MatcherCastImpl<T, Matcher<T> > {
  public:
   static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; }
 };
@@ -261,7 +261,7 @@ inline Matcher<T> MatcherCast(const M& matcher) {
 // FIXME: The intermediate SafeMatcherCastImpl class was introduced as a
 // workaround for a compiler bug, and can now be removed.
 template <typename T>
-class SafeMatcherCastImpl {
+class LLVM_CLASS_ABI SafeMatcherCastImpl {
  public:
   // This overload handles polymorphic matchers and values only since
   // monomorphic matchers are handled by the next one.
@@ -365,7 +365,7 @@ bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,
 // An internal helper class for doing compile-time loop on a tuple's
 // fields.
 template <size_t N>
-class TuplePrefix {
+class LLVM_CLASS_ABI TuplePrefix {
  public:
   // TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true
   // if and only if the first N fields of matcher_tuple matches
@@ -413,7 +413,7 @@ class TuplePrefix {
 
 // The base case.
 template <>
-class TuplePrefix<0> {
+class LLVM_CLASS_ABI TuplePrefix<0> {
  public:
   template <typename MatcherTuple, typename ValueTuple>
   static bool Matches(const MatcherTuple& /* matcher_tuple */,
@@ -459,7 +459,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
 // TransformTupleValuesHelper hides the internal machinery that
 // TransformTupleValues uses to implement a tuple traversal.
 template <typename Tuple, typename Func, typename OutIter>
-class TransformTupleValuesHelper {
+class LLVM_CLASS_ABI TransformTupleValuesHelper {
  private:
   typedef ::std::tuple_size<Tuple> TupleSize;
 
@@ -496,7 +496,7 @@ OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) {
 
 // Implements A<T>().
 template <typename T>
-class AnyMatcherImpl : public MatcherInterface<const T&> {
+class LLVM_CLASS_ABI AnyMatcherImpl : public MatcherInterface<const T&> {
  public:
   bool MatchAndExplain(const T& /* x */,
                        MatchResultListener* /* listener */) const override {
@@ -515,7 +515,7 @@ class AnyMatcherImpl : public MatcherInterface<const T&> {
 // type.  This is a polymorphic matcher, so we need a template type
 // conversion operator to make it appearing as a Matcher<T> for any
 // type T.
-class AnythingMatcher {
+class LLVM_CLASS_ABI AnythingMatcher {
  public:
   template <typename T>
   operator Matcher<T>() const { return A<T>(); }
@@ -523,7 +523,7 @@ class AnythingMatcher {
 
 // Implements the polymorphic IsNull() matcher, which matches any raw or smart
 // pointer that is NULL.
-class IsNullMatcher {
+class LLVM_CLASS_ABI IsNullMatcher {
  public:
   template <typename Pointer>
   bool MatchAndExplain(const Pointer& p,
@@ -539,7 +539,7 @@ class IsNullMatcher {
 
 // Implements the polymorphic NotNull() matcher, which matches any raw or smart
 // pointer that is not NULL.
-class NotNullMatcher {
+class LLVM_CLASS_ABI NotNullMatcher {
  public:
   template <typename Pointer>
   bool MatchAndExplain(const Pointer& p,
@@ -570,7 +570,7 @@ template <typename T>
 class RefMatcher;
 
 template <typename T>
-class RefMatcher<T&> {
+class LLVM_CLASS_ABI RefMatcher<T&> {
   // Google Mock is a generic framework and thus needs to support
   // mocking any function types, including those that take non-const
   // reference arguments.  Therefore the template parameter T (and
@@ -664,7 +664,7 @@ bool CaseInsensitiveStringEquals(const StringType& s1,
 
 // Implements equality-based string matchers like StrEq, StrCaseNe, and etc.
 template <typename StringType>
-class StrEqualityMatcher {
+class LLVM_CLASS_ABI StrEqualityMatcher {
  public:
   StrEqualityMatcher(const StringType& str, bool expect_eq,
                      bool case_sensitive)
@@ -735,7 +735,7 @@ class StrEqualityMatcher {
 // can be used as a Matcher<T> as long as T can be converted to a
 // string.
 template <typename StringType>
-class HasSubstrMatcher {
+class LLVM_CLASS_ABI HasSubstrMatcher {
  public:
   explicit HasSubstrMatcher(const StringType& substring)
       : substring_(substring) {}
@@ -792,7 +792,7 @@ class HasSubstrMatcher {
 // can be used as a Matcher<T> as long as T can be converted to a
 // string.
 template <typename StringType>
-class StartsWithMatcher {
+class LLVM_CLASS_ABI StartsWithMatcher {
  public:
   explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) {
   }
@@ -849,7 +849,7 @@ class StartsWithMatcher {
 // can be used as a Matcher<T> as long as T can be converted to a
 // string.
 template <typename StringType>
-class EndsWithMatcher {
+class LLVM_CLASS_ABI EndsWithMatcher {
  public:
   explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {}
 
@@ -910,7 +910,7 @@ class EndsWithMatcher {
 // etc).  Therefore we use a template type conversion operator in the
 // implementation.
 template <typename D, typename Op>
-class PairMatchBase {
+class LLVM_CLASS_ABI PairMatchBase {
  public:
   template <typename T1, typename T2>
   operator Matcher<::std::tuple<T1, T2>>() const {
@@ -942,27 +942,27 @@ class PairMatchBase {
   };
 };
 
-class Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
+class LLVM_CLASS_ABI Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
  public:
   static const char* Desc() { return "an equal pair"; }
 };
-class Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
+class LLVM_CLASS_ABI Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
  public:
   static const char* Desc() { return "an unequal pair"; }
 };
-class Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
+class LLVM_CLASS_ABI Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
  public:
   static const char* Desc() { return "a pair where the first < the second"; }
 };
-class Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
+class LLVM_CLASS_ABI Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
  public:
   static const char* Desc() { return "a pair where the first > the second"; }
 };
-class Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
+class LLVM_CLASS_ABI Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
  public:
   static const char* Desc() { return "a pair where the first <= the second"; }
 };
-class Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
+class LLVM_CLASS_ABI Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
  public:
   static const char* Desc() { return "a pair where the first >= the second"; }
 };
@@ -972,7 +972,7 @@ class Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
 // will prevent different instantiations of NotMatcher from sharing
 // the same NotMatcherImpl<T> class.
 template <typename T>
-class NotMatcherImpl : public MatcherInterface<const T&> {
+class LLVM_CLASS_ABI NotMatcherImpl : public MatcherInterface<const T&> {
  public:
   explicit NotMatcherImpl(const Matcher<T>& matcher)
       : matcher_(matcher) {}
@@ -999,7 +999,7 @@ class NotMatcherImpl : public MatcherInterface<const T&> {
 // Implements the Not(m) matcher, which matches a value that doesn't
 // match matcher m.
 template <typename InnerMatcher>
-class NotMatcher {
+class LLVM_CLASS_ABI NotMatcher {
  public:
   explicit NotMatcher(InnerMatcher matcher) : matcher_(matcher) {}
 
@@ -1021,7 +1021,7 @@ class NotMatcher {
 // that will prevent different instantiations of BothOfMatcher from
 // sharing the same BothOfMatcherImpl<T> class.
 template <typename T>
-class AllOfMatcherImpl : public MatcherInterface<const T&> {
+class LLVM_CLASS_ABI AllOfMatcherImpl : public MatcherInterface<const T&> {
  public:
   explicit AllOfMatcherImpl(std::vector<Matcher<T> > matchers)
       : matchers_(std::move(matchers)) {}
@@ -1084,7 +1084,7 @@ class AllOfMatcherImpl : public MatcherInterface<const T&> {
 // CombiningMatcher<T> is used to recursively combine the provided matchers
 // (of type Args...).
 template <template <typename T> class CombiningMatcher, typename... Args>
-class VariadicMatcher {
+class LLVM_CLASS_ABI VariadicMatcher {
  public:
   VariadicMatcher(const Args&... matchers)  // NOLINT
       : matchers_(matchers...) {
@@ -1127,7 +1127,7 @@ using AllOfMatcher = VariadicMatcher<AllOfMatcherImpl, Args...>;
 // that will prevent different instantiations of AnyOfMatcher from
 // sharing the same EitherOfMatcherImpl<T> class.
 template <typename T>
-class AnyOfMatcherImpl : public MatcherInterface<const T&> {
+class LLVM_CLASS_ABI AnyOfMatcherImpl : public MatcherInterface<const T&> {
  public:
   explicit AnyOfMatcherImpl(std::vector<Matcher<T> > matchers)
       : matchers_(std::move(matchers)) {}
@@ -1191,7 +1191,7 @@ using AnyOfMatcher = VariadicMatcher<AnyOfMatcherImpl, Args...>;
 
 // Wrapper for implementation of Any/AllOfArray().
 template <template <class> class MatcherImpl, typename T>
-class SomeOfArrayMatcher {
+class LLVM_CLASS_ABI SomeOfArrayMatcher {
  public:
   // Constructs the matcher from a sequence of element values or
   // element matchers.
@@ -1223,7 +1223,7 @@ using AnyOfArrayMatcher = SomeOfArrayMatcher<AnyOfMatcherImpl, T>;
 // Used for implementing Truly(pred), which turns a predicate into a
 // matcher.
 template <typename Predicate>
-class TrulyMatcher {
+class LLVM_CLASS_ABI TrulyMatcher {
  public:
   explicit TrulyMatcher(Predicate pred) : predicate_(pred) {}
 
@@ -1262,7 +1262,7 @@ class TrulyMatcher {
 // Used for implementing Matches(matcher), which turns a matcher into
 // a predicate.
 template <typename M>
-class MatcherAsPredicate {
+class LLVM_CLASS_ABI MatcherAsPredicate {
  public:
   explicit MatcherAsPredicate(M matcher) : matcher_(matcher) {}
 
@@ -1300,7 +1300,7 @@ class MatcherAsPredicate {
 // For implementing ASSERT_THAT() and EXPECT_THAT().  The template
 // argument M must be a type that can be converted to a matcher.
 template <typename M>
-class PredicateFormatterFromMatcher {
+class LLVM_CLASS_ABI PredicateFormatterFromMatcher {
  public:
   explicit PredicateFormatterFromMatcher(M m) : matcher_(std::move(m)) {}
 
@@ -1364,7 +1364,7 @@ MakePredicateFormatterFromMatcher(M matcher) {
 // user-specified epsilon.  The template is meant to be instantiated with
 // FloatType being either float or double.
 template <typename FloatType>
-class FloatingEqMatcher {
+class LLVM_CLASS_ABI FloatingEqMatcher {
  public:
   // Constructor for FloatingEqMatcher.
   // The matcher's input will be compared with expected.  The matcher treats two
@@ -1522,7 +1522,7 @@ class FloatingEqMatcher {
 // against y. The former implements "Eq", the latter "Near". At present, there
 // is no version that compares NaNs as equal.
 template <typename FloatType>
-class FloatingEq2Matcher {
+class LLVM_CLASS_ABI FloatingEq2Matcher {
  public:
   FloatingEq2Matcher() { Init(-1, false); }
 
@@ -1595,7 +1595,7 @@ class FloatingEq2Matcher {
 // Implements the Pointee(m) matcher for matching a pointer whose
 // pointee matches matcher m.  The pointer can be either raw or smart.
 template <typename InnerMatcher>
-class PointeeMatcher {
+class LLVM_CLASS_ABI PointeeMatcher {
  public:
   explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}
 
@@ -1729,7 +1729,7 @@ class WhenDynamicCastToMatcher<To&> : public WhenDynamicCastToMatcherBase<To&> {
 // Implements the Field() matcher for matching a field (i.e. member
 // variable) of an object.
 template <typename Class, typename FieldType>
-class FieldMatcher {
+class LLVM_CLASS_ABI FieldMatcher {
  public:
   FieldMatcher(FieldType Class::*field,
                const Matcher<const FieldType&>& matcher)
@@ -1795,7 +1795,7 @@ class FieldMatcher {
 // Property is a const-qualified member function of Class returning
 // PropertyType.
 template <typename Class, typename PropertyType, typename Property>
-class PropertyMatcher {
+class LLVM_CLASS_ABI PropertyMatcher {
  public:
   typedef const PropertyType& RefToConstProperty;
 
@@ -1862,7 +1862,7 @@ class PropertyMatcher {
 // Type traits specifying various features of different functors for ResultOf.
 // The default template specifies features for functor objects.
 template <typename Functor>
-struct CallableTraits {
+struct LLVM_CLASS_ABI CallableTraits {
   typedef Functor StorageType;
 
   static void CheckIsValid(Functor /* functor */) {}
@@ -1875,7 +1875,7 @@ struct CallableTraits {
 
 // Specialization for function pointers.
 template <typename ArgType, typename ResType>
-struct CallableTraits<ResType(*)(ArgType)> {
+struct LLVM_CLASS_ABI CallableTraits<ResType(*)(ArgType)> {
   typedef ResType ResultType;
   typedef ResType(*StorageType)(ArgType);
 
@@ -1892,7 +1892,7 @@ struct CallableTraits<ResType(*)(ArgType)> {
 // Implements the ResultOf() matcher for matching a return value of a
 // unary function of an object.
 template <typename Callable, typename InnerMatcher>
-class ResultOfMatcher {
+class LLVM_CLASS_ABI ResultOfMatcher {
  public:
   ResultOfMatcher(Callable callable, InnerMatcher matcher)
       : callable_(std::move(callable)), matcher_(std::move(matcher)) {
@@ -1958,7 +1958,7 @@ class ResultOfMatcher {
 
 // Implements a matcher that checks the size of an STL-style container.
 template <typename SizeMatcher>
-class SizeIsMatcher {
+class LLVM_CLASS_ABI SizeIsMatcher {
  public:
   explicit SizeIsMatcher(const SizeMatcher& size_matcher)
        : size_matcher_(size_matcher) {
@@ -2009,7 +2009,7 @@ class SizeIsMatcher {
 // Implements a matcher that checks the begin()..end() distance of an STL-style
 // container.
 template <typename DistanceMatcher>
-class BeginEndDistanceIsMatcher {
+class LLVM_CLASS_ABI BeginEndDistanceIsMatcher {
  public:
   explicit BeginEndDistanceIsMatcher(const DistanceMatcher& distance_matcher)
       : distance_matcher_(distance_matcher) {}
@@ -2077,7 +2077,7 @@ class BeginEndDistanceIsMatcher {
 // Uses the container's const_iterator, value_type, operator ==,
 // begin(), and end().
 template <typename Container>
-class ContainerEqMatcher {
+class LLVM_CLASS_ABI ContainerEqMatcher {
  public:
   typedef internal::StlContainerView<Container> View;
   typedef typename View::type StlContainer;
@@ -2161,14 +2161,14 @@ class ContainerEqMatcher {
 };
 
 // A comparator functor that uses the < operator to compare two values.
-struct LessComparator {
+struct LLVM_CLASS_ABI LessComparator {
   template <typename T, typename U>
   bool operator()(const T& lhs, const U& rhs) const { return lhs < rhs; }
 };
 
 // Implements WhenSortedBy(comparator, container_matcher).
 template <typename Comparator, typename ContainerMatcher>
-class WhenSortedByMatcher {
+class LLVM_CLASS_ABI WhenSortedByMatcher {
  public:
   WhenSortedByMatcher(const Comparator& comparator,
                       const ContainerMatcher& matcher)
@@ -2248,7 +2248,7 @@ class WhenSortedByMatcher {
 // T2&> >, where T1 and T2 are the types of elements in the LHS
 // container and the RHS container respectively.
 template <typename TupleMatcher, typename RhsContainer>
-class PointwiseMatcher {
+class LLVM_CLASS_ABI PointwiseMatcher {
   GTEST_COMPILE_ASSERT_(
       !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>::value,
       use_UnorderedPointwise_with_hash_tables);
@@ -2369,7 +2369,7 @@ class PointwiseMatcher {
 
 // Holds the logic common to ContainsMatcherImpl and EachMatcherImpl.
 template <typename Container>
-class QuantifierMatcherImpl : public MatcherInterface<Container> {
+class LLVM_CLASS_ABI QuantifierMatcherImpl : public MatcherInterface<Container> {
  public:
   typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
   typedef StlContainerView<RawContainer> View;
@@ -2414,7 +2414,7 @@ class QuantifierMatcherImpl : public MatcherInterface<Container> {
 // Implements Contains(element_matcher) for the given argument type Container.
 // Symmetric to EachMatcherImpl.
 template <typename Container>
-class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
+class LLVM_CLASS_ABI ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
  public:
   template <typename InnerMatcher>
   explicit ContainsMatcherImpl(InnerMatcher inner_matcher)
@@ -2443,7 +2443,7 @@ class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
 // Implements Each(element_matcher) for the given argument type Container.
 // Symmetric to ContainsMatcherImpl.
 template <typename Container>
-class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
+class LLVM_CLASS_ABI EachMatcherImpl : public QuantifierMatcherImpl<Container> {
  public:
   template <typename InnerMatcher>
   explicit EachMatcherImpl(InnerMatcher inner_matcher)
@@ -2471,7 +2471,7 @@ class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
 
 // Implements polymorphic Contains(element_matcher).
 template <typename M>
-class ContainsMatcher {
+class LLVM_CLASS_ABI ContainsMatcher {
  public:
   explicit ContainsMatcher(M m) : inner_matcher_(m) {}
 
@@ -2489,7 +2489,7 @@ class ContainsMatcher {
 
 // Implements polymorphic Each(element_matcher).
 template <typename M>
-class EachMatcher {
+class LLVM_CLASS_ABI EachMatcher {
  public:
   explicit EachMatcher(M m) : inner_matcher_(m) {}
 
@@ -2505,8 +2505,8 @@ class EachMatcher {
   GTEST_DISALLOW_ASSIGN_(EachMatcher);
 };
 
-struct Rank1 {};
-struct Rank0 : Rank1 {};
+struct LLVM_CLASS_ABI Rank1 {};
+struct LLVM_CLASS_ABI Rank0 : Rank1 {};
 
 namespace pair_getters {
 using std::get;
@@ -2534,7 +2534,7 @@ auto Second(T& x, Rank0) -> decltype((x.second)) {  // NOLINT
 // inner_matcher.  For example, Contains(Key(Ge(5))) can be used to match an
 // std::map that contains at least one element whose key is >= 5.
 template <typename PairType>
-class KeyMatcherImpl : public MatcherInterface<PairType> {
+class LLVM_CLASS_ABI KeyMatcherImpl : public MatcherInterface<PairType> {
  public:
   typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
   typedef typename RawPairType::first_type KeyType;
@@ -2579,7 +2579,7 @@ class KeyMatcherImpl : public MatcherInterface<PairType> {
 
 // Implements polymorphic Key(matcher_for_key).
 template <typename M>
-class KeyMatcher {
+class LLVM_CLASS_ABI KeyMatcher {
  public:
   explicit KeyMatcher(M m) : matcher_for_key_(m) {}
 
@@ -2598,7 +2598,7 @@ class KeyMatcher {
 // Implements Pair(first_matcher, second_matcher) for the given argument pair
 // type with its two matchers. See Pair() function below.
 template <typename PairType>
-class PairMatcherImpl : public MatcherInterface<PairType> {
+class LLVM_CLASS_ABI PairMatcherImpl : public MatcherInterface<PairType> {
  public:
   typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
   typedef typename RawPairType::first_type FirstType;
@@ -2684,7 +2684,7 @@ class PairMatcherImpl : public MatcherInterface<PairType> {
 
 // Implements polymorphic Pair(first_matcher, second_matcher).
 template <typename FirstMatcher, typename SecondMatcher>
-class PairMatcher {
+class LLVM_CLASS_ABI PairMatcher {
  public:
   PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
       : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
@@ -2704,7 +2704,7 @@ class PairMatcher {
 
 // Implements ElementsAre() and ElementsAreArray().
 template <typename Container>
-class ElementsAreMatcherImpl : public MatcherInterface<Container> {
+class LLVM_CLASS_ABI ElementsAreMatcherImpl : public MatcherInterface<Container> {
  public:
   typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
   typedef internal::StlContainerView<RawContainer> View;
@@ -2904,7 +2904,7 @@ typedef ::std::vector<ElementMatcherPair> ElementMatcherPairs;
 GTEST_API_ ElementMatcherPairs
 FindMaxBipartiteMatching(const MatchMatrix& g);
 
-struct UnorderedMatcherRequire {
+struct LLVM_CLASS_ABI UnorderedMatcherRequire {
   enum Flags {
     Superset = 1 << 0,
     Subset = 1 << 1,
@@ -2959,7 +2959,7 @@ class GTEST_API_ UnorderedElementsAreMatcherImplBase {
 // Implements UnorderedElementsAre, UnorderedElementsAreArray, IsSubsetOf, and
 // IsSupersetOf.
 template <typename Container>
-class UnorderedElementsAreMatcherImpl
+class LLVM_CLASS_ABI UnorderedElementsAreMatcherImpl
     : public MatcherInterface<Container>,
       public UnorderedElementsAreMatcherImplBase {
  public:
@@ -3056,7 +3056,7 @@ class UnorderedElementsAreMatcherImpl
 // Functor for use in TransformTuple.
 // Performs MatcherCast<Target> on an input argument of any type.
 template <typename Target>
-struct CastAndAppendTransform {
+struct LLVM_CLASS_ABI CastAndAppendTransform {
   template <typename Arg>
   Matcher<Target> operator()(const Arg& a) const {
     return MatcherCast<Target>(a);
@@ -3065,7 +3065,7 @@ struct CastAndAppendTransform {
 
 // Implements UnorderedElementsAre.
 template <typename MatcherTuple>
-class UnorderedElementsAreMatcher {
+class LLVM_CLASS_ABI UnorderedElementsAreMatcher {
  public:
   explicit UnorderedElementsAreMatcher(const MatcherTuple& args)
       : matchers_(args) {}
@@ -3097,7 +3097,7 @@ class UnorderedElementsAreMatcher {
 
 // Implements ElementsAre.
 template <typename MatcherTuple>
-class ElementsAreMatcher {
+class LLVM_CLASS_ABI ElementsAreMatcher {
  public:
   explicit ElementsAreMatcher(const MatcherTuple& args) : matchers_(args) {}
 
@@ -3131,7 +3131,7 @@ class ElementsAreMatcher {
 
 // Implements UnorderedElementsAreArray(), IsSubsetOf(), and IsSupersetOf().
 template <typename T>
-class UnorderedElementsAreArrayMatcher {
+class LLVM_CLASS_ABI UnorderedElementsAreArrayMatcher {
  public:
   template <typename Iter>
   UnorderedElementsAreArrayMatcher(UnorderedMatcherRequire::Flags match_flags,
@@ -3154,7 +3154,7 @@ class UnorderedElementsAreArrayMatcher {
 
 // Implements ElementsAreArray().
 template <typename T>
-class ElementsAreArrayMatcher {
+class LLVM_CLASS_ABI ElementsAreArrayMatcher {
  public:
   template <typename Iter>
   ElementsAreArrayMatcher(Iter first, Iter last) : matchers_(first, last) {}
@@ -3185,7 +3185,7 @@ class ElementsAreArrayMatcher {
 // instances of this class in a vector when implementing
 // UnorderedPointwise().
 template <typename Tuple2Matcher, typename Second>
-class BoundSecondMatcher {
+class LLVM_CLASS_ABI BoundSecondMatcher {
  public:
   BoundSecondMatcher(const Tuple2Matcher& tm, const Second& second)
       : tuple2_matcher_(tm), second_value_(second) {}
@@ -3261,7 +3261,7 @@ GTEST_API_ std::string FormatMatcherDescription(bool negation,
 
 // Implements a matcher that checks the value of a optional<> type variable.
 template <typename ValueMatcher>
-class OptionalMatcher {
+class LLVM_CLASS_ABI OptionalMatcher {
  public:
   explicit OptionalMatcher(const ValueMatcher& value_matcher)
       : value_matcher_(value_matcher) {}
@@ -3323,7 +3323,7 @@ void get() {}
 
 // Implements a matcher that checks the value of a variant<> type variable.
 template <typename T>
-class VariantMatcher {
+class LLVM_CLASS_ABI VariantMatcher {
  public:
   explicit VariantMatcher(::testing::Matcher<const T&> matcher)
       : matcher_(std::move(matcher)) {}
@@ -3384,7 +3384,7 @@ void any_cast() {}
 
 // Implements a matcher that any_casts the value.
 template <typename T>
-class AnyCastMatcher {
+class LLVM_CLASS_ABI AnyCastMatcher {
  public:
   explicit AnyCastMatcher(const ::testing::Matcher<const T&>& matcher)
       : matcher_(matcher) {}
@@ -3439,7 +3439,7 @@ class AnyCastMatcher {
 
 // Implements the Args() matcher.
 template <class ArgsTuple, size_t... k>
-class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
+class LLVM_CLASS_ABI ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
  public:
   using RawArgsTuple = typename std::decay<ArgsTuple>::type;
   using SelectedArgs =
@@ -3496,7 +3496,7 @@ class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
 };
 
 template <class InnerMatcher, size_t... k>
-class ArgsMatcher {
+class LLVM_CLASS_ABI ArgsMatcher {
  public:
   explicit ArgsMatcher(InnerMatcher inner_matcher)
       : inner_matcher_(std::move(inner_matcher)) {}
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-nice-strict.h b/third-party/unittest/googlemock/include/gmock/gmock-nice-strict.h
index 140fc19fcd7dc5c..2c2587e1c5ab331 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-nice-strict.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-nice-strict.h
@@ -71,7 +71,7 @@
 namespace testing {
 
 template <class MockClass>
-class NiceMock : public MockClass {
+class LLVM_CLASS_ABI NiceMock : public MockClass {
  public:
   NiceMock() : MockClass() {
     ::testing::Mock::AllowUninterestingCalls(
@@ -109,7 +109,7 @@ class NiceMock : public MockClass {
 };
 
 template <class MockClass>
-class NaggyMock : public MockClass {
+class LLVM_CLASS_ABI NaggyMock : public MockClass {
  public:
   NaggyMock() : MockClass() {
     ::testing::Mock::WarnUninterestingCalls(
@@ -147,7 +147,7 @@ class NaggyMock : public MockClass {
 };
 
 template <class MockClass>
-class StrictMock : public MockClass {
+class LLVM_CLASS_ABI StrictMock : public MockClass {
  public:
   StrictMock() : MockClass() {
     ::testing::Mock::FailUninterestingCalls(
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-spec-builders.h b/third-party/unittest/googlemock/include/gmock/gmock-spec-builders.h
index 80b0b8726fc6173..5d4ae51aa0c579d 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-spec-builders.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-spec-builders.h
@@ -251,7 +251,7 @@ class GTEST_API_ UntypedFunctionMockerBase {
 };  // class UntypedFunctionMockerBase
 
 // Untyped base class for OnCallSpec<F>.
-class UntypedOnCallSpecBase {
+class LLVM_CLASS_ABI UntypedOnCallSpecBase {
  public:
   // The arguments are the location of the ON_CALL() statement.
   UntypedOnCallSpecBase(const char* a_file, int a_line)
@@ -293,7 +293,7 @@ class UntypedOnCallSpecBase {
 
 // This template class implements an ON_CALL spec.
 template <typename F>
-class OnCallSpec : public UntypedOnCallSpecBase {
+class LLVM_CLASS_ABI OnCallSpec : public UntypedOnCallSpecBase {
  public:
   typedef typename Function<F>::ArgumentTuple ArgumentTuple;
   typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
@@ -573,7 +573,7 @@ class GTEST_API_ Expectation {
 // after the first two have both been satisfied.
 //
 // This class is copyable and has value semantics.
-class ExpectationSet {
+class LLVM_CLASS_ABI ExpectationSet {
  public:
   // A bidirectional iterator that can read a const element in the set.
   typedef Expectation::Set::const_iterator const_iterator;
@@ -887,7 +887,7 @@ class GTEST_API_ ExpectationBase {
 
 // Impements an expectation for the given function type.
 template <typename F>
-class TypedExpectation : public ExpectationBase {
+class LLVM_CLASS_ABI TypedExpectation : public ExpectationBase {
  public:
   typedef typename Function<F>::ArgumentTuple ArgumentTuple;
   typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
@@ -1250,7 +1250,7 @@ GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
                                 const std::string& message);
 
 template <typename F>
-class MockSpec {
+class LLVM_CLASS_ABI MockSpec {
  public:
   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
   typedef typename internal::Function<F>::ArgumentMatcherTuple
@@ -1309,7 +1309,7 @@ class MockSpec {
 // comments describe the contract for the whole template (including
 // specializations).
 template <typename T>
-class ReferenceOrValueWrapper {
+class LLVM_CLASS_ABI ReferenceOrValueWrapper {
  public:
   // Constructs a wrapper from the given value/reference.
   explicit ReferenceOrValueWrapper(T value)
@@ -1336,7 +1336,7 @@ class ReferenceOrValueWrapper {
 // Specialization for lvalue reference types. See primary template
 // for documentation.
 template <typename T>
-class ReferenceOrValueWrapper<T&> {
+class LLVM_CLASS_ABI ReferenceOrValueWrapper<T&> {
  public:
   // Workaround for debatable pass-by-reference lint warning (c-library-team
   // policy precludes NOLINT in this context)
@@ -1365,7 +1365,7 @@ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355)
 // non-void-returning mock functions.
 
 // Untyped base class for ActionResultHolder<T>.
-class UntypedActionResultHolderBase {
+class LLVM_CLASS_ABI UntypedActionResultHolderBase {
  public:
   virtual ~UntypedActionResultHolderBase() {}
 
@@ -1375,7 +1375,7 @@ class UntypedActionResultHolderBase {
 
 // This generic definition is used when T is not void.
 template <typename T>
-class ActionResultHolder : public UntypedActionResultHolderBase {
+class LLVM_CLASS_ABI ActionResultHolder : public UntypedActionResultHolderBase {
  public:
   // Returns the held value. Must not be called more than once.
   T Unwrap() {
@@ -1423,7 +1423,7 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
 
 // Specialization for T = void.
 template <>
-class ActionResultHolder<void> : public UntypedActionResultHolderBase {
+class LLVM_CLASS_ABI ActionResultHolder<void> : public UntypedActionResultHolderBase {
  public:
   void Unwrap() { }
 
@@ -1458,7 +1458,7 @@ template <typename F>
 class FunctionMocker;
 
 template <typename R, typename... Args>
-class FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase {
+class LLVM_CLASS_ABI FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase {
   using F = R(Args...);
 
  public:
@@ -1790,7 +1790,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4355
 
 // Reports an uninteresting call (whose description is in msg) in the
 // manner specified by 'reaction'.
-void ReportUninterestingCall(CallReaction reaction, const std::string& msg);
+LLVM_FUNC_ABI void ReportUninterestingCall(CallReaction reaction, const std::string& msg);
 
 }  // namespace internal
 
@@ -1844,7 +1844,7 @@ template <typename F>
 class MockFunction;
 
 template <typename R, typename... Args>
-class MockFunction<R(Args...)> {
+class LLVM_CLASS_ABI MockFunction<R(Args...)> {
  public:
   MockFunction() {}
   MockFunction(const MockFunction&) = delete;
diff --git a/third-party/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h b/third-party/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
index 9ee68b7261bc4db..d40358838ba204d 100644
--- a/third-party/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
+++ b/third-party/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
@@ -79,14 +79,14 @@ GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name);
 // following default implementation is for the case where Pointer is a
 // smart pointer.
 template <typename Pointer>
-struct PointeeOf {
+struct LLVM_CLASS_ABI PointeeOf {
   // Smart pointer classes define type element_type as the type of
   // their pointees.
   typedef typename Pointer::element_type type;
 };
 // This specialization is for the raw pointer case.
 template <typename T>
-struct PointeeOf<T*> { typedef T type; };  // NOLINT
+struct LLVM_CLASS_ABI PointeeOf<T*> { typedef T type; };  // NOLINT
 
 // GetRawPointer(p) returns the raw pointer underlying p when p is a
 // smart pointer, or returns p itself when p is already a raw pointer.
@@ -119,7 +119,7 @@ enum TypeKind {
 };
 
 // KindOf<T>::value is the kind of type T.
-template <typename T> struct KindOf {
+template <typename T> struct LLVM_CLASS_ABI KindOf {
   enum { value = kOther };  // The default kind.
 };
 
@@ -173,32 +173,32 @@ GMOCK_DECLARE_KIND_(long double, kFloatingPoint);
 // From, and kToKind is the kind of To; the value is
 // implementation-defined when the above pre-condition is violated.
 template <TypeKind kFromKind, typename From, TypeKind kToKind, typename To>
-struct LosslessArithmeticConvertibleImpl : public std::false_type {};
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl : public std::false_type {};
 
 // Converting bool to bool is lossless.
 template <>
-struct LosslessArithmeticConvertibleImpl<kBool, bool, kBool, bool>
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kBool, bool, kBool, bool>
     : public std::true_type {};
 
 // Converting bool to any integer type is lossless.
 template <typename To>
-struct LosslessArithmeticConvertibleImpl<kBool, bool, kInteger, To>
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kBool, bool, kInteger, To>
     : public std::true_type {};
 
 // Converting bool to any floating-point type is lossless.
 template <typename To>
-struct LosslessArithmeticConvertibleImpl<kBool, bool, kFloatingPoint, To>
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kBool, bool, kFloatingPoint, To>
     : public std::true_type {};
 
 // Converting an integer to bool is lossy.
 template <typename From>
-struct LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool>
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool>
     : public std::false_type {};
 
 // Converting an integer to another non-bool integer is lossless
 // if and only if the target type's range encloses the source type's range.
 template <typename From, typename To>
-struct LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>
     : public bool_constant<
       // When converting from a smaller size to a larger size, we are
       // fine as long as we are not converting from signed to unsigned.
@@ -213,23 +213,23 @@ struct LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>
 // Converting an integer to a floating-point type may be lossy, since
 // the format of a floating-point number is implementation-defined.
 template <typename From, typename To>
-struct LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
     : public std::false_type {};
 
 // Converting a floating-point to bool is lossy.
 template <typename From>
-struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
     : public std::false_type {};
 
 // Converting a floating-point to an integer is lossy.
 template <typename From, typename To>
-struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
     : public std::false_type {};
 
 // Converting a floating-point to another floating-point is lossless
 // if and only if the target type is at least as big as the source type.
 template <typename From, typename To>
-struct LosslessArithmeticConvertibleImpl<
+struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<
   kFloatingPoint, From, kFloatingPoint, To>
     : public bool_constant<sizeof(From) <= sizeof(To)> {};  // NOLINT
 
@@ -241,13 +241,13 @@ struct LosslessArithmeticConvertibleImpl<
 // reference) built-in arithmetic types; the value is
 // implementation-defined when the above pre-condition is violated.
 template <typename From, typename To>
-struct LosslessArithmeticConvertible
+struct LLVM_CLASS_ABI LosslessArithmeticConvertible
     : public LosslessArithmeticConvertibleImpl<
   GMOCK_KIND_OF_(From), From, GMOCK_KIND_OF_(To), To> {};  // NOLINT
 
 // This interface knows how to report a Google Mock failure (either
 // non-fatal or fatal).
-class FailureReporterInterface {
+class LLVM_CLASS_ABI FailureReporterInterface {
  public:
   // The type of a failure (either non-fatal or fatal).
   enum FailureType {
@@ -328,7 +328,7 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
 //
 //    ON_CALL(mock, Method({}, nullptr))...
 //
-class WithoutMatchers {
+class LLVM_CLASS_ABI WithoutMatchers {
  private:
   WithoutMatchers() {}
   friend GTEST_API_ WithoutMatchers GetWithoutMatchers();
@@ -381,7 +381,7 @@ inline T Invalid() {
 // This generic version is used when RawContainer itself is already an
 // STL-style container.
 template <class RawContainer>
-class StlContainerView {
+class LLVM_CLASS_ABI StlContainerView {
  public:
   typedef RawContainer type;
   typedef const type& const_reference;
@@ -396,7 +396,7 @@ class StlContainerView {
 
 // This specialization is used when RawContainer is a native array type.
 template <typename Element, size_t N>
-class StlContainerView<Element[N]> {
+class LLVM_CLASS_ABI StlContainerView<Element[N]> {
  public:
   typedef typename std::remove_const<Element>::type RawElement;
   typedef internal::NativeArray<RawElement> type;
@@ -420,7 +420,7 @@ class StlContainerView<Element[N]> {
 // This specialization is used when RawContainer is a native array
 // represented as a (pointer, size) tuple.
 template <typename ElementPointer, typename Size>
-class StlContainerView< ::std::tuple<ElementPointer, Size> > {
+class LLVM_CLASS_ABI StlContainerView< ::std::tuple<ElementPointer, Size> > {
  public:
   typedef typename std::remove_const<
       typename internal::PointeeOf<ElementPointer>::type>::type RawElement;
@@ -445,13 +445,13 @@ template <typename T> class StlContainerView<T&>;
 // Pairs like that are used as the value_type of associative containers,
 // and this transform produces a similar but assignable pair.
 template <typename T>
-struct RemoveConstFromKey {
+struct LLVM_CLASS_ABI RemoveConstFromKey {
   typedef T type;
 };
 
 // Partially specialized to remove constness from std::pair<const K, V>.
 template <typename K, typename V>
-struct RemoveConstFromKey<std::pair<const K, V> > {
+struct LLVM_CLASS_ABI RemoveConstFromKey<std::pair<const K, V> > {
   typedef std::pair<K, V> type;
 };
 
@@ -491,7 +491,7 @@ template <typename T>
 struct Function;
 
 template <typename R, typename... Args>
-struct Function<R(Args...)> {
+struct LLVM_CLASS_ABI Function<R(Args...)> {
   using Result = R;
   static constexpr size_t ArgumentCount = sizeof...(Args);
   template <size_t I>
diff --git a/third-party/unittest/googletest/include/gtest/gtest-message.h b/third-party/unittest/googletest/include/gtest/gtest-message.h
index 5802907f939539d..1723bd3d69dfebf 100644
--- a/third-party/unittest/googletest/include/gtest/gtest-message.h
+++ b/third-party/unittest/googletest/include/gtest/gtest-message.h
@@ -61,7 +61,7 @@ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
 
 // Ensures that there is at least one operator<< in the global namespace.
 // See Message& operator<<(...) below for why.
-void operator<<(const testing::internal::Secret&, int);
+LLVM_FUNC_ABI void operator<<(const testing::internal::Secret&, int);
 
 namespace testing {
 
diff --git a/third-party/unittest/googletest/include/gtest/gtest-test-part.h b/third-party/unittest/googletest/include/gtest/gtest-test-part.h
index 53526c98ee8913e..f5e40fbaf044d8c 100644
--- a/third-party/unittest/googletest/include/gtest/gtest-test-part.h
+++ b/third-party/unittest/googletest/include/gtest/gtest-test-part.h
@@ -124,7 +124,7 @@ class GTEST_API_ TestPartResult {
 };
 
 // Prints a TestPartResult object.
-std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
+LLVM_FUNC_ABI std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
 
 // An array of TestPartResult objects.
 //
diff --git a/third-party/unittest/googletest/include/gtest/gtest.h b/third-party/unittest/googletest/include/gtest/gtest.h
index eb5c5cc0d0b6c44..838d840fbba4db1 100644
--- a/third-party/unittest/googletest/include/gtest/gtest.h
+++ b/third-party/unittest/googletest/include/gtest/gtest.h
@@ -173,8 +173,8 @@ class TestEventRepeater;
 class UnitTestRecordPropertyTestHelper;
 class WindowsDeathTest;
 class FuchsiaDeathTest;
-class UnitTestImpl* GetUnitTestImpl();
-void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
+LLVM_FUNC_ABI class UnitTestImpl* GetUnitTestImpl();
+LLVM_FUNC_ABI void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
                                     const std::string& message);
 
 }  // namespace internal
@@ -1418,9 +1418,9 @@ class GTEST_API_ UnitTest {
   friend class internal::AssertHelper;
   friend class internal::StreamingListenerTest;
   friend class internal::UnitTestRecordPropertyTestHelper;
-  friend Environment* AddGlobalTestEnvironment(Environment* env);
-  friend internal::UnitTestImpl* internal::GetUnitTestImpl();
-  friend void internal::ReportFailureInUnknownLocation(
+  friend LLVM_FUNC_ABI Environment* AddGlobalTestEnvironment(Environment* env);
+  friend LLVM_FUNC_ABI internal::UnitTestImpl* internal::GetUnitTestImpl();
+  friend LLVM_FUNC_ABI void internal::ReportFailureInUnknownLocation(
       TestPartResult::Type result_type,
       const std::string& message);
 
@@ -2466,7 +2466,7 @@ TestInfo* RegisterTest(const char* test_suite_name, const char* test_name,
 //
 // This function was formerly a macro; thus, it is in the global
 // namespace and has an all-caps name.
-int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
+LLVM_FUNC_ABI int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
 
 inline int RUN_ALL_TESTS() {
   return ::testing::UnitTest::GetInstance()->Run();
diff --git a/third-party/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h b/third-party/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
index 052dc978252e190..a0751226f8ca063 100644
--- a/third-party/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ b/third-party/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
@@ -296,7 +296,7 @@ class InternalRunDeathTestFlag {
 // Returns a newly created InternalRunDeathTestFlag object with fields
 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
 // the flag is specified; otherwise returns NULL.
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
+LLVM_FUNC_ABI InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
 
 #endif  // GTEST_HAS_DEATH_TEST
 
diff --git a/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h b/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h
index d861a0a4f76fff8..6b7ee094f869d06 100644
--- a/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h
+++ b/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h
@@ -648,7 +648,7 @@ inline std::string GetPrefixUntilComma(const char* str) {
 
 // Splits a given string on a given delimiter, populating a given
 // vector with the fields.
-void SplitString(const ::std::string& str, char delimiter,
+LLVM_FUNC_ABI void SplitString(const ::std::string& str, char delimiter,
                  ::std::vector< ::std::string>* dest);
 
 // The default argument to the template below for the case when the user does
diff --git a/third-party/unittest/googletest/include/gtest/internal/gtest-port.h b/third-party/unittest/googletest/include/gtest/internal/gtest-port.h
index 9ec07b8d4a6ad4c..ba2dfc68e642e87 100644
--- a/third-party/unittest/googletest/include/gtest/internal/gtest-port.h
+++ b/third-party/unittest/googletest/include/gtest/internal/gtest-port.h
@@ -1139,11 +1139,11 @@ GTEST_API_ std::vector<std::string> GetArgvs();
 
 #if GTEST_HAS_DEATH_TEST
 
-std::vector<std::string> GetInjectableArgvs();
+LLVM_FUNC_ABI std::vector<std::string> GetInjectableArgvs();
 // Deprecated: pass the args vector by value instead.
-void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
-void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
-void ClearInjectableArgvs();
+LLVM_FUNC_ABI void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
+LLVM_FUNC_ABI void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
+LLVM_FUNC_ABI void ClearInjectableArgvs();
 
 #endif  // GTEST_HAS_DEATH_TEST
 
@@ -2200,14 +2200,14 @@ typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
 // to *value and returns true; otherwise leaves *value unchanged and returns
 // false.
-bool ParseInt32(const Message& src_text, const char* str, Int32* value);
+LLVM_FUNC_ABI bool ParseInt32(const Message& src_text, const char* str, Int32* value);
 
 // Parses a bool/Int32/string from the environment variable
 // corresponding to the given Google Test flag.
-bool BoolFromGTestEnv(const char* flag, bool default_val);
+LLVM_FUNC_ABI bool BoolFromGTestEnv(const char* flag, bool default_val);
 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
-std::string OutputFlagAlsoCheckEnvVar();
-const char* StringFromGTestEnv(const char* flag, const char* default_val);
+LLVM_FUNC_ABI std::string OutputFlagAlsoCheckEnvVar();
+LLVM_FUNC_ABI const char* StringFromGTestEnv(const char* flag, const char* default_val);
 
 }  // namespace internal
 }  // namespace testing

>From 5e74b4ceb614fb2ef92fdb67547eaf4bb0f2abca Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Mon, 31 Jul 2023 18:51:26 +0000
Subject: [PATCH 17/39] Support/Threading: Include Support/thread.h before api
 implementations

This header was included after the implementations to work around an
issue with FreeBSD, however, this causes some issues when adding
dllimport attributes to the headers on Windows.
---
 llvm/lib/Support/Unix/Threading.inc    | 8 ++++++++
 llvm/lib/Support/Windows/Threading.inc | 1 +
 2 files changed, 9 insertions(+)

diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc
index 819748db4ec21e8..b34a1988a745f73 100644
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -33,6 +33,14 @@
 #include <pthread_np.h> // For pthread_getthreadid_np() / pthread_set_name_np()
 #endif
 
+
+// Must be included after Threading.inc to provide definition for llvm::thread
+// because FreeBSD's condvar.h (included by user.h) misuses the "thread"
+// keyword.
+#ifndef __FreeBSD__
+#include "llvm/Support/thread.h"
+#endif
+
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <errno.h>
 #include <sys/cpuset.h>
diff --git a/llvm/lib/Support/Windows/Threading.inc b/llvm/lib/Support/Windows/Threading.inc
index 4baf8b8cb82aed3..d862dbd7f71c9d5 100644
--- a/llvm/lib/Support/Windows/Threading.inc
+++ b/llvm/lib/Support/Windows/Threading.inc
@@ -12,6 +12,7 @@
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/thread.h"
 
 #include "llvm/Support/Windows/WindowsSupport.h"
 #include <process.h>

>From 52328cff69255447f74356c09e80c9470a4e5005 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 4 Aug 2023 22:47:17 +0000
Subject: [PATCH 18/39] Manuall fixups

---
 llvm/include/llvm-c/Core.h                          | 2 +-
 llvm/include/llvm/IR/Dominators.h                   | 2 +-
 llvm/include/llvm/IR/PassManager.h                  | 8 ++++----
 llvm/include/llvm/Object/ELF.h                      | 5 +++++
 llvm/include/llvm/Object/XCOFFObjectFile.h          | 9 +++++++--
 llvm/lib/Analysis/LazyValueInfo.cpp                 | 1 +
 llvm/lib/Analysis/RegionInfo.cpp                    | 1 +
 llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp | 1 +
 llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp | 1 +
 llvm/utils/TableGen/DirectiveEmitter.cpp            | 8 ++++----
 10 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h
index 435ed90f3833b1f..9a219a1cfeb92ff 100644
--- a/llvm/include/llvm-c/Core.h
+++ b/llvm/include/llvm-c/Core.h
@@ -1801,7 +1801,7 @@ LLVM_FUNC_ABI LLVMBool LLVMIsPoison(LLVMValueRef Val);
  * @see llvm::dyn_cast_or_null<>
  */
 #define LLVM_DECLARE_VALUE_CAST(name) \
-  LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
+  LLVM_FUNC_ABI LLVMValueRef LLVMIsA##name(LLVMValueRef Val);
 LLVM_FUNC_ABI LLVM_FOR_EACH_VALUE_SUBCLASS(LLVM_DECLARE_VALUE_CAST)
 
 LLVM_FUNC_ABI LLVMValueRef LLVMIsAMDNode(LLVMValueRef Val);
diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h
index 74aca8ab7afca05..e2f90e8be6ec2d6 100644
--- a/llvm/include/llvm/IR/Dominators.h
+++ b/llvm/include/llvm/IR/Dominators.h
@@ -63,7 +63,7 @@ using BBUpdates = ArrayRef<llvm::cfg::Update<BasicBlock *>>;
 using BBDomTreeGraphDiff = GraphDiff<BasicBlock *, false>;
 using BBPostDomTreeGraphDiff = GraphDiff<BasicBlock *, true>;
 
-extern template void Calculate<BBDomTree>(BBDomTree &DT);
+extern template LLVM_FUNC_ABI void Calculate<BBDomTree>(BBDomTree &DT);
 extern template void CalculateWithUpdates<BBDomTree>(BBDomTree &DT,
                                                      BBUpdates U);
 
diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h
index d01a486b2cea82e..2488ae2a374bad9 100644
--- a/llvm/include/llvm/IR/PassManager.h
+++ b/llvm/include/llvm/IR/PassManager.h
@@ -577,12 +577,12 @@ class LLVM_CLASS_ABI PassManager : public PassInfoMixin<
   std::vector<std::unique_ptr<PassConceptT>> Passes;
 };
 
-extern template class PassManager<Module>;
+extern template class LLVM_CLASS_ABI PassManager<Module>;
 
 /// Convenience typedef for a pass manager over modules.
 using ModulePassManager = PassManager<Module>;
 
-extern template class PassManager<Function>;
+extern template class LLVM_CLASS_ABI PassManager<Function>;
 
 /// Convenience typedef for a pass manager over functions.
 using FunctionPassManager = PassManager<Function>;
@@ -902,12 +902,12 @@ template <typename IRUnitT, typename... ExtraArgTs> class LLVM_CLASS_ABI Analysi
   AnalysisResultMapT AnalysisResults;
 };
 
-extern template class AnalysisManager<Module>;
+extern template class LLVM_CLASS_ABI AnalysisManager<Module>;
 
 /// Convenience typedef for the Module analysis manager.
 using ModuleAnalysisManager = AnalysisManager<Module>;
 
-extern template class AnalysisManager<Function>;
+extern template class LLVM_CLASS_ABI AnalysisManager<Function>;
 
 /// Convenience typedef for the Function analysis manager.
 using FunctionAnalysisManager = AnalysisManager<Function>;
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index 682aafa6b9ad0c8..275b663e3fe704a 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -1273,6 +1273,11 @@ inline uint32_t hashGnu(StringRef Name) {
   return H;
 }
 
+extern template class LLVM_CLASS_ABI llvm::object::ELFFile<ELF32LE>;
+extern template class LLVM_CLASS_ABI llvm::object::ELFFile<ELF32BE>;
+extern template class LLVM_CLASS_ABI llvm::object::ELFFile<ELF64LE>;
+extern template class LLVM_CLASS_ABI llvm::object::ELFFile<ELF64BE>;
+
 } // end namespace object
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/Object/XCOFFObjectFile.h b/llvm/include/llvm/Object/XCOFFObjectFile.h
index 2018ac3a88dbecd..62ac25afc6ffdc0 100644
--- a/llvm/include/llvm/Object/XCOFFObjectFile.h
+++ b/llvm/include/llvm/Object/XCOFFObjectFile.h
@@ -511,8 +511,8 @@ template <typename AddressType> struct LLVM_CLASS_ABI XCOFFRelocation {
   uint8_t getRelocatedLength() const;
 };
 
-extern template struct XCOFFRelocation<llvm::support::ubig32_t>;
-extern template struct XCOFFRelocation<llvm::support::ubig64_t>;
+extern template struct LLVM_CLASS_ABI XCOFFRelocation<llvm::support::ubig32_t>;
+extern template struct LLVM_CLASS_ABI XCOFFRelocation<llvm::support::ubig64_t>;
 
 struct LLVM_CLASS_ABI XCOFFRelocation32 : XCOFFRelocation<llvm::support::ubig32_t> {};
 struct LLVM_CLASS_ABI XCOFFRelocation64 : XCOFFRelocation<llvm::support::ubig64_t> {};
@@ -718,6 +718,11 @@ class LLVM_CLASS_ABI XCOFFObjectFile : public ObjectFile {
   static bool classof(const Binary *B) { return B->isXCOFF(); }
 }; // XCOFFObjectFile
 
+extern template Expected<ArrayRef<ExceptionSectionEntry32>> LLVM_FUNC_ABI
+XCOFFObjectFile::getExceptionEntries() const;
+extern template Expected<ArrayRef<ExceptionSectionEntry64>> LLVM_FUNC_ABI
+XCOFFObjectFile::getExceptionEntries() const;
+
 typedef struct LLVM_CLASS_ABI {
   uint8_t LanguageId;
   uint8_t CpuTypeId;
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 7a40259492abf3e..99d7995572e9443 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -17,6 +17,7 @@
 #include "llvm/Analysis/AssumptionCache.h"
 #include "llvm/Analysis/ConstantFolding.h"
 #include "llvm/Analysis/InstructionSimplify.h"
+#include "llvm/Analysis/Passes.h"
 #include "llvm/Analysis/TargetLibraryInfo.h"
 #include "llvm/Analysis/ValueLattice.h"
 #include "llvm/Analysis/ValueTracking.h"
diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp
index 9be23a374eca5ae..5f42343efab263f 100644
--- a/llvm/lib/Analysis/RegionInfo.cpp
+++ b/llvm/lib/Analysis/RegionInfo.cpp
@@ -16,6 +16,7 @@
 #include "llvm/Analysis/RegionPrinter.h"
 #endif
 #include "llvm/Analysis/RegionInfoImpl.h"
+#include "llvm/Analysis/Passes.h"
 #include "llvm/Config/llvm-config.h"
 #include "llvm/IR/Function.h"
 #include "llvm/Support/CommandLine.h"
diff --git a/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp b/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp
index e3f4cdd21557e28..52cf1ff1376d08b 100644
--- a/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp
+++ b/llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp
@@ -10,6 +10,7 @@
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExpr.h"
 #include "llvm/MC/MCInst.h"
+#include "llvm/MC/TargetRegistry.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cstring>
 
diff --git a/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp b/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
index e866fe681127546..6dccf6a65ee392a 100644
--- a/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
+++ b/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
@@ -71,6 +71,7 @@
 #include "llvm/InitializePasses.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Transforms/Scalar.h"
 
 using namespace llvm;
 
diff --git a/llvm/utils/TableGen/DirectiveEmitter.cpp b/llvm/utils/TableGen/DirectiveEmitter.cpp
index 67033c6290ca0e6..dcc543e9beff282 100644
--- a/llvm/utils/TableGen/DirectiveEmitter.cpp
+++ b/llvm/utils/TableGen/DirectiveEmitter.cpp
@@ -251,7 +251,7 @@ static void GenerateGetName(const std::vector<Record *> &Records,
                             const DirectiveLanguage &DirLang,
                             StringRef Prefix) {
   OS << "\n";
-  OS << "llvm::StringRef llvm::" << DirLang.getCppNamespace() << "::get"
+  OS << "LLVM_FUNC_ABI llvm::StringRef llvm::" << DirLang.getCppNamespace() << "::get"
      << DirLang.getName() << Enum << "Name(" << Enum << " Kind) {\n";
   OS << "  switch (Kind) {\n";
   for (const auto &R : Records) {
@@ -287,7 +287,7 @@ static void GenerateGetKind(const std::vector<Record *> &Records,
   BaseRecord DefaultRec{(*DefaultIt)};
 
   OS << "\n";
-  OS << Enum << " llvm::" << DirLang.getCppNamespace() << "::get"
+  OS << "LLVM_FUNC_ABI " << Enum << " llvm::" << DirLang.getCppNamespace() << "::get"
      << DirLang.getName() << Enum << "Kind(llvm::StringRef Str) {\n";
   OS << "  return llvm::StringSwitch<" << Enum << ">(Str)\n";
 
@@ -333,7 +333,7 @@ static void GenerateGetKindClauseVal(const DirectiveLanguage &DirLang,
     }
 
     OS << "\n";
-    OS << EnumName << " llvm::" << DirLang.getCppNamespace() << "::get"
+    OS << "LLVM_FUNC_ABI " << EnumName << " llvm::" << DirLang.getCppNamespace() << "::get"
        << EnumName << "(llvm::StringRef Str) {\n";
     OS << "  return llvm::StringSwitch<" << EnumName << ">(Str)\n";
     for (const auto &CV : ClauseVals) {
@@ -385,7 +385,7 @@ GenerateCaseForVersionedClauses(const std::vector<Record *> &Clauses,
 static void GenerateIsAllowedClause(const DirectiveLanguage &DirLang,
                                     raw_ostream &OS) {
   OS << "\n";
-  OS << "bool llvm::" << DirLang.getCppNamespace()
+  OS << "LLVM_FUNC_ABI bool llvm::" << DirLang.getCppNamespace()
      << "::isAllowedClauseForDirective("
      << "Directive D, Clause C, unsigned Version) {\n";
   OS << "  assert(unsigned(D) <= llvm::" << DirLang.getCppNamespace()

>From 98e91b0e4a21c904b43c5fcf795b395f88bfbab5 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 4 Aug 2023 22:48:29 +0000
Subject: [PATCH 19/39] XXX: Undo gtest changes

---
 .../googlemock/include/gmock/gmock-actions.h  |  56 +++----
 .../include/gmock/gmock-cardinalities.h       |   2 +-
 .../include/gmock/gmock-generated-actions.h   |   6 +-
 .../googlemock/include/gmock/gmock-matchers.h | 144 +++++++++---------
 .../include/gmock/gmock-nice-strict.h         |   6 +-
 .../include/gmock/gmock-spec-builders.h       |  26 ++--
 .../gmock/internal/gmock-internal-utils.h     |  44 +++---
 .../googletest/include/gtest/gtest-message.h  |   2 +-
 .../include/gtest/gtest-test-part.h           |   2 +-
 .../unittest/googletest/include/gtest/gtest.h |  12 +-
 .../internal/gtest-death-test-internal.h      |   2 +-
 .../include/gtest/internal/gtest-internal.h   |   2 +-
 .../include/gtest/internal/gtest-port.h       |  16 +-
 13 files changed, 160 insertions(+), 160 deletions(-)

diff --git a/third-party/unittest/googlemock/include/gmock/gmock-actions.h b/third-party/unittest/googlemock/include/gmock/gmock-actions.h
index 14eaf680be19eb6..de58b18edc1d859 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-actions.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-actions.h
@@ -84,11 +84,11 @@ namespace internal {
 //
 // This primary template is used when kDefaultConstructible is true.
 template <typename T, bool kDefaultConstructible>
-struct LLVM_CLASS_ABI BuiltInDefaultValueGetter {
+struct BuiltInDefaultValueGetter {
   static T Get() { return T(); }
 };
 template <typename T>
-struct LLVM_CLASS_ABI BuiltInDefaultValueGetter<T, false> {
+struct BuiltInDefaultValueGetter<T, false> {
   static T Get() {
     Assert(false, __FILE__, __LINE__,
            "Default action undefined for the function return type.");
@@ -106,7 +106,7 @@ struct LLVM_CLASS_ABI BuiltInDefaultValueGetter<T, false> {
 // other type T, the built-in default T value is undefined, and the
 // function will abort the process.
 template <typename T>
-class LLVM_CLASS_ABI BuiltInDefaultValue {
+class BuiltInDefaultValue {
  public:
   // This function returns true if and only if type T has a built-in default
   // value.
@@ -123,7 +123,7 @@ class LLVM_CLASS_ABI BuiltInDefaultValue {
 // This partial specialization says that we use the same built-in
 // default value for T and const T.
 template <typename T>
-class LLVM_CLASS_ABI BuiltInDefaultValue<const T> {
+class BuiltInDefaultValue<const T> {
  public:
   static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
   static T Get() { return BuiltInDefaultValue<T>::Get(); }
@@ -132,7 +132,7 @@ class LLVM_CLASS_ABI BuiltInDefaultValue<const T> {
 // This partial specialization defines the default values for pointer
 // types.
 template <typename T>
-class LLVM_CLASS_ABI BuiltInDefaultValue<T*> {
+class BuiltInDefaultValue<T*> {
  public:
   static bool Exists() { return true; }
   static T* Get() { return nullptr; }
@@ -194,7 +194,7 @@ GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0);
 //   // Sets the default value for type T to be foo.
 //   DefaultValue<T>::Set(foo);
 template <typename T>
-class LLVM_CLASS_ABI DefaultValue {
+class DefaultValue {
  public:
   // Sets the default value for type T; requires T to be
   // copy-constructable and have a public destructor.
@@ -269,7 +269,7 @@ class LLVM_CLASS_ABI DefaultValue {
 // This partial specialization allows a user to set default values for
 // reference types.
 template <typename T>
-class LLVM_CLASS_ABI DefaultValue<T&> {
+class DefaultValue<T&> {
  public:
   // Sets the default value for type T&.
   static void Set(T& x) {  // NOLINT
@@ -303,7 +303,7 @@ class LLVM_CLASS_ABI DefaultValue<T&> {
 // This specialization allows DefaultValue<void>::Get() to
 // compile.
 template <>
-class LLVM_CLASS_ABI DefaultValue<void> {
+class DefaultValue<void> {
  public:
   static bool Exists() { return true; }
   static void Get() {}
@@ -319,7 +319,7 @@ T* DefaultValue<T&>::address_ = nullptr;
 
 // Implement this interface to define an action for function type F.
 template <typename F>
-class LLVM_CLASS_ABI ActionInterface {
+class ActionInterface {
  public:
   typedef typename internal::Function<F>::Result Result;
   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
@@ -345,7 +345,7 @@ class LLVM_CLASS_ABI ActionInterface {
 // concrete action (including its current state), and an Action<F>
 // object as a handle to it.
 template <typename F>
-class LLVM_CLASS_ABI Action {
+class Action {
   // Adapter class to allow constructing Action from a legacy ActionInterface.
   // New code should create Actions from functors instead.
   struct ActionAdapter {
@@ -431,7 +431,7 @@ class LLVM_CLASS_ABI Action {
 // the definition of Return(void) and SetArgumentPointee<N>(value) for
 // complete examples.
 template <typename Impl>
-class LLVM_CLASS_ABI PolymorphicAction {
+class PolymorphicAction {
  public:
   explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
 
@@ -488,7 +488,7 @@ namespace internal {
 // Helper struct to specialize ReturnAction to execute a move instead of a copy
 // on return. Useful for move-only types, but could be used on any type.
 template <typename T>
-struct LLVM_CLASS_ABI ByMoveWrapper {
+struct ByMoveWrapper {
   explicit ByMoveWrapper(T value) : payload(std::move(value)) {}
   T payload;
 };
@@ -521,7 +521,7 @@ struct LLVM_CLASS_ABI ByMoveWrapper {
 // of gtl::Container() is passed into Return.
 //
 template <typename R>
-class LLVM_CLASS_ABI ReturnAction {
+class ReturnAction {
  public:
   // Constructs a ReturnAction object from the value to be returned.
   // 'value' is passed by value instead of by const reference in order
@@ -612,7 +612,7 @@ class LLVM_CLASS_ABI ReturnAction {
 };
 
 // Implements the ReturnNull() action.
-class LLVM_CLASS_ABI ReturnNullAction {
+class ReturnNullAction {
  public:
   // Allows ReturnNull() to be used in any pointer-returning function. In C++11
   // this is enforced by returning nullptr, and in non-C++11 by asserting a
@@ -624,7 +624,7 @@ class LLVM_CLASS_ABI ReturnNullAction {
 };
 
 // Implements the Return() action.
-class LLVM_CLASS_ABI ReturnVoidAction {
+class ReturnVoidAction {
  public:
   // Allows Return() to be used in any void-returning function.
   template <typename Result, typename ArgumentTuple>
@@ -637,7 +637,7 @@ class LLVM_CLASS_ABI ReturnVoidAction {
 // in any function that returns a reference to the type of x,
 // regardless of the argument types.
 template <typename T>
-class LLVM_CLASS_ABI ReturnRefAction {
+class ReturnRefAction {
  public:
   // Constructs a ReturnRefAction object from the reference to be returned.
   explicit ReturnRefAction(T& ref) : ref_(ref) {}  // NOLINT
@@ -682,7 +682,7 @@ class LLVM_CLASS_ABI ReturnRefAction {
 // used in any function that returns a reference to the type of x,
 // regardless of the argument types.
 template <typename T>
-class LLVM_CLASS_ABI ReturnRefOfCopyAction {
+class ReturnRefOfCopyAction {
  public:
   // Constructs a ReturnRefOfCopyAction object from the reference to
   // be returned.
@@ -726,7 +726,7 @@ class LLVM_CLASS_ABI ReturnRefOfCopyAction {
 };
 
 // Implements the polymorphic DoDefault() action.
-class LLVM_CLASS_ABI DoDefaultAction {
+class DoDefaultAction {
  public:
   // This template type conversion operator allows DoDefault() to be
   // used in any function.
@@ -737,7 +737,7 @@ class LLVM_CLASS_ABI DoDefaultAction {
 // Implements the Assign action to set a given pointer referent to a
 // particular value.
 template <typename T1, typename T2>
-class LLVM_CLASS_ABI AssignAction {
+class AssignAction {
  public:
   AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}
 
@@ -758,7 +758,7 @@ class LLVM_CLASS_ABI AssignAction {
 // Implements the SetErrnoAndReturn action to simulate return from
 // various system calls and libc functions.
 template <typename T>
-class LLVM_CLASS_ABI SetErrnoAndReturnAction {
+class SetErrnoAndReturnAction {
  public:
   SetErrnoAndReturnAction(int errno_value, T result)
       : errno_(errno_value),
@@ -781,7 +781,7 @@ class LLVM_CLASS_ABI SetErrnoAndReturnAction {
 // Implements the SetArgumentPointee<N>(x) action for any function
 // whose N-th argument (0-based) is a pointer to x's type.
 template <size_t N, typename A, typename = void>
-struct LLVM_CLASS_ABI SetArgumentPointeeAction {
+struct SetArgumentPointeeAction {
   A value;
 
   template <typename... Args>
@@ -792,7 +792,7 @@ struct LLVM_CLASS_ABI SetArgumentPointeeAction {
 
 // Implements the Invoke(object_ptr, &Class::Method) action.
 template <class Class, typename MethodPtr>
-struct LLVM_CLASS_ABI InvokeMethodAction {
+struct InvokeMethodAction {
   Class* const obj_ptr;
   const MethodPtr method_ptr;
 
@@ -808,7 +808,7 @@ struct LLVM_CLASS_ABI InvokeMethodAction {
 // function pointer or a functor.  InvokeWithoutArgs(f) can be used as an
 // Action<F> as long as f's type is compatible with F.
 template <typename FunctionImpl>
-struct LLVM_CLASS_ABI InvokeWithoutArgsAction {
+struct InvokeWithoutArgsAction {
   FunctionImpl function_impl;
 
   // Allows InvokeWithoutArgs(f) to be used as any action whose type is
@@ -821,7 +821,7 @@ struct LLVM_CLASS_ABI InvokeWithoutArgsAction {
 
 // Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
 template <class Class, typename MethodPtr>
-struct LLVM_CLASS_ABI InvokeMethodWithoutArgsAction {
+struct InvokeMethodWithoutArgsAction {
   Class* const obj_ptr;
   const MethodPtr method_ptr;
 
@@ -836,7 +836,7 @@ struct LLVM_CLASS_ABI InvokeMethodWithoutArgsAction {
 
 // Implements the IgnoreResult(action) action.
 template <typename A>
-class LLVM_CLASS_ABI IgnoreResultAction {
+class IgnoreResultAction {
  public:
   explicit IgnoreResultAction(const A& action) : action_(action) {}
 
@@ -889,7 +889,7 @@ class LLVM_CLASS_ABI IgnoreResultAction {
 };
 
 template <typename InnerAction, size_t... I>
-struct LLVM_CLASS_ABI WithArgsAction {
+struct WithArgsAction {
   InnerAction action;
 
   // The inner action could be anything convertible to Action<X>.
@@ -907,7 +907,7 @@ struct LLVM_CLASS_ABI WithArgsAction {
 };
 
 template <typename... Actions>
-struct LLVM_CLASS_ABI DoAllAction {
+struct DoAllAction {
  private:
   template <typename... Args, size_t... I>
   std::vector<Action<void(Args...)>> Convert(IndexSequence<I...>) const {
@@ -919,7 +919,7 @@ struct LLVM_CLASS_ABI DoAllAction {
 
   template <typename R, typename... Args>
   operator Action<R(Args...)>() const {  // NOLINT
-    struct LLVM_CLASS_ABI Op {
+    struct Op {
       std::vector<Action<void(Args...)>> converted;
       Action<R(Args...)> last;
       R operator()(Args... args) const {
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h b/third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h
index dcede0b42d5a4af..32c57b3b327240b 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h
@@ -64,7 +64,7 @@ namespace testing {
 // management as Cardinality objects can now be copied like plain values.
 
 // The implementation of a cardinality.
-class LLVM_CLASS_ABI CardinalityInterface {
+class CardinalityInterface {
  public:
   virtual ~CardinalityInterface() {}
 
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-generated-actions.h b/third-party/unittest/googlemock/include/gmock/gmock-generated-actions.h
index ac13ccd6436f6ea..c538dce8d2726fb 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-generated-actions.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-generated-actions.h
@@ -66,11 +66,11 @@ namespace internal {
 // instead of testing::internal.  However, this is an INTERNAL TYPE
 // and subject to change without notice, so a user MUST NOT USE THIS
 // TYPE DIRECTLY.
-struct LLVM_CLASS_ABI ExcessiveArg {};
+struct ExcessiveArg {};
 
 // A helper class needed for implementing the ACTION* macros.
 template <typename Result, class Impl>
-class LLVM_CLASS_ABI ActionHelper {
+class ActionHelper {
  public:
   static Result Perform(Impl* impl, const ::std::tuple<>& args) {
     return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
@@ -1637,7 +1637,7 @@ namespace invoke_argument {
 
 // Appears in InvokeArgumentAdl's argument list to help avoid
 // accidental calls to user functions of the same name.
-struct LLVM_CLASS_ABI AdlTag {};
+struct AdlTag {};
 
 // InvokeArgumentAdl - a helper for InvokeArgument.
 // The basic overloads are provided here for generic functors.
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-matchers.h b/third-party/unittest/googlemock/include/gmock/gmock-matchers.h
index 78b116948dee6d4..8d636f48c67d6e9 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-matchers.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-matchers.h
@@ -95,7 +95,7 @@ namespace testing {
 // plain values.
 
 // A match result listener that stores the explanation in a string.
-class LLVM_CLASS_ABI StringMatchResultListener : public MatchResultListener {
+class StringMatchResultListener : public MatchResultListener {
  public:
   StringMatchResultListener() : MatchResultListener(&ss_) {}
 
@@ -126,7 +126,7 @@ namespace internal {
 // Matcher but is not one yet; for example, Eq(value)) or a value (for
 // example, "hello").
 template <typename T, typename M>
-class LLVM_CLASS_ABI MatcherCastImpl {
+class MatcherCastImpl {
  public:
   static Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
     // M can be a polymorphic matcher, in which case we want to use
@@ -191,7 +191,7 @@ class LLVM_CLASS_ABI MatcherCastImpl {
 // is already a Matcher.  This only compiles when type T can be
 // statically converted to type U.
 template <typename T, typename U>
-class LLVM_CLASS_ABI MatcherCastImpl<T, Matcher<U> > {
+class MatcherCastImpl<T, Matcher<U> > {
  public:
   static Matcher<T> Cast(const Matcher<U>& source_matcher) {
     return Matcher<T>(new Impl(source_matcher));
@@ -240,7 +240,7 @@ class LLVM_CLASS_ABI MatcherCastImpl<T, Matcher<U> > {
 // This even more specialized version is used for efficiently casting
 // a matcher to its own type.
 template <typename T>
-class LLVM_CLASS_ABI MatcherCastImpl<T, Matcher<T> > {
+class MatcherCastImpl<T, Matcher<T> > {
  public:
   static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; }
 };
@@ -261,7 +261,7 @@ inline Matcher<T> MatcherCast(const M& matcher) {
 // FIXME: The intermediate SafeMatcherCastImpl class was introduced as a
 // workaround for a compiler bug, and can now be removed.
 template <typename T>
-class LLVM_CLASS_ABI SafeMatcherCastImpl {
+class SafeMatcherCastImpl {
  public:
   // This overload handles polymorphic matchers and values only since
   // monomorphic matchers are handled by the next one.
@@ -365,7 +365,7 @@ bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,
 // An internal helper class for doing compile-time loop on a tuple's
 // fields.
 template <size_t N>
-class LLVM_CLASS_ABI TuplePrefix {
+class TuplePrefix {
  public:
   // TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true
   // if and only if the first N fields of matcher_tuple matches
@@ -413,7 +413,7 @@ class LLVM_CLASS_ABI TuplePrefix {
 
 // The base case.
 template <>
-class LLVM_CLASS_ABI TuplePrefix<0> {
+class TuplePrefix<0> {
  public:
   template <typename MatcherTuple, typename ValueTuple>
   static bool Matches(const MatcherTuple& /* matcher_tuple */,
@@ -459,7 +459,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
 // TransformTupleValuesHelper hides the internal machinery that
 // TransformTupleValues uses to implement a tuple traversal.
 template <typename Tuple, typename Func, typename OutIter>
-class LLVM_CLASS_ABI TransformTupleValuesHelper {
+class TransformTupleValuesHelper {
  private:
   typedef ::std::tuple_size<Tuple> TupleSize;
 
@@ -496,7 +496,7 @@ OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) {
 
 // Implements A<T>().
 template <typename T>
-class LLVM_CLASS_ABI AnyMatcherImpl : public MatcherInterface<const T&> {
+class AnyMatcherImpl : public MatcherInterface<const T&> {
  public:
   bool MatchAndExplain(const T& /* x */,
                        MatchResultListener* /* listener */) const override {
@@ -515,7 +515,7 @@ class LLVM_CLASS_ABI AnyMatcherImpl : public MatcherInterface<const T&> {
 // type.  This is a polymorphic matcher, so we need a template type
 // conversion operator to make it appearing as a Matcher<T> for any
 // type T.
-class LLVM_CLASS_ABI AnythingMatcher {
+class AnythingMatcher {
  public:
   template <typename T>
   operator Matcher<T>() const { return A<T>(); }
@@ -523,7 +523,7 @@ class LLVM_CLASS_ABI AnythingMatcher {
 
 // Implements the polymorphic IsNull() matcher, which matches any raw or smart
 // pointer that is NULL.
-class LLVM_CLASS_ABI IsNullMatcher {
+class IsNullMatcher {
  public:
   template <typename Pointer>
   bool MatchAndExplain(const Pointer& p,
@@ -539,7 +539,7 @@ class LLVM_CLASS_ABI IsNullMatcher {
 
 // Implements the polymorphic NotNull() matcher, which matches any raw or smart
 // pointer that is not NULL.
-class LLVM_CLASS_ABI NotNullMatcher {
+class NotNullMatcher {
  public:
   template <typename Pointer>
   bool MatchAndExplain(const Pointer& p,
@@ -570,7 +570,7 @@ template <typename T>
 class RefMatcher;
 
 template <typename T>
-class LLVM_CLASS_ABI RefMatcher<T&> {
+class RefMatcher<T&> {
   // Google Mock is a generic framework and thus needs to support
   // mocking any function types, including those that take non-const
   // reference arguments.  Therefore the template parameter T (and
@@ -664,7 +664,7 @@ bool CaseInsensitiveStringEquals(const StringType& s1,
 
 // Implements equality-based string matchers like StrEq, StrCaseNe, and etc.
 template <typename StringType>
-class LLVM_CLASS_ABI StrEqualityMatcher {
+class StrEqualityMatcher {
  public:
   StrEqualityMatcher(const StringType& str, bool expect_eq,
                      bool case_sensitive)
@@ -735,7 +735,7 @@ class LLVM_CLASS_ABI StrEqualityMatcher {
 // can be used as a Matcher<T> as long as T can be converted to a
 // string.
 template <typename StringType>
-class LLVM_CLASS_ABI HasSubstrMatcher {
+class HasSubstrMatcher {
  public:
   explicit HasSubstrMatcher(const StringType& substring)
       : substring_(substring) {}
@@ -792,7 +792,7 @@ class LLVM_CLASS_ABI HasSubstrMatcher {
 // can be used as a Matcher<T> as long as T can be converted to a
 // string.
 template <typename StringType>
-class LLVM_CLASS_ABI StartsWithMatcher {
+class StartsWithMatcher {
  public:
   explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) {
   }
@@ -849,7 +849,7 @@ class LLVM_CLASS_ABI StartsWithMatcher {
 // can be used as a Matcher<T> as long as T can be converted to a
 // string.
 template <typename StringType>
-class LLVM_CLASS_ABI EndsWithMatcher {
+class EndsWithMatcher {
  public:
   explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {}
 
@@ -910,7 +910,7 @@ class LLVM_CLASS_ABI EndsWithMatcher {
 // etc).  Therefore we use a template type conversion operator in the
 // implementation.
 template <typename D, typename Op>
-class LLVM_CLASS_ABI PairMatchBase {
+class PairMatchBase {
  public:
   template <typename T1, typename T2>
   operator Matcher<::std::tuple<T1, T2>>() const {
@@ -942,27 +942,27 @@ class LLVM_CLASS_ABI PairMatchBase {
   };
 };
 
-class LLVM_CLASS_ABI Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
+class Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
  public:
   static const char* Desc() { return "an equal pair"; }
 };
-class LLVM_CLASS_ABI Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
+class Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
  public:
   static const char* Desc() { return "an unequal pair"; }
 };
-class LLVM_CLASS_ABI Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
+class Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
  public:
   static const char* Desc() { return "a pair where the first < the second"; }
 };
-class LLVM_CLASS_ABI Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
+class Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
  public:
   static const char* Desc() { return "a pair where the first > the second"; }
 };
-class LLVM_CLASS_ABI Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
+class Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
  public:
   static const char* Desc() { return "a pair where the first <= the second"; }
 };
-class LLVM_CLASS_ABI Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
+class Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
  public:
   static const char* Desc() { return "a pair where the first >= the second"; }
 };
@@ -972,7 +972,7 @@ class LLVM_CLASS_ABI Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
 // will prevent different instantiations of NotMatcher from sharing
 // the same NotMatcherImpl<T> class.
 template <typename T>
-class LLVM_CLASS_ABI NotMatcherImpl : public MatcherInterface<const T&> {
+class NotMatcherImpl : public MatcherInterface<const T&> {
  public:
   explicit NotMatcherImpl(const Matcher<T>& matcher)
       : matcher_(matcher) {}
@@ -999,7 +999,7 @@ class LLVM_CLASS_ABI NotMatcherImpl : public MatcherInterface<const T&> {
 // Implements the Not(m) matcher, which matches a value that doesn't
 // match matcher m.
 template <typename InnerMatcher>
-class LLVM_CLASS_ABI NotMatcher {
+class NotMatcher {
  public:
   explicit NotMatcher(InnerMatcher matcher) : matcher_(matcher) {}
 
@@ -1021,7 +1021,7 @@ class LLVM_CLASS_ABI NotMatcher {
 // that will prevent different instantiations of BothOfMatcher from
 // sharing the same BothOfMatcherImpl<T> class.
 template <typename T>
-class LLVM_CLASS_ABI AllOfMatcherImpl : public MatcherInterface<const T&> {
+class AllOfMatcherImpl : public MatcherInterface<const T&> {
  public:
   explicit AllOfMatcherImpl(std::vector<Matcher<T> > matchers)
       : matchers_(std::move(matchers)) {}
@@ -1084,7 +1084,7 @@ class LLVM_CLASS_ABI AllOfMatcherImpl : public MatcherInterface<const T&> {
 // CombiningMatcher<T> is used to recursively combine the provided matchers
 // (of type Args...).
 template <template <typename T> class CombiningMatcher, typename... Args>
-class LLVM_CLASS_ABI VariadicMatcher {
+class VariadicMatcher {
  public:
   VariadicMatcher(const Args&... matchers)  // NOLINT
       : matchers_(matchers...) {
@@ -1127,7 +1127,7 @@ using AllOfMatcher = VariadicMatcher<AllOfMatcherImpl, Args...>;
 // that will prevent different instantiations of AnyOfMatcher from
 // sharing the same EitherOfMatcherImpl<T> class.
 template <typename T>
-class LLVM_CLASS_ABI AnyOfMatcherImpl : public MatcherInterface<const T&> {
+class AnyOfMatcherImpl : public MatcherInterface<const T&> {
  public:
   explicit AnyOfMatcherImpl(std::vector<Matcher<T> > matchers)
       : matchers_(std::move(matchers)) {}
@@ -1191,7 +1191,7 @@ using AnyOfMatcher = VariadicMatcher<AnyOfMatcherImpl, Args...>;
 
 // Wrapper for implementation of Any/AllOfArray().
 template <template <class> class MatcherImpl, typename T>
-class LLVM_CLASS_ABI SomeOfArrayMatcher {
+class SomeOfArrayMatcher {
  public:
   // Constructs the matcher from a sequence of element values or
   // element matchers.
@@ -1223,7 +1223,7 @@ using AnyOfArrayMatcher = SomeOfArrayMatcher<AnyOfMatcherImpl, T>;
 // Used for implementing Truly(pred), which turns a predicate into a
 // matcher.
 template <typename Predicate>
-class LLVM_CLASS_ABI TrulyMatcher {
+class TrulyMatcher {
  public:
   explicit TrulyMatcher(Predicate pred) : predicate_(pred) {}
 
@@ -1262,7 +1262,7 @@ class LLVM_CLASS_ABI TrulyMatcher {
 // Used for implementing Matches(matcher), which turns a matcher into
 // a predicate.
 template <typename M>
-class LLVM_CLASS_ABI MatcherAsPredicate {
+class MatcherAsPredicate {
  public:
   explicit MatcherAsPredicate(M matcher) : matcher_(matcher) {}
 
@@ -1300,7 +1300,7 @@ class LLVM_CLASS_ABI MatcherAsPredicate {
 // For implementing ASSERT_THAT() and EXPECT_THAT().  The template
 // argument M must be a type that can be converted to a matcher.
 template <typename M>
-class LLVM_CLASS_ABI PredicateFormatterFromMatcher {
+class PredicateFormatterFromMatcher {
  public:
   explicit PredicateFormatterFromMatcher(M m) : matcher_(std::move(m)) {}
 
@@ -1364,7 +1364,7 @@ MakePredicateFormatterFromMatcher(M matcher) {
 // user-specified epsilon.  The template is meant to be instantiated with
 // FloatType being either float or double.
 template <typename FloatType>
-class LLVM_CLASS_ABI FloatingEqMatcher {
+class FloatingEqMatcher {
  public:
   // Constructor for FloatingEqMatcher.
   // The matcher's input will be compared with expected.  The matcher treats two
@@ -1522,7 +1522,7 @@ class LLVM_CLASS_ABI FloatingEqMatcher {
 // against y. The former implements "Eq", the latter "Near". At present, there
 // is no version that compares NaNs as equal.
 template <typename FloatType>
-class LLVM_CLASS_ABI FloatingEq2Matcher {
+class FloatingEq2Matcher {
  public:
   FloatingEq2Matcher() { Init(-1, false); }
 
@@ -1595,7 +1595,7 @@ class LLVM_CLASS_ABI FloatingEq2Matcher {
 // Implements the Pointee(m) matcher for matching a pointer whose
 // pointee matches matcher m.  The pointer can be either raw or smart.
 template <typename InnerMatcher>
-class LLVM_CLASS_ABI PointeeMatcher {
+class PointeeMatcher {
  public:
   explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}
 
@@ -1729,7 +1729,7 @@ class WhenDynamicCastToMatcher<To&> : public WhenDynamicCastToMatcherBase<To&> {
 // Implements the Field() matcher for matching a field (i.e. member
 // variable) of an object.
 template <typename Class, typename FieldType>
-class LLVM_CLASS_ABI FieldMatcher {
+class FieldMatcher {
  public:
   FieldMatcher(FieldType Class::*field,
                const Matcher<const FieldType&>& matcher)
@@ -1795,7 +1795,7 @@ class LLVM_CLASS_ABI FieldMatcher {
 // Property is a const-qualified member function of Class returning
 // PropertyType.
 template <typename Class, typename PropertyType, typename Property>
-class LLVM_CLASS_ABI PropertyMatcher {
+class PropertyMatcher {
  public:
   typedef const PropertyType& RefToConstProperty;
 
@@ -1862,7 +1862,7 @@ class LLVM_CLASS_ABI PropertyMatcher {
 // Type traits specifying various features of different functors for ResultOf.
 // The default template specifies features for functor objects.
 template <typename Functor>
-struct LLVM_CLASS_ABI CallableTraits {
+struct CallableTraits {
   typedef Functor StorageType;
 
   static void CheckIsValid(Functor /* functor */) {}
@@ -1875,7 +1875,7 @@ struct LLVM_CLASS_ABI CallableTraits {
 
 // Specialization for function pointers.
 template <typename ArgType, typename ResType>
-struct LLVM_CLASS_ABI CallableTraits<ResType(*)(ArgType)> {
+struct CallableTraits<ResType(*)(ArgType)> {
   typedef ResType ResultType;
   typedef ResType(*StorageType)(ArgType);
 
@@ -1892,7 +1892,7 @@ struct LLVM_CLASS_ABI CallableTraits<ResType(*)(ArgType)> {
 // Implements the ResultOf() matcher for matching a return value of a
 // unary function of an object.
 template <typename Callable, typename InnerMatcher>
-class LLVM_CLASS_ABI ResultOfMatcher {
+class ResultOfMatcher {
  public:
   ResultOfMatcher(Callable callable, InnerMatcher matcher)
       : callable_(std::move(callable)), matcher_(std::move(matcher)) {
@@ -1958,7 +1958,7 @@ class LLVM_CLASS_ABI ResultOfMatcher {
 
 // Implements a matcher that checks the size of an STL-style container.
 template <typename SizeMatcher>
-class LLVM_CLASS_ABI SizeIsMatcher {
+class SizeIsMatcher {
  public:
   explicit SizeIsMatcher(const SizeMatcher& size_matcher)
        : size_matcher_(size_matcher) {
@@ -2009,7 +2009,7 @@ class LLVM_CLASS_ABI SizeIsMatcher {
 // Implements a matcher that checks the begin()..end() distance of an STL-style
 // container.
 template <typename DistanceMatcher>
-class LLVM_CLASS_ABI BeginEndDistanceIsMatcher {
+class BeginEndDistanceIsMatcher {
  public:
   explicit BeginEndDistanceIsMatcher(const DistanceMatcher& distance_matcher)
       : distance_matcher_(distance_matcher) {}
@@ -2077,7 +2077,7 @@ class LLVM_CLASS_ABI BeginEndDistanceIsMatcher {
 // Uses the container's const_iterator, value_type, operator ==,
 // begin(), and end().
 template <typename Container>
-class LLVM_CLASS_ABI ContainerEqMatcher {
+class ContainerEqMatcher {
  public:
   typedef internal::StlContainerView<Container> View;
   typedef typename View::type StlContainer;
@@ -2161,14 +2161,14 @@ class LLVM_CLASS_ABI ContainerEqMatcher {
 };
 
 // A comparator functor that uses the < operator to compare two values.
-struct LLVM_CLASS_ABI LessComparator {
+struct LessComparator {
   template <typename T, typename U>
   bool operator()(const T& lhs, const U& rhs) const { return lhs < rhs; }
 };
 
 // Implements WhenSortedBy(comparator, container_matcher).
 template <typename Comparator, typename ContainerMatcher>
-class LLVM_CLASS_ABI WhenSortedByMatcher {
+class WhenSortedByMatcher {
  public:
   WhenSortedByMatcher(const Comparator& comparator,
                       const ContainerMatcher& matcher)
@@ -2248,7 +2248,7 @@ class LLVM_CLASS_ABI WhenSortedByMatcher {
 // T2&> >, where T1 and T2 are the types of elements in the LHS
 // container and the RHS container respectively.
 template <typename TupleMatcher, typename RhsContainer>
-class LLVM_CLASS_ABI PointwiseMatcher {
+class PointwiseMatcher {
   GTEST_COMPILE_ASSERT_(
       !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>::value,
       use_UnorderedPointwise_with_hash_tables);
@@ -2369,7 +2369,7 @@ class LLVM_CLASS_ABI PointwiseMatcher {
 
 // Holds the logic common to ContainsMatcherImpl and EachMatcherImpl.
 template <typename Container>
-class LLVM_CLASS_ABI QuantifierMatcherImpl : public MatcherInterface<Container> {
+class QuantifierMatcherImpl : public MatcherInterface<Container> {
  public:
   typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
   typedef StlContainerView<RawContainer> View;
@@ -2414,7 +2414,7 @@ class LLVM_CLASS_ABI QuantifierMatcherImpl : public MatcherInterface<Container>
 // Implements Contains(element_matcher) for the given argument type Container.
 // Symmetric to EachMatcherImpl.
 template <typename Container>
-class LLVM_CLASS_ABI ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
+class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
  public:
   template <typename InnerMatcher>
   explicit ContainsMatcherImpl(InnerMatcher inner_matcher)
@@ -2443,7 +2443,7 @@ class LLVM_CLASS_ABI ContainsMatcherImpl : public QuantifierMatcherImpl<Containe
 // Implements Each(element_matcher) for the given argument type Container.
 // Symmetric to ContainsMatcherImpl.
 template <typename Container>
-class LLVM_CLASS_ABI EachMatcherImpl : public QuantifierMatcherImpl<Container> {
+class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
  public:
   template <typename InnerMatcher>
   explicit EachMatcherImpl(InnerMatcher inner_matcher)
@@ -2471,7 +2471,7 @@ class LLVM_CLASS_ABI EachMatcherImpl : public QuantifierMatcherImpl<Container> {
 
 // Implements polymorphic Contains(element_matcher).
 template <typename M>
-class LLVM_CLASS_ABI ContainsMatcher {
+class ContainsMatcher {
  public:
   explicit ContainsMatcher(M m) : inner_matcher_(m) {}
 
@@ -2489,7 +2489,7 @@ class LLVM_CLASS_ABI ContainsMatcher {
 
 // Implements polymorphic Each(element_matcher).
 template <typename M>
-class LLVM_CLASS_ABI EachMatcher {
+class EachMatcher {
  public:
   explicit EachMatcher(M m) : inner_matcher_(m) {}
 
@@ -2505,8 +2505,8 @@ class LLVM_CLASS_ABI EachMatcher {
   GTEST_DISALLOW_ASSIGN_(EachMatcher);
 };
 
-struct LLVM_CLASS_ABI Rank1 {};
-struct LLVM_CLASS_ABI Rank0 : Rank1 {};
+struct Rank1 {};
+struct Rank0 : Rank1 {};
 
 namespace pair_getters {
 using std::get;
@@ -2534,7 +2534,7 @@ auto Second(T& x, Rank0) -> decltype((x.second)) {  // NOLINT
 // inner_matcher.  For example, Contains(Key(Ge(5))) can be used to match an
 // std::map that contains at least one element whose key is >= 5.
 template <typename PairType>
-class LLVM_CLASS_ABI KeyMatcherImpl : public MatcherInterface<PairType> {
+class KeyMatcherImpl : public MatcherInterface<PairType> {
  public:
   typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
   typedef typename RawPairType::first_type KeyType;
@@ -2579,7 +2579,7 @@ class LLVM_CLASS_ABI KeyMatcherImpl : public MatcherInterface<PairType> {
 
 // Implements polymorphic Key(matcher_for_key).
 template <typename M>
-class LLVM_CLASS_ABI KeyMatcher {
+class KeyMatcher {
  public:
   explicit KeyMatcher(M m) : matcher_for_key_(m) {}
 
@@ -2598,7 +2598,7 @@ class LLVM_CLASS_ABI KeyMatcher {
 // Implements Pair(first_matcher, second_matcher) for the given argument pair
 // type with its two matchers. See Pair() function below.
 template <typename PairType>
-class LLVM_CLASS_ABI PairMatcherImpl : public MatcherInterface<PairType> {
+class PairMatcherImpl : public MatcherInterface<PairType> {
  public:
   typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
   typedef typename RawPairType::first_type FirstType;
@@ -2684,7 +2684,7 @@ class LLVM_CLASS_ABI PairMatcherImpl : public MatcherInterface<PairType> {
 
 // Implements polymorphic Pair(first_matcher, second_matcher).
 template <typename FirstMatcher, typename SecondMatcher>
-class LLVM_CLASS_ABI PairMatcher {
+class PairMatcher {
  public:
   PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
       : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
@@ -2704,7 +2704,7 @@ class LLVM_CLASS_ABI PairMatcher {
 
 // Implements ElementsAre() and ElementsAreArray().
 template <typename Container>
-class LLVM_CLASS_ABI ElementsAreMatcherImpl : public MatcherInterface<Container> {
+class ElementsAreMatcherImpl : public MatcherInterface<Container> {
  public:
   typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
   typedef internal::StlContainerView<RawContainer> View;
@@ -2904,7 +2904,7 @@ typedef ::std::vector<ElementMatcherPair> ElementMatcherPairs;
 GTEST_API_ ElementMatcherPairs
 FindMaxBipartiteMatching(const MatchMatrix& g);
 
-struct LLVM_CLASS_ABI UnorderedMatcherRequire {
+struct UnorderedMatcherRequire {
   enum Flags {
     Superset = 1 << 0,
     Subset = 1 << 1,
@@ -2959,7 +2959,7 @@ class GTEST_API_ UnorderedElementsAreMatcherImplBase {
 // Implements UnorderedElementsAre, UnorderedElementsAreArray, IsSubsetOf, and
 // IsSupersetOf.
 template <typename Container>
-class LLVM_CLASS_ABI UnorderedElementsAreMatcherImpl
+class UnorderedElementsAreMatcherImpl
     : public MatcherInterface<Container>,
       public UnorderedElementsAreMatcherImplBase {
  public:
@@ -3056,7 +3056,7 @@ class LLVM_CLASS_ABI UnorderedElementsAreMatcherImpl
 // Functor for use in TransformTuple.
 // Performs MatcherCast<Target> on an input argument of any type.
 template <typename Target>
-struct LLVM_CLASS_ABI CastAndAppendTransform {
+struct CastAndAppendTransform {
   template <typename Arg>
   Matcher<Target> operator()(const Arg& a) const {
     return MatcherCast<Target>(a);
@@ -3065,7 +3065,7 @@ struct LLVM_CLASS_ABI CastAndAppendTransform {
 
 // Implements UnorderedElementsAre.
 template <typename MatcherTuple>
-class LLVM_CLASS_ABI UnorderedElementsAreMatcher {
+class UnorderedElementsAreMatcher {
  public:
   explicit UnorderedElementsAreMatcher(const MatcherTuple& args)
       : matchers_(args) {}
@@ -3097,7 +3097,7 @@ class LLVM_CLASS_ABI UnorderedElementsAreMatcher {
 
 // Implements ElementsAre.
 template <typename MatcherTuple>
-class LLVM_CLASS_ABI ElementsAreMatcher {
+class ElementsAreMatcher {
  public:
   explicit ElementsAreMatcher(const MatcherTuple& args) : matchers_(args) {}
 
@@ -3131,7 +3131,7 @@ class LLVM_CLASS_ABI ElementsAreMatcher {
 
 // Implements UnorderedElementsAreArray(), IsSubsetOf(), and IsSupersetOf().
 template <typename T>
-class LLVM_CLASS_ABI UnorderedElementsAreArrayMatcher {
+class UnorderedElementsAreArrayMatcher {
  public:
   template <typename Iter>
   UnorderedElementsAreArrayMatcher(UnorderedMatcherRequire::Flags match_flags,
@@ -3154,7 +3154,7 @@ class LLVM_CLASS_ABI UnorderedElementsAreArrayMatcher {
 
 // Implements ElementsAreArray().
 template <typename T>
-class LLVM_CLASS_ABI ElementsAreArrayMatcher {
+class ElementsAreArrayMatcher {
  public:
   template <typename Iter>
   ElementsAreArrayMatcher(Iter first, Iter last) : matchers_(first, last) {}
@@ -3185,7 +3185,7 @@ class LLVM_CLASS_ABI ElementsAreArrayMatcher {
 // instances of this class in a vector when implementing
 // UnorderedPointwise().
 template <typename Tuple2Matcher, typename Second>
-class LLVM_CLASS_ABI BoundSecondMatcher {
+class BoundSecondMatcher {
  public:
   BoundSecondMatcher(const Tuple2Matcher& tm, const Second& second)
       : tuple2_matcher_(tm), second_value_(second) {}
@@ -3261,7 +3261,7 @@ GTEST_API_ std::string FormatMatcherDescription(bool negation,
 
 // Implements a matcher that checks the value of a optional<> type variable.
 template <typename ValueMatcher>
-class LLVM_CLASS_ABI OptionalMatcher {
+class OptionalMatcher {
  public:
   explicit OptionalMatcher(const ValueMatcher& value_matcher)
       : value_matcher_(value_matcher) {}
@@ -3323,7 +3323,7 @@ void get() {}
 
 // Implements a matcher that checks the value of a variant<> type variable.
 template <typename T>
-class LLVM_CLASS_ABI VariantMatcher {
+class VariantMatcher {
  public:
   explicit VariantMatcher(::testing::Matcher<const T&> matcher)
       : matcher_(std::move(matcher)) {}
@@ -3384,7 +3384,7 @@ void any_cast() {}
 
 // Implements a matcher that any_casts the value.
 template <typename T>
-class LLVM_CLASS_ABI AnyCastMatcher {
+class AnyCastMatcher {
  public:
   explicit AnyCastMatcher(const ::testing::Matcher<const T&>& matcher)
       : matcher_(matcher) {}
@@ -3439,7 +3439,7 @@ class LLVM_CLASS_ABI AnyCastMatcher {
 
 // Implements the Args() matcher.
 template <class ArgsTuple, size_t... k>
-class LLVM_CLASS_ABI ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
+class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
  public:
   using RawArgsTuple = typename std::decay<ArgsTuple>::type;
   using SelectedArgs =
@@ -3496,7 +3496,7 @@ class LLVM_CLASS_ABI ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
 };
 
 template <class InnerMatcher, size_t... k>
-class LLVM_CLASS_ABI ArgsMatcher {
+class ArgsMatcher {
  public:
   explicit ArgsMatcher(InnerMatcher inner_matcher)
       : inner_matcher_(std::move(inner_matcher)) {}
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-nice-strict.h b/third-party/unittest/googlemock/include/gmock/gmock-nice-strict.h
index 2c2587e1c5ab331..140fc19fcd7dc5c 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-nice-strict.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-nice-strict.h
@@ -71,7 +71,7 @@
 namespace testing {
 
 template <class MockClass>
-class LLVM_CLASS_ABI NiceMock : public MockClass {
+class NiceMock : public MockClass {
  public:
   NiceMock() : MockClass() {
     ::testing::Mock::AllowUninterestingCalls(
@@ -109,7 +109,7 @@ class LLVM_CLASS_ABI NiceMock : public MockClass {
 };
 
 template <class MockClass>
-class LLVM_CLASS_ABI NaggyMock : public MockClass {
+class NaggyMock : public MockClass {
  public:
   NaggyMock() : MockClass() {
     ::testing::Mock::WarnUninterestingCalls(
@@ -147,7 +147,7 @@ class LLVM_CLASS_ABI NaggyMock : public MockClass {
 };
 
 template <class MockClass>
-class LLVM_CLASS_ABI StrictMock : public MockClass {
+class StrictMock : public MockClass {
  public:
   StrictMock() : MockClass() {
     ::testing::Mock::FailUninterestingCalls(
diff --git a/third-party/unittest/googlemock/include/gmock/gmock-spec-builders.h b/third-party/unittest/googlemock/include/gmock/gmock-spec-builders.h
index 5d4ae51aa0c579d..80b0b8726fc6173 100644
--- a/third-party/unittest/googlemock/include/gmock/gmock-spec-builders.h
+++ b/third-party/unittest/googlemock/include/gmock/gmock-spec-builders.h
@@ -251,7 +251,7 @@ class GTEST_API_ UntypedFunctionMockerBase {
 };  // class UntypedFunctionMockerBase
 
 // Untyped base class for OnCallSpec<F>.
-class LLVM_CLASS_ABI UntypedOnCallSpecBase {
+class UntypedOnCallSpecBase {
  public:
   // The arguments are the location of the ON_CALL() statement.
   UntypedOnCallSpecBase(const char* a_file, int a_line)
@@ -293,7 +293,7 @@ class LLVM_CLASS_ABI UntypedOnCallSpecBase {
 
 // This template class implements an ON_CALL spec.
 template <typename F>
-class LLVM_CLASS_ABI OnCallSpec : public UntypedOnCallSpecBase {
+class OnCallSpec : public UntypedOnCallSpecBase {
  public:
   typedef typename Function<F>::ArgumentTuple ArgumentTuple;
   typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
@@ -573,7 +573,7 @@ class GTEST_API_ Expectation {
 // after the first two have both been satisfied.
 //
 // This class is copyable and has value semantics.
-class LLVM_CLASS_ABI ExpectationSet {
+class ExpectationSet {
  public:
   // A bidirectional iterator that can read a const element in the set.
   typedef Expectation::Set::const_iterator const_iterator;
@@ -887,7 +887,7 @@ class GTEST_API_ ExpectationBase {
 
 // Impements an expectation for the given function type.
 template <typename F>
-class LLVM_CLASS_ABI TypedExpectation : public ExpectationBase {
+class TypedExpectation : public ExpectationBase {
  public:
   typedef typename Function<F>::ArgumentTuple ArgumentTuple;
   typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
@@ -1250,7 +1250,7 @@ GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
                                 const std::string& message);
 
 template <typename F>
-class LLVM_CLASS_ABI MockSpec {
+class MockSpec {
  public:
   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
   typedef typename internal::Function<F>::ArgumentMatcherTuple
@@ -1309,7 +1309,7 @@ class LLVM_CLASS_ABI MockSpec {
 // comments describe the contract for the whole template (including
 // specializations).
 template <typename T>
-class LLVM_CLASS_ABI ReferenceOrValueWrapper {
+class ReferenceOrValueWrapper {
  public:
   // Constructs a wrapper from the given value/reference.
   explicit ReferenceOrValueWrapper(T value)
@@ -1336,7 +1336,7 @@ class LLVM_CLASS_ABI ReferenceOrValueWrapper {
 // Specialization for lvalue reference types. See primary template
 // for documentation.
 template <typename T>
-class LLVM_CLASS_ABI ReferenceOrValueWrapper<T&> {
+class ReferenceOrValueWrapper<T&> {
  public:
   // Workaround for debatable pass-by-reference lint warning (c-library-team
   // policy precludes NOLINT in this context)
@@ -1365,7 +1365,7 @@ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355)
 // non-void-returning mock functions.
 
 // Untyped base class for ActionResultHolder<T>.
-class LLVM_CLASS_ABI UntypedActionResultHolderBase {
+class UntypedActionResultHolderBase {
  public:
   virtual ~UntypedActionResultHolderBase() {}
 
@@ -1375,7 +1375,7 @@ class LLVM_CLASS_ABI UntypedActionResultHolderBase {
 
 // This generic definition is used when T is not void.
 template <typename T>
-class LLVM_CLASS_ABI ActionResultHolder : public UntypedActionResultHolderBase {
+class ActionResultHolder : public UntypedActionResultHolderBase {
  public:
   // Returns the held value. Must not be called more than once.
   T Unwrap() {
@@ -1423,7 +1423,7 @@ class LLVM_CLASS_ABI ActionResultHolder : public UntypedActionResultHolderBase {
 
 // Specialization for T = void.
 template <>
-class LLVM_CLASS_ABI ActionResultHolder<void> : public UntypedActionResultHolderBase {
+class ActionResultHolder<void> : public UntypedActionResultHolderBase {
  public:
   void Unwrap() { }
 
@@ -1458,7 +1458,7 @@ template <typename F>
 class FunctionMocker;
 
 template <typename R, typename... Args>
-class LLVM_CLASS_ABI FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase {
+class FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase {
   using F = R(Args...);
 
  public:
@@ -1790,7 +1790,7 @@ GTEST_DISABLE_MSC_WARNINGS_POP_()  //  4355
 
 // Reports an uninteresting call (whose description is in msg) in the
 // manner specified by 'reaction'.
-LLVM_FUNC_ABI void ReportUninterestingCall(CallReaction reaction, const std::string& msg);
+void ReportUninterestingCall(CallReaction reaction, const std::string& msg);
 
 }  // namespace internal
 
@@ -1844,7 +1844,7 @@ template <typename F>
 class MockFunction;
 
 template <typename R, typename... Args>
-class LLVM_CLASS_ABI MockFunction<R(Args...)> {
+class MockFunction<R(Args...)> {
  public:
   MockFunction() {}
   MockFunction(const MockFunction&) = delete;
diff --git a/third-party/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h b/third-party/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
index d40358838ba204d..9ee68b7261bc4db 100644
--- a/third-party/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
+++ b/third-party/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
@@ -79,14 +79,14 @@ GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name);
 // following default implementation is for the case where Pointer is a
 // smart pointer.
 template <typename Pointer>
-struct LLVM_CLASS_ABI PointeeOf {
+struct PointeeOf {
   // Smart pointer classes define type element_type as the type of
   // their pointees.
   typedef typename Pointer::element_type type;
 };
 // This specialization is for the raw pointer case.
 template <typename T>
-struct LLVM_CLASS_ABI PointeeOf<T*> { typedef T type; };  // NOLINT
+struct PointeeOf<T*> { typedef T type; };  // NOLINT
 
 // GetRawPointer(p) returns the raw pointer underlying p when p is a
 // smart pointer, or returns p itself when p is already a raw pointer.
@@ -119,7 +119,7 @@ enum TypeKind {
 };
 
 // KindOf<T>::value is the kind of type T.
-template <typename T> struct LLVM_CLASS_ABI KindOf {
+template <typename T> struct KindOf {
   enum { value = kOther };  // The default kind.
 };
 
@@ -173,32 +173,32 @@ GMOCK_DECLARE_KIND_(long double, kFloatingPoint);
 // From, and kToKind is the kind of To; the value is
 // implementation-defined when the above pre-condition is violated.
 template <TypeKind kFromKind, typename From, TypeKind kToKind, typename To>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl : public std::false_type {};
+struct LosslessArithmeticConvertibleImpl : public std::false_type {};
 
 // Converting bool to bool is lossless.
 template <>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kBool, bool, kBool, bool>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kBool, bool>
     : public std::true_type {};
 
 // Converting bool to any integer type is lossless.
 template <typename To>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kBool, bool, kInteger, To>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kInteger, To>
     : public std::true_type {};
 
 // Converting bool to any floating-point type is lossless.
 template <typename To>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kBool, bool, kFloatingPoint, To>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kFloatingPoint, To>
     : public std::true_type {};
 
 // Converting an integer to bool is lossy.
 template <typename From>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool>
     : public std::false_type {};
 
 // Converting an integer to another non-bool integer is lossless
 // if and only if the target type's range encloses the source type's range.
 template <typename From, typename To>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>
     : public bool_constant<
       // When converting from a smaller size to a larger size, we are
       // fine as long as we are not converting from signed to unsigned.
@@ -213,23 +213,23 @@ struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kInteger, From, kInteger
 // Converting an integer to a floating-point type may be lossy, since
 // the format of a floating-point number is implementation-defined.
 template <typename From, typename To>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
     : public std::false_type {};
 
 // Converting a floating-point to bool is lossy.
 template <typename From>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
+struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
     : public std::false_type {};
 
 // Converting a floating-point to an integer is lossy.
 template <typename From, typename To>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
+struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
     : public std::false_type {};
 
 // Converting a floating-point to another floating-point is lossless
 // if and only if the target type is at least as big as the source type.
 template <typename From, typename To>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<
+struct LosslessArithmeticConvertibleImpl<
   kFloatingPoint, From, kFloatingPoint, To>
     : public bool_constant<sizeof(From) <= sizeof(To)> {};  // NOLINT
 
@@ -241,13 +241,13 @@ struct LLVM_CLASS_ABI LosslessArithmeticConvertibleImpl<
 // reference) built-in arithmetic types; the value is
 // implementation-defined when the above pre-condition is violated.
 template <typename From, typename To>
-struct LLVM_CLASS_ABI LosslessArithmeticConvertible
+struct LosslessArithmeticConvertible
     : public LosslessArithmeticConvertibleImpl<
   GMOCK_KIND_OF_(From), From, GMOCK_KIND_OF_(To), To> {};  // NOLINT
 
 // This interface knows how to report a Google Mock failure (either
 // non-fatal or fatal).
-class LLVM_CLASS_ABI FailureReporterInterface {
+class FailureReporterInterface {
  public:
   // The type of a failure (either non-fatal or fatal).
   enum FailureType {
@@ -328,7 +328,7 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
 //
 //    ON_CALL(mock, Method({}, nullptr))...
 //
-class LLVM_CLASS_ABI WithoutMatchers {
+class WithoutMatchers {
  private:
   WithoutMatchers() {}
   friend GTEST_API_ WithoutMatchers GetWithoutMatchers();
@@ -381,7 +381,7 @@ inline T Invalid() {
 // This generic version is used when RawContainer itself is already an
 // STL-style container.
 template <class RawContainer>
-class LLVM_CLASS_ABI StlContainerView {
+class StlContainerView {
  public:
   typedef RawContainer type;
   typedef const type& const_reference;
@@ -396,7 +396,7 @@ class LLVM_CLASS_ABI StlContainerView {
 
 // This specialization is used when RawContainer is a native array type.
 template <typename Element, size_t N>
-class LLVM_CLASS_ABI StlContainerView<Element[N]> {
+class StlContainerView<Element[N]> {
  public:
   typedef typename std::remove_const<Element>::type RawElement;
   typedef internal::NativeArray<RawElement> type;
@@ -420,7 +420,7 @@ class LLVM_CLASS_ABI StlContainerView<Element[N]> {
 // This specialization is used when RawContainer is a native array
 // represented as a (pointer, size) tuple.
 template <typename ElementPointer, typename Size>
-class LLVM_CLASS_ABI StlContainerView< ::std::tuple<ElementPointer, Size> > {
+class StlContainerView< ::std::tuple<ElementPointer, Size> > {
  public:
   typedef typename std::remove_const<
       typename internal::PointeeOf<ElementPointer>::type>::type RawElement;
@@ -445,13 +445,13 @@ template <typename T> class StlContainerView<T&>;
 // Pairs like that are used as the value_type of associative containers,
 // and this transform produces a similar but assignable pair.
 template <typename T>
-struct LLVM_CLASS_ABI RemoveConstFromKey {
+struct RemoveConstFromKey {
   typedef T type;
 };
 
 // Partially specialized to remove constness from std::pair<const K, V>.
 template <typename K, typename V>
-struct LLVM_CLASS_ABI RemoveConstFromKey<std::pair<const K, V> > {
+struct RemoveConstFromKey<std::pair<const K, V> > {
   typedef std::pair<K, V> type;
 };
 
@@ -491,7 +491,7 @@ template <typename T>
 struct Function;
 
 template <typename R, typename... Args>
-struct LLVM_CLASS_ABI Function<R(Args...)> {
+struct Function<R(Args...)> {
   using Result = R;
   static constexpr size_t ArgumentCount = sizeof...(Args);
   template <size_t I>
diff --git a/third-party/unittest/googletest/include/gtest/gtest-message.h b/third-party/unittest/googletest/include/gtest/gtest-message.h
index 1723bd3d69dfebf..5802907f939539d 100644
--- a/third-party/unittest/googletest/include/gtest/gtest-message.h
+++ b/third-party/unittest/googletest/include/gtest/gtest-message.h
@@ -61,7 +61,7 @@ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
 
 // Ensures that there is at least one operator<< in the global namespace.
 // See Message& operator<<(...) below for why.
-LLVM_FUNC_ABI void operator<<(const testing::internal::Secret&, int);
+void operator<<(const testing::internal::Secret&, int);
 
 namespace testing {
 
diff --git a/third-party/unittest/googletest/include/gtest/gtest-test-part.h b/third-party/unittest/googletest/include/gtest/gtest-test-part.h
index f5e40fbaf044d8c..53526c98ee8913e 100644
--- a/third-party/unittest/googletest/include/gtest/gtest-test-part.h
+++ b/third-party/unittest/googletest/include/gtest/gtest-test-part.h
@@ -124,7 +124,7 @@ class GTEST_API_ TestPartResult {
 };
 
 // Prints a TestPartResult object.
-LLVM_FUNC_ABI std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
+std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
 
 // An array of TestPartResult objects.
 //
diff --git a/third-party/unittest/googletest/include/gtest/gtest.h b/third-party/unittest/googletest/include/gtest/gtest.h
index 838d840fbba4db1..eb5c5cc0d0b6c44 100644
--- a/third-party/unittest/googletest/include/gtest/gtest.h
+++ b/third-party/unittest/googletest/include/gtest/gtest.h
@@ -173,8 +173,8 @@ class TestEventRepeater;
 class UnitTestRecordPropertyTestHelper;
 class WindowsDeathTest;
 class FuchsiaDeathTest;
-LLVM_FUNC_ABI class UnitTestImpl* GetUnitTestImpl();
-LLVM_FUNC_ABI void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
+class UnitTestImpl* GetUnitTestImpl();
+void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
                                     const std::string& message);
 
 }  // namespace internal
@@ -1418,9 +1418,9 @@ class GTEST_API_ UnitTest {
   friend class internal::AssertHelper;
   friend class internal::StreamingListenerTest;
   friend class internal::UnitTestRecordPropertyTestHelper;
-  friend LLVM_FUNC_ABI Environment* AddGlobalTestEnvironment(Environment* env);
-  friend LLVM_FUNC_ABI internal::UnitTestImpl* internal::GetUnitTestImpl();
-  friend LLVM_FUNC_ABI void internal::ReportFailureInUnknownLocation(
+  friend Environment* AddGlobalTestEnvironment(Environment* env);
+  friend internal::UnitTestImpl* internal::GetUnitTestImpl();
+  friend void internal::ReportFailureInUnknownLocation(
       TestPartResult::Type result_type,
       const std::string& message);
 
@@ -2466,7 +2466,7 @@ TestInfo* RegisterTest(const char* test_suite_name, const char* test_name,
 //
 // This function was formerly a macro; thus, it is in the global
 // namespace and has an all-caps name.
-LLVM_FUNC_ABI int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
+int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
 
 inline int RUN_ALL_TESTS() {
   return ::testing::UnitTest::GetInstance()->Run();
diff --git a/third-party/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h b/third-party/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
index a0751226f8ca063..052dc978252e190 100644
--- a/third-party/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ b/third-party/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
@@ -296,7 +296,7 @@ class InternalRunDeathTestFlag {
 // Returns a newly created InternalRunDeathTestFlag object with fields
 // initialized from the GTEST_FLAG(internal_run_death_test) flag if
 // the flag is specified; otherwise returns NULL.
-LLVM_FUNC_ABI InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
+InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
 
 #endif  // GTEST_HAS_DEATH_TEST
 
diff --git a/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h b/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h
index 6b7ee094f869d06..d861a0a4f76fff8 100644
--- a/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h
+++ b/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h
@@ -648,7 +648,7 @@ inline std::string GetPrefixUntilComma(const char* str) {
 
 // Splits a given string on a given delimiter, populating a given
 // vector with the fields.
-LLVM_FUNC_ABI void SplitString(const ::std::string& str, char delimiter,
+void SplitString(const ::std::string& str, char delimiter,
                  ::std::vector< ::std::string>* dest);
 
 // The default argument to the template below for the case when the user does
diff --git a/third-party/unittest/googletest/include/gtest/internal/gtest-port.h b/third-party/unittest/googletest/include/gtest/internal/gtest-port.h
index ba2dfc68e642e87..9ec07b8d4a6ad4c 100644
--- a/third-party/unittest/googletest/include/gtest/internal/gtest-port.h
+++ b/third-party/unittest/googletest/include/gtest/internal/gtest-port.h
@@ -1139,11 +1139,11 @@ GTEST_API_ std::vector<std::string> GetArgvs();
 
 #if GTEST_HAS_DEATH_TEST
 
-LLVM_FUNC_ABI std::vector<std::string> GetInjectableArgvs();
+std::vector<std::string> GetInjectableArgvs();
 // Deprecated: pass the args vector by value instead.
-LLVM_FUNC_ABI void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
-LLVM_FUNC_ABI void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
-LLVM_FUNC_ABI void ClearInjectableArgvs();
+void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
+void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
+void ClearInjectableArgvs();
 
 #endif  // GTEST_HAS_DEATH_TEST
 
@@ -2200,14 +2200,14 @@ typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
 // to *value and returns true; otherwise leaves *value unchanged and returns
 // false.
-LLVM_FUNC_ABI bool ParseInt32(const Message& src_text, const char* str, Int32* value);
+bool ParseInt32(const Message& src_text, const char* str, Int32* value);
 
 // Parses a bool/Int32/string from the environment variable
 // corresponding to the given Google Test flag.
-LLVM_FUNC_ABI bool BoolFromGTestEnv(const char* flag, bool default_val);
+bool BoolFromGTestEnv(const char* flag, bool default_val);
 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
-LLVM_FUNC_ABI std::string OutputFlagAlsoCheckEnvVar();
-LLVM_FUNC_ABI const char* StringFromGTestEnv(const char* flag, const char* default_val);
+std::string OutputFlagAlsoCheckEnvVar();
+const char* StringFromGTestEnv(const char* flag, const char* default_val);
 
 }  // namespace internal
 }  // namespace testing

>From 7abb277eedadbb8ae6f7599c7fbd126e2fb670e5 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 01:40:36 +0000
Subject: [PATCH 20/39] XXX: Profile headers

---
 llvm/include/llvm/Analysis/MemoryProfileInfo.h    | 4 ++++
 llvm/unittests/Analysis/MemoryProfileInfoTest.cpp | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/Analysis/MemoryProfileInfo.h b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
index 06bd5b6d3e89329..abaa15ad2d0a24a 100644
--- a/llvm/include/llvm/Analysis/MemoryProfileInfo.h
+++ b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
@@ -18,10 +18,14 @@
 #include "llvm/IR/Metadata.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/Support/Commandline.h"
 #include "llvm/Support/Compiler.h"
 #include <map>
 
 namespace llvm {
+
+LLVM_FUNC_ABI extern cl::opt<unsigned> MemProfAveLifetimeColdThreshold;
+
 namespace memprof {
 
 /// Return the allocation type for a given set of memory profile values.
diff --git a/llvm/unittests/Analysis/MemoryProfileInfoTest.cpp b/llvm/unittests/Analysis/MemoryProfileInfoTest.cpp
index 1ba402276e036db..030e1a3b30493ab 100644
--- a/llvm/unittests/Analysis/MemoryProfileInfoTest.cpp
+++ b/llvm/unittests/Analysis/MemoryProfileInfoTest.cpp
@@ -22,7 +22,6 @@ using namespace llvm;
 using namespace llvm::memprof;
 
 extern cl::opt<float> MemProfLifetimeAccessDensityColdThreshold;
-extern cl::opt<unsigned> MemProfAveLifetimeColdThreshold;
 extern cl::opt<unsigned> MemProfMinAveLifetimeAccessDensityHotThreshold;
 
 namespace {

>From 592641211220ae7deeb43e46bb310de50c6803b6 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 01:41:42 +0000
Subject: [PATCH 21/39] XXX: cl headers

---
 llvm/include/llvm/Analysis/MemoryProfileInfo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/Analysis/MemoryProfileInfo.h b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
index abaa15ad2d0a24a..71ba2f600b1b306 100644
--- a/llvm/include/llvm/Analysis/MemoryProfileInfo.h
+++ b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
@@ -18,7 +18,7 @@
 #include "llvm/IR/Metadata.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/ModuleSummaryIndex.h"
-#include "llvm/Support/Commandline.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Compiler.h"
 #include <map>
 

>From d0b4a52047f8fed761a75ccdc2668557a5c8b24f Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 01:54:49 +0000
Subject: [PATCH 22/39] XXX: profile headres

---
 llvm/include/llvm/Analysis/MemoryProfileInfo.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/MemoryProfileInfo.h b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
index 71ba2f600b1b306..9f759b3921e1787 100644
--- a/llvm/include/llvm/Analysis/MemoryProfileInfo.h
+++ b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
@@ -22,10 +22,9 @@
 #include "llvm/Support/Compiler.h"
 #include <map>
 
-namespace llvm {
-
-LLVM_FUNC_ABI extern cl::opt<unsigned> MemProfAveLifetimeColdThreshold;
+LLVM_FUNC_ABI extern llvm::cl::opt<unsigned> MemProfAveLifetimeColdThreshold;
 
+namespace llvm {
 namespace memprof {
 
 /// Return the allocation type for a given set of memory profile values.

>From b7d8fa7666b55e688383d08794e2805de1a4312a Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 04:53:59 +0000
Subject: [PATCH 23/39] XXX: profile headers

---
 llvm/include/llvm/Analysis/MemoryProfileInfo.h    | 2 ++
 llvm/unittests/Analysis/MemoryProfileInfoTest.cpp | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/Analysis/MemoryProfileInfo.h b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
index 9f759b3921e1787..3d79821a5ee2e9a 100644
--- a/llvm/include/llvm/Analysis/MemoryProfileInfo.h
+++ b/llvm/include/llvm/Analysis/MemoryProfileInfo.h
@@ -22,7 +22,9 @@
 #include "llvm/Support/Compiler.h"
 #include <map>
 
+LLVM_FUNC_ABI extern llvm::cl::opt<float> MemProfLifetimeAccessDensityColdThreshold;
 LLVM_FUNC_ABI extern llvm::cl::opt<unsigned> MemProfAveLifetimeColdThreshold;
+LLVM_FUNC_ABI extern llvm::cl::opt<unsigned> MemProfMinAveLifetimeAccessDensityHotThreshold;
 
 namespace llvm {
 namespace memprof {
diff --git a/llvm/unittests/Analysis/MemoryProfileInfoTest.cpp b/llvm/unittests/Analysis/MemoryProfileInfoTest.cpp
index 030e1a3b30493ab..e888c83b425687f 100644
--- a/llvm/unittests/Analysis/MemoryProfileInfoTest.cpp
+++ b/llvm/unittests/Analysis/MemoryProfileInfoTest.cpp
@@ -21,9 +21,6 @@
 using namespace llvm;
 using namespace llvm::memprof;
 
-extern cl::opt<float> MemProfLifetimeAccessDensityColdThreshold;
-extern cl::opt<unsigned> MemProfMinAveLifetimeAccessDensityHotThreshold;
-
 namespace {
 
 class MemoryProfileInfoTest : public testing::Test {

>From f1afa80de16ac4980fe7698df84ce6bb6d4f72db Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 04:54:20 +0000
Subject: [PATCH 24/39] XXX: regallco headers

---
 llvm/lib/CodeGen/RegAllocScore.h             | 7 +++++++
 llvm/unittests/CodeGen/RegAllocScoreTest.cpp | 5 -----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/llvm/lib/CodeGen/RegAllocScore.h b/llvm/lib/CodeGen/RegAllocScore.h
index b80adae29f23ce5..ca183d37a67f04b 100644
--- a/llvm/lib/CodeGen/RegAllocScore.h
+++ b/llvm/lib/CodeGen/RegAllocScore.h
@@ -16,6 +16,13 @@
 #define LLVM_CODEGEN_REGALLOCSCORE_H_
 
 #include "llvm/ADT/STLFunctionalExtras.h"
+#include "llvm/Support/CommandLine.h"
+
+LLVM_FUNC_ABI extern llvm::cl::opt<double> CopyWeight;
+LLVM_FUNC_ABI extern llvm::cl::opt<double> LoadWeight;
+LLVM_FUNC_ABI extern llvm::cl::opt<double> StoreWeight;
+LLVM_FUNC_ABI extern llvm::cl::opt<double> CheapRematWeight;
+LLVM_FUNC_ABI extern llvm::cl::opt<double> ExpensiveRematWeight;
 
 namespace llvm {
 
diff --git a/llvm/unittests/CodeGen/RegAllocScoreTest.cpp b/llvm/unittests/CodeGen/RegAllocScoreTest.cpp
index ff7146eaf9439af..b457b53c7583c9a 100644
--- a/llvm/unittests/CodeGen/RegAllocScoreTest.cpp
+++ b/llvm/unittests/CodeGen/RegAllocScoreTest.cpp
@@ -29,11 +29,6 @@
 #include "gtest/gtest.h"
 
 using namespace llvm;
-extern cl::opt<double> CopyWeight;
-extern cl::opt<double> LoadWeight;
-extern cl::opt<double> StoreWeight;
-extern cl::opt<double> CheapRematWeight;
-extern cl::opt<double> ExpensiveRematWeight;
 
 namespace {
 // Include helper functions to ease the manipulation of MachineFunctions.

>From 6d58227771b01e9bcde8623d8ea7290422dfd1d2 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 04:54:27 +0000
Subject: [PATCH 25/39] templates

---
 llvm/include/llvm/Analysis/LoopInfo.h         |  4 +--
 llvm/include/llvm/IR/Dominators.h             | 26 +++++++++----------
 llvm/lib/CodeGen/MLRegallocEvictAdvisor.h     |  3 +++
 .../ExecutionEngine/JITLink/AArch32Tests.cpp  |  1 +
 4 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h
index 38e17315585d5ac..cb33d5139265a38 100644
--- a/llvm/include/llvm/Analysis/LoopInfo.h
+++ b/llvm/include/llvm/Analysis/LoopInfo.h
@@ -41,7 +41,7 @@ class ScalarEvolution;
 class raw_ostream;
 
 // Implementation in Support/GenericLoopInfoImpl.h
-extern template class LoopBase<BasicBlock, Loop>;
+extern template class LLVM_CLASS_ABI LoopBase<BasicBlock, Loop>;
 
 /// Represents a single loop in the control flow graph.  Note that not all SCCs
 /// in the CFG are necessarily loops.
@@ -406,7 +406,7 @@ class LLVM_EXTERNAL_VISIBILITY Loop : public LoopBase<BasicBlock, Loop> {
 };
 
 // Implementation in Support/GenericLoopInfoImpl.h
-extern template class LoopInfoBase<BasicBlock, Loop>;
+extern template class LLVM_CLASS_ABI LoopInfoBase<BasicBlock, Loop>;
 
 class LLVM_CLASS_ABI LoopInfo : public LoopInfoBase<BasicBlock, Loop> {
   typedef LoopInfoBase<BasicBlock, Loop> BaseT;
diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h
index e2f90e8be6ec2d6..35cbd1672e6a907 100644
--- a/llvm/include/llvm/IR/Dominators.h
+++ b/llvm/include/llvm/IR/Dominators.h
@@ -48,9 +48,9 @@ class Value;
 class raw_ostream;
 template <class GraphType> struct GraphTraits;
 
-extern template class DomTreeNodeBase<BasicBlock>;
-extern template class DominatorTreeBase<BasicBlock, false>; // DomTree
-extern template class DominatorTreeBase<BasicBlock, true>; // PostDomTree
+extern template class LLVM_CLASS_ABI DomTreeNodeBase<BasicBlock>;
+extern template class LLVM_CLASS_ABI DominatorTreeBase<BasicBlock, false>; // DomTree
+extern template class LLVM_CLASS_ABI DominatorTreeBase<BasicBlock, true>; // PostDomTree
 
 extern template class cfg::Update<BasicBlock *>;
 
@@ -64,33 +64,33 @@ using BBDomTreeGraphDiff = GraphDiff<BasicBlock *, false>;
 using BBPostDomTreeGraphDiff = GraphDiff<BasicBlock *, true>;
 
 extern template LLVM_FUNC_ABI void Calculate<BBDomTree>(BBDomTree &DT);
-extern template void CalculateWithUpdates<BBDomTree>(BBDomTree &DT,
+extern template LLVM_FUNC_ABI void CalculateWithUpdates<BBDomTree>(BBDomTree &DT,
                                                      BBUpdates U);
 
-extern template void Calculate<BBPostDomTree>(BBPostDomTree &DT);
+extern template LLVM_FUNC_ABI void Calculate<BBPostDomTree>(BBPostDomTree &DT);
 
-extern template void InsertEdge<BBDomTree>(BBDomTree &DT, BasicBlock *From,
+extern template LLVM_FUNC_ABI void InsertEdge<BBDomTree>(BBDomTree &DT, BasicBlock *From,
                                            BasicBlock *To);
-extern template void InsertEdge<BBPostDomTree>(BBPostDomTree &DT,
+extern template LLVM_FUNC_ABI void InsertEdge<BBPostDomTree>(BBPostDomTree &DT,
                                                BasicBlock *From,
                                                BasicBlock *To);
 
-extern template void DeleteEdge<BBDomTree>(BBDomTree &DT, BasicBlock *From,
+extern template LLVM_FUNC_ABI void DeleteEdge<BBDomTree>(BBDomTree &DT, BasicBlock *From,
                                            BasicBlock *To);
-extern template void DeleteEdge<BBPostDomTree>(BBPostDomTree &DT,
+extern template LLVM_FUNC_ABI void DeleteEdge<BBPostDomTree>(BBPostDomTree &DT,
                                                BasicBlock *From,
                                                BasicBlock *To);
 
-extern template void ApplyUpdates<BBDomTree>(BBDomTree &DT,
+extern template LLVM_FUNC_ABI void ApplyUpdates<BBDomTree>(BBDomTree &DT,
                                              BBDomTreeGraphDiff &,
                                              BBDomTreeGraphDiff *);
-extern template void ApplyUpdates<BBPostDomTree>(BBPostDomTree &DT,
+extern template LLVM_FUNC_ABI void ApplyUpdates<BBPostDomTree>(BBPostDomTree &DT,
                                                  BBPostDomTreeGraphDiff &,
                                                  BBPostDomTreeGraphDiff *);
 
-extern template bool Verify<BBDomTree>(const BBDomTree &DT,
+extern template LLVM_FUNC_ABI bool Verify<BBDomTree>(const BBDomTree &DT,
                                        BBDomTree::VerificationLevel VL);
-extern template bool Verify<BBPostDomTree>(const BBPostDomTree &DT,
+extern template LLVM_FUNC_ABI bool Verify<BBPostDomTree>(const BBPostDomTree &DT,
                                            BBPostDomTree::VerificationLevel VL);
 }  // namespace DomTreeBuilder
 
diff --git a/llvm/lib/CodeGen/MLRegallocEvictAdvisor.h b/llvm/lib/CodeGen/MLRegallocEvictAdvisor.h
index e36a4115409670a..87e869d91978509 100644
--- a/llvm/lib/CodeGen/MLRegallocEvictAdvisor.h
+++ b/llvm/lib/CodeGen/MLRegallocEvictAdvisor.h
@@ -17,6 +17,7 @@
 #include "llvm/Analysis/MLModelRunner.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/SlotIndexes.h"
+#include "llvm/Support/Compiler.h"
 
 using namespace llvm;
 
@@ -31,6 +32,7 @@ struct LRStartEndInfo {
   size_t Pos = 0;
 };
 
+LLVM_FUNC_ABI
 void extractInstructionFeatures(
     llvm::SmallVectorImpl<LRStartEndInfo> &LRPosInfo,
     MLModelRunner *RegallocRunner, function_ref<int(SlotIndex)> GetOpcode,
@@ -40,6 +42,7 @@ void extractInstructionFeatures(
     const int MBBFreqIndex, const int MBBMappingIndex,
     const SlotIndex LastIndex);
 
+LLVM_FUNC_ABI
 void extractMBBFrequency(const SlotIndex CurrentIndex,
                          const size_t CurrentInstructionIndex,
                          std::map<MachineBasicBlock *, size_t> &VisitedMBBs,
diff --git a/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp b/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
index 0e41174040b684b..137b34c8b861ff1 100644
--- a/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
+++ b/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
@@ -8,6 +8,7 @@
 
 #include <llvm/BinaryFormat/ELF.h>
 #include <llvm/ExecutionEngine/JITLink/aarch32.h>
+#include <llvm/Object/ELF.h>
 
 #include "gtest/gtest.h"
 

>From ddde6c44db512675c62bf4a5ba293fd2b7af7bf2 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 05:14:04 +0000
Subject: [PATCH 26/39] EnableKnowledgeRetention option

---
 llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h | 3 +++
 llvm/lib/Passes/PassBuilderPipelines.cpp                 | 1 -
 llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp     | 6 ------
 llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp      | 1 -
 4 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
index 3b00d34822eab0a..6eebbb2be144514 100644
--- a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
+++ b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
@@ -18,6 +18,7 @@
 
 #include "llvm/Analysis/AssumeBundleQueries.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Compiler.h"
 
 namespace llvm {
@@ -27,6 +28,8 @@ class Instruction;
 class AssumptionCache;
 class DominatorTree;
 
+extern cl::opt<bool> EnableKnowledgeRetention;
+
 /// Build a call to llvm.assume to preserve informations that can be derived
 /// from the given instruction.
 /// If no information derived from \p I, this call returns null.
diff --git a/llvm/lib/Passes/PassBuilderPipelines.cpp b/llvm/lib/Passes/PassBuilderPipelines.cpp
index 660cb2e974d7816..a530bc20183b578 100644
--- a/llvm/lib/Passes/PassBuilderPipelines.cpp
+++ b/llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -291,7 +291,6 @@ PipelineTuningOptions::PipelineTuningOptions() {
 
 namespace llvm {
 extern cl::opt<unsigned> MaxDevirtIterations;
-extern cl::opt<bool> EnableKnowledgeRetention;
 } // namespace llvm
 
 void PassBuilder::invokePeepholeEPCallbacks(FunctionPassManager &FPM,
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 37d6a59e364e707..76cf8d91ac6d53a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -89,12 +89,6 @@ static cl::opt<unsigned> GuardWideningWindow(
     cl::desc("How wide an instruction window to bypass looking for "
              "another guard"));
 
-namespace llvm {
-/// enable preservation of attributes in assume like:
-/// call void @llvm.assume(i1 true) [ "nonnull"(i32* %PTR) ]
-extern cl::opt<bool> EnableKnowledgeRetention;
-} // namespace llvm
-
 /// Return the specified type promoted as it would be to pass though a va_arg
 /// area.
 static Type *getPromotedType(Type *Ty) {
diff --git a/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp b/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
index ef84ed5d99d6829..139d9998db0aaaf 100644
--- a/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
+++ b/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
@@ -22,7 +22,6 @@ using namespace llvm;
 
 namespace llvm {
 extern cl::opt<bool> ShouldPreserveAllAttributes;
-extern cl::opt<bool> EnableKnowledgeRetention;
 } // namespace llvm
 
 static void RunTest(

>From e3bdbec777f627c49feb3fbf77a3d094dbcf4a95 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 05:45:13 +0000
Subject: [PATCH 27/39] XXX: profile heders

---
 llvm/include/llvm/Analysis/ProfileSummaryInfo.h          | 3 +++
 llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h | 1 +
 llvm/lib/Analysis/ModuleSummaryAnalysis.cpp              | 2 --
 llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp      | 4 ----
 llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp       | 2 --
 5 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
index b6260fe4b80f572..f51607e1aaf0af8 100644
--- a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
+++ b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
@@ -21,10 +21,13 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/ProfileSummary.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Compiler.h"
 #include <memory>
 #include <optional>
 
+LLVM_FUNC_ABI extern llvm::cl::opt<bool> ScalePartialSampleProfileWorkingSetSize;
+
 namespace llvm {
 class BasicBlock;
 class CallBase;
diff --git a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
index 6eebbb2be144514..5c725b08efd573b 100644
--- a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
+++ b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
@@ -29,6 +29,7 @@ class AssumptionCache;
 class DominatorTree;
 
 extern cl::opt<bool> EnableKnowledgeRetention;
+extern cl::opt<bool> ShouldPreserveAllAttributes;
 
 /// Build a call to llvm.assume to preserve informations that can be derived
 /// from the given instruction.
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index 165b8f172c35e80..61b61a371e6ed19 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -80,8 +80,6 @@ static cl::opt<std::string> ModuleSummaryDotFile(
     "module-summary-dot-file", cl::Hidden, cl::value_desc("filename"),
     cl::desc("File to emit dot graph of new summary into"));
 
-extern cl::opt<bool> ScalePartialSampleProfileWorkingSetSize;
-
 // Walk through the operands of a given User via worklist iteration and populate
 // the set of GlobalValue references encountered. Invoked either on an
 // Instruction or a GlobalVariable (which walks its initializer).
diff --git a/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp b/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
index 139d9998db0aaaf..6c42798a74c9254 100644
--- a/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
+++ b/llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp
@@ -20,10 +20,6 @@
 
 using namespace llvm;
 
-namespace llvm {
-extern cl::opt<bool> ShouldPreserveAllAttributes;
-} // namespace llvm
-
 static void RunTest(
     StringRef Head, StringRef Tail,
     std::vector<std::pair<StringRef, llvm::function_ref<void(Instruction *)>>>
diff --git a/llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp b/llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
index f36d3ba99775b4d..0b73f32b88d31b4 100644
--- a/llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
+++ b/llvm/unittests/Analysis/ProfileSummaryInfoTest.cpp
@@ -24,8 +24,6 @@
 #include "llvm/Support/raw_ostream.h"
 #include "gtest/gtest.h"
 
-extern llvm::cl::opt<bool> ScalePartialSampleProfileWorkingSetSize;
-
 namespace llvm {
 namespace {
 

>From a2cab291ecdb4dea5f53d9d135c50d8d0d8e1966 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 5 Aug 2023 18:29:15 +0000
Subject: [PATCH 28/39] XXX: Working

---
 llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h | 4 ++--
 llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h            | 3 ++-
 llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h     | 2 +-
 llvm/lib/CodeGen/RegAllocScore.h                         | 7 ++++---
 llvm/lib/FileCheck/FileCheckImpl.h                       | 5 +++--
 llvm/lib/Transforms/Vectorize/VPlan.h                    | 4 ++--
 llvm/lib/Transforms/Vectorize/VPlanVerifier.h            | 4 +++-
 7 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
index 5c725b08efd573b..4b8eab98f49f99d 100644
--- a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
+++ b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h
@@ -28,8 +28,8 @@ class Instruction;
 class AssumptionCache;
 class DominatorTree;
 
-extern cl::opt<bool> EnableKnowledgeRetention;
-extern cl::opt<bool> ShouldPreserveAllAttributes;
+LLVM_FUNC_ABI extern cl::opt<bool> EnableKnowledgeRetention;
+LLVM_FUNC_ABI extern cl::opt<bool> ShouldPreserveAllAttributes;
 
 /// Build a call to llvm.assume to preserve informations that can be derived
 /// from the given instruction.
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h b/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
index 79b5df89e33898f..ffbddca4e8ecc4c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
@@ -13,6 +13,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/CodeGen/DwarfStringPoolEntry.h"
 #include "llvm/Support/Allocator.h"
+#include "llvm/Support/Compiler.h"
 
 namespace llvm {
 
@@ -23,7 +24,7 @@ class MCSymbol;
 // Collection of strings for this unit and assorted symbols.
 // A String->Symbol mapping of strings used by indirect
 // references.
-class DwarfStringPool {
+class LLVM_CLASS_ABI DwarfStringPool {
   using EntryTy = DwarfStringPoolEntry;
 
   StringMap<EntryTy, BumpPtrAllocator &> Pool;
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
index 30de18e53c4fb43..da874f3bb95f287 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
@@ -104,7 +104,7 @@ struct SpillLoc {
 /// The obvious limits of a 1M block function or 1M instruction blocks are
 /// problematic; but by that point we should probably have bailed out of
 /// trying to analyse the function.
-class ValueIDNum {
+class LLVM_CLASS_ABI ValueIDNum {
   union {
     struct {
       uint64_t BlockNo : 20; /// The block where the def happens.
diff --git a/llvm/lib/CodeGen/RegAllocScore.h b/llvm/lib/CodeGen/RegAllocScore.h
index ca183d37a67f04b..8aa07ce79d3b9a6 100644
--- a/llvm/lib/CodeGen/RegAllocScore.h
+++ b/llvm/lib/CodeGen/RegAllocScore.h
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/STLFunctionalExtras.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Compiler.h"
 
 LLVM_FUNC_ABI extern llvm::cl::opt<double> CopyWeight;
 LLVM_FUNC_ABI extern llvm::cl::opt<double> LoadWeight;
@@ -32,7 +33,7 @@ class MachineFunction;
 class MachineInstr;
 
 /// Regalloc score.
-class RegAllocScore final {
+class LLVM_CLASS_ABI RegAllocScore final {
   double CopyCounts = 0.0;
   double LoadCounts = 0.0;
   double StoreCounts = 0.0;
@@ -67,11 +68,11 @@ class RegAllocScore final {
 /// Calculate a score. When comparing 2 scores for the same function but
 /// different policies, the better policy would have a smaller score.
 /// The implementation is the overload below (which is also easily unittestable)
-RegAllocScore calculateRegAllocScore(const MachineFunction &MF,
+LLVM_FUNC_ABI RegAllocScore calculateRegAllocScore(const MachineFunction &MF,
                                      const MachineBlockFrequencyInfo &MBFI);
 
 /// Implementation of the above, which is also more easily unittestable.
-RegAllocScore calculateRegAllocScore(
+LLVM_FUNC_ABI RegAllocScore calculateRegAllocScore(
     const MachineFunction &MF,
     llvm::function_ref<double(const MachineBasicBlock &)> GetBBFreq,
     llvm::function_ref<bool(const MachineInstr &)> IsTriviallyRematerializable);
diff --git a/llvm/lib/FileCheck/FileCheckImpl.h b/llvm/lib/FileCheck/FileCheckImpl.h
index 10fe8d46ffac386..f1867465ea06457 100644
--- a/llvm/lib/FileCheck/FileCheckImpl.h
+++ b/llvm/lib/FileCheck/FileCheckImpl.h
@@ -19,6 +19,7 @@
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/FileCheck/FileCheck.h"
+#include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/SourceMgr.h"
 #include <map>
@@ -433,7 +434,7 @@ class NumericSubstitution : public Substitution {
 /// Class holding the Pattern global state, shared by all patterns: tables
 /// holding values of variables and whether they are defined or not at any
 /// given time in the matching process.
-class FileCheckPatternContext {
+class LLVM_CLASS_ABI FileCheckPatternContext {
   friend class Pattern;
 
 private:
@@ -588,7 +589,7 @@ class ErrorReported final : public ErrorInfo<ErrorReported> {
   }
 };
 
-class Pattern {
+class LLVM_CLASS_ABI Pattern {
   SMLoc PatternLoc;
 
   /// A fixed string to match as the pattern or empty if this pattern requires
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 73313465adea990..84dcd4c98ea0191 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -2411,7 +2411,7 @@ class VPRegionBlock : public VPBlockBase {
 /// output IR instructions to generate, and their cost. VPlan holds a
 /// Hierarchical-CFG of VPBasicBlocks and VPRegionBlocks rooted at an Entry
 /// VPBasicBlock.
-class VPlan {
+class LLVM_CLASS_ABI VPlan {
   friend class VPlanPrinter;
   friend class VPSlotTracker;
 
@@ -2861,7 +2861,7 @@ class VPInterleavedAccessInfo {
 
 /// Class that maps (parts of) an existing VPlan to trees of combined
 /// VPInstructions.
-class VPlanSlp {
+class LLVM_CLASS_ABI VPlanSlp {
   enum class OpMode { Failed, Load, Opcode };
 
   /// A DenseMapInfo implementation for using SmallVector<VPValue *, 4> as
diff --git a/llvm/lib/Transforms/Vectorize/VPlanVerifier.h b/llvm/lib/Transforms/Vectorize/VPlanVerifier.h
index 839c24e2c9f4d33..a981880ebb4d61b 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanVerifier.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanVerifier.h
@@ -24,13 +24,15 @@
 #ifndef LLVM_TRANSFORMS_VECTORIZE_VPLANVERIFIER_H
 #define LLVM_TRANSFORMS_VECTORIZE_VPLANVERIFIER_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class VPRegionBlock;
 class VPlan;
 
 /// Struct with utility functions that can be used to check the consistency and
 /// invariants of a VPlan, including the components of its H-CFG.
-struct VPlanVerifier {
+struct LLVM_CLASS_ABI VPlanVerifier {
   /// Verify the invariants of the H-CFG starting from \p TopRegion. The
   /// verification process comprises the following steps:
   /// 1. Region/Block verification: Check the Region/Block verification

>From 4d7ea8ad56ee0a5baa52b7a699c33e050215bf15 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sun, 6 Aug 2023 06:10:01 +0000
Subject: [PATCH 29/39] Unit test working

---
 llvm/include/llvm/ADT/DenseMapInfoVariant.h   |  2 +-
 llvm/include/llvm/ADT/ImmutableList.h         |  8 +-
 llvm/include/llvm/ADT/ImmutableMap.h          |  6 +-
 llvm/include/llvm/ADT/ImmutableSet.h          | 28 +++----
 llvm/include/llvm/ADT/TypeSwitch.h            |  6 +-
 .../ExecutionEngine/JITLink/ELF_aarch32.h     |  3 +
 .../llvm/ExecutionEngine/JITLink/aarch32.h    |  7 ++
 llvm/include/llvm/Support/HashBuilder.h       |  8 +-
 llvm/include/llvm/Support/raw_sha1_ostream.h  |  2 +-
 .../include/llvm/Testing/ADT/StringMapEntry.h |  8 +-
 .../include/llvm/Transforms/Utils/LoopUtils.h |  2 +-
 llvm/include/llvm/XRay/FDRLogBuilder.h        |  2 +-
 llvm/lib/CodeGen/AsmPrinter/DIEHash.h         |  2 +-
 .../LiveDebugValues/InstrRefBasedImpl.h       | 30 +++----
 .../CodeGen/LiveDebugValues/LiveDebugValues.h | 10 ++-
 llvm/lib/CodeGen/MLRegallocEvictAdvisor.h     |  2 +-
 llvm/lib/CodeGen/RegisterCoalescer.h          |  2 +-
 llvm/lib/FileCheck/FileCheckImpl.h            | 46 +++++-----
 .../Target/X86/MCTargetDesc/X86MCTargetDesc.h | 37 ++++----
 llvm/lib/Target/X86/X86InstrFMA3Info.h        |  5 +-
 llvm/lib/Target/X86/X86InstrInfo.h            | 28 +++----
 llvm/lib/Target/X86/X86RegisterInfo.h         |  2 +-
 llvm/lib/Transforms/Vectorize/VPlan.h         | 84 +++++++++----------
 llvm/lib/Transforms/Vectorize/VPlanCFG.h      | 22 ++---
 .../Transforms/Vectorize/VPlanDominatorTree.h |  6 +-
 .../Transforms/Vectorize/VPlanHCFGBuilder.h   |  2 +-
 .../Transforms/Vectorize/VPlanTransforms.h    |  2 +-
 llvm/lib/Transforms/Vectorize/VPlanValue.h    | 10 +--
 .../ExecutionEngine/JITLink/AArch32Tests.cpp  | 10 +--
 .../Transforms/Scalar/LoopPassManagerTest.cpp |  1 +
 llvm/utils/TableGen/GlobalISel/CodeExpander.h |  2 +-
 .../TableGen/GlobalISel/CodeExpansions.h      |  2 +-
 32 files changed, 197 insertions(+), 190 deletions(-)

diff --git a/llvm/include/llvm/ADT/DenseMapInfoVariant.h b/llvm/include/llvm/ADT/DenseMapInfoVariant.h
index a97f9b9566c81ca..33faab3044f8044 100644
--- a/llvm/include/llvm/ADT/DenseMapInfoVariant.h
+++ b/llvm/include/llvm/ADT/DenseMapInfoVariant.h
@@ -21,7 +21,7 @@
 namespace llvm {
 
 // Provide DenseMapInfo for variants whose all alternatives have DenseMapInfo.
-template <typename... Ts> struct DenseMapInfo<std::variant<Ts...>> {
+template <typename... Ts> struct LLVM_CLASS_ABI DenseMapInfo<std::variant<Ts...>> {
   using Variant = std::variant<Ts...>;
   using FirstT = std::variant_alternative_t<0, Variant>;
 
diff --git a/llvm/include/llvm/ADT/ImmutableList.h b/llvm/include/llvm/ADT/ImmutableList.h
index 0b6f5e4d16368ee..c977b5ceccc7f01 100644
--- a/llvm/include/llvm/ADT/ImmutableList.h
+++ b/llvm/include/llvm/ADT/ImmutableList.h
@@ -25,7 +25,7 @@ namespace llvm {
 template <typename T> class ImmutableListFactory;
 
 template <typename T>
-class ImmutableListImpl : public FoldingSetNode {
+class LLVM_CLASS_ABI ImmutableListImpl : public FoldingSetNode {
   friend class ImmutableListFactory<T>;
 
   T Head;
@@ -62,7 +62,7 @@ class ImmutableListImpl : public FoldingSetNode {
 ///  of a group of lists.  When the factory object is reclaimed, all lists
 ///  created by that factory are released as well.
 template <typename T>
-class ImmutableList {
+class LLVM_CLASS_ABI ImmutableList {
 public:
   using value_type = T;
   using Factory = ImmutableListFactory<T>;
@@ -147,7 +147,7 @@ class ImmutableList {
 };
 
 template <typename T>
-class ImmutableListFactory {
+class LLVM_CLASS_ABI ImmutableListFactory {
   using ListTy = ImmutableListImpl<T>;
   using CacheTy = FoldingSet<ListTy>;
 
@@ -221,7 +221,7 @@ class ImmutableListFactory {
 // Partially-specialized Traits.
 //===----------------------------------------------------------------------===//
 
-template <typename T> struct DenseMapInfo<ImmutableList<T>, void> {
+template <typename T> struct LLVM_CLASS_ABI DenseMapInfo<ImmutableList<T>, void> {
   static inline ImmutableList<T> getEmptyKey() {
     return reinterpret_cast<ImmutableListImpl<T>*>(-1);
   }
diff --git a/llvm/include/llvm/ADT/ImmutableMap.h b/llvm/include/llvm/ADT/ImmutableMap.h
index 3d19ca41a5be0d9..6fe6c01fb68ae3c 100644
--- a/llvm/include/llvm/ADT/ImmutableMap.h
+++ b/llvm/include/llvm/ADT/ImmutableMap.h
@@ -25,7 +25,7 @@ namespace llvm {
 /// and second elements in a pair are used to generate profile information,
 /// only the first element (the key) is used by isEqual and isLess.
 template <typename T, typename S>
-struct ImutKeyValueInfo {
+struct LLVM_CLASS_ABI ImutKeyValueInfo {
   using value_type = const std::pair<T,S>;
   using value_type_ref = const value_type&;
   using key_type = const T;
@@ -60,7 +60,7 @@ struct ImutKeyValueInfo {
 
 template <typename KeyT, typename ValT,
           typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
-class ImmutableMap {
+class LLVM_CLASS_ABI ImmutableMap {
 public:
   using value_type = typename ValInfo::value_type;
   using value_type_ref = typename ValInfo::value_type_ref;
@@ -200,7 +200,7 @@ class ImmutableMap {
 // NOTE: This will possibly become the new implementation of ImmutableMap some day.
 template <typename KeyT, typename ValT,
 typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
-class ImmutableMapRef {
+class LLVM_CLASS_ABI ImmutableMapRef {
 public:
   using value_type = typename ValInfo::value_type;
   using value_type_ref = typename ValInfo::value_type_ref;
diff --git a/llvm/include/llvm/ADT/ImmutableSet.h b/llvm/include/llvm/ADT/ImmutableSet.h
index 5bee746688ce4e8..e4b0eb0fcd9f0f2 100644
--- a/llvm/include/llvm/ADT/ImmutableSet.h
+++ b/llvm/include/llvm/ADT/ImmutableSet.h
@@ -40,7 +40,7 @@ template <typename ImutInfo> class ImutAVLTreeInOrderIterator;
 template <typename ImutInfo> class ImutAVLTreeGenericIterator;
 
 template <typename ImutInfo >
-class ImutAVLTree {
+class LLVM_CLASS_ABI ImutAVLTree {
 public:
   using key_type_ref = typename ImutInfo::key_type_ref;
   using value_type = typename ImutInfo::value_type;
@@ -346,7 +346,7 @@ class ImutAVLTree {
 };
 
 template <typename ImutInfo>
-struct IntrusiveRefCntPtrInfo<ImutAVLTree<ImutInfo>> {
+struct LLVM_CLASS_ABI IntrusiveRefCntPtrInfo<ImutAVLTree<ImutInfo>> {
   static void retain(ImutAVLTree<ImutInfo> *Tree) { Tree->retain(); }
   static void release(ImutAVLTree<ImutInfo> *Tree) { Tree->release(); }
 };
@@ -356,7 +356,7 @@ struct IntrusiveRefCntPtrInfo<ImutAVLTree<ImutInfo>> {
 //===----------------------------------------------------------------------===//
 
 template <typename ImutInfo >
-class ImutAVLFactory {
+class LLVM_CLASS_ABI ImutAVLFactory {
   friend class ImutAVLTree<ImutInfo>;
 
   using TreeTy = ImutAVLTree<ImutInfo>;
@@ -638,7 +638,7 @@ class ImutAVLFactory {
 // Immutable AVL-Tree Iterators.
 //===----------------------------------------------------------------------===//
 
-template <typename ImutInfo> class ImutAVLTreeGenericIterator {
+template <typename ImutInfo> class LLVM_CLASS_ABI ImutAVLTreeGenericIterator {
   SmallVector<uintptr_t,20> stack;
 
 public:
@@ -752,7 +752,7 @@ template <typename ImutInfo> class ImutAVLTreeGenericIterator {
   }
 };
 
-template <typename ImutInfo> class ImutAVLTreeInOrderIterator {
+template <typename ImutInfo> class LLVM_CLASS_ABI ImutAVLTreeInOrderIterator {
   using InternalIteratorTy = ImutAVLTreeGenericIterator<ImutInfo>;
 
   InternalIteratorTy InternalItr;
@@ -812,7 +812,7 @@ template <typename ImutInfo> class ImutAVLTreeInOrderIterator {
 /// Generic iterator that wraps a T::TreeTy::iterator and exposes
 /// iterator::getValue() on dereference.
 template <typename T>
-struct ImutAVLValueIterator
+struct LLVM_CLASS_ABI ImutAVLValueIterator
     : iterator_adaptor_base<
           ImutAVLValueIterator<T>, typename T::TreeTy::iterator,
           typename std::iterator_traits<
@@ -835,7 +835,7 @@ struct ImutAVLValueIterator
 /// profile method of an object.  Specializations for primitive integers
 /// and generic handling of pointers is done below.
 template <typename T>
-struct ImutProfileInfo {
+struct LLVM_CLASS_ABI ImutProfileInfo {
   using value_type = const T;
   using value_type_ref = const T&;
 
@@ -846,7 +846,7 @@ struct ImutProfileInfo {
 
 /// Profile traits for integers.
 template <typename T>
-struct ImutProfileInteger {
+struct LLVM_CLASS_ABI ImutProfileInteger {
   using value_type = const T;
   using value_type_ref = const T&;
 
@@ -873,7 +873,7 @@ PROFILE_INTEGER_INFO(unsigned long long)
 
 /// Profile traits for booleans.
 template <>
-struct ImutProfileInfo<bool> {
+struct LLVM_CLASS_ABI ImutProfileInfo<bool> {
   using value_type = const bool;
   using value_type_ref = const bool&;
 
@@ -885,7 +885,7 @@ struct ImutProfileInfo<bool> {
 /// Generic profile trait for pointer types.  We treat pointers as
 /// references to unique objects.
 template <typename T>
-struct ImutProfileInfo<T*> {
+struct LLVM_CLASS_ABI ImutProfileInfo<T*> {
   using value_type = const T*;
   using value_type_ref = value_type;
 
@@ -905,7 +905,7 @@ struct ImutProfileInfo<T*> {
 ///   elements of immutable containers that defaults to using
 ///   std::equal_to<> and std::less<> to perform comparison of elements.
 template <typename T>
-struct ImutContainerInfo : public ImutProfileInfo<T> {
+struct LLVM_CLASS_ABI ImutContainerInfo : public ImutProfileInfo<T> {
   using value_type = typename ImutProfileInfo<T>::value_type;
   using value_type_ref = typename ImutProfileInfo<T>::value_type_ref;
   using key_type = value_type;
@@ -931,7 +931,7 @@ struct ImutContainerInfo : public ImutProfileInfo<T> {
 ///  as references to unique objects.  Pointers are thus compared by
 ///  their addresses.
 template <typename T>
-struct ImutContainerInfo<T*> : public ImutProfileInfo<T*> {
+struct LLVM_CLASS_ABI ImutContainerInfo<T*> : public ImutProfileInfo<T*> {
   using value_type = typename ImutProfileInfo<T*>::value_type;
   using value_type_ref = typename ImutProfileInfo<T*>::value_type_ref;
   using key_type = value_type;
@@ -954,7 +954,7 @@ struct ImutContainerInfo<T*> : public ImutProfileInfo<T*> {
 //===----------------------------------------------------------------------===//
 
 template <typename ValT, typename ValInfo = ImutContainerInfo<ValT>>
-class ImmutableSet {
+class LLVM_CLASS_ABI ImmutableSet {
 public:
   using value_type = typename ValInfo::value_type;
   using value_type_ref = typename ValInfo::value_type_ref;
@@ -1080,7 +1080,7 @@ class ImmutableSet {
 
 // NOTE: This may some day replace the current ImmutableSet.
 template <typename ValT, typename ValInfo = ImutContainerInfo<ValT>>
-class ImmutableSetRef {
+class LLVM_CLASS_ABI ImmutableSetRef {
 public:
   using value_type = typename ValInfo::value_type;
   using value_type_ref = typename ValInfo::value_type_ref;
diff --git a/llvm/include/llvm/ADT/TypeSwitch.h b/llvm/include/llvm/ADT/TypeSwitch.h
index 10a2d48e918db99..7baecf2068e461a 100644
--- a/llvm/include/llvm/ADT/TypeSwitch.h
+++ b/llvm/include/llvm/ADT/TypeSwitch.h
@@ -22,7 +22,7 @@
 namespace llvm {
 namespace detail {
 
-template <typename DerivedT, typename T> class TypeSwitchBase {
+template <typename DerivedT, typename T> class LLVM_CLASS_ABI TypeSwitchBase {
 public:
   TypeSwitchBase(const T &value) : value(value) {}
   TypeSwitchBase(TypeSwitchBase &&other) : value(other.value) {}
@@ -104,7 +104,7 @@ template <typename DerivedT, typename T> class TypeSwitchBase {
 ///    .Default([](Operation *op) { ... });
 ///
 template <typename T, typename ResultT = void>
-class TypeSwitch : public detail::TypeSwitchBase<TypeSwitch<T, ResultT>, T> {
+class LLVM_CLASS_ABI TypeSwitch : public detail::TypeSwitchBase<TypeSwitch<T, ResultT>, T> {
 public:
   using BaseT = detail::TypeSwitchBase<TypeSwitch<T, ResultT>, T>;
   using BaseT::BaseT;
@@ -150,7 +150,7 @@ class TypeSwitch : public detail::TypeSwitchBase<TypeSwitch<T, ResultT>, T> {
 
 /// Specialization of TypeSwitch for void returning callables.
 template <typename T>
-class TypeSwitch<T, void>
+class LLVM_CLASS_ABI TypeSwitch<T, void>
     : public detail::TypeSwitchBase<TypeSwitch<T, void>, T> {
 public:
   using BaseT = detail::TypeSwitchBase<TypeSwitch<T, void>, T>;
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
index cfeb580d107f58a..a539ae4545e552a 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
@@ -33,6 +33,9 @@ createLinkGraphFromELFObject_aarch32(MemoryBufferRef ObjectBuffer);
 LLVM_FUNC_ABI void link_ELF_aarch32(std::unique_ptr<LinkGraph> G,
                       std::unique_ptr<JITLinkContext> Ctx);
 
+LLVM_FUNC_ABI Expected<uint32_t> getELFRelocationType(Edge::Kind Kind);
+LLVM_FUNC_ABI Expected<aarch32::EdgeKind_aarch32> getJITLinkEdgeKind(uint32_t ELFType);
+
 } // end namespace jitlink
 } // end namespace llvm
 
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
index 7d5f8c015b60d1c..4fa70603b28c817 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
@@ -291,6 +291,13 @@ class LLVM_CLASS_ABI StubsManager : public TableManager<StubsManager<Flavor>> {
 template <>
 Symbol &StubsManager<Thumbv7>::createEntry(LinkGraph &G, Symbol &Target);
 
+LLVM_FUNC_ABI HalfWords encodeRegMovtT1MovwT3(int64_t Value);
+LLVM_FUNC_ABI int64_t decodeRegMovtT1MovwT3(unsigned int, unsigned int);
+LLVM_FUNC_ABI uint16_t decodeImmMovtT1MovwT3(uint32_t Hi, uint32_t Lo);
+LLVM_FUNC_ABI int64_t decodeImmBT4BlT1BlxT2_J1J2(uint32_t Hi, uint32_t Lo);
+LLVM_FUNC_ABI HalfWords encodeImmMovtT1MovwT3(uint16_t Value);
+LLVM_FUNC_ABI HalfWords encodeImmBT4BlT1BlxT2_J1J2(int64_t Value);
+
 } // namespace aarch32
 } // namespace jitlink
 } // namespace llvm
diff --git a/llvm/include/llvm/Support/HashBuilder.h b/llvm/include/llvm/Support/HashBuilder.h
index 6b3625b9cb71a20..922d0178671a520 100644
--- a/llvm/include/llvm/Support/HashBuilder.h
+++ b/llvm/include/llvm/Support/HashBuilder.h
@@ -33,13 +33,13 @@ namespace hashbuilder_detail {
 /// Trait to indicate whether a type's bits can be hashed directly (after
 /// endianness correction).
 template <typename U>
-struct IsHashableData
+struct LLVM_CLASS_ABI IsHashableData
     : std::integral_constant<bool, is_integral_or_enum<U>::value> {};
 
 } // namespace hashbuilder_detail
 
 /// Declares the hasher member, and functions forwarding directly to the hasher.
-template <typename HasherT> class HashBuilderBase {
+template <typename HasherT> class LLVM_CLASS_ABI HashBuilderBase {
 public:
   template <typename HasherT_ = HasherT>
   using HashResultTy = decltype(std::declval<HasherT_ &>().final());
@@ -92,7 +92,7 @@ template <typename HasherT> class HashBuilderBase {
 /// expected to canonicalize `support::endianness::native` to one of
 /// `support::endianness::big` or `support::endianness::little`.
 template <typename HasherT, support::endianness Endianness>
-class HashBuilderImpl : public HashBuilderBase<HasherT> {
+class LLVM_CLASS_ABI HashBuilderImpl : public HashBuilderBase<HasherT> {
   static_assert(Endianness != support::endianness::native,
                 "HashBuilder should canonicalize endianness");
 
@@ -402,7 +402,7 @@ using HashBuilder =
                                   : Endianness)>;
 
 namespace hashbuilder_detail {
-class HashCodeHasher {
+class LLVM_CLASS_ABI HashCodeHasher {
 public:
   HashCodeHasher() : Code(0) {}
   void update(ArrayRef<uint8_t> Data) {
diff --git a/llvm/include/llvm/Support/raw_sha1_ostream.h b/llvm/include/llvm/Support/raw_sha1_ostream.h
index 299f6e6b5e88604..93cf26667ab7b02 100644
--- a/llvm/include/llvm/Support/raw_sha1_ostream.h
+++ b/llvm/include/llvm/Support/raw_sha1_ostream.h
@@ -20,7 +20,7 @@
 namespace llvm {
 
 /// A raw_ostream that hash the content using the sha1 algorithm.
-class raw_sha1_ostream : public raw_ostream {
+class LLVM_CLASS_ABI raw_sha1_ostream : public raw_ostream {
   SHA1 State;
 
   /// See raw_ostream::write_impl.
diff --git a/llvm/include/llvm/Testing/ADT/StringMapEntry.h b/llvm/include/llvm/Testing/ADT/StringMapEntry.h
index 7649c30078181b3..507dcb69ac20eff 100644
--- a/llvm/include/llvm/Testing/ADT/StringMapEntry.h
+++ b/llvm/include/llvm/Testing/ADT/StringMapEntry.h
@@ -18,10 +18,10 @@ namespace llvm {
 namespace detail {
 
 template <typename T, typename = std::void_t<>>
-struct CanOutputToOStream : std::false_type {};
+struct LLVM_CLASS_ABI CanOutputToOStream : std::false_type {};
 
 template <typename T>
-struct CanOutputToOStream<T, std::void_t<decltype(std::declval<std::ostream &>()
+struct LLVM_CLASS_ABI CanOutputToOStream<T, std::void_t<decltype(std::declval<std::ostream &>()
                                                   << std::declval<T>())>>
     : std::true_type {};
 
@@ -43,7 +43,7 @@ std::ostream &operator<<(std::ostream &OS, const StringMapEntry<T> &E) {
 namespace detail {
 
 template <typename StringMapEntryT>
-class StringMapEntryMatcherImpl
+class LLVM_CLASS_ABI StringMapEntryMatcherImpl
     : public testing::MatcherInterface<StringMapEntryT> {
 public:
   using ValueT = typename std::remove_reference_t<StringMapEntryT>::ValueType;
@@ -97,7 +97,7 @@ class StringMapEntryMatcherImpl
 };
 
 template <typename KeyMatcherT, typename ValueMatcherT>
-class StringMapEntryMatcher {
+class LLVM_CLASS_ABI StringMapEntryMatcher {
 public:
   StringMapEntryMatcher(KeyMatcherT KMArg, ValueMatcherT VMArg)
       : KM(std::move(KMArg)), VM(std::move(VMArg)) {}
diff --git a/llvm/include/llvm/Transforms/Utils/LoopUtils.h b/llvm/include/llvm/Transforms/Utils/LoopUtils.h
index 68c72c22e68bba4..f4f7d07773f8385 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopUtils.h
@@ -496,7 +496,7 @@ LLVM_FUNC_ABI void setProfileInfoAfterUnrolling(Loop *OrigLoop, Loop *UnrolledLo
 /// For trees, a preorder traversal is a viable reverse postorder, so we
 /// actually append using a preorder walk algorithm.
 template <typename RangeT>
-void appendLoopsToWorklist(RangeT &&, SmallPriorityWorklist<Loop *, 4> &);
+LLVM_FUNC_ABI void appendLoopsToWorklist(RangeT &&, SmallPriorityWorklist<Loop *, 4> &);
 /// Utility that implements appending of loops onto a worklist given a range.
 /// It has the same behavior as appendLoopsToWorklist, but assumes the range of
 /// loops has already been reversed, so it processes loops in the given order.
diff --git a/llvm/include/llvm/XRay/FDRLogBuilder.h b/llvm/include/llvm/XRay/FDRLogBuilder.h
index f07c446ce1e5973..3ee785b7727eeda 100644
--- a/llvm/include/llvm/XRay/FDRLogBuilder.h
+++ b/llvm/include/llvm/XRay/FDRLogBuilder.h
@@ -22,7 +22,7 @@ namespace xray {
 ///       .add<NewBufferRecord>(1)
 ///       .consume();
 ///
-class LogBuilder {
+class LLVM_CLASS_ABI LogBuilder {
   std::vector<std::unique_ptr<Record>> Records;
 
 public:
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIEHash.h b/llvm/lib/CodeGen/AsmPrinter/DIEHash.h
index 24a973b39271582..1b2f0e24e972f31 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIEHash.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DIEHash.h
@@ -23,7 +23,7 @@ class AsmPrinter;
 
 /// An object containing the capability of hashing and adding hash
 /// attributes onto a DIE.
-class DIEHash {
+class LLVM_CLASS_ABI DIEHash {
   // Collection of all attributes used in hashing a particular DIE.
   struct DIEAttrs {
 #define HANDLE_DIE_HASH_ATTR(NAME) DIEValue NAME;
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
index da874f3bb95f287..3a5f02bb942e95f 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
@@ -40,7 +40,7 @@ using namespace llvm;
 /// without concern for where that location is. Practically, this allows us to
 /// treat the state of the machine at a particular point as an array of values,
 /// rather than a map of values.
-class LocIdx {
+class LLVM_CLASS_ABI LocIdx {
   unsigned Location;
 
   // Default constructor is private, initializing to an illegal location number.
@@ -79,7 +79,7 @@ class LocIdx {
 
 // The location at which a spilled value resides. It consists of a register and
 // an offset.
-struct SpillLoc {
+struct LLVM_CLASS_ABI SpillLoc {
   unsigned SpillBase;
   StackOffset SpillOffset;
   bool operator==(const SpillLoc &Other) const {
@@ -175,7 +175,7 @@ class LLVM_CLASS_ABI ValueIDNum {
 namespace llvm {
 using namespace LiveDebugValues;
 
-template <> struct DenseMapInfo<LocIdx> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<LocIdx> {
   static inline LocIdx getEmptyKey() { return LocIdx::MakeIllegalLoc(); }
   static inline LocIdx getTombstoneKey() { return LocIdx::MakeTombstoneLoc(); }
 
@@ -184,7 +184,7 @@ template <> struct DenseMapInfo<LocIdx> {
   static bool isEqual(const LocIdx &A, const LocIdx &B) { return A == B; }
 };
 
-template <> struct DenseMapInfo<ValueIDNum> {
+template <> struct LLVM_CLASS_ABI DenseMapInfo<ValueIDNum> {
   static inline ValueIDNum getEmptyKey() { return ValueIDNum::EmptyValue; }
   static inline ValueIDNum getTombstoneKey() {
     return ValueIDNum::TombstoneValue;
@@ -213,7 +213,7 @@ using FuncValueTable = std::unique_ptr<ValueTable[]>;
 
 /// Thin wrapper around an integer -- designed to give more type safety to
 /// spill location numbers.
-class SpillLocationNo {
+class LLVM_CLASS_ABI SpillLocationNo {
 public:
   explicit SpillLocationNo(unsigned SpillNo) : SpillNo(SpillNo) {}
   unsigned SpillNo;
@@ -233,7 +233,7 @@ class SpillLocationNo {
 
 /// Meta qualifiers for a value. Pair of whatever expression is used to qualify
 /// the value, and Boolean of whether or not it's indirect.
-class DbgValueProperties {
+class LLVM_CLASS_ABI DbgValueProperties {
 public:
   DbgValueProperties(const DIExpression *DIExpr, bool Indirect, bool IsVariadic)
       : DIExpr(DIExpr), Indirect(Indirect), IsVariadic(IsVariadic) {}
@@ -279,7 +279,7 @@ class DbgValueProperties {
 /// Stores a single debug operand, which can either be a MachineOperand for
 /// directly storing immediate values, or a ValueIDNum representing some value
 /// computed at some point in the program. IsConst is used as a discriminator.
-struct DbgOp {
+struct LLVM_CLASS_ABI DbgOp {
   union {
     ValueIDNum ID;
     MachineOperand MO;
@@ -301,7 +301,7 @@ struct DbgOp {
 /// when working with concrete debug values, i.e. when joining MLocs and VLocs
 /// in the TransferTracker or emitting DBG_VALUE/DBG_VALUE_LIST instructions in
 /// the MLocTracker.
-struct ResolvedDbgOp {
+struct LLVM_CLASS_ABI ResolvedDbgOp {
   union {
     LocIdx Loc;
     MachineOperand MO;
@@ -331,7 +331,7 @@ struct ResolvedDbgOp {
 /// should be equal for all equal DbgOps, and also encodes whether the mapped
 /// DbgOp is a constant, meaning that for simple equality or const-ness checks
 /// it is not necessary to lookup this ID.
-struct DbgOpID {
+struct LLVM_CLASS_ABI DbgOpID {
   struct IsConstIndexPair {
     uint32_t IsConst : 1;
     uint32_t Index : 31;
@@ -368,7 +368,7 @@ struct DbgOpID {
 /// within the current function. Allows 2-way lookup, with `find` returning the
 /// Op for a given ID and `insert` returning the ID for a given Op (creating one
 /// if none exists).
-class DbgOpIDMap {
+class LLVM_CLASS_ABI DbgOpIDMap {
 
   SmallVector<ValueIDNum, 0> ValueOps;
   SmallVector<MachineOperand, 0> ConstOps;
@@ -438,7 +438,7 @@ class DbgOpIDMap {
 /// This class also stores meta-information about how the value is qualified.
 /// Used to reason about variable values when performing the second
 /// (DebugVariable specific) dataflow analysis.
-class DbgValue {
+class LLVM_CLASS_ABI DbgValue {
 private:
   /// If Kind is Def or VPHI, the set of IDs corresponding to the DbgOps that
   /// are used. VPHIs set every ID to EmptyID when we have not found a valid
@@ -575,7 +575,7 @@ class DbgValue {
   }
 };
 
-class LocIdxToIndexFunctor {
+class LLVM_CLASS_ABI LocIdxToIndexFunctor {
 public:
   using argument_type = LocIdx;
   unsigned operator()(const LocIdx &L) const { return L.asU64(); }
@@ -618,7 +618,7 @@ class LocIdxToIndexFunctor {
 /// Register mask operands cause trouble by technically defining every register;
 /// various hacks are used to avoid tracking registers that are never read and
 /// only written by regmasks.
-class MLocTracker {
+class LLVM_CLASS_ABI MLocTracker {
 public:
   MachineFunction &MF;
   const TargetInstrInfo &TII;
@@ -962,7 +962,7 @@ using OverlapMap =
 /// variable and the value the DBG_VALUE refers to. Requires the machine value
 /// location dataflow algorithm to have run already, so that values can be
 /// identified.
-class VLocTracker {
+class LLVM_CLASS_ABI VLocTracker {
 public:
   /// Map DebugVariable to the latest Value it's defined to have.
   /// Needs to be a MapVector because we determine order-in-the-input-MIR from
@@ -1034,7 +1034,7 @@ class VLocTracker {
 };
 
 // XXX XXX docs
-class InstrRefBasedLDV : public LDVImpl {
+class LLVM_CLASS_ABI InstrRefBasedLDV : public LDVImpl {
 public:
   friend class ::InstrRefLDVTest;
 
diff --git a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.h b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.h
index 6cc1685c002228f..af173fc2f514953 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.h
+++ b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_LIB_CODEGEN_LIVEDEBUGVALUES_LIVEDEBUGVALUES_H
 #define LLVM_LIB_CODEGEN_LIVEDEBUGVALUES_LIVEDEBUGVALUES_H
 
+#include "llvm/Support/Compiler.h"
+
 namespace llvm {
 class MachineDominatorTree;
 class MachineFunction;
@@ -22,7 +24,7 @@ inline namespace SharedLiveDebugValues {
 // Expose a base class for LiveDebugValues interfaces to inherit from. This
 // allows the generic LiveDebugValues pass handles to call into the
 // implementation.
-class LDVImpl {
+class LLVM_CLASS_ABI LDVImpl {
 public:
   virtual bool ExtendRanges(MachineFunction &MF, MachineDominatorTree *DomTree,
                             TargetPassConfig *TPC, unsigned InputBBLimit,
@@ -33,10 +35,10 @@ class LDVImpl {
 } // namespace SharedLiveDebugValues
 
 // Factory functions for LiveDebugValues implementations.
-extern LDVImpl *makeVarLocBasedLiveDebugValues();
-extern LDVImpl *makeInstrRefBasedLiveDebugValues();
+LLVM_FUNC_ABI extern LDVImpl *makeVarLocBasedLiveDebugValues();
+LLVM_FUNC_ABI extern LDVImpl *makeInstrRefBasedLiveDebugValues();
 
-extern bool debuginfoShouldUseDebugInstrRef(const Triple &T);
+LLVM_FUNC_ABI extern bool debuginfoShouldUseDebugInstrRef(const Triple &T);
 
 } // namespace llvm
 
diff --git a/llvm/lib/CodeGen/MLRegallocEvictAdvisor.h b/llvm/lib/CodeGen/MLRegallocEvictAdvisor.h
index 87e869d91978509..3fe8156f22e170a 100644
--- a/llvm/lib/CodeGen/MLRegallocEvictAdvisor.h
+++ b/llvm/lib/CodeGen/MLRegallocEvictAdvisor.h
@@ -26,7 +26,7 @@ using namespace llvm;
 // is assigned to (or 1 above the phys reg count if its the candidate).
 // Used when extracting per-instruction features in the context of a
 // specific eviction problem.
-struct LRStartEndInfo {
+struct LLVM_CLASS_ABI LRStartEndInfo {
   SlotIndex Begin;
   SlotIndex End;
   size_t Pos = 0;
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.h b/llvm/lib/CodeGen/RegisterCoalescer.h
index f265d93fb0d63d5..06c740ba4f78b77 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.h
+++ b/llvm/lib/CodeGen/RegisterCoalescer.h
@@ -25,7 +25,7 @@ class TargetRegisterInfo;
   /// A helper class for register coalescers. When deciding if
   /// two registers can be coalesced, CoalescerPair can determine if a copy
   /// instruction would become an identity copy after coalescing.
-  class CoalescerPair {
+  class LLVM_CLASS_ABI CoalescerPair {
     const TargetRegisterInfo &TRI;
 
     /// The register that will be left after coalescing. It can be a
diff --git a/llvm/lib/FileCheck/FileCheckImpl.h b/llvm/lib/FileCheck/FileCheckImpl.h
index f1867465ea06457..e5aa55e63403b03 100644
--- a/llvm/lib/FileCheck/FileCheckImpl.h
+++ b/llvm/lib/FileCheck/FileCheckImpl.h
@@ -38,7 +38,7 @@ class ExpressionValue;
 /// Type representing the format an expression value should be textualized into
 /// for matching. Used to represent both explicit format specifiers as well as
 /// implicit format from using numeric variables.
-struct ExpressionFormat {
+struct LLVM_CLASS_ABI ExpressionFormat {
   enum class Kind {
     /// Denote absence of format. Used for implicit format of literals and
     /// empty expressions.
@@ -108,7 +108,7 @@ struct ExpressionFormat {
 
 /// Class to represent an overflow error that might result when manipulating a
 /// value.
-class OverflowError : public ErrorInfo<OverflowError> {
+class LLVM_CLASS_ABI OverflowError : public ErrorInfo<OverflowError> {
 public:
   static char ID;
 
@@ -120,7 +120,7 @@ class OverflowError : public ErrorInfo<OverflowError> {
 };
 
 /// Class representing a numeric value.
-class ExpressionValue {
+class LLVM_CLASS_ABI ExpressionValue {
 private:
   APInt Value;
 
@@ -134,21 +134,21 @@ class ExpressionValue {
 
 /// Performs operation and \returns its result or an error in case of failure,
 /// such as if an overflow occurs.
-Expected<ExpressionValue> operator+(const ExpressionValue &Lhs,
+LLVM_FUNC_ABI Expected<ExpressionValue> operator+(const ExpressionValue &Lhs,
                                     const ExpressionValue &Rhs);
-Expected<ExpressionValue> operator-(const ExpressionValue &Lhs,
+LLVM_FUNC_ABI Expected<ExpressionValue> operator-(const ExpressionValue &Lhs,
                                     const ExpressionValue &Rhs);
-Expected<ExpressionValue> operator*(const ExpressionValue &Lhs,
+LLVM_FUNC_ABI Expected<ExpressionValue> operator*(const ExpressionValue &Lhs,
                                     const ExpressionValue &Rhs);
-Expected<ExpressionValue> operator/(const ExpressionValue &Lhs,
+LLVM_FUNC_ABI Expected<ExpressionValue> operator/(const ExpressionValue &Lhs,
                                     const ExpressionValue &Rhs);
-Expected<ExpressionValue> max(const ExpressionValue &Lhs,
+LLVM_FUNC_ABI Expected<ExpressionValue> max(const ExpressionValue &Lhs,
                               const ExpressionValue &Rhs);
-Expected<ExpressionValue> min(const ExpressionValue &Lhs,
+LLVM_FUNC_ABI Expected<ExpressionValue> min(const ExpressionValue &Lhs,
                               const ExpressionValue &Rhs);
 
 /// Base class representing the AST of a given expression.
-class ExpressionAST {
+class LLVM_CLASS_ABI ExpressionAST {
 private:
   StringRef ExpressionStr;
 
@@ -174,7 +174,7 @@ class ExpressionAST {
 };
 
 /// Class representing an unsigned literal in the AST of an expression.
-class ExpressionLiteral : public ExpressionAST {
+class LLVM_CLASS_ABI ExpressionLiteral : public ExpressionAST {
 private:
   /// Actual value of the literal.
   ExpressionValue Value;
@@ -190,7 +190,7 @@ class ExpressionLiteral : public ExpressionAST {
 
 /// Class to represent an undefined variable error, which quotes that
 /// variable's name when printed.
-class UndefVarError : public ErrorInfo<UndefVarError> {
+class LLVM_CLASS_ABI UndefVarError : public ErrorInfo<UndefVarError> {
 private:
   StringRef VarName;
 
@@ -212,7 +212,7 @@ class UndefVarError : public ErrorInfo<UndefVarError> {
 };
 
 /// Class representing an expression and its matching format.
-class Expression {
+class LLVM_CLASS_ABI Expression {
 private:
   /// Pointer to AST of the expression.
   std::unique_ptr<ExpressionAST> AST;
@@ -234,7 +234,7 @@ class Expression {
 };
 
 /// Class representing a numeric variable and its associated current value.
-class NumericVariable {
+class LLVM_CLASS_ABI NumericVariable {
 private:
   /// Name of the numeric variable.
   StringRef Name;
@@ -303,7 +303,7 @@ class NumericVariable {
 
 /// Class representing the use of a numeric variable in the AST of an
 /// expression.
-class NumericVariableUse : public ExpressionAST {
+class LLVM_CLASS_ABI NumericVariableUse : public ExpressionAST {
 private:
   /// Pointer to the class instance for the variable this use is about.
   NumericVariable *Variable;
@@ -326,7 +326,7 @@ using binop_eval_t = Expected<ExpressionValue> (*)(const ExpressionValue &,
                                                    const ExpressionValue &);
 
 /// Class representing a single binary operation in the AST of an expression.
-class BinaryOperation : public ExpressionAST {
+class LLVM_CLASS_ABI BinaryOperation : public ExpressionAST {
 private:
   /// Left operand.
   std::unique_ptr<ExpressionAST> LeftOperand;
@@ -363,7 +363,7 @@ class BinaryOperation : public ExpressionAST {
 class FileCheckPatternContext;
 
 /// Class representing a substitution to perform in the RegExStr string.
-class Substitution {
+class LLVM_CLASS_ABI Substitution {
 protected:
   /// Pointer to a class instance holding, among other things, the table with
   /// the values of live string variables at the start of any given CHECK line.
@@ -398,7 +398,7 @@ class Substitution {
   virtual Expected<std::string> getResult() const = 0;
 };
 
-class StringSubstitution : public Substitution {
+class LLVM_CLASS_ABI StringSubstitution : public Substitution {
 public:
   StringSubstitution(FileCheckPatternContext *Context, StringRef VarName,
                      size_t InsertIdx)
@@ -409,7 +409,7 @@ class StringSubstitution : public Substitution {
   Expected<std::string> getResult() const override;
 };
 
-class NumericSubstitution : public Substitution {
+class LLVM_CLASS_ABI NumericSubstitution : public Substitution {
 private:
   /// Pointer to the class representing the expression whose value is to be
   /// substituted.
@@ -511,7 +511,7 @@ class LLVM_CLASS_ABI FileCheckPatternContext {
 
 /// Class to represent an error holding a diagnostic with location information
 /// used when printing it.
-class ErrorDiagnostic : public ErrorInfo<ErrorDiagnostic> {
+class LLVM_CLASS_ABI ErrorDiagnostic : public ErrorInfo<ErrorDiagnostic> {
 private:
   SMDiagnostic Diagnostic;
   SMRange Range;
@@ -545,7 +545,7 @@ class ErrorDiagnostic : public ErrorInfo<ErrorDiagnostic> {
   }
 };
 
-class NotFoundError : public ErrorInfo<NotFoundError> {
+class LLVM_CLASS_ABI NotFoundError : public ErrorInfo<NotFoundError> {
 public:
   static char ID;
 
@@ -569,7 +569,7 @@ class NotFoundError : public ErrorInfo<NotFoundError> {
 /// an error except, in the former case, (1) there is no confusion over polarity
 /// and (2) the caller must either check the result or explicitly ignore it with
 /// a call like \c consumeError.
-class ErrorReported final : public ErrorInfo<ErrorReported> {
+class LLVM_CLASS_ABI ErrorReported final : public ErrorInfo<ErrorReported> {
 public:
   static char ID;
 
@@ -840,7 +840,7 @@ class LLVM_CLASS_ABI Pattern {
 //===----------------------------------------------------------------------===//
 
 /// A check that we found in the input file.
-struct FileCheckString {
+struct LLVM_CLASS_ABI FileCheckString {
   /// The pattern to match.
   Pattern Pat;
 
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
index 437a7bd6ff6c4cf..1be5963cd4209a1 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
@@ -13,6 +13,7 @@
 #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
 #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
 
+#include "llvm/Support/Compiler.h"
 #include <memory>
 #include <string>
 
@@ -53,26 +54,26 @@ namespace N86 {
 }
 
 namespace X86_MC {
-std::string ParseX86Triple(const Triple &TT);
+LLVM_FUNC_ABI std::string ParseX86Triple(const Triple &TT);
 
-unsigned getDwarfRegFlavour(const Triple &TT, bool isEH);
+LLVM_FUNC_ABI unsigned getDwarfRegFlavour(const Triple &TT, bool isEH);
 
-void initLLVMToSEHAndCVRegMapping(MCRegisterInfo *MRI);
+LLVM_FUNC_ABI void initLLVMToSEHAndCVRegMapping(MCRegisterInfo *MRI);
 
 
 /// Returns true if this instruction has a LOCK prefix.
-bool hasLockPrefix(const MCInst &MI);
+LLVM_FUNC_ABI bool hasLockPrefix(const MCInst &MI);
 
 /// \param Op operand # of the memory operand.
 ///
 /// \returns true if the specified instruction has a 16-bit memory operand.
-bool is16BitMemOperand(const MCInst &MI, unsigned Op,
+LLVM_FUNC_ABI bool is16BitMemOperand(const MCInst &MI, unsigned Op,
                        const MCSubtargetInfo &STI);
 
 /// \param Op operand # of the memory operand.
 ///
 /// \returns true if the specified instruction has a 32-bit memory operand.
-bool is32BitMemOperand(const MCInst &MI, unsigned Op);
+LLVM_FUNC_ABI bool is32BitMemOperand(const MCInst &MI, unsigned Op);
 
 /// \param Op operand # of the memory operand.
 ///
@@ -82,42 +83,42 @@ bool is64BitMemOperand(const MCInst &MI, unsigned Op);
 #endif
 
 /// Returns true if this instruction needs an Address-Size override prefix.
-bool needsAddressSizeOverride(const MCInst &MI, const MCSubtargetInfo &STI,
+LLVM_FUNC_ABI bool needsAddressSizeOverride(const MCInst &MI, const MCSubtargetInfo &STI,
                               int MemoryOperand, uint64_t TSFlags);
 
 /// Create a X86 MCSubtargetInfo instance. This is exposed so Asm parser, etc.
 /// do not need to go through TargetRegistry.
-MCSubtargetInfo *createX86MCSubtargetInfo(const Triple &TT, StringRef CPU,
+LLVM_FUNC_ABI MCSubtargetInfo *createX86MCSubtargetInfo(const Triple &TT, StringRef CPU,
                                           StringRef FS);
 }
 
-MCCodeEmitter *createX86MCCodeEmitter(const MCInstrInfo &MCII,
+LLVM_FUNC_ABI MCCodeEmitter *createX86MCCodeEmitter(const MCInstrInfo &MCII,
                                       MCContext &Ctx);
 
-MCAsmBackend *createX86_32AsmBackend(const Target &T,
+LLVM_FUNC_ABI MCAsmBackend *createX86_32AsmBackend(const Target &T,
                                      const MCSubtargetInfo &STI,
                                      const MCRegisterInfo &MRI,
                                      const MCTargetOptions &Options);
-MCAsmBackend *createX86_64AsmBackend(const Target &T,
+LLVM_FUNC_ABI MCAsmBackend *createX86_64AsmBackend(const Target &T,
                                      const MCSubtargetInfo &STI,
                                      const MCRegisterInfo &MRI,
                                      const MCTargetOptions &Options);
 
 /// Implements X86-only directives for assembly emission.
-MCTargetStreamer *createX86AsmTargetStreamer(MCStreamer &S,
+LLVM_FUNC_ABI MCTargetStreamer *createX86AsmTargetStreamer(MCStreamer &S,
                                              formatted_raw_ostream &OS,
                                              MCInstPrinter *InstPrinter,
                                              bool IsVerboseAsm);
 
 /// Implements X86-only directives for object files.
-MCTargetStreamer *createX86ObjectTargetStreamer(MCStreamer &S,
+LLVM_FUNC_ABI MCTargetStreamer *createX86ObjectTargetStreamer(MCStreamer &S,
                                                 const MCSubtargetInfo &STI);
 
 /// Construct an X86 Windows COFF machine code streamer which will generate
 /// PE/COFF format object files.
 ///
 /// Takes ownership of \p AB and \p CE.
-MCStreamer *createX86WinCOFFStreamer(MCContext &C,
+LLVM_FUNC_ABI MCStreamer *createX86WinCOFFStreamer(MCContext &C,
                                      std::unique_ptr<MCAsmBackend> &&AB,
                                      std::unique_ptr<MCObjectWriter> &&OW,
                                      std::unique_ptr<MCCodeEmitter> &&CE,
@@ -125,14 +126,14 @@ MCStreamer *createX86WinCOFFStreamer(MCContext &C,
                                      bool IncrementalLinkerCompatible);
 
 /// Construct an X86 Mach-O object writer.
-std::unique_ptr<MCObjectTargetWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectTargetWriter>
 createX86MachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype);
 
 /// Construct an X86 ELF object writer.
-std::unique_ptr<MCObjectTargetWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectTargetWriter>
 createX86ELFObjectWriter(bool IsELF64, uint8_t OSABI, uint16_t EMachine);
 /// Construct an X86 Win COFF object writer.
-std::unique_ptr<MCObjectTargetWriter>
+LLVM_FUNC_ABI std::unique_ptr<MCObjectTargetWriter>
 createX86WinCOFFObjectWriter(bool Is64Bit);
 
 /// \param Reg speicifed register.
@@ -140,7 +141,7 @@ createX86WinCOFFObjectWriter(bool Is64Bit);
 /// \param High requires the high register.
 ///
 /// \returns the sub or super register of a specific X86 register.
-MCRegister getX86SubSuperRegister(MCRegister Reg, unsigned Size,
+LLVM_FUNC_ABI MCRegister getX86SubSuperRegister(MCRegister Reg, unsigned Size,
                                   bool High = false);
 } // End llvm namespace
 
diff --git a/llvm/lib/Target/X86/X86InstrFMA3Info.h b/llvm/lib/Target/X86/X86InstrFMA3Info.h
index ce0a7cc7f82e52f..d701b8d0e0ce147 100644
--- a/llvm/lib/Target/X86/X86InstrFMA3Info.h
+++ b/llvm/lib/Target/X86/X86InstrFMA3Info.h
@@ -14,6 +14,7 @@
 #ifndef LLVM_LIB_TARGET_X86_UTILS_X86INSTRFMA3INFO_H
 #define LLVM_LIB_TARGET_X86_UTILS_X86INSTRFMA3INFO_H
 
+#include "llvm/Support/Compiler.h"
 #include <cstdint>
 
 namespace llvm {
@@ -21,7 +22,7 @@ namespace llvm {
 /// This class is used to group {132, 213, 231} forms of FMA opcodes together.
 /// Each of the groups has either 3 opcodes, Also, each group has an attributes
 /// field describing it.
-struct X86InstrFMA3Group {
+struct LLVM_CLASS_ABI X86InstrFMA3Group {
   /// An array holding 3 forms of FMA opcodes.
   uint16_t Opcodes[3];
 
@@ -90,7 +91,7 @@ struct X86InstrFMA3Group {
 /// Returns a reference to a group of FMA3 opcodes to where the given
 /// \p Opcode is included. If the given \p Opcode is not recognized as FMA3
 /// and not included into any FMA3 group, then nullptr is returned.
-const X86InstrFMA3Group *getFMA3Group(unsigned Opcode, uint64_t TSFlags);
+LLVM_FUNC_ABI const X86InstrFMA3Group *getFMA3Group(unsigned Opcode, uint64_t TSFlags);
 
 } // end namespace llvm
 
diff --git a/llvm/lib/Target/X86/X86InstrInfo.h b/llvm/lib/Target/X86/X86InstrInfo.h
index 82554032ebd6611..aa1b4500b808b48 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.h
+++ b/llvm/lib/Target/X86/X86InstrInfo.h
@@ -35,46 +35,46 @@ enum AsmComments {
 
 /// Return a pair of condition code for the given predicate and whether
 /// the instruction operands should be swaped to match the condition code.
-std::pair<CondCode, bool> getX86ConditionCode(CmpInst::Predicate Predicate);
+LLVM_FUNC_ABI std::pair<CondCode, bool> getX86ConditionCode(CmpInst::Predicate Predicate);
 
 /// Return a cmov opcode for the given register size in bytes, and operand type.
-unsigned getCMovOpcode(unsigned RegBytes, bool HasMemoryOperand = false);
+LLVM_FUNC_ABI unsigned getCMovOpcode(unsigned RegBytes, bool HasMemoryOperand = false);
 
 /// Return the source operand # for condition code by \p MCID. If the
 /// instruction doesn't have a condition code, return -1.
-int getCondSrcNoFromDesc(const MCInstrDesc &MCID);
+LLVM_FUNC_ABI int getCondSrcNoFromDesc(const MCInstrDesc &MCID);
 
 /// Return the condition code of the instruction. If the instruction doesn't
 /// have a condition code, return X86::COND_INVALID.
-CondCode getCondFromMI(const MachineInstr &MI);
+LLVM_FUNC_ABI CondCode getCondFromMI(const MachineInstr &MI);
 
 // Turn JCC instruction into condition code.
-CondCode getCondFromBranch(const MachineInstr &MI);
+LLVM_FUNC_ABI CondCode getCondFromBranch(const MachineInstr &MI);
 
 // Turn SETCC instruction into condition code.
-CondCode getCondFromSETCC(const MachineInstr &MI);
+LLVM_FUNC_ABI CondCode getCondFromSETCC(const MachineInstr &MI);
 
 // Turn CMOV instruction into condition code.
-CondCode getCondFromCMov(const MachineInstr &MI);
+LLVM_FUNC_ABI CondCode getCondFromCMov(const MachineInstr &MI);
 
 /// GetOppositeBranchCondition - Return the inverse of the specified cond,
 /// e.g. turning COND_E to COND_NE.
-CondCode GetOppositeBranchCondition(CondCode CC);
+LLVM_FUNC_ABI CondCode GetOppositeBranchCondition(CondCode CC);
 
 /// Get the VPCMP immediate for the given condition.
-unsigned getVPCMPImmForCond(ISD::CondCode CC);
+LLVM_FUNC_ABI unsigned getVPCMPImmForCond(ISD::CondCode CC);
 
 /// Get the VPCMP immediate if the opcodes are swapped.
-unsigned getSwappedVPCMPImm(unsigned Imm);
+LLVM_FUNC_ABI unsigned getSwappedVPCMPImm(unsigned Imm);
 
 /// Get the VPCOM immediate if the opcodes are swapped.
-unsigned getSwappedVPCOMImm(unsigned Imm);
+LLVM_FUNC_ABI unsigned getSwappedVPCOMImm(unsigned Imm);
 
 /// Get the VCMP immediate if the opcodes are swapped.
-unsigned getSwappedVCMPImm(unsigned Imm);
+LLVM_FUNC_ABI unsigned getSwappedVCMPImm(unsigned Imm);
 
 /// Check if the instruction is X87 instruction.
-bool isX87Instruction(MachineInstr &MI);
+LLVM_FUNC_ABI bool isX87Instruction(MachineInstr &MI);
 } // namespace X86
 
 /// isGlobalStubReference - Return true if the specified TargetFlag operand is
@@ -135,7 +135,7 @@ inline static bool isMem(const MachineInstr &MI, unsigned Op) {
          MI.getOperand(Op + X86::AddrSegmentReg).isReg() && isLeaMem(MI, Op);
 }
 
-class X86InstrInfo final : public X86GenInstrInfo {
+class LLVM_CLASS_ABI X86InstrInfo final : public X86GenInstrInfo {
   X86Subtarget &Subtarget;
   const X86RegisterInfo RI;
 
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.h b/llvm/lib/Target/X86/X86RegisterInfo.h
index da7b171e4cf6dfd..925d78a0b95a34e 100644
--- a/llvm/lib/Target/X86/X86RegisterInfo.h
+++ b/llvm/lib/Target/X86/X86RegisterInfo.h
@@ -21,7 +21,7 @@
 namespace llvm {
   class Triple;
 
-class X86RegisterInfo final : public X86GenRegisterInfo {
+class LLVM_CLASS_ABI X86RegisterInfo final : public X86GenRegisterInfo {
 private:
   /// Is64Bit - Is the target 64-bits.
   ///
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 84dcd4c98ea0191..b93f48eee3838f1 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -69,19 +69,19 @@ typedef unsigned ID;
 /// Returns a calculation for the total number of elements for a given \p VF.
 /// For fixed width vectors this value is a constant, whereas for scalable
 /// vectors it is an expression determined at runtime.
-Value *getRuntimeVF(IRBuilderBase &B, Type *Ty, ElementCount VF);
+LLVM_FUNC_ABI Value *getRuntimeVF(IRBuilderBase &B, Type *Ty, ElementCount VF);
 
 /// Return a value for Step multiplied by VF.
-Value *createStepForVF(IRBuilderBase &B, Type *Ty, ElementCount VF,
+LLVM_FUNC_ABI Value *createStepForVF(IRBuilderBase &B, Type *Ty, ElementCount VF,
                        int64_t Step);
 
-const SCEV *createTripCountSCEV(Type *IdxTy, PredicatedScalarEvolution &PSE,
+LLVM_FUNC_ABI const SCEV *createTripCountSCEV(Type *IdxTy, PredicatedScalarEvolution &PSE,
                                 Loop *CurLoop = nullptr);
 
 /// A range of powers-of-2 vectorization factors with fixed start and
 /// adjustable end. The range includes start and excludes end, e.g.,:
 /// [1, 16) = {1, 2, 4, 8}
-struct VFRange {
+struct LLVM_CLASS_ABI VFRange {
   // A power of 2.
   const ElementCount Start;
 
@@ -137,7 +137,7 @@ using VPlanPtr = std::unique_ptr<VPlan>;
 /// VPLane provides a way to access lanes in both fixed width and scalable
 /// vectors, where for the latter the lane index sometimes needs calculating
 /// as a runtime expression.
-class VPLane {
+class LLVM_CLASS_ABI VPLane {
 public:
   /// Kind describes how to interpret Lane.
   enum class Kind : uint8_t {
@@ -213,7 +213,7 @@ class VPLane {
 
 /// VPIteration represents a single point in the iteration space of the output
 /// (vectorized and/or unrolled) IR loop.
-struct VPIteration {
+struct LLVM_CLASS_ABI VPIteration {
   /// in [0..UF)
   unsigned Part;
 
@@ -230,7 +230,7 @@ struct VPIteration {
 
 /// VPTransformState holds information passed down when "executing" a VPlan,
 /// needed for generating the output IR.
-struct VPTransformState {
+struct LLVM_CLASS_ABI VPTransformState {
   VPTransformState(ElementCount VF, unsigned UF, LoopInfo *LI,
                    DominatorTree *DT, IRBuilderBase &Builder,
                    InnerLoopVectorizer *ILV, VPlan *Plan)
@@ -414,7 +414,7 @@ struct VPTransformState {
 
 /// VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
 /// A VPBlockBase can be either a VPBasicBlock or a VPRegionBlock.
-class VPBlockBase {
+class LLVM_CLASS_ABI VPBlockBase {
   friend class VPBlockUtils;
 
   const unsigned char SubclassID; ///< Subclass identifier (for isa/dyn_cast).
@@ -659,7 +659,7 @@ class VPBlockBase {
 
 /// A value that is used outside the VPlan. The operand of the user needs to be
 /// added to the associated LCSSA phi node.
-class VPLiveOut : public VPUser {
+class LLVM_CLASS_ABI VPLiveOut : public VPUser {
   PHINode *Phi;
 
 public:
@@ -697,7 +697,7 @@ class VPLiveOut : public VPUser {
 /// and is responsible for deleting its defined values. Single-value
 /// VPRecipeBases that also inherit from VPValue must make sure to inherit from
 /// VPRecipeBase before VPValue.
-class VPRecipeBase : public ilist_node_with_parent<VPRecipeBase, VPBasicBlock>,
+class LLVM_CLASS_ABI VPRecipeBase : public ilist_node_with_parent<VPRecipeBase, VPBasicBlock>,
                      public VPDef,
                      public VPUser {
   friend VPBasicBlock;
@@ -812,7 +812,7 @@ class VPRecipeBase : public ilist_node_with_parent<VPRecipeBase, VPBasicBlock>,
 /// While as any Recipe it may generate a sequence of IR instructions when
 /// executed, these instructions would always form a single-def expression as
 /// the VPInstruction is also a single def-use vertex.
-class VPInstruction : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPInstruction : public VPRecipeBase, public VPValue {
   friend class VPlanSlp;
 
 public:
@@ -944,7 +944,7 @@ class VPInstruction : public VPRecipeBase, public VPValue {
 };
 
 /// Class to record LLVM IR flag for a recipe along with it.
-class VPRecipeWithIRFlags : public VPRecipeBase {
+class LLVM_CLASS_ABI VPRecipeWithIRFlags : public VPRecipeBase {
   enum class OperationType : unsigned char {
     OverflowingBinOp,
     PossiblyExactOp,
@@ -1100,7 +1100,7 @@ class VPRecipeWithIRFlags : public VPRecipeBase {
 /// VPWidenRecipe is a recipe for producing a copy of vector type its
 /// ingredient. This recipe covers most of the traditional vectorization cases
 /// where each ingredient transforms into a vectorized version of itself.
-class VPWidenRecipe : public VPRecipeWithIRFlags, public VPValue {
+class LLVM_CLASS_ABI VPWidenRecipe : public VPRecipeWithIRFlags, public VPValue {
 
 public:
   template <typename IterT>
@@ -1122,7 +1122,7 @@ class VPWidenRecipe : public VPRecipeWithIRFlags, public VPValue {
 };
 
 /// VPWidenCastRecipe is a recipe to create vector cast instructions.
-class VPWidenCastRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPWidenCastRecipe : public VPRecipeBase, public VPValue {
   /// Cast instruction opcode.
   Instruction::CastOps Opcode;
 
@@ -1160,7 +1160,7 @@ class VPWidenCastRecipe : public VPRecipeBase, public VPValue {
 };
 
 /// A recipe for widening Call instructions.
-class VPWidenCallRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPWidenCallRecipe : public VPRecipeBase, public VPValue {
   /// ID of the vector intrinsic to call when widening the call. If set the
   /// Intrinsic::not_intrinsic, a library call will be used instead.
   Intrinsic::ID VectorIntrinsicID;
@@ -1193,7 +1193,7 @@ class VPWidenCallRecipe : public VPRecipeBase, public VPValue {
 };
 
 /// A recipe for widening select instructions.
-struct VPWidenSelectRecipe : public VPRecipeBase, public VPValue {
+struct LLVM_CLASS_ABI VPWidenSelectRecipe : public VPRecipeBase, public VPValue {
   template <typename IterT>
   VPWidenSelectRecipe(SelectInst &I, iterator_range<IterT> Operands)
       : VPRecipeBase(VPDef::VPWidenSelectSC, Operands), VPValue(this, &I) {}
@@ -1221,7 +1221,7 @@ struct VPWidenSelectRecipe : public VPRecipeBase, public VPValue {
 };
 
 /// A recipe for handling GEP instructions.
-class VPWidenGEPRecipe : public VPRecipeWithIRFlags, public VPValue {
+class LLVM_CLASS_ABI VPWidenGEPRecipe : public VPRecipeWithIRFlags, public VPValue {
   bool isPointerLoopInvariant() const {
     return getOperand(0)->isDefinedOutsideVectorRegions();
   }
@@ -1279,7 +1279,7 @@ class VPWidenGEPRecipe : public VPRecipeWithIRFlags, public VPValue {
 ///  * VPWidenPointerInductionRecipe: Generate vector and scalar values for a
 ///    pointer induction. Produces either a vector PHI per-part or scalar values
 ///    per-lane based on the canonical induction.
-class VPHeaderPHIRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPHeaderPHIRecipe : public VPRecipeBase, public VPValue {
 protected:
   VPHeaderPHIRecipe(unsigned char VPDefID, Instruction *UnderlyingInstr,
                     VPValue *Start = nullptr)
@@ -1336,7 +1336,7 @@ class VPHeaderPHIRecipe : public VPRecipeBase, public VPValue {
 
 /// A recipe for handling phi nodes of integer and floating-point inductions,
 /// producing their vector values.
-class VPWidenIntOrFpInductionRecipe : public VPHeaderPHIRecipe {
+class LLVM_CLASS_ABI VPWidenIntOrFpInductionRecipe : public VPHeaderPHIRecipe {
   PHINode *IV;
   TruncInst *Trunc;
   const InductionDescriptor &IndDesc;
@@ -1409,7 +1409,7 @@ class VPWidenIntOrFpInductionRecipe : public VPHeaderPHIRecipe {
   }
 };
 
-class VPWidenPointerInductionRecipe : public VPHeaderPHIRecipe {
+class LLVM_CLASS_ABI VPWidenPointerInductionRecipe : public VPHeaderPHIRecipe {
   const InductionDescriptor &IndDesc;
 
   bool IsScalarAfterVectorization;
@@ -1450,7 +1450,7 @@ class VPWidenPointerInductionRecipe : public VPHeaderPHIRecipe {
 /// A recipe for handling header phis that are widened in the vector loop.
 /// In the VPlan native path, all incoming VPValues & VPBasicBlock pairs are
 /// managed in the recipe directly.
-class VPWidenPHIRecipe : public VPHeaderPHIRecipe {
+class LLVM_CLASS_ABI VPWidenPHIRecipe : public VPHeaderPHIRecipe {
   /// List of incoming blocks. Only used in the VPlan native path.
   SmallVector<VPBasicBlock *, 2> IncomingBlocks;
 
@@ -1491,7 +1491,7 @@ class VPWidenPHIRecipe : public VPHeaderPHIRecipe {
 /// A recipe for handling first-order recurrence phis. The start value is the
 /// first operand of the recipe and the incoming value from the backedge is the
 /// second operand.
-struct VPFirstOrderRecurrencePHIRecipe : public VPHeaderPHIRecipe {
+struct LLVM_CLASS_ABI VPFirstOrderRecurrencePHIRecipe : public VPHeaderPHIRecipe {
   VPFirstOrderRecurrencePHIRecipe(PHINode *Phi, VPValue &Start)
       : VPHeaderPHIRecipe(VPDef::VPFirstOrderRecurrencePHISC, Phi, &Start) {}
 
@@ -1513,7 +1513,7 @@ struct VPFirstOrderRecurrencePHIRecipe : public VPHeaderPHIRecipe {
 /// A recipe for handling reduction phis. The start value is the first operand
 /// of the recipe and the incoming value from the backedge is the second
 /// operand.
-class VPReductionPHIRecipe : public VPHeaderPHIRecipe {
+class LLVM_CLASS_ABI VPReductionPHIRecipe : public VPHeaderPHIRecipe {
   /// Descriptor for the reduction.
   const RecurrenceDescriptor &RdxDesc;
 
@@ -1564,7 +1564,7 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe {
 
 /// A recipe for vectorizing a phi-node as a sequence of mask-based select
 /// instructions.
-class VPBlendRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPBlendRecipe : public VPRecipeBase, public VPValue {
   PHINode *Phi;
 
 public:
@@ -1615,7 +1615,7 @@ class VPBlendRecipe : public VPRecipeBase, public VPValue {
 /// or stores into one wide load/store and shuffles. The first operand of a
 /// VPInterleave recipe is the address, followed by the stored values, followed
 /// by an optional mask.
-class VPInterleaveRecipe : public VPRecipeBase {
+class LLVM_CLASS_ABI VPInterleaveRecipe : public VPRecipeBase {
   const InterleaveGroup<Instruction> *IG;
 
   /// Indicates if the interleave group is in a conditional block and requires a
@@ -1699,7 +1699,7 @@ class VPInterleaveRecipe : public VPRecipeBase {
 /// A recipe to represent inloop reduction operations, performing a reduction on
 /// a vector operand into a scalar value, and adding the result to a chain.
 /// The Operands are {ChainOp, VecOp, [Condition]}.
-class VPReductionRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPReductionRecipe : public VPRecipeBase, public VPValue {
   /// The recurrence decriptor for the reduction in question.
   const RecurrenceDescriptor *RdxDesc;
   /// Pointer to the TTI, needed to create the target reduction
@@ -1742,7 +1742,7 @@ class VPReductionRecipe : public VPRecipeBase, public VPValue {
 /// copies of the original scalar type, one per lane, instead of producing a
 /// single copy of widened type for all lanes. If the instruction is known to be
 /// uniform only one copy, per lane zero, will be generated.
-class VPReplicateRecipe : public VPRecipeWithIRFlags, public VPValue {
+class LLVM_CLASS_ABI VPReplicateRecipe : public VPRecipeWithIRFlags, public VPValue {
   /// Indicator if only a single replica per lane is needed.
   bool IsUniform;
 
@@ -1805,7 +1805,7 @@ class VPReplicateRecipe : public VPRecipeWithIRFlags, public VPValue {
 };
 
 /// A recipe for generating conditional branches on the bits of a mask.
-class VPBranchOnMaskRecipe : public VPRecipeBase {
+class LLVM_CLASS_ABI VPBranchOnMaskRecipe : public VPRecipeBase {
 public:
   VPBranchOnMaskRecipe(VPValue *BlockInMask)
       : VPRecipeBase(VPDef::VPBranchOnMaskSC, {}) {
@@ -1852,7 +1852,7 @@ class VPBranchOnMaskRecipe : public VPRecipeBase {
 /// order to merge values that are set under such a branch and feed their uses.
 /// The phi nodes can be scalar or vector depending on the users of the value.
 /// This recipe works in concert with VPBranchOnMaskRecipe.
-class VPPredInstPHIRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPPredInstPHIRecipe : public VPRecipeBase, public VPValue {
 public:
   /// Construct a VPPredInstPHIRecipe given \p PredInst whose value needs a phi
   /// nodes after merging back from a Branch-on-Mask.
@@ -1885,7 +1885,7 @@ class VPPredInstPHIRecipe : public VPRecipeBase, public VPValue {
 /// - For store: Address, stored value, optional mask
 /// TODO: We currently execute only per-part unless a specific instance is
 /// provided.
-class VPWidenMemoryInstructionRecipe : public VPRecipeBase {
+class LLVM_CLASS_ABI VPWidenMemoryInstructionRecipe : public VPRecipeBase {
   Instruction &Ingredient;
 
   // Whether the loaded-from / stored-to addresses are consecutive.
@@ -1978,7 +1978,7 @@ class VPWidenMemoryInstructionRecipe : public VPRecipeBase {
 };
 
 /// Recipe to expand a SCEV expression.
-class VPExpandSCEVRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPExpandSCEVRecipe : public VPRecipeBase, public VPValue {
   const SCEV *Expr;
   ScalarEvolution &SE;
 
@@ -2007,7 +2007,7 @@ class VPExpandSCEVRecipe : public VPRecipeBase, public VPValue {
 /// start value (either 0 or the resume value when vectorizing the epilogue
 /// loop). VPWidenCanonicalIVRecipe represents the vector version of the
 /// canonical induction variable.
-class VPCanonicalIVPHIRecipe : public VPHeaderPHIRecipe {
+class LLVM_CLASS_ABI VPCanonicalIVPHIRecipe : public VPHeaderPHIRecipe {
   DebugLoc DL;
 
 public:
@@ -2054,7 +2054,7 @@ class VPCanonicalIVPHIRecipe : public VPHeaderPHIRecipe {
 /// used to predicate the vector operations.
 /// TODO: It would be good to use the existing VPWidenPHIRecipe instead and
 /// remove VPActiveLaneMaskPHIRecipe.
-class VPActiveLaneMaskPHIRecipe : public VPHeaderPHIRecipe {
+class LLVM_CLASS_ABI VPActiveLaneMaskPHIRecipe : public VPHeaderPHIRecipe {
   DebugLoc DL;
 
 public:
@@ -2081,7 +2081,7 @@ class VPActiveLaneMaskPHIRecipe : public VPHeaderPHIRecipe {
 };
 
 /// A Recipe for widening the canonical induction variable of the vector loop.
-class VPWidenCanonicalIVRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPWidenCanonicalIVRecipe : public VPRecipeBase, public VPValue {
 public:
   VPWidenCanonicalIVRecipe(VPCanonicalIVPHIRecipe *CanonicalIV)
       : VPRecipeBase(VPDef::VPWidenCanonicalIVSC, {CanonicalIV}),
@@ -2112,7 +2112,7 @@ class VPWidenCanonicalIVRecipe : public VPRecipeBase, public VPValue {
 /// A recipe for converting the canonical IV value to the corresponding value of
 /// an IV with different start and step values, using Start + CanonicalIV *
 /// Step.
-class VPDerivedIVRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPDerivedIVRecipe : public VPRecipeBase, public VPValue {
   /// The type of the result value. It may be smaller than the type of the
   /// induction and in this case it will get truncated to ResultTy.
   Type *ResultTy;
@@ -2155,7 +2155,7 @@ class VPDerivedIVRecipe : public VPRecipeBase, public VPValue {
 
 /// A recipe for handling phi nodes of integer and floating-point inductions,
 /// producing their scalar values.
-class VPScalarIVStepsRecipe : public VPRecipeBase, public VPValue {
+class LLVM_CLASS_ABI VPScalarIVStepsRecipe : public VPRecipeBase, public VPValue {
   const InductionDescriptor &IndDesc;
 
 public:
@@ -2190,7 +2190,7 @@ class VPScalarIVStepsRecipe : public VPRecipeBase, public VPValue {
 /// VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph. It
 /// holds a sequence of zero or more VPRecipe's each representing a sequence of
 /// output IR instructions. All PHI-like recipes must come before any non-PHI recipes.
-class VPBasicBlock : public VPBlockBase {
+class LLVM_CLASS_ABI VPBasicBlock : public VPBlockBase {
 public:
   using RecipeListTy = iplist<VPRecipeBase>;
 
@@ -2314,7 +2314,7 @@ class VPBasicBlock : public VPBlockBase {
 /// this replication indicator helps to keep a single model for multiple
 /// candidate VF's. The actual replication takes place only once the desired VF
 /// and UF have been determined.
-class VPRegionBlock : public VPBlockBase {
+class LLVM_CLASS_ABI VPRegionBlock : public VPBlockBase {
   /// Hold the Single Entry of the SESE region modelled by the VPRegionBlock.
   VPBlockBase *Entry;
 
@@ -2738,7 +2738,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const VPlan &Plan) {
 //===----------------------------------------------------------------------===//
 
 /// Class that provides utilities for VPBlockBases in VPlan.
-class VPBlockUtils {
+class LLVM_CLASS_ABI VPBlockUtils {
 public:
   VPBlockUtils() = delete;
 
@@ -2820,7 +2820,7 @@ class VPBlockUtils {
   }
 };
 
-class VPInterleavedAccessInfo {
+class LLVM_CLASS_ABI VPInterleavedAccessInfo {
   DenseMap<VPInstruction *, InterleaveGroup<VPInstruction> *>
       InterleaveGroupMap;
 
@@ -2957,14 +2957,14 @@ class LLVM_CLASS_ABI VPlanSlp {
 namespace vputils {
 
 /// Returns true if only the first lane of \p Def is used.
-bool onlyFirstLaneUsed(VPValue *Def);
+LLVM_FUNC_ABI bool onlyFirstLaneUsed(VPValue *Def);
 
 /// Get or create a VPValue that corresponds to the expansion of \p Expr. If \p
 /// Expr is a SCEVConstant or SCEVUnknown, return a VPValue wrapping the live-in
 /// value. Otherwise return a VPExpandSCEVRecipe to expand \p Expr. If \p Plan's
 /// pre-header already contains a recipe expanding \p Expr, return it. If not,
 /// create a new one.
-VPValue *getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr,
+LLVM_FUNC_ABI VPValue *getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr,
                                        ScalarEvolution &SE);
 
 /// Returns true if \p VPV is uniform after vectorization.
diff --git a/llvm/lib/Transforms/Vectorize/VPlanCFG.h b/llvm/lib/Transforms/Vectorize/VPlanCFG.h
index 89e2e7514dac2b8..985b14ad3e1fb81 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanCFG.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanCFG.h
@@ -31,7 +31,7 @@ namespace llvm {
 // directly and not their successors. Those will be traversed when a region's
 // exiting block is traversed
 template <typename BlockPtrTy>
-class VPAllSuccessorsIterator
+class LLVM_CLASS_ABI VPAllSuccessorsIterator
     : public iterator_facade_base<VPAllSuccessorsIterator<BlockPtrTy>,
                                   std::bidirectional_iterator_tag,
                                   VPBlockBase> {
@@ -112,7 +112,7 @@ class VPAllSuccessorsIterator
 };
 
 /// Helper for GraphTraits specialization that traverses through VPRegionBlocks.
-template <typename BlockTy> class VPBlockDeepTraversalWrapper {
+template <typename BlockTy> class LLVM_CLASS_ABI VPBlockDeepTraversalWrapper {
   BlockTy Entry;
 
 public:
@@ -125,7 +125,7 @@ template <typename BlockTy> class VPBlockDeepTraversalWrapper {
 /// implicitly have their parent region's successors. This ensures all blocks in
 /// a region are visited before any blocks in a successor region when doing a
 /// reverse post-order traversal of the graph.
-template <> struct GraphTraits<VPBlockDeepTraversalWrapper<VPBlockBase *>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<VPBlockDeepTraversalWrapper<VPBlockBase *>> {
   using NodeRef = VPBlockBase *;
   using ChildIteratorType = VPAllSuccessorsIterator<VPBlockBase *>;
 
@@ -143,7 +143,7 @@ template <> struct GraphTraits<VPBlockDeepTraversalWrapper<VPBlockBase *>> {
 };
 
 template <>
-struct GraphTraits<VPBlockDeepTraversalWrapper<const VPBlockBase *>> {
+struct LLVM_CLASS_ABI GraphTraits<VPBlockDeepTraversalWrapper<const VPBlockBase *>> {
   using NodeRef = const VPBlockBase *;
   using ChildIteratorType = VPAllSuccessorsIterator<const VPBlockBase *>;
 
@@ -163,7 +163,7 @@ struct GraphTraits<VPBlockDeepTraversalWrapper<const VPBlockBase *>> {
 
 /// Helper for GraphTraits specialization that does not traverses through
 /// VPRegionBlocks.
-template <typename BlockTy> class VPBlockShallowTraversalWrapper {
+template <typename BlockTy> class LLVM_CLASS_ABI VPBlockShallowTraversalWrapper {
   BlockTy Entry;
 
 public:
@@ -171,7 +171,7 @@ template <typename BlockTy> class VPBlockShallowTraversalWrapper {
   BlockTy getEntry() { return Entry; }
 };
 
-template <> struct GraphTraits<VPBlockShallowTraversalWrapper<VPBlockBase *>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<VPBlockShallowTraversalWrapper<VPBlockBase *>> {
   using NodeRef = VPBlockBase *;
   using ChildIteratorType = SmallVectorImpl<VPBlockBase *>::iterator;
 
@@ -189,7 +189,7 @@ template <> struct GraphTraits<VPBlockShallowTraversalWrapper<VPBlockBase *>> {
 };
 
 template <>
-struct GraphTraits<VPBlockShallowTraversalWrapper<const VPBlockBase *>> {
+struct LLVM_CLASS_ABI GraphTraits<VPBlockShallowTraversalWrapper<const VPBlockBase *>> {
   using NodeRef = const VPBlockBase *;
   using ChildIteratorType = SmallVectorImpl<VPBlockBase *>::const_iterator;
 
@@ -238,7 +238,7 @@ vp_depth_first_deep(const VPBlockBase *G) {
 // VPBlockBase is a VPRegionBlock, this specialization provides access to its
 // successors/predecessors but not to the blocks inside the region.
 
-template <> struct GraphTraits<VPBlockBase *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<VPBlockBase *> {
   using NodeRef = VPBlockBase *;
   using ChildIteratorType = VPAllSuccessorsIterator<VPBlockBase *>;
 
@@ -253,7 +253,7 @@ template <> struct GraphTraits<VPBlockBase *> {
   }
 };
 
-template <> struct GraphTraits<const VPBlockBase *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<const VPBlockBase *> {
   using NodeRef = const VPBlockBase *;
   using ChildIteratorType = VPAllSuccessorsIterator<const VPBlockBase *>;
 
@@ -271,7 +271,7 @@ template <> struct GraphTraits<const VPBlockBase *> {
 /// Inverse graph traits are not implemented yet.
 /// TODO: Implement a version of VPBlockNonRecursiveTraversalWrapper to traverse
 /// predecessors recursively through regions.
-template <> struct GraphTraits<Inverse<VPBlockBase *>> {
+template <> struct LLVM_CLASS_ABI GraphTraits<Inverse<VPBlockBase *>> {
   using NodeRef = VPBlockBase *;
   using ChildIteratorType = SmallVectorImpl<VPBlockBase *>::iterator;
 
@@ -288,7 +288,7 @@ template <> struct GraphTraits<Inverse<VPBlockBase *>> {
   }
 };
 
-template <> struct GraphTraits<VPlan *> {
+template <> struct LLVM_CLASS_ABI GraphTraits<VPlan *> {
   using GraphRef = VPlan *;
   using NodeRef = VPBlockBase *;
   using nodes_iterator = df_iterator<NodeRef>;
diff --git a/llvm/lib/Transforms/Vectorize/VPlanDominatorTree.h b/llvm/lib/Transforms/Vectorize/VPlanDominatorTree.h
index fc4cf709a371958..22c270470535f45 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanDominatorTree.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanDominatorTree.h
@@ -23,7 +23,7 @@
 
 namespace llvm {
 
-template <> struct DomTreeNodeTraits<VPBlockBase> {
+template <> struct LLVM_CLASS_ABI DomTreeNodeTraits<VPBlockBase> {
   using NodeType = VPBlockBase;
   using NodePtr = VPBlockBase *;
   using ParentPtr = VPlan *;
@@ -41,12 +41,12 @@ using VPDomTreeNode = DomTreeNodeBase<VPBlockBase>;
 
 /// Template specializations of GraphTraits for VPDomTreeNode.
 template <>
-struct GraphTraits<VPDomTreeNode *>
+struct LLVM_CLASS_ABI GraphTraits<VPDomTreeNode *>
     : public DomTreeGraphTraitsBase<VPDomTreeNode,
                                     VPDomTreeNode::const_iterator> {};
 
 template <>
-struct GraphTraits<const VPDomTreeNode *>
+struct LLVM_CLASS_ABI GraphTraits<const VPDomTreeNode *>
     : public DomTreeGraphTraitsBase<const VPDomTreeNode,
                                     VPDomTreeNode::const_iterator> {};
 } // namespace llvm
diff --git a/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.h b/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.h
index 299ae36155cba08..2e54a7b137eee73 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.h
@@ -36,7 +36,7 @@ class VPlan;
 class VPlanTestBase;
 
 /// Main class to build the VPlan H-CFG for an incoming IR.
-class VPlanHCFGBuilder {
+class LLVM_CLASS_ABI VPlanHCFGBuilder {
   friend VPlanTestBase;
 
 private:
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
index 3eccf6e9600d193..5a65625332f9914 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
@@ -28,7 +28,7 @@ class TargetLibraryInfo;
 class VPBuilder;
 class VPRecipeBuilder;
 
-struct VPlanTransforms {
+struct LLVM_CLASS_ABI VPlanTransforms {
   /// Replaces the VPInstructions in \p Plan with corresponding
   /// widen recipes.
   static void
diff --git a/llvm/lib/Transforms/Vectorize/VPlanValue.h b/llvm/lib/Transforms/Vectorize/VPlanValue.h
index ac110bb3b0ef9be..246e429ec5e33a9 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanValue.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanValue.h
@@ -41,7 +41,7 @@ class VPWidenMemoryInstructionRecipe;
 // flow into, within and out of the VPlan. VPValues can stand for live-ins
 // coming from the input IR, instructions which VPlan will generate if executed
 // and live-outs which the VPlan will need to fix accordingly.
-class VPValue {
+class LLVM_CLASS_ABI VPValue {
   friend class VPBuilder;
   friend class VPDef;
   friend class VPInstruction;
@@ -197,11 +197,11 @@ class VPValue {
 typedef DenseMap<Value *, VPValue *> Value2VPValueTy;
 typedef DenseMap<VPValue *, Value *> VPValue2ValueTy;
 
-raw_ostream &operator<<(raw_ostream &OS, const VPValue &V);
+LLVM_FUNC_ABI raw_ostream &operator<<(raw_ostream &OS, const VPValue &V);
 
 /// This class augments VPValue with operands which provide the inverse def-use
 /// edges from VPValue's users to their defs.
-class VPUser {
+class LLVM_CLASS_ABI VPUser {
 public:
   /// Subclass identifier (for isa/dyn_cast).
   enum class VPUserID {
@@ -303,7 +303,7 @@ class VPUser {
 /// the VPValues it defines and is responsible for deleting its defined values.
 /// Single-value VPDefs that also inherit from VPValue must make sure to inherit
 /// from VPDef before VPValue.
-class VPDef {
+class LLVM_CLASS_ABI VPDef {
   friend class VPValue;
 
   /// Subclass identifier (for isa/dyn_cast).
@@ -435,7 +435,7 @@ class VPBasicBlock;
 /// This class can be used to assign consecutive numbers to all VPValues in a
 /// VPlan and allows querying the numbering for printing, similar to the
 /// ModuleSlotTracker for IR values.
-class VPSlotTracker {
+class LLVM_CLASS_ABI VPSlotTracker {
   DenseMap<const VPValue *, unsigned> Slots;
   unsigned NextSlot = 0;
 
diff --git a/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp b/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
index 137b34c8b861ff1..a525d7339bac295 100644
--- a/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
+++ b/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
@@ -8,6 +8,7 @@
 
 #include <llvm/BinaryFormat/ELF.h>
 #include <llvm/ExecutionEngine/JITLink/aarch32.h>
+#include <llvm/ExecutionEngine/JITLink/ELF_aarch32.h>
 #include <llvm/Object/ELF.h>
 
 #include "gtest/gtest.h"
@@ -30,15 +31,6 @@ struct MutableHalfWords {
   uint16_t Lo; // Second halfword
 };
 
-namespace llvm {
-namespace jitlink {
-
-Expected<aarch32::EdgeKind_aarch32> getJITLinkEdgeKind(uint32_t ELFType);
-Expected<uint32_t> getELFRelocationType(Edge::Kind Kind);
-
-} // namespace jitlink
-} // namespace llvm
-
 TEST(AArch32_ELF, EdgeKinds) {
   // Fails: Invalid ELF type -> JITLink kind
   Expected<uint32_t> ErrKind = getJITLinkEdgeKind(ELF::R_ARM_NONE);
diff --git a/llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp b/llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp
index bdabc34decf854c..c51f900c50803c1 100644
--- a/llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp
+++ b/llvm/unittests/Transforms/Scalar/LoopPassManagerTest.cpp
@@ -23,6 +23,7 @@
 #include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/SourceMgr.h"
+#include "llvm/Transforms/Utils/LoopUtils.h"
 
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
diff --git a/llvm/utils/TableGen/GlobalISel/CodeExpander.h b/llvm/utils/TableGen/GlobalISel/CodeExpander.h
index 0b1e6ceab52c293..ac18f412365f110 100644
--- a/llvm/utils/TableGen/GlobalISel/CodeExpander.h
+++ b/llvm/utils/TableGen/GlobalISel/CodeExpander.h
@@ -29,7 +29,7 @@ class raw_ostream;
 ///
 /// The emitted code can be given a custom indent to enable both indentation by
 /// an arbitrary amount of whitespace and emission of the code as a comment.
-class CodeExpander {
+class LLVM_CLASS_ABI CodeExpander {
   StringRef Code;
   const CodeExpansions &Expansions;
   const ArrayRef<SMLoc> &Loc;
diff --git a/llvm/utils/TableGen/GlobalISel/CodeExpansions.h b/llvm/utils/TableGen/GlobalISel/CodeExpansions.h
index f536e801b27f39a..2c78df0ee9516e8 100644
--- a/llvm/utils/TableGen/GlobalISel/CodeExpansions.h
+++ b/llvm/utils/TableGen/GlobalISel/CodeExpansions.h
@@ -15,7 +15,7 @@
 #ifndef LLVM_UTILS_TABLEGEN_CODEEXPANSIONS_H
 #define LLVM_UTILS_TABLEGEN_CODEEXPANSIONS_H
 namespace llvm {
-class CodeExpansions {
+class LLVM_CLASS_ABI CodeExpansions {
 public:
   using const_iterator = StringMap<std::string>::const_iterator;
 

>From 3e429f5741e7ffa4fd985c4c6ca2e8b79a303018 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 21 Jul 2023 21:57:48 +0000
Subject: [PATCH 30/39] Enable tests

---
 .github/workflows/llvm-tests.yml | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/.github/workflows/llvm-tests.yml b/.github/workflows/llvm-tests.yml
index b59607647c8fec5..a9e730c4ce87aee 100644
--- a/.github/workflows/llvm-tests.yml
+++ b/.github/workflows/llvm-tests.yml
@@ -6,17 +6,6 @@ permissions:
 on:
   workflow_dispatch:
   push:
-    ignore-forks: true
-    branches:
-      - 'release/**'
-    paths:
-      - 'llvm/**'
-      - '.github/workflows/llvm-tests.yml'
-      - '.github/workflows/llvm-project-tests.yml'
-  pull_request:
-    ignore-forks: true
-    branches:
-      - 'release/**'
     paths:
       - 'llvm/**'
       - '.github/workflows/llvm-tests.yml'
@@ -30,7 +19,6 @@ concurrency:
 
 jobs:
   check_all:
-    if: github.repository_owner == 'llvm'
     name: Test llvm,clang,libclc
     uses: ./.github/workflows/llvm-project-tests.yml
     with:
@@ -40,7 +28,6 @@ jobs:
   # These need to be separate from the check_all job, becuase there is not enough disk
   # space to build all these projects on Windows.
   build_lldb:
-    if: github.repository_owner == 'llvm'
     name: Build lldb
     uses: ./.github/workflows/llvm-project-tests.yml
     with:
@@ -48,7 +35,6 @@ jobs:
       projects: clang;lldb
 
   check_lld:
-    if: github.repository_owner == 'llvm'
     name: Test lld
     uses: ./.github/workflows/llvm-project-tests.yml
     with:

>From 9f2c53615c9579e564cdc3b78315e8433337a01d Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 21 Jul 2023 21:59:44 +0000
Subject: [PATCH 31/39] Enable tests v2

---
 .github/workflows/llvm-tests.yml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/.github/workflows/llvm-tests.yml b/.github/workflows/llvm-tests.yml
index a9e730c4ce87aee..b854ee949cd3a5d 100644
--- a/.github/workflows/llvm-tests.yml
+++ b/.github/workflows/llvm-tests.yml
@@ -6,10 +6,6 @@ permissions:
 on:
   workflow_dispatch:
   push:
-    paths:
-      - 'llvm/**'
-      - '.github/workflows/llvm-tests.yml'
-      - '.github/workflows/llvm-project-tests.yml'
 
 concurrency:
   # Skip intermediate builds: always.

>From f28f7ddbd6380994babb99d14a17c3d095e8c9d2 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sun, 23 Jul 2023 03:35:15 +0000
Subject: [PATCH 32/39] XXX: restrict tests

---
 .github/workflows/llvm-tests.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/workflows/llvm-tests.yml b/.github/workflows/llvm-tests.yml
index b854ee949cd3a5d..c1361a105d30021 100644
--- a/.github/workflows/llvm-tests.yml
+++ b/.github/workflows/llvm-tests.yml
@@ -24,6 +24,7 @@ jobs:
   # These need to be separate from the check_all job, becuase there is not enough disk
   # space to build all these projects on Windows.
   build_lldb:
+    if: github.repository_owner == 'llvm'
     name: Build lldb
     uses: ./.github/workflows/llvm-project-tests.yml
     with:
@@ -31,6 +32,7 @@ jobs:
       projects: clang;lldb
 
   check_lld:
+    if: github.repository_owner == 'llvm'
     name: Test lld
     uses: ./.github/workflows/llvm-project-tests.yml
     with:

>From 2645b69bf7769c05e6a2bf22a2e435123ccd3622 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 26 Jul 2023 16:52:51 +0000
Subject: [PATCH 33/39] Disable non-windows builds

---
 .github/workflows/llvm-project-tests.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml
index 26a08a70f3db5f4..e58865c42f378a3 100644
--- a/.github/workflows/llvm-project-tests.yml
+++ b/.github/workflows/llvm-project-tests.yml
@@ -36,13 +36,13 @@ jobs:
       fail-fast: false
       matrix:
         os:
-          - ubuntu-latest
+          #- ubuntu-latest
           # Use windows-2019 due to:
           # https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
           - windows-2019
           # We're using a specific version of macOS due to:
           # https://github.com/actions/virtual-environments/issues/5900
-          - macOS-11
+          #- macOS-11
     steps:
       - name: Setup Windows
         if: startsWith(matrix.os, 'windows')

>From d29e66e733bf3e5f7806592220160c7e833e3b14 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 22 Jul 2023 05:26:39 +0000
Subject: [PATCH 34/39] Windows fix

---
 llvm/cmake/modules/AddLLVM.cmake | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 49850e8bdde43a0..90c5c953f8d5bd5 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -591,9 +591,9 @@ function(llvm_add_library name)
   endif()
 
   if(ARG_COMPONENT_LIB)
-    set_target_properties(${name} PROPERTIES
-	                  LLVM_COMPONENT TRUE
-			  DEFINE_SYMBOL "LLVM_ABI_EXPORTS")
+    set_target_properties(${name} PROPERTIES LLVM_COMPONENT TRUE)
+    #target_compile_definitions(${name} PRIVATE LLVM_ABI_EXPORTS)
+    target_compile_options(${name} PRIVATE -DLLVM_ABI_EXPORTS)
 
     # When building shared objects for each target there are some internal APIs
     # that are used across shared objects which we can't hide.

>From 4dfbd76f2745bce4104c51166a6d6a8476c17da2 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 8 Aug 2023 00:45:15 +0000
Subject: [PATCH 35/39] Static library test

---
 llvm/include/llvm/Support/Compiler.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index 0f5e8d73d38eb41..77b818d8cf9731f 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -150,8 +150,10 @@
 #else
 # if defined(LLVM_ABI_EXPORTS)
 #   define LLVM_ABI __declspec(dllexport)
-# else
+# elif defined(LLVM_DLL_IMPORT)
 #   define LLVM_ABI __declspec(dllimport)
+# else
+#   define LLVM_ABI
 # endif
 # define LLVM_CLASS_ABI
 # define LLVM_FUNC_ABI LLVM_ABI

>From 082e61d2dd3cd4bc9d4463629f3a97c96e2d5d2e Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 8 Aug 2023 10:24:13 +0000
Subject: [PATCH 36/39] Enable import for shared libs

---
 llvm/cmake/modules/AddLLVM.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 90c5c953f8d5bd5..6116f92bfd163e4 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1049,6 +1049,10 @@ macro(add_llvm_executable name)
   endif()
 
   llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS} BUNDLE_PATH ${ARG_BUNDLE_PATH})
+
+  if (LLVM_LINK_LLVM_DYLIB AND NOT DISABLE_LLVM_LINK_LLVM_DYLIB)
+    target_compile_options(${name} PRIVATE -DLLVM_DLL_IMPORT)
+  endif()
 endmacro(add_llvm_executable name)
 
 # add_llvm_pass_plugin(name [NO_MODULE] ...)

>From f7437d91f537ff7d3a6cf537b882b337ef933b12 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Tue, 8 Aug 2023 10:42:34 +0000
Subject: [PATCH 37/39] Frontend tablegen fixes

---
 llvm/utils/TableGen/DirectiveEmitter.cpp | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/llvm/utils/TableGen/DirectiveEmitter.cpp b/llvm/utils/TableGen/DirectiveEmitter.cpp
index dcc543e9beff282..c32d6db31d96993 100644
--- a/llvm/utils/TableGen/DirectiveEmitter.cpp
+++ b/llvm/utils/TableGen/DirectiveEmitter.cpp
@@ -109,7 +109,7 @@ static void GenerateEnumClauseVal(const std::vector<Record *> &Records,
                              .str();
 
       EnumHelperFuncs +=
-          (llvm::Twine("llvm::StringRef get") + llvm::Twine(DirLang.getName()) +
+          (llvm::Twine("LLVM_FUNC_ABI llvm::StringRef get") + llvm::Twine(DirLang.getName()) +
            llvm::Twine(EnumName) + llvm::Twine("Name(") +
            llvm::Twine(EnumName) + llvm::Twine(");\n"))
               .str();
@@ -215,20 +215,20 @@ static void EmitDirectivesDecl(RecordKeeper &Records, raw_ostream &OS) {
   // Generic function signatures
   OS << "\n";
   OS << "// Enumeration helper functions\n";
-  OS << "Directive get" << DirLang.getName()
+  OS << "LLVM_FUNC_ABI Directive get" << DirLang.getName()
      << "DirectiveKind(llvm::StringRef Str);\n";
   OS << "\n";
-  OS << "llvm::StringRef get" << DirLang.getName()
+  OS << "LLVM_FUNC_ABI llvm::StringRef get" << DirLang.getName()
      << "DirectiveName(Directive D);\n";
   OS << "\n";
-  OS << "Clause get" << DirLang.getName()
+  OS << "LLVM_FUNC_ABI Clause get" << DirLang.getName()
      << "ClauseKind(llvm::StringRef Str);\n";
   OS << "\n";
-  OS << "llvm::StringRef get" << DirLang.getName() << "ClauseName(Clause C);\n";
+  OS << "LLVM_FUNC_ABI llvm::StringRef get" << DirLang.getName() << "ClauseName(Clause C);\n";
   OS << "\n";
   OS << "/// Return true if \\p C is a valid clause for \\p D in version \\p "
      << "Version.\n";
-  OS << "bool isAllowedClauseForDirective(Directive D, "
+  OS << "LLVM_FUNC_ABI bool isAllowedClauseForDirective(Directive D, "
      << "Clause C, unsigned Version);\n";
   OS << "\n";
   if (EnumHelperFuncs.length() > 0) {
@@ -251,7 +251,7 @@ static void GenerateGetName(const std::vector<Record *> &Records,
                             const DirectiveLanguage &DirLang,
                             StringRef Prefix) {
   OS << "\n";
-  OS << "LLVM_FUNC_ABI llvm::StringRef llvm::" << DirLang.getCppNamespace() << "::get"
+  OS << "llvm::StringRef llvm::" << DirLang.getCppNamespace() << "::get"
      << DirLang.getName() << Enum << "Name(" << Enum << " Kind) {\n";
   OS << "  switch (Kind) {\n";
   for (const auto &R : Records) {
@@ -287,7 +287,7 @@ static void GenerateGetKind(const std::vector<Record *> &Records,
   BaseRecord DefaultRec{(*DefaultIt)};
 
   OS << "\n";
-  OS << "LLVM_FUNC_ABI " << Enum << " llvm::" << DirLang.getCppNamespace() << "::get"
+  OS << Enum << " llvm::" << DirLang.getCppNamespace() << "::get"
      << DirLang.getName() << Enum << "Kind(llvm::StringRef Str) {\n";
   OS << "  return llvm::StringSwitch<" << Enum << ">(Str)\n";
 
@@ -385,7 +385,7 @@ GenerateCaseForVersionedClauses(const std::vector<Record *> &Clauses,
 static void GenerateIsAllowedClause(const DirectiveLanguage &DirLang,
                                     raw_ostream &OS) {
   OS << "\n";
-  OS << "LLVM_FUNC_ABI bool llvm::" << DirLang.getCppNamespace()
+  OS << "bool llvm::" << DirLang.getCppNamespace()
      << "::isAllowedClauseForDirective("
      << "Directive D, Clause C, unsigned Version) {\n";
   OS << "  assert(unsigned(D) <= llvm::" << DirLang.getCppNamespace()

>From 3fa104bc537d78f4e043662a059e77bd591eef1a Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 30 Sep 2023 01:03:37 +0000
Subject: [PATCH 38/39] Fix annotation on tablegenerated functions

---
 llvm/utils/TableGen/DirectiveEmitter.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/llvm/utils/TableGen/DirectiveEmitter.cpp b/llvm/utils/TableGen/DirectiveEmitter.cpp
index c32d6db31d96993..033e452c9d2703f 100644
--- a/llvm/utils/TableGen/DirectiveEmitter.cpp
+++ b/llvm/utils/TableGen/DirectiveEmitter.cpp
@@ -104,7 +104,8 @@ static void GenerateEnumClauseVal(const std::vector<Record *> &Records,
            << "llvm::" << DirLang.getCppNamespace() << "::" << EnumName
            << "::" << CV->getName() << ";\n";
       }
-      EnumHelperFuncs += (llvm::Twine(EnumName) + llvm::Twine(" get") +
+      EnumHelperFuncs += (llvm::Twine("LLVM_FUNC_ABI ") +
+                          llvm::Twine(EnumName) + llvm::Twine(" get") +
                           llvm::Twine(EnumName) + llvm::Twine("(StringRef);\n"))
                              .str();
 
@@ -333,7 +334,7 @@ static void GenerateGetKindClauseVal(const DirectiveLanguage &DirLang,
     }
 
     OS << "\n";
-    OS << "LLVM_FUNC_ABI " << EnumName << " llvm::" << DirLang.getCppNamespace() << "::get"
+    OS << EnumName << " llvm::" << DirLang.getCppNamespace() << "::get"
        << EnumName << "(llvm::StringRef Str) {\n";
     OS << "  return llvm::StringSwitch<" << EnumName << ">(Str)\n";
     for (const auto &CV : ClauseVals) {

>From fee30c485fb161a2fe89a151b7b86f7f090814e5 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Sat, 30 Sep 2023 02:45:34 +0000
Subject: [PATCH 39/39] ONly build x86 target

---
 .github/workflows/llvm-project-tests.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml
index e58865c42f378a3..071b64ace02fb36 100644
--- a/.github/workflows/llvm-project-tests.yml
+++ b/.github/workflows/llvm-project-tests.yml
@@ -85,7 +85,7 @@ jobs:
           # This should be a no-op for non-mac OSes
           PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
         with:
-          cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache'
+          cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DLLVM_TARGETS_TO_BUILD=X86'
           build_target: '${{ inputs.build_target }}'
 
       - name: Build and Test libclc



More information about the cfe-commits mailing list