[cfe-dev] Does Clang lower C++ to C at a single point in the lowering phase?

mats petersson via cfe-dev cfe-dev at lists.llvm.org
Tue Sep 8 15:09:02 PDT 2015


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).

--
Mats

On 8 September 2015 at 23:03, Hayden Livingston via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> 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
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150908/5b0c7ed3/attachment.html>


More information about the cfe-dev mailing list