Added LLVM copyright header (for lack of a better term).
[oota-llvm.git] / include / llvm / Instruction.h
index 56f4ebf3aac21956454e3844072fd2664c9795c8..f23fe32ef359982d3e6ebb74421a3e3343fd7212 100644 (file)
@@ -1,4 +1,11 @@
 //===-- llvm/Instruction.h - Instruction class definition -------*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This file contains the declaration of the Instruction class, which is the
 // base class for all of the LLVM instructions.
@@ -9,6 +16,7 @@
 #define LLVM_INSTRUCTION_H
 
 #include "llvm/User.h"
+
 template<typename SC> struct ilist_traits;
 template<typename ValueSubClass, typename ItemParentClass, typename SymTabClass,
          typename SubClass> class SymbolTableListTraits;
@@ -23,17 +31,12 @@ class Instruction : public User {
   friend class SymbolTableListTraits<Instruction, BasicBlock, Function,
                                      ilist_traits<Instruction> >;
   void setParent(BasicBlock *P);
-private:
-  Instruction* cln; //the newest cloned instruction
 protected:
   unsigned iType;      // InstructionType: The opcode of the instruction
 
   Instruction(const Type *Ty, unsigned iType, const std::string &Name = "",
               Instruction *InsertBefore = 0);
 public:
-  virtual ~Instruction() {
-    assert(Parent == 0 && "Instruction still embedded in basic block!");
-  }
 
   // Specialize setName to handle symbol table majik...
   virtual void setName(const std::string &name, SymbolTable *ST = 0);
@@ -44,9 +47,7 @@ public:
   ///   * The instruction has no name
   ///
   virtual Instruction *clone() const = 0;
-  Instruction * getClone(){return cln;}
-  void          setClone(Instruction* _cln){cln=_cln;}
-  void          clearClone(){cln=NULL;}
+  
   // Accessor methods...
   //
   inline const BasicBlock *getParent() const { return Parent; }
@@ -82,7 +83,7 @@ public:
 
   /// isAssociative - Return true if the instruction is associative:
   ///
-  ///   Associative operators satisfy:  x op (y op z) === (x op y) op z)
+  ///   Associative operators satisfy:  x op (y op z) === (x op y) op z
   ///
   /// In LLVM, the Add, Mul, And, Or, and Xor operators are associative, when
   /// not applied to floating point types.
@@ -92,7 +93,7 @@ public:
 
   /// isCommutative - Return true if the instruction is commutative:
   ///
-  ///   Commutative operators satistify: (x op y) === (y op x)
+  ///   Commutative operators satisfy: (x op y) === (y op x)
   ///
   /// In LLVM, these are the associative operators, plus SetEQ and SetNE, when
   /// applied to any type.
@@ -100,7 +101,13 @@ public:
   bool isCommutative() const { return isCommutative(getOpcode()); }
   static bool isCommutative(unsigned op);
 
-
+  /// isTrappingInstruction - Return true if the instruction may trap.
+  ///
+  bool isTrapping() const {
+    return isTrapping(getOpcode()); 
+  }
+  static bool isTrapping(unsigned op);
+  
   virtual void print(std::ostream &OS) const;
 
   /// Methods for support type inquiry through isa, cast, and dyn_cast: