From 5a53c5d1977b0eeade04b53da24f6d75566d28e5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 25 Feb 2005 20:30:21 +0000 Subject: [PATCH] add an entry, add links to entries for demo page. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20328 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/FAQ.html | 80 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/docs/FAQ.html b/docs/FAQ.html index 9359324019a..0f2abd63801 100644 --- a/docs/FAQ.html +++ b/docs/FAQ.html @@ -72,12 +72,13 @@
  • Questions about code generated by the GCC front-end
      -
    1. What is this __main() call that gets inserted into - main()?
    2. -
    3. Where did all of my code go??
    4. -
    5. What is this llvm.global_ctors and +
    6. What is this __main() call that gets inserted into + main()?
    7. +
    8. What is this llvm.global_ctors and _GLOBAL__I__tmp_webcompile... stuff that happens when I - #include <iostream>?
    9. + #include <iostream>? +
    10. Where did all of my code go??
    11. +
    12. What is this "undef" thing that shows up in my code?
  • @@ -448,6 +449,7 @@ correct this, do:

    + What is this __main() call that gets inserted into main()?

    @@ -469,29 +471,8 @@ linked in automatically when you link the program. -

    -Where did all of my code go?? -

    - -
    -

    -If you are using the LLVM demo page, you may often wonder what happened to all -of the code that you typed in. Remember that the demo script is running the -code through the LLVM optimizers, so if your code doesn't actually do anything -useful, it might all be deleted. -

    - -

    -To prevent this, make sure that the code is actually needed. For example, if -you are computing some expression, return the value from the function instead of -leaving it in a local variable. If you really want to constrain the optimizer, -you can read from and assign to volatile global variables. -

    -
    - - -
    +

    What is this llvm.global_ctors and _GLOBAL__I__tmp_webcompile... stuff that happens when I #include <iostream>?

    @@ -520,6 +501,51 @@ instead of iostreams to print values.

    + + +

    + +Where did all of my code go?? +

    + +
    +

    +If you are using the LLVM demo page, you may often wonder what happened to all +of the code that you typed in. Remember that the demo script is running the +code through the LLVM optimizers, so if your code doesn't actually do anything +useful, it might all be deleted. +

    + +

    +To prevent this, make sure that the code is actually needed. For example, if +you are computing some expression, return the value from the function instead of +leaving it in a local variable. If you really want to constrain the optimizer, +you can read from and assign to volatile global variables. +

    +
    + + + +

    + +

    What is this "undef" thing that shows up in my code? +

    + +
    +

    +undef is the LLVM way of representing +a value that is not defined. You can get these if you do not initialize a +variable before you use it. For example, the C function:

    + +
    + int X() { int i; return i; } +
    + +

    Is compiled to "ret int undef" because "i" never has a value +specified for it. +

    +
    +
    -- 2.34.1