[PATCH] D14313: Add a libLTO diagnostic handler that supports lto_get_error_message API

Yunzhong Gao via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 12:50:37 PST 2015


ygao added a comment.

Also, I'd like to make some trivial spelling changes to llvm-lto.cpp to verify that setDiagnosticHandler() actually did change the handler (but it's possible that it is already verified in other forms that I am not aware of, in which case I'm happy to take out my changes).


================
Comment at: lib/LTO/LTOCodeGenerator.cpp:83
@@ +82,3 @@
+                                const char *Msg, void *) {
+  errs() << getLTODiagnosticPrefix(Severity) << Msg << "\n";
+}
----------------
rafael wrote:
> Since this is code in lib/, it would probably better to not set the diagonstic handler at all.
True, I do not have to set the diagnostic handler in lib/; I only need to set it for tools/lto.cpp, so I can take out pretty much the changes in r247461. I am thinking to keep the test case to verify that in the case if setDiagnosticHandler() is called, the LTO library does not call exit(1).


http://reviews.llvm.org/D14313





More information about the llvm-commits mailing list