Hi Rafael, Duncan, Peter,
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.
There are still a few cases inside lto.cpp where sLastErrorString is being passed around as an
argument. I'd like to look into cleaning those up in a separate patch.
This patch did not addressing testing: llvm-lto uses a custom diagnostic handler; maybe I can
overwrite that custom handler with a new handler, but then I would be testing the new handler
in llvm-lto.cpp instead of the handler in lto.cpp. I'll have to think about it.
- Gao
The switch is already fully covered, no?