From b39a40757680a4d2e713614abe7b0ac723206178 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Fri, 4 Dec 2009 01:26:26 +0000 Subject: [PATCH] Add some helpers for Invoke to mirror CreateCall helpers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90508 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/IRBuilder.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index 2db2477a9eb..773fcd1449d 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -269,6 +269,19 @@ public: return Insert(IndirectBrInst::Create(Addr, NumDests)); } + InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest, + BasicBlock *UnwindDest, const Twine &Name = "") { + Value *Args[] = { 0 }; + return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, Args, + Args), Name); + } + InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest, + BasicBlock *UnwindDest, Value *Arg1, + const Twine &Name = "") { + Value *Args[] = { Arg1 }; + return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, Args, + Args+1), Name); + } /// CreateInvoke - Create an invoke instruction. template InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,