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
13#include <llvm/Support/raw_ostream.h>
14
15namespace mcld {
16
17class LinkerConfig;
18
19/** \class TextDiagnosticPrinter
20 *  \brief The plain, text-based DiagnosticPrinter.
21 */
22class TextDiagnosticPrinter : public DiagnosticPrinter {
23 public:
24  TextDiagnosticPrinter(llvm::raw_ostream& pOStream,
25                        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
38 private:
39  llvm::raw_ostream& m_OStream;
40  const LinkerConfig& m_Config;
41  const Input* m_pInput;
42};
43
44}  // namespace mcld
45
46#endif  // MCLD_LD_TEXTDIAGNOSTICPRINTER_H_
47