<div dir="ltr"><div><div><div><div><div>Hi, I have a problem - looking for advice.<br><br></div>I have a source code file with two functions which are compiled into a .bc file.<br></div>When the bitcode file is loaded, I can dump the module and see the two functions:<br><br>...<br>; Materializable<br>; Function Attrs: noinline nounwind uwtable<br>define void @matmul(double*, double*, double*, i32, i32, i32) #0 {}<br><br>; Materializable<br>; Function Attrs: noinline nounwind uwtable<br>define i32 @main() #0 {}<br>...<br><br></div>However, when I use LLVMGetirstFunction() and LLVMGetNextFunction() to iterate through the functions in the module, it only iterates through the function "matmul".<br></div>It never finds main().<br><br>50      first_func = LLVMGetFirstFunction(module);<br>(gdb) next<br>151      last_func = LLVMGetLastFunction(module);<br>(gdb) <br>154      for (func = first_func; func != last_func; func = LLVMGetNextFunction(func)) {<br>(gdb) <br>155        func_name = LLVMGetValueName(func);<br>(gdb) <br>156        func_addr = LLVMGetFunctionAddress(engine, func_name);<br>(gdb) print func_name<br>$9 = 0x1efe180 "matmul"<br>(gdb) next<br>159        if (!func_addr) continue;<br>(gdb) <br>161        symbol_table_add(symbol_table, func_name, func_addr);<br>(gdb) <br>164        if ((size = mem_region_lookup(mem_region_anchor, func_addr))) { symbol_table_add(symbol_table, "dummy_symbol", func_addr + size); }<br>(gdb) <br>154      for (func = first_func; func != last_func; func = LLVMGetNextFunction(func)) {<br>(gdb) <br>168      symbol_table_calc_symbol_sizes(symbol_table);<br><br></div><div>Any suggestions appreciated.<br><br></div><div>Toshi<br><br></div><div><div><br><br></div></div></div>