[all-commits] [llvm/llvm-project] 7e4bdb: [llvm] annotate interfaces in llvm/CGData and llvm...

Andrew Rogers via All-commits all-commits at lists.llvm.org
Wed May 28 10:19:50 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e4bdb427f7531a3d15c5aebb4cc94906404657b
      https://github.com/llvm/llvm-project/commit/7e4bdb427f7531a3d15c5aebb4cc94906404657b
  Author: Andrew Rogers <andrurogerz at gmail.com>
  Date:   2025-05-28 (Wed, 28 May 2025)

  Changed paths:
    M llvm/include/llvm/CGData/CodeGenData.h
    M llvm/include/llvm/CGData/CodeGenDataReader.h
    M llvm/include/llvm/CGData/CodeGenDataWriter.h
    M llvm/include/llvm/CGData/OutlinedHashTree.h
    M llvm/include/llvm/CGData/OutlinedHashTreeRecord.h
    M llvm/include/llvm/CGData/StableFunctionMap.h
    M llvm/include/llvm/CGData/StableFunctionMapRecord.h
    M llvm/include/llvm/CodeGen/AccelTable.h
    M llvm/include/llvm/CodeGen/AsmPrinter.h
    M llvm/include/llvm/CodeGen/AsmPrinterHandler.h
    M llvm/include/llvm/CodeGen/CallingConvLower.h
    M llvm/include/llvm/CodeGen/CodeGenTargetMachineImpl.h
    M llvm/include/llvm/CodeGen/CommandFlags.h
    M llvm/include/llvm/CodeGen/DIE.h
    M llvm/include/llvm/CodeGen/DroppedVariableStatsMIR.h
    M llvm/include/llvm/CodeGen/GCMetadata.h
    M llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h
    M llvm/include/llvm/CodeGen/GlobalISel/CSEMIRBuilder.h
    M llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
    M llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
    M llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
    M llvm/include/llvm/CodeGen/GlobalISel/GISelValueTracking.h
    M llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h
    M llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
    M llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h
    M llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
    M llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
    M llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
    M llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
    M llvm/include/llvm/CodeGen/GlobalISel/Utils.h
    M llvm/include/llvm/CodeGen/ISDOpcodes.h
    M llvm/include/llvm/CodeGen/LexicalScopes.h
    M llvm/include/llvm/CodeGen/LiveInterval.h
    M llvm/include/llvm/CodeGen/LiveIntervalCalc.h
    M llvm/include/llvm/CodeGen/LiveIntervals.h
    M llvm/include/llvm/CodeGen/LiveRangeCalc.h
    M llvm/include/llvm/CodeGen/LiveRegUnits.h
    M llvm/include/llvm/CodeGen/LiveVariables.h
    M llvm/include/llvm/CodeGen/LowLevelTypeUtils.h
    M llvm/include/llvm/CodeGen/MIRFormatter.h
    M llvm/include/llvm/CodeGen/MIRParser/MIRParser.h
    M llvm/include/llvm/CodeGen/MIRPrinter.h
    M llvm/include/llvm/CodeGen/MachineBasicBlock.h
    M llvm/include/llvm/CodeGen/MachineBlockFrequencyInfo.h
    M llvm/include/llvm/CodeGen/MachineCycleAnalysis.h
    M llvm/include/llvm/CodeGen/MachineDomTreeUpdater.h
    M llvm/include/llvm/CodeGen/MachineDominators.h
    M llvm/include/llvm/CodeGen/MachineFrameInfo.h
    M llvm/include/llvm/CodeGen/MachineFunction.h
    M llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h
    M llvm/include/llvm/CodeGen/MachineFunctionAnalysisManager.h
    M llvm/include/llvm/CodeGen/MachineFunctionPass.h
    M llvm/include/llvm/CodeGen/MachineInstr.h
    M llvm/include/llvm/CodeGen/MachineInstrBuilder.h
    M llvm/include/llvm/CodeGen/MachineInstrBundle.h
    M llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
    M llvm/include/llvm/CodeGen/MachineLoopInfo.h
    M llvm/include/llvm/CodeGen/MachineMemOperand.h
    M llvm/include/llvm/CodeGen/MachineModuleInfo.h
    M llvm/include/llvm/CodeGen/MachineModuleSlotTracker.h
    M llvm/include/llvm/CodeGen/MachineOperand.h
    M llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
    M llvm/include/llvm/CodeGen/MachinePassManager.h
    M llvm/include/llvm/CodeGen/MachinePostDominators.h
    M llvm/include/llvm/CodeGen/MachineRegisterInfo.h
    M llvm/include/llvm/CodeGen/MachineScheduler.h
    M llvm/include/llvm/CodeGen/MachineSizeOpts.h
    M llvm/include/llvm/CodeGen/MachineStableHash.h
    M llvm/include/llvm/CodeGen/MachineVerifier.h
    M llvm/include/llvm/CodeGen/MacroFusion.h
    M llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
    M llvm/include/llvm/CodeGen/PBQPRAConstraint.h
    M llvm/include/llvm/CodeGen/Passes.h
    M llvm/include/llvm/CodeGen/PseudoSourceValue.h
    M llvm/include/llvm/CodeGen/PseudoSourceValueManager.h
    M llvm/include/llvm/CodeGen/RegisterBank.h
    M llvm/include/llvm/CodeGen/RegisterClassInfo.h
    M llvm/include/llvm/CodeGen/RegisterPressure.h
    M llvm/include/llvm/CodeGen/ReplaceWithVeclib.h
    M llvm/include/llvm/CodeGen/RuntimeLibcallUtil.h
    M llvm/include/llvm/CodeGen/ScheduleDAG.h
    M llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h
    M llvm/include/llvm/CodeGen/ScheduleDAGMutation.h
    M llvm/include/llvm/CodeGen/SchedulerRegistry.h
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/include/llvm/CodeGen/SelectionDAGAddressAnalysis.h
    M llvm/include/llvm/CodeGen/SelectionDAGNodes.h
    M llvm/include/llvm/CodeGen/SlotIndexes.h
    M llvm/include/llvm/CodeGen/StackMaps.h
    M llvm/include/llvm/CodeGen/TargetFrameLowering.h
    M llvm/include/llvm/CodeGen/TargetInstrInfo.h
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/include/llvm/CodeGen/TargetPassConfig.h
    M llvm/include/llvm/CodeGen/TargetRegisterInfo.h
    M llvm/include/llvm/CodeGen/TargetSchedule.h
    M llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
    M llvm/include/llvm/CodeGen/ValueTypes.h
    M llvm/include/llvm/CodeGen/VirtRegMap.h
    M llvm/unittests/CodeGen/RegAllocScoreTest.cpp

  Log Message:
  -----------
  [llvm] annotate interfaces in llvm/CGData and llvm/CodeGen for DLL export (#140823)

## Purpose

This patch is one in a series of code-mods that annotate LLVM’s public
interface for export. This patch annotates the `llvm/CGData` and
`llvm/CodeGen` 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 `LLVM_ABI` to a subset of private class methods and fields that
require export
- Add `LLVM_TEMPLATE_ABI` and `LLVM_EXPORT_TEMPLATE` to exported
instantiated templates defined via X-macro
- Add `LLVM_ABI_FRIEND` to friend member functions declared with
`LLVM_ABI`
- Explicitly make classes non-copyable where needed to due IDS adding
LLVM_ABI at the class level
- 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.
- Add `LLVM_ABI` to a small number of symbols that require export but
are not declared in headers

## 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