[llvm-commits] CVS: llvm/lib/CodeGen/MachineBasicBlock.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Feb 19 10:14:01 PST 2004


Changes in directory llvm/lib/CodeGen:

MachineBasicBlock.cpp updated: 1.6 -> 1.7

---
Log message:

Add a MachineBasicBlock::getParent() method


---
Diffs of the changes:  (+7 -3)

Index: llvm/lib/CodeGen/MachineBasicBlock.cpp
diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.6 llvm/lib/CodeGen/MachineBasicBlock.cpp:1.7
--- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.6	Mon Feb 16 01:17:42 2004
+++ llvm/lib/CodeGen/MachineBasicBlock.cpp	Thu Feb 19 10:13:39 2004
@@ -12,14 +12,18 @@
 //===----------------------------------------------------------------------===//
 
 #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()
 {





More information about the llvm-commits mailing list