Chris Lattner
df9ae62700
parse the alloc_box instruction.
...
Swift SVN r6045
2013-07-08 15:05:06 +00:00
Chris Lattner
e51b88ce95
add silparser support for checked cast instructions, with downcast as an exemplar.
...
Swift SVN r5930
2013-07-01 17:24:32 +00:00
Chris Lattner
41591909d8
Change the syntax of SIL cast instructions to use the 'to' keyword.
...
This is better for uniformity with store and also is less of a punctuation
soup, making things easier to read.
Swift SVN r5928
2013-07-01 16:51:02 +00:00
Chris Lattner
cd5c533a40
add silparser support for upcast.
...
Swift SVN r5926
2013-07-01 16:40:47 +00:00
Chris Lattner
6c4b37fd30
make class_method and protocol_method print the type of the object value being referenced,
...
a step towards parsability.
Swift SVN r5925
2013-07-01 16:31:39 +00:00
Chris Lattner
03aa55802b
implement alloc_ref and ref_to_object_pointer
...
Swift SVN r5919
2013-07-01 00:38:47 +00:00
Chris Lattner
9f5145be4f
silparser support for project_existential and destroy_addr.
...
Swift SVN r5917
2013-07-01 00:00:19 +00:00
Chris Lattner
76e15b8472
make the SIL parser put basic blocks in the order that they are defined, not
...
the order they are referenced. Fix a testcase to use control flow instead
of producing invalid SSA to test forward refs of values, fixing a FIXME.
Swift SVN r5916
2013-06-30 23:40:59 +00:00
Chris Lattner
5ac61b6b90
add testcase for unconditional branch, which exposes a bug: the wrong mneumonic was used.
...
Swift SVN r5915
2013-06-30 23:37:12 +00:00
Chris Lattner
b13c50157e
implement proper name binding and resolution of global sil function names, including
...
diagnosing redefinitions, use of undefined values, handling forward references, etc.
Swift SVN r5908
2013-06-30 19:31:19 +00:00
Manman Ren
8b2cf98fec
SIL Parser: parse branch and condbranch.
...
Swift SVN r5872
2013-06-28 17:51:13 +00:00
Chris Lattner
be0f7b4c48
Wire up initial support for function_ref, allowing us to SILParse the code for "return 4".
...
This is terrible in several ways: it doesn't handle forward references, we do a linear scan
of SILFunctions, and diagnostics don't exist. Room for improvement some other time.
Swift SVN r5736
2013-06-21 05:27:15 +00:00
Chris Lattner
9cf535be31
after parsing an applyinst, actually create it! We can now silparse
...
the sil for this function:
func call(fnptr : () -> Int) -> Int {
return fnptr()
}
Swift SVN r5724
2013-06-20 20:29:21 +00:00
Chris Lattner
88e8f0227a
Start parsing SIL apply instructions. Right now, they are dropped on the floor because I have to run.
...
Swift SVN r5720
2013-06-20 17:57:04 +00:00
Chris Lattner
e4e1d635a2
fix couple fixme's by having the SILParser make SILTypes directly
...
instead of going through TypeConverter.
Swift SVN r5527
2013-06-07 23:19:18 +00:00
Chris Lattner
5350849cbe
Parser support for retain/release/retain_autoreleased.
...
Swift SVN r5357
2013-05-26 23:22:40 +00:00
Chris Lattner
3b82c89106
implement parsing support for the metatype instruction.
...
Swift SVN r5356
2013-05-26 23:14:41 +00:00
Chris Lattner
e052f3ca41
change the sil printer to print the type of the destination
...
operand, producing something like:
%2 = store %0 to %1 : $*Int64
Enhance the sil parser to be able to parse this. We can now
round trip everything required to handle this function:
func foo(a : Int) -> Int {
return a
}
Swift SVN r5354
2013-05-26 14:43:17 +00:00
Chris Lattner
63557b5ddd
parse basic block argument lists.
...
Swift SVN r5353
2013-05-26 06:22:02 +00:00
Chris Lattner
dfef589a4b
implement generic support for parsing the [thin] attribute on function types.
...
Switch SILType parsing to parse type annotations.
This allows us to use thin functions in .sil files.
Swift SVN r5351
2013-05-26 06:11:13 +00:00
Chris Lattner
56ded647de
- Implement parsing of load, alloc_var, and dealloc_var.
...
- Fix SIL Type parsing of address types.
- Remove dead siltype parsing logic for attributes like sil_sret
and sil_uncurry.
Swift SVN r5350
2013-05-26 06:00:21 +00:00
Chris Lattner
a34f4efa13
parse integer_literal. Parse and print tuple instructions with named
...
elements in a way that we can not lose information.
Swift SVN r5348
2013-05-26 01:09:46 +00:00
Chris Lattner
479cbd2ac6
don't require the basic block name to be present. It is particularly
...
annoying when hand writing tests for the entry block.
Swift SVN r5347
2013-05-25 22:36:17 +00:00
Chris Lattner
686efc45db
allow naming local values in .sil files something meaningful, like %a.
...
Swift SVN r5346
2013-05-25 22:20:57 +00:00
Chris Lattner
c801ea6de0
diagnose use of undefined values.
...
Swift SVN r5345
2013-05-25 22:19:26 +00:00
Chris Lattner
2e69c61f71
Implement more reasonable local value name lookup:
...
- Allow forward references.
- Diagnose redefinitions.
- Diagnose cases where the use/def of a value mismatch type.
While I'm at it, this fixes a bug where tuple parsing wasn't parsing
the separating commas.
Swift SVN r5343
2013-05-25 18:42:38 +00:00
Chris Lattner
44cdd1d59d
parse and build tuple and return instructions. Add a terrible hack at
...
local name lookup.
Swift SVN r5334
2013-05-25 16:12:42 +00:00
Chris Lattner
ce314e59c1
- introduce a form of Parser::parseIdentifier that captures a token location,
...
requiring us to make the variadic templates a bit more specific.
- Make SIL parser tests use updated syntax (still not parsed).
Swift SVN r5312
2013-05-24 23:59:21 +00:00
Chris Lattner
0ad6fac283
Remove the basic block name field from SILBasicBlock. The name is currently
...
ignored and is going to be a private detail of the SILParser.
Swift SVN r5276
2013-05-22 22:24:39 +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
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
6a33a4ddf1
actually invoke filecheck in this test, ahem.
...
Swift SVN r5247
2013-05-21 05:30:51 +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
b4eee19287
Switch the SIL parse to parse the file in a model similar to "immediate"
...
mode for normal .swift files. We basically parse batches of non-sil function
decls, type check them as a batch, then process any SIL functions. This allows
us to have mutually recursive types and other things that are fully sema'd and
that are referenced by SIL functions, without involving SIL functions too
intimately with type checking.
This does mean that SIL functions can't forward reference types, oh well.
Swift SVN r5243
2013-05-21 03:27:27 +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
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
85c7c494ae
Wire up the most trivial support for sil parsing, which allows us to write
...
a (trivial, empty) sil parser testcase. The parser is still not SIL aware
though.
Swift SVN r4585
2013-04-03 05:57:42 +00:00