aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/CBackend/Writer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix anands changesChris Lattner2002-06-301-6/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2806 91177308-0d34-0410-b5e6-96231b3b80d8
* added include<iostream> for cerrAnand Shukla2002-06-251-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2796 91177308-0d34-0410-b5e6-96231b3b80d8
* changes to make it compatible with 64bit gccAnand Shukla2002-06-251-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2790 91177308-0d34-0410-b5e6-96231b3b80d8
* * Update with MegaPatchChris Lattner2002-06-251-139/+125
| | | | | | | * Fix various bugs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2774 91177308-0d34-0410-b5e6-96231b3b80d8
* * Fix typeoChris Lattner2002-05-211-1/+2
| | | | | | | | * Provide a #include of <malloc.h> so that the sun C compiler does not miscompile malloc function calls git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2702 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.llChris Lattner2002-05-211-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2690 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: test/Regression/CBackend/2002-05-16-NameCollide.ll by trackingChris Lattner2002-05-171-2/+24
| | | | | | | | which global variables would have name collisions if they were not mangled, and use this info to mangle them iff they would collide. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2639 91177308-0d34-0410-b5e6-96231b3b80d8
* Last minor cleanups, this code still does not work for all cases, but itChris Lattner2002-05-091-18/+10
| | | | | | | works much better than it used to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2588 91177308-0d34-0410-b5e6-96231b3b80d8
* Two Cleanups to generated C code:Chris Lattner2002-05-091-35/+65
| | | | | | | | | | | | | | | 1. Avoid printing *(&globalvariable), instead print globalvariable alone as a special case. 2. Inline subexpressions into expressions as much as legal that preserves execution characteristics of expressions. Now we get nice (but over-parenthesized, oh well) things like: ltmp_428_7 = spec__putc(((unsigned char )((bsBuff) >> 24)), (bsStream)); instead of five seperate instructions (bsBuff & bsStream are globals). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2587 91177308-0d34-0410-b5e6-96231b3b80d8
* * Remove CInstPrintVisitor class, incorporating it into the CWriter classChris Lattner2002-05-091-344/+300
| | | | | | | * Reorder code in the file to make it more logically laid out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2586 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove CLocalVars data structure entirely, instead of building stuff andChris Lattner2002-05-091-28/+3
| | | | | | | then printing it out, just print as we go. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2585 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code by removing InstLocalVarsVisitor, replacing it with a simpleChris Lattner2002-05-091-62/+17
| | | | | | | inst_iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2584 91177308-0d34-0410-b5e6-96231b3b80d8
* * Clean up how PHI nodes are handledChris Lattner2002-05-091-54/+73
| | | | | | | | | | | | | | | * Correct global variable references * Fix loads & stores with zero indices * Do not emit an else part of a branch if there is no code (no phi node and a fallthrough branch), makes code more readable to get: if (l2_cond240) { goto l13_bb10; } with no else{} branch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2583 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit:Chris Lattner2002-05-091-2/+13
| | | | | | | | | | | l3_reg109 = l81_this->field0; Instead of: l3_reg109 = l81_this[0u].field0; where possible git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2579 91177308-0d34-0410-b5e6-96231b3b80d8
* * Print structures types correctlyChris Lattner2002-05-091-42/+70
| | | | | | | | * Clean up generated code to not emit basic block labels and goto instructions if they are unneccesary (for example, fall throughs) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2578 91177308-0d34-0410-b5e6-96231b3b80d8
* * Continue cleanup of type printing codeChris Lattner2002-05-091-58/+45
| | | | | | | | | * Print a newline after a malloc instruction * Convert unprintable characters to x_ instead of _x so that we don't generate identifiers that start with underscores git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2577 91177308-0d34-0410-b5e6-96231b3b80d8
* Gut the type printing code so there is only one copy of it instead of 3Chris Lattner2002-05-091-296/+92
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2576 91177308-0d34-0410-b5e6-96231b3b80d8
* * Remove dead "constant printing" codeChris Lattner2002-05-091-48/+22
| | | | | | | | | | * Mangle names with only a prefix so that they are easier on the eyes. * Put spaces around binary operators with low precedence to make them easier to read * Don't prefix function names with &, although it's correct, it's unnecesary and easier to read without it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2575 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove gross "Operand" instance variableChris Lattner2002-05-091-41/+31
| | | | | | | Remove lots of unneccesary arguments to methods git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2574 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify and clean up function calls.Chris Lattner2002-05-091-49/+37
| | | | | | | Now indirect function calls work, except that function pointer types are not correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2573 91177308-0d34-0410-b5e6-96231b3b80d8
* * Remove dead functionChris Lattner2002-05-091-9/+20
| | | | | | | | * Print C strings correctly * Expand C escape sequences nicely (ie \n \t, etc get generated instead of hex escapes) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2572 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Getelementptr, load & store all work the right way.Chris Lattner2002-05-091-112/+37
| | | | | | | Handle global variables correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2571 91177308-0d34-0410-b5e6-96231b3b80d8
* Many random fixes:Chris Lattner2002-05-091-112/+56
| | | | | | | | * Use binary operator logic for shifts instead of cloning code * Unary not is '~' not '!' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2570 91177308-0d34-0410-b5e6-96231b3b80d8
* Incorporate and purge function before and after printing them so unnamed valuesChris Lattner2002-05-091-11/+16
| | | | | | | | | have some hope of working right. Function calls do not try to emit an lvalue if they return void. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2569 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out the code to print a value to ONE place.Chris Lattner2002-05-091-187/+101
| | | | | | | It turns out that unnamed values DO NOT work at all, that's next on the list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2568 91177308-0d34-0410-b5e6-96231b3b80d8
* First wave of cleanups, looks like the first of many.Chris Lattner2002-05-091-292/+162
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2567 91177308-0d34-0410-b5e6-96231b3b80d8
* *** empty log message ***Sumant Kowshik2002-05-081-0/+1415
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2552 91177308-0d34-0410-b5e6-96231b3b80d8