diff options
| author | Vivek Pandya <vivekvpandya@gmail.com> | 2017-09-15 19:53:54 +0000 |
|---|---|---|
| committer | Vivek Pandya <vivekvpandya@gmail.com> | 2017-09-15 19:53:54 +0000 |
| commit | df8598dcc46bde61fd70e2a39b6b8a067cc8be4a (patch) | |
| tree | 2e1611061b39e36c315db9964457895cf2770aaa /llvm/lib/LTO | |
| parent | 8b0bbc6fe03b50a87312902ed9ae2a09c5735889 (diff) | |
| download | bcm5719-llvm-df8598dcc46bde61fd70e2a39b6b8a067cc8be4a.tar.gz bcm5719-llvm-df8598dcc46bde61fd70e2a39b6b8a067cc8be4a.zip | |
This reverts r313381
llvm-svn: 313387
Diffstat (limited to 'llvm/lib/LTO')
| -rw-r--r-- | llvm/lib/LTO/LTOCodeGenerator.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp index ee9c70126b8..8ad3cccf8d4 100644 --- a/llvm/lib/LTO/LTOCodeGenerator.cpp +++ b/llvm/lib/LTO/LTOCodeGenerator.cpp @@ -622,8 +622,12 @@ void LTOCodeGenerator::parseCodeGenDebugOptions() { } } +void LTOCodeGenerator::DiagnosticHandler(const DiagnosticInfo &DI, + void *Context) { + ((LTOCodeGenerator *)Context)->DiagnosticHandler2(DI); +} -void LTOCodeGenerator::DiagnosticHandler(const DiagnosticInfo &DI) { +void LTOCodeGenerator::DiagnosticHandler2(const DiagnosticInfo &DI) { // Map the LLVM internal diagnostic severity to the LTO diagnostic severity. lto_codegen_diagnostic_severity_t Severity; switch (DI.getSeverity()) { @@ -653,29 +657,17 @@ void LTOCodeGenerator::DiagnosticHandler(const DiagnosticInfo &DI) { (*DiagHandler)(Severity, MsgStorage.c_str(), DiagContext); } -namespace { -struct LTODiagnosticHandler : public DiagnosticHandler { - LTOCodeGenerator *CodeGenerator; - LTODiagnosticHandler(LTOCodeGenerator *CodeGenPtr) - : CodeGenerator(CodeGenPtr) {} - bool handleDiagnostics(const DiagnosticInfo &DI) override { - CodeGenerator->DiagnosticHandler(DI); - return true; - } -}; -} - void LTOCodeGenerator::setDiagnosticHandler(lto_diagnostic_handler_t DiagHandler, void *Ctxt) { this->DiagHandler = DiagHandler; this->DiagContext = Ctxt; if (!DiagHandler) - return Context.setDiagnosticHandler(nullptr); + return Context.setDiagnosticHandler(nullptr, nullptr); // Register the LTOCodeGenerator stub in the LLVMContext to forward the // diagnostic to the external DiagHandler. - Context.setDiagnosticHandler(llvm::make_unique<LTODiagnosticHandler>(this), - true); + Context.setDiagnosticHandler(LTOCodeGenerator::DiagnosticHandler, this, + /* RespectFilters */ true); } namespace { |

