Use lib/LTO directly in the gold plugin.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 19 Jun 2014 21:14:13 +0000 (21:14 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 19 Jun 2014 21:14:13 +0000 (21:14 +0000)
commit6b244b134868958e7adc62e8b7cfe02e448529c7
tree3e320ed67faed0d961b0a727c8a6a076e07a077e
parentc40e5edbbc85ed9346417d13f99137fa66dff1a1
Use lib/LTO directly in the gold plugin.

The tools/lto API is not the best choice for implementing a gold plugin. Among
other issues:

* It is an stable ABI. Old errors stay and we have to be really careful
  before adding new features.
* It has to support two fairly different linkers: gold and ld64.
* We end up with a plugin that depends on a shared lib, something quiet
  unusual in LLVM land.
* It hides LLVM. For some features in the gold plugin it would be really
  nice to be able to just get a Module or a GlobalValue.

This change is intended to be a very direct translation from the C API. It
will just enable other fixes and cleanups.

Tested with a LTO bootstrap on linux.

llvm-svn: 211315
llvm/tools/gold/CMakeLists.txt
llvm/tools/gold/gold-plugin.cpp