[LLVMdev] "Can I use LLVM to convert C++ code to C code?"FAQ doesn't work

pp tdihp at hotmail.com
Tue Jul 12 20:38:50 PDT 2011

hi, I'm new to llvm and trying to convert some c files to bitcode and convert them back to c code.
my command line is pretty simple and verymuch like commands in "Can I use LLVM to convert C++ code to C code?"
dragonegg_disable_version_check=1 llvm-gcc -emit-llvm test.c -o test -c
llc -march=c test -o testout.c

so I meant to compile test.c, which can be compiled and run by normal gcc, to bitcode, and use lcc -march=c to convert it back to c code.

but I recieve this:
llc: test:1:1: error: expected top-level entity

so please could someone tell me how can I get the correct result?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110713/5dd7810c/attachment.html>

More information about the llvm-dev mailing list