Skip to content

Commit aa97a35

Browse files
author
David Ungar
authored
Merge pull request #408 from davidungar/better-dep-printing
[Incremental] Better dependency node printing
2 parents 528e7ba + f9adb7c commit aa97a35

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Sources/SwiftDriver/Incremental Compilation/DependencyKey.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ public struct DependencyKey: Hashable, CustomStringConvertible {
6868
public var description: String {
6969
switch self {
7070
case let .topLevel(name: name):
71-
return "top-level name \(name)"
71+
return "top-level name '\(name)'"
7272
case let .nominal(context: context):
73-
return "type \(context)"
73+
return "type '\(context)'"
7474
case let .potentialMember(context: context):
75-
return "potential members of \(context)"
75+
return "potential members of '\(context)'"
7676
case let .member(context: context, name: name):
77-
return "member \(name) of \(context)"
77+
return "member '\(name)' of '\(context)'"
7878
case let .dynamicLookup(name: name):
79-
return "AnyObject member \(name)"
79+
return "AnyObject member '\(name)'"
8080
case let .externalDepend(externalDependency):
81-
return "module \(externalDependency)"
81+
return "module '\(externalDependency)'"
8282
case let .sourceFileProvide(name: name):
83-
return (try? VirtualPath(path: name).basename) ?? name
83+
return "source file '\((try? VirtualPath(path: name).basename) ?? name)'"
8484
}
8585
}
8686
}

Sources/SwiftDriver/Incremental Compilation/ModuleDependencyGraph Parts/Node.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ extension ModuleDependencyGraph.Node: Comparable {
9999

100100
extension ModuleDependencyGraph.Node: CustomStringConvertible {
101101
public var description: String {
102-
"\(dependencyKey)\( swiftDeps?.description ?? "<expat>")"
102+
"\(dependencyKey) \( swiftDeps.map { "in \($0.description)" } ?? "<expat>" )"
103103
}
104104
}
105105

Tests/SwiftDriverTests/IncrementalCompilationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ final class IncrementalCompilationTests: XCTestCase {
496496
"Forming batch job from 1 constituents: main.swift",
497497
"Incremental compilation: Queuing Compiling main.swift",
498498
"Starting Compiling main.swift",
499-
"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",
499+
"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",
500500
"Incremental compilation: Queuing because of dependencies discovered later: {compile: other.o <= other.swift}",
501501
"Incremental compilation: Scheduling discovered {compile: other.o <= other.swift}",
502502
"Finished Compiling main.swift",
@@ -520,7 +520,7 @@ final class IncrementalCompilationTests: XCTestCase {
520520
"Incremental compilation: May skip current input: {compile: other.o <= other.swift}",
521521
"Incremental compilation: Queuing (initial): {compile: main.o <= main.swift}",
522522
"Incremental compilation: scheduling dependents of main.swift; -driver-always-rebuild-dependents",
523-
"Incremental compilation: Traced: interface of top-level name foo from: main.swift -> implementation of other.swiftdeps from: other.swift",
523+
"Incremental compilation: Traced: interface of top-level name 'foo' from: main.swift -> implementation of source file 'other.swiftdeps' from: other.swift",
524524
"Incremental compilation: Found dependent of main.swift: {compile: other.o <= other.swift}",
525525
"Incremental compilation: Immediately scheduling dependent on main.swift {compile: other.o <= other.swift}",
526526
"Incremental compilation: Queuing (dependent): {compile: other.o <= other.swift}",

0 commit comments

Comments
 (0)