summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instruction.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-07-31 17:58:14 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-07-31 17:58:14 +0000
commit654e130b6ec76c1a2910b2594cb403ecd2773af8 (patch)
tree79a53c08a138345e3cdd13b36940d3d1cf6f5917 /llvm/lib/IR/Instruction.cpp
parente430654fd85a04f04c93eab40ba7fe87d8657130 (diff)
downloadbcm5719-llvm-654e130b6ec76c1a2910b2594cb403ecd2773af8.tar.gz
bcm5719-llvm-654e130b6ec76c1a2910b2594cb403ecd2773af8.zip
New EH representation for MSVC compatibility
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. Differential Revision: http://reviews.llvm.org/D11097 llvm-svn: 243766
Diffstat (limited to 'llvm/lib/IR/Instruction.cpp')
-rw-r--r--llvm/lib/IR/Instruction.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index c57ba16cf6c..85173d96562 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 CatchEndPad: return "catchendpad";
+ case CatchRet: return "catchret";
+ case CatchPad: return "catchpad";
+ case TerminatePad: return "terminatepad";
// 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 CleanupPad: return "cleanuppad";
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::TerminatePad:
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::TerminatePad:
return true;
case Instruction::Call:
return !cast<CallInst>(this)->onlyReadsMemory();
@@ -455,6 +465,12 @@ 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 *CEPI = dyn_cast<CatchEndPadInst>(this))
+ return CEPI->unwindsToCaller();
+ if (const auto *TPI = dyn_cast<TerminatePadInst>(this))
+ return TPI->unwindsToCaller();
return isa<ResumeInst>(this);
}
OpenPOWER on IntegriCloud