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

Hayden Livingston via cfe-dev cfe-dev at lists.llvm.org
Tue Sep 8 17:09:35 PDT 2015


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?

On Tue, Sep 8, 2015 at 3:09 PM, mats petersson <mats at planetcatfish.com> wrote:
> 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
>
>



More information about the cfe-dev mailing list