Add a MachineBasicBlock::getParent() method

llvm-svn: 11622
This commit is contained in:
Chris Lattner
2004-02-19 16:13:54 +00:00
parent 3562c2dd9f
commit d23a882f2f
2 changed files with 14 additions and 6 deletions

View File

@@ -12,15 +12,19 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/BasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "Support/LeakDetector.h"
#include <iostream>
using namespace llvm;
const MachineFunction *MachineBasicBlock::getParent() const {
// Get the parent by getting the Function parent of the basic block, and
// getting the MachineFunction from it.
return &MachineFunction::get(getBasicBlock()->getParent());
}
MachineInstr* ilist_traits<MachineInstr>::createNode()
{
MachineInstr* dummy = new MachineInstr(0, 0);