DiagnosticRenderer.h (239462) | DiagnosticRenderer.h (243830) |
---|---|
1//===--- DiagnosticRenderer.h - Diagnostic Pretty-Printing ------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 30 unchanged lines hidden (view full) --- 39/// a recursive process, synthesizing notes for each macro expansion. 40/// 41/// A brief worklist: 42/// FIXME: Sink the recursive printing of template instantiations into this 43/// class. 44class DiagnosticRenderer { 45protected: 46 const LangOptions &LangOpts; | 1//===--- DiagnosticRenderer.h - Diagnostic Pretty-Printing ------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 30 unchanged lines hidden (view full) --- 39/// a recursive process, synthesizing notes for each macro expansion. 40/// 41/// A brief worklist: 42/// FIXME: Sink the recursive printing of template instantiations into this 43/// class. 44class DiagnosticRenderer { 45protected: 46 const LangOptions &LangOpts; |
47 const DiagnosticOptions &DiagOpts; | 47 IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts; |
48 49 /// \brief The location of the previous diagnostic if known. 50 /// 51 /// This will be invalid in cases where there is no (known) previous 52 /// diagnostic location, or that location itself is invalid or comes from 53 /// a different source manager than SM. 54 SourceLocation LastLoc; 55 --- 5 unchanged lines hidden (view full) --- 61 62 /// \brief The level of the last diagnostic emitted. 63 /// 64 /// The level of the last diagnostic emitted. Used to detect level changes 65 /// which change the amount of information displayed. 66 DiagnosticsEngine::Level LastLevel; 67 68 DiagnosticRenderer(const LangOptions &LangOpts, | 48 49 /// \brief The location of the previous diagnostic if known. 50 /// 51 /// This will be invalid in cases where there is no (known) previous 52 /// diagnostic location, or that location itself is invalid or comes from 53 /// a different source manager than SM. 54 SourceLocation LastLoc; 55 --- 5 unchanged lines hidden (view full) --- 61 62 /// \brief The level of the last diagnostic emitted. 63 /// 64 /// The level of the last diagnostic emitted. Used to detect level changes 65 /// which change the amount of information displayed. 66 DiagnosticsEngine::Level LastLevel; 67 68 DiagnosticRenderer(const LangOptions &LangOpts, |
69 const DiagnosticOptions &DiagOpts); | 69 DiagnosticOptions *DiagOpts); |
70 71 virtual ~DiagnosticRenderer(); 72 73 virtual void emitDiagnosticMessage(SourceLocation Loc, PresumedLoc PLoc, 74 DiagnosticsEngine::Level Level, 75 StringRef Message, 76 ArrayRef<CharSourceRange> Ranges, 77 const SourceManager *SM, --- 41 unchanged lines hidden (view full) --- 119 /// diagnostic. 120 /// 121 /// \param Loc The location for this caret. 122 /// \param Level The level of the diagnostic to be emitted. 123 /// \param Message The diagnostic message to emit. 124 /// \param Ranges The underlined ranges for this code snippet. 125 /// \param FixItHints The FixIt hints active for this diagnostic. 126 /// \param SM The SourceManager; will be null if the diagnostic came from the | 70 71 virtual ~DiagnosticRenderer(); 72 73 virtual void emitDiagnosticMessage(SourceLocation Loc, PresumedLoc PLoc, 74 DiagnosticsEngine::Level Level, 75 StringRef Message, 76 ArrayRef<CharSourceRange> Ranges, 77 const SourceManager *SM, --- 41 unchanged lines hidden (view full) --- 119 /// diagnostic. 120 /// 121 /// \param Loc The location for this caret. 122 /// \param Level The level of the diagnostic to be emitted. 123 /// \param Message The diagnostic message to emit. 124 /// \param Ranges The underlined ranges for this code snippet. 125 /// \param FixItHints The FixIt hints active for this diagnostic. 126 /// \param SM The SourceManager; will be null if the diagnostic came from the |
127 /// frontend, thus \param Loc will be invalid. | 127 /// frontend, thus \p Loc will be invalid. |
128 void emitDiagnostic(SourceLocation Loc, DiagnosticsEngine::Level Level, 129 StringRef Message, ArrayRef<CharSourceRange> Ranges, 130 ArrayRef<FixItHint> FixItHints, 131 const SourceManager *SM, 132 DiagOrStoredDiag D = (Diagnostic *)0); 133 134 void emitStoredDiagnostic(StoredDiagnostic &Diag); 135}; 136 137/// Subclass of DiagnosticRender that turns all subdiagostics into explicit 138/// notes. It is up to subclasses to further define the behavior. 139class DiagnosticNoteRenderer : public DiagnosticRenderer { 140public: 141 DiagnosticNoteRenderer(const LangOptions &LangOpts, | 128 void emitDiagnostic(SourceLocation Loc, DiagnosticsEngine::Level Level, 129 StringRef Message, ArrayRef<CharSourceRange> Ranges, 130 ArrayRef<FixItHint> FixItHints, 131 const SourceManager *SM, 132 DiagOrStoredDiag D = (Diagnostic *)0); 133 134 void emitStoredDiagnostic(StoredDiagnostic &Diag); 135}; 136 137/// Subclass of DiagnosticRender that turns all subdiagostics into explicit 138/// notes. It is up to subclasses to further define the behavior. 139class DiagnosticNoteRenderer : public DiagnosticRenderer { 140public: 141 DiagnosticNoteRenderer(const LangOptions &LangOpts, |
142 const DiagnosticOptions &DiagOpts) | 142 DiagnosticOptions *DiagOpts) |
143 : DiagnosticRenderer(LangOpts, DiagOpts) {} 144 145 virtual ~DiagnosticNoteRenderer(); 146 147 virtual void emitBasicNote(StringRef Message); 148 149 virtual void emitIncludeLocation(SourceLocation Loc, 150 PresumedLoc PLoc, 151 const SourceManager &SM); 152 153 virtual void emitNote(SourceLocation Loc, StringRef Message, 154 const SourceManager *SM) = 0; 155}; 156} // end clang namespace 157#endif | 143 : DiagnosticRenderer(LangOpts, DiagOpts) {} 144 145 virtual ~DiagnosticNoteRenderer(); 146 147 virtual void emitBasicNote(StringRef Message); 148 149 virtual void emitIncludeLocation(SourceLocation Loc, 150 PresumedLoc PLoc, 151 const SourceManager &SM); 152 153 virtual void emitNote(SourceLocation Loc, StringRef Message, 154 const SourceManager *SM) = 0; 155}; 156} // end clang namespace 157#endif |