On Fri, Nov 11, 2011 at 11:00 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="HOEnZb"><div class="h5">A CallInst in one module can't reference a Function in another module.<br></div></div>
 Build a declaration of foo in the module where you're building the<br>
call, and call that.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Eli<br>
</font></span></blockquote></div><br>Hmm, before emitting any code i've added this:<br><br>Function::Create(fooFunction->getFunctionType(),fooFunction->getLinkage(),"foo",myModule);<br><br>Now i see @foo declaration when dumping myModule, but the error is still same.<br>