oota-llvm.git
20 years agoBug fixes for PR341
Chris Lattner [Thu, 15 Jul 2004 01:29:12 +0000 (01:29 +0000)]
Bug fixes for PR341

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14838 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImplement folding of expressions like 'uint cast (int* getelementptr (int*
Chris Lattner [Thu, 15 Jul 2004 01:16:59 +0000 (01:16 +0000)]
Implement folding of expressions like 'uint cast (int* getelementptr (int*
null, uint 1) to uint)' to a constant integer.  We can only do this with
primitive LLVM types, because other types have target-specific sizes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14837 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoYeah, how about those 'primative' types huh?
Chris Lattner [Thu, 15 Jul 2004 01:15:53 +0000 (01:15 +0000)]
Yeah, how about those 'primative' types huh?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14836 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoNow that we codegen the portable "sizeof" efficiently, we can use it for
Chris Lattner [Thu, 15 Jul 2004 01:08:08 +0000 (01:08 +0000)]
Now that we codegen the portable "sizeof" efficiently, we can use it for
malloc lowering.  This means that lowerallocations doesn't need targetdata
anymore.  yaay.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14835 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImprove codegen for the LLVM offsetof/sizeof "operator". Before we compiled
Chris Lattner [Thu, 15 Jul 2004 00:58:53 +0000 (00:58 +0000)]
Improve codegen for the LLVM offsetof/sizeof "operator".  Before we compiled
this LLVM function:

int %foo() {
        ret int cast (int** getelementptr (int** null, int 1) to int)
}

into:

foo:
        mov %EAX, 0
        lea %EAX, DWORD PTR [%EAX + 4]
        ret

now we compile it into:

foo:
        mov %EAX, 4
        ret

This sequence is frequently generated by the MSIL front-end, and soon the malloc lowering pass and
Java front-ends as well..

-Chris

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14834 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoYou cannot pass functions by value, what does that even mean??
Chris Lattner [Wed, 14 Jul 2004 23:14:07 +0000 (23:14 +0000)]
You cannot pass functions by value, what does that even mean??

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14833 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agothis "feature" is gone
Chris Lattner [Wed, 14 Jul 2004 23:12:09 +0000 (23:12 +0000)]
this "feature" is gone

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14832 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoThis is logically part of the last patch. Just more really horrible code
Chris Lattner [Wed, 14 Jul 2004 23:07:13 +0000 (23:07 +0000)]
This is logically part of the last patch.  Just more really horrible code
that is made unnecessary by it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14831 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago** Finally DeclareNewGlobalValue is dead!
Chris Lattner [Wed, 14 Jul 2004 23:03:46 +0000 (23:03 +0000)]
** Finally DeclareNewGlobalValue is dead!
* Simplify a lot of code because type's cannot be in function symbol tables
* Fix memory leaks in handling of redefined function prototypes
* Don't use SymbolTable directly for stuff that we can go through the Module
  for.
* Fix some minor bugs on obscure testcases like:
      test/Feature/globalredefinition.ll
* Do not create GlobalVariable objects for forward referenced Functions!
* When forward referencing a function in a constant expression, do not create
  a placeholder, add a bunch of references to it, then turn around and
  replaceAllUsesOfWith on it with a new global, deleting the placeholder.
  Instead, when we find the real definition of the global, just use the
  placeholder instead of creating a new object.

This substantially simplifies the asmwriter and should even speed it up on
cases heavy in constantexprs (like C++, Java, MSIL)...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14830 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoNew, horrible, testcase
Chris Lattner [Wed, 14 Jul 2004 22:59:47 +0000 (22:59 +0000)]
New, horrible, testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14829 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago* Fairly substantial change. Instead of creating new globalvariables, then
Chris Lattner [Wed, 14 Jul 2004 21:44:00 +0000 (21:44 +0000)]
* Fairly substantial change.  Instead of creating new globalvariables, then
  replaceAllUsesWith'ing any forward references, just use the forward
  reference if it exists.

This introduces GetForwardRefForGlobal, which will eventually completely
replace the horrible DeclareNewGlobalValue function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14828 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFold setValueNameMergingDuplicates into ParseGlobalVariable, allowing us
Chris Lattner [Wed, 14 Jul 2004 20:42:57 +0000 (20:42 +0000)]
Fold setValueNameMergingDuplicates into ParseGlobalVariable, allowing us
to substantially simplify the result.  In particular, we no longer create
GlobalVariables and then immediately destroy them when they are duplciate
definitions.

The real point of this patch though is that it gets us closer to the
DeclareNewGlobalValue calls...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14827 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoActually set the endian/pointersize flags on the module being read in!
Brian Gaeke [Wed, 14 Jul 2004 20:33:13 +0000 (20:33 +0000)]
Actually set the endian/pointersize flags on the module being read in!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14826 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoSimplify logic.
Chris Lattner [Wed, 14 Jul 2004 20:27:12 +0000 (20:27 +0000)]
Simplify logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14825 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoMake PATypeHolder and friends return non-const pointers to the types they
Chris Lattner [Wed, 14 Jul 2004 20:10:26 +0000 (20:10 +0000)]
Make PATypeHolder and friends return non-const pointers to the types they
hold.  Because types are basically immutable anyway, they should not be
referenced as "const Type*" everywhere.  Just "Type*" should suffice!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14824 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFix a regression from last night. Apparently the CFE is broken and outputs
Chris Lattner [Wed, 14 Jul 2004 19:33:47 +0000 (19:33 +0000)]
Fix a regression from last night.  Apparently the CFE is broken and outputs
functions multiple times, expecting them to be merged.  This should be fixed
in the CFE, then here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14823 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoMake sure MTSPR instruction is inserted into the BasicBlock
Misha Brukman [Wed, 14 Jul 2004 18:26:31 +0000 (18:26 +0000)]
Make sure MTSPR instruction is inserted into the BasicBlock

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14822 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImplement new helper methods for creating two-index GEP instructions
Chris Lattner [Wed, 14 Jul 2004 18:14:33 +0000 (18:14 +0000)]
Implement new helper methods for creating two-index GEP instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14821 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago* Change code to use a static_cast instead of reinterpret_cast
Chris Lattner [Wed, 14 Jul 2004 18:13:54 +0000 (18:13 +0000)]
* Change code to use a static_cast instead of reinterpret_cast
* Add comments
* Add two new gep ctors for the very common case of creating a two operand
  GEP instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14820 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoDon't define the same register twice when loading a ConstantPointerRef to a reg
Misha Brukman [Wed, 14 Jul 2004 17:57:04 +0000 (17:57 +0000)]
Don't define the same register twice when loading a ConstantPointerRef to a reg

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14819 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago* Fix multiplication by powers of two and otherwise
Misha Brukman [Wed, 14 Jul 2004 15:29:51 +0000 (15:29 +0000)]
* Fix multiplication by powers of two and otherwise
* Clarify variable name (StoreInst SI instead of LI)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14818 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoPull out code shared between GV forward-decl and definition processing.
Chris Lattner [Wed, 14 Jul 2004 08:23:52 +0000 (08:23 +0000)]
Pull out code shared between GV forward-decl and definition processing.
This gives us only a single call site for setValueNameMergingDuplicates.
The next stage is the start merging them together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14811 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoSimplify code. Do not allow functions to be redefined more than once.
Chris Lattner [Wed, 14 Jul 2004 07:12:48 +0000 (07:12 +0000)]
Simplify code.  Do not allow functions to be redefined more than once.
Since the stupid '%X = const int 4' thing is gone, we can now simplify
setValueNameMergingDuplicates a bit more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14810 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoRemove a gross and crufty "feature" that was never documented and doesn't work.
Chris Lattner [Wed, 14 Jul 2004 06:44:56 +0000 (06:44 +0000)]
Remove a gross and crufty "feature" that was never documented and doesn't work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14809 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFinegrainify namespacification
Chris Lattner [Wed, 14 Jul 2004 06:39:48 +0000 (06:39 +0000)]
Finegrainify namespacification

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14808 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoRevamp handling of labels. In particular, if we create a forward reference
Chris Lattner [Wed, 14 Jul 2004 06:28:35 +0000 (06:28 +0000)]
Revamp handling of labels.  In particular, if we create a forward reference
for a basic block, use it when the block is defined instead of deleting it
and creating a new one.  Also, only create at most ONE forward reference
for any block, instead of one for each forward reference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14807 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd Machine-CFG edges to SparcV9 MachineBasicBlocks.
Brian Gaeke [Wed, 14 Jul 2004 05:40:50 +0000 (05:40 +0000)]
Add Machine-CFG edges to SparcV9 MachineBasicBlocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14806 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoSplit the basic block handling case out of getVal into getBBVal.
Chris Lattner [Wed, 14 Jul 2004 01:33:11 +0000 (01:33 +0000)]
Split the basic block handling case out of getVal into getBBVal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14805 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoMake Argument::print more resilient to non-verifiable IR
Chris Lattner [Tue, 13 Jul 2004 23:14:34 +0000 (23:14 +0000)]
Make Argument::print more resilient to non-verifiable IR

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14801 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoCatch aggregates passed by value sooner rather than later.
Chris Lattner [Tue, 13 Jul 2004 20:09:51 +0000 (20:09 +0000)]
Catch aggregates passed by value sooner rather than later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14800 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago* Specify that FP arith options have 3 operands
Misha Brukman [Tue, 13 Jul 2004 15:35:45 +0000 (15:35 +0000)]
* Specify that FP arith options have 3 operands
* Correctly load FP constants from the constant pool, should be refactored

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14799 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoActually, use an exception to stop verification. This gives us much better
Chris Lattner [Tue, 13 Jul 2004 08:48:04 +0000 (08:48 +0000)]
Actually, use an exception to stop verification.  This gives us much better
error messages because verification stops at the first error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14794 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoThere is no reason to abort and print a stack trace if there is a verification
Chris Lattner [Tue, 13 Jul 2004 08:45:41 +0000 (08:45 +0000)]
There is no reason to abort and print a stack trace if there is a verification
error.  Just print the message like a good little tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14793 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFine-grainify namespacification, prune #include
Chris Lattner [Tue, 13 Jul 2004 08:42:12 +0000 (08:42 +0000)]
Fine-grainify namespacification, prune #include

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14792 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFix typeo and refactor bb productions to make it possible for us to reuse any
Chris Lattner [Tue, 13 Jul 2004 08:39:15 +0000 (08:39 +0000)]
Fix typeo and refactor bb productions to make it possible for us to reuse any
forward reference blocks if they have been created (instead of creating a new
block, replaceAllUsesOfWith, then nuking the placeholder).   This is not yet
implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14791 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoEliminate some mega-cruft here. There is no reason to DERIVE FROM IR CLASSES
Chris Lattner [Tue, 13 Jul 2004 08:28:21 +0000 (08:28 +0000)]
Eliminate some mega-cruft here.  There is no reason to DERIVE FROM IR CLASSES
just to keep track of some per-object state!  Gaah!  Whoever wrote this stuff...
oh wait, that would be me.  Never mind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14790 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoInline the now trivial setValueNameInternal function into both callers
Chris Lattner [Tue, 13 Jul 2004 08:12:39 +0000 (08:12 +0000)]
Inline the now trivial setValueNameInternal function into both callers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14789 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoNow that basic blocks are eagerly inserted into the Function, we can use
Chris Lattner [Tue, 13 Jul 2004 08:10:10 +0000 (08:10 +0000)]
Now that basic blocks are eagerly inserted into the Function, we can use
the funciton symbol table to check for conflicts instead of having to
keep a shadow named LocalSymtab.  Totally eliminate LocalSymtab.  Verified
that this did not cause a regression on the testcase for PR107.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14788 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoA couple of substantial cleanup fixes:
Chris Lattner [Tue, 13 Jul 2004 07:59:27 +0000 (07:59 +0000)]
A couple of substantial cleanup fixes:
  1. Split setValueName into two separate functions, one that is only used
     at function scope and doesn't have to deal with duplicates, and one
     that can be used either at global or function scope but that does deal
     with conflicts.  Conflicts were only in there because of the crappy old
     CFE and probably should be entirely eliminated.
  2. Insert BasicBlock's into the parent functions when they are created
     instead of when they are complete.  This effects name lookup (for the
     better), which will be exploited in the next patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14787 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFix warning on SparcV9, where sizeof (int) != sizeof (void *).
Brian Gaeke [Tue, 13 Jul 2004 07:37:43 +0000 (07:37 +0000)]
Fix warning on SparcV9, where sizeof (int) != sizeof (void *).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14786 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoReplace a bunch of complex ConstantPointerRef referring code with simple
Chris Lattner [Tue, 13 Jul 2004 06:58:07 +0000 (06:58 +0000)]
Replace a bunch of complex ConstantPointerRef referring code with simple
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14785 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoMake tblgen not try to be smart. This is better handled in makefiles if
Chris Lattner [Tue, 13 Jul 2004 06:11:46 +0000 (06:11 +0000)]
Make tblgen not try to be smart.  This is better handled in makefiles if
at all.  Patch contributed by Vladimir Prus!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14784 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFactor some code to handle "load (constantexpr cast foo)" just like
Chris Lattner [Tue, 13 Jul 2004 01:49:43 +0000 (01:49 +0000)]
Factor some code to handle "load (constantexpr cast foo)" just like
"load (cast foo)".  This allows us to compile C++ code like this:

class Bclass {
  public: virtual int operator()() { return 666; }
};

class Dclass: public Bclass {
  public: virtual int operator()() { return 667; }
} ;

int main(int argc, char** argv) {
  Dclass x;
  return x();
}

Into this:

int %main(int %argc, sbyte** %argv) {
entry:
        call void %__main( )
        ret int 667
}

Instead of this:

int %main(int %argc, sbyte** %argv) {
entry:
        %x = alloca "struct.std::bad_typeid"            ; <"struct.std::bad_typeid"*> [#uses=3]
        call void %__main( )
        %tmp.1.i.i = getelementptr "struct.std::bad_typeid"* %x, uint 0, uint 0, uint 0         ; <int (...)***> [#uses=1]
        store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Bclass, int 0, long 2), int (...)*** %tmp.1.i.i
        %tmp.3.i = getelementptr "struct.std::bad_typeid"* %x, int 0, uint 0, uint 0            ; <int (...)***> [#uses=1]
        store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2), int (...)*** %tmp.3.i
        %tmp.5 = load int ("struct.std::bad_typeid"*)** cast (int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2) to int
("struct.std::bad_typeid"*)**)          ; <int ("struct.std::bad_typeid"*)*> [#uses=1]
        %tmp.6 = call int %tmp.5( "struct.std::bad_typeid"* %x )                ; <int> [#uses=1]
ret int %tmp.6
        ret int 0
}

In order words, we now resolve the virtual function call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14783 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoCorrectly load FP constants out of the constant pool.
Misha Brukman [Mon, 12 Jul 2004 23:49:47 +0000 (23:49 +0000)]
Correctly load FP constants out of the constant pool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14782 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoApple's MacOS X is another OS which does not provide alloca() via <alloca.h>
Misha Brukman [Mon, 12 Jul 2004 23:37:18 +0000 (23:37 +0000)]
Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14781 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImplement getModuleMatchQuality and getJITMatchQuality() for PowerPC
Misha Brukman [Mon, 12 Jul 2004 23:36:12 +0000 (23:36 +0000)]
Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14780 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago* Tabs to spaces
Misha Brukman [Mon, 12 Jul 2004 22:58:07 +0000 (22:58 +0000)]
* Tabs to spaces
* Delete extra blank lines

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14779 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoNew open proj: C/C++ compiler in C++, with link to Ed Willink's C++ yacc grammar
Misha Brukman [Mon, 12 Jul 2004 21:10:47 +0000 (21:10 +0000)]
New open proj: C/C++ compiler in C++, with link to Ed Willink's C++ yacc grammar

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14778 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd a helper method. The StructType element is completely redundant in most
Chris Lattner [Mon, 12 Jul 2004 20:36:08 +0000 (20:36 +0000)]
Add a helper method.  The StructType element is completely redundant in most
cases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14777 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoimplement new helper method
Chris Lattner [Mon, 12 Jul 2004 20:35:11 +0000 (20:35 +0000)]
implement new helper method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14776 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFix unused var warning
Chris Lattner [Mon, 12 Jul 2004 20:29:52 +0000 (20:29 +0000)]
Fix unused var warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14775 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFix a really nasty logic error that VC noticed.
Chris Lattner [Mon, 12 Jul 2004 20:27:31 +0000 (20:27 +0000)]
Fix a really nasty logic error that VC noticed.
Reid, this might matter to you :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14774 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd a missing #include
Chris Lattner [Mon, 12 Jul 2004 20:25:33 +0000 (20:25 +0000)]
Add a missing #include

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14773 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFix warning compiling with VC++
Chris Lattner [Mon, 12 Jul 2004 20:25:04 +0000 (20:25 +0000)]
Fix warning compiling with VC++

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14772 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agonew feature
Chris Lattner [Mon, 12 Jul 2004 17:09:23 +0000 (17:09 +0000)]
new feature

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14770 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago* Clarify Sparc as SparcV9
Misha Brukman [Mon, 12 Jul 2004 16:55:41 +0000 (16:55 +0000)]
* Clarify Sparc as SparcV9
* Add link to bugzilla bug with list of miscompiled SparcV9 programs
* Wrap long lines

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14769 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImplement a new method useful for things like the inliner
Chris Lattner [Mon, 12 Jul 2004 01:17:52 +0000 (01:17 +0000)]
Implement a new method useful for things like the inliner

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14768 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImplement new method
Chris Lattner [Mon, 12 Jul 2004 01:17:34 +0000 (01:17 +0000)]
Implement new method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14767 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoCorrect an output typo.
Reid Spencer [Sun, 11 Jul 2004 23:20:54 +0000 (23:20 +0000)]
Correct an output typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14766 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoVarious cleanups:
Reid Spencer [Sun, 11 Jul 2004 17:28:43 +0000 (17:28 +0000)]
Various cleanups:
- Remove tabs
- Standardize use of space around ( and ).
- Consolidate the ConstantPlaceHolder class
- Rename two methods to be more meaningful (ParseType, ParseTypes)
- Correct indentation of blocks
- Add documentation
- Convert input dependent asserts to error(...) so it throws instead.
Provide placeholder implementations of read_float and read_double that
still read in platform-specific endianess. When I figure out how to do
this without knowing the endianess of the platform, it will get implemented
correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14765 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago- Rename two methods to give them more meaning
Reid Spencer [Sun, 11 Jul 2004 17:24:05 +0000 (17:24 +0000)]
- Rename two methods to give them more meaning
- Add read_float and read_double in preparation for a correct
  implementation of bytecode floating point support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14764 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoRemove tabs.
Reid Spencer [Sun, 11 Jul 2004 17:22:51 +0000 (17:22 +0000)]
Remove tabs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14763 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoPrepare the writer for a non-broken implementation of writing floating
Reid Spencer [Sun, 11 Jul 2004 17:22:07 +0000 (17:22 +0000)]
Prepare the writer for a non-broken implementation of writing floating
point values. This will be fixed when I figure out how to do it correctly
without depending on knowing the endianess of a platform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14762 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoThe cleanup is done. Update comment.
Chris Lattner [Sun, 11 Jul 2004 08:24:02 +0000 (08:24 +0000)]
The cleanup is done.  Update comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14761 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoMake add constantexprs work with all types, fixing the regressions from last night
Chris Lattner [Sun, 11 Jul 2004 08:01:11 +0000 (08:01 +0000)]
Make add constantexprs work with all types, fixing the regressions from last night

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14760 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImplement TargetRegistrationListener
Chris Lattner [Sun, 11 Jul 2004 06:03:21 +0000 (06:03 +0000)]
Implement TargetRegistrationListener

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14759 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd a new listener class for things that want to be informed about new
Chris Lattner [Sun, 11 Jul 2004 06:02:59 +0000 (06:02 +0000)]
Add a new listener class for things that want to be informed about new
targets that are loaded

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14758 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoDelete the allocate*TargetMachine function, which is now dead.
Chris Lattner [Sun, 11 Jul 2004 04:17:58 +0000 (04:17 +0000)]
Delete the allocate*TargetMachine function, which is now dead.
The shared command line options are now in a header that makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14757 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoDelete the allocate*TargetMachine function, which is now dead .
Chris Lattner [Sun, 11 Jul 2004 04:17:10 +0000 (04:17 +0000)]
Delete the allocate*TargetMachine function, which is now dead .
The shared command line options are now in a header that makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14756 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoDelete the allocate*TargetMachine function, which is now dead .
Chris Lattner [Sun, 11 Jul 2004 04:16:31 +0000 (04:16 +0000)]
Delete the allocate*TargetMachine function, which is now dead .

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14755 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoDelete the allocate*TargetMachine functions. Move options to a header file
Chris Lattner [Sun, 11 Jul 2004 04:15:52 +0000 (04:15 +0000)]
Delete the allocate*TargetMachine functions.  Move options to a header file
that makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14754 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoPrune unused #include
Chris Lattner [Sun, 11 Jul 2004 04:05:32 +0000 (04:05 +0000)]
Prune unused #include

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14753 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoGoodbye macro hell, hello nice clean and simple code. This also gives llc
Chris Lattner [Sun, 11 Jul 2004 04:03:24 +0000 (04:03 +0000)]
Goodbye macro hell, hello nice clean and simple code.  This also gives llc
the ability to dynamically load and use targets that are not linked into it
statically.  e.g.:

  llc -load libparisc.so -march=parisc foo.bc -o foo.s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14751 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoGoodbye macro hell, hello nice clean simple extensible code. This change
Chris Lattner [Sun, 11 Jul 2004 04:02:06 +0000 (04:02 +0000)]
Goodbye macro hell, hello nice clean simple extensible code.  This change
also gives the JIT the ability to dynamically load targets. e.g.

lli -load libparisc.so -march=parisc foo.bc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14750 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImplement a couple of methods that TargetMachineRegistry now provides. See,
Chris Lattner [Sun, 11 Jul 2004 04:00:19 +0000 (04:00 +0000)]
Implement a couple of methods that TargetMachineRegistry now provides.  See,
I told you this file wasn't useless :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14749 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd a new TargetNameParser class, which is useful for parsing options.
Chris Lattner [Sun, 11 Jul 2004 03:59:46 +0000 (03:59 +0000)]
Add a new TargetNameParser class, which is useful for parsing options.
Add two methods which are useful for autoselecting targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14748 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoMake these format a bit nicer
Chris Lattner [Sun, 11 Jul 2004 03:27:42 +0000 (03:27 +0000)]
Make these format a bit nicer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14747 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoProvide better support for pointer-valued command line arguments
Chris Lattner [Sun, 11 Jul 2004 03:18:30 +0000 (03:18 +0000)]
Provide better support for pointer-valued command line arguments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14746 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAuto-registrate target
Chris Lattner [Sun, 11 Jul 2004 02:48:49 +0000 (02:48 +0000)]
Auto-registrate target

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14745 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd compilability
Chris Lattner [Sun, 11 Jul 2004 02:48:28 +0000 (02:48 +0000)]
Add compilability

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14744 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoInitial impl of this file. Yes this is pretty useless right now, but it
Chris Lattner [Sun, 11 Jul 2004 02:44:26 +0000 (02:44 +0000)]
Initial impl of this file.  Yes this is pretty useless right now, but it
will grow in time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14743 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFirst cut at TargetMachineRegistry and RegisterTarget classes
Chris Lattner [Sun, 11 Jul 2004 02:43:43 +0000 (02:43 +0000)]
First cut at TargetMachineRegistry and RegisterTarget classes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14742 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd two new "virtual static" methods to the TargetMachine class
Chris Lattner [Sun, 11 Jul 2004 02:43:07 +0000 (02:43 +0000)]
Add two new "virtual static" methods to the TargetMachine class

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14741 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd -load option
Chris Lattner [Sun, 11 Jul 2004 01:08:19 +0000 (01:08 +0000)]
Add -load option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14740 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd a -load option
Chris Lattner [Sun, 11 Jul 2004 01:06:59 +0000 (01:06 +0000)]
Add a -load option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14739 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoImplicitly getting a new option by linking to support.o instead of support.a
Chris Lattner [Sun, 11 Jul 2004 01:04:33 +0000 (01:04 +0000)]
Implicitly getting a new option by linking to support.o instead of support.a
is a bad idea.  Make tools that want the option #include PluginSupport.h
explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14738 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd a new header
Chris Lattner [Sun, 11 Jul 2004 01:03:57 +0000 (01:03 +0000)]
Add a new header

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14737 91177308-0d34-0410-b5e6-96231b3b80d8

20 years ago- Correct grammar of -s description
Reid Spencer [Sat, 10 Jul 2004 23:41:08 +0000 (23:41 +0000)]
- Correct grammar of -s description
- Normalize -s option specification

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14736 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoGroup the hidden command line arguments.
Reid Spencer [Sat, 10 Jul 2004 23:35:46 +0000 (23:35 +0000)]
Group the hidden command line arguments.
Make the -s option actually work and default to the right value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14735 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd link to the stkrc page
Chris Lattner [Sat, 10 Jul 2004 21:43:12 +0000 (21:43 +0000)]
Add link to the stkrc page

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14734 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoCommand Guide for the Stacker language compiler, stkrc.
Reid Spencer [Sat, 10 Jul 2004 20:04:02 +0000 (20:04 +0000)]
Command Guide for the Stacker language compiler, stkrc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14733 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoReplace use of defunct Type::setName method with SymbolTable::insert.
Reid Spencer [Sat, 10 Jul 2004 16:37:42 +0000 (16:37 +0000)]
Replace use of defunct Type::setName method with SymbolTable::insert.
Patch found and provided by Vladimir Merzliakov. Thanks Vladimir!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14732 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoMake the VBRSavings percentage make sense (as a fraction of the total
Reid Spencer [Sat, 10 Jul 2004 08:04:13 +0000 (08:04 +0000)]
Make the VBRSavings percentage make sense (as a fraction of the total
expanded size instead of the file size). Thanks Chris.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14731 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoMinor cleanups:
Chris Lattner [Sat, 10 Jul 2004 06:06:56 +0000 (06:06 +0000)]
Minor cleanups:
 * Mention the --help and --help-hidden options
 * Don't say program when we really mean any old bytecode file
 * Add a link to the man pages
 * Move analyze down in the list, as it's not as important as the rest

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14730 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoError Handling Cleanup:
Reid Spencer [Fri, 9 Jul 2004 22:21:33 +0000 (22:21 +0000)]
Error Handling Cleanup:
- get rid of PARSE_ERROR macro
- add error(std::string) function
- use error(std::string) for all errors
- make input dependent asserts call error(std::string) instead
- ensure asserts are only for logic bugs, not input discrepancies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14729 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoFix a backwards compatibility bug found by Tanya. In version 1.2, the
Reid Spencer [Fri, 9 Jul 2004 21:13:53 +0000 (21:13 +0000)]
Fix a backwards compatibility bug found by Tanya. In version 1.2, the
global type plane starts with a length and the TypeTyID value to identify
the type plane has having type definitions. This doesn't happen in 1.3
because the types are read from a known position in the file. However, the
TypeTyID must be read in (and ignored) if its a 1.2 bytecode file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14728 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoRemoved unneeded forward decl
Chris Lattner [Fri, 9 Jul 2004 17:02:57 +0000 (17:02 +0000)]
Removed unneeded forward decl

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14727 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoRemove unused method
Chris Lattner [Fri, 9 Jul 2004 16:48:13 +0000 (16:48 +0000)]
Remove unused method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14726 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoAdd checks to ensure that there are no unreachable blocks in the function
Chris Lattner [Fri, 9 Jul 2004 16:44:37 +0000 (16:44 +0000)]
Add checks to ensure that there are no unreachable blocks in the function

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14725 91177308-0d34-0410-b5e6-96231b3b80d8

20 years agoDon't call Type::setName()
Chris Lattner [Fri, 9 Jul 2004 16:43:55 +0000 (16:43 +0000)]
Don't call Type::setName()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14724 91177308-0d34-0410-b5e6-96231b3b80d8