summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2003-07-31 04:05:50 +0000
committerTanya Lattner <tonic@nondot.org>2003-07-31 04:05:50 +0000
commita93c7aeb7eee9ac7c18a289941256f6eb5fa5cd7 (patch)
tree6994b86bdcef27aca4e2e806096ba4678e19618d /llvm/lib
parent2b3ac6be6a7e0c1554daf72c8e77515109400465 (diff)
downloadbcm5719-llvm-a93c7aeb7eee9ac7c18a289941256f6eb5fa5cd7.tar.gz
bcm5719-llvm-a93c7aeb7eee9ac7c18a289941256f6eb5fa5cd7.zip
Added function to determine if an Instruction may trap.
llvm-svn: 7442
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Instruction.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index ce1423a8631..a1ccddf4161 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/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;
+ }
+}
OpenPOWER on IntegriCloud