[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.43 -> 1.44 --- Log message: Added "llvmc" to the FAQ. --- Diffs of the changes: (+14 -2) FAQ.html | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.43 llvm/docs/FAQ.html:1.44 --- llvm/docs/FAQ.html:1.43 Tue May 29 04:24:33 2007 +++ llvm/docs/FAQ.html Tue May 29 04:35:34 2007 @@ -51,7 +51,9 @@ When I use the test suite, all of the C Backend tests fail. What is wrong? After CVS update, rebuilding gives the error "No rule to make - target". + target". + The llvmc program gives me errors/doesn't + work. Source Languages @@ -386,6 +388,16 @@ rebuilding. + + The llvmc program gives me errors/doesn't + work. + + + + llvmc is experimental and isn't really supported. We suggest + using llvm-gcc instead. + + Source Languages @@ -695,7 +707,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2007/05/29 09:24:33 $ + Last modified: $Date: 2007/05/29 09:35:34 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.42 -> 1.43 --- Log message: Added "doc_class" div tags to code segments. --- Diffs of the changes: (+44 -17) FAQ.html | 61 - 1 files changed, 44 insertions(+), 17 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.42 llvm/docs/FAQ.html:1.43 --- llvm/docs/FAQ.html:1.42 Wed Feb 14 01:40:16 2007 +++ llvm/docs/FAQ.html Tue May 29 04:24:33 2007 @@ -311,11 +311,20 @@ For example, if you built LLVM with the command: -gmake ENABLE_PROFILING=1 + + +% gmake ENABLE_PROFILING=1 + + ...then you must run the tests with the following commands: -cd llvm/testgmake ENABLE_PROFILING=1 + + +% cd llvm/test +% gmake ENABLE_PROFILING=1 + + @@ -354,11 +363,11 @@ If the error is of the form: - + gmake[2]: *** No rule to make target `/path/to/somefile', needed by `/path/to/another/file.d'. Stop. - + This may occur anytime files are moved within the CVS repository or removed @@ -471,11 +480,14 @@ The only way this can happen is if you haven't installed the runtime library. To correct this, do: + + - % cd llvm/runtime - % make clean ; make install-bytecode +% cd llvm/runtime +% make clean ; make install-bytecode + @@ -512,14 +524,20 @@ Compile your program as normal with llvm-g++: -$ llvm-g++ x.cpp -o program + + +% llvm-g++ x.cpp -o program + + or: - llvm-g++ a.cpp -c - llvm-g++ b.cpp -c - llvm-g++ a.o b.o -o program + +% llvm-g++ a.cpp -c +% llvm-g++ b.cpp -c +% llvm-g++ a.o b.o -o program + With llvm-gcc3, this will generate program and program.bc. The .bc file is @@ -528,11 +546,19 @@ Convert the LLVM code to C code, using the LLC tool with the C backend: -$ llc -march=c program.bc -o program.c + + +% llc -march=c program.bc -o program.c + + Finally, compile the c file: -$ cc x.c + + +% cc x.c + + @@ -650,12 +676,13 @@ variable before you use it. For example, the C function: - int X() { int i; return i; } + +int X() { int i; return i; } + -Is compiled to "ret int undef" because "i" never has a value -specified for it. - +Is compiled to "ret i32 undef" because "i" never has +a value specified for it. @@ -668,7 +695,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/14 07:40:16 $ + Last modified: $Date: 2007/05/29 09:24:33 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.41 -> 1.42 --- Log message: remove an obsolete question --- Diffs of the changes: (+1 -18) FAQ.html | 19 +-- 1 files changed, 1 insertion(+), 18 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.41 llvm/docs/FAQ.html:1.42 --- llvm/docs/FAQ.html:1.41 Fri Feb 9 09:59:08 2007 +++ llvm/docs/FAQ.html Wed Feb 14 01:40:16 2007 @@ -36,7 +36,6 @@ Build Problems When I run configure, it finds the wrong C compiler. - I compile the code, and I get some error about /localhome. The configure script finds the right C compiler, but it uses the LLVM linker from a previous build. What do I do? When creating a dynamic library, I get a strange GLIBC error. @@ -216,22 +215,6 @@ -I compile the code, and I get some error about /localhome. - - - - -There are several possible causes for this. The first is that you didn't set -a pathname properly when using configure, and it defaulted to a -pathname that we use on our research machines. - -Another possibility is that we hardcoded a path in our Makefiles. If you see -this, please email the LLVM bug mailing list with the name of the offending -Makefile and a description of what is wrong with it. - - - - The configure script finds the right C compiler, but it uses the LLVM linker from a previous build. What do I do? @@ -685,7 +668,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2007/02/09 15:59:08 $ + Last modified: $Date: 2007/02/14 07:40:16 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.39 -> 1.40 --- Log message: Add a note about C++ -> C with libstdc++ --- Diffs of the changes: (+12 -3) FAQ.html | 15 --- 1 files changed, 12 insertions(+), 3 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.39 llvm/docs/FAQ.html:1.40 --- llvm/docs/FAQ.html:1.39 Mon Aug 14 19:43:35 2006 +++ llvm/docs/FAQ.html Wed Aug 30 23:26:31 2006 @@ -541,8 +541,8 @@ or: - llvm-g++ a.cpp -c - llvm-g++ b.cpp -c + llvm-g++ a.cpp -c + llvm-g++ b.cpp -c llvm-g++ a.o b.o -o program @@ -566,6 +566,15 @@ use setjmp/longjmp to implement exception support that is correct but relatively slow. + +Also note: this specific sequence of commands won't work if you use a +function defined in the C++ runtime library (or any other C++ library). To +access an external C++ library, you must manually +compile libstdc++ to LLVM bytecode, statically link it into your program, then +use the commands above to convert the whole result into C code. Alternatively, +you can compile the libraries and your application into two different chunks +of C code and link them. + @@ -683,7 +692,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/08/15 00:43:35 $ + Last modified: $Date: 2006/08/31 04:26:31 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.38 -> 1.39 --- Log message: Add a link in a prominant location. --- Diffs of the changes: (+11 -1) FAQ.html | 12 +++- 1 files changed, 11 insertions(+), 1 deletion(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.38 llvm/docs/FAQ.html:1.39 --- llvm/docs/FAQ.html:1.38 Thu Aug 10 15:15:58 2006 +++ llvm/docs/FAQ.html Mon Aug 14 19:43:35 2006 @@ -427,6 +427,16 @@ compiler driver which simplifies the task of running optimizations, linking, and executable generation. + + + I don't understand the GetElementPtr + instruction. Help! + + + See The Often Misunderstood GEP + Instruction. + + Using the GCC Front End @@ -673,7 +683,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/08/10 20:15:58 $ + Last modified: $Date: 2006/08/15 00:43:35 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.36 -> 1.37 --- Log message: Answer the FAQ: "can llvm convert C++ code to C?" --- Diffs of the changes: (+58 -1) FAQ.html | 59 ++- 1 files changed, 58 insertions(+), 1 deletion(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.36 llvm/docs/FAQ.html:1.37 --- llvm/docs/FAQ.html:1.36 Wed Apr 26 16:03:17 2006 +++ llvm/docs/FAQ.html Wed Jul 19 13:19:59 2006 @@ -79,6 +79,8 @@ How can I disable all optimizations when compiling code using the LLVM GCC front end? +Can I use LLVM to convert C++ code to C code? + @@ -501,6 +503,61 @@ + + + +Can I use LLVM to convert C++ code to C code? + + + + +Yes, you can use LLVM to convert code from any language LLVM supports to C. +Note that the generated C code will be very low level (all loops are lowered +to gotos, etc) and not very pretty (comments are stripped, original source +formatting is totally lost, variables are renamed, expressions are regrouped), +so this may not be what you're looking for. However, this is a good way to add +C++ support for a processor that does not otherwise have a C++ compiler. + + +Use commands like this: + + +Compile your program as normal with llvm-g++: + +$ llvm-g++ x.cpp -o program + +or: + + + llvm-g++ a.cpp -c + llvm-g++ b.cpp -c + llvm-g++ a.o b.o -o program + + +With llvm-gcc3, this will generate program and program.bc. The .bc file is +the LLVM version of the program all linked together. + +Convert the LLVM code to C code, using the LLC tool with the C +backend: + +$ llc -march=c program.bc -o program.c + +Finally, compile the c file: + +$ cc x.c + + + +Note that, by default, the C backend does not support exception handling. +If you want/need it for a certain program, you can enable it by passing +"-enable-correct-eh-support" to the llc program. The resultant code will +use setjmp/longjmp to implement exception support that is correct but +relatively slow. + + + + + Questions about code generated by the GCC front-end @@ -614,7 +671,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/04/26 21:03:17 $ + Last modified: $Date: 2006/07/19 18:19:59 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.35 -> 1.36 --- Log message: Actually, semantical doesn't appear to be a word. --- Diffs of the changes: (+2 -2) FAQ.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.35 llvm/docs/FAQ.html:1.36 --- llvm/docs/FAQ.html:1.35 Wed Apr 26 13:10:59 2006 +++ llvm/docs/FAQ.html Wed Apr 26 16:03:17 2006 @@ -418,7 +418,7 @@ Currently, there isn't much. LLVM supports an intermediate representation which is useful for code representation but will not support the high level (abstract syntax tree) representation needed by most compilers. There are no - facilities for lexical nor semantical analysis. There is, however, a mostly + facilities for lexical nor semantic analysis. There is, however, a mostly implemented configuration-driven compiler driver which simplifies the task of running optimizations, linking, and executable generation. @@ -614,7 +614,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/04/26 18:10:59 $ + Last modified: $Date: 2006/04/26 21:03:17 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.34 -> 1.35 --- Log message: Unfortunately this really isn't the place for advertisement. --- Diffs of the changes: (+1 -4) FAQ.html |5 + 1 files changed, 1 insertion(+), 4 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.34 llvm/docs/FAQ.html:1.35 --- llvm/docs/FAQ.html:1.34 Wed Apr 26 13:05:25 2006 +++ llvm/docs/FAQ.html Wed Apr 26 13:10:59 2006 @@ -422,9 +422,6 @@ implemented configuration-driven compiler driver which simplifies the task of running optimizations, linking, and executable generation. - You might be interested in following the progress of the http://hlvm.org";>HLVM Project which is attempting to address these - issues. @@ -617,7 +614,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/04/26 18:05:25 $ + Last modified: $Date: 2006/04/26 18:10:59 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.33 -> 1.34 --- Log message: Fix typo. --- Diffs of the changes: (+2 -2) FAQ.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.33 llvm/docs/FAQ.html:1.34 --- llvm/docs/FAQ.html:1.33 Wed Apr 26 10:46:53 2006 +++ llvm/docs/FAQ.html Wed Apr 26 13:05:25 2006 @@ -418,7 +418,7 @@ Currently, there isn't much. LLVM supports an intermediate representation which is useful for code representation but will not support the high level (abstract syntax tree) representation needed by most compilers. There are no - facilities for lexical nor semantica analysis. There is, however, a mostly + facilities for lexical nor semantical analysis. There is, however, a mostly implemented configuration-driven compiler driver which simplifies the task of running optimizations, linking, and executable generation. @@ -617,7 +617,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/04/26 15:46:53 $ + Last modified: $Date: 2006/04/26 18:05:25 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.32 -> 1.33 --- Log message: Fix some anchors. --- Diffs of the changes: (+8 -8) FAQ.html | 16 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.32 llvm/docs/FAQ.html:1.33 --- llvm/docs/FAQ.html:1.32 Wed Apr 26 09:52:19 2006 +++ llvm/docs/FAQ.html Wed Apr 26 10:46:53 2006 @@ -391,12 +391,12 @@ - - Source Languages - +Source Languages -What source languages are supported? - + + What source languages are supported? + + LLVM currently has full support for C and C++ source languages. These are available through a special version of GCC that LLVM calls the C Front End @@ -410,9 +410,9 @@ The PyPy developers are working on integrating LLVM into the PyPy backend so that PyPy language can translate to LLVM. - + What support is there for a higher level source language constructs for - building a compiler? + building a compiler? Currently, there isn't much. LLVM supports an intermediate representation @@ -617,7 +617,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/04/26 14:52:19 $ + Last modified: $Date: 2006/04/26 15:46:53 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/FAQ.html
Changes in directory llvm/docs: FAQ.html updated: 1.31 -> 1.32 --- Log message: Add some notes about the current state of source (front end) languages so we can point to them on llvm-dev. --- Diffs of the changes: (+44 -1) FAQ.html | 45 - 1 files changed, 44 insertions(+), 1 deletion(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.31 llvm/docs/FAQ.html:1.32 --- llvm/docs/FAQ.html:1.31 Mon Mar 13 23:39:39 2006 +++ llvm/docs/FAQ.html Wed Apr 26 09:52:19 2006 @@ -55,6 +55,13 @@ target". + Source Languages + +What source languages are supported? +What support is there for higher level source + language constructs for building a compiler? + + Using the GCC Front End @@ -385,6 +392,42 @@ + Source Languages + + +What source languages are supported? + + LLVM currently has full support for C and C++ source languages. These are + available through a special version of GCC that LLVM calls the + C Front End + There is an incomplete version of a Java front end available in the + llvm-java CVS repository. There is no documentation on this yet so + you'll need to download the code, compile it, and try it. + In the examples/BFtoLLVM directory is a translator for the + BrainF*** language (2002 Language Specification). + In the projects/Stacker directory is a compiler and runtime + library for the Stacker language, a "toy" language loosely based on Forth. + The PyPy developers are working on integrating LLVM into the PyPy backend + so that PyPy language can translate to LLVM. + + + What support is there for a higher level source language constructs for + building a compiler? + + + Currently, there isn't much. LLVM supports an intermediate representation + which is useful for code representation but will not support the high level + (abstract syntax tree) representation needed by most compilers. There are no + facilities for lexical nor semantica analysis. There is, however, a mostly +implemented configuration-driven + compiler driver which simplifies the task + of running optimizations, linking, and executable generation. + You might be interested in following the progress of the http://hlvm.org";>HLVM Project which is attempting to address these + issues. + + + Using the GCC Front End @@ -574,7 +617,7 @@ src="http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> http://llvm.org";>LLVM Compiler Infrastructure - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/04/26 14:52:19 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits