[PATCH] D23132: Add a new BitcodeSymbolTable abstraction for bitcode files, and migrate IRObjectFile, llvm-nm, and LTO to use it

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 12:55:50 PDT 2016


mehdi_amini created this revision.
mehdi_amini added reviewers: davide, dexonsmith, pcc.
mehdi_amini added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.

This is related to http://lists.llvm.org/pipermail/llvm-dev/2016-May/100190.html
And https://llvm.org/bugs/show_bug.cgi?id=27551

It is a first step toward having an easy and fast to access Symbol
Table in Bitcode Files so that they can be handled as regular
object files by tools like llvm-ar, llvm-nm, or by linkers during
LTO.

The SymbolTable abstraction will provide backward compatiblity for
existing bitcode files, and as soon as it is stable enough, we'll
be able to evolve the format to make it more efficient to build.

The existing approach is IRObjectFile, it is implemented on top
of the IR: it requires a LLVMContext and will parse the Module.
The newly introduced replacement, BitcodeObjectFile, is using the
BitcodeSymbolTable which is built out of the bitcode without
having to generate any IR construct.
It means that on the long term, we should be able to build tools
like llvm-nm that wouldn't needs to link-in the target for instance.

LTOModule/libLTO.dylib as well as llvm-nm have been converted to
use this new class.

https://reviews.llvm.org/D23132

Files:
  include/llvm/Bitcode/ReaderWriter.h
  include/llvm/IR/Mangler.h
  include/llvm/LTO/legacy/LTOModule.h
  include/llvm/Object/BitcodeObjectFile.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/IR/Mangler.cpp
  lib/LTO/LTOCodeGenerator.cpp
  lib/LTO/LTOModule.cpp
  lib/Object/BitcodeObjectFile.cpp
  lib/Object/CMakeLists.txt
  lib/Object/SymbolicFile.cpp
  test/tools/lto/hide-linkonce-odr.ll
  test/tools/lto/opt-level.ll
  tools/llvm-lto/llvm-lto.cpp
  tools/llvm-nm/llvm-nm.cpp
  tools/lto/lto.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23132.66698.patch
Type: text/x-patch
Size: 87850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160803/6359efd2/attachment.bin>


More information about the llvm-commits mailing list