 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
0.0% |
0 / 0 |
| Generated: |
2010-02-10 01:31 |
|
Branches Executed: |
0.0% |
0 / 0 |
| |
|
Line Coverage: |
100.0% |
6 / 6 |
| |
 |
|
 |
1 : //===--- TextDiagnosticPrinter.h - Text Diagnostic Client -------*- 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 : //===----------------------------------------------------------------------===//
9 : //
10 : // This is a concrete diagnostic client, which prints the diagnostics to
11 : // standard error.
12 : //
13 : //===----------------------------------------------------------------------===//
14 :
15 : #ifndef LLVM_CLANG_FRONTEND_TEXT_DIAGNOSTIC_PRINTER_H_
16 : #define LLVM_CLANG_FRONTEND_TEXT_DIAGNOSTIC_PRINTER_H_
17 :
18 : #include "clang/Basic/Diagnostic.h"
19 : #include "clang/Basic/SourceLocation.h"
20 :
21 : namespace llvm {
22 : class raw_ostream;
23 : }
24 :
25 : namespace clang {
26 : class DiagnosticOptions;
27 : class LangOptions;
28 : class SourceManager;
29 :
30 : class TextDiagnosticPrinter : public DiagnosticClient {
31 : llvm::raw_ostream &OS;
32 : const LangOptions *LangOpts;
33 : const DiagnosticOptions *DiagOpts;
34 :
35 : SourceLocation LastWarningLoc;
36 : FullSourceLoc LastLoc;
37 : unsigned LastCaretDiagnosticWasNote : 1;
38 : unsigned OwnsOutputStream : 1;
39 :
40 : public:
41 : TextDiagnosticPrinter(llvm::raw_ostream &os, const DiagnosticOptions &diags,
42 : bool OwnsOutputStream = false);
43 : virtual ~TextDiagnosticPrinter();
44 :
45 2459: void BeginSourceFile(const LangOptions &LO, const Preprocessor *PP) {
46 2459: LangOpts = &LO;
47 2459: }
48 :
49 2461: void EndSourceFile() {
50 2461: LangOpts = 0;
51 2461: }
52 :
53 : void PrintIncludeStack(SourceLocation Loc, const SourceManager &SM);
54 :
55 : void HighlightRange(const SourceRange &R,
56 : const SourceManager &SrcMgr,
57 : unsigned LineNo, FileID FID,
58 : std::string &CaretLine,
59 : const std::string &SourceLine);
60 :
61 : void EmitCaretDiagnostic(SourceLocation Loc,
62 : SourceRange *Ranges, unsigned NumRanges,
63 : SourceManager &SM,
64 : const CodeModificationHint *Hints,
65 : unsigned NumHints,
66 : unsigned Columns);
67 :
68 : virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
69 : const DiagnosticInfo &Info);
70 : };
71 :
72 : } // end namspace clang
73 :
74 : #endif
Generated: 2010-02-10 01:31 by zcov