mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Added MachineFunction parent* to MachineBasicBlock. Customized ilist template
to set the parent when a MachineBasicBlock is added to a MachineFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -24,6 +24,8 @@
|
||||
#include "llvm/Target/TargetFrameInfo.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/iOther.h"
|
||||
#include "Support/LeakDetector.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
static AnnotationID MF_AID(
|
||||
@ -84,6 +86,22 @@ FunctionPass *llvm::createMachineCodeDeleter() {
|
||||
//===---------------------------------------------------------------------===//
|
||||
// MachineFunction implementation
|
||||
//===---------------------------------------------------------------------===//
|
||||
MachineBasicBlock* ilist_traits<MachineBasicBlock>::createNode()
|
||||
{
|
||||
MachineBasicBlock* dummy = new MachineBasicBlock();
|
||||
LeakDetector::removeGarbageObject(dummy);
|
||||
return dummy;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
MachineFunction::MachineFunction(const Function *F,
|
||||
const TargetMachine &TM)
|
||||
@ -92,6 +110,7 @@ MachineFunction::MachineFunction(const Function *F,
|
||||
MFInfo = new MachineFunctionInfo(*this);
|
||||
FrameInfo = new MachineFrameInfo();
|
||||
ConstantPool = new MachineConstantPool();
|
||||
BasicBlocks.parent = this;
|
||||
}
|
||||
|
||||
MachineFunction::~MachineFunction() {
|
||||
|
Reference in New Issue
Block a user