Chris Lattner
5578696d40
Fix bug: 2002-08-20-UnnamedArgument.c
...
llvm-svn: 3401
2002-08-20 16:55:48 +00:00
Chris Lattner
69a443b356
Implement ConstantExprs in CWriter
...
llvm-svn: 3394
2002-08-19 23:09:46 +00:00
Chris Lattner
ddd1d61b21
Incorporate calcTypeNameVar into CWriter class, fixing
...
test/Regression/CBackend/2002-08-19-FunctionPointer.c in the process
llvm-svn: 3392
2002-08-19 22:17:53 +00:00
Chris Lattner
b6818687da
Output forward definitions of global vars to handle recursive intializers correctly.
...
llvm-svn: 3391
2002-08-19 21:48:40 +00:00
Chris Lattner
fc62e1bdb1
- Change constant printing to be better integrated with the rest of the
...
CWriter class. Write directly to stream instead of building a big
string, then writing it out.
- Implement printing of ConstantPointerRefs
llvm-svn: 3389
2002-08-19 21:32:41 +00:00
Chris Lattner
119695e390
Remove support for NOT instruction
...
llvm-svn: 3320
2002-08-14 18:00:52 +00:00
Chris Lattner
0d3708d9dc
Avoid warning message
...
llvm-svn: 3085
2002-07-25 16:30:45 +00:00
Chris Lattner
aa9a5b5c15
Fix anands changes
...
llvm-svn: 2806
2002-06-30 16:07:20 +00:00
Anand Shukla
0de79ee516
added include<iostream> for cerr
...
llvm-svn: 2796
2002-06-25 21:29:10 +00:00
Anand Shukla
b35aa2b2e7
changes to make it compatible with 64bit gcc
...
llvm-svn: 2790
2002-06-25 20:44:04 +00:00
Chris Lattner
390c338968
* Update with MegaPatch
...
* Fix various bugs
llvm-svn: 2774
2002-06-25 15:57:03 +00:00
Chris Lattner
4864c06550
* Fix typeo
...
* Provide a #include of <malloc.h> so that the sun C compiler does not
miscompile malloc function calls
llvm-svn: 2702
2002-05-21 21:10:04 +00:00
Chris Lattner
b82857d705
Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.ll
...
llvm-svn: 2690
2002-05-21 18:05:19 +00:00
Chris Lattner
4d98351cea
Fix bug: test/Regression/CBackend/2002-05-16-NameCollide.ll by tracking
...
which global variables would have name collisions if they were not mangled,
and use this info to mangle them iff they would collide.
llvm-svn: 2639
2002-05-17 04:55:35 +00:00
Chris Lattner
a98304f4fa
Last minor cleanups, this code still does not work for all cases, but it
...
works much better than it used to.
llvm-svn: 2588
2002-05-09 21:31:18 +00:00
Chris Lattner
4ece8deba5
Two Cleanups to generated C code:
...
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).
llvm-svn: 2587
2002-05-09 21:18:38 +00:00
Chris Lattner
9a9b801669
* Remove CInstPrintVisitor class, incorporating it into the CWriter class
...
* Reorder code in the file to make it more logically laid out.
llvm-svn: 2586
2002-05-09 20:53:56 +00:00
Chris Lattner
3fd3c03371
Remove CLocalVars data structure entirely, instead of building stuff and
...
then printing it out, just print as we go.
llvm-svn: 2585
2002-05-09 20:39:03 +00:00
Chris Lattner
5ed180c1bd
Simplify code by removing InstLocalVarsVisitor, replacing it with a simple
...
inst_iterator.
llvm-svn: 2584
2002-05-09 20:33:35 +00:00
Chris Lattner
aa1d35be51
* Clean up how PHI nodes are handled
...
* 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
llvm-svn: 2583
2002-05-09 20:14:10 +00:00
Chris Lattner
94e4578db4
Emit:
...
l3_reg109 = l81_this->field0;
Instead of:
l3_reg109 = l81_this[0u].field0;
where possible
llvm-svn: 2579
2002-05-09 15:59:50 +00:00
Chris Lattner
97ae8c039e
* Print structures types correctly
...
* Clean up generated code to not emit basic block labels and goto
instructions if they are unneccesary (for example, fall throughs)
llvm-svn: 2578
2002-05-09 15:49:41 +00:00
Chris Lattner
93fb65370c
* Continue cleanup of type printing code
...
* 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
llvm-svn: 2577
2002-05-09 15:18:52 +00:00
Chris Lattner
b3acea93cf
Gut the type printing code so there is only one copy of it instead of 3
...
llvm-svn: 2576
2002-05-09 14:40:11 +00:00
Chris Lattner
619c55baec
* Remove dead "constant printing" code
...
* 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.
llvm-svn: 2575
2002-05-09 05:16:40 +00:00
Chris Lattner
cde698978f
Remove gross "Operand" instance variable
...
Remove lots of unneccesary arguments to methods
llvm-svn: 2574
2002-05-09 04:39:00 +00:00
Chris Lattner
e8573f21c7
Simplify and clean up function calls.
...
Now indirect function calls work, except that function pointer types are not correct.
llvm-svn: 2573
2002-05-09 04:21:21 +00:00
Chris Lattner
72286b8a3b
* Remove dead function
...
* Print C strings correctly
* Expand C escape sequences nicely (ie \n \t, etc get generated instead of hex escapes)
llvm-svn: 2572
2002-05-09 03:56:52 +00:00
Chris Lattner
c7b3367aad
Make Getelementptr, load & store all work the right way.
...
Handle global variables correctly.
llvm-svn: 2571
2002-05-09 03:50:42 +00:00
Chris Lattner
2a4f66f21d
Many random fixes:
...
* Use binary operator logic for shifts instead of cloning code
* Unary not is '~' not '!'
llvm-svn: 2570
2002-05-09 03:28:37 +00:00
Chris Lattner
87d656d2a6
Incorporate and purge function before and after printing them so unnamed values
...
have some hope of working right.
Function calls do not try to emit an lvalue if they return void.
llvm-svn: 2569
2002-05-09 03:12:34 +00:00
Chris Lattner
80f7e2db14
Factor out the code to print a value to ONE place.
...
It turns out that unnamed values DO NOT work at all, that's next on the list.
llvm-svn: 2568
2002-05-09 03:06:06 +00:00
Chris Lattner
558771c658
First wave of cleanups, looks like the first of many.
...
llvm-svn: 2567
2002-05-09 02:28:59 +00:00
Sumant Kowshik
64cf4b95c9
*** empty log message ***
...
llvm-svn: 2552
2002-05-08 18:09:58 +00:00