Skip to content

Commit 380d0d9

Browse files
author
David Ungar
authored
Merge pull request #28563 from davidungar/renaming-dependencies
[Incremental compilation] Rename "experimental dependencies" to "fine-grained dependencies"
2 parents 12fd207 + 4d2c46c commit 380d0d9

16 files changed

+166
-167
lines changed

include/swift/AST/ExperimentalDependencies.h renamed to include/swift/AST/FineGrainedDependencies.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- ExperimentalDependencies.h -----------------------------*- C++ -*-===//
1+
//===----- FineGrainedependencies.h -----------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef SWIFT_AST_EXPERIMENTAL_DEPENDENCIES_H
14-
#define SWIFT_AST_EXPERIMENTAL_DEPENDENCIES_H
13+
#ifndef SWIFT_AST_FINE_GRAINED_DEPENDENCIES_H
14+
#define SWIFT_AST_FINE_GRAINED_DEPENDENCIES_H
1515

1616
#include "swift/Basic/Debug.h"
1717
#include "swift/Basic/LLVM.h"
@@ -27,7 +27,7 @@
2727
#include <unordered_set>
2828
#include <vector>
2929

30-
// Summary: The ExperimentalDependency* files contain infrastructure for a
30+
// Summary: The FineGrainedDependency* files contain infrastructure for a
3131
// dependency system that, in the future, will be finer-grained than the current
3232
// dependency system. At present--12/5/18--they are using the same input
3333
// information as the current system and expected to produce the same results.
@@ -36,14 +36,14 @@
3636
//
3737
// The frontend uses the information from the compiler to built a
3838
// SourceFileDepGraph consisting of SourceFileDepGraphNodes.
39-
// ExperimentalDependencies.* define these structures, and
40-
// ExperimentalDependenciesProducer has the frontend-unique code used to build
39+
// FineGrainedDependencies.* define these structures, and
40+
// FineGrainedDependenciesProducer has the frontend-unique code used to build
4141
// the SourceFileDepGraph.
4242
//
4343
// The driver reads the SourceFileDepGraph and integrates it into its dependency
4444
// graph, a ModuleDepGraph consisting of ModuleDepGraphNodes.
4545

46-
// This file holds the declarations for the experimental dependency system
46+
// This file holds the declarations for the fine-grained dependency system
4747
// that are used by both the driver and frontend.
4848
// These include the graph structures common to both programs and also
4949
// the frontend graph, which must be read by the driver.
@@ -59,7 +59,7 @@ class FrontendOptions;
5959
class SourceFile;
6060

6161
/// Use a new namespace to help keep the experimental code from clashing.
62-
namespace experimental_dependencies {
62+
namespace fine_grained_dependencies {
6363

6464
using StringVec = std::vector<std::string>;
6565

@@ -318,7 +318,7 @@ class BiIndexedTwoStageMap {
318318
// End of general declarations
319319

320320
//==============================================================================
321-
// MARK: Start of experimental-dependency-specific code
321+
// MARK: Start of fine-grained-dependency-specific code
322322
//==============================================================================
323323

324324
/// The entry point into this system from the frontend:
@@ -517,20 +517,20 @@ class DependencyKey {
517517
// Name conversion helpers
518518
static std::string demangleTypeAsContext(StringRef);
519519
};
520-
} // namespace experimental_dependencies
520+
} // namespace fine_grained_dependencies
521521
} // namespace swift
522522

523523
template <>
524-
struct std::hash<typename swift::experimental_dependencies::DependencyKey> {
524+
struct std::hash<typename swift::fine_grained_dependencies::DependencyKey> {
525525
size_t
526-
operator()(const swift::experimental_dependencies::DependencyKey &key) const {
526+
operator()(const swift::fine_grained_dependencies::DependencyKey &key) const {
527527
return key.hash();
528528
}
529529
};
530530
template <>
531-
struct std::hash<typename swift::experimental_dependencies::DeclAspect> {
531+
struct std::hash<typename swift::fine_grained_dependencies::DeclAspect> {
532532
size_t
533-
operator()(const swift::experimental_dependencies::DeclAspect aspect) const {
533+
operator()(const swift::fine_grained_dependencies::DeclAspect aspect) const {
534534
return size_t(aspect);
535535
}
536536
};
@@ -559,7 +559,7 @@ struct std::hash<typename swift::experimental_dependencies::DeclAspect> {
559559
/// improving it.
560560

561561
namespace swift {
562-
namespace experimental_dependencies {
562+
namespace fine_grained_dependencies {
563563
class DepGraphNode {
564564
/// Def->use arcs go by DependencyKey. There may be >1 node for a given key.
565565
DependencyKey key;
@@ -705,7 +705,7 @@ class SourceFileDepGraphNode : public DepGraphNode {
705705
//==============================================================================
706706

707707
/// The dependency graph produced by the frontend and consumed by the driver.
708-
/// See \ref Node in ExperimentalDependencies.h
708+
/// See \ref Node in FineGrainedDependencies.h
709709
class SourceFileDepGraph {
710710
/// Every node in the graph. Indices used for serialization.
711711
/// Use addNode instead of adding directly.
@@ -936,7 +936,7 @@ template <typename GraphT> class DotFileEmitter {
936936
}
937937
};
938938

939-
} // end namespace experimental_dependencies
939+
} // end namespace fine_grained_dependencies
940940
} // end namespace swift
941941

942942
//==============================================================================
@@ -948,32 +948,32 @@ template <typename GraphT> class DotFileEmitter {
948948
#if !(defined(__linux__) || defined(_WIN64))
949949
LLVM_YAML_DECLARE_SCALAR_TRAITS(size_t, QuotingType::None)
950950
#endif
951-
LLVM_YAML_DECLARE_ENUM_TRAITS(swift::experimental_dependencies::NodeKind)
952-
LLVM_YAML_DECLARE_ENUM_TRAITS(swift::experimental_dependencies::DeclAspect)
951+
LLVM_YAML_DECLARE_ENUM_TRAITS(swift::fine_grained_dependencies::NodeKind)
952+
LLVM_YAML_DECLARE_ENUM_TRAITS(swift::fine_grained_dependencies::DeclAspect)
953953
LLVM_YAML_DECLARE_MAPPING_TRAITS(
954-
swift::experimental_dependencies::DependencyKey)
955-
LLVM_YAML_DECLARE_MAPPING_TRAITS(swift::experimental_dependencies::DepGraphNode)
954+
swift::fine_grained_dependencies::DependencyKey)
955+
LLVM_YAML_DECLARE_MAPPING_TRAITS(swift::fine_grained_dependencies::DepGraphNode)
956956

957957
namespace llvm {
958958
namespace yaml {
959959
template <>
960960
struct MappingContextTraits<
961-
swift::experimental_dependencies::SourceFileDepGraphNode,
962-
swift::experimental_dependencies::SourceFileDepGraph> {
961+
swift::fine_grained_dependencies::SourceFileDepGraphNode,
962+
swift::fine_grained_dependencies::SourceFileDepGraph> {
963963
using SourceFileDepGraphNode =
964-
swift::experimental_dependencies::SourceFileDepGraphNode;
964+
swift::fine_grained_dependencies::SourceFileDepGraphNode;
965965
using SourceFileDepGraph =
966-
swift::experimental_dependencies::SourceFileDepGraph;
966+
swift::fine_grained_dependencies::SourceFileDepGraph;
967967

968968
static void mapping(IO &io, SourceFileDepGraphNode &node,
969969
SourceFileDepGraph &g);
970970
};
971971

972972
template <>
973973
struct SequenceTraits<
974-
std::vector<swift::experimental_dependencies::SourceFileDepGraphNode *>> {
974+
std::vector<swift::fine_grained_dependencies::SourceFileDepGraphNode *>> {
975975
using SourceFileDepGraphNode =
976-
swift::experimental_dependencies::SourceFileDepGraphNode;
976+
swift::fine_grained_dependencies::SourceFileDepGraphNode;
977977
using NodeVec = std::vector<SourceFileDepGraphNode *>;
978978
static size_t size(IO &, NodeVec &vec);
979979
static SourceFileDepGraphNode &element(IO &, NodeVec &vec, size_t index);
@@ -983,6 +983,6 @@ struct SequenceTraits<
983983
} // namespace llvm
984984

985985
LLVM_YAML_DECLARE_MAPPING_TRAITS(
986-
swift::experimental_dependencies::SourceFileDepGraph)
986+
swift::fine_grained_dependencies::SourceFileDepGraph)
987987

988-
#endif // SWIFT_AST_EXPERIMENTAL_DEPENDENCIES_H
988+
#endif // SWIFT_AST_FINE_GRAINED_DEPENDENCIES_H

include/swift/Basic/LangOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ namespace swift {
280280

281281
/// Scaffolding to permit experimentation with finer-grained dependencies
282282
/// and faster rebuilds.
283-
bool EnableExperimentalDependencies = false;
283+
bool EnableFineGrainedDependencies = false;
284284

285285
/// To mimic existing system, set to false.
286286
/// To experiment with including file-private and private dependency info,
287287
/// set to true.
288-
bool ExperimentalDependenciesIncludeIntrafileOnes = false;
288+
bool FineGrainedDependenciesIncludeIntrafileOnes = false;
289289

290290
/// Whether to enable experimental differentiable programming features:
291291
/// `@differentiable` declaration attribute, etc.

include/swift/Driver/Compilation.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -259,17 +259,17 @@ class Compilation {
259259

260260
/// Scaffolding to permit experimentation with finer-grained dependencies and
261261
/// faster rebuilds.
262-
const bool EnableExperimentalDependencies;
262+
const bool EnableFineGrainedDependencies;
263263

264264
/// Helpful for debugging, but slows down the driver. So, only turn on when
265265
/// needed.
266-
const bool VerifyExperimentalDependencyGraphAfterEveryImport;
266+
const bool VerifyFineGrainedDependencyGraphAfterEveryImport;
267267
/// Helpful for debugging, but slows down the driver. So, only turn on when
268268
/// needed.
269-
const bool EmitExperimentalDependencyDotFileAfterEveryImport;
269+
const bool EmitFineGrainedDependencyDotFileAfterEveryImport;
270270

271271
/// Experiment with inter-file dependencies
272-
const bool ExperimentalDependenciesIncludeIntrafileOnes;
272+
const bool FineGrainedDependenciesIncludeIntrafileOnes;
273273

274274
/// Experiment with source-range-based dependencies
275275
const bool EnableSourceRangeDependencies;
@@ -309,10 +309,10 @@ class Compilation {
309309
bool SaveTemps = false,
310310
bool ShowDriverTimeCompilation = false,
311311
std::unique_ptr<UnifiedStatsReporter> Stats = nullptr,
312-
bool EnableExperimentalDependencies = false,
313-
bool VerifyExperimentalDependencyGraphAfterEveryImport = false,
314-
bool EmitExperimentalDependencyDotFileAfterEveryImport = false,
315-
bool ExperimentalDependenciesIncludeIntrafileOnes = false,
312+
bool EnableFineGrainedDependencies = false,
313+
bool VerifyFineGrainedDependencyGraphAfterEveryImport = false,
314+
bool EmitFineGrainedDependencyDotFileAfterEveryImport = false,
315+
bool FineGrainedDependenciesIncludeIntrafileOnes = false,
316316
bool EnableSourceRangeDependencies = false,
317317
bool CompareIncrementalSchemes = false,
318318
StringRef CompareIncrementalSchemesPath = "");
@@ -374,20 +374,20 @@ class Compilation {
374374
}
375375
void disableIncrementalBuild(Twine why);
376376

377-
bool getEnableExperimentalDependencies() const {
378-
return EnableExperimentalDependencies;
377+
bool getEnableFineGrainedDependencies() const {
378+
return EnableFineGrainedDependencies;
379379
}
380380

381-
bool getVerifyExperimentalDependencyGraphAfterEveryImport() const {
382-
return VerifyExperimentalDependencyGraphAfterEveryImport;
381+
bool getVerifyFineGrainedDependencyGraphAfterEveryImport() const {
382+
return VerifyFineGrainedDependencyGraphAfterEveryImport;
383383
}
384384

385-
bool getEmitExperimentalDependencyDotFileAfterEveryImport() const {
386-
return EmitExperimentalDependencyDotFileAfterEveryImport;
385+
bool getEmitFineGrainedDependencyDotFileAfterEveryImport() const {
386+
return EmitFineGrainedDependencyDotFileAfterEveryImport;
387387
}
388388

389-
bool getExperimentalDependenciesIncludeIntrafileOnes() const {
390-
return ExperimentalDependenciesIncludeIntrafileOnes;
389+
bool getFineGrainedDependenciesIncludeIntrafileOnes() const {
390+
return FineGrainedDependenciesIncludeIntrafileOnes;
391391
}
392392

393393
bool getEnableSourceRangeDependencies() const {

include/swift/Driver/DependencyGraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class DependencyGraph : public DependencyGraphImpl {
238238
/// If \p node has already been marked, only its outgoing edges are updated.
239239
/// The third argument is ignored here, but must be present so that the same
240240
/// call site can polymorphically call \ref
241-
/// experimental_dependencies::ModuleDepGraph::loadFromPath
241+
/// fine_grained_dependencies::ModuleDepGraph::loadFromPath
242242
LoadResult loadFromPath(T node, StringRef path, DiagnosticEngine &) {
243243
return DependencyGraphImpl::loadFromPath(Traits::getAsVoidPointer(node),
244244
path);

include/swift/Driver/ExperimentalDependencyDriverGraph.h renamed to include/swift/Driver/FineGrainedDependencyDriverGraph.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- ExperimentalDependencyModuleDepGraph.h ------------------*- C++-*-===//
1+
//===---- FineGrainedDependencyModuleDepGraph.h ------------------*- C++-*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -10,10 +10,10 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef ExperimentalDependencyGraph_h
14-
#define ExperimentalDependencyGraph_h
13+
#ifndef SWIFT_DRIVER_FINE_GRAINED_DEPENDENCY_DRIVER_GRAPH_H
14+
#define SWIFT_DRIVER_FINE_GRAINED_DEPENDENCY_DRIVER_GRAPH_H
1515

16-
#include "swift/AST/ExperimentalDependencies.h"
16+
#include "swift/AST/FineGrainedDependencies.h"
1717
#include "swift/Basic/Debug.h"
1818
#include "swift/Basic/LLVM.h"
1919
#include "swift/Basic/OptionSet.h"
@@ -34,11 +34,11 @@
3434
#include <unordered_set>
3535
#include <vector>
3636

37-
// Declarations for the portion experimental dependency system used by the
37+
// Declarations for the portion fine-grained dependency system used by the
3838
// driver.
3939

4040
namespace swift {
41-
namespace experimental_dependencies {
41+
namespace fine_grained_dependencies {
4242

4343
//==============================================================================
4444
// MARK: ModuleDepGraphNode
@@ -117,7 +117,7 @@ class DependencyGraphImpl {
117117
// MARK: ModuleDepGraph
118118
//==============================================================================
119119

120-
/// See \ref Node in ExperimentalDependencies.h
120+
/// See \ref Node in FineGrainedDependencies.h
121121
class ModuleDepGraph {
122122

123123
/// Find nodes, first by the swiftDeps file, then by key.
@@ -186,8 +186,8 @@ class ModuleDepGraph {
186186
/// files for the same name distinct, keep a sequence number for each name.
187187
std::unordered_map<std::string, unsigned> dotFileSequenceNumber;
188188

189-
const bool verifyExperimentalDependencyGraphAfterEveryImport;
190-
const bool emitExperimentalDependencyDotFileAfterEveryImport;
189+
const bool verifyFineGrainedDependencyGraphAfterEveryImport;
190+
const bool emitFineGrainedDependencyDotFileAfterEveryImport;
191191

192192
/// If tracing dependencies, holds the current node traversal path
193193
Optional<std::vector<const ModuleDepGraphNode *>> currentPathIfTracing;
@@ -250,14 +250,14 @@ class ModuleDepGraph {
250250
using NodeType = ModuleDepGraphNode;
251251

252252
/// \p stats may be null
253-
ModuleDepGraph(const bool verifyExperimentalDependencyGraphAfterEveryImport,
254-
const bool emitExperimentalDependencyDotFileAfterEveryImport,
253+
ModuleDepGraph(const bool verifyFineGrainedDependencyGraphAfterEveryImport,
254+
const bool emitFineGrainedDependencyDotFileAfterEveryImport,
255255
const bool shouldTraceDependencies,
256256
UnifiedStatsReporter *stats)
257-
: verifyExperimentalDependencyGraphAfterEveryImport(
258-
verifyExperimentalDependencyGraphAfterEveryImport),
259-
emitExperimentalDependencyDotFileAfterEveryImport(
260-
emitExperimentalDependencyDotFileAfterEveryImport),
257+
: verifyFineGrainedDependencyGraphAfterEveryImport(
258+
verifyFineGrainedDependencyGraphAfterEveryImport),
259+
emitFineGrainedDependencyDotFileAfterEveryImport(
260+
emitFineGrainedDependencyDotFileAfterEveryImport),
261261
currentPathIfTracing(
262262
shouldTraceDependencies
263263
? llvm::Optional<std::vector<const ModuleDepGraphNode *>>(
@@ -473,7 +473,7 @@ class ModuleDepGraph {
473473
return !currentPathIfTracing.hasValue() || currentPathIfTracing->empty();
474474
}
475475
};
476-
} // namespace experimental_dependencies
476+
} // namespace fine_grained_dependencies
477477
} // namespace swift
478478

479-
#endif // ExperimentalDependencyGraph_h
479+
#endif // SWIFT_DRIVER_FINE_GRAINED_DEPENDENCY_DRIVER_GRAPH_H

include/swift/Option/Options.td

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ def driver_always_rebuild_dependents :
135135
Flag<["-"], "driver-always-rebuild-dependents">, InternalDebugOpt,
136136
HelpText<"Always rebuild dependents of files that have been modified">;
137137

138-
def enable_experimental_dependencies :
139-
Flag<["-"], "enable-experimental-dependencies">, Flags<[FrontendOption, HelpHidden]>,
138+
def enable_fine_grained_dependencies :
139+
Flag<["-"], "enable-fine-grained-dependencies">, Flags<[FrontendOption, HelpHidden]>,
140140
HelpText<"Experimental work-in-progress to be more selective about incremental recompilation">;
141141

142142
def enable_source_range_dependencies :
@@ -158,18 +158,18 @@ Joined<["-"], "driver-compare-incremental-schemes-path=">, Flags<[]>,
158158
Alias<driver_compare_incremental_schemes_path>;
159159

160160

161-
def driver_verify_experimental_dependency_graph_after_every_import :
162-
Flag<["-"], "driver-verify-experimental-dependency-graph-after-every-import">,
161+
def driver_verify_fine_grained_dependency_graph_after_every_import :
162+
Flag<["-"], "driver-verify-fine-grained-dependency-graph-after-every-import">,
163163
InternalDebugOpt,
164164
HelpText<"Debug DriverGraph by verifying it after every import">;
165165

166-
def driver_emit_experimental_dependency_dot_file_after_every_import :
167-
Flag<["-"], "driver-emit-experimental-dependency-dot-file-after-every-import">,
166+
def driver_emit_fine_grained_dependency_dot_file_after_every_import :
167+
Flag<["-"], "driver-emit-fine-grained-dependency-dot-file-after-every-import">,
168168
InternalDebugOpt,
169-
HelpText<"Emit dot files every time driver imports an experimental swiftdeps file.">;
169+
HelpText<"Emit dot files every time driver imports an fine-grained swiftdeps file.">;
170170

171-
def experimental_dependency_include_intrafile :
172-
Flag<["-"], "experimental-dependency-include-intrafile">,
171+
def fine_grained_dependency_include_intrafile :
172+
Flag<["-"], "fine-grained-dependency-include-intrafile">,
173173
InternalDebugOpt,
174174
HelpText<"Include within-file dependencies.">;
175175

lib/AST/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ add_swift_host_library(swiftAST STATIC
4646
DiagnosticList.cpp
4747
DocComment.cpp
4848
Evaluator.cpp
49-
ExperimentalDependencies.cpp
50-
ExperimentalDependenciesSourceFileDepGraphConstructor.cpp
5149
Expr.cpp
50+
FineGrainedDependencies.cpp
51+
FineGrainedDependenciesSourceFileDepGraphConstructor.cpp
5252
GenericEnvironment.cpp
5353
GenericSignature.cpp
5454
GenericSignatureBuilder.cpp

0 commit comments

Comments
 (0)