Commit Graph

424 Commits

Author SHA1 Message Date
Chris Lattner 6d817c5486 use splice instead of remove/insert for a minor speedup
llvm-svn: 21743
2005-05-06 19:58:35 +00:00
Chris Lattner 6409f3490a remove some ugly hacks that are no longer needed since andrew removed the
varargs munging code

llvm-svn: 21742
2005-05-06 19:49:51 +00:00
Chris Lattner ca4d4bd2db lex tail
llvm-svn: 21729
2005-05-06 06:20:33 +00:00
Chris Lattner 0603845a49 Add a 'tail' marker for call instructions, patch contributed by
Alexander Friedman.

llvm-svn: 21722
2005-05-06 05:51:46 +00:00
Andrew Lenharth f5d58d1bc3 Remove support for 1.0 style varargs
amusing of course, because we will have to go back to those semantics soon

llvm-svn: 21654
2005-05-02 19:07:27 +00:00
Misha Brukman 13f332cd3f * Remove trailing whitespace
* Convert tabs to spaces

llvm-svn: 21415
2005-04-21 21:10:11 +00:00
Chris Lattner 07ad98dbe2 fix PR549
llvm-svn: 21360
2005-04-19 15:27:29 +00:00
Chris Lattner dcb82f5d0a don't crash in some bad cases.
llvm-svn: 20776
2005-03-23 01:29:26 +00:00
Chris Lattner a5f4b773d9 Remove a bunch of cruft and dead code for handling the case when types were
defined in function constant pools.  The assembler grammar has long
disallowed functions from having constant pools, so all of this stuff is
dead.

This makes it an immediate error for functions to refer to nonexisting
types, fixing Regression/Verifier/2005-03-21-UndefinedTypeReference.ll.

Before, references to non-existing types in functions would only be
detected when the subsequent function was parsed, due to the call to
"ResolveTypes".  "ResolveTypes" has not resolved any types for a long time,
instead it emitted an error message if no resolved types are left.  Since
the only caller of this method is in the module code, just inline it.

llvm-svn: 20726
2005-03-21 06:27:42 +00:00
Chris Lattner 531f9e92d4 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner aa72c889a6 zap
llvm-svn: 20461
2005-03-05 19:04:07 +00:00
Chris Lattner fc824c1a7e add more checking
llvm-svn: 20296
2005-02-24 05:25:17 +00:00
Chris Lattner 5f0df0c1e6 Do not read free'd memory when printing an error message.
llvm-svn: 20295
2005-02-24 04:59:49 +00:00
Chris Lattner 06b6c4bbde C++ is not a functional programming language.
llvm-svn: 20274
2005-02-22 23:13:58 +00:00
Chris Lattner 085c981345 Fix test/Regression/Assembler/2005-01-31-CallingAggregateFunction.ll
llvm-svn: 19966
2005-02-01 01:47:42 +00:00
Chris Lattner 29b97d53c1 Apparently := confuses makellvm
llvm-svn: 19965
2005-02-01 01:47:12 +00:00
Chris Lattner 2c08949c62 Adjust to slight changes in instruction interfaces.
llvm-svn: 19893
2005-01-29 00:35:55 +00:00
Chris Lattner fa66dc7852 Silence VS warnings.
llvm-svn: 19390
2005-01-08 20:07:03 +00:00
Alkis Evlogimenos a93b4520a7 Do not allow empty label names.
llvm-svn: 18743
2004-12-10 05:40:19 +00:00
Chris Lattner fcec9d6dec Implement test/Feature/escaped_label.ll
llvm-svn: 18741
2004-12-10 05:27:29 +00:00
Chris Lattner 4270bcbab7 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 95044d0071 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 aef74b55de Fix PR463
llvm-svn: 18303
2004-11-28 16:45:45 +00:00
Reid Spencer c9bbb35c6f 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 57cbe39d1e Change Library Names Not To Conflict With Others When Installed
llvm-svn: 17286
2004-10-27 23:18:45 +00:00
Chris Lattner 6ee2c57128 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 c1c320c335 We won't use automake
llvm-svn: 17155
2004-10-22 03:35:04 +00:00
Reid Spencer 6a11a75f31 Initial automake generated Makefile template
llvm-svn: 17136
2004-10-18 23:55:41 +00:00
Chris Lattner 4ff314968e Parse undef and unreachable
llvm-svn: 17053
2004-10-16 18:17:13 +00:00
Reid Spencer ace94df71f Update to reflect changes in Makefile rules.
llvm-svn: 16950
2004-10-13 11:46:52 +00:00
Reid Spencer b84cbf2725 Initial version of automake Makefile.am file.
llvm-svn: 16885
2004-10-10 20:43:57 +00:00
Chris Lattner 1f4739cd08 Add a check to avoid an assertion on malformed input
llvm-svn: 16861
2004-10-09 02:18:58 +00:00
Reid Spencer f27c4cde06 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 b9e0877223 Add support for the link-time pass list to Modules.
llvm-svn: 16321
2004-09-13 23:44:23 +00:00
Reid Spencer 7c16caa336 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 04f4d52d9e 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 d0713e7664 quish a warning
llvm-svn: 15954
2004-08-20 18:07:39 +00:00
Brian Gaeke 0220904e7a Packed types, brought to you by Brad Jones
llvm-svn: 15938
2004-08-20 06:00:58 +00:00
Chris Lattner fca2833838 Work around PR424 for old c/c++ frontends.
llvm-svn: 15882
2004-08-17 17:26:41 +00:00
Alkis Evlogimenos fd7a2d4477 Merge i*.h headers into Instructions.h as part of bug403.
llvm-svn: 15325
2004-07-29 12:17:34 +00:00
Chris Lattner 87dc093b10 Fix bug in previous patch :(
llvm-svn: 15226
2004-07-26 01:40:20 +00:00
Chris Lattner c2cb34ae61 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 62c6da9a64 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 a24de0d15d bug 263:
Provide parsing for the target triple and dependent libraries.

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

llvm-svn: 15208
2004-07-25 17:56:00 +00:00
Reid Spencer ce6adaff1c 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 fe05024b0f Fix the regressions handling unnamed global variables
llvm-svn: 14870
2004-07-16 01:18:09 +00:00
Chris Lattner 4babbe04e1 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 8abe1a11b4 ** 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 4c9210ed64 * 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 e875d48a92 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 91393ee84f 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 42dd47437e 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 70ef57d001 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 6652224c2a 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 88357937b6 Finegrainify namespacification
llvm-svn: 14808
2004-07-14 06:39:48 +00:00
Chris Lattner 4accae9c3e 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 95230b0cbc Split the basic block handling case out of getVal into getBBVal.
llvm-svn: 14805
2004-07-14 01:33:11 +00:00
Chris Lattner d25cad9f38 Fine-grainify namespacification, prune #include
llvm-svn: 14792
2004-07-13 08:42:12 +00:00
Chris Lattner e84a2ba99f 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 d9c9c496e6 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 30b35cf3f7 Inline the now trivial setValueNameInternal function into both callers
llvm-svn: 14789
2004-07-13 08:12:39 +00:00
Chris Lattner 85a351f78d 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 2ed776bb88 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 cc459c9d66 Replace a bunch of complex ConstantPointerRef referring code with simple
code.

llvm-svn: 14785
2004-07-13 06:58:07 +00:00
Chris Lattner c18917c85c Don't call Type::setName()
llvm-svn: 14724
2004-07-09 16:43:55 +00:00
Chris Lattner 0bba5dbe95 Eliminate uses of the UniqueID field on Type objects
llvm-svn: 14707
2004-07-08 22:30:50 +00:00
Reid Spencer 832fa92ab6 - 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 e258e94af7 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 6b7275996c Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()
llvm-svn: 14201
2004-06-17 18:19:28 +00:00
Reid Spencer 9a6bb5fab7 Remove some more dead code resulting from adding setTypeName().
llvm-svn: 13862
2004-05-28 00:21:06 +00:00
Reid Spencer 3ae29942bf 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 604e19e707 Add support for dos-style files
llvm-svn: 13837
2004-05-27 17:49:14 +00:00
Reid Spencer 5b4413cb03 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 1f08746f72 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 ea41b4fb83 Changed to use SymbolTable's new lookup interface.
llvm-svn: 13758
2004-05-25 17:29:21 +00:00
Chris Lattner ca96cee67b 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 fd9fbe187d 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 c0ba90e35c 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 deab5e212d Fix bug: Assembler/2004-03-30-UnclosedFunctionCrash.llx
llvm-svn: 12551
2004-03-30 20:58:25 +00:00
Chris Lattner 3922d607a5 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 6536f0c35f Allow parsing select instruction and constant expr
llvm-svn: 12313
2004-03-12 05:51:36 +00:00
Chris Lattner e2b27080e7 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 75998c0885 Eliminate a REALLY HORRIBLE API: mutateReferences, which is gross gross gross.
llvm-svn: 12212
2004-03-08 06:09:57 +00:00
Chris Lattner 7289e62874 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 edd4500cf0 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 ac6db755c3 Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner fa829be4d3 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner a9634a0ee3 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 3cb4167b26 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 a263b85fe6 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 17235712fb 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 1b7d4d7b63 Don't use ConstantExpr::getShift anymore
llvm-svn: 10791
2004-01-12 19:08:43 +00:00
Chris Lattner fd2a514199 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 87c593b882 Right, fix the problem with invoke instructions, not just call instructions
llvm-svn: 10599
2003-12-23 22:18:36 +00:00
Chris Lattner 601415ed84 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 e970301580 Minor cleanups, plug a minor memory leak
llvm-svn: 10596
2003-12-23 20:05:15 +00:00
Chris Lattner 6789a0b1d4 To not barf when an error occurs.
llvm-svn: 10236
2003-11-26 07:24:58 +00:00
Chris Lattner 2a18c640df Fix PR147
llvm-svn: 10204
2003-11-25 03:54:16 +00:00
Chris Lattner 3ae303cc8c Check return types of functions
llvm-svn: 10146
2003-11-21 22:32:23 +00:00
Chris Lattner 199bb859a9 Don't crash on bogus source value
llvm-svn: 10132
2003-11-21 20:27:35 +00:00
Chris Lattner ebcf5a5dba Fix bug PR107, patch contributed by Reid Spencer!
llvm-svn: 9911
2003-11-12 04:40:30 +00:00
Brian Gaeke 960707c335 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 0fc43a6048 Make sure that PHI node operands are first class types
llvm-svn: 9607
2003-10-30 01:38:18 +00:00
Misha Brukman ad44de185d * Eliminate `using' directive
* Order #includes as per style guide

llvm-svn: 9429
2003-10-23 18:00:34 +00:00
John Criswell 29265fe981 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell 4436c49787 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell 482202a601 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 24c67e8553 Eliminate unused class
llvm-svn: 9270
2003-10-19 21:39:41 +00:00
Chris Lattner b94550e537 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 0079e7dd6d New revised variable argument handling support
llvm-svn: 9219
2003-10-18 05:53:13 +00:00
Chris Lattner 0aa8eaf7bf Tighten up handling of checks for shift instructions
llvm-svn: 9191
2003-10-17 05:11:44 +00:00
Chris Lattner 6187774380 Minor cleanups
llvm-svn: 9177
2003-10-16 20:12:13 +00:00
Chris Lattner 068ad84038 Add support for 'weak' linkage.
llvm-svn: 9171
2003-10-16 18:29:00 +00:00
Chris Lattner f95d9b99b3 Decrease usage of use_size()
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Chris Lattner 44d2c3514a Regularize header file comments
llvm-svn: 9071
2003-10-13 03:32:08 +00:00
Brian Gaeke bc12709888 Include <cctype> and <cstdlib> instead of <ctype.h> and "Config/stdlib.h".
llvm-svn: 9036
2003-10-10 19:12:08 +00:00
Chris Lattner 8ad183194b Reserve space for PHI operands
llvm-svn: 9007
2003-10-10 16:34:58 +00:00
Chris Lattner f4120d9a2a Accept 'weak' as a linkage type. For now, just turn it into linkonce linkage
llvm-svn: 8998
2003-10-10 04:54:02 +00:00
Chris Lattner 6f8cd63693 Add better checking
llvm-svn: 8996
2003-10-10 03:56:01 +00:00
Chris Lattner 5c02edbf5c The objects mapped are really PATypeHolders, not PATypeHandles
llvm-svn: 8822
2003-10-02 19:00:34 +00:00
Misha Brukman d4d259cafb Uppercase the acronym ASCII.
llvm-svn: 8676
2003-09-22 23:50:25 +00:00
Chris Lattner 9eea08caa2 Oops, look at the VOLATILE marker, not the opcode
llvm-svn: 8413
2003-09-08 20:29:46 +00:00
Chris Lattner 9c58cf6d03 Add support for the unwind instruction
llvm-svn: 8408
2003-09-08 18:54:55 +00:00
Chris Lattner 8b1680eadb Parse volatile loads/stores
llvm-svn: 8402
2003-09-08 18:20:29 +00:00
Chris Lattner 667ded9bf8 Remove gross old hacky code that was in there for backwards compatibility
1 year is plenty of migration time!

llvm-svn: 8282
2003-09-01 16:31:28 +00:00
Chris Lattner 6a2b859191 Rename SwitchInst::dest_push_back -> addCase
llvm-svn: 8089
2003-08-23 23:14:52 +00:00
Chris Lattner 9eb287583b 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.

llvm-svn: 8050
2003-08-22 05:42:10 +00:00
Misha Brukman 7eb05a170a Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner f26a8ee580 Remove redundant const qualifiers from cast<> expressions
llvm-svn: 7253
2003-07-23 15:30:06 +00:00
Misha Brukman 7fdaab4f68 The word `separate' only has one `e'.
llvm-svn: 7173
2003-07-14 17:20:40 +00:00
John Criswell 3ef61afb76 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner 7969401e16 Add support for a new zeroinitializer token which can be used to get rid of
huge arrays of zero initialized values

llvm-svn: 6937
2003-06-28 20:01:34 +00:00
Chris Lattner 8826647168 Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'.
llvm-svn: 6774
2003-06-18 19:22:36 +00:00
Chris Lattner d515967513 Fix bugs:
Assembler/2003-05-21-MalformedShiftCrash.llx
  Assembler/2003-05-21-ConstantShiftExpr.ll

llvm-svn: 6258
2003-05-21 17:48:56 +00:00
Chris Lattner 5bb2315a88 Fix bugs:
Assembler/2003-05-21-EmptyStructTest.ll
  Assembler/2003-05-21-MalformedStructCrash.llx

llvm-svn: 6255
2003-05-21 16:06:56 +00:00
Chris Lattner 9f3648bf02 Fix bug: Assembler/2003-05-15-SwitchBug.ll
llvm-svn: 6239
2003-05-15 21:30:00 +00:00
Chris Lattner f70da10697 Add support for the new va_arg instruction
llvm-svn: 6029
2003-05-08 02:44:12 +00:00
Chris Lattner 1fcfaf5bc0 Fix bug: Assembler/2003-04-25-UnresolvedGlobalReference.ll
llvm-svn: 5948
2003-04-25 21:47:33 +00:00
Chris Lattner 62fa743e75 Use a union to cast int to fp
llvm-svn: 5849
2003-04-22 20:20:28 +00:00
Chris Lattner 2012613040 Allow information about the target to be specified in the .ll file
llvm-svn: 5843
2003-04-22 19:07:06 +00:00
Chris Lattner 89da8a3b31 Namespacify
llvm-svn: 5840
2003-04-22 18:42:41 +00:00
Chris Lattner b672b5607f Preserve module source information in the ModuleID
llvm-svn: 5836
2003-04-22 18:02:52 +00:00
Chris Lattner e509bd47bf Allow hexadecimal integer constants to be used
llvm-svn: 5802
2003-04-17 22:17:32 +00:00
Chris Lattner 379a8d2d1c Add new linkage types to support a real frontend
llvm-svn: 5786
2003-04-16 20:28:45 +00:00
Chris Lattner fcfb1761c7 Don't allow declaring an external internal variable
llvm-svn: 5781
2003-04-16 18:13:57 +00:00
Chris Lattner 4b1d10604e Fix bug: Assember2003-04-15-ConstantInitAssertion.llx
llvm-svn: 5777
2003-04-15 16:09:31 +00:00
Chris Lattner 8ce4e7949b Fix bug: Assembler/2003-03-03-DuplicateConstant.ll
llvm-svn: 5692
2003-03-03 23:28:55 +00:00
Chris Lattner b90181e348 Fix bug: Assembler/2003-02-02-ConstGlobal.ll
llvm-svn: 5467
2003-02-02 16:40:20 +00:00
Chris Lattner 63a25242dc Fix bug: Assembler/2003-01-30-UnsignedString.ll
llvm-svn: 5445
2003-01-30 22:24:26 +00:00
Misha Brukman 4e243cee9a Ignore generated files Lexer.cpp and llvmAsmParser.*
llvm-svn: 4861
2002-12-02 21:14:54 +00:00
Chris Lattner 98cf1f5d64 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.

llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner 1961329140 - Fix bug: Assembler/2002-10-15-NameClash.ll
- Clean up code a bit, s/Method/Function/

llvm-svn: 4188
2002-10-15 21:41:14 +00:00
Chris Lattner 8022a0f57c This loop executed exactly one time, turn it into straightline code
llvm-svn: 4159
2002-10-14 03:28:42 +00:00
Chris Lattner 149376dee5 - 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.

llvm-svn: 4149
2002-10-13 20:57:00 +00:00
Chris Lattner fa01a52149 Minor, non-functionality changing, formatting fix
llvm-svn: 4091
2002-10-09 00:25:32 +00:00
Chris Lattner e2dd92be96 The parser now accepts "external" global variables, in addition to the backwards
compatible "uninitialized" global variables

llvm-svn: 4050
2002-10-06 22:45:09 +00:00
Chris Lattner 322bf4f3a9 Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.

llvm-svn: 3710
2002-09-13 22:28:45 +00:00
Chris Lattner ef299571d9 include/llvm/DataTypes.h includes this #define so we don't need it anymore
llvm-svn: 3709
2002-09-13 22:25:00 +00:00
Chris Lattner bb4fe2c3c4 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.

llvm-svn: 3679
2002-09-11 01:17:27 +00:00
Chris Lattner a6834c1331 Use explicit ctor
llvm-svn: 3663
2002-09-10 22:37:46 +00:00
Chris Lattner c0686feca2 Tighten up error checking in parser, disallowing instructions that f.e.,
add pointers together.

llvm-svn: 3660
2002-09-10 19:57:26 +00:00
Chris Lattner e083fe9e34 AsmParser now depends on clients to verify that input is well formed
llvm-svn: 3548
2002-08-30 22:52:23 +00:00
Chris Lattner 030effa42c Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore

llvm-svn: 3484
2002-08-22 22:48:55 +00:00
Chris Lattner 319c47adec - 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.

llvm-svn: 3435
2002-08-21 23:51:21 +00:00
Chris Lattner 7f325cd0bc - 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

llvm-svn: 3362
2002-08-16 21:14:40 +00:00
Chris Lattner d8ecff793a Parse const expr cast instruction the same way the instruction is formed
llvm-svn: 3353
2002-08-15 19:37:11 +00:00
Chris Lattner 7f1c98d060 Move ConstExpr production to unify ConstVal stuff
llvm-svn: 3351
2002-08-15 18:17:28 +00:00
Chris Lattner 61643a01c3 Fix bug: test/Regression/Assembler/2002-08-15-UnresolvedGlobalReference.ll
llvm-svn: 3350
2002-08-15 17:58:33 +00:00
Chris Lattner 330b7ac76c 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.

llvm-svn: 3328
2002-08-14 18:24:09 +00:00
Chris Lattner db3b202be8 AsmParser turns 'not' instructions into 'xor' instructions now.
llvm-svn: 3309
2002-08-14 17:12:33 +00:00
Chris Lattner 3cd8c56cbb 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

llvm-svn: 3161
2002-07-30 18:54:25 +00:00
Chris Lattner 91e0832181 Add check to fix bug:
test/Regression/Assembler/2002-07-25-ParserAssertionFailure.llx

llvm-svn: 3101
2002-07-25 20:52:56 +00:00
Chris Lattner e680139c34 GCC 3.1 changes
llvm-svn: 3074
2002-07-25 06:17:42 +00:00
Chris Lattner 8eedb941d3 * Code cleanups
* Fix a REALLY misleading error message

llvm-svn: 2960
2002-07-18 05:18:37 +00:00
Chris Lattner 980ddf5854 ConstExpr::getelementptr now takes a vector of Constants not Values
llvm-svn: 2948
2002-07-18 00:14:27 +00:00
Chris Lattner 8445b41ddd Fix bug: test/Regression/Assembler/2002-07-14-InternalLossage.llx
llvm-svn: 2907
2002-07-15 00:10:33 +00:00
Vikram S. Adve 7064eaf80b Added support for parsing expressions constructed from constant values.
(Major new non-terminal is ConstExpr.)

Add YYERROR_VERBOSE and print additional information on errors.

llvm-svn: 2894
2002-07-14 22:59:28 +00:00
Vikram S. Adve 9f835b82fc Declare globals llvmAsmtext and llvmAsmleng for use in the parser.
llvm-svn: 2893
2002-07-14 22:49:40 +00:00
Chris Lattner 113f4f4609 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner 8cb1dfbdc9 * 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.

llvm-svn: 2757
2002-06-04 21:58:56 +00:00
Chris Lattner f4c7dd9c22 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.

llvm-svn: 2727
2002-05-22 22:33:00 +00:00
Chris Lattner 181cc32365 Replace all usages of Type::isPointerType with isa<PointerType>
llvm-svn: 2486
2002-05-06 16:15:30 +00:00
Chris Lattner 638fa9385d Remove dead code
llvm-svn: 2473
2002-05-06 03:03:09 +00:00
Chris Lattner 1e1a9b4166 Allow open/closing curly braces instead of begin/end to define the body of a function
llvm-svn: 2451
2002-05-03 18:23:48 +00:00
Chris Lattner 18489fb61f * 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.

llvm-svn: 2436
2002-05-02 19:27:42 +00:00
Chris Lattner 7b804d6195 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.

llvm-svn: 2433
2002-05-02 19:11:13 +00:00
Chris Lattner 8cfc0d5f89 Fix bug: test/Regression/Other/2002-04-29-NameBinding.ll
llvm-svn: 2402
2002-04-29 18:25:33 +00:00
Chris Lattner d5a847057b Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner d0cfbae8c9 Remove dead code
llvm-svn: 2390
2002-04-28 21:57:50 +00:00
Chris Lattner ca14237696 Split ConstantVals.h into Constant.h and Constants.h
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner ae234e1868 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.

llvm-svn: 2214
2002-04-09 19:41:42 +00:00
Chris Lattner 8e421f454d isLabelType is obsolete
llvm-svn: 2175
2002-04-08 21:59:08 +00:00
Chris Lattner 970bb72ff6 Library bumped up out of Assembly directory
llvm-svn: 2164
2002-04-08 20:17:06 +00:00
Chris Lattner b99f479f71 Add a better comment to explain what is going on.
llvm-svn: 2139
2002-04-07 08:31:26 +00:00
Chris Lattner a815ded431 Remove debugging code accidentally checked in!
llvm-svn: 2137
2002-04-07 08:13:29 +00:00
Chris Lattner 1b3437405b Add support for hexadecimal FP constants!
llvm-svn: 2135
2002-04-07 08:10:41 +00:00
Chris Lattner e2f2f54f0c s/MethodType/FunctionType
llvm-svn: 2115
2002-04-04 22:19:18 +00:00
Chris Lattner 30752bd910 * 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

llvm-svn: 2104
2002-04-04 19:23:55 +00:00
Chris Lattner f269b9d236 Lexer doesn't create typehandle gross stuff now, parser does.
llvm-svn: 2103
2002-04-04 19:22:17 +00:00