[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h

Nate Begeman natebegeman at mac.com
Wed Aug 17 16:45:06 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGNodes.h updated: 1.56 -> 1.57
---
Log message:

Add two new methods isTargetOpcode() which returns true if the node type
is greater than the range of building selection dag node types, and
getTargetOpcode(), which returns the node opcode less the value of
isd::builtin_op_end, which specifies the end of the builtin types.


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

 SelectionDAGNodes.h |   13 +++++++++++++
 1 files changed, 13 insertions(+)


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.56 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.57
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.56	Wed Aug 17 15:08:02 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Wed Aug 17 18:44:54 2005
@@ -428,6 +428,8 @@
   inline unsigned getNodeDepth() const;
   inline unsigned getNumOperands() const;
   inline const SDOperand &getOperand(unsigned i) const;
+  inline bool isTargetOpcode() const;
+  inline unsigned getTargetOpcode() const;
 
   /// hasOneUse - Return true if there is exactly one operation using this
   /// result value of the defining operator.
@@ -480,6 +482,11 @@
   //  Accessors
   //
   unsigned getOpcode()  const { return NodeType; }
+  bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; }
+  unsigned getTargetOpcode() const {
+    assert(isTargetOpcode() && "Not a target opcode!");
+    return NodeType - ISD::BUILTIN_OP_END;
+  }
 
   size_t use_size() const { return Uses.size(); }
   bool use_empty() const { return Uses.empty(); }
@@ -691,6 +698,12 @@
 inline const SDOperand &SDOperand::getOperand(unsigned i) const {
   return Val->getOperand(i);
 }
+inline bool SDOperand::isTargetOpcode() const {
+  return Val->isTargetOpcode();
+}
+inline unsigned SDOperand::getTargetOpcode() const {
+  return Val->getTargetOpcode();
+}
 inline bool SDOperand::hasOneUse() const {
   return Val->hasNUsesOfValue(1, ResNo);
 }






More information about the llvm-commits mailing list