C++ frontend only compiler (convert C++ to C)

后端 未结 7 652
再見小時候
再見小時候 2020-12-04 17:16

I\'m currently managing some C++ code that runs on multiple platforms from a single source tree (Win32, Linux, Verifone CC terminals, MBED and even the Nintendo GBA/DS). How

相关标签:
7条回答
  • 2020-12-04 17:45

    If you use LLVM, llvm-g++ will compile your C++ code to LLVM bitcode, and llc has a backend which converts bitcode to C.

    You could write commands like this:

    llvm-g++ -emit-llvm -c foo.cpp -o foo.o
    llc -march=c <foo.o >foo.c
    
    0 讨论(0)
提交回复
热议问题