[LLVMdev] C++ to C?

Török Edwin edwintorok at gmail.com
Sat Oct 11 00:49:10 PDT 2008

On 2008-10-10 21:29, Michael wrote:
> What command and options should be used to convert C++ to C?

This works usually:
llvm-g++ -O2 -c x.cpp -emit-llvm -o - | llc -march=c

llvm-g++ -O2 -c x.cpp -emit-llvm -o x.bc
llc x.bc -march=c -o x.cbe.c

However the resulting C file is not meant to be human-readable (or
What do you need the C++ -> C conversion for?

Best regards,

More information about the llvm-dev mailing list