Commit Graph

413 Commits

Author SHA1 Message Date
Chris Lattner
83beacddc9 Do not read free'd memory when printing an error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20295 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-24 04:59:49 +00:00
Chris Lattner
a08976b092 C++ is not a functional programming language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20274 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-22 23:13:58 +00:00
Chris Lattner
595f06c6da Fix test/Regression/Assembler/2005-01-31-CallingAggregateFunction.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19966 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:47:42 +00:00
Chris Lattner
ce1df9e9e8 Adjust to slight changes in instruction interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19893 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:35:55 +00:00
Chris Lattner
6d8dbecff2 Add support for compilers with arg dependent name lookup, contributed by
Bjørn Wennberg


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18628 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-08 16:13:53 +00:00
Reid Spencer
9f9b3acfce 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18584 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-06 22:18:25 +00:00
Chris Lattner
7891593359 Fix PR463
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18303 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 16:45:45 +00:00
Chris Lattner
e8343a5fbb 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17262 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26 18:26:14 +00:00
Chris Lattner
16710e9574 Parse undef and unreachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17053 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:17:13 +00:00
Chris Lattner
1c1bb33534 Add a check to avoid an assertion on malformed input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-09 02:18:58 +00:00
Reid Spencer
1c7b907325 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16333 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-14 05:43:23 +00:00
Reid Spencer
e59eaf407a Add support for the link-time pass list to Modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16321 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-13 23:44:23 +00:00
Reid Spencer
551ccae044 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/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Reid Spencer
57b6eec5e6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15963 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 16:11:02 +00:00
Chris Lattner
42db1a04ef quish a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15954 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 18:07:39 +00:00
Brian Gaeke
715c90ba52 Packed types, brought to you by Brad Jones
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-20 06:00:58 +00:00
Chris Lattner
c6d2f15037 Work around PR424 for old c/c++ frontends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15882 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 17:26:41 +00:00
Alkis Evlogimenos
eb62bc77b6 Merge i*.h headers into Instructions.h as part of bug403.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15325 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 12:17:34 +00:00
Chris Lattner
8d65a06a3e Fix bug in previous patch :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15226 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 01:40:20 +00:00
Chris Lattner
badf091b47 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15225 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 01:22:59 +00:00
Reid Spencer
feaf10e571 Adjust to new Module.h interface for dependent libraries
Remove mem leaks resulting from not freeing parse strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15217 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:30:51 +00:00
Reid Spencer
0be13e7f14 bug 263:
Provide parsing for the target triple and dependent libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15209 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:58:28 +00:00
Reid Spencer
3271ed554a 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14937 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:08:11 +00:00
Chris Lattner
a2d4b3cfeb Fix the regressions handling unnamed global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14870 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 01:18:09 +00:00
Chris Lattner
0f01bbc3b2 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
2004-07-14 23:07:13 +00:00
Chris Lattner
a09000db75 ** 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
2004-07-14 23:03:46 +00:00
Chris Lattner
8a32784ad4 * 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
2004-07-14 21:44:00 +00:00
Chris Lattner
cb9d6a8f73 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
2004-07-14 20:42:57 +00:00
Chris Lattner
d9ce6adfcc 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
2004-07-14 19:33:47 +00:00
Chris Lattner
d88998db01 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
2004-07-14 08:23:52 +00:00
Chris Lattner
66028f208e 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
2004-07-14 07:12:48 +00:00
Chris Lattner
e002694ce2 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
2004-07-14 06:44:56 +00:00
Chris Lattner
8642763f11 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14808 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-14 06:39:48 +00:00
Chris Lattner
2e2ed2995a 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
2004-07-14 06:28:35 +00:00
Chris Lattner
64116f980e 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
2004-07-14 01:33:11 +00:00
Chris Lattner
22ae232d98 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
2004-07-13 08:39:15 +00:00
Chris Lattner
bc721ed100 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
2004-07-13 08:28:21 +00:00
Chris Lattner
c9aea52ae4 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
2004-07-13 08:12:39 +00:00
Chris Lattner
8c89a0a1fd 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
2004-07-13 08:10:10 +00:00
Chris Lattner
8ab406d5bd 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
2004-07-13 07:59:27 +00:00
Chris Lattner
38ab6bff5d 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
2004-07-13 06:58:07 +00:00
Chris Lattner
8ca2dc0710 Don't call Type::setName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14724 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 16:43:55 +00:00
Chris Lattner
735f2700d6 Eliminate uses of the UniqueID field on Type objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14707 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 22:30:50 +00:00
Reid Spencer
8ce1da781e - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14621 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:19:05 +00:00
Chris Lattner
f70c22b019 Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-17 18:19:28 +00:00
Reid Spencer
4e6620c9e0 Remove some more dead code resulting from adding setTypeName().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13862 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-28 00:21:06 +00:00
Reid Spencer
9ed0f17a62 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 22:05:50 +00:00
Reid Spencer
75719bf239 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13795 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-26 21:48:31 +00:00
Chris Lattner
42fbc7e809 A quick and ugly hack to fix PR345. I used TypeTy specifically to make
Reid cringe :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13788 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-26 17:08:25 +00:00
Reid Spencer
b152f9ff78 Changed to use SymbolTable's new lookup interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13758 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 17:29:21 +00:00
Chris Lattner
f57a43da9c Fix a memory leak. We leaked the vector holding the entries in switch tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13023 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-17 23:49:15 +00:00
Chris Lattner
830b6f9868 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12652 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:30:04 +00:00
Chris Lattner
91ef460285 Avoid TRUE and FALSE which apparently conflict with some macros on OSX
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12566 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-31 03:49:47 +00:00
Chris Lattner
bc280abd46 Fix bug: Assembler/2004-03-30-UnclosedFunctionCrash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12551 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-30 20:58:25 +00:00
Chris Lattner
76f0ff394d Allow parsing select instruction and constant expr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12313 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-12 05:51:36 +00:00
Chris Lattner
63a225050f Insert functions into the module promptly, not lazily. This fixes a bug
I introduced last night.  Note to self: test the *correct* tree...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12220 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 16:14:19 +00:00
Chris Lattner
bc2075977c Eliminate a REALLY HORRIBLE API: mutateReferences, which is gross gross gross.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12212 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-08 06:09:57 +00:00
Chris Lattner
16af11d962 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11244 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 21:03:38 +00:00
Chris Lattner
026a8ce312 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11241 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 18:53:54 +00:00
Chris Lattner
d21cd809b6 Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11228 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 04:37:31 +00:00
Chris Lattner
d5d8996720 Start using the new and improve interface to FunctionType arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11224 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 04:14:01 +00:00
Chris Lattner
bcb6afba33 This #include is not needed, it should have been removed with the last patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11222 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 03:22:32 +00:00
Chris Lattner
3b07386724 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11221 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 03:19:29 +00:00
Chris Lattner
2c37c18c6e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11220 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-09 03:03:10 +00:00
Chris Lattner
a58e3a16c5 Change the 'exception' destination to the 'unwind' destination. We will always
allow 'except' instead of 'unwind' here though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11203 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-08 21:48:25 +00:00
Chris Lattner
b16689b647 Don't use ConstantExpr::getShift anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:08:43 +00:00
Chris Lattner
c7d3f6b6bf Minor code cleanups. The only bugfix is to the UR_DEBUG stuff which didn't
compile when enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10657 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 02:18:11 +00:00
Chris Lattner
9cd42575c2 Right, fix the problem with invoke instructions, not just call instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10599 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 22:18:36 +00:00
Chris Lattner
f64d57ada8 Do not delete the type holder until after the call instruction has been
constructed!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10598 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 20:39:17 +00:00
Chris Lattner
a989b234bd Minor cleanups, plug a minor memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10596 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 20:05:15 +00:00
Chris Lattner
4257098c36 To not barf when an error occurs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10236 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-26 07:24:58 +00:00
Chris Lattner
0b268fb75e Fix PR147
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10204 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 03:54:16 +00:00
Chris Lattner
c282f5a380 Check return types of functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10146 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 22:32:23 +00:00
Chris Lattner
ae711a8b48 Don't crash on bogus source value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10132 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 20:27:35 +00:00
Chris Lattner
15b697214e Fix bug PR107, patch contributed by Reid Spencer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9911 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-12 04:40:30 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Chris Lattner
8ea8f36a7f Make sure that PHI node operands are first class types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9607 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-30 01:38:18 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
Chris Lattner
3b237fcd38 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:34:28 +00:00
Chris Lattner
99e7ab72c8 New revised variable argument handling support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9219 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:53:13 +00:00
Chris Lattner
888d3bc0cd Tighten up handling of checks for shift instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9191 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 05:11:44 +00:00
Chris Lattner
394f2eb03d Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9177 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 20:12:13 +00:00
Chris Lattner
72ac148d49 Add support for 'weak' linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9171 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 18:29:00 +00:00
Chris Lattner
fd05924946 Decrease usage of use_size()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-15 16:48:29 +00:00
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Chris Lattner
bd2531f8a6 Reserve space for PHI operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9007 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 16:34:58 +00:00
Chris Lattner
f797cabedf Accept 'weak' as a linkage type. For now, just turn it into linkonce linkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8998 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 04:54:02 +00:00
Chris Lattner
0f3bc5ecc2 Add better checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8996 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 03:56:01 +00:00
Chris Lattner
876dc577d5 The objects mapped are really PATypeHolders, not PATypeHandles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8822 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 19:00:34 +00:00
Chris Lattner
79ad13808b Oops, look at the VOLATILE marker, not the opcode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8413 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 20:29:46 +00:00
Chris Lattner
36143fc444 Add support for the unwind instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8408 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:54:55 +00:00
Chris Lattner
15c9c0352e Parse volatile loads/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8402 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:20:29 +00:00
Chris Lattner
8c8418ddb4 Remove gross old hacky code that was in there for backwards compatibility
1 year is plenty of migration time!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8282 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:31:28 +00:00
Chris Lattner
4354f564c2 Rename SwitchInst::dest_push_back -> addCase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8089 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 23:14:52 +00:00
Chris Lattner
6c23f57ebc Accept double quoted strings everwhere we accept a %ABC variable name.
This introduces one more innoculous shift-reduce conflict, but will REALLY
help the type names generated by the C++ frontend, which wants to use all
kinds of crazy stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8050 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-22 05:42:10 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Chris Lattner
949a362802 Remove redundant const qualifiers from cast<> expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7253 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:30:06 +00:00
Misha Brukman
bc0e998c49 The word separate' only has one e'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7173 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-14 17:20:40 +00:00
Chris Lattner
f460048771 Add support for a new zeroinitializer token which can be used to get rid of
huge arrays of zero initialized values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6937 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 20:01:34 +00:00
Chris Lattner
893f025262 Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6774 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 19:22:36 +00:00
Chris Lattner
5e458e26b3 Fix bugs:
Assembler/2003-05-21-MalformedShiftCrash.llx
  Assembler/2003-05-21-ConstantShiftExpr.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6258 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 17:48:56 +00:00
