FLANG
FatalError.h
1//===-- Optimizer/Support/FatalError.h --------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef FORTRAN_OPTIMIZER_SUPPORT_FATALERROR_H
14#define FORTRAN_OPTIMIZER_SUPPORT_FATALERROR_H
15
16#include "mlir/IR/Diagnostics.h"
17#include "llvm/Support/ErrorHandling.h"
18
19namespace fir {
20
25[[noreturn]] inline void emitFatalError(mlir::Location loc,
26 const llvm::Twine &message,
27 bool genCrashDiag = true) {
28 mlir::emitError(loc, message);
29 llvm::report_fatal_error("aborting", genCrashDiag);
30}
31
32} // namespace fir
33
34#endif // FORTRAN_OPTIMIZER_SUPPORT_FATALERROR_H
Definition: AbstractConverter.h:31
void emitFatalError(mlir::Location loc, const llvm::Twine &message, bool genCrashDiag=true)
Definition: FatalError.h:25