[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Mar 24 16:02:57 PST 2005
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructure.cpp updated: 1.234 -> 1.235
---
Log message:
Make the spliceFrom case where one graph is completely empty be constant time.
---
Diffs of the changes: (+6 -2)
DataStructure.cpp | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.234 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.235
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.234 Thu Mar 24 17:46:04 2005
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Thu Mar 24 18:02:41 2005
@@ -1321,8 +1321,12 @@
AuxFunctionCalls.splice(AuxFunctionCalls.end(), RHS.AuxFunctionCalls);
// Take all of the return nodes.
- ReturnNodes.insert(RHS.ReturnNodes.begin(), RHS.ReturnNodes.end());
- RHS.ReturnNodes.clear();
+ if (ReturnNodes.empty()) {
+ ReturnNodes.swap(RHS.ReturnNodes);
+ } else {
+ ReturnNodes.insert(RHS.ReturnNodes.begin(), RHS.ReturnNodes.end());
+ RHS.ReturnNodes.clear();
+ }
// Merge the scalar map in.
ScalarMap.spliceFrom(RHS.ScalarMap);
More information about the llvm-commits
mailing list