summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-16 18:06:43 +0000
committerChris Lattner <sabre@nondot.org>2004-10-16 18:06:43 +0000
commit38a696989404572903bfe5c86b206fd33d3d919d (patch)
treeb4b93a684811126296a903b8efb5e541c13cda15 /llvm
parentbcf508cf6fbd1466535181f487e935b70bc1bc28 (diff)
downloadbcm5719-llvm-38a696989404572903bfe5c86b206fd33d3d919d.tar.gz
bcm5719-llvm-38a696989404572903bfe5c86b206fd33d3d919d.zip
Add support for the unreachable instruction
llvm-svn: 17039
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/InstVisitor.h1
-rw-r--r--llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h7
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/InstVisitor.h b/llvm/include/llvm/Support/InstVisitor.h
index c8e7cf98d05..a9b3b715065 100644
--- a/llvm/include/llvm/Support/InstVisitor.h
+++ b/llvm/include/llvm/Support/InstVisitor.h
@@ -156,6 +156,7 @@ struct InstVisitor {
RetTy visitSwitchInst(SwitchInst &I) { DELEGATE(TerminatorInst);}
RetTy visitInvokeInst(InvokeInst &I) { DELEGATE(TerminatorInst);}
RetTy visitUnwindInst(UnwindInst &I) { DELEGATE(TerminatorInst);}
+ RetTy visitUnreachableInst(UnreachableInst &I) { DELEGATE(TerminatorInst);}
RetTy visitSetCondInst(SetCondInst &I) { DELEGATE(BinaryOperator);}
RetTy visitMallocInst(MallocInst &I) { DELEGATE(AllocationInst);}
RetTy visitAllocaInst(AllocaInst &I) { DELEGATE(AllocationInst);}
diff --git a/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
index 590d51034bd..6202f85792e 100644
--- a/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
+++ b/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
@@ -23,18 +23,19 @@
namespace llvm {
struct UnifyFunctionExitNodes : public FunctionPass {
- BasicBlock *ReturnBlock, *UnwindBlock;
+ BasicBlock *ReturnBlock, *UnwindBlock, *UnreachableBlock;
public:
UnifyFunctionExitNodes() : ReturnBlock(0), UnwindBlock(0) {}
// We can preserve non-critical-edgeness when we unify function exit nodes
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- // getReturn|UnwindBlock - Return the new single (or nonexistant) return or
- // unwind basic blocks in the CFG.
+ // getReturn|Unwind|UnreachableBlock - Return the new single (or nonexistant)
+ // return, unwind, or unreachable basic blocks in the CFG.
//
BasicBlock *getReturnBlock() const { return ReturnBlock; }
BasicBlock *getUnwindBlock() const { return UnwindBlock; }
+ BasicBlock *getUnreachableBlock() const { return UnreachableBlock; }
virtual bool runOnFunction(Function &F);
};
OpenPOWER on IntegriCloud