Hello. I have an .bc, which defines @foo(%type* arg1, %type* arg2, %type* arg3).<br>Firstly, i do this:<br><br>runtimeModule = getLazyIRFileModule("runtime.bc", smd, llctx);<br><br>then this:<br><br>fooFunction = runtimeModule->getFunction("foo");<br>

myType = runtimeModule->getTypeByName("type");<br><br>After that, i'm creating another module:<br><br>myModule = new Module("My Module", llctx);<br><br>and create some AllocaInsts with type %type:<br>

<br>AllocaInst * retZval = new AllocaInst(myType,<br>                                          "arg1",<br>                                          currentBB);<br><br>Finally, i do<br><br>CallInst::Create(fooFunction, args_vector, "", currentBB);<br>

<br>Everything seems to be fine so far.<br>Now i link two modules together and run Verifier:<br><br>llvm::Linker linker("myModule", runtimeModule);<br>linker.LinkInModule(myModule, &err);<br>llvm::verifyModule(*linker.releaseModule());<br>

<br>This gives me error:<br>Call parameter type does not match function signature!<br>  %"arg1" = alloca %type<br> %"type 0x801e9b550"*  %0 = call i32 @foo(%type* %"~3", %type* %"arg2", %type* %"arg3")<br>

<br>What's interesting - if i dump myModule before verifying, manually put @foo and %type definitions into it, then opt -verify do not complain.<br><br>Am i doing something wrong or is it a bug?<br>