summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instruction.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-07-10 07:00:44 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-07-10 07:00:44 +0000
commitae2ffc8a8c825acf46f58f20dc7d0ae5fecbdd0b (patch)
treebba694cd7ab6a7a5eb4aca757ebfc3b38b1e949d /llvm/lib/IR/Instruction.cpp
parent83505347724a3eeb42f66a0b58fb8ff5c4c9ea4c (diff)
downloadbcm5719-llvm-ae2ffc8a8c825acf46f58f20dc7d0ae5fecbdd0b.tar.gz
bcm5719-llvm-ae2ffc8a8c825acf46f58f20dc7d0ae5fecbdd0b.zip
New EH representation for MSVC compatibility
Summary: This introduces new instructions neccessary to implement MSVC-compatible exception handling support. Most of the middle-end and none of the back-end haven't been audited or updated to take them into account. Reviewers: rnk, JosephTremoulet, reames, nlewycky, rjmccall Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11041 llvm-svn: 241888
Diffstat (limited to 'llvm/lib/IR/Instruction.cpp')
-rw-r--r--llvm/lib/IR/Instruction.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index c57ba16cf6c..124bf089321 100644
--- a/llvm/lib/IR/Instruction.cpp
+++ b/llvm/lib/IR/Instruction.cpp
@@ -196,6 +196,11 @@ const char *Instruction::getOpcodeName(unsigned OpCode) {
case Invoke: return "invoke";
case Resume: return "resume";
case Unreachable: return "unreachable";
+ case CleanupRet: return "cleanupret";
+ case CatchEndBlock: return "catchendblock";
+ case CatchRet: return "catchret";
+ case CatchBlock: return "catchblock";
+ case TerminateBlock: return "terminateblock";
// Standard binary operators...
case Add: return "add";
@@ -256,6 +261,7 @@ const char *Instruction::getOpcodeName(unsigned OpCode) {
case ExtractValue: return "extractvalue";
case InsertValue: return "insertvalue";
case LandingPad: return "landingpad";
+ case CleanupBlock: return "cleanupblock";
default: return "<Invalid operator> ";
}
@@ -407,6 +413,8 @@ bool Instruction::mayReadFromMemory() const {
case Instruction::Fence: // FIXME: refine definition of mayReadFromMemory
case Instruction::AtomicCmpXchg:
case Instruction::AtomicRMW:
+ case Instruction::CatchRet:
+ case Instruction::TerminateBlock:
return true;
case Instruction::Call:
return !cast<CallInst>(this)->doesNotAccessMemory();
@@ -427,6 +435,8 @@ bool Instruction::mayWriteToMemory() const {
case Instruction::VAArg:
case Instruction::AtomicCmpXchg:
case Instruction::AtomicRMW:
+ case Instruction::CatchRet:
+ case Instruction::TerminateBlock:
return true;
case Instruction::Call:
return !cast<CallInst>(this)->onlyReadsMemory();
@@ -455,6 +465,10 @@ bool Instruction::isAtomic() const {
bool Instruction::mayThrow() const {
if (const CallInst *CI = dyn_cast<CallInst>(this))
return !CI->doesNotThrow();
+ if (const auto *CRI = dyn_cast<CleanupReturnInst>(this))
+ return CRI->unwindsToCaller();
+ if (const auto *CEBI = dyn_cast<CatchEndBlockInst>(this))
+ return CEBI->unwindsToCaller();
return isa<ResumeInst>(this);
}
OpenPOWER on IntegriCloud