Commit Graph

216 Commits

Author SHA1 Message Date
Chris Lattner
bb82daca8f generalize parseToken to take an arbitrary argument list for the diagnostic
when it fails.

Teach the SIL parser to parse and validate (but still discard) tuple and
return instructions.


Swift SVN r5318
2013-05-25 00:40:46 +00:00
Chris Lattner
bd217c9227 extend the general form of parseIdentifier to optionally return a SourceLoc,
and use this throughout the parser.


Swift SVN r5314
2013-05-25 00:07:56 +00:00
Chris Lattner
5d434c581b move sil function parsing logic into the SILParserFunctionState class.
Swift SVN r5311
2013-05-24 23:43:02 +00:00
Chris Lattner
39d0d13dbb Diagnose SIL BB redefinition errors, add a testcase to check error conditions.
Swift SVN r5278
2013-05-22 23:03:31 +00:00
Chris Lattner
3fb5bcf16b implement name binding mechanics for SILBasicBlock's.
Swift SVN r5277
2013-05-22 22:34:44 +00:00
Chris Lattner
98d708d1fc In a SIL function body, lex %42 as a new sil_local_name token.
Swift SVN r5261
2013-05-22 05:34:18 +00:00
Chris Lattner
eeb05ae90b Start working towards SIL parser support for basic blocks and instructions.
For now, just stub out instruction parsing with a hungry loop to get our
minimal testcase parsing (but ignored).


Swift SVN r5259
2013-05-22 00:55:52 +00:00
Chris Lattner
e0527c8a84 simplify resolveIdentifierType() in two ways:
1) a DeclContext doesn't need to be passed in, now that IdentifierType tracks it.
2) factor the code that sets Components to ErrorType out of the clients.




Swift SVN r5250
2013-05-21 05:46:16 +00:00
Chris Lattner
8c85a49d2a with the groundwork out of the way, we can now namebind types referenced
by the SIL parser.  Add a test that covers both local types, and types
that require looking through an import decl (Int, from the stdlib).


Swift SVN r5249
2013-05-21 05:34:24 +00:00
Chris Lattner
1fde9f69fd remove the diag::tuple_global_missing_type diagnostic, which printed as
"a tuple type specifying the type of a global must explicitly state the type of each tuple element".

This diagnostic doesn't make any sense, and is apparently only generated by the old
type checker.  It is also the only thing keeping the "isFirstPass" argument to
TC.validateType() alive, so remove it.

The new type checker does have issues with default values, I filed 
rdar://13946171 to track it, but this old approach (which I wrote, *shame*) 
seems way too broken to salvage.



Swift SVN r5244
2013-05-21 04:08:32 +00:00
Chris Lattner
b4e7ab4247 use TypeLowering to produce SILTypes that make sense now that aggregates
have been simplified.  This still isn't ideal, but is a lot better than
what we had, and is waiting for SILFunctionTypeInfo to stop containing
SILTypes.


Swift SVN r5232
2013-05-20 19:36:57 +00:00
Chris Lattner
a38747b6a2 remove parsing logic for SILType calling convention attribute, this
is hoisted up to Type now.



Swift SVN r5230
2013-05-20 19:29:44 +00:00
Chris Lattner
087d4c8430 Implement the parsing logic for SIL types (the SILType specific attributes).
All of it is still dropped on the floor.


Swift SVN r5195
2013-05-17 01:02:02 +00:00
Chris Lattner
611a3a97db Parse sil linkage types, and actually create the SILFunction parsed.
This gets us prototypes parsing and printing, though types aren't
correct at all yet.



Swift SVN r5192
2013-05-16 22:48:07 +00:00
Chris Lattner
bde8f753da wire up minimal sil function parsing (still not validating or creating
a SIL function).  This introduces contextual lexing state for SIL function 
bodies for SIL-specific lexing rules.


Swift SVN r5179
2013-05-16 18:46:46 +00:00
Chris Lattner
192475ad88 carve out a new file for the sil parser logic.
Swift SVN r5177
2013-05-16 17:59:30 +00:00