logic in SILGen. This exposes a bug in the definite analysis pass handling
aggregates, which is why the testcase is changing. Given that noone is using
this yet, I'm just changing the test, I'll fix it next.
Swift SVN r7187
In the case of 'is' patterns involving classes or archetype, we need to include other type casts in the specialization based on whether the archetype or class could still dynamically match the specialized type. We were filtering casts based on orthogonality, which is wrong; we really need to filter based on whether the patterns have nonexhaustive overlap.
Swift SVN r7181
When we have potentially overlapping 'is' patterns, such as multiple class or archetype patterns, and we specialize the decision tree on an 'is' pattern, we derive new 'is' patterns relative to the specialized type, but we weren't actually setting the correct kind for those new patterns. Oops. Caught by Ted.
Swift SVN r7180
assignment is an initialization or not. This will be used by SILGen shortly to
emit the right operation when it doesn't know what sort of an assignment it is
dealing with (which is a flow sensitive property). The definite initialization
pass will then "do the right thing".
Swift SVN r7172
turning them into initializations or stores depending on what they are,
and diagnosing cases where an assignment has different behavior depending
on the path to the instruction.
Swift SVN r7156
the variable being used and the access path to the uninitialized field (if relevant).
For example, for:
func test3() {
var s2 : ((Int, Int), (), SomeStruct, Int)
s2.0 = (1,2)
s2.2.x = 1
s2.2.z = 1
s2.3 = 17337
noop(s2)
}
we now produce:
t.swift:12:8: error: variable 's2.2.y' used before being initialized
noop(s2)
^
t.swift:7:7: note: variable defined here
var s2 : ((Int, Int), (), SomeStruct, Int)
^
Swift SVN r7140
lets us write our first pure swift test for definite initialization.
Despite this being a SIL pass that implements this, writing tests as .swift
files makes sense, given that this is intended to be a stable diagnostic pass.
It is basically like writing a sema test.
Swift SVN r7136
Every valid source location corresponds to a source buffer. There should be no
cases where we create a source location for a random string. Thus,
findBufferContainingLoc() always succeeds.
Swift SVN r7120
Modify SILPrinter to print the generic function type for specialize.
TODO: the testing case needs uniquing of PolymorphicFunctionType. Right now,
we will get a type mismatch between two copies of the same
PolymorphicFunctionType.
Swift SVN r7097
TODO: Conformances are currently not included in SIL.rst for init_existential
or init_existential_ref, but they exist in InitExistentialInst and
InitExistentialRefInst.
Swift SVN r7076
If this is not an invariant on SIL, but only on the output of SILGen,
I'll add an option to the verifier to only check this after SILGen.
Swift SVN r7068
The test displays "<invalid loc>" even though the SIL location is
non-null because the corresponding AST node (Expr) does not have a location.
Swift SVN r7066
since it's stated purpose in life is to build a closure around its argument
values.
Teach definite assignment that escape points for closures require their value
to be initialized. Use this to produce a diagnostic about closures over values
that are not yet initialized.
Swift SVN r7035
This is what the current behavior is, it can change if we find this info
insufficient.
Branches formed from control flow due to IfStmt, ForLoop and other statements and
expressions will have the statement as the location. With one exception - if the
block ends with a return statement, we have the return statement as the location.
Currently, this preserves the location of the original return; before merging into
a single return block.
The instructions building the conditions of the control flow ASTNodes, have the
condition as the location. (I've added test for this, but this was already working
as expected.)
Swift SVN r6992
Added a -v(verbose) option to swift that will trigger verbose printing in SIL
Printer. SIL Printer will print the location info only in the verbose mode.
Here is the example of the format - only the line and colon are displayed for
brevity:
%24 = apply %13(%22) : $[cc(method), thin] ((), [byref] Bool) -> Builtin.Int1 // user: %26 line:46:10
(This will be used to test the validity of SILLocation info.)
Swift SVN r6991
This doubles SILLocation to being two words, since SourceLocations
can't be dumped into a PointerUnion, but it is due for a redesign someday
anyway, so I'm not going to worry about it.
Swift SVN r6989