How to make clang compile to llvm IR
Given some C/C++ file foo.c: > clang -S -emit-llvm foo.c Produces foo.ll which is an LLVM IR file. The -emit-llvm option can also be passed to the compiler front-end directly, and not the driver by means of -cc1: > clang -cc1 foo.c -emit-llvm Produces foo.ll with the IR. -cc1 adds some cool options like -ast-print. … Read more