//===- DiagnosticRenderer.h - Diagnostic Pretty-Printing --------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This is a utility class that provides support for pretty-printing of // diagnostics. It is used to implement the different code paths which require // such functionality in a consistent way. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_FRONTEND_DIAGNOSTICRENDERER_H #define LLVM_CLANG_FRONTEND_DIAGNOSTICRENDERER_H #include "clang/Basic/Diagnostic.h" #include "clang/Basic/DiagnosticOptions.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/StringRef.h" namespace clang { class LangOptions; class SourceManager; DiagOrStoredDiag; /// Class to encapsulate the logic for formatting a diagnostic message. /// /// Actual "printing" logic is implemented by subclasses. /// /// This class provides an interface for building and emitting /// diagnostic, including all of the macro backtraces, caret diagnostics, FixIt /// Hints, and code snippets. In the presence of macros this involves /// a recursive process, synthesizing notes for each macro expansion. /// /// A brief worklist: /// FIXME: Sink the recursive printing of template instantiations into this /// class. class DiagnosticRenderer { … }; /// Subclass of DiagnosticRender that turns all subdiagostics into explicit /// notes. It is up to subclasses to further define the behavior. class DiagnosticNoteRenderer : public DiagnosticRenderer { … }; } // namespace clang #endif // LLVM_CLANG_FRONTEND_DIAGNOSTICRENDERER_H