MCStreamer.h: Prune \return, corresponding to r252102. [-Wdocumentation]
[oota-llvm.git] / include / llvm / MC / MCInstrInfo.h
index 9b15825c8f204908f90c24be74c6c6264231f67c..70c86587b08c5b053a20022492095184e77d9a3c 100644 (file)
 namespace llvm {
 
 //---------------------------------------------------------------------------
-///
-/// MCInstrInfo - Interface to description of machine instruction set
-///
+/// \brief Interface to description of machine instruction set.
 class MCInstrInfo {
-  const MCInstrDesc *Desc;  // Raw array to allow static init'n
-  unsigned NumOpcodes;             // Number of entries in the desc array
+  const MCInstrDesc *Desc;          // Raw array to allow static init'n
+  const unsigned *InstrNameIndices; // Array for name indices in InstrNameData
+  const char *InstrNameData;        // Instruction name string pool
+  unsigned NumOpcodes;              // Number of entries in the desc array
 
 public:
-  /// InitMCInstrInfo - Initialize MCInstrInfo, called by TableGen
-  /// auto-generated routines. *DO NOT USE*.
-  void InitMCInstrInfo(const MCInstrDesc *D, unsigned NO) {
+  /// \brief Initialize MCInstrInfo, called by TableGen auto-generated routines.
+  /// *DO NOT USE*.
+  void InitMCInstrInfo(const MCInstrDesc *D, const unsigned *NI, const char *ND,
+                       unsigned NO) {
     Desc = D;
+    InstrNameIndices = NI;
+    InstrNameData = ND;
     NumOpcodes = NO;
   }
 
   unsigned getNumOpcodes() const { return NumOpcodes; }
 
-  /// get - Return the machine instruction descriptor that corresponds to the
+  /// \brief Return the machine instruction descriptor that corresponds to the
   /// specified instruction opcode.
-  ///
   const MCInstrDesc &get(unsigned Opcode) const {
     assert(Opcode < NumOpcodes && "Invalid opcode!");
     return Desc[Opcode];
   }
+
+  /// \brief Returns the name for the instructions with the given opcode.
+  const char *getName(unsigned Opcode) const {
+    assert(Opcode < NumOpcodes && "Invalid opcode!");
+    return &InstrNameData[InstrNameIndices[Opcode]];
+  }
 };
 
 } // End llvm namespace