aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-19 16:13:54 +0000
committerChris Lattner <sabre@nondot.org>2004-02-19 16:13:54 +0000
commit5e61fa95196b85281eec655787e9c73267532bd1 (patch)
tree5571834e7eeec045638ab62c24cb1bcc0eb82fd7 /lib/CodeGen/MachineBasicBlock.cpp
parent1d29a6d6c7a7f6203065c003d3d2d002870e38a1 (diff)
Add a MachineBasicBlock::getParent() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp
index 9360693186..9d65453edf 100644
--- a/lib/CodeGen/MachineBasicBlock.cpp
+++ b/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 <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);