diff options
author | Craig Topper <craig.topper@intel.com> | 2018-10-08 03:12:12 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-10-08 03:12:12 +0000 |
commit | 98dd9d6896ec1ddbb8d660ad1d283345a6165339 (patch) | |
tree | 38864cec829ea4ffb960e3ce7f72517552e6454a /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | 0b5683001175f2e321c90f6608ade719c0a34fab (diff) | |
download | bcm5719-llvm-98dd9d6896ec1ddbb8d660ad1d283345a6165339.tar.gz bcm5719-llvm-98dd9d6896ec1ddbb8d660ad1d283345a6165339.zip |
Revert r343948 "[LegalizeDAG] Make one of the ReplaceNode signatures take an ArrayRef instead a pointer to an array. Add assert on size of array. NFC"
The assert is failing some asan tests on the bots.
llvm-svn: 343950
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index a54cda7904f..27875c11909 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -222,12 +222,10 @@ public: ReplacedNode(Old.getNode()); } - void ReplaceNode(SDNode *Old, ArrayRef<SDValue> New) { - assert(Old->getNumValues() == New.size() && - "Replacing with a different number of values!"); + void ReplaceNode(SDNode *Old, const SDValue *New) { LLVM_DEBUG(dbgs() << " ... replacing: "; Old->dump(&DAG)); - DAG.ReplaceAllUsesWith(Old, New.data()); + DAG.ReplaceAllUsesWith(Old, New); for (unsigned i = 0, e = Old->getNumValues(); i != e; ++i) { LLVM_DEBUG(dbgs() << (i == 0 ? " with: " : " and: "); New[i]->dump(&DAG)); @@ -1206,7 +1204,7 @@ void SelectionDAGLegalize::LegalizeOp(SDNode *Node) { for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i) ResultVals.push_back(Res.getValue(i)); LLVM_DEBUG(dbgs() << "Successfully custom legalized node\n"); - ReplaceNode(Node, ResultVals); + ReplaceNode(Node, ResultVals.data()); return; } LLVM_DEBUG(dbgs() << "Could not custom legalize node\n"); @@ -3961,7 +3959,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) { } LLVM_DEBUG(dbgs() << "Successfully expanded node\n"); - ReplaceNode(Node, Results); + ReplaceNode(Node, Results.data()); return true; } @@ -4288,7 +4286,7 @@ void SelectionDAGLegalize::ConvertNodeToLibcall(SDNode *Node) { // Replace the original node with the legalized result. if (!Results.empty()) { LLVM_DEBUG(dbgs() << "Successfully converted node to libcall\n"); - ReplaceNode(Node, Results); + ReplaceNode(Node, Results.data()); } else LLVM_DEBUG(dbgs() << "Could not convert node to libcall\n"); } @@ -4743,7 +4741,7 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node) { // Replace the original node with the legalized result. if (!Results.empty()) { LLVM_DEBUG(dbgs() << "Successfully promoted node\n"); - ReplaceNode(Node, Results); + ReplaceNode(Node, Results.data()); } else LLVM_DEBUG(dbgs() << "Could not promote node\n"); } |