aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/Writer.cpp
AgeCommit message (Collapse)Author
2002-10-02I was wrong on the removing of those references on the last commit.Nick Hildenbrandt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4023 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02Removed unneeded reference and dereferences.Nick Hildenbrandt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4016 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02Cleaned up my last check-in.Nick Hildenbrandt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4014 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02No longer include malloc.h. If protoypes are needed for memory functions ↵Nick Hildenbrandt
they will be present in the byte code and the generated c as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4013 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-30Fixed to properly escape quotes in strings.Nick Hildenbrandt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3991 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25Strings now handled correctly.Nick Hildenbrandt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3920 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23Parenthesis are now added to casts of type array.Nick Hildenbrandt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3892 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20Fix cwriter to not output FP constants in ascii, output them in hex instead.Chris Lattner
This fixes a number of FP precision problems, making the output of the power benchmark closer to the right answer. Unfortunately, this only addresses FP constants used directly in functions. Constants referred to by global constants (such as an array of FP values) aren't helped by this. Until this happens power won't work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3871 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20Fix bug: 2002-09-20-VarArgPrototypes.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3870 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20Fix output of typedefs to avoid syntax errors.Chris Lattner
* We now can correctly Cify the Olden-power benchmark git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3860 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20* Add a couple of comments to the output c codeChris Lattner
* _FIX_ infinite recursion problem, due to typedefs of a structure being printed before the structure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3859 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20Another change that doesn't affect functionality. Since we are only lookingChris Lattner
at types in the symbol table, only traverse the type plane, saving a loop nest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3858 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20Make the StructPrinted set only take memory when it's being used.Chris Lattner
rename parseStruct to printContainedStructs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3857 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20No functionality changes, primarily just changing tab indentation to spaceChris Lattner
indentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3856 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17Don't print global variable definitions twice! Sun's pathetic compilerVikram S. Adve
never complained about this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3774 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-15No longer need to sign-extend array indices to 64 bits since theyVikram S. Adve
are now longs and not unsigned ints. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3731 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14Fixed problem with printing struct definitions in the correct order.Nick Hildenbrandt
This allows for the Regression/Transforms/ScalarReplacement/scalarize.c to run correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3721 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-12Fix a bug introduced by the Getelementptr changeChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3695 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 - Change getelementptr instruction to use long indexes instead of uintChris Lattner
indexes for sequential types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3681 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-31 - Fix bug: test/Regression/CBackend/2002-08-20-RecursiveTypes.llChris Lattner
- Converted CWriter to be an LLVM pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3558 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-26Fix bug: test/Regression/CBackend/2002-08-26-IndirectCallTest.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3511 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-25Fix the way parens are printed around "*ptrName" so thatVikram S. Adve
no parens are printed around *, **, ... alone, except if it is a pointer type for which no name should be printed, as in the result of a cast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3506 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-24Sign-extend array index expressions to work correctly on non-32 bit machines.Vikram S. Adve
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3496 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-23Changed default value of 3rd parameter in function definitionAnand Shukla
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3492 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22Load & StoreInst no longer derive from MemAccessInst, so we don't haveChris Lattner
to handle indexing anymore git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3484 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-20Fix bug: 2002-08-20-UnnamedArgument.cChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3401 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19Implement ConstantExprs in CWriterChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3394 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19Incorporate calcTypeNameVar into CWriter class, fixingChris Lattner
test/Regression/CBackend/2002-08-19-FunctionPointer.c in the process git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3392 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19Output forward definitions of global vars to handle recursive intializers ↵Chris Lattner
correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3391 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19 - Change constant printing to be better integrated with the rest of theChris Lattner
CWriter class. Write directly to stream instead of building a big string, then writing it out. - Implement printing of ConstantPointerRefs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3389 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14Remove support for NOT instructionChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3320 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25Avoid warning messageChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3085 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30Fix anands changesChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2806 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25added include<iostream> for cerrAnand Shukla
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2796 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25changes to make it compatible with 64bit gccAnand Shukla
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2790 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25* Update with MegaPatchChris Lattner
* Fix various bugs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2774 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21* Fix typeoChris Lattner
* 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
2002-05-21Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.llChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2690 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-17Fix bug: test/Regression/CBackend/2002-05-16-NameCollide.ll by trackingChris Lattner
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
2002-05-09Last minor cleanups, this code still does not work for all cases, but itChris Lattner
works much better than it used to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2588 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09Two Cleanups to generated C code:Chris Lattner
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
2002-05-09* Remove CInstPrintVisitor class, incorporating it into the CWriter classChris Lattner
* 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
2002-05-09Remove CLocalVars data structure entirely, instead of building stuff andChris Lattner
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
2002-05-09Simplify code by removing InstLocalVarsVisitor, replacing it with a simpleChris Lattner
inst_iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2584 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09* Clean up how PHI nodes are handledChris Lattner
* 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
2002-05-09Emit:Chris Lattner
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
2002-05-09* Print structures types correctlyChris Lattner
* 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
2002-05-09* Continue cleanup of type printing codeChris Lattner
* 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
2002-05-09Gut the type printing code so there is only one copy of it instead of 3Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2576 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-09* Remove dead "constant printing" codeChris Lattner
* 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