codegenerator.cpp (ldc-1.32.1) | : | codegenerator.cpp (ldc-1.32.2) | ||
---|---|---|---|---|
skipping to change at line 180 | skipping to change at line 180 | |||
inlineAsmDiagnostic(static_cast<IRState *>(context), d, locCookie); | inlineAsmDiagnostic(static_cast<IRState *>(context), d, locCookie); | |||
} | } | |||
#else | #else | |||
struct InlineAsmDiagnosticHandler : public llvm::DiagnosticHandler { | struct InlineAsmDiagnosticHandler : public llvm::DiagnosticHandler { | |||
IRState *irs; | IRState *irs; | |||
InlineAsmDiagnosticHandler(IRState *irs) : irs(irs) {} | InlineAsmDiagnosticHandler(IRState *irs) : irs(irs) {} | |||
// return false to defer to LLVMContext::diagnose() | // return false to defer to LLVMContext::diagnose() | |||
bool handleDiagnostics(const llvm::DiagnosticInfo &DI) override { | bool handleDiagnostics(const llvm::DiagnosticInfo &DI) override { | |||
if (DI.getKind() != llvm::DK_SrcMgr) | if (DI.getKind() == llvm::SourceMgr::DK_Error || | |||
return false; | DI.getSeverity() == llvm::DS_Error) { | |||
const auto &DISM = llvm::cast<llvm::DiagnosticInfoSrcMgr>(DI); | ||||
if (DISM.getKind() == llvm::SourceMgr::DK_Error || | ||||
DISM.getSeverity() == llvm::DS_Error) { | ||||
++global.errors; | ++global.errors; | |||
} else if (global.params.warnings == DIAGNOSTICerror && | } else if (global.params.warnings == DIAGNOSTICerror && | |||
(DISM.getKind() == llvm::SourceMgr::DK_Warning || | (DI.getKind() == llvm::SourceMgr::DK_Warning || | |||
DISM.getSeverity() == llvm::DS_Warning)) { | DI.getSeverity() == llvm::DS_Warning)) { | |||
++global.warnings; | ++global.warnings; | |||
} | } | |||
if (DI.getKind() != llvm::DK_SrcMgr) | ||||
return false; | ||||
const auto &DISM = llvm::cast<llvm::DiagnosticInfoSrcMgr>(DI); | ||||
return inlineAsmDiagnostic(irs, DISM.getSMDiag(), DISM.getLocCookie()); | return inlineAsmDiagnostic(irs, DISM.getSMDiag(), DISM.getLocCookie()); | |||
} | } | |||
}; | }; | |||
#endif | #endif | |||
} // anonymous namespace | } // anonymous namespace | |||
namespace ldc { | namespace ldc { | |||
CodeGenerator::CodeGenerator(llvm::LLVMContext &context, | CodeGenerator::CodeGenerator(llvm::LLVMContext &context, | |||
#if LDC_MLIR_ENABLED | #if LDC_MLIR_ENABLED | |||
End of changes. 3 change blocks. | ||||
8 lines changed or deleted | 9 lines changed or added |