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).

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.