[llvm-commits] CVS: llvm/include/llvm/BasicBlock.h Instruction.h

Chris Lattner sabre at nondot.org
Sat Sep 30 15:20:48 PDT 2006



Changes in directory llvm/include/llvm:

BasicBlock.h updated: 1.60 -> 1.61
Instruction.h updated: 1.73 -> 1.74
---
Log message:

Override use_back in instruction/basicblock to provide more type information.


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

 BasicBlock.h  |    5 +++++
 Instruction.h |    6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/BasicBlock.h
diff -u llvm/include/llvm/BasicBlock.h:1.60 llvm/include/llvm/BasicBlock.h:1.61
--- llvm/include/llvm/BasicBlock.h:1.60	Fri Sep 22 23:03:45 2006
+++ llvm/include/llvm/BasicBlock.h	Sat Sep 30 17:20:34 2006
@@ -85,6 +85,11 @@
         BasicBlock *getPrev()       { return Prev; }
   const BasicBlock *getPrev() const { return Prev; }
 
+  /// use_back - Specialize the methods defined in Value, as we know that an
+  /// BasicBlock can only be used by Instructions (specifically PHI and terms).
+  Instruction       *use_back()       { return cast<Instruction>(*use_begin());}
+  const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
+  
   /// getTerminator() - If this is a well formed basic block, then this returns
   /// a pointer to the terminator instruction.  If it is not, then you get a
   /// null pointer back.


Index: llvm/include/llvm/Instruction.h
diff -u llvm/include/llvm/Instruction.h:1.73 llvm/include/llvm/Instruction.h:1.74
--- llvm/include/llvm/Instruction.h:1.73	Sun Sep 17 14:14:47 2006
+++ llvm/include/llvm/Instruction.h	Sat Sep 30 17:20:34 2006
@@ -71,7 +71,11 @@
   /// extra information (e.g. load is volatile) agree.
   bool isIdenticalTo(Instruction *I) const;
 
-
+  /// use_back - Specialize the methods defined in Value, as we know that an
+  /// instruction can only be used by other instructions.
+  Instruction       *use_back()       { return cast<Instruction>(*use_begin());}
+  const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
+  
   // Accessor methods...
   //
   inline const BasicBlock *getParent() const { return Parent; }






More information about the llvm-commits mailing list