[llvm-dev] LLVMGetBitcodeModuleInContext2 problem

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 8 15:48:57 PST 2017


On 3/8/2017 3:44 PM, Toshiyasu Morita wrote:
>
>
>             module_path = LLVMCreateMemoryBufferWithMemoryRange(path,
>     strlen(path), "path", 1);
>
>
> LLVMCreateMemoryBufferWithContentsOfFile takes a path.
>
> Erm...no...the code is calling LLVMCreateMemoryBufferWithMemoryRange, 
> not LLVMCreateMemoryBufferWithContentsOfFile...
>
> Or do you mean I need to load the module into memory before calling 
> LLVMGetBitcodeModuleInContext2?

Yes, you need to load the module into memory first. 
LLVMCreateMemoryBufferWithContentsOfFile will do that for you.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170308/1eaa9d2d/attachment.html>


More information about the llvm-dev mailing list