Skip to content

[Incremental] Better dependency node printing #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Sources/SwiftDriver/Incremental Compilation/DependencyKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ public struct DependencyKey: Hashable, CustomStringConvertible {
public var description: String {
switch self {
case let .topLevel(name: name):
return "top-level name \(name)"
return "top-level name '\(name)'"
case let .nominal(context: context):
return "type \(context)"
return "type '\(context)'"
case let .potentialMember(context: context):
return "potential members of \(context)"
return "potential members of '\(context)'"
case let .member(context: context, name: name):
return "member \(name) of \(context)"
return "member '\(name)' of '\(context)'"
case let .dynamicLookup(name: name):
return "AnyObject member \(name)"
return "AnyObject member '\(name)'"
case let .externalDepend(externalDependency):
return "module \(externalDependency)"
return "module '\(externalDependency)'"
case let .sourceFileProvide(name: name):
return (try? VirtualPath(path: name).basename) ?? name
return "source file '\((try? VirtualPath(path: name).basename) ?? name)'"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ extension ModuleDependencyGraph.Node: Comparable {

extension ModuleDependencyGraph.Node: CustomStringConvertible {
public var description: String {
"\(dependencyKey)\( swiftDeps?.description ?? "<expat>")"
"\(dependencyKey) \( swiftDeps.map { "in \($0.description)" } ?? "<expat>" )"
}
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftDriverTests/IncrementalCompilationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ final class IncrementalCompilationTests: XCTestCase {
"Forming batch job from 1 constituents: main.swift",
"Incremental compilation: Queuing Compiling main.swift",
"Starting Compiling main.swift",
"Incremental compilation: Traced: interface of main.swiftdeps from: main.swift -> interface of top-level name foo from: main.swift -> implementation of other.swiftdeps from: other.swift",
"Incremental compilation: Traced: interface of source file 'main.swiftdeps' from: main.swift -> interface of top-level name 'foo' from: main.swift -> implementation of source file 'other.swiftdeps' from: other.swift",
"Incremental compilation: Queuing because of dependencies discovered later: {compile: other.o <= other.swift}",
"Incremental compilation: Scheduling discovered {compile: other.o <= other.swift}",
"Finished Compiling main.swift",
Expand All @@ -520,7 +520,7 @@ final class IncrementalCompilationTests: XCTestCase {
"Incremental compilation: May skip current input: {compile: other.o <= other.swift}",
"Incremental compilation: Queuing (initial): {compile: main.o <= main.swift}",
"Incremental compilation: scheduling dependents of main.swift; -driver-always-rebuild-dependents",
"Incremental compilation: Traced: interface of top-level name foo from: main.swift -> implementation of other.swiftdeps from: other.swift",
"Incremental compilation: Traced: interface of top-level name 'foo' from: main.swift -> implementation of source file 'other.swiftdeps' from: other.swift",
"Incremental compilation: Found dependent of main.swift: {compile: other.o <= other.swift}",
"Incremental compilation: Immediately scheduling dependent on main.swift {compile: other.o <= other.swift}",
"Incremental compilation: Queuing (dependent): {compile: other.o <= other.swift}",
Expand Down