[LLVMdev] creating InvokeInst without branch locations
John Criswell
criswell at illinois.edu
Mon Oct 21 07:12:23 PDT 2013
On 10/20/13 10:52 PM, edA-qa mort-ora-y wrote:
> Is it okay to pass null values to the destinations of
> InvokeInst::Create? I checked the code and it looks like it'd be okay,
> but the Create method doesn't make them optional, so I'm uncertain.
> Perhaps a specific Create function without destinations can be added to
> make it clear that it's okay (of course assuming you eventually call
> setNormal/UnwindDest).
I'm assuming that you want to create the invoke instruction and then
fill in the destination basic blocks later. Is that correct?
It should be okay to create an InvokeInst with "invalid" destinations so
long as your pass fills them in with valid values before it finishes
(otherwise, the LLVM verifier pass will complain). I recommend using
Undef values or a dummy basic block, though, instead of NULL values. A
dummy basic block would probably be best.
-- John T.
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131021/7d8f36c2/attachment.html>
More information about the llvm-dev
mailing list