mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Implement swapping
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4674 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a3590f2496
commit
5c533ae837
@ -271,4 +271,19 @@ inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) {
|
||||
*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
|
||||
|
@ -271,4 +271,19 @@ inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) {
|
||||
*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
|
||||
|
Loading…
x
Reference in New Issue
Block a user