Chris Lattner
c6212f1920 Fix bugs:
Assembler/2003-05-21-EmptyStructTest.ll
  Assembler/2003-05-21-MalformedStructCrash.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6255 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 16:06:56 +00:00
Chris Lattner
196850c2c4 Fix bug: Assembler/2003-05-15-SwitchBug.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6239 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-15 21:30:00 +00:00
Chris Lattner
8f77daef04 Add support for the new va_arg instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 02:44:12 +00:00
Chris Lattner
b8fdd8ba61 Fix bug: Assembler/2003-04-25-UnresolvedGlobalReference.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5948 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-25 21:47:33 +00:00
Chris Lattner
b9bcbb533f Allow information about the target to be specified in the .ll file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5843 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 19:07:06 +00:00
Chris Lattner
9232b99461 Namespacify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5840 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 18:42:41 +00:00
Chris Lattner
75f20532ec Preserve module source information in the ModuleID
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5836 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 18:02:52 +00:00
Chris Lattner
4ad02e726d Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:28:45 +00:00
Chris Lattner
1f862af473 Don't allow declaring an external internal variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5781 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 18:13:57 +00:00
Chris Lattner
af76d0ea0b Fix bug: Assember2003-04-15-ConstantInitAssertion.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5777 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-15 16:09:31 +00:00
Chris Lattner
adf99700a7 Fix bug: Assembler/2003-03-03-DuplicateConstant.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5692 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-03 23:28:55 +00:00
Chris Lattner
bb3e5d4f6e Fix bug: Assembler/2003-02-02-ConstGlobal.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5467 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-02 16:40:20 +00:00
Chris Lattner
bae362f8fc Fix bug: Assembler/2003-01-30-UnsignedString.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5445 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 22:24:26 +00:00
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
Chris Lattner
bf0a37b9aa - Fix bug: Assembler/2002-10-15-NameClash.ll
- Clean up code a bit, s/Method/Function/


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4188 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-15 21:41:14 +00:00
Chris Lattner
9e932bd566 This loop executed exactly one time, turn it into straightline code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4159 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 03:28:42 +00:00
Chris Lattner
69da5cf261 - Change Function's so that their argument list is populated when they are
constructed.  Before, external functions would have an empty argument list,
    now a Function ALWAYS has a populated argument list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 20:57:00 +00:00
