From: Craig Topper Date: Sun, 29 Jan 2017 06:08:02 +0000 (+0000) Subject: [SelectionDAG] Make SDNode::getConstantOperandVal an inline method. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=544a997a27b37e7ee1de2a32f043674485f3a7b0;p=llvm [SelectionDAG] Make SDNode::getConstantOperandVal an inline method. 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 --- diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index b6f5424dbbd..a512c44e4ba 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -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(getOperand(Num))->getZExtValue(); +} + class ConstantFPSDNode : public SDNode { const ConstantFP *Value; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 5a82ff1e3ab..4227aa7ab12 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -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(OperandList[Num])->getZExtValue(); -} - const SDNodeFlags *SDNode::getFlags() const { if (auto *FlagsNode = dyn_cast(this)) return &FlagsNode->Flags;