[llvm-commits] CVS: llvm/utils/TableGen/CodeGenTarget.h

Chris Lattner lattner at cs.uiuc.edu
Wed Sep 14 11:03:05 PDT 2005



Changes in directory llvm/utils/TableGen:

CodeGenTarget.h updated: 1.18 -> 1.19
---
Log message:

add an accessor


---
Diffs of the changes:  (+6 -0)

 CodeGenTarget.h |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/utils/TableGen/CodeGenTarget.h
diff -u llvm/utils/TableGen/CodeGenTarget.h:1.18 llvm/utils/TableGen/CodeGenTarget.h:1.19
--- llvm/utils/TableGen/CodeGenTarget.h:1.18	Thu Sep  8 16:43:21 2005
+++ llvm/utils/TableGen/CodeGenTarget.h	Wed Sep 14 13:02:53 2005
@@ -103,6 +103,12 @@
     return Instructions;
   }
 
+  CodeGenInstruction &getInstruction(const std::string &Name) const {
+    const std::map<std::string, CodeGenInstruction> &Insts = getInstructions();
+    assert(Insts.count(Name) && "Not an instruction!");
+    return const_cast<CodeGenInstruction&>(Insts.find(Name)->second);
+  }
+
   typedef std::map<std::string,
                    CodeGenInstruction>::const_iterator inst_iterator;
   inst_iterator inst_begin() const { return getInstructions().begin(); }






More information about the llvm-commits mailing list