-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm] annotate interfaces in llvm/MC and llvm/MCA for DLL export #142655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
39eee07
to
f595c67
Compare
@compnerd, @vgvassilev another one that's ready for review, thanks! |
@llvm/pr-subscribers-tools-llvm-mca Author: Andrew Rogers (andrurogerz) ChangesPurposeThis patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the BackgroundThis effort is tracked in #109483. Additional context is provided in this discourse, and documentation for The bulk of these changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with The following manual adjustments were also applied after running IDS on Linux:
ValidationLocal builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations:
Patch is 128.21 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/142655.diff 56 Files Affected:
diff --git a/llvm/include/llvm/MC/MCAsmBackend.h b/llvm/include/llvm/MC/MCAsmBackend.h
index f6d776b839fe5..e49e786a10f58 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>
@@ -39,7 +40,7 @@ class StringRef;
class raw_ostream;
/// Generic interface to target specific assembler backends.
-class MCAsmBackend {
+class LLVM_ABI MCAsmBackend {
protected: // Can only create subclasses.
MCAsmBackend(llvm::endianness Endian) : Endian(Endian) {}
diff --git a/llvm/include/llvm/MC/MCAsmInfo.h b/llvm/include/llvm/MC/MCAsmInfo.h
index 3a31957f2f6be..4eb50344d6384 100644
--- a/llvm/include/llvm/MC/MCAsmInfo.h
+++ b/llvm/include/llvm/MC/MCAsmInfo.h
@@ -20,6 +20,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 {
@@ -55,7 +56,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_ABI MCAsmInfo {
public:
/// Assembly character literal syntax types.
enum AsmCharLiteralSyntax {
@@ -427,6 +428,10 @@ class MCAsmInfo {
explicit MCAsmInfo();
virtual ~MCAsmInfo();
+ // Explicitly non-copyable.
+ MCAsmInfo(MCAsmInfo const &) = delete;
+ MCAsmInfo &operator=(MCAsmInfo const &) = delete;
+
/// Get the code pointer size in bytes.
unsigned getCodePointerSize() const { return CodePointerSize; }
diff --git a/llvm/include/llvm/MC/MCAsmMacro.h b/llvm/include/llvm/MC/MCAsmMacro.h
index c0c895fa94e64..ce50fb6418845 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>
@@ -74,9 +75,9 @@ class AsmToken {
bool is(TokenKind K) const { return Kind == K; }
bool isNot(TokenKind K) const { return Kind != K; }
- SMLoc getLoc() const;
- SMLoc getEndLoc() const;
- SMRange getLocRange() const;
+ LLVM_ABI SMLoc getLoc() const;
+ LLVM_ABI SMLoc getEndLoc() const;
+ LLVM_ABI SMRange getLocRange() const;
/// Get the contents of a string token (without quotes).
StringRef getStringContents() const {
@@ -115,7 +116,7 @@ class AsmToken {
return IntVal;
}
- void dump(raw_ostream &OS) const;
+ LLVM_ABI void dump(raw_ostream &OS) const;
};
struct MCAsmMacroParameter {
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index 988677193d6d9..5e009090311c4 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -17,6 +17,7 @@
#include "llvm/ADT/iterator_range.h"
#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/SMLoc.h"
#include <algorithm>
#include <cassert>
@@ -135,46 +136,48 @@ class MCAssembler {
// concrete and require clients to pass in a target like object. The other
// option is to make this abstract, and have targets provide concrete
// implementations as we do with AsmParser.
- MCAssembler(MCContext &Context, std::unique_ptr<MCAsmBackend> Backend,
- std::unique_ptr<MCCodeEmitter> Emitter,
- std::unique_ptr<MCObjectWriter> Writer);
+ LLVM_ABI MCAssembler(MCContext &Context,
+ std::unique_ptr<MCAsmBackend> Backend,
+ std::unique_ptr<MCCodeEmitter> Emitter,
+ std::unique_ptr<MCObjectWriter> Writer);
MCAssembler(const MCAssembler &) = delete;
MCAssembler &operator=(const MCAssembler &) = delete;
/// Compute the effective fragment size.
- uint64_t computeFragmentSize(const MCFragment &F) const;
+ LLVM_ABI uint64_t computeFragmentSize(const MCFragment &F) const;
- void layoutBundle(MCFragment *Prev, MCFragment *F) const;
+ LLVM_ABI void layoutBundle(MCFragment *Prev, MCFragment *F) const;
// Get the offset of the given fragment inside its containing section.
uint64_t getFragmentOffset(const MCFragment &F) const { return F.Offset; }
- uint64_t getSectionAddressSize(const MCSection &Sec) const;
- uint64_t getSectionFileSize(const MCSection &Sec) const;
+ LLVM_ABI uint64_t getSectionAddressSize(const MCSection &Sec) const;
+ LLVM_ABI uint64_t getSectionFileSize(const MCSection &Sec) const;
// Get the offset of the given symbol, as computed in the current
// layout.
// \return True on success.
- bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const;
+ LLVM_ABI bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const;
// Variant that reports a fatal error if the offset is not computable.
- uint64_t getSymbolOffset(const MCSymbol &S) const;
+ LLVM_ABI uint64_t getSymbolOffset(const MCSymbol &S) const;
// If this symbol is equivalent to A + Constant, return A.
- const MCSymbol *getBaseSymbol(const MCSymbol &Symbol) const;
+ LLVM_ABI const MCSymbol *getBaseSymbol(const MCSymbol &Symbol) const;
/// Emit the section contents to \p OS.
- void writeSectionData(raw_ostream &OS, const MCSection *Section) const;
+ LLVM_ABI void writeSectionData(raw_ostream &OS,
+ const MCSection *Section) const;
/// Check whether a given symbol has been flagged with .thumb_func.
- bool isThumbFunc(const MCSymbol *Func) const;
+ LLVM_ABI bool isThumbFunc(const MCSymbol *Func) const;
/// Flag a function symbol as the target of a .thumb_func directive.
void setIsThumbFunc(const MCSymbol *Func) { ThumbFuncs.insert(Func); }
/// Reuse an assembler instance
///
- void reset();
+ LLVM_ABI void reset();
MCContext &getContext() const { return Context; }
@@ -193,10 +196,10 @@ class MCAssembler {
/// Finish - Do final processing and write the object to the output stream.
/// \p Writer is used for custom object writer (as the MCJIT does),
/// if not specified it is automatically created from backend.
- void Finish();
+ LLVM_ABI void Finish();
// Layout all section and prepare them for emission.
- void layout();
+ LLVM_ABI void layout();
bool hasLayout() const { return HasLayout; }
bool hasFinalLayout() const { return HasFinalLayout; }
@@ -223,21 +226,22 @@ class MCAssembler {
return make_pointee_range(Symbols);
}
- bool registerSection(MCSection &Section);
- bool registerSymbol(const MCSymbol &Symbol);
+ LLVM_ABI bool registerSection(MCSection &Section);
+ LLVM_ABI bool registerSymbol(const MCSymbol &Symbol);
/// Write the necessary bundle padding to \p OS.
/// Expects a fragment \p F containing instructions and its size \p FSize.
- void writeFragmentPadding(raw_ostream &OS, const MCEncodedFragment &F,
- uint64_t FSize) const;
+ LLVM_ABI void writeFragmentPadding(raw_ostream &OS,
+ const MCEncodedFragment &F,
+ uint64_t FSize) const;
- void reportError(SMLoc L, const Twine &Msg) const;
+ LLVM_ABI void reportError(SMLoc L, const Twine &Msg) const;
// Record pending errors during layout iteration, as they may go away once the
// layout is finalized.
- void recordError(SMLoc L, const Twine &Msg) const;
- void flushPendingErrors() const;
+ LLVM_ABI void recordError(SMLoc L, const Twine &Msg) const;
+ LLVM_ABI void flushPendingErrors() const;
- void dump() const;
+ LLVM_ABI void dump() const;
};
} // end namespace llvm
diff --git a/llvm/include/llvm/MC/MCCodeEmitter.h b/llvm/include/llvm/MC/MCCodeEmitter.h
index ceb16c9b4da78..1c454c3795c2c 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;
@@ -18,7 +20,7 @@ class raw_ostream;
template<typename T> class SmallVectorImpl;
/// MCCodeEmitter - Generic instruction encoding interface.
-class MCCodeEmitter {
+class LLVM_ABI MCCodeEmitter {
protected: // Can only create subclasses.
MCCodeEmitter();
diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h
index a2a53427be986..76a750db3fa17 100644
--- a/llvm/include/llvm/MC/MCContext.h
+++ b/llvm/include/llvm/MC/MCContext.h
@@ -375,15 +375,16 @@ class MCContext {
DenseSet<StringRef> ELFSeenGenericMergeableSections;
public:
- explicit MCContext(const Triple &TheTriple, const MCAsmInfo *MAI,
- const MCRegisterInfo *MRI, const MCSubtargetInfo *MSTI,
- const SourceMgr *Mgr = nullptr,
- MCTargetOptions const *TargetOpts = nullptr,
- bool DoAutoReset = true,
- StringRef Swift5ReflSegmentName = {});
+ LLVM_ABI explicit MCContext(const Triple &TheTriple, const MCAsmInfo *MAI,
+ const MCRegisterInfo *MRI,
+ const MCSubtargetInfo *MSTI,
+ const SourceMgr *Mgr = nullptr,
+ MCTargetOptions const *TargetOpts = nullptr,
+ bool DoAutoReset = true,
+ StringRef Swift5ReflSegmentName = {});
MCContext(const MCContext &) = delete;
MCContext &operator=(const MCContext &) = delete;
- ~MCContext();
+ LLVM_ABI ~MCContext();
Environment getObjectFileType() const { return Env; }
@@ -393,7 +394,7 @@ class MCContext {
const Triple &getTargetTriple() const { return TT; }
const SourceMgr *getSourceManager() const { return SrcMgr; }
- void initInlineSourceManager();
+ LLVM_ABI void initInlineSourceManager();
SourceMgr *getInlineSourceManager() { return InlineSrcMgr.get(); }
std::vector<const MDNode *> &getLocInfos() { return LocInfos; }
void setDiagnosticHandler(DiagHandlerTy DiagHandler) {
@@ -412,7 +413,7 @@ class MCContext {
const MCTargetOptions *getTargetOptions() const { return TargetOptions; }
- CodeViewContext &getCVContext();
+ LLVM_ABI CodeViewContext &getCVContext();
void setUseNamesOnTempLabels(bool Value) { UseNamesOnTempLabels = Value; }
@@ -421,14 +422,14 @@ class MCContext {
/// reset - return object to right after construction state to prepare
/// to process a new module
- void reset();
+ LLVM_ABI void reset();
/// @}
/// \name McInst Management
/// Create and return a new MC instruction.
- MCInst *createMCInst();
+ LLVM_ABI MCInst *createMCInst();
template <typename F, typename... Args> F *allocFragment(Args &&...args) {
return new (FragmentAllocator.Allocate(sizeof(F), alignof(F)))
@@ -441,64 +442,69 @@ class MCContext {
/// Create a new linker temporary symbol with the specified prefix (Name) or
/// "tmp". This creates a "l"-prefixed symbol for Mach-O and is identical to
/// createNamedTempSymbol for other object file formats.
- MCSymbol *createLinkerPrivateTempSymbol();
- MCSymbol *createLinkerPrivateSymbol(const Twine &Name);
+ LLVM_ABI MCSymbol *createLinkerPrivateTempSymbol();
+ LLVM_ABI MCSymbol *createLinkerPrivateSymbol(const Twine &Name);
/// Create a temporary symbol with a unique name. The name will be omitted
/// in the symbol table if UseNamesOnTempLabels is false (default except
/// MCAsmStreamer). The overload without Name uses an unspecified name.
- MCSymbol *createTempSymbol();
- MCSymbol *createTempSymbol(const Twine &Name, bool AlwaysAddSuffix = true);
+ LLVM_ABI MCSymbol *createTempSymbol();
+ LLVM_ABI MCSymbol *createTempSymbol(const Twine &Name,
+ bool AlwaysAddSuffix = true);
/// Create a temporary symbol with a unique name whose name cannot be
/// omitted in the symbol table. This is rarely used.
- MCSymbol *createNamedTempSymbol();
- MCSymbol *createNamedTempSymbol(const Twine &Name);
+ LLVM_ABI MCSymbol *createNamedTempSymbol();
+ LLVM_ABI MCSymbol *createNamedTempSymbol(const Twine &Name);
/// Get or create a symbol for a basic block. For non-always-emit symbols,
/// this behaves like createTempSymbol, except that it uses the
/// PrivateLabelPrefix instead of the PrivateGlobalPrefix. When AlwaysEmit is
/// true, behaves like getOrCreateSymbol, prefixed with PrivateLabelPrefix.
- MCSymbol *createBlockSymbol(const Twine &Name, bool AlwaysEmit = false);
+ LLVM_ABI MCSymbol *createBlockSymbol(const Twine &Name,
+ bool AlwaysEmit = false);
/// Create a local, non-temporary symbol like an ELF mapping symbol. Calling
/// the function with the same name will generate new, unique instances.
- MCSymbol *createLocalSymbol(StringRef Name);
+ LLVM_ABI MCSymbol *createLocalSymbol(StringRef Name);
/// Create the definition of a directional local symbol for numbered label
/// (used for "1:" definitions).
- MCSymbol *createDirectionalLocalSymbol(unsigned LocalLabelVal);
+ LLVM_ABI MCSymbol *createDirectionalLocalSymbol(unsigned LocalLabelVal);
/// Create and return a directional local symbol for numbered label (used
/// for "1b" or 1f" references).
- MCSymbol *getDirectionalLocalSymbol(unsigned LocalLabelVal, bool Before);
+ LLVM_ABI MCSymbol *getDirectionalLocalSymbol(unsigned LocalLabelVal,
+ bool Before);
/// Lookup the symbol inside with the specified \p Name. If it exists,
/// return it. If not, create a forward reference and return it.
///
/// \param Name - The symbol name, which must be unique across all symbols.
- MCSymbol *getOrCreateSymbol(const Twine &Name);
+ LLVM_ABI MCSymbol *getOrCreateSymbol(const Twine &Name);
/// Gets a symbol that will be defined to the final stack offset of a local
/// variable after codegen.
///
/// \param Idx - The index of a local variable passed to \@llvm.localescape.
- MCSymbol *getOrCreateFrameAllocSymbol(const Twine &FuncName, unsigned Idx);
+ LLVM_ABI MCSymbol *getOrCreateFrameAllocSymbol(const Twine &FuncName,
+ unsigned Idx);
- MCSymbol *getOrCreateParentFrameOffsetSymbol(const Twine &FuncName);
+ LLVM_ABI MCSymbol *getOrCreateParentFrameOffsetSymbol(const Twine &FuncName);
- MCSymbol *getOrCreateLSDASymbol(const Twine &FuncName);
+ LLVM_ABI MCSymbol *getOrCreateLSDASymbol(const Twine &FuncName);
/// Get the symbol for \p Name, or null.
- MCSymbol *lookupSymbol(const Twine &Name) const;
+ LLVM_ABI MCSymbol *lookupSymbol(const Twine &Name) const;
/// Clone a symbol for the .set directive, replacing it in the symbol table.
/// Existing references to the original symbol remain unchanged, and the
/// original symbol is not emitted to the symbol table.
- MCSymbol *cloneSymbol(MCSymbol &Sym);
+ LLVM_ABI MCSymbol *cloneSymbol(MCSymbol &Sym);
/// Set value for a symbol.
- void setSymbolValue(MCStreamer &Streamer, const Twine &Sym, uint64_t Val);
+ LLVM_ABI void setSymbolValue(MCStreamer &Streamer, const Twine &Sym,
+ uint64_t Val);
/// getSymbols - Get a reference for the symbol table for clients that
/// want to, for example, iterate over all symbols. 'const' because we
@@ -514,11 +520,11 @@ class MCContext {
/// registerInlineAsmLabel - Records that the name is a label referenced in
/// inline assembly.
- void registerInlineAsmLabel(MCSymbol *Sym);
+ LLVM_ABI void registerInlineAsmLabel(MCSymbol *Sym);
/// Allocates and returns a new `WasmSignature` instance (with empty parameter
/// and return type lists).
- wasm::WasmSignature *createWasmSignature();
+ LLVM_ABI wasm::WasmSignature *createWasmSignature();
/// @}
@@ -527,10 +533,10 @@ class MCContext {
/// Return the MCSection for the specified mach-o section. This requires
/// the operands to be valid.
- MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
- unsigned TypeAndAttributes,
- unsigned Reserved2, SectionKind K,
- const char *BeginSymName = nullptr);
+ LLVM_ABI MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
+ unsigned TypeAndAttributes,
+ unsigned Reserved2, SectionKind K,
+ const char *BeginSymName = nullptr);
MCSectionMachO *getMachOSection(StringRef Segment, StringRef Section,
unsigned TypeAndAttributes, SectionKind K,
@@ -557,85 +563,93 @@ class MCContext {
MCSection::NonUniqueID, nullptr);
}
- MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
- unsigned Flags, unsigned EntrySize,
- const Twine &Group, bool IsComdat,
- unsigned UniqueID,
- const MCSymbolELF *LinkedToSym);
+ LLVM_ABI MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
+ unsigned Flags, unsigned EntrySize,
+ const Twine &Group, bool IsComdat,
+ unsigned UniqueID,
+ const MCSymbolELF *LinkedToSym);
- MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
- unsigned Flags, unsigned EntrySize,
- const MCSymbolELF *Group, bool IsComdat,
- unsigned UniqueID,
- const MCSymbolELF *LinkedToSym);
+ LLVM_ABI MCSectionELF *getELFSection(const Twine &Section, unsigned Type,
+ unsigned Flags, unsigned EntrySize,
+ const MCSymbolELF *Group, bool IsComdat,
+ unsigned UniqueID,
+ const MCSymbolELF *LinkedToSym);
/// Get a section with the provided group identifier. This section is
/// named by concatenating \p Prefix with '.' then \p Suffix. The \p Type
/// describes the type of the section and \p Flags are used to further
/// configure this named section.
- MCSectionELF *getELFNamedSection(const Twine &Prefix, const Twine &Suffix,
- unsigned Type, unsigned Flags,
- unsigned EntrySize = 0);
+ LLVM_ABI MCSectionELF *getELFNamedSection(const Twine &Prefix,
+ const Twine &Suffix, unsigned Type,
+ unsigned Flags,
+ unsigned EntrySize = 0);
- MCSectionELF *createELFRelSection(const Twine &Name, unsigned Type,
- unsigned Flags, unsigned EntrySize,
- const MCSymbolELF *Group,
- const MCSectionELF *RelInfoSection);
+ LLVM_ABI MCSectionELF *
+ createELFRelSection(const Twine &Name, unsigned Type, unsigned Flags,
+ unsigned EntrySize, const MCSymbolELF *Group,
+ const MCSectionELF *RelInfoSection);
- MCSectionELF *createELFGroupSection(const MCSymbolELF *Group, bool IsComdat);
+ LLVM_ABI MCSectionELF *createELFGroupSection(const MCSymbolELF *Group,
+ bool IsComdat);
- void recordELFMergeableSectionInfo(StringRef SectionName, unsigned Flags,
- unsigned UniqueID, unsigned EntrySize);
+ LLVM_ABI void recordELFMergeableSectionInfo(StringRef SectionName,
+ unsigned Flags, unsigned UniqueID,
+ unsigned EntrySize);
- bool isELFImplicitMergeableSectionNamePrefix(StringRef Name);
+ LLVM_ABI bool isELFImplicitMergeableSectionNamePrefix(StringRef Name);
- bool is...
[truncated]
|
…vm#142655) ## Purpose This patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the `llvm/MC` and `llvm/MCA` libraries. These annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build. ## Background This effort is tracked in llvm#109483. Additional context is provided in [this discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307), and documentation for `LLVM_ABI` and related annotations is found in the LLVM repo [here](https://github.com/llvm/llvm-project/blob/main/llvm/docs/InterfaceExportAnnotations.rst). The bulk of these changes were generated automatically using the [Interface Definition Scanner (IDS)](https://github.com/compnerd/ids) tool, followed formatting with `git clang-format`. The following manual adjustments were also applied after running IDS on Linux: - Add `#include "llvm/Support/Compiler.h"` to files where it was not auto-added by IDS due to no pre-existing block of include statements. - Explicitly make classes non-copyable where needed to due IDS adding LLVM_ABI at the class level ## Validation Local builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations: - Windows with MSVC - Windows with Clang - Linux with GCC - Linux with Clang - Darwin with Clang
…vm#142655) ## Purpose This patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the `llvm/MC` and `llvm/MCA` libraries. These annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build. ## Background This effort is tracked in llvm#109483. Additional context is provided in [this discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307), and documentation for `LLVM_ABI` and related annotations is found in the LLVM repo [here](https://github.com/llvm/llvm-project/blob/main/llvm/docs/InterfaceExportAnnotations.rst). The bulk of these changes were generated automatically using the [Interface Definition Scanner (IDS)](https://github.com/compnerd/ids) tool, followed formatting with `git clang-format`. The following manual adjustments were also applied after running IDS on Linux: - Add `#include "llvm/Support/Compiler.h"` to files where it was not auto-added by IDS due to no pre-existing block of include statements. - Explicitly make classes non-copyable where needed to due IDS adding LLVM_ABI at the class level ## Validation Local builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations: - Windows with MSVC - Windows with Clang - Linux with GCC - Linux with Clang - Darwin with Clang
Purpose
This patch is one in a series of code-mods that annotate LLVM’s public interface for export. This patch annotates the
llvm/MC
andllvm/MCA
libraries. These annotations currently have no meaningful impact on the LLVM build; however, they are a prerequisite to support an LLVM Windows DLL (shared library) build.Background
This effort is tracked in #109483. Additional context is provided in this discourse, and documentation for
LLVM_ABI
and related annotations is found in the LLVM repo here.The bulk of these changes were generated automatically using the Interface Definition Scanner (IDS) tool, followed formatting with
git clang-format
.The following manual adjustments were also applied after running IDS on Linux:
#include "llvm/Support/Compiler.h"
to files where it was not auto-added by IDS due to no pre-existing block of include statements.Validation
Local builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations: