From a2f40868287ec9362f5d9f29c99d5458df87404c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 11 Aug 2006 17:46:28 +0000 Subject: [PATCH] Change one ReplaceAllUsesWith method to take an array of operands to replace instead of a vector of operands. llvm-svn: 29616 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 +++-- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index aa325b3ba405..0e7cc2ee1d50 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -81,7 +81,7 @@ namespace { std::cerr << "\nWith: "; To[0].Val->dump(&DAG); std::cerr << " and " << To.size()-1 << " other values\n"); std::vector NowDead; - DAG.ReplaceAllUsesWith(N, To, &NowDead); + DAG.ReplaceAllUsesWith(N, &To[0], &NowDead); // Push the new nodes and any users onto the worklist for (unsigned i = 0, e = To.size(); i != e; ++i) { @@ -416,7 +416,8 @@ void DAGCombiner::Run(bool RunningAfterLegalize) { std::cerr << "\nWith: "; RV.Val->dump(&DAG); std::cerr << '\n'); std::vector NowDead; - DAG.ReplaceAllUsesWith(N, std::vector(1, RV), &NowDead); + SDOperand OpV = RV; + DAG.ReplaceAllUsesWith(N, &OpV, &NowDead); // Push the new node and any users onto the worklist WorkList.push_back(RV.Val); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index c6e205744562..75a063953bff 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2441,11 +2441,9 @@ void SelectionDAG::ReplaceAllUsesWith(SDNode *From, SDNode *To, /// This version can replace From with any result values. To must match the /// number and types of values returned by From. void SelectionDAG::ReplaceAllUsesWith(SDNode *From, - const std::vector &To, + const SDOperand *To, std::vector *Deleted) { - assert(From->getNumValues() == To.size() && - "Incorrect number of values to replace with!"); - if (To.size() == 1 && To[0].Val->getNumValues() == 1) { + if (From->getNumValues() == 1 && To[0].Val->getNumValues() == 1) { // Degenerate case handled above. ReplaceAllUsesWith(SDOperand(From, 0), To[0], Deleted); return;