Commit Graph

76 Commits

Author SHA1 Message Date
Chris Lattner
6e6026b465 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 18:36:02 +00:00
Nick Hildenbrandt
a1a64f8f27 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4754 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 22:21:52 +00:00
Nick Hildenbrandt
9850237536 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4745 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 20:55:50 +00:00
Chris Lattner
9c1338b71c _REALLY_ fix the float constant problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4609 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 22:12:53 +00:00
Chris Lattner
eb6f8c757f Print out 'float' constants correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4607 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-07 19:43:59 +00:00
Nick Hildenbrandt
088b472eed Fixes escapeing bug in strings. Fixes test case test/Regression/CBackend/2002-11-06-PrintEscaped.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4583 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 21:40:23 +00:00
Nick Hildenbrandt
2cf2cbcefb Loads and stores can't be inlined. This fixes test/Singlesource/matrixTranspose
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4579 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-06 20:07:54 +00:00
Nick Hildenbrandt
7e9fea736d Fixed bug in Regression/CBackend/2002-10-30-FunctionPointerAlloca.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-01 17:37:09 +00:00
Nick Hildenbrandt
f0fca36d14 Casting NULL can cause problems so lets just not cast NULL to anything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4349 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:54:06 +00:00
Nick Hildenbrandt
50de36a41d *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4343 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-28 19:05:12 +00:00
Nick Hildenbrandt
3cecdc5b9a Malloc prototyping now works even if the original file had its own prototype for malloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4271 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-23 18:59:40 +00:00
Chris Lattner
e8e035b591 Fix bug: CBackend/2002-10-16-External.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4201 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-16 20:08:47 +00:00
Chris Lattner
04b72c821e Fix bug: test/Regression/CBackend/2002-10-15-OpaqueTypeProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4190 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-16 00:08:22 +00:00
Nick Hildenbrandt
98360a1752 Instead of adding stdlib we just prototype malloc correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4118 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-11 21:40:44 +00:00
Nick Hildenbrandt
c7140e9bd9 Sun requires you to include stdlib to use malloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4117 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-11 18:41:44 +00:00
Vikram S. Adve
2a408f06b5 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4043 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-05 23:43:10 +00:00
Nick Hildenbrandt
d2eb386c16 Add parens around constant calls to getelemptr to properly associate the reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4032 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-03 20:47:24 +00:00
Nick Hildenbrandt
ca626922bc I was wrong on the removing of those references on the last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4023 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 21:14:33 +00:00
Nick Hildenbrandt
51c84d14ab Removed unneeded reference and dereferences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4016 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:34:51 +00:00
Nick Hildenbrandt
275801b2dd Cleaned up my last check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4014 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:32:35 +00:00
Nick Hildenbrandt
113ad893b9 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4013 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 18:20:18 +00:00
Nick Hildenbrandt
c3dd2af428 Fixed to properly escape quotes in strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3991 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-30 21:11:55 +00:00
Nick Hildenbrandt
e548f009f7 Strings now handled correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3920 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 20:29:26 +00:00
Nick Hildenbrandt
c14ded4858 Parenthesis are now added to casts of type array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3892 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 21:02:50 +00:00
Chris Lattner
d1cf1b458a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3871 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 23:26:33 +00:00
Chris Lattner
1f8c4a17c1 Fix bug: 2002-09-20-VarArgPrototypes.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3870 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 22:32:30 +00:00
Chris Lattner
270d78a8d6 Fix output of typedefs to avoid syntax errors.
* 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 15:20:24 +00:00
Chris Lattner
58d04d4e35 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3859 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:18:30 +00:00
Chris Lattner
2db41cd5de 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3858 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:12:13 +00:00
Chris Lattner
2c601a7be1 Make the StructPrinted set only take memory when it's being used.
rename parseStruct to printContainedStructs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3857 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 15:05:40 +00:00
Chris Lattner
a4c047ec27 No functionality changes, primarily just changing tab indentation to space
indentation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3856 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-20 14:56:54 +00:00
Vikram S. Adve
913bfbc2e4 Don't print global variable definitions twice! Sun's pathetic compiler
never complained about this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3774 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 11:50:38 +00:00
Vikram S. Adve
9d6f13f34b No longer need to sign-extend array indices to 64 bits since they
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-15 21:51:04 +00:00
Nick Hildenbrandt
67aa2e235d Fixed problem with printing struct definitions in the correct order.
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-14 21:36:24 +00:00
Chris Lattner
59afbf3999 Fix a bug introduced by the Getelementptr change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3695 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-12 20:34:47 +00:00
Chris Lattner
106ff4551c - Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3681 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 01:21:29 +00:00
Chris Lattner
0e9f93ea37 - Fix bug: test/Regression/CBackend/2002-08-20-RecursiveTypes.ll
- 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-31 00:29:16 +00:00
Chris Lattner
fabc8803a3 Fix bug: test/Regression/CBackend/2002-08-26-IndirectCallTest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3511 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-26 20:50:09 +00:00
Vikram S. Adve
969c4ad65d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3506 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-25 20:00:08 +00:00
Vikram S. Adve
42eb2bae8e Sign-extend array index expressions to work correctly on non-32 bit machines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3496 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-24 14:44:23 +00:00
Anand Shukla
ed0f1c5285 Changed default value of 3rd parameter in function definition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3492 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-23 10:55:49 +00:00
Chris Lattner
5dfe767b87 Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3484 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 22:48:55 +00:00
Chris Lattner
4cda83568e Fix bug: 2002-08-20-UnnamedArgument.c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3401 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-20 16:55:48 +00:00
Chris Lattner
df35a1cb4b Implement ConstantExprs in CWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3394 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19 23:09:46 +00:00
Chris Lattner
83c577566e Incorporate calcTypeNameVar into CWriter class, fixing
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-19 22:17:53 +00:00
Chris Lattner
a4d4a855d8 Output forward definitions of global vars to handle recursive intializers correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3391 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19 21:48:40 +00:00
Chris Lattner
6d49292003 - 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3389 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19 21:32:41 +00:00
Chris Lattner
20e8e01c5d Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3320 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:00:52 +00:00
Chris Lattner
4b367217c2 Avoid warning message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3085 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 16:30:45 +00:00
Chris Lattner
e7f65d3b71 Fix anands changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2806 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:07:20 +00:00