bcraig updated this revision to Diff 59950. bcraig added a comment. Uploading more context.
http://reviews.llvm.org/D20933 Files: include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h lib/StaticAnalyzer/Core/CoreEngine.cpp Index: lib/StaticAnalyzer/Core/CoreEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/CoreEngine.cpp +++ lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -208,6 +208,8 @@ // Check if we have a steps limit bool UnlimitedSteps = Steps == 0; + if(!UnlimitedSteps) + G.reserve(Steps); while (WList->hasWork()) { if (!UnlimitedSteps) { Index: include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h @@ -321,6 +321,8 @@ bool empty() const { return NumNodes == 0; } unsigned size() const { return NumNodes; } + void reserve(unsigned NodeCount) { Nodes.reserve(NodeCount); } + // Iterators. typedef ExplodedNode NodeTy; typedef llvm::FoldingSet<ExplodedNode> AllNodesTy;
Index: lib/StaticAnalyzer/Core/CoreEngine.cpp =================================================================== --- lib/StaticAnalyzer/Core/CoreEngine.cpp +++ lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -208,6 +208,8 @@ // Check if we have a steps limit bool UnlimitedSteps = Steps == 0; + if(!UnlimitedSteps) + G.reserve(Steps); while (WList->hasWork()) { if (!UnlimitedSteps) { Index: include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h =================================================================== --- include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h +++ include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h @@ -321,6 +321,8 @@ bool empty() const { return NumNodes == 0; } unsigned size() const { return NumNodes; } + void reserve(unsigned NodeCount) { Nodes.reserve(NodeCount); } + // Iterators. typedef ExplodedNode NodeTy; typedef llvm::FoldingSet<ExplodedNode> AllNodesTy;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits