[all-commits] [llvm/llvm-project] d94846: [llvm] annotate interfaces in llvm/MC and llvm/MCA...

Andrew Rogers via All-commits all-commits at lists.llvm.org
Wed Jun 4 10:29:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d94846a9adfd6c89699228f8538a832554c59df7
      https://github.com/llvm/llvm-project/commit/d94846a9adfd6c89699228f8538a832554c59df7
  Author: Andrew Rogers <andrurogerz at gmail.com>
  Date:   2025-06-04 (Wed, 04 Jun 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCAsmBackend.h
    M llvm/include/llvm/MC/MCAsmInfo.h
    M llvm/include/llvm/MC/MCAsmMacro.h
    M llvm/include/llvm/MC/MCAssembler.h
    M llvm/include/llvm/MC/MCCodeEmitter.h
    M llvm/include/llvm/MC/MCContext.h
    M llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
    M llvm/include/llvm/MC/MCDisassembler/MCRelocationInfo.h
    M llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h
    M llvm/include/llvm/MC/MCDwarf.h
    M llvm/include/llvm/MC/MCExpr.h
    M llvm/include/llvm/MC/MCFragment.h
    M llvm/include/llvm/MC/MCInst.h
    M llvm/include/llvm/MC/MCInstPrinter.h
    M llvm/include/llvm/MC/MCInstrAnalysis.h
    M llvm/include/llvm/MC/MCInstrDesc.h
    M llvm/include/llvm/MC/MCInstrInfo.h
    M llvm/include/llvm/MC/MCLinkerOptimizationHint.h
    M llvm/include/llvm/MC/MCMachObjectWriter.h
    M llvm/include/llvm/MC/MCObjectFileInfo.h
    M llvm/include/llvm/MC/MCObjectWriter.h
    M llvm/include/llvm/MC/MCParser/AsmLexer.h
    M llvm/include/llvm/MC/MCParser/MCAsmParser.h
    M llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
    M llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h
    M llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
    M llvm/include/llvm/MC/MCPseudoProbe.h
    M llvm/include/llvm/MC/MCRegisterInfo.h
    M llvm/include/llvm/MC/MCSchedule.h
    M llvm/include/llvm/MC/MCSection.h
    M llvm/include/llvm/MC/MCSectionMachO.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/include/llvm/MC/MCSubtargetInfo.h
    M llvm/include/llvm/MC/MCSymbol.h
    M llvm/include/llvm/MC/MCTargetOptions.h
    M llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h
    M llvm/include/llvm/MC/MCWinEH.h
    M llvm/include/llvm/MC/StringTableBuilder.h
    M llvm/include/llvm/MC/TargetRegistry.h
    M llvm/include/llvm/MCA/CodeEmitter.h
    M llvm/include/llvm/MCA/Context.h
    M llvm/include/llvm/MCA/CustomBehaviour.h
    M llvm/include/llvm/MCA/HWEventListener.h
    M llvm/include/llvm/MCA/HardwareUnits/HardwareUnit.h
    M llvm/include/llvm/MCA/HardwareUnits/LSUnit.h
    M llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h
    M llvm/include/llvm/MCA/HardwareUnits/Scheduler.h
    M llvm/include/llvm/MCA/IncrementalSourceMgr.h
    M llvm/include/llvm/MCA/InstrBuilder.h
    M llvm/include/llvm/MCA/Instruction.h
    M llvm/include/llvm/MCA/Pipeline.h
    M llvm/include/llvm/MCA/Stages/EntryStage.h
    M llvm/include/llvm/MCA/Stages/InstructionTables.h
    M llvm/include/llvm/MCA/Stages/Stage.h
    M llvm/include/llvm/MCA/Support.h
    M llvm/include/llvm/MCA/View.h

  Log Message:
  -----------
  [llvm] annotate interfaces in llvm/MC and llvm/MCA for DLL export (#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 #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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list