[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineBasicBlock.h

Brian Gaeke gaeke at cs.uiuc.edu
Wed May 12 16:35:20 PDT 2004


Changes in directory llvm/include/llvm/CodeGen:

MachineBasicBlock.h updated: 1.30 -> 1.31

---
Log message:

Add a Number field w/ accessor method, for function-level unique numbering
of MBBs.

Add non-const MachineBasicBlock::getParent() accessor method.


---
Diffs of the changes:  (+8 -1)

Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h
diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.30 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.31
--- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.30	Sat May  1 20:04:52 2004
+++ llvm/include/llvm/CodeGen/MachineBasicBlock.h	Wed May 12 16:35:20 2004
@@ -63,9 +63,11 @@
   const BasicBlock *BB;
   std::vector<MachineBasicBlock *> Predecessors;
   std::vector<MachineBasicBlock *> Successors;
+  int Number;
 
 public:
-  MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb) {
+  MachineBasicBlock(const BasicBlock *bb = 0) : Prev(0), Next(0), BB(bb),
+                                                Number(-1) {
     Insts.parent = this;
   }
   ~MachineBasicBlock() {}
@@ -78,6 +80,7 @@
   /// getParent - Return the MachineFunction containing this basic block.
   ///
   const MachineFunction *getParent() const;
+        MachineFunction *getParent();
 
   typedef ilist<MachineInstr>::iterator                       iterator;
   typedef ilist<MachineInstr>::const_iterator           const_iterator;
@@ -157,6 +160,10 @@
   // Debugging methods.
   void dump() const;
   void print(std::ostream &OS) const;
+
+  // MachineBasicBlocks are uniquely numbered at the function level
+  // (unless they're not in a MachineFunction yet)
+  int getNumber() const { return Number; }
 
 private:   // Methods used to maintain doubly linked list of blocks...
   friend class ilist_traits<MachineBasicBlock>;





More information about the llvm-commits mailing list