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 fileex.ll.clang -c -emit-llvm ex.cgenerates a binary fileex.bc.llvm-dis ex.bcgenerates a fileex.ll, which is identical with the file generated using ``clang -S -emit-llvm ex.c`.llvm-as ex.llgenerates a fileex.bc, which is identical with the file generated usingclang -c -emit-llvm ex.c.llc ex.llgenerates the assembly fileex.slli ex.llcan run this file. Useecho $?to see the return value.
See https://llvm.org/devmtg/2019-04/slides/Tutorial-Bridgers-LLVM_IR_tutorial.pdf.