aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/IR/Instruction.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/IR/Instruction.cpp b/lib/IR/Instruction.cpp
index 42df5d7118..2b5a0b39c3 100644
--- a/lib/IR/Instruction.cpp
+++ b/lib/IR/Instruction.cpp
@@ -455,14 +455,18 @@ bool Instruction::mayWriteToMemory() const {
}
}
-/// mayThrow - Return true if this instruction may throw an exception.
-///
bool Instruction::mayThrow() const {
if (const CallInst *CI = dyn_cast<CallInst>(this))
return !CI->doesNotThrow();
return isa<ResumeInst>(this);
}
+bool Instruction::mayReturn() const {
+ if (const CallInst *CI = dyn_cast<CallInst>(this))
+ return !CI->doesNotReturn();
+ return true;
+}
+
/// isAssociative - Return true if the instruction is associative:
///
/// Associative operators satisfy: x op (y op z) === (x op y) op z