3

I compile my C++ program to LLVM IR using the following command.

clang++ -O4 -emit-llvm program.cpp -c -o program.ll -S -pthread 

However, now I want to do the same for multiple files. How can I do that? I want to produce one IR file after the compilation (not separate IR files for each file). In other words I want to have the linked code (code from all files linked together) in my IR file.

pythonic
  • 20,589
  • 43
  • 136
  • 219

1 Answers1

3

You're probably looking for the llvm-link command, which links bitcode files together.

John Bartholomew
  • 6,428
  • 1
  • 30
  • 39