[PATCH] D109192: [WIP/DNM] Support: introduce public API annotation support

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 13:48:13 PDT 2021


compnerd created this revision.
compnerd added reviewers: rnk, hans.
compnerd added a project: LLVM.
Herald added subscribers: dexonsmith, hiraditya, mgorny.
compnerd requested review of this revision.
Herald added a subscriber: aheejin.

This provides a model for annotating the "public" interfaces of a module
in LLVM.  This is motivated by the desire to have the ability to build
LLVM libraries in the shared mode to enable extraction of the shared
content between the tools.

Unlike Unix platforms, Windows has a more stringent requirement of
annotating the "dll-interface" when building a shared library.  All of
the public APIs should be marked by the appropriate `*_API` macro.  The
annotation indicates what APIs are public but are expected to live in
the dynamic library (DLL/dylib/so) that the macro is associated with.

The longer term desire here is to evolve this to support creating a
small set of libraries.  Because there is a cost associated with the
call across the image boundary (GOT+PLT/IAT), the intent is to minimise
the number of libraries.  The separation of the libraries should prefer
to split along the following disjoint sets:

- minimal set of interfaces required for `llvm-ar` (archiver/librarian)
- minimal set of interfaces required for `lld` (linker)
- minimal set of interfaces required for `clang` (compiler)

The reasoning behind this split set is that these tools are executed the
most, and minimising the penalty for these three sets is crucial for
keeping the penalty to dynamic linking (and LTO) low.  Keeping the
number of libraries low reduces the complexity in distribution and
should also help reduce the overall size of the toolchain distribution.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109192

Files:
  llvm/include/llvm/Support/AArch64TargetParser.h
  llvm/include/llvm/Support/ARMTargetParser.h
  llvm/include/llvm/Support/Atomic.h
  llvm/include/llvm/Support/AutoConvert.h
  llvm/include/llvm/Support/BinaryStream.h
  llvm/include/llvm/Support/BinaryStreamError.h
  llvm/include/llvm/Support/BinaryStreamReader.h
  llvm/include/llvm/Support/BinaryStreamRef.h
  llvm/include/llvm/Support/BinaryStreamWriter.h
  llvm/include/llvm/Support/BlockFrequency.h
  llvm/include/llvm/Support/COM.h
  llvm/include/llvm/Support/CachePruning.h
  llvm/include/llvm/Support/Chrono.h
  llvm/include/llvm/Support/CodeGenCoverage.h
  llvm/include/llvm/Support/CommandLine.h
  llvm/include/llvm/Support/Compression.h
  llvm/include/llvm/Support/Error.h
  llvm/include/llvm/Support/LLVMSupportExports.h
  llvm/include/llvm/Support/circular_raw_ostream.h
  llvm/lib/Support/AArch64TargetParser.cpp
  llvm/lib/Support/ARMTargetParser.cpp
  llvm/lib/Support/Atomic.cpp
  llvm/lib/Support/AutoConvert.cpp
  llvm/lib/Support/CMakeLists.txt
  llvm/lib/Support/CachePruning.cpp
  llvm/lib/Support/Chrono.cpp
  llvm/lib/Support/Compression.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109192.370395.patch
Type: text/x-patch
Size: 50467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210902/339f7fb4/attachment.bin>


More information about the llvm-commits mailing list