<div dir="ltr"><div><div><div><div>Hey all,<br><br></div>A quick question about the LLVM C-Api and using LinkModules. In a normal situation where I have 2 LLVM modules and 1 depends on the other using LLVMLinkModules2() works perfectly.<br><br></div>LLVMLinkModules2() "Links the source module into the destination module. The source module is destroyed." according to the comment of the function. That is all fine when you only have 2 modules.<br><br></div>But how are you supposed to act in a triangulary dependency like below?<br><br></div>                                                    CommonModule<br>                                                                |<br>                                                        -----------------<br><div><div><div><div><div><div><div><div><div><div>                                                        |               |<br></div><div>                                                 ModuleA      Module B<br></div><div><br></div><div>1) Create and verify common module.<br></div><div>2) Create ModuleA, Link CommonModule to ModuleA and verify the new module.<br></div><div>3) Now we have a problem. Even though we wanted to repeat step (2) for Module B this fails due to CommonModule being "damaged" as the documentation says. Even though LLVMLinkModules2() function returns success, Module B is lacking structs and functions that were defined in the CommonModule.<br><br><br></div><div>I am probably doing this the wrong way and am missing something obvious. <br>Any tips on how to do this the right way? Thanks in advance!<br></div><div><br>---<br></div><div><br></div><div>Best Regards,<br></div><div><br clear="all"><div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><table border="0"><tbody><tr><td>Lefteris(Eleftherios) Karapetsas</td>
</tr>
<tr>
<td>About me: <a href="http://lefteris.refu.co" target="_blank">My Website</a><br></td>
</tr>
<tr>
<td><br></td>
</tr>
<tr>
<td>Keep in touch: <a href="https://twitter.com/LefterisJP" target="_blank">Twitter</a>, <a href="https://github.com/LefterisJP" target="_blank">Github</a>, <a href="http://blog.refu.co" target="_blank">Blog</a><br></td>
</tr>
</tbody></table>
</div></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div>