diff options
| author | Duncan Sands <baldrick@free.fr> | 2009-05-06 06:49:50 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2009-05-06 06:49:50 +0000 |
| commit | 1efabaaa2ad2a90bb2fe7f79461353b5f1ea63e8 (patch) | |
| tree | 719834c43dbeab5fa7413c1e2a259167fc6307b0 /llvm/include | |
| parent | 51f57a419581f772fb06e4c27128e702373177d9 (diff) | |
| download | bcm5719-llvm-1efabaaa2ad2a90bb2fe7f79461353b5f1ea63e8.tar.gz bcm5719-llvm-1efabaaa2ad2a90bb2fe7f79461353b5f1ea63e8.zip | |
Allow readonly functions to unwind exceptions. Teach
the optimizers about this. For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.
llvm-svn: 71071
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Instruction.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/llvm/include/llvm/Instruction.h b/llvm/include/llvm/Instruction.h index 0a39b08461d..7d946e85a6d 100644 --- a/llvm/include/llvm/Instruction.h +++ b/llvm/include/llvm/Instruction.h @@ -40,14 +40,6 @@ public: // Out of line virtual method, so the vtable, etc has a home. ~Instruction(); - /// mayWriteToMemory - Return true if this instruction may modify memory. - /// - bool mayWriteToMemory() const; - - /// mayReadFromMemory - Return true if this instruction may read memory. - /// - bool mayReadFromMemory() const; - /// clone() - Create a copy of 'this' instruction that is identical in all /// ways except the following: /// * The instruction has no parent @@ -181,6 +173,24 @@ public: } static bool isTrapping(unsigned op); + /// mayWriteToMemory - Return true if this instruction may modify memory. + /// + bool mayWriteToMemory() const; + + /// mayReadFromMemory - Return true if this instruction may read memory. + /// + bool mayReadFromMemory() const; + + /// mayThrow - Return true if this instruction may throw an exception. + /// + bool mayThrow() const; + + /// mayHaveSideEffects - Return true if the instruction may have side effects. + /// + bool mayHaveSideEffects() const { + return mayWriteToMemory() || mayThrow(); + } + /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const Instruction *) { return true; } static inline bool classof(const Value *V) { |

