The purpose is to keep optimization flags around if you're, say, compiling with LTO or PGO--cases where the regular compilation process will keep bitcode files around.
The usual trick I do is clang -S -emit-llvm -O2 -Xclang --disable-llvm-passes.
> Clang doesn't take the --print-after-all flag.
You have to prefix it with -mllvm, e.g., clang -mllvm -print-after-all -O2 foo.cpp.
The usual trick I do is clang -S -emit-llvm -O2 -Xclang --disable-llvm-passes.
> Clang doesn't take the --print-after-all flag.
You have to prefix it with -mllvm, e.g., clang -mllvm -print-after-all -O2 foo.cpp.