mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 08:26:02 +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:
@@ -1321,8 +1321,12 @@ void DSGraph::spliceFrom(DSGraph &RHS) {
|
|||||||
AuxFunctionCalls.splice(AuxFunctionCalls.end(), RHS.AuxFunctionCalls);
|
AuxFunctionCalls.splice(AuxFunctionCalls.end(), RHS.AuxFunctionCalls);
|
||||||
|
|
||||||
// Take all of the return nodes.
|
// Take all of the return nodes.
|
||||||
ReturnNodes.insert(RHS.ReturnNodes.begin(), RHS.ReturnNodes.end());
|
if (ReturnNodes.empty()) {
|
||||||
RHS.ReturnNodes.clear();
|
ReturnNodes.swap(RHS.ReturnNodes);
|
||||||
|
} else {
|
||||||
|
ReturnNodes.insert(RHS.ReturnNodes.begin(), RHS.ReturnNodes.end());
|
||||||
|
RHS.ReturnNodes.clear();
|
||||||
|
}
|
||||||
|
|
||||||
// Merge the scalar map in.
|
// Merge the scalar map in.
|
||||||
ScalarMap.spliceFrom(RHS.ScalarMap);
|
ScalarMap.spliceFrom(RHS.ScalarMap);
|
||||||
|
Reference in New Issue
Block a user