[llvm-dev] LLVMGetBitcodeModuleInContext2 problem
Toshiyasu Morita via llvm-dev
llvm-dev at lists.llvm.org
Wed Mar 8 15:56:34 PST 2017
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.
Thanks!
On Wed, Mar 8, 2017 at 3:48 PM, Friedman, Eli <efriedma at codeaurora.org>
wrote:
> 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/6bc6c384/attachment.html>
More information about the llvm-dev
mailing list