DiagnosticInfos.h revision 22add6ff3426df1a85089fe6a6e1597ee3b6f300
1//===- DiagnosticInfo.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_DIAGNOSTIC_INFORMATION_H
10#define MCLD_DIAGNOSTIC_INFORMATION_H
11#ifdef ENABLE_UNITTEST
12#include <gtest.h>
13#endif
14#include <llvm/ADT/StringRef.h>
15
16namespace mcld {
17
18namespace diag {
19  enum ID {
20#define DIAG(ENUM, CLASS, ADDRMSG, LINEMSG) ENUM,
21#include "mcld/LD/DiagCommonKinds.inc"
22#include "mcld/LD/DiagReaders.inc"
23#include "mcld/LD/DiagSymbolResolutions.inc"
24#include "mcld/LD/DiagRelocations.inc"
25#include "mcld/LD/DiagLayouts.inc"
26#include "mcld/LD/DiagGOTPLT.inc"
27#undef DIAG
28    NUM_OF_BUILDIN_DIAGNOSTIC_INFO
29  };
30} // namespace of diag
31
32class LinkerConfig;
33class DiagnosticEngine;
34
35/** \class DiagnosticInfos
36 *  \brief DiagnosticInfos caches run-time information of DiagnosticInfo.
37 */
38class DiagnosticInfos
39{
40public:
41  DiagnosticInfos(const LinkerConfig& pConfig);
42
43  ~DiagnosticInfos();
44
45  llvm::StringRef getDescription(unsigned int pID, bool pLoC) const;
46
47  bool process(DiagnosticEngine& pEngine) const;
48
49private:
50  const LinkerConfig& m_Config;
51};
52
53} // namespace of mcld
54
55#endif
56
57