1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

264 Commits

Author SHA1 Message Date
Reid Spencer
2e9ba7166f 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.

llvm-svn: 30834
2006-10-09 17:36:59 +00:00
Chris Lattner
168061f13d Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().

llvm-svn: 30665
2006-09-28 23:35:22 +00:00
Reid Spencer
0d237ceba1 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.

llvm-svn: 30650
2006-09-28 19:28:24 +00:00
Anton Korobeynikov
7c2118575c Added some eye-candy for Subtarget type checking
Added X86 StdCall & FastCall calling conventions. Codegen will follow.

llvm-svn: 30446
2006-09-17 20:25:45 +00:00
Anton Korobeynikov
b2b7c2f8b9 Small fixes for supporting dll* linkage types
llvm-svn: 30441
2006-09-17 13:06:18 +00:00
Anton Korobeynikov
6e19f80688 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.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Chris Lattner
b3b620030f trivial optimization
llvm-svn: 29770
2006-08-18 17:34:24 +00:00
Reid Spencer
32bc5710a6 Add a comment about the mechanisms used to rid AsmParser of exceptions.
llvm-svn: 29769
2006-08-18 17:32:55 +00:00
Reid Spencer
c7c0e6c6ef 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.

llvm-svn: 29763
2006-08-18 08:43:06 +00:00
Reid Spencer
ac33b75511 Fix grammar in a comment.
llvm-svn: 28534
2006-05-29 02:34:34 +00:00
Chris Lattner
eb18e81992 Add support for parsing csret
llvm-svn: 28406
2006-05-19 21:28:34 +00:00
Chris Lattner
a637f981d7 Use isValidOperands instead of duplicating or eliding checks.
llvm-svn: 27525
2006-04-08 04:08:32 +00:00
Chris Lattner
6be33112a7 Add insertelement and shufflevector constantexpr support
llvm-svn: 27520
2006-04-08 03:53:34 +00:00
Chris Lattner
97a47d4c9c Parse shufflevector
llvm-svn: 27511
2006-04-08 01:18:35 +00:00
Chris Lattner
b780a1ecdc Don't use invalidated iterators!
llvm-svn: 26521
2006-03-04 07:53:16 +00:00
Chris Lattner
ac76b3c549 Parse inline asm objects
llvm-svn: 25618
2006-01-25 22:26:43 +00:00
Chris Lattner
2cbee3afee Rename method
llvm-svn: 25571
2006-01-24 04:14:29 +00:00
Chris Lattner
239ebe1535 syntax change
llvm-svn: 25567
2006-01-24 00:40:17 +00:00
Chris Lattner
1f9d99295e Add support for parsing global asm blocks
llvm-svn: 25557
2006-01-23 23:05:15 +00:00
Reid Spencer
fd0ae0047a Make sure intrinsic auto-upgrade is invoked correctly.
llvm-svn: 25434
2006-01-19 01:21:04 +00:00
Robert Bocchino
30daf8a531 Lexer and parser support for the insertelement operation.
llvm-svn: 25403
2006-01-17 20:06:25 +00:00
Reid Spencer
3cecd3c4cf 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.

llvm-svn: 25366
2006-01-16 21:12:35 +00:00
Robert Bocchino
b33dab425c Added lexer and parser support for the extractelement operation.
llvm-svn: 25177
2006-01-10 19:04:32 +00:00
Chris Lattner
2c88f52eb3 allow logical operators on packed integral types
llvm-svn: 24907
2005-12-21 18:31:29 +00:00
Chris Lattner
4ca5857a7c Implement Regression/Assembler/2005-12-21-ZeroInitVector.ll
llvm-svn: 24903
2005-12-21 17:53:02 +00:00
Chris Lattner
4d0f7614d8 refactor grammar to eliminate shift-reduce conflict. Move alignment checking
code out of all of the clients and into OptAlign/OptCAlign

llvm-svn: 24327
2005-11-12 18:21:21 +00:00
Chris Lattner
01374bd923 Parse section info
llvm-svn: 24314
2005-11-12 00:11:10 +00:00
Chris Lattner
8a169a30ae Force vectors to be a power of two in size
llvm-svn: 24265
2005-11-10 01:42:43 +00:00
Chris Lattner
8cda8020c7 Allow globals to have an alignment specified. Switch to using isPowerOf2_32
at Jim's request for the checking code.

llvm-svn: 24210
2005-11-06 06:46:28 +00:00
Chris Lattner
e09addd94b factor optional alignment
llvm-svn: 24207
2005-11-06 06:34:12 +00:00
Chris Lattner
f2e7f355a0 Verify that alignment amounts are a power of 2
llvm-svn: 24198
2005-11-05 21:54:03 +00:00
Nate Begeman
f299b9fb03 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.

llvm-svn: 24196
2005-11-05 09:21:28 +00:00
Jeff Cohen
a38c737e85 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.

llvm-svn: 23888
2005-10-23 04:37:20 +00:00
Chris Lattner
6f3c7b46ee Fix grammar
llvm-svn: 22279
2005-06-24 18:00:40 +00:00
Andrew Lenharth
4fd2bde906 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.

llvm-svn: 22273
2005-06-22 21:04:42 +00:00
Andrew Lenharth
ce6f907ffe because some functions just use va_start and pass things to vfprintf
llvm-svn: 22269
2005-06-20 15:41:37 +00:00
Andrew Lenharth
231216b573 va_end fix
llvm-svn: 22262
2005-06-19 14:04:55 +00:00
Andrew Lenharth
6bbe9d92c6 add a check for the mixing of vaarg and vanext with va_arg
llvm-svn: 22260
2005-06-19 03:53:56 +00:00
Andrew Lenharth
a9214fec08 core changes for varargs
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Chris Lattner
993038773b Give the asmparser the ability to parse strings. Patch contributed by
Alexander Friedman

llvm-svn: 22146
2005-05-20 03:25:47 +00:00
Misha Brukman
d264be8e32 * Convert tabs to spaces, fix code alignment
* Remove trailing whitespace
* Wrap long lines

llvm-svn: 21844
2005-05-10 22:02:28 +00:00
Chris Lattner
562734e130 parse new calling conv specifiers
llvm-svn: 21748
2005-05-06 20:27:19 +00:00
Chris Lattner
0995b3da02 use splice instead of remove/insert for a minor speedup
llvm-svn: 21743
2005-05-06 19:58:35 +00:00
Chris Lattner
146014b748 remove some ugly hacks that are no longer needed since andrew removed the
varargs munging code

llvm-svn: 21742
2005-05-06 19:49:51 +00:00
Chris Lattner
72ffd7e7d5 Add a 'tail' marker for call instructions, patch contributed by
Alexander Friedman.

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

llvm-svn: 21654
2005-05-02 19:07:27 +00:00
Chris Lattner
8fa2449908 don't crash in some bad cases.
llvm-svn: 20776
2005-03-23 01:29:26 +00:00
Chris Lattner
ce471ff361 Remove a bunch of cruft and dead code for handling the case when types were
defined in function constant pools.  The assembler grammar has long
disallowed functions from having constant pools, so all of this stuff is
dead.

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

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

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

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
70ffed029e zap
llvm-svn: 20461
2005-03-05 19:04:07 +00:00