Add method
[oota-llvm.git] / include / llvm / Instruction.h
index 85f6cdb0b144ccc0bf8d17a043e16a736ac5b4e7..a7359731db7d513f77bd136acbb5efda4452c6d6 100644 (file)
@@ -57,12 +57,22 @@ public:
   // Specialize setName to handle symbol table majik...
   virtual void setName(const std::string &name, SymbolTable *ST = 0);
   
+  /// mayWriteToMemory - Return true if this instruction may modify memory.
+  ///
+  virtual bool mayWriteToMemory() const { return false; }
+
   /// clone() - Create a copy of 'this' instruction that is identical in all
   /// ways except the following:
   ///   * The instruction has no parent
   ///   * The instruction has no name
   ///
   virtual Instruction *clone() const = 0;
+
+  /// isIdenticalTo - Return true if the specified instruction is exactly
+  /// identical to the current one.  This means that all operands match and any
+  /// extra information (e.g. load is volatile) agree.
+  bool isIdenticalTo(Instruction *I) const;
+
   
   // Accessor methods...
   //
@@ -76,9 +86,15 @@ public:
         Instruction *getPrev()       { return Prev; }
   const Instruction *getPrev() const { return Prev; }
 
-  /// mayWriteToMemory - Return true if this instruction may modify memory.
+  /// removeFromParent - This method unlinks 'this' from the containing basic
+  /// block, but does not delete it.
   ///
-  virtual bool mayWriteToMemory() const { return false; }
+  void removeFromParent();
+
+  /// eraseFromParent - This method unlinks 'this' from the containing basic
+  /// block and deletes it.
+  ///
+  void eraseFromParent();
 
   // ---------------------------------------------------------------------------
   /// Subclass classification... getOpcode() returns a member of