[llvm-commits] CVS: llvm/lib/VMCore/Instruction.cpp

Tanya Brethour tbrethou at niobe.cs.uiuc.edu
Wed Jul 30 23:07:05 PDT 2003


Changes in directory llvm/lib/VMCore:

Instruction.cpp updated: 1.22 -> 1.23

---
Log message:

Added function to determine if an Instruction may trap.


---
Diffs of the changes:

Index: llvm/lib/VMCore/Instruction.cpp
diff -u llvm/lib/VMCore/Instruction.cpp:1.22 llvm/lib/VMCore/Instruction.cpp:1.23
--- llvm/lib/VMCore/Instruction.cpp:1.22	Wed May  7 21:44:12 2003
+++ llvm/lib/VMCore/Instruction.cpp	Wed Jul 30 23:05:36 2003
@@ -137,3 +137,20 @@
     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;
+  }
+}





More information about the llvm-commits mailing list