aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore/Instruction.cpp')
-rw-r--r--lib/VMCore/Instruction.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index ce1423a863..a1ccddf416 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -137,3 +137,20 @@ bool Instruction::isCommutative(unsigned op) {
return false;
}
}
+
+
+/// isTrappingInstruction - Return true if the instruction may trap.
+///
+bool Instruction::isTrappingInstruction(unsigned op) {
+ switch(op) {
+ case Div:
+ case Rem:
+ case Load:
+ case Store:
+ case Call:
+ case Invoke:
+ return true;
+ default:
+ return false;
+ }
+}