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