1affc150dc44fab1911775a49636d0ce85333b634Zonr Chang//===- DiagnosticInfo.h ---------------------------------------------------===//
2affc150dc44fab1911775a49636d0ce85333b634Zonr Chang//
3affc150dc44fab1911775a49636d0ce85333b634Zonr Chang//                     The MCLinker Project
4affc150dc44fab1911775a49636d0ce85333b634Zonr Chang//
5affc150dc44fab1911775a49636d0ce85333b634Zonr Chang// This file is distributed under the University of Illinois Open Source
6affc150dc44fab1911775a49636d0ce85333b634Zonr Chang// License. See LICENSE.TXT for details.
7affc150dc44fab1911775a49636d0ce85333b634Zonr Chang//
8affc150dc44fab1911775a49636d0ce85333b634Zonr Chang//===----------------------------------------------------------------------===//
937b74a387bb3993387029859c2d9d051c41c724eStephen Hines#ifndef MCLD_LD_DIAGNOSTICINFOS_H_
1037b74a387bb3993387029859c2d9d051c41c724eStephen Hines#define MCLD_LD_DIAGNOSTICINFOS_H_
1137b74a387bb3993387029859c2d9d051c41c724eStephen Hines
12affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#include <llvm/ADT/StringRef.h>
13affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
14affc150dc44fab1911775a49636d0ce85333b634Zonr Changnamespace mcld {
15affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
16affc150dc44fab1911775a49636d0ce85333b634Zonr Changnamespace diag {
1737b74a387bb3993387029859c2d9d051c41c724eStephen Hinesenum ID {
18affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#define DIAG(ENUM, CLASS, ADDRMSG, LINEMSG) ENUM,
1987f34658dec9097d987d254a990ea7f311bfc95fStephen Hines#include "mcld/LD/DiagAttribute.inc"
20affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#include "mcld/LD/DiagCommonKinds.inc"
21affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#include "mcld/LD/DiagReaders.inc"
22affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#include "mcld/LD/DiagSymbolResolutions.inc"
23affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#include "mcld/LD/DiagRelocations.inc"
24affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#include "mcld/LD/DiagLayouts.inc"
25affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#include "mcld/LD/DiagGOTPLT.inc"
2687f34658dec9097d987d254a990ea7f311bfc95fStephen Hines#include "mcld/LD/DiagLDScript.inc"
27b0d0eb206527b43c771933602e147bbd7b471082Stephen Hines#include "mcld/LD/DiagMips.inc"
28affc150dc44fab1911775a49636d0ce85333b634Zonr Chang#undef DIAG
2937b74a387bb3993387029859c2d9d051c41c724eStephen Hines  NUM_OF_BUILDIN_DIAGNOSTIC_INFO
3037b74a387bb3993387029859c2d9d051c41c724eStephen Hines};
3137b74a387bb3993387029859c2d9d051c41c724eStephen Hines}  // namespace diag
32affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
33affc150dc44fab1911775a49636d0ce85333b634Zonr Changclass DiagnosticEngine;
3437b74a387bb3993387029859c2d9d051c41c724eStephen Hinesclass LinkerConfig;
35affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
36affc150dc44fab1911775a49636d0ce85333b634Zonr Chang/** \class DiagnosticInfos
37affc150dc44fab1911775a49636d0ce85333b634Zonr Chang *  \brief DiagnosticInfos caches run-time information of DiagnosticInfo.
38affc150dc44fab1911775a49636d0ce85333b634Zonr Chang */
3937b74a387bb3993387029859c2d9d051c41c724eStephen Hinesclass DiagnosticInfos {
4037b74a387bb3993387029859c2d9d051c41c724eStephen Hines public:
4137b74a387bb3993387029859c2d9d051c41c724eStephen Hines  explicit DiagnosticInfos(const LinkerConfig& pConfig);
42affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
43affc150dc44fab1911775a49636d0ce85333b634Zonr Chang  ~DiagnosticInfos();
44affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
45affc150dc44fab1911775a49636d0ce85333b634Zonr Chang  llvm::StringRef getDescription(unsigned int pID, bool pLoC) const;
46affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
47affc150dc44fab1911775a49636d0ce85333b634Zonr Chang  bool process(DiagnosticEngine& pEngine) const;
48affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
4937b74a387bb3993387029859c2d9d051c41c724eStephen Hines private:
5022add6ff3426df1a85089fe6a6e1597ee3b6f300Shih-wei Liao  const LinkerConfig& m_Config;
51affc150dc44fab1911775a49636d0ce85333b634Zonr Chang};
52affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
5337b74a387bb3993387029859c2d9d051c41c724eStephen Hines}  // namespace mcld
54affc150dc44fab1911775a49636d0ce85333b634Zonr Chang
5537b74a387bb3993387029859c2d9d051c41c724eStephen Hines#endif  // MCLD_LD_DIAGNOSTICINFOS_H_
56