hasSideEffects should be marked virtual
authorChris Lattner <sabre@nondot.org>
Mon, 9 Jul 2001 19:38:26 +0000 (19:38 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 9 Jul 2001 19:38:26 +0000 (19:38 +0000)
stores and free's have sideeffects

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instruction.h
include/llvm/iMemory.h

index 031730a9759b12d10ebcd06534162866c3889b87..25be14fbd21969ce1011ffe3116d7b5f6b1b5768 100644 (file)
@@ -39,7 +39,7 @@ public:
   //
   inline const BasicBlock *getParent() const { return Parent; }
   inline       BasicBlock *getParent()       { return Parent; }
-  bool hasSideEffects() const { return false; }  // Memory & Call insts = true
+  virtual bool hasSideEffects() const { return false; }  // Memory & Call insts
 
   // ---------------------------------------------------------------------------
   // Subclass classification... getInstType() returns a member of 
index feed3a2f8837951b417b1fae4617ea5757674ab0..fe045d72667356f9bb1d676eace3e7c2593906b9 100644 (file)
@@ -95,6 +95,8 @@ public:
   virtual Instruction *clone() const { return new FreeInst(Operands[0]); }
 
   virtual const char *getOpcodeName() const { return "free"; }
+
+  virtual bool hasSideEffects() const { return true; }
 };
 
 
@@ -155,6 +157,8 @@ public:
            const string &Name = "");
   virtual Instruction *clone() const { return new StoreInst(*this); }
   virtual const char *getOpcodeName() const { return "store"; }  
+
+  virtual bool hasSideEffects() const { return true; }
 };