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#include "llvm/ADT/IntrusiveRefCntPtr.h"
24
25namespace Fortran::frontend {
26
40public:
42
44
53 static void printDiagnosticLevel(llvm::raw_ostream &os,
54 clang::DiagnosticsEngine::Level level,
55 bool showColors);
56
69 static void printDiagnosticMessage(llvm::raw_ostream &os, bool isSupplemental,
70 llvm::StringRef message, bool showColors);
71};
72
73} // namespace Fortran::frontend
74
75#endif
Definition: TextDiagnostic.h:39
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