Commit Graph

68 Commits

Author SHA1 Message Date
Nick Hildenbrandt 85e3d59a1c Casting NULL can cause problems so lets just not cast NULL to anything.
llvm-svn: 4349
2002-10-28 19:54:06 +00:00
Nick Hildenbrandt c7147032f3 *** empty log message ***
llvm-svn: 4343
2002-10-28 19:05:12 +00:00
Nick Hildenbrandt 181dbf0851 Malloc prototyping now works even if the original file had its own prototype for malloc
llvm-svn: 4271
2002-10-23 18:59:40 +00:00
Chris Lattner 8fad3eab59 Fix bug: CBackend/2002-10-16-External.ll
llvm-svn: 4201
2002-10-16 20:08:47 +00:00
Chris Lattner c6e5d688af Fix bug: test/Regression/CBackend/2002-10-15-OpaqueTypeProblem.ll
llvm-svn: 4190
2002-10-16 00:08:22 +00:00
Nick Hildenbrandt fa6e71e31d Instead of adding stdlib we just prototype malloc correctly.
llvm-svn: 4118
2002-10-11 21:40:44 +00:00
Nick Hildenbrandt 8d354423fc Sun requires you to include stdlib to use malloc
llvm-svn: 4117
2002-10-11 18:41:44 +00:00
Vikram S. Adve 2cc6609e25 Bug fix: In preventing static global variables from being printed twice,
I also prevented external globals from being printed twice, but they
should (extern declaration and definition).

llvm-svn: 4043
2002-10-05 23:43:10 +00:00
Nick Hildenbrandt afff0a25b7 Add parens around constant calls to getelemptr to properly associate the reference
llvm-svn: 4032
2002-10-03 20:47:24 +00:00
Nick Hildenbrandt 2d3eb5a349 I was wrong on the removing of those references on the last commit.
llvm-svn: 4023
2002-10-02 21:14:33 +00:00
Nick Hildenbrandt bff2adb2a4 Removed unneeded reference and dereferences.
llvm-svn: 4016
2002-10-02 18:34:51 +00:00
Nick Hildenbrandt e07698b492 Cleaned up my last check-in.
llvm-svn: 4014
2002-10-02 18:32:35 +00:00
Nick Hildenbrandt e0ba1f25b6 No longer include malloc.h. If protoypes are needed for memory functions they will be present in the byte code and the generated c as well.
llvm-svn: 4013
2002-10-02 18:20:18 +00:00
Nick Hildenbrandt 386834b2f1 Fixed to properly escape quotes in strings.
llvm-svn: 3991
2002-09-30 21:11:55 +00:00
Nick Hildenbrandt 88e87783b8 Strings now handled correctly.
llvm-svn: 3920
2002-09-25 20:29:26 +00:00
Nick Hildenbrandt 9cedce62ee Parenthesis are now added to casts of type array.
llvm-svn: 3892
2002-09-23 21:02:50 +00:00
Chris Lattner 230d832e38 Fix cwriter to not output FP constants in ascii, output them in hex instead.
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.

llvm-svn: 3871
2002-09-20 23:26:33 +00:00
Chris Lattner 79ea4c4aa2 Fix bug: 2002-09-20-VarArgPrototypes.ll
llvm-svn: 3870
2002-09-20 22:32:30 +00:00
Chris Lattner 2895a2f421 Fix output of typedefs to avoid syntax errors.
* We now can correctly Cify the Olden-power benchmark

llvm-svn: 3860
2002-09-20 15:20:24 +00:00
Chris Lattner 7bd37ed1a6 * Add a couple of comments to the output c code
* _FIX_ infinite recursion problem, due to typedefs of a structure being
  printed before the structure.

llvm-svn: 3859
2002-09-20 15:18:30 +00:00
Chris Lattner 32d812feff Another change that doesn't affect functionality. Since we are only looking
at types in the symbol table, only traverse the type plane, saving a loop nest.

llvm-svn: 3858
2002-09-20 15:12:13 +00:00
Chris Lattner 9a973b4f6a Make the StructPrinted set only take memory when it's being used.
rename parseStruct to printContainedStructs

llvm-svn: 3857
2002-09-20 15:05:40 +00:00
Chris Lattner 37bd117997 No functionality changes, primarily just changing tab indentation to space
indentation

llvm-svn: 3856
2002-09-20 14:56:54 +00:00
Vikram S. Adve 9d0fb1aac5 Don't print global variable definitions twice! Sun's pathetic compiler
never complained about this.

llvm-svn: 3774
2002-09-17 11:50:38 +00:00
Vikram S. Adve 5c5c617b95 No longer need to sign-extend array indices to 64 bits since they
are now longs and not unsigned ints.

llvm-svn: 3731
2002-09-15 21:51:04 +00:00
Nick Hildenbrandt e89a6ebddd Fixed problem with printing struct definitions in the correct order.
This allows for the Regression/Transforms/ScalarReplacement/scalarize.c to run correctly.

llvm-svn: 3721
2002-09-14 21:36:24 +00:00
Chris Lattner d1a21f46ef Fix a bug introduced by the Getelementptr change
llvm-svn: 3695
2002-09-12 20:34:47 +00:00
Chris Lattner b9d9e0ff8d - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.

llvm-svn: 3681
2002-09-11 01:21:29 +00:00
Chris Lattner c61f6b0589 - Fix bug: test/Regression/CBackend/2002-08-20-RecursiveTypes.ll
- Converted CWriter to be an LLVM pass.

llvm-svn: 3558
2002-08-31 00:29:16 +00:00
Chris Lattner 91680b53f4 Fix bug: test/Regression/CBackend/2002-08-26-IndirectCallTest.ll
llvm-svn: 3511
2002-08-26 20:50:09 +00:00
Vikram S. Adve 8a5c9b15ae Fix the way parens are printed around "*ptrName" so that
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.

llvm-svn: 3506
2002-08-25 20:00:08 +00:00
Vikram S. Adve bc27523001 Sign-extend array index expressions to work correctly on non-32 bit machines.
llvm-svn: 3496
2002-08-24 14:44:23 +00:00
Anand Shukla 83a3654838 Changed default value of 3rd parameter in function definition
llvm-svn: 3492
2002-08-23 10:55:49 +00:00
Chris Lattner 030effa42c Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore

llvm-svn: 3484
2002-08-22 22:48:55 +00:00
Chris Lattner 7934dad0a0 Fix bug: 2002-08-20-UnnamedArgument.c
llvm-svn: 3401
2002-08-20 16:55:48 +00:00
Chris Lattner f3a86f0b57 Implement ConstantExprs in CWriter
llvm-svn: 3394
2002-08-19 23:09:46 +00:00
Chris Lattner 9ccab2c89b 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 b5815279c6 Output forward definitions of global vars to handle recursive intializers correctly.
llvm-svn: 3391
2002-08-19 21:48:40 +00:00
Chris Lattner fda3b293d8 - 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 7a74051566 Remove support for NOT instruction
llvm-svn: 3320
2002-08-14 18:00:52 +00:00
Chris Lattner f200f7b11a Avoid warning message
llvm-svn: 3085
2002-07-25 16:30:45 +00:00
Chris Lattner e8b6196f28 Fix anands changes
llvm-svn: 2806
2002-06-30 16:07:20 +00:00
Anand Shukla 7e9d0710e6 added include<iostream> for cerr
llvm-svn: 2796
2002-06-25 21:29:10 +00:00
Anand Shukla eaa2e7204e changes to make it compatible with 64bit gcc
llvm-svn: 2790
2002-06-25 20:44:04 +00:00
Chris Lattner f8b0668cc1 * Update with MegaPatch
* Fix various bugs

llvm-svn: 2774
2002-06-25 15:57:03 +00:00
Chris Lattner c839a2574e * 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 e7c7df07f3 Fix bug: test/Regression/CBackend/2002-05-21-MissingReturn.ll
llvm-svn: 2690
2002-05-21 18:05:19 +00:00
Chris Lattner 5b3057bb82 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 e291226f02 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 d4c569c973 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