diff options
author | Florian Hahn <flo@fhahn.com> | 2019-01-18 10:00:38 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-01-18 10:00:38 +0000 |
commit | 1b8177232813a048407bbb43eef18d7f72794b35 (patch) | |
tree | 6355c51c0d877dd58b89c95b2860fee2400ec14b /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 2d7d4a3809cc648c83bdc1d2eff6e00d93a17825 (diff) | |
download | bcm5719-llvm-1b8177232813a048407bbb43eef18d7f72794b35.tar.gz bcm5719-llvm-1b8177232813a048407bbb43eef18d7f72794b35.zip |
[SelectionDAG] Add static getMaxNumOperands function to SDNode.
Summary:
Use this helper to make sure we use the same value at various places.
This will likely be needed at more places were we currently crash
because we use more operands than possible.
Also makes it easier to change in the future.
Reviewers: RKSimon, craig.topper, efriedma, aemerson
Reviewed By: RKSimon
Subscribers: hiraditya, arsenm, llvm-commits
Differential Revision: https://reviews.llvm.org/D56859
llvm-svn: 351537
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 647496c1afc..af81216e344 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -9266,8 +9266,7 @@ SDNode *SelectionDAG::isConstantFPBuildVectorOrConstantFP(SDValue N) { void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) { assert(!Node->OperandList && "Node already has operands"); - assert(std::numeric_limits<decltype(SDNode::NumOperands)>::max() >= - Vals.size() && + assert(SDNode::getMaxNumOperands() >= Vals.size() && "too many operands to fit into SDNode"); SDUse *Ops = OperandRecycler.allocate( ArrayRecycler<SDUse>::Capacity::get(Vals.size()), OperandAllocator); |