<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Ping.<div><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Quentin</div>

</div>
<br><div style=""><div>On Jan 3, 2014, at 11:38 AM, Quentin Colombet <<a href="mailto:qcolombet@apple.com">qcolombet@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi,<div><br></div><div>This patch adds a way to register a diagnostic handler for the diagnostics coming from the code generator for the clients of LTO.</div><div><br></div><div>** Context **</div><div><br></div><div>In r197438, we introduced a new API to diagnose all sorts of events in the backend. This diagnostic framework exposes a hook to map the reported events in the client of the backend.</div><div><br></div><div>LTO, as a client of the backend, has access to this framework. However, LTO is not the component that directly interacts with the user. Therefore, we need to propagate these diagnostics to the clients of LTO.</div><div><br></div><div><br></div><div>** Proposed Solution **</div><div><br></div><div>Add a hook in the C API of LTO so that clients of the code generator can set their own handler.</div><div>The handler is defined like this:</div><div><font face="Menlo" style="font-size: 11px;">typedef void (*lto_diagnostic_handler_t)(lto_codegen_diagnostic_severity_t severity, const char *diag, void *ctxt)</font></div><div>- severity says how bad this is.</div><div>- diag is a string that contains the diagnostic message.</div><div>- ctxt is the registered context for this handler.</div><div><br></div><div>This hook is more general than the <font face="Menlo" style="font-size: 11px;">lot_get_error_message</font>, since this function keeps only the latest message and can only be queried when something went wrong (no warning for instance).</div><div><br></div><div>Finally, the patch also adds <font face="Menlo" style="font-size: 11px;">LTOCodeGenerator::resetDiagnosticHandler</font> (and the related C API), to reset the diagnostic handler to the original one. Indeed, the original diagnostic handler (if any) uses the C++ API and there are no (clean) way to expose it in the C API.</div><div><br></div><div>Thanks for your reviews.</div><div><br></div><div>Cheers,<br><div apple-content-edited="true">
<div style="font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">-Quentin</div>

</div>
</div></div><span><lto_diag.patch></span><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div></div>
_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote></div><br></div></body></html>