forked from OSchip/llvm-project
[SelectionDAG] Make SDNode::getConstantOperandVal an inline method.
It's operation already exists manually in many places without using the method. llvm-svn: 293421
This commit is contained in:
parent
b130469bc9
commit
135da1faf5
|
@ -741,7 +741,7 @@ public:
|
|||
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!");
|
||||
|
@ -1396,6 +1396,10 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
uint64_t SDNode::getConstantOperandVal(unsigned Num) const {
|
||||
return cast<ConstantSDNode>(getOperand(Num))->getZExtValue();
|
||||
}
|
||||
|
||||
class ConstantFPSDNode : public SDNode {
|
||||
const ConstantFP *Value;
|
||||
|
||||
|
|
|
@ -7159,11 +7159,6 @@ bool SDNode::hasPredecessor(const SDNode *N) const {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue