Commit Graph

14 Commits

Author SHA1 Message Date
Erik Eckstein
789646a15b Demangling: Make demangled names more readable and further reduce the size of the simplified demangled names
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)
2017-04-13 08:43:28 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Vedant Kumar
31365c3af3 [Coverage] Make a test easier to read 2016-02-10 18:22:01 -08:00
Vedant Kumar
be87f04807 [Coverage] Fix the counter increment for repeat-while bodies
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.
2016-02-10 16:32:07 -08:00
Vedant Kumar
7375b6fedc [Coverage] Clean up warnings in coverage_while.swift (NFC) 2016-02-09 16:29:33 -08:00
Vedant Kumar
376870e357 [Coverage] Fix handling of return statements within repeat-while loops
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
2016-02-09 16:16:49 -08:00
Vedant Kumar
0199f8e083 [Coverage] Remove leftover lit CHECK (NFC) 2016-02-09 13:26:23 -08:00
Vedant Kumar
2a34b7c641 [Coverage] Fix handling of abnormal exits through repeat blocks
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
2016-02-09 13:19:22 -08:00
Erik Eckstein
c0cdbc4510 SILPrinter: only print simplified demangled names in comments.
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.
2016-02-09 08:51:47 -08:00
Dmitri Gribenko
9d5cbc4428 Revert "Removed the ++ and -- operators" 2015-12-26 12:48:02 +01:00
David Walter
9513d1797c Removed some post-, preincrement/decrements from test
Removed some post-, preincrement/decrements from test
2015-12-06 23:56:08 +01:00
Justin Bogner
5fe447dd8d InstrProf: Fix the coverage of the condition in repeat-while
Swift SVN r27883
2015-04-28 21:56:55 +00:00
Justin Bogner
2311b939ea InstrProf: Improve handling of while conditions
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
2015-02-21 02:05:49 +00:00
Justin Bogner
d44090d29e InstrProf: Optionally generate coverage maps when profiling
This adds the -profile-coverage-mapping option to swift, and teaches
SILGenProfiling to generate mappings from source ranges to counters.

Swift SVN r25266
2015-02-13 08:42:15 +00:00