Chris Lattner
e43f40bc17 Minor, non-functionality changing, formatting fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4091 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 00:25:32 +00:00
Chris Lattner
08c0e6af4f The parser now accepts "external" global variables, in addition to the backwards
compatible "uninitialized" global variables


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4050 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-06 22:45:09 +00:00
Chris Lattner
05804b7459 Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-13 22:28:45 +00:00
Chris Lattner
0235fe2b72 Recently changed getelementptr to use 'long' indexes for sequential types
instead of uints.  This adds a translation scheme to be backwards compatible
with old .ll files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3679 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 01:17:27 +00:00
Chris Lattner
1cff96a77c Use explicit ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3663 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 22:37:46 +00:00
Chris Lattner
4a6482ba9c Tighten up error checking in parser, disallowing instructions that f.e.,
add pointers together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3660 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 19:57:26 +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
0383cc4455 - Fix asmparser and bytecode reader to not generate loads/stores with idxs
Now an obnoxious warning is emitted to discourage usage.  Eventually
    support will be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3435 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 23:51:21 +00:00
Chris Lattner
d78700de8e - Remove unused STRING token from lexer & parser
- Changed parser to always use parenthesis on ConstExprs to be consistent
  - Parser now passes TRUE and FALSE tokens as a special case of the ConstExpr
    machinery instead of a special case of constant int stuff
  - Fix the AsmParser to use ValueRef ::= ConstExpr, and remove
    ResolvedVal ::= ConstExpr this allows constexprs to be used in PHI nodes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3362 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-16 21:14:40 +00:00
Chris Lattner
ec1b8a0796 Parse const expr cast instruction the same way the instruction is formed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3353 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 19:37:11 +00:00
Chris Lattner
d05e359b10 Move ConstExpr production to unify ConstVal stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3351 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 18:17:28 +00:00
Chris Lattner
3101c25293 Fix bug: test/Regression/Assembler/2002-08-15-UnresolvedGlobalReference.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3350 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 17:58:33 +00:00
Chris Lattner
ad333484ea Remove support for Not ConstantExpr. This simplifies the unary case to only
have to support the cast instruction, so the function is renamed to getCast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3328 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:24:09 +00:00
Chris Lattner
699f1eb214 AsmParser turns 'not' instructions into 'xor' instructions now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3309 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:12:33 +00:00
Chris Lattner
c188eeb08c Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3161 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:25 +00:00
Chris Lattner
a4e251822a Add check to fix bug:
test/Regression/Assembler/2002-07-25-ParserAssertionFailure.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3101 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 20:52:56 +00:00
Chris Lattner
bcafccebdb GCC 3.1 changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3074 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 06:17:42 +00:00
Chris Lattner
f8dff732ae * Code cleanups
* Fix a REALLY misleading error message


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2960 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 05:18:37 +00:00
Chris Lattner
cc4b6ec2b9 ConstExpr::getelementptr now takes a vector of Constants not Values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2948 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:14:27 +00:00
Chris Lattner
5659dd1af8 Fix bug: test/Regression/Assembler/2002-07-14-InternalLossage.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2907 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 00:10:33 +00:00
Vikram S. Adve
d3f7eb0aa4 Added support for parsing expressions constructed from constant values.
(Major new non-terminal is ConstExpr.)

Add YYERROR_VERBOSE and print additional information on errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2894 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 22:59:28 +00:00
Chris Lattner
7e70829632 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:24 +00:00
Chris Lattner
51727bee39 * Be more typesafe: cast<x> now no longer discards constness
* The newly installed version of Bison now really likes there to be ;'s
  after productions.  Add them to avoid tons of warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2757 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-04 21:58:56 +00:00
Chris Lattner
8ebccb7f0e Support function declarations with either %XXX or "XXX" style for now
"XXX" style should be considered deprecated, and will hopefully be removed
in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2727 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 22:33:00 +00:00
Chris Lattner
9b625030c8 Replace all usages of Type::isPointerType with isa<PointerType>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:15:30 +00:00
Chris Lattner
05dcf353fc Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2473 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 03:03:09 +00:00
Chris Lattner
9b02cc365c Allow open/closing curly braces instead of begin/end to define the body of a function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2451 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-03 18:23:48 +00:00
Chris Lattner
9705a15b1a * Fix a bug (test/Regression/Assembler/2002-05-02-InvalidForwardRef.ll)
introduced in the 1.66 revision of this file.
* Convert a hard coded constant to a symbolic value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2436 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 19:27:42 +00:00
Chris Lattner
0e73ce6d94 The "implementation" is now allowed but not required by the parser. All type
definitions must still occur before function bodies, but the wierd keyword is
no longer neccesary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2433 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 19:11:13 +00:00
Chris Lattner
924025e9ad Fix bug: test/Regression/Other/2002-04-29-NameBinding.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2402 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 18:25:33 +00:00
Chris Lattner
c6f3ae5c66 Eliminate duplicate or unneccesary #include's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 17:42:12 +00:00
Chris Lattner
18b24ea4b6 Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2390 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 21:57:50 +00:00
Chris Lattner
4674804d29 Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

Rename some yacc type names to be more concise.  Change jump table to use
a vector instead of a list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2214 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:41:42 +00:00
Chris Lattner
8b88b3b5bf * Make PATypeHolder not take a type argument
* Eliminate by inlining the old newTH, newTH, and TypeDone functions
* OPAQUE is now just a token that gets returned by the lexer, not a type
  Parser now creates type, not lexer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2104 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:23:55 +00:00
Chris Lattner
09c07538a8 * Fix nondeleted type handle which could cause type pool corruption (and
a memory leak)
* Fix memory leak of Argument nodes on function prototypes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2065 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:16:49 +00:00
Chris Lattner
79df7c0aaa Change references from Method to Function
change references from MethodARgument to FunctionArgument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1991 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 18:01:55 +00:00
Chris Lattner
749ce032ba Implement TODO for better diagnostic output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1859 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 22:12:39 +00:00
Chris Lattner
34538145f4 Fix bug: test/Regression/2002-03-08-NameCollision2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1839 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 19:11:42 +00:00
Chris Lattner
9176fe4171 Fix minor memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1837 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 18:57:56 +00:00
Chris Lattner
f28d6c9313 Fix for: test/Regression/Assembler/2002-03-08-NameCollision.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1836 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 18:41:32 +00:00
Chris Lattner
697954c15d Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-20 22:54:45 +00:00
Chris Lattner
72e002564e * Fix cases where we were calling Type->getName() instead of Type->getDescription()
* Remove unsized array support
* Malloc/alloca do not require that the first element be an unsized array to be an
  array allocation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1458 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-14 16:28:42 +00:00
Chris Lattner
7a17675206 Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator   -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-04 00:03:30 +00:00
Chris Lattner
e9bb2df410 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-03 22:26:30 +00:00
Chris Lattner
7061dc50b2 Split the PHINode class out from the iOther.h file into the iPHINode.h file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1405 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-03 18:02:31 +00:00
Chris Lattner
cee8f9ae67 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1400 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-27 00:03:19 +00:00
Chris Lattner
dda719665b Implement support for internal methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1373 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-26 18:54:16 +00:00
Chris Lattner
6cdb0118e8 Implement array indexing with uints
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1336 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-26 16:54:11 +00:00
Chris Lattner
5084d032e5 Improve some debugging code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1088 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-02 07:46:26 +00:00
Chris Lattner
822695901f Remove ugly subclass of Opaque type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@936 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 06:01:08 +00:00
Chris Lattner
4a42e909cd Fix bug with
%list = type {%list *}
%list = type {%list *}

not being accepted (broken testmisc.ll)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@935 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-22 05:56:09 +00:00
Chris Lattner
c9a21b51a1 Two changes:
1. Delete type handle regardless of whether a collision occured
2. Remove a MAJOR pessimization of runtime performance (thought be be an optimization at the time).

This second one was causing a 105k llvm file (from gcc) to parse in 58 seconds... without the
'optimization' it now parses in 3.64 seconds.  I suck.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@933 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-21 23:02:41 +00:00
Chris Lattner
23192ebe95 Fix bug caused by:
%list = type opaque
%list = type %list


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@931 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-21 21:43:25 +00:00
Chris Lattner
42c9e77ffb Add support for And, XOR, and Or
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@924 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-20 09:32:59 +00:00
Chris Lattner
2b3c925d02 It is valid to have unsigned arrays as constants... the linker may initialize them later
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@923 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-20 06:43:05 +00:00
Chris Lattner
386a3b7b95 Simplify some code
Remove Method special case
Fix bug exposed by this testcase:

implementation

void "PtrFunc2"()
begin
bb1:
        %reg = add int(int)* null, null
        add int (int)* %reg, null
        ret void
end


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@852 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-16 19:54:17 +00:00
Chris Lattner
c18545dc9e Rename ConstPoolPointerReference to ConstPoolPointerRef - My fingers get tired typing that much
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@822 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-15 13:21:42 +00:00
Chris Lattner
2079fde081 * Add support for forward references of global variable addresses
* Add support for numeric global variable addresses
* Clean up getVal function by refactoring it into several smaller functions
* MethodTypes are now specified with an explicit isVarArg parameter
* Break ValueRef into ConstValueRef & SymbolicValueRef components
* Add support for the new Invoke instruction
* Fix a few broken calls to Type::getName instead of Type::getDescription


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@758 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-13 06:41:08 +00:00
Chris Lattner
43efcbf561 Add comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@712 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 19:35:57 +00:00
Chris Lattner
8921983734 Support multiple global's definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@711 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 19:35:04 +00:00
Chris Lattner
b747451c9c Allow duplicate constant values as long as they are compatible.
Clean up stuff a little bit with inMethod/ModuleContext functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@707 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 15:39:04 +00:00
Chris Lattner
b973dd75ba Add check to make sure that we dont reference MEthodType's directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@704 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 14:59:05 +00:00
Chris Lattner
ef9c23f281 * Both Method & GlobalVariable now subclass GlobalValue
* ConstPoolPointerReference now represents a pointer to a GlobalValue
* Methods name references are now explicit pointers to methods
* Rename Value::GlobalVal to Value::GlobalVariableVal to avoid confusion


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@703 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 14:53:21 +00:00
Chris Lattner
f4ba6c710c First try at a horrible global value reference wrapper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@701 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 06:12:09 +00:00
Chris Lattner
d05adbcdce Clean up parser, fix a bug that prevented this from working:
%ListNode3 = global %list { %list* null, int 4 }

because %list is name and the parser expected a literal {..} type there.

In addition, simplified rules that the fix (Allow any Types there, not just a StructType)
made obsolete.  Simplified type propogation a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@700 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 03:19:33 +00:00
Chris Lattner
df7306f1b9 * Add support for null as a constant
* Allow multiple definitions of a type with the same name as long as they are the same type
* Eagerly resolve types to allow #2 to work instead of after the whole const pool has been processed
* Change grammar to require a const before a local constant definition


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@699 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-03 01:49:25 +00:00
Chris Lattner
b00c582b6d Commit more code over to new cast style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-02 03:41:24 +00:00
Chris Lattner
cfe26c930a Add more support for new style casts
Convert more code to use them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@695 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-01 18:26:53 +00:00
Chris Lattner
9636a91649 Add support for new style casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@694 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-01 16:18:37 +00:00
Chris Lattner
1a1cb111fe Implement constant pointers, and null specifically in the parser, bytecode writer, and
bytecode reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@668 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-30 22:46:54 +00:00
Chris Lattner
3ff4387113 Pull iterators out of CFG.h and CFGdecls and put them in Support directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@664 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-28 22:56:31 +00:00
Chris Lattner
7f5ef148b0 Remove the unsized array constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@599 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-18 04:38:32 +00:00
Chris Lattner
1781acab34 Add support for global constants, and for initializers for constants
Clean up parser somewhat by factoring out freeing of ID's into setname function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@597 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-18 04:00:54 +00:00
Chris Lattner
b2d22f6dce Update to use correct type cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@536 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-10 20:08:08 +00:00
Chris Lattner
70cc3397f8 Implement global variable support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@530 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-10 07:58:01 +00:00
Chris Lattner
30c8979bcb * Add support for forward referencing types
* Add support for upreferences for recursive types
* Remove support for ConstantPool.h
* Add support for globally unique Constants
* Add support for the opaque type


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@446 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-07 16:35:17 +00:00
Chris Lattner
93750fa4f8 * Enable the use of escaped literal strings
* Unresolved variable names now have the correct line number for their
  error messages
* Rename Def* to Value*
* Check for symbol table collisions before inserting values
* Remove the STRING keyword
* Enable the use of string literals to initialize constant arrays
* Enable the use of extended constants in more locations: eg ret [int] [4, 5]
* Allow method prototypes to appear in the constant pool of the program
* Support varargs methods better.  Enable varargs methods with 0 fixed
  arguments
* Allow the entire method prototype to optionally be specified in a call inst


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-28 17:48:55 +00:00
Chris Lattner
bcbf6baf10 Refactor some of the constant stuff so that we can return complex constant
values directly.  This was causing test failures. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-26 16:29:15 +00:00
Chris Lattner
8b81bf5046 Add support for extern varargs methods & varargs method calls
Remove tool generated files


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-25 22:47:46 +00:00
Chris Lattner
a28504313d Remove dependence on command line library. Silly anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-22 18:36:00 +00:00
Chris Lattner
698b56e690 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-20 19:15:08 +00:00
Chris Lattner
e181564419 Implement forward/external declarations for methods. Also, emit an error if a method
is defined more than once, instead of crashing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-15 06:35:53 +00:00
Chris Lattner
3d52b2fdcc Add support to the parser to recognize floating point constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-15 00:17:01 +00:00
Chris Lattner
e98dda6d42 Added some comments, preparing to add global variables and method prototypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-14 06:10:16 +00:00
Chris Lattner
8896eda9a9 Make sure that types go in the constant pool if they are used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-09 19:38:36 +00:00
Chris Lattner
ab5ac6bb38 Implementation of Store & GetElementPtr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-08 23:22:50 +00:00
Chris Lattner
027dcc5b22 Implemented shl, shl, & load instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-08 21:10:27 +00:00
Chris Lattner
71496b3b50 Moved Cast from being a Unary instruction to being an "Other" instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-08 19:03:27 +00:00
Chris Lattner
0908309e3c Neg instruction removed. Cast instruction implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-08 04:57:15 +00:00
Chris Lattner
f0d0e9c262 Changed memory reference instructions to store the result as the implicit
type of the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-07 08:36:30 +00:00
Chris Lattner
7fc9fe3439 Miscellaneous cleanups:
* Convert post to pre-increment for for loops
  * Use generic programming more
  * Use new Value::cast* instructions
  * Use new Module, Method, & BasicBlock forwarding methods
  * Use new facilities in STLExtras.h
  * Use new Instruction::isPHINode() method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-27 23:41:11 +00:00
Chris Lattner
bebd60dc9d Renamed get.*Operator to create seeing that it would have to be qualified
with the classname anyways.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-25 07:31:31 +00:00
Chris Lattner
c24d2088dc Updates to support
* Changes in PHI node structure
* Change to PHI syntax


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-11 15:04:20 +00:00
Chris Lattner
477c2ec3e0 Moved getBinaryOperator to the BinaryOperator class and the getUnaryOperator
to the UnaryOperator class (from the Instruction class).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-08 21:30:13 +00:00
Chris Lattner
009505452b Initial revision
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2 91177308-0d34-0410-b5e6-96231b3b80d8
2001-06-06 20:29:01 +00:00