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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nate Begeman 2005-08-17 23:44:54 +00:00
parent 8385e51e21
commit 0f66a91721

View File

@ -428,6 +428,8 @@ public:
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 @@ public:
// 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 unsigned SDOperand::getNumOperands() const {
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);
}