ClangIR tries to preserve high-level scope information till the end of its pipeline, where it runs a flattening pass to convert to pure basic block control flow. You can pass -Xclang -emit-cir-flat
to see this flattened representation. Godbolt shows the difference in the representations.
Pass -fclangir -S -emit-llvm
to emit LLVM through the ClangIR pipeline. Godbolt shows an example. All the standard Clang flags can be used as well, e.g. to build with optimizations.
TBD
TBD