From: Chris Lattner Date: Tue, 8 Nov 2005 23:32:44 +0000 (+0000) Subject: Allocate the right amount of memory for this vector up front. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0d902a9c740bdaa57396547f26a02c234752c579;p=oota-llvm.git Allocate the right amount of memory for this vector up front. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24252 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index e17a9080cc3..eb057548391 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -409,6 +409,7 @@ void SelectionDAGLegalize::LegalizeDAG() { // node is only legalized after all of its operands are legalized. std::map Visited; std::vector Order; + Order.reserve(DAG.allnodes_end()-DAG.allnodes_begin()); // Compute ordering from all of the leaves in the graphs, those (like the // entry node) that have no operands.