diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h index 031730a9759..25be14fbd21 100644 --- a/include/llvm/Instruction.h +++ b/include/llvm/Instruction.h @@ -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 diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h index feed3a2f883..fe045d72667 100644 --- a/include/llvm/iMemory.h +++ b/include/llvm/iMemory.h @@ -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; } };