FLANG
TextDiagnostic.h
1//===--- TextDiagnostic.h - Text Diagnostic Pretty-Printing -----*- 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// A utility class that provides support for textual pretty-printing of
10// diagnostics. Based on clang::TextDiagnostic (this is a trimmed version).
11//
12// TODO: If expanding, consider sharing the implementation with Clang.
13//===----------------------------------------------------------------------===//
14//
15// Coding style: https://mlir.llvm.org/getting_started/DeveloperGuide/
16//
17//===----------------------------------------------------------------------===//
18
19#ifndef FORTRAN_FRONTEND_TEXTDIAGNOSTIC_H
20#define FORTRAN_FRONTEND_TEXTDIAGNOSTIC_H
21
22#include "clang/Basic/Diagnostic.h"
23
24namespace Fortran::frontend {
25
38class TextDiagnostic {
39public:
40 TextDiagnostic();
41
42 ~TextDiagnostic();
43
52 static void printDiagnosticLevel(llvm::raw_ostream &os,
53 clang::DiagnosticsEngine::Level level,
54 bool showColors);
55
68 static void printDiagnosticMessage(llvm::raw_ostream &os, bool isSupplemental,
69 llvm::StringRef message, bool showColors);
70};
71
72} // namespace Fortran::frontend
73
74#endif
static void printDiagnosticLevel(llvm::raw_ostream &os, clang::DiagnosticsEngine::Level level, bool showColors)
Definition TextDiagnostic.cpp:38
static void printDiagnosticMessage(llvm::raw_ostream &os, bool isSupplemental, llvm::StringRef message, bool showColors)
Definition TextDiagnostic.cpp:91