Add a libLTO diagnostic handler that supports lto_get_error_message API
authorYunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Wed, 11 Nov 2015 19:59:08 +0000 (19:59 +0000)
committerYunzhong Gao <Yunzhong_Gao@playstation.sony.com>
Wed, 11 Nov 2015 19:59:08 +0000 (19:59 +0000)
commit8de34ad8f7dd5c159c1989c011fa70fd6f62026a
tree98a0db059418b4803a9bf28394b6433aa7225ea3
parente2eaa9712db78fe0a0ddbd10c5322c45c54af9a8
Add a libLTO diagnostic handler that supports lto_get_error_message API

This is a follow-up from the previous discussion on the thread:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151019/307763.html

The LibLTO lto_get_error_message() API reads error messages from a std::string
sLastErrorString. Instead of passing this string around as an argument, this
patch creates a diagnostic handler and then sends this handler to the
constructor of LTOCodeGenerator.

Differential Revision: http://reviews.llvm.org/D14313

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252791 91177308-0d34-0410-b5e6-96231b3b80d8
lib/LTO/LTOCodeGenerator.cpp
test/LTO/X86/diagnostic-handler-noexit.ll
tools/lto/lto.cpp