properly encapsulate the parent field of MBB and MI with get/set accessors.

llvm-svn: 45469
This commit is contained in:
Chris Lattner
2007-12-31 04:56:33 +00:00
parent 21ec2b4769
commit 574e7166e0
5 changed files with 53 additions and 49 deletions

View File

@@ -111,12 +111,14 @@ MachineBasicBlock* ilist_traits<MachineBasicBlock>::createSentinel() {
}
void ilist_traits<MachineBasicBlock>::transferNodesFromList(
iplist<MachineBasicBlock, ilist_traits<MachineBasicBlock> >& toList,
ilist_iterator<MachineBasicBlock> first,
ilist_iterator<MachineBasicBlock> last) {
if (Parent != toList.Parent)
for (; first != last; ++first)
first->Parent = toList.Parent;
iplist<MachineBasicBlock, ilist_traits<MachineBasicBlock> >& toList,
ilist_iterator<MachineBasicBlock> first,
ilist_iterator<MachineBasicBlock> 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,