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)
commit0b5745abd8e46ac60cd16f949a2fd5a581fc8fd4
tree9bf3216708f093b7f26e88da9a98598484162e10
parentd2f9358649478df80d688e77858dee14e37aebed
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211315 91177308-0d34-0410-b5e6-96231b3b80d8
tools/gold/CMakeLists.txt
tools/gold/gold-plugin.cpp