Is there a single well-defined point beyond which the AST has been
lowered ( / desugared?) to essentially C, including expanding template
information as different types?
Or is it pretty much adhoc all over as we proceed to LLVM IR?
I don't have complicated C++ code, so writing a ClangTool is not out
of the realm of possibility for me, but I'm inquiring here if it's
already part of the compiler
I’m not a Clang expert, but I’m 99% sure that Clang does not convert C++ into C (or something resembling C), but converts C++ code directly to LLVM IR, which is then further “worked on” by LLVM to improve on the code quality via various optimization passes, and then converted to machine code (or output as .bc or .ll from the compiler).
Ok, but it used to be that it lowered to C for quite a bit of the code
(not all), unless I've got my information wrong. Any body know?
Very early C++ compilers used to do this (circa early 1990s). AFAIK No modern compiler has done this for decades.
You may be thinking of the old C backend. It could generate C code from the LLVM intermediate code.