[all-commits] [llvm/llvm-project] 7dc5dc: [llvm] annotate interfaces in llvm/IR for DLL expo...

Andrew Rogers via All-commits all-commits at lists.llvm.org
Mon Jun 2 15:58:45 PDT 2025


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

  Changed paths:
    M llvm/include/llvm/IR/AbstractCallSite.h
    M llvm/include/llvm/IR/Analysis.h
    M llvm/include/llvm/IR/Argument.h
    M llvm/include/llvm/IR/AssemblyAnnotationWriter.h
    M llvm/include/llvm/IR/Assumptions.h
    M llvm/include/llvm/IR/Attributes.h
    M llvm/include/llvm/IR/AutoUpgrade.h
    M llvm/include/llvm/IR/BasicBlock.h
    M llvm/include/llvm/IR/BuiltinGCs.h
    M llvm/include/llvm/IR/CmpPredicate.h
    M llvm/include/llvm/IR/Comdat.h
    M llvm/include/llvm/IR/Constant.h
    M llvm/include/llvm/IR/ConstantFPRange.h
    M llvm/include/llvm/IR/ConstantFold.h
    M llvm/include/llvm/IR/ConstantFolder.h
    M llvm/include/llvm/IR/ConstantRange.h
    M llvm/include/llvm/IR/ConstantRangeList.h
    M llvm/include/llvm/IR/Constants.h
    M llvm/include/llvm/IR/DIBuilder.h
    M llvm/include/llvm/IR/DataLayout.h
    M llvm/include/llvm/IR/DebugInfo.h
    M llvm/include/llvm/IR/DebugInfoMetadata.h
    M llvm/include/llvm/IR/DebugLoc.h
    M llvm/include/llvm/IR/DebugProgramInstruction.h
    M llvm/include/llvm/IR/DerivedTypes.h
    M llvm/include/llvm/IR/DiagnosticHandler.h
    M llvm/include/llvm/IR/DiagnosticInfo.h
    M llvm/include/llvm/IR/DiagnosticPrinter.h
    M llvm/include/llvm/IR/Dominators.h
    M llvm/include/llvm/IR/DroppedVariableStats.h
    M llvm/include/llvm/IR/DroppedVariableStatsIR.h
    M llvm/include/llvm/IR/EHPersonalities.h
    M llvm/include/llvm/IR/FMF.h
    M llvm/include/llvm/IR/FPEnv.h
    M llvm/include/llvm/IR/Function.h
    M llvm/include/llvm/IR/GenericFloatingPointPredicateUtils.h
    M llvm/include/llvm/IR/GlobalAlias.h
    M llvm/include/llvm/IR/GlobalIFunc.h
    M llvm/include/llvm/IR/GlobalObject.h
    M llvm/include/llvm/IR/GlobalValue.h
    M llvm/include/llvm/IR/GlobalVariable.h
    M llvm/include/llvm/IR/IRBuilder.h
    M llvm/include/llvm/IR/IRBuilderFolder.h
    M llvm/include/llvm/IR/IRPrintingPasses.h
    M llvm/include/llvm/IR/InlineAsm.h
    M llvm/include/llvm/IR/InstrTypes.h
    M llvm/include/llvm/IR/Instruction.h
    M llvm/include/llvm/IR/Instructions.h
    M llvm/include/llvm/IR/IntrinsicInst.h
    M llvm/include/llvm/IR/Intrinsics.h
    M llvm/include/llvm/IR/LLVMContext.h
    M llvm/include/llvm/IR/LLVMRemarkStreamer.h
    M llvm/include/llvm/IR/LegacyPassManager.h
    M llvm/include/llvm/IR/LegacyPassManagers.h
    M llvm/include/llvm/IR/LegacyPassNameParser.h
    M llvm/include/llvm/IR/MDBuilder.h
    M llvm/include/llvm/IR/Mangler.h
    M llvm/include/llvm/IR/MemoryModelRelaxationAnnotations.h
    M llvm/include/llvm/IR/Metadata.h
    M llvm/include/llvm/IR/Module.h
    M llvm/include/llvm/IR/ModuleSlotTracker.h
    M llvm/include/llvm/IR/ModuleSummaryIndex.h
    M llvm/include/llvm/IR/NoFolder.h
    M llvm/include/llvm/IR/Operator.h
    M llvm/include/llvm/IR/OptBisect.h
    M llvm/include/llvm/IR/PassInstrumentation.h
    M llvm/include/llvm/IR/PassManager.h
    M llvm/include/llvm/IR/PassManagerImpl.h
    M llvm/include/llvm/IR/PassTimingInfo.h
    M llvm/include/llvm/IR/ProfDataUtils.h
    M llvm/include/llvm/IR/ProfileSummary.h
    M llvm/include/llvm/IR/PseudoProbe.h
    M llvm/include/llvm/IR/ReplaceConstant.h
    M llvm/include/llvm/IR/RuntimeLibcalls.h
    M llvm/include/llvm/IR/StructuralHash.h
    M llvm/include/llvm/IR/SymbolTableListTraits.h
    M llvm/include/llvm/IR/Type.h
    M llvm/include/llvm/IR/TypedPointerType.h
    M llvm/include/llvm/IR/Use.h
    M llvm/include/llvm/IR/User.h
    M llvm/include/llvm/IR/VFABIDemangler.h
    M llvm/include/llvm/IR/Value.h
    M llvm/include/llvm/IR/ValueHandle.h
    M llvm/include/llvm/IR/ValueSymbolTable.h
    M llvm/include/llvm/IR/VectorBuilder.h
    M llvm/include/llvm/IR/VectorTypeUtils.h
    M llvm/include/llvm/IR/Verifier.h
    M llvm/include/llvm/IRPrinter/IRPrintingPasses.h
    M llvm/include/llvm/IRReader/IRReader.h
    M llvm/lib/IR/BasicBlock.cpp
    M llvm/lib/IR/DebugInfoMetadata.cpp
    M llvm/lib/IR/DebugProgramInstruction.cpp
    M llvm/lib/IR/Dominators.cpp
    M llvm/lib/IR/Function.cpp
    M llvm/lib/IR/IRPrintingPasses.cpp
    M llvm/lib/IR/Instruction.cpp
    M llvm/lib/IR/Instructions.cpp
    M llvm/lib/IR/LegacyPassManager.cpp
    M llvm/lib/IR/Module.cpp
    M llvm/lib/IR/PassManager.cpp
    M llvm/lib/IRPrinter/IRPrintingPasses.cpp
    M llvm/unittests/IR/DebugInfoTest.cpp
    M llvm/unittests/IR/InstructionsTest.cpp
    M llvm/unittests/IR/MetadataTest.cpp
    M llvm/unittests/IR/ValueTest.cpp

  Log Message:
  -----------
  [llvm] annotate interfaces in llvm/IR for DLL export (#141650)

## Purpose

This patch is one in a series of code-mods that annotate LLVM’s public
interface for export. This patch annotates the `llvm/IR`,
`llvm/IRPrinter`, and `llvm/IRReader` 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.
- Add `LLVM_ABI_FRIEND` to friend member functions declared with
`LLVM_ABI`
- Add `LLVM_TEMPLATE_ABI` and `LLVM_EXPORT_TEMPLATE` to exported
instantiated templates
- Add `LLVM_ABI` to a subset of private class methods and fields that
require export
- Add `LLVM_ABI` to a small number of symbols that require export but
are not declared in headers
- Reorder `LLVM_ABI` with `[[deprecated]]` and `[[nodiscard]]`
attributes.

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