[llvm-dev] LLVMGetBitcodeModuleInContext2 problem

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


On 3/8/2017 3:29 PM, Toshiyasu Morita via llvm-dev wrote:
>
> I'm trying to use LLVMGetBitcodeModuleInContext2 to load a .bc file.
> However, it's not working.
>
> The code looks something like this:
>
> void llvm_load_IR_library(char *path)
>
> {
>         LLVMContextRef global_context;
>         LLVMMemoryBufferRef module_path;
>         LLVMModuleRef ir_lib_module;
>         bool flag;
>
>         module_path = LLVMCreateMemoryBufferWithMemoryRange(path, 
> strlen(path), "path", 1);

LLVMCreateMemoryBufferWithContentsOfFile takes a path.

-Eli

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



More information about the llvm-dev mailing list