mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Make the spliceFrom case where one graph is completely empty be constant time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20825 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5734e4331e
commit
ce7068d378
@ -1321,8 +1321,12 @@ void DSGraph::spliceFrom(DSGraph &RHS) {
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user