I used the LLVM demo page http://llvm.org/demo/ to generate C++ code for generating LLVM IR code. But that page is now disabled. Is there any tool or other site which does what I'm trying to do, that is I give "C/C++ code" as input and I get the "C++ code for generating the equivalent LLVM IR" as output. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130207/9f95ed8e/attachment.html>
Blind Faith <person.of.book at gmail.com> writes:> I used the LLVM demo page http://llvm.org/demo/ to generate C++ code for > generating LLVM IR code. But that page is now disabled. Is there any tool > or other site which does what I'm trying to do, that is I give "C/C++ code" > as input and I get the "C++ code for generating the equivalent LLVM IR" as > output.You can use clang++ and llc for that: $ clang++ -c -emit-llvm foo.cpp -o foo.ll $ llc -march=cpp -o foo.ll.cpp foo.ll (Note: the CppBackend is not enabled by default when you build with CMake on Windows.)
Blind Faith <person.of.book at gmail.com> writes:>> You can use clang++ and llc for that: >> >> $ clang++ -c -emit-llvm foo.cpp -o foo.ll >> $ llc -march=cpp -o foo.ll.cpp foo.ll >> >> (Note: the CppBackend is not enabled by default when you build with >> CMake on Windows.) > > It says "llc: error: invalid target 'cpp'"See the note. Please provide information about the LLVM version you are using and the exact commands you executed for building LLVM and Clang. The output of `llc --version' will help too.
On Thu, Feb 07, 2013 at 11:09:10AM +0100, Óscar Fuentes wrote:> Blind Faith <person.of.book at gmail.com> writes: > > > I used the LLVM demo page http://llvm.org/demo/ to generate C++ code for > > generating LLVM IR code. But that page is now disabled. Is there any tool > > or other site which does what I'm trying to do, that is I give "C/C++ code" > > as input and I get the "C++ code for generating the equivalent LLVM IR" as > > output. > > You can use clang++ and llc for that: > > $ clang++ -c -emit-llvm foo.cpp -o foo.ll > $ llc -march=cpp -o foo.ll.cpp foo.ll > > (Note: the CppBackend is not enabled by default when you build with > CMake on Windows.)Just to be curious. Is there any plan to bring the demo page back? Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj