[llvm-commits] CVS: llvm/include/llvm/Analysis/DSNode.h
Chris Lattner
lattner at cs.uiuc.edu
Sun Nov 10 00:49:00 PST 2002
Changes in directory llvm/include/llvm/Analysis:
DSNode.h updated: 1.13 -> 1.14
---
Log message:
Implement swapping
---
Diffs of the changes:
Index: llvm/include/llvm/Analysis/DSNode.h
diff -u llvm/include/llvm/Analysis/DSNode.h:1.13 llvm/include/llvm/Analysis/DSNode.h:1.14
--- llvm/include/llvm/Analysis/DSNode.h:1.13 Fri Nov 8 18:48:52 2002
+++ llvm/include/llvm/Analysis/DSNode.h Sun Nov 10 00:48:24 2002
@@ -271,4 +271,19 @@
*this = Node;
}
+inline void DSNodeHandle::swap(DSNodeHandle &NH) {
+ std::swap(Offset, NH.Offset);
+ if (N != NH.N) {
+ if (N) {
+ N->removeReferrer(this);
+ N->addReferrer(&NH);
+ }
+ if (NH.N) {
+ N->removeReferrer(&NH);
+ N->addReferrer(this);
+ }
+ std::swap(N, NH.N);
+ }
+}
+
#endif
More information about the llvm-commits
mailing list