Search code examples
functionllvmllvm-irinlining

Inlining functions from multiple assembly files in LLVM


I have multiple .s files, which contain LLVM IR code generated separately from corresponding high level Ada code. There are function calls across these files. Is there a way to inline a function in a different .s file?


Solution

  • Welcome to SO, Ranjani!

    You can try linking those files together using llvm-link, e.g.:

    llvm-link -S -o merged.ll foo.ll bar.ll
    

    The command will link two files foo.ll and bar.ll and write the result into merged.ll. The -S option tells the linker to emit bitcode in the human-readable form.