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

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 4 15:50:05 PST 2015


joker.eph added a subscriber: joker.eph.

================
Comment at: include/llvm/LTO/LTOCodeGenerator.h:68
@@ -66,1 +67,3 @@
+  LTOCodeGenerator(std::unique_ptr<LLVMContext> Context,
+                   DiagnosticHandlerFunction DiagnosticHandler);
   ~LTOCodeGenerator();
----------------
The combinatory explosion of constructors is not nice. I feel we should be able to avoid it with a default value (and promoting handleLTODiagnostic to a static class method):

```
struct LTOCodeGenerator {
  static void handleLTODiagnostic(const DiagnosticInfo &DI);
  LTOCodeGenerator(DiagnosticHandlerFunction DiagnosticHandler = handleLTODiagnostic);
  ....
```

================
Comment at: tools/lto/lto.cpp:93
@@ +92,3 @@
+  DI.print(DP);
+  Stream.flush();
+}
----------------
An issue I had the last few days with this is that when multiple diagnostic are issued, they will be concatenated in a single giant line, should they be split on a new line here?


http://reviews.llvm.org/D14313





More information about the llvm-commits mailing list