It's operation already exists manually in many places without using the method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293421
91177308-0d34-0410-b5e6-
96231b3b80d8
unsigned getNumOperands() const { return NumOperands; }
/// Helper method returns the integer value of a ConstantSDNode operand.
- uint64_t getConstantOperandVal(unsigned Num) const;
+ inline uint64_t getConstantOperandVal(unsigned Num) const;
const SDValue &getOperand(unsigned Num) const {
assert(Num < NumOperands && "Invalid child # of SDNode!");
}
};
+uint64_t SDNode::getConstantOperandVal(unsigned Num) const {
+ return cast<ConstantSDNode>(getOperand(Num))->getZExtValue();
+}
+
class ConstantFPSDNode : public SDNode {
const ConstantFP *Value;
return hasPredecessorHelper(N, Visited, Worklist);
}
-uint64_t SDNode::getConstantOperandVal(unsigned Num) const {
- assert(Num < NumOperands && "Invalid child # of SDNode!");
- return cast<ConstantSDNode>(OperandList[Num])->getZExtValue();
-}
-
const SDNodeFlags *SDNode::getFlags() const {
if (auto *FlagsNode = dyn_cast<BinaryWithFlagsSDNode>(this))
return &FlagsNode->Flags;