Skip to content

Commit a6719ec

Browse files
committed
Do not store context creation trace in -Ydebug
This makes the compiler unusably slow.
1 parent e177e78 commit a6719ec

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -249,25 +249,6 @@ object Contexts {
249249
final def withPhaseNoLater(phase: Phase) =
250250
if (ctx.phase.id > phase.id) withPhase(phase) else ctx
251251

252-
/** If -Ydebug is on, the top of the stack trace where this context
253-
* was created, otherwise `null`.
254-
*/
255-
private var creationTrace: Array[StackTraceElement] = _
256-
257-
private def setCreationTrace() =
258-
if (this.settings.debug.value)
259-
creationTrace = (new Throwable).getStackTrace().take(20)
260-
261-
/** Print all enclosing context's creation stacktraces */
262-
def printCreationTraces() = {
263-
println("=== context creation trace =======")
264-
for (ctx <- outersIterator) {
265-
println(s">>>>>>>>> $ctx")
266-
if (ctx.creationTrace != null) println(ctx.creationTrace.mkString("\n"))
267-
}
268-
println("=== end context creation trace ===")
269-
}
270-
271252
/** The current reporter */
272253
def reporter: Reporter = typerState.reporter
273254

@@ -391,7 +372,6 @@ object Contexts {
391372
this.implicitsCache = null
392373
this.phasedCtx = this
393374
this.phasedCtxs = null
394-
setCreationTrace()
395375
this
396376
}
397377

0 commit comments

Comments
 (0)