From 574e7166e07ee64888faf8a60ded7855c56cf0a7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 31 Dec 2007 04:56:33 +0000 Subject: properly encapsulate the parent field of MBB and MI with get/set accessors. llvm-svn: 45469 --- llvm/lib/CodeGen/MachineFunction.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 595159b..3f2c119 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -111,12 +111,14 @@ MachineBasicBlock* ilist_traits::createSentinel() { } void ilist_traits::transferNodesFromList( - iplist >& toList, - ilist_iterator first, - ilist_iterator last) { - if (Parent != toList.Parent) - for (; first != last; ++first) - first->Parent = toList.Parent; + iplist >& toList, + ilist_iterator first, + ilist_iterator last) { + // If splicing withing the same function, no change. + if (Parent == toList.Parent) return; + + for (; first != last; ++first) + first->setParent(toList.Parent); } MachineFunction::MachineFunction(const Function *F, -- cgit v1.1