The goal here is to make the short demangling as short and readable as possible, also at the cost of omitting some information.
The assumption is that whenever the short demangling is displayed, there is a way for the user to also get the full demangled name if needed.
*) omit <where ...> because it does not give useful information anyway
Deserializer.deserialize<A where ...> () throws -> [A]
--> Deserializer.deserialize<A> () throws -> [A]
*) for multiple specialized functions only emit a single “specialized”
specialized specialized Constructible.create(A.Element) -> Constructible<A>
--> specialized Constructible.create(A.Element) -> Constructible<A>
*) Don’t print function argument types:
foo(Int, Double, named: Int)
--> foo(_:_:named:)
This is a trade-off, because it can lead to ambiguity if there are overloads with different types.
*) make contexts of closures, local functions, etc. more readable by using “<a> in <b>” syntax
This is also done for the full and not only for the simplified demangling.
Renderer.(renderInlines([Inline]) -> String).(closure #1)
--> closure #1 in Renderer.renderInlines
*) change spacing, so that it matches our coding style:
foo <A> (x : A)
--> foo<A>(x: A)
We need to increment the counter for repeat-while bodies immediately
after the loop body is entered. This allows us to handle "break" and
"return" statements in the repeat-while body correctly.
This also fixes an off-by-one error where we only updated the
repeat-while body counter when the loop condition evaluates to true.
In 2a34b7c6, we introduced an incorrect test case for return statements
within repeat-while loops. Consider this situation:
repeat { // Region 1
return
} while C1 // Should be "zero", not "Region 1"
The fix requires maintaining a stack of active repeat-while loops. This
is an accepted idiom (c.f the clang CoverageMapping implementation). To
see why a stack is needed, consider:
repeat { // Region 1
repeat { // Region 2
if (C1) { // Region 3
return
}
} while C2 // Should be "Region 2 - *Region 3*", not "Region 2"
} while C3 // Should be "Region 1 - *Region 3*", not "Region 1"
rdar://problem/24572268
We do not correctly update the counter expression for conditionals in
repeat-while blocks in the following two situations:
Situation 1:
repeat { // Region 1
if (C1) { // Region 2
break
}
} while C2 // Should be "Region 1 - Region 2", not "Region 1"
Situation 2:
repeat { // Region 1
if (C1) { // Region 2
continue
}
} while C2 // Should be "Region 1", not "Region 1 + Region 2"
Fix both of these problems and add thorough regression tests.
Closes Swift PR #1244, rdar://problem/24572268
For long names this is easier to read and in most cases the omitted information can be seen in the actual SIL code.
With the option -Xllvm -sil-full-demangle the old behavior can be restored.
Fix a crash in coverage when a while's condition consists only of let
clauses. This degrades to simply not showing the coverage for the
condition in that case for now, since we don't handle Patterns yet.
Swift SVN r25456
This adds the -profile-coverage-mapping option to swift, and teaches
SILGenProfiling to generate mappings from source ranges to counters.
Swift SVN r25266