Modernize the C++ APIs for creating LTO modules.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 4 Dec 2015 16:14:31 +0000 (16:14 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 4 Dec 2015 16:14:31 +0000 (16:14 +0000)
commit608d7b4f4a08cf0ac4529ef1260667d82f3926c4
tree264a5c1cf7fabc6885da6a15ddb0678afceb247d
parente67b3e872170aa4f2cacf12cc7c6c3aed7373399
Modernize the C++ APIs for creating LTO modules.

This is a continuation of r253367.

These functions return is owned by the caller, so they return
std::unique_ptr now.

The call can fail, so the return is wrapped in ErrorOr.

They have a context where to report diagnostics, so they don't need to
take a string out parameter.

With this there are no call to getGlobalContext in lib/LTO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254721 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/LTO/LTOModule.h
lib/LTO/LTOModule.cpp
tools/llvm-lto/llvm-lto.cpp
tools/lto/lto.cpp