1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

12970 Commits

Author SHA1 Message Date
Chris Lattner
183766f21e Make Argument::print more resilient to non-verifiable IR
llvm-svn: 14801
2004-07-13 23:14:34 +00:00
Chris Lattner
1a1afa3566 Catch aggregates passed by value sooner rather than later.
llvm-svn: 14800
2004-07-13 20:09:51 +00:00
Misha Brukman
79b089abff * Specify that FP arith options have 3 operands
* Correctly load FP constants from the constant pool, should be refactored

llvm-svn: 14799
2004-07-13 15:35:45 +00:00
Chris Lattner
1fa594cf7b Actually, use an exception to stop verification. This gives us much better
error messages because verification stops at the first error.

llvm-svn: 14794
2004-07-13 08:48:04 +00:00
Chris Lattner
2d343521e2 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.

llvm-svn: 14793
2004-07-13 08:45:41 +00:00
Chris Lattner
96d249c97a Fine-grainify namespacification, prune #include
llvm-svn: 14792
2004-07-13 08:42:12 +00:00
Chris Lattner
ed8ebfdac9 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.

llvm-svn: 14791
2004-07-13 08:39:15 +00:00
Chris Lattner
3ab20a8c6a 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.

llvm-svn: 14790
2004-07-13 08:28:21 +00:00
Chris Lattner
2314ffe629 Inline the now trivial setValueNameInternal function into both callers
llvm-svn: 14789
2004-07-13 08:12:39 +00:00
Chris Lattner
34682ff049 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.

llvm-svn: 14788
2004-07-13 08:10:10 +00:00
Chris Lattner
83973de5a7 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.

llvm-svn: 14787
2004-07-13 07:59:27 +00:00
Brian Gaeke
f6ec78a335 Fix warning on SparcV9, where sizeof (int) != sizeof (void *).
llvm-svn: 14786
2004-07-13 07:37:43 +00:00
Chris Lattner
7aa45e259a Replace a bunch of complex ConstantPointerRef referring code with simple
code.

llvm-svn: 14785
2004-07-13 06:58:07 +00:00
Chris Lattner
817b562565 Make tblgen not try to be smart. This is better handled in makefiles if
at all.  Patch contributed by Vladimir Prus!

llvm-svn: 14784
2004-07-13 06:11:46 +00:00
Chris Lattner
fca5fee9d5 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.

llvm-svn: 14783
2004-07-13 01:49:43 +00:00
Misha Brukman
449715a57d Correctly load FP constants out of the constant pool.
llvm-svn: 14782
2004-07-12 23:49:47 +00:00
Misha Brukman
da8ed5f4d5 Apple's MacOS X is another OS which does not provide alloca() via <alloca.h>
llvm-svn: 14781
2004-07-12 23:37:18 +00:00
Misha Brukman
b7f3d7b04b Implement getModuleMatchQuality and getJITMatchQuality() for PowerPC
llvm-svn: 14780
2004-07-12 23:36:12 +00:00
Misha Brukman
c9bf3b6db9 * Tabs to spaces
* Delete extra blank lines

llvm-svn: 14779
2004-07-12 22:58:07 +00:00
Misha Brukman
34d55eb8a1 New open proj: C/C++ compiler in C++, with link to Ed Willink's C++ yacc grammar
llvm-svn: 14778
2004-07-12 21:10:47 +00:00
Chris Lattner
10686c55cc Add a helper method. The StructType element is completely redundant in most
cases

llvm-svn: 14777
2004-07-12 20:36:08 +00:00
Chris Lattner
3f023d6df9 implement new helper method
llvm-svn: 14776
2004-07-12 20:35:11 +00:00
Chris Lattner
9fc90f37fd Fix unused var warning
llvm-svn: 14775
2004-07-12 20:29:52 +00:00
Chris Lattner
d581590c73 Fix a really nasty logic error that VC noticed.
Reid, this might matter to you :)

llvm-svn: 14774
2004-07-12 20:27:31 +00:00
Chris Lattner
528291513f Add a missing #include
llvm-svn: 14773
2004-07-12 20:25:33 +00:00
Chris Lattner
2bf0308d44 Fix warning compiling with VC++
llvm-svn: 14772
2004-07-12 20:25:04 +00:00
Chris Lattner
ded33b4131 new feature
llvm-svn: 14770
2004-07-12 17:09:23 +00:00
Misha Brukman
8680151c4c * Clarify Sparc as SparcV9
* Add link to bugzilla bug with list of miscompiled SparcV9 programs
* Wrap long lines

llvm-svn: 14769
2004-07-12 16:55:41 +00:00
Chris Lattner
4d2009965c Implement a new method useful for things like the inliner
llvm-svn: 14768
2004-07-12 01:17:52 +00:00
Chris Lattner
b704df8365 Implement new method
llvm-svn: 14767
2004-07-12 01:17:34 +00:00
Reid Spencer
7e948057af Correct an output typo.
llvm-svn: 14766
2004-07-11 23:20:54 +00:00
Reid Spencer
c6bdf47e72 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.

llvm-svn: 14765
2004-07-11 17:28:43 +00:00
Reid Spencer
1d6847c22e - 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.

llvm-svn: 14764
2004-07-11 17:24:05 +00:00
Reid Spencer
af6625347f Remove tabs.
llvm-svn: 14763
2004-07-11 17:22:51 +00:00
Reid Spencer
1a22913bac 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.

llvm-svn: 14762
2004-07-11 17:22:07 +00:00
Chris Lattner
196b4f394f The cleanup is done. Update comment.
llvm-svn: 14761
2004-07-11 08:24:02 +00:00
Chris Lattner
6029e3234e Make add constantexprs work with all types, fixing the regressions from last night
llvm-svn: 14760
2004-07-11 08:01:11 +00:00
Chris Lattner
e0ccf04c10 Implement TargetRegistrationListener
llvm-svn: 14759
2004-07-11 06:03:21 +00:00
Chris Lattner
050495885f Add a new listener class for things that want to be informed about new
targets that are loaded

llvm-svn: 14758
2004-07-11 06:02:59 +00:00
Chris Lattner
773f2d65c2 Delete the allocate*TargetMachine function, which is now dead.
The shared command line options are now in a header that makes sense.

llvm-svn: 14757
2004-07-11 04:17:58 +00:00
Chris Lattner
6331eb6bbe Delete the allocate*TargetMachine function, which is now dead .
The shared command line options are now in a header that makes sense.

llvm-svn: 14756
2004-07-11 04:17:10 +00:00
Chris Lattner
9e183d06a6 Delete the allocate*TargetMachine function, which is now dead .
llvm-svn: 14755
2004-07-11 04:16:31 +00:00
Chris Lattner
2ea95d837e Delete the allocate*TargetMachine functions. Move options to a header file
that makes sense.

llvm-svn: 14754
2004-07-11 04:15:52 +00:00
Chris Lattner
4cfce6dea3 Prune unused #include
llvm-svn: 14753
2004-07-11 04:05:32 +00:00
Chris Lattner
0171aec781 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

llvm-svn: 14751
2004-07-11 04:03:24 +00:00
Chris Lattner
6bbbf294d1 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

llvm-svn: 14750
2004-07-11 04:02:06 +00:00
Chris Lattner
646bc16b63 Implement a couple of methods that TargetMachineRegistry now provides. See,
I told you this file wasn't useless :)

llvm-svn: 14749
2004-07-11 04:00:19 +00:00
Chris Lattner
2a79beb587 Add a new TargetNameParser class, which is useful for parsing options.
Add two methods which are useful for autoselecting targets.

llvm-svn: 14748
2004-07-11 03:59:46 +00:00
Chris Lattner
b67e3b01bc Make these format a bit nicer
llvm-svn: 14747
2004-07-11 03:27:42 +00:00
Chris Lattner
3f154d5c7c Provide better support for pointer-valued command line arguments
llvm-svn: 14746
2004-07-11 03:18:30 +00:00