From d23a882f2f4c16955e5f7e46ec3b4b3a2ea3de0f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 19 Feb 2004 16:13:54 +0000 Subject: Add a MachineBasicBlock::getParent() method llvm-svn: 11622 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 9360693..9d65453 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -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 - 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::createNode() { MachineInstr* dummy = new MachineInstr(0, 0); -- cgit v1.1