edA-qa mort-ora-y
2013-Oct-21 03:52 UTC
[LLVMdev] creating InvokeInst without branch locations
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). -- edA-qa mort-ora-y -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Sign: Please digitally sign your emails. Encrypt: I'm also happy to receive encrypted mail. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 263 bytes Desc: OpenPGP digital signature URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131021/80c6ef99/attachment.sig>
John Criswell
2013-Oct-21 14:12 UTC
[LLVMdev] creating InvokeInst without branch locations
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>