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

后端 未结 7 657
再見小時候
再見小時候 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.c
    

提交回复
热议问题