pp
2011-Jul-13 03:38 UTC
[LLVMdev] "Can I use LLVM to convert C++ code to C code?"FAQ doesn't work
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 ELFX4( U0EMUMEUEMUUMEEMU=MEU so please could someone tell me how can I get the correct result? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110713/5dd7810c/attachment.html>
Eli Friedman
2011-Jul-13 04:58 UTC
[LLVMdev] "Can I use LLVM to convert C++ code to C code?"FAQ doesn't work
On Tue, Jul 12, 2011 at 8:38 PM, pp <tdihp at hotmail.com> wrote:> 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 > ELF X 4( > U����0��E��M��U��M��E��U�� �E��M� ȋU� �ƒ� �� > �U��M��E��E��M��U�=��M��E��U� > > so please could someone tell me how can I get the correct result?dragonegg doesn't support -emit-llvm; try -flto. -Eli