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_LD_DIAGNOSTICINFOS_H_ 10 #define MCLD_LD_DIAGNOSTICINFOS_H_ 11 12 #include <llvm/ADT/StringRef.h> 13 14 namespace mcld { 15 16 namespace diag { 17 enum ID { 18 #define DIAG(ENUM, CLASS, ADDRMSG, LINEMSG) ENUM, 19 #include "mcld/LD/DiagAttribute.inc" 20 #include "mcld/LD/DiagCommonKinds.inc" 21 #include "mcld/LD/DiagReaders.inc" 22 #include "mcld/LD/DiagSymbolResolutions.inc" 23 #include "mcld/LD/DiagRelocations.inc" 24 #include "mcld/LD/DiagLayouts.inc" 25 #include "mcld/LD/DiagGOTPLT.inc" 26 #include "mcld/LD/DiagLDScript.inc" 27 #include "mcld/LD/DiagMips.inc" 28 #undef DIAG 29 NUM_OF_BUILDIN_DIAGNOSTIC_INFO 30 }; 31 } // namespace diag 32 33 class DiagnosticEngine; 34 class LinkerConfig; 35 36 /** \class DiagnosticInfos 37 * \brief DiagnosticInfos caches run-time information of DiagnosticInfo. 38 */ 39 class DiagnosticInfos { 40 public: 41 explicit 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 49 private: 50 const LinkerConfig& m_Config; 51 }; 52 53 } // namespace mcld 54 55 #endif // MCLD_LD_DIAGNOSTICINFOS_H_ 56