Commit Graph

776 Commits

Author SHA1 Message Date
Reid Spencer
763ed5e4ac For PR950: For ICmp and FCmp constant expressions, put the predicate outiside the parentheses to match what llvm-upgrade generates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32171 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-04 05:20:06 +00:00
Reid Spencer
13cf7b61c5 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32156 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 16:20:14 +00:00
Reid Spencer
9b1630382e Remove useless #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32155 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 16:19:43 +00:00
Reid Spencer
6e18b7d3d9 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32152 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 06:59:29 +00:00
Reid Spencer
9f746f415e Shorten the FCmp and ICmp mnemonics to 3 letters. Make the parser
disambiguate them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32151 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 06:58:07 +00:00
Reid Spencer
a132e04b66 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32145 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 05:46:11 +00:00
Reid Spencer
08de34b229 Remove backwards compatibility goop. Now implemented in llvm-upgrade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32144 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 05:45:44 +00:00
Reid Spencer
481169e701 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32053 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-01 00:33:46 +00:00
Anton Korobeynikov
78ee7b78c3 Introducing external weak linkage. Darwin codegen should be added later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32052 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-01 00:25:12 +00:00
Bill Wendling
3e3bcbf3a0 Removed #include <iostream> and used llvm streams
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31984 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 22:47:12 +00:00
Reid Spencer
861d9d6863 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31965 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 07:29:44 +00:00
Reid Spencer
b78b908d4a Implement signedness caching for values, value lists, constants and
constant lists. This is just an internal change to the parser in
preparation for some backwards compatibility code that is to follow.
This will allow things like "uint 4000000000" to retain the unsignedness
of the integer constant as the value moves through the parser. In the
future, all integer types will be signless but parsing "uint" and friends
will be retained for backwards compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31964 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 07:28:14 +00:00
Reid Spencer
3da59db637 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Reid Spencer
36699cabc5 For PR950:
Retain the signedness of the old integer types in a new TypeInfo structure
so that it can be used in the grammar to implement auto-upgrade of things
that depended on signedness of types. This doesn't implement any new
functionality in the AsmParser, its just plumbing for future changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31866 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-19 23:07:00 +00:00
Bill Wendling
b39a55a2e7 Initialize some pointers to quiet the compiler (when doing build_gcc
builds).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31694 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-12 11:10:39 +00:00
Reid Spencer
3822ff5c71 For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 06:47:33 +00:00
Chris Lattner
f49c1766e5 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31539 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 05:58:47 +00:00
Chris Lattner
39033699d2 Fix a bug noticed by Emil Mikulic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31538 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 05:58:11 +00:00
Reid Spencer
3ed469ccd7 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:25:50 +00:00
Reid Spencer
0a783f783c For PR950:
Replace the REM instruction with UREM, SREM and FREM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31369 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 01:53:59 +00:00
Reid Spencer
1628cec4d7 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-26 06:15:43 +00:00
John Criswell
2f6a8b15ef Removed extraneous semi-colon; this was prevening the grammar file from
bison'ing correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31169 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-24 19:09:48 +00:00
Reid Spencer
21be86535b Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31111 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 07:03:43 +00:00
Reid Spencer
fd6131b5a8 Remove unneeded CHECK_FOR_ERROR invocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31110 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 07:03:09 +00:00
Chris Lattner
1ae022f647 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31109 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 06:08:13 +00:00
Chris Lattner
10b271152a change keyword to datalayout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31108 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-22 06:07:41 +00:00
Reid Spencer
b83eb6447b For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 07:07:24 +00:00
Owen Anderson
1dc6969f48 Add support for the new "target data" information in .ll files. This provides
a better encoding of the targets data layout, rather than trying to guess it
from the endianness and pointersize like before.

Update the generated files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31031 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-18 02:21:48 +00:00
Owen Anderson
cf7ff2b4c8 Add support for the new "target data" information in .ll files. This provides
a better encoding of the targets data layout, rather than trying to guess it
from the endianness and pointersize like before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31030 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-18 02:21:12 +00:00
Chris Lattner
59c85e96de regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30971 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-15 23:27:25 +00:00
Chris Lattner
9e76ce97b8 Produce a useful error message for Regression/Verifier/2006-10-15-AddrLabel.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30970 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-15 23:26:46 +00:00
Reid Spencer
f63697de04 Fix PR886:
The result of yyparse() was not being checked. When YYERROR or YYABORT is
called it causes yyparse() to return 1 to indicate the error. The code was
silently ignoring this situation because it previously expected either an
exception or a null ParserResult to indicate an error. The patch corrects
this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30834 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-09 17:36:59 +00:00
Chris Lattner
47811b76ca Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30665 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:35:22 +00:00
Reid Spencer
5b7e753d95 Fix PR902:
Errors are generated with the YYERROR macro which can only be called from
a production (inside yyparse) because of the goto statement in the macro.
This lead to several situations where GEN_ERROR was not called but
GenerateError was used instead (because it doesn't use YYERROR). However,
in such situations, catching the error much later (e.g. at the end of
the production) is not sufficient because LLVM can assert on invalid data
before the end of the production is reached. The solution is to ensure that
the CHECK_FOR_ERROR macro (which invokes YYERROR if there's an error) is
used as soon as possible after a call to GenerateError has been made.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30650 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 19:28:24 +00:00
Anton Korobeynikov
bcb9770efe Added some eye-candy for Subtarget type checking
Added X86 StdCall & FastCall calling conventions. Codegen will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30446 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 20:25:45 +00:00
Anton Korobeynikov
93c2b37340 Small fixes for supporting dll* linkage types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 13:06:18 +00:00
Anton Korobeynikov
43e3aad6af Adding generated files for the last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30375 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 18:25:26 +00:00
Anton Korobeynikov
b74ed07bfd Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 18:23:27 +00:00
Chris Lattner
224f84f20b regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29771 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-18 17:34:45 +00:00
Chris Lattner
703e92fa1b trivial optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29770 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-18 17:34:24 +00:00
Reid Spencer
e4f4759857 Add a comment about the mechanisms used to rid AsmParser of exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29769 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-18 17:32:55 +00:00
Reid Spencer
f0646768be For PR797:
1. Actually turn on -fno-exceptions in libraries that do not have the
   REQUIRES_EH option in their Makefile. The following library file size
   savings were made (DEBUG):
      libLLVMDataStructure.a  525K
      libLLVMCore.a           380K
      libLLVMCodeGen.a        350K
      libLLVMTransformUtils.a 305K
      libLLVMScalarOpts.a     270K
      libLLVMAnalysis.a       247K
      libLLVMSelectionDAG.a   233K
      libLLVMipo.a            175K
      LLVMX86.o               123K
      LLVMPPC.o                81K
      libLLVMipa.a             17K
                 TOTAL      2,706K
      Note that the savings is actually a little larger than this because
      I didn't count any of the libraries that had small changes.

2. Remove REQUIRES_EH from the AsmParser library as it is now exception
   free. This resulted in a nearly 78K drop in the size of the debug
   library for AsmParser.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29767 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-18 09:30:03 +00:00
Reid Spencer
61c83e023f For PR797:
Rid the Assembly Parser of exceptions. This is a really gross hack but it
will do until the Assembly Parser is re-written as a recursive descent.
The basic premise is that wherever the old "ThrowException" function was
called (new name: GenerateError) we set a flag (TriggerError). Every
production checks that flag and calls YYERROR if it is set. Additionally,
each call to ThrowException in the grammar is replaced with GEN_ERROR
which calls GenerateError and then YYERROR immediately. This prevents
the remaining production from continuing after an error condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29763 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-18 08:43:06 +00:00
Chris Lattner
7c339b8ca2 These libs use EH info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29043 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 16:44:31 +00:00
Chris Lattner
0ad19703ae fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28897 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-21 16:53:00 +00:00
Chris Lattner
57de7a4542 Fix build on systems with bad bison's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28657 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-02 18:20:28 +00:00
Reid Spencer
18c8b49e7d Use archive libraries instead of object files for VMCore, BCReader,
BCWriter, and bzip2 libraries. Adjust the various makefiles to accommodate
these changes. This was done to speed up link times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28610 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 01:30:27 +00:00
Reid Spencer
fd20c0ab00 Fix grammar in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28534 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 02:34:34 +00:00
Chris Lattner
7546619743 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28407 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:28:53 +00:00
Chris Lattner
515906d106 Add support for parsing csret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28406 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-19 21:28:34 +00:00
Reid Spencer
536c006249 Make sure CVS versions of yacc and lex files get distributed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27630 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-12 20:57:05 +00:00
Chris Lattner
f4bd7d8151 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27526 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 04:09:02 +00:00
Chris Lattner
2d7349a62d Use isValidOperands instead of duplicating or eliding checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27525 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 04:08:32 +00:00
Chris Lattner
d25db20f1a regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 03:55:17 +00:00
Chris Lattner
ca73cd8830 Add insertelement and shufflevector constantexpr support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27520 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 03:53:34 +00:00
Chris Lattner
d5efe84646 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 01:18:56 +00:00
Chris Lattner
4c94908b64 Parse shufflevector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27511 91177308-0d34-0410-b5e6-96231b3b80d8
2006-04-08 01:18:35 +00:00
Reid Spencer
7a10277fa3 Add new generated files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27013 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-23 23:48:12 +00:00
Chris Lattner
c2c6038913 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26522 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 07:53:41 +00:00
Chris Lattner
7d5c1e1ed1 Don't use invalidated iterators!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 07:53:16 +00:00
Chris Lattner
58af2a1c5f Convert this over to work with the new makefiles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26206 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-15 07:22:58 +00:00
Chris Lattner
2fecc0f9e2 random lexer change to test the makefile updating stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26203 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-15 07:02:59 +00:00
Chris Lattner
32eecb09a2 adjust to new style of handling lexer changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26162 91177308-0d34-0410-b5e6-96231b3b80d8
2006-02-14 05:14:46 +00:00
Chris Lattner
0e9c376761 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25619 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 22:27:16 +00:00
Chris Lattner
aa2c853766 Parse inline asm objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25618 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 22:26:43 +00:00
Chris Lattner
6631601eed Rename method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25571 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 04:14:29 +00:00
Chris Lattner
71cdba3177 syntax change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25567 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-24 00:40:17 +00:00
Chris Lattner
8335e84a4b regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25558 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 23:05:42 +00:00
Chris Lattner
ee45477a48 Add support for parsing global asm blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25557 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-23 23:05:15 +00:00
Reid Spencer
e812fb230a Make sure intrinsic auto-upgrade is invoked correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25434 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 01:21:04 +00:00
Robert Bocchino
2def1b3e73 Lexer and parser support for the insertelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25403 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-17 20:06:25 +00:00
Reid Spencer
0b118206bf For PR411:
This patch is an incremental step towards supporting a flat symbol table.
It de-overloads the intrinsic functions by providing type-specific intrinsics
and arranging for automatically upgrading from the old overloaded name to
the new non-overloaded name. Specifically:
  llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64
  llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64
  llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64
  llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64
  llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64
New code should not use the overloaded intrinsic names. Warnings will be
emitted if they are used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25366 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-16 21:12:35 +00:00
Chris Lattner
fe442be5a4 Regenerate these files. FreeBSD apparently has issues with the version of
lex/bison Rob used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25196 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-11 02:07:51 +00:00
Robert Bocchino
9c62b5630c Added lexer and parser support for the extractelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25177 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-10 19:04:32 +00:00
Chris Lattner
524a1313da Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24908 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 18:31:50 +00:00
Chris Lattner
0a01783d7c allow logical operators on packed integral types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24907 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 18:31:29 +00:00
Chris Lattner
7aa6189629 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24904 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 17:53:23 +00:00
Chris Lattner
f1f03dfc66 Implement Regression/Assembler/2005-12-21-ZeroInitVector.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24903 91177308-0d34-0410-b5e6-96231b3b80d8
2005-12-21 17:53:02 +00:00
Chris Lattner
b475c42314 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24328 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 18:22:38 +00:00
Chris Lattner
b2b96679d1 refactor grammar to eliminate shift-reduce conflict. Move alignment checking
code out of all of the clients and into OptAlign/OptCAlign


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24327 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 18:21:21 +00:00
Chris Lattner
e869eef7d3 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24316 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 00:11:49 +00:00
Chris Lattner
b7d08a50f5 add a token
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24315 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 00:11:30 +00:00
Chris Lattner
164c378047 Parse section info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24314 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-12 00:11:10 +00:00
Chris Lattner
9547d7fe33 Force vectors to be a power of two in size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24265 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-10 01:42:43 +00:00
Chris Lattner
0019bbe198 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24211 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 06:46:53 +00:00
Chris Lattner
87ac972709 Allow globals to have an alignment specified. Switch to using isPowerOf2_32
at Jim's request for the checking code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24210 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 06:46:28 +00:00
Chris Lattner
7d09ab6b88 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24208 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 06:34:34 +00:00
Chris Lattner
66db8e4aab factor optional alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24207 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-06 06:34:12 +00:00
Chris Lattner
d91c32110a regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24199 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 21:54:23 +00:00
Chris Lattner
ac6e5c10db Verify that alignment amounts are a power of 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24198 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 21:54:03 +00:00
Nate Begeman
14b0529532 Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.

No targets currently do anything with this information, nor is it presrved
in the bytecode representation.  That's coming up next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24196 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-05 09:21:28 +00:00
Jeff Cohen
66c5fd6c53 When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type.  An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23888 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-23 04:37:20 +00:00
Reid Spencer
68a24bdba4 Implement PR614:
These changes modify the makefiles so that the output of flex and bison are
placed in the SRC directory, not the OBJ directory. It is intended that they
be checked in as any other LLVM source so that platforms without convenient
access to flex/bison can be compiled. From now on, if you change a .y or
.l file you *must* also commit the generated .cpp and .h files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23115 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 18:50:39 +00:00
Chris Lattner
548021f411 Fix grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22279 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-24 18:00:40 +00:00
Andrew Lenharth
213e557cef If we support structs as va_list, we must pass pointers to them to va_copy
See last commit for LangRef, this implements it on all targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22273 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-22 21:04:42 +00:00
Andrew Lenharth
31c98bfb85 because some functions just use va_start and pass things to vfprintf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22269 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-20 15:41:37 +00:00
Andrew Lenharth
017fba9d0f va_end fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22262 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-19 14:04:55 +00:00
Andrew Lenharth
e78f50deea add a check for the mixing of vaarg and vanext with va_arg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22260 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-19 03:53:56 +00:00
Andrew Lenharth
558bc88a00 core changes for varargs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22254 91177308-0d34-0410-b5e6-96231b3b80d8
2005-06-18 18:34:52 +00:00
Chris Lattner
6184febcda Give the asmparser the ability to parse strings. Patch contributed by
Alexander Friedman


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22146 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-20 03:25:47 +00:00
Misha Brukman
5a2a3826ef * Convert tabs to spaces, fix code alignment
* Remove trailing whitespace
* Wrap long lines


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21844 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 22:02:28 +00:00
Chris Lattner
a8e8f16714 parse new calling conv specifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21748 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 20:27:19 +00:00
Chris Lattner
f924a4c21f use splice instead of remove/insert for a minor speedup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21743 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 19:58:35 +00:00
Chris Lattner
1f64025d88 remove some ugly hacks that are no longer needed since andrew removed the
varargs munging code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21742 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 19:49:51 +00:00
Chris Lattner
c28ade4266 lex tail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21729 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 06:20:33 +00:00
Chris Lattner
ddb6db4fa1 Add a 'tail' marker for call instructions, patch contributed by
Alexander Friedman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21722 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 05:51:46 +00:00
Andrew Lenharth
abc73b3e5d Remove support for 1.0 style varargs
amusing of course, because we will have to go back to those semantics soon


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21654 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-02 19:07:27 +00:00
Misha Brukman
019b63931b * Remove trailing whitespace
* Convert tabs to spaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21415 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 21:10:11 +00:00
Chris Lattner
20b463629b fix PR549
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21360 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 15:27:29 +00:00
Chris Lattner
60cd9558ba don't crash in some bad cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20776 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-23 01:29:26 +00:00
Chris Lattner
355ad1f3af 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20726 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-21 06:27:42 +00:00
Chris Lattner
e4d5c441e0 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 04:54:21 +00:00
Chris Lattner
262bb9ae5e zap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20461 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-05 19:04:07 +00:00
Chris Lattner
69331f5726 add more checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20296 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-24 05:25:17 +00:00
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
4047a49cdc Apparently := confuses makellvm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19965 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-01 01:47:12 +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
a8101c163d Silence VS warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19390 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-08 20:07:03 +00:00
Alkis Evlogimenos
d82ef51187 Do not allow empty label names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18743 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 05:40:19 +00:00
Chris Lattner
c6c9772823 Implement test/Feature/escaped_label.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18741 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-10 05:27:29 +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
Reid Spencer
5d6ca51ded 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17289 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-28 00:43:24 +00:00
Reid Spencer
6cb21d443e Change Library Names Not To Conflict With Others When Installed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 23:18: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
Reid Spencer
cac731ecbe We won't use automake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17155 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 03:35:04 +00:00
Reid Spencer
86d341b204 Initial automake generated Makefile template
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17136 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 23:55:41 +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
Reid Spencer
d96cb6eaa0 Update to reflect changes in Makefile rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16950 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-13 11:46:52 +00:00
Reid Spencer
9f41a5fe85 Initial version of automake Makefile.am file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-10 20:43:57 +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
3cd2fe3d2f bug 263:
Provide new tokens for target triples and dependent libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15208 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:56:00 +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
65cd4b0fa7 Fine-grainify namespacification, prune #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14792 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 08:42:12 +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
Reid Spencer
77f4d868d7 Remove use of Type::TypeTy which is no longer defined. This change needed
for bug 122 since the "Type Type" concept is gone now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14620 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 12:17:44 +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
Chris Lattner
a0846a3fa7 Add support for dos-style files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13837 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 17:49:14 +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
e151259288 Hrm, we were leaking ~1M of garbage that valgrind never told us about because
it was "reachable".  Cute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12515 91177308-0d34-0410-b5e6-96231b3b80d8
2004-03-19 23:34:33 +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
Misha Brukman
1913848e33 * Eliminate `using' directive
* Order #includes as per style guide


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9429 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 18:00:34 +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
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
a626e0242e Eliminate unused class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9270 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:39:41 +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
Brian Gaeke
778fab283e Include <cctype> and <cstdlib> instead of <ctype.h> and "Config/stdlib.h".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9036 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 19:12: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
Misha Brukman
3229991165 Uppercase the acronym ASCII.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8676 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:50:25 +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
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +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
7a5a1f790f Use a union to cast int to fp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5849 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 20:20:28 +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
3e8ba10750 Allow hexadecimal integer constants to be used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5802 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-17 22:17:32 +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
Misha Brukman
236757df2e Ignore generated files Lexer.cpp and llvmAsmParser.*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4861 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-02 21:14:54 +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
5fefb25253 include/llvm/DataTypes.h includes this #define so we don't need it anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3709 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-13 22:25:00 +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
77e14adf0b AsmParser now depends on clients to verify that input is well formed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3548 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-30 22:52:23 +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
Vikram S. Adve
f946bcdc23 Declare globals llvmAsmtext and llvmAsmleng for use in the parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2893 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 22:49:40 +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
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +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
c8a79af27d isLabelType is obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2175 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 21:59:08 +00:00
Chris Lattner
afca8bbf06 Library bumped up out of Assembly directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2164 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 20:17:06 +00:00
Chris Lattner
b55679d427 Add a better comment to explain what is going on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2139 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 08:31:26 +00:00
Chris Lattner
74dbc99777 Remove debugging code accidentally checked in!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2137 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 08:13:29 +00:00
Chris Lattner
275da86ab0 Add support for hexadecimal FP constants!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2135 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 08:10:41 +00:00
Chris Lattner
2aac6bf66a s/MethodType/FunctionType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2115 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 22:19:18 +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
4e4cae87f9 Lexer doesn't create typehandle gross stuff now, parser does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2103 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:22:17 +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
fbdb1da666 Close input file if exception is thrown
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1784 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-20 18:06:43 +00:00
Chris Lattner
0b91acf5db Change to verifier interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1782 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-20 17:56:02 +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
9a88d278dd Allow hyphens in identifier names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1409 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-04 04:31:30 +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
1e2c614864 Support floating point numbers in expodential form so that small numbers don't get truncated, which broke the health benchmark
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1087 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-01 22:06:08 +00:00
Chris Lattner
90ebc114c6 Negative FP constants... whodathunkit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@963 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 04:13:01 +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
8c9c586768 Add operator< to ValID's so that they can be put in map's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@757 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-13 06:37:47 +00:00
Chris Lattner
b4d22f9952 Remove exception specification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@756 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-13 06:37:27 +00:00
Chris Lattner
5efbbc28f6 Support the new Invoke instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@755 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-13 06:37:14 +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
1d87bcf490 Convert more code to use new style casts
Eliminate old style casts from value.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@696 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-01 20:11:19 +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
eb5ff8d517 Add support for forward referencing types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@445 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-07 16:33:01 +00:00
Chris Lattner
e1fe875fc2 Add support for an opaque type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@444 91177308-0d34-0410-b5e6-96231b3b80d8
2001-09-07 16:32:43 +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
57dbb3ad63 Moved inline/llvm/Tools/* to include/llvm/Support/*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-23 17:46:59 +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
a41f50dea8 Broad superficial changes:
* Renamed getOpcode to getOpcodeName
* Changed getOpcodeName to return a const char * instead of string
* Added a getOpcode method to replace getInstType
* Changed code to use getOpcode instead of getInstType


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152 91177308-0d34-0410-b5e6-96231b3b80d8
2001-07-07 19:24: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