Intermediate representation
clang --help
  -emit-llvm  Use the LLVM representation for assembler and object files
  -S          Only run preprocess and compilation steps
- clang -S -emit-llvm ex.cgenerates a text file- ex.ll.
- clang -c -emit-llvm ex.cgenerates a binary file- ex.bc.
- llvm-dis ex.bcgenerates a file- ex.ll, which is identical with the file generated using ``clang -S -emit-llvm ex.c`.
- llvm-as ex.llgenerates a file- ex.bc, which is identical with the file generated using- clang -c -emit-llvm ex.c.
- llc ex.llgenerates the assembly file- ex.s
- lli ex.llcan run this file. Use- echo $?to see the return value.
See https://llvm.org/devmtg/2019-04/slides/Tutorial-Bridgers-LLVM_IR_tutorial.pdf.