TextDiagnosticPrinter.h revision 533eae20118036f425f27bf0536ef0ccbb090b65
1//===- TextDiagnosticPrinter.h --------------------------------------------===//
2//
3//                     The MCLinker Project
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9#ifndef MCLD_LD_TEXTDIAGNOSTICPRINTER_H
10#define MCLD_LD_TEXTDIAGNOSTICPRINTER_H
11#include <mcld/LD/DiagnosticPrinter.h>
12#include <llvm/Support/raw_ostream.h>
13
14namespace mcld
15{
16
17class LinkerConfig;
18
19/** \class TextDiagnosticPrinter
20 *  \brief The plain, text-based DiagnosticPrinter.
21 */
22class TextDiagnosticPrinter : public DiagnosticPrinter
23{
24public:
25  TextDiagnosticPrinter(llvm::raw_ostream& pOStream, const LinkerConfig& pConfig);
26
27  virtual ~TextDiagnosticPrinter();
28
29  /// HandleDiagnostic - Handle this diagnostic, reporting it to the user or
30  /// capturing it to a log as needed.
31  virtual void handleDiagnostic(DiagnosticEngine::Severity pSeverity,
32                                const Diagnostic& pInfo);
33
34  virtual void beginInput(const Input& pInput, const LinkerConfig& pConfig);
35
36  virtual void endInput();
37
38private:
39  llvm::raw_ostream& m_OStream;
40  const LinkerConfig& m_Config;
41  const Input* m_pInput;
42};
43
44} // namespace of mcld
45
46#endif
47
48