<div dir="ltr"><div><div><div><div><span class="gmail-im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
        module_path = LLVMCreateMemoryBufferWithMemo<wbr>ryRange(path, strlen(path), "path", 1);<br>
</blockquote>
<br></span>
LLVMCreateMemoryBufferWithCont<wbr>entsOfFile takes a path.<br></div><br></div>Erm...no...the code is calling LLVMCreateMemoryBufferWithMemoryRange, not LLVMCreateMemoryBufferWithContentsOfFile...<br><br></div>Or do you mean I need to load the module into memory before calling LLVMGetBitcodeModuleInContext2?<br><br></div>Toshi<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 8, 2017 at 3:40 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 3/8/2017 3:29 PM, Toshiyasu Morita via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I'm trying to use LLVMGetBitcodeModuleInContext2 to load a .bc file.<br>
However, it's not working.<br>
<br>
The code looks something like this:<br>
<br>
void llvm_load_IR_library(char *path)<br>
<br>
{<br>
        LLVMContextRef global_context;<br>
        LLVMMemoryBufferRef module_path;<br>
        LLVMModuleRef ir_lib_module;<br>
        bool flag;<br>
<br>
        module_path = LLVMCreateMemoryBufferWithMemo<wbr>ryRange(path, strlen(path), "path", 1);<br>
</blockquote>
<br></span>
LLVMCreateMemoryBufferWithCont<wbr>entsOfFile takes a path.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Eli<br>
<br>
-- <br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<br>
</font></span></blockquote></div><br></div>