Add support for the unreachable instruction
authorChris Lattner <sabre@nondot.org>
Sat, 16 Oct 2004 18:06:43 +0000 (18:06 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 16 Oct 2004 18:06:43 +0000 (18:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17039 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/InstVisitor.h
include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h

index c8e7cf98d0562833ae12aaafc41723563f2dc773..a9b3b7150656c159648d1851d473c8b0ecd16ff1 100644 (file)
@@ -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);}
index 590d51034bdfd421627575d99d90f4ac6bbc95b9..6202f85792e67618b55e9bea52d2fc764c9450aa 100644 (file)
 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);
 };