1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

307 Commits

Author SHA1 Message Date
Chris Lattner
f1c684b3a2 Silence VS warnings.
llvm-svn: 19390
2005-01-08 20:07:03 +00:00
Alkis Evlogimenos
189fdf11db Do not allow empty label names.
llvm-svn: 18743
2004-12-10 05:40:19 +00:00
Chris Lattner
e0936a0bd3 Implement test/Feature/escaped_label.ll
llvm-svn: 18741
2004-12-10 05:27:29 +00:00
Chris Lattner
dabf541efb Add support for compilers with arg dependent name lookup, contributed by
Bjørn Wennberg

llvm-svn: 18628
2004-12-08 16:13:53 +00:00
Reid Spencer
d505b99715 For PR409: \
Make sure to check isValueValidForType on floating point constants and give \
an error if the value is not valid, otherwise it would assert in the VMCore

llvm-svn: 18584
2004-12-06 22:18:25 +00:00
Chris Lattner
bf49c461ef Fix PR463
llvm-svn: 18303
2004-11-28 16:45:45 +00:00
Reid Spencer
a909f95ebd Make sure that the yacc and lex output are specified as BUILT_SOURCES.
Correct the dependency of the Lexer.o file on the constructed
llvmAsmParser.h header file. It is not the Lexer.cpp file that depends on
the header, its the output of compiling Lexer.cpp, Lexer.o

llvm-svn: 17289
2004-10-28 00:43:24 +00:00
Reid Spencer
d3f7233495 Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Chris Lattner
d8ac6d4a25 Plug a memory leak in the asmparser. It turns out that we were leaking
the strings for basic block labels in some cases.  This amounted to about
120K of memory for namd, a medium sized program.

llvm-svn: 17262
2004-10-26 18:26:14 +00:00
Reid Spencer
e48ba34fd4 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer
ce514b1c2c Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner
eb973c8226 Parse undef and unreachable
llvm-svn: 17053
2004-10-16 18:17:13 +00:00
Reid Spencer
e6418ec30f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer
7d9cba7a0f Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Chris Lattner
e2607964ae Add a check to avoid an assertion on malformed input
llvm-svn: 16861
2004-10-09 02:18:58 +00:00
Reid Spencer
7bd9d86b65 Okay, the list of link-time passes wasn't such a hot idea. Its prone to
error. We'll strategize on this when we have multiple front ends to deal
with. For now llvm-ld just runs a standard set of transforms.

llvm-svn: 16333
2004-09-14 05:43:23 +00:00
Reid Spencer
4a1593ebd2 Add support for the link-time pass list to Modules.
llvm-svn: 16321
2004-09-13 23:44:23 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer
fdbcdb732f Examine the type code in the setcc class of instructions and if it
is a PackedType, throw an error. Temporary solution.

Patch contributed by Brad Jones.

llvm-svn: 15963
2004-08-21 16:11:02 +00:00
Chris Lattner
fb6d2225ff quish a warning
llvm-svn: 15954
2004-08-20 18:07:39 +00:00
Brian Gaeke
01636f4e0f Packed types, brought to you by Brad Jones
llvm-svn: 15938
2004-08-20 06:00:58 +00:00
Chris Lattner
54c0c44d38 Work around PR424 for old c/c++ frontends.
llvm-svn: 15882
2004-08-17 17:26:41 +00:00
Alkis Evlogimenos
fb27f702ca Merge i*.h headers into Instructions.h as part of bug403.
llvm-svn: 15325
2004-07-29 12:17:34 +00:00
Chris Lattner
4fcb3b1e7d Fix bug in previous patch :(
llvm-svn: 15226
2004-07-26 01:40:20 +00:00
Chris Lattner
1bb4db76b2 Fix an extremely serious regression that was causing LLVM basic blocks to be
scrambled around almost at random, having really bad effects on icache locality.

llvm-svn: 15225
2004-07-26 01:22:59 +00:00
Reid Spencer
04819ff173 Adjust to new Module.h interface for dependent libraries
Remove mem leaks resulting from not freeing parse strings.

llvm-svn: 15217
2004-07-25 21:30:51 +00:00
Reid Spencer
4b76a409e5 bug 263:
Provide parsing for the target triple and dependent libraries.

llvm-svn: 15209
2004-07-25 17:58:28 +00:00
Reid Spencer
282e14928d bug 263:
Provide new tokens for target triples and dependent libraries.

llvm-svn: 15208
2004-07-25 17:56:00 +00:00
Reid Spencer
6ed43e1320 bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
- Remove tabs
- Fix coments refering to ConstantPointerRef

llvm-svn: 14937
2004-07-18 00:08:11 +00:00
Chris Lattner
f849543948 Fix the regressions handling unnamed global variables
llvm-svn: 14870
2004-07-16 01:18:09 +00:00
Chris Lattner
7397a61a7f This is logically part of the last patch. Just more really horrible code
that is made unnecessary by it.

llvm-svn: 14831
2004-07-14 23:07:13 +00:00
Chris Lattner
d81b8323ee ** 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)...

llvm-svn: 14830
2004-07-14 23:03:46 +00:00
Chris Lattner
7bef7be4c4 * 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.

llvm-svn: 14828
2004-07-14 21:44:00 +00:00
Chris Lattner
5b80b7157a 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...

llvm-svn: 14827
2004-07-14 20:42:57 +00:00
Chris Lattner
7044b0d4e1 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.

llvm-svn: 14823
2004-07-14 19:33:47 +00:00
Chris Lattner
6472a6b770 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.

llvm-svn: 14811
2004-07-14 08:23:52 +00:00
Chris Lattner
9827ad9f08 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.

llvm-svn: 14810
2004-07-14 07:12:48 +00:00
Chris Lattner
fafef8ecd1 Remove a gross and crufty "feature" that was never documented and doesn't work.
llvm-svn: 14809
2004-07-14 06:44:56 +00:00
Chris Lattner
633e78c5c6 Finegrainify namespacification
llvm-svn: 14808
2004-07-14 06:39:48 +00:00
Chris Lattner
a262a55378 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.

llvm-svn: 14807
2004-07-14 06:28:35 +00:00
Chris Lattner
483a35c547 Split the basic block handling case out of getVal into getBBVal.
llvm-svn: 14805
2004-07-14 01:33:11 +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
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
75bbce2fdb Don't call Type::setName()
llvm-svn: 14724
2004-07-09 16:43:55 +00:00
Chris Lattner
2d48ef104b Eliminate uses of the UniqueID field on Type objects
llvm-svn: 14707
2004-07-08 22:30:50 +00:00
Reid Spencer
d5ed7fb8fb - remove use of isa<Type>(Val) since there's no inheritance relationship
any more. Needed for bug 122
- #include <iostream> since Value.h doesn't include it any more.

llvm-svn: 14621
2004-07-04 12:19:05 +00:00
Reid Spencer
172bb5ee88 Remove use of Type::TypeTy which is no longer defined. This change needed
for bug 122 since the "Type Type" concept is gone now.

llvm-svn: 14620
2004-07-04 12:17:44 +00:00
Chris Lattner
0cd29ae2cd Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Reid Spencer
686af1f8bc Remove some more dead code resulting from adding setTypeName().
llvm-svn: 13862
2004-05-28 00:21:06 +00:00
Reid Spencer
3077b8e168 Remove an assertion that uses Type::TypeTy that is never hit and will
break when Type::TypeTy goes away. Also remove a dead block of code and
dead comments.

llvm-svn: 13861
2004-05-27 22:05:50 +00:00
Chris Lattner
a7e4eba812 Add support for dos-style files
llvm-svn: 13837
2004-05-27 17:49:14 +00:00
Reid Spencer
9a0451787d Provide the correct patch for bug 345. The solution is to add a setTypeName
function to llvmAsmParser.y and then use it in the one place in the grammar
that needs it. Also had to make Type::setName public because setTypeName
needs it in order to retain compatibility with setValueName.

llvm-svn: 13795
2004-05-26 21:48:31 +00:00
Chris Lattner
70d84370e1 A quick and ugly hack to fix PR345. I used TypeTy specifically to make
Reid cringe :)

llvm-svn: 13788
2004-05-26 17:08:25 +00:00
Reid Spencer
1190d6061c Changed to use SymbolTable's new lookup interface.
llvm-svn: 13758
2004-05-25 17:29:21 +00:00
Chris Lattner
22ca3df5b1 Fix a memory leak. We leaked the vector holding the entries in switch tables.
llvm-svn: 13023
2004-04-17 23:49:15 +00:00
Chris Lattner
f78d930837 Support getelementptr instructions which use uint's to index into structure
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.

Auto-upgrade .ll files that use ubytes to index into structures to use uint's.

llvm-svn: 12652
2004-04-05 01:30:04 +00:00
Chris Lattner
6ea8b0176c Avoid TRUE and FALSE which apparently conflict with some macros on OSX
llvm-svn: 12566
2004-03-31 03:49:47 +00:00
Chris Lattner
d265077f6d Fix bug: Assembler/2004-03-30-UnclosedFunctionCrash.llx
llvm-svn: 12551
2004-03-30 20:58:25 +00:00
Chris Lattner
f3867b270c Hrm, we were leaking ~1M of garbage that valgrind never told us about because
it was "reachable".  Cute.

llvm-svn: 12515
2004-03-19 23:34:33 +00:00
Chris Lattner
81df059f63 Allow parsing select instruction and constant expr
llvm-svn: 12313
2004-03-12 05:51:36 +00:00
Chris Lattner
e44cc1372e Insert functions into the module promptly, not lazily. This fixes a bug
I introduced last night.  Note to self: test the *correct* tree...

llvm-svn: 12220
2004-03-08 16:14:19 +00:00
Chris Lattner
df5ebdc8b1 Eliminate a REALLY HORRIBLE API: mutateReferences, which is gross gross gross.
llvm-svn: 12212
2004-03-08 06:09:57 +00:00
Chris Lattner
034a264a99 It turns out that the two dimensional vectors were causing big slowdowns
in this for programs with lots of types (like the testcase in PR224).
The problem was that the type ID that the outer vector was using was not
very dense (as many types are getting resolved), so the vector is large
and gets reallocated a lot.

Since there are a lot of values in the program (the .ll file is 10M),
each reallocation has to copy the subvectors, which is also quite slow
(this wouldn't be a problem if C++ supported move semantics, but it
doesn't, at least not yet :(

Changing the outer data structure to a map speeds a release build of
llvm-as up from 11.21s to 5.13s on the testcase in PR224.

llvm-svn: 11244
2004-02-09 21:03:38 +00:00
Chris Lattner
7eb118e4f7 When resolving upreferences, if multiple uprefs will be resolved to the same
type at the same time, resolve the upreferences to each other before resolving
it to the outer type.  This shaves off some time from the testcase in PR224, from
25.41s -> 21.72s.

llvm-svn: 11241
2004-02-09 18:53:54 +00:00
Chris Lattner
16690fad3d Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
a1757d1d91 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
2b3eaf045b This #include is not needed, it should have been removed with the last patch
llvm-svn: 11222
2004-02-09 03:22:32 +00:00
Chris Lattner
76292e7fcc Instead of searching the entire type graph for a type to determine if it
contains the type we are looking for, just search the immediately used types.
We can only do this because we keep the "current" type in the nesting level
as we decrement upreferences.

This change speeds up the testcase in PR224 from 50.4s to 22.08s, not
too shabby.

llvm-svn: 11221
2004-02-09 03:19:29 +00:00
Chris Lattner
645f8fb4e5 Upreferences are always OpaqueTypes, meaning that it is impossible for a non-abstract
type from containing one.  This speeds up the asmparser on the testcase in PR224 from
61->50s.

llvm-svn: 11220
2004-02-09 03:03:10 +00:00
Chris Lattner
2e51b50de1 Change the 'exception' destination to the 'unwind' destination. We will always
allow 'except' instead of 'unwind' here though.

llvm-svn: 11203
2004-02-08 21:48:25 +00:00
Chris Lattner
758109ce2e Don't use ConstantExpr::getShift anymore
llvm-svn: 10791
2004-01-12 19:08:43 +00:00
Chris Lattner
fe95ceadaf Minor code cleanups. The only bugfix is to the UR_DEBUG stuff which didn't
compile when enabled.

llvm-svn: 10657
2003-12-31 02:18:11 +00:00
Chris Lattner
c09a6f0621 Right, fix the problem with invoke instructions, not just call instructions
llvm-svn: 10599
2003-12-23 22:18:36 +00:00
Chris Lattner
c1dd02538a Do not delete the type holder until after the call instruction has been
constructed!

llvm-svn: 10598
2003-12-23 20:39:17 +00:00
Chris Lattner
defd9ccd73 Minor cleanups, plug a minor memory leak
llvm-svn: 10596
2003-12-23 20:05:15 +00:00
Chris Lattner
fe5dac5c16 To not barf when an error occurs.
llvm-svn: 10236
2003-11-26 07:24:58 +00:00
Chris Lattner
59f92a51f1 Fix PR147
llvm-svn: 10204
2003-11-25 03:54:16 +00:00
Chris Lattner
f987c67a53 Check return types of functions
llvm-svn: 10146
2003-11-21 22:32:23 +00:00
Chris Lattner
70c6fff394 Don't crash on bogus source value
llvm-svn: 10132
2003-11-21 20:27:35 +00:00
Chris Lattner
be56c11ccc Fix bug PR107, patch contributed by Reid Spencer!
llvm-svn: 9911
2003-11-12 04:40:30 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
034bfaddf0 Make sure that PHI node operands are first class types
llvm-svn: 9607
2003-10-30 01:38:18 +00:00
Misha Brukman
6ace5e86b1 * Eliminate `using' directive
* Order #includes as per style guide

llvm-svn: 9429
2003-10-23 18:00:34 +00:00
John Criswell
de34542f41 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell
71d2894956 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
7a4e225f37 Eliminate unused class
llvm-svn: 9270
2003-10-19 21:39:41 +00:00
Chris Lattner
87843f87b8 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
llvm-svn: 9269
2003-10-19 21:34:28 +00:00
Chris Lattner
d0e3a15a9e New revised variable argument handling support
llvm-svn: 9219
2003-10-18 05:53:13 +00:00
Chris Lattner
17f8f2e317 Tighten up handling of checks for shift instructions
llvm-svn: 9191
2003-10-17 05:11:44 +00:00
Chris Lattner
39b976aed8 Minor cleanups
llvm-svn: 9177
2003-10-16 20:12:13 +00:00
Chris Lattner
f46c45682a Add support for 'weak' linkage.
llvm-svn: 9171
2003-10-16 18:29:00 +00:00
Chris Lattner
f2ed60c0b7 Decrease usage of use_size()
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Chris Lattner
b6c8569f05 Regularize header file comments
llvm-svn: 9071
2003-10-13 03:32:08 +00:00
Brian Gaeke
b4b2fa9060 Include <cctype> and <cstdlib> instead of <ctype.h> and "Config/stdlib.h".
llvm-svn: 9036
2003-10-10 19:12:08 +00:00