Skip to content

Commit 92cb680

Browse files
authored
Merge pull request swiftlang#34151 from CodaFi/body-paint
Remove Type Body Fingerprints Flags
2 parents 4e7714b + 964f640 commit 92cb680

File tree

60 files changed

+631
-2233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+631
-2233
lines changed

include/swift/AST/AbstractSourceFileDepGraphFactory.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ namespace fine_grained_dependencies {
2424
/// \c SourceFile or a unit test
2525
class AbstractSourceFileDepGraphFactory {
2626
protected:
27-
/// To match the existing system, set this to false.
28-
/// To include even private entities and get intra-file info, set to true.
29-
const bool includePrivateDeps;
30-
3127
/// If there was an error, cannot get accurate info.
3228
const bool hadCompilationError;
3329

@@ -48,8 +44,7 @@ class AbstractSourceFileDepGraphFactory {
4844
public:
4945
/// Expose this layer to enable faking up a constructor for testing.
5046
/// See the instance variable comments for explanation.
51-
AbstractSourceFileDepGraphFactory(bool includePrivateDeps,
52-
bool hadCompilationError,
47+
AbstractSourceFileDepGraphFactory(bool hadCompilationError,
5348
StringRef swiftDeps,
5449
StringRef fileFingerprint,
5550
bool emitDotFileAfterConstruction,

include/swift/AST/Decl.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,9 +950,6 @@ class alignas(1 << DeclAlignInBits) Decl {
950950
/// If this returns true, the decl can be safely casted to ValueDecl.
951951
bool isPotentiallyOverridable() const;
952952

953-
/// Returns true if this Decl cannot be seen by any other source file
954-
bool isPrivateToEnclosingFile() const;
955-
956953
/// If an alternative module name is specified for this decl, e.g. using
957954
/// @_originalDefinedIn attribute, this function returns this module name.
958955
StringRef getAlternateModuleName() const;

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -330,21 +330,10 @@ namespace swift {
330330
/// of active clauses aren't hoisted into the enclosing scope.
331331
bool DisablePoundIfEvaluation = false;
332332

333-
/// Instead of hashing tokens inside of NominalType and ExtensionBodies into
334-
/// the interface hash, hash them into per-iterable-decl-context
335-
/// fingerprints. Fine-grained dependency types won't dirty every provides
336-
/// in a file when the user adds a member to, e.g., a struct.
337-
bool EnableTypeFingerprints = true;
338-
339333
/// When using fine-grained dependencies, emit dot files for every swiftdeps
340334
/// file.
341335
bool EmitFineGrainedDependencySourcefileDotFiles = false;
342336

343-
/// To mimic existing system, set to false.
344-
/// To experiment with including file-private and private dependency info,
345-
/// set to true.
346-
bool FineGrainedDependenciesIncludeIntrafileOnes = false;
347-
348337
/// Whether to enable experimental differentiable programming features:
349338
/// `@differentiable` declaration attribute, etc.
350339
bool EnableExperimentalDifferentiableProgramming = false;

include/swift/Driver/Compilation.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -265,19 +265,13 @@ class Compilation {
265265
const bool OnlyOneDependencyFile;
266266

267267
private:
268-
/// Is the parser recording token hashes for each type body?
269-
const bool EnableTypeFingerprints;
270-
271268
/// Helpful for debugging, but slows down the driver. So, only turn on when
272269
/// needed.
273270
const bool VerifyFineGrainedDependencyGraphAfterEveryImport;
274271
/// Helpful for debugging, but slows down the driver. So, only turn on when
275272
/// needed.
276273
const bool EmitFineGrainedDependencyDotFileAfterEveryImport;
277274

278-
/// Experiment with intrafile dependencies
279-
const bool FineGrainedDependenciesIncludeIntrafileOnes;
280-
281275
/// Experiment with source-range-based dependencies
282276
const bool EnableSourceRangeDependencies;
283277

@@ -319,11 +313,8 @@ class Compilation {
319313
bool ShowDriverTimeCompilation = false,
320314
std::unique_ptr<UnifiedStatsReporter> Stats = nullptr,
321315
bool OnlyOneDependencyFile = false,
322-
bool EnableTypeFingerprints =
323-
LangOptions().EnableTypeFingerprints,
324316
bool VerifyFineGrainedDependencyGraphAfterEveryImport = false,
325317
bool EmitFineGrainedDependencyDotFileAfterEveryImport = false,
326-
bool FineGrainedDependenciesIncludeIntrafileOnes = false,
327318
bool EnableSourceRangeDependencies = false,
328319
bool CompareIncrementalSchemes = false,
329320
StringRef CompareIncrementalSchemesPath = "",
@@ -386,8 +377,6 @@ class Compilation {
386377
}
387378
void disableIncrementalBuild(Twine why);
388379

389-
bool getEnableTypeFingerprints() const { return EnableTypeFingerprints; }
390-
391380
bool getVerifyFineGrainedDependencyGraphAfterEveryImport() const {
392381
return VerifyFineGrainedDependencyGraphAfterEveryImport;
393382
}
@@ -396,10 +385,6 @@ class Compilation {
396385
return EmitFineGrainedDependencyDotFileAfterEveryImport;
397386
}
398387

399-
bool getFineGrainedDependenciesIncludeIntrafileOnes() const {
400-
return FineGrainedDependenciesIncludeIntrafileOnes;
401-
}
402-
403388
bool getEnableSourceRangeDependencies() const {
404389
return EnableSourceRangeDependencies;
405390
}

include/swift/Driver/FineGrainedDependencyDriverGraph.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ class ModuleDepGraph {
189189
const bool verifyFineGrainedDependencyGraphAfterEveryImport;
190190
const bool emitFineGrainedDependencyDotFileAfterEveryImport;
191191

192-
const bool EnableTypeFingerprints;
193-
194192
private:
195193
/// If tracing dependencies, holds a vector used to hold the current path
196194
/// def - use/def - use/def - ...
@@ -296,14 +294,12 @@ class ModuleDepGraph {
296294
/// \p stats may be null
297295
ModuleDepGraph(const bool verifyFineGrainedDependencyGraphAfterEveryImport,
298296
const bool emitFineGrainedDependencyDotFileAfterEveryImport,
299-
const bool EnableTypeFingerprints,
300297
const bool shouldTraceDependencies,
301298
UnifiedStatsReporter *stats)
302299
: verifyFineGrainedDependencyGraphAfterEveryImport(
303300
verifyFineGrainedDependencyGraphAfterEveryImport),
304301
emitFineGrainedDependencyDotFileAfterEveryImport(
305302
emitFineGrainedDependencyDotFileAfterEveryImport),
306-
EnableTypeFingerprints(EnableTypeFingerprints),
307303
currentPathIfTracing(
308304
shouldTraceDependencies
309305
? llvm::Optional<std::vector<const ModuleDepGraphNode *>>(
@@ -314,11 +310,10 @@ class ModuleDepGraph {
314310
}
315311

316312
/// For unit tests.
317-
ModuleDepGraph(const bool EnableTypeFingerprints,
318-
const bool EmitDotFilesForDebugging = false)
313+
ModuleDepGraph(const bool EmitDotFilesForDebugging = false)
319314
: ModuleDepGraph(
320315
true, /*emitFineGrainedDependencyDotFileAfterEveryImport=*/
321-
EmitDotFilesForDebugging, EnableTypeFingerprints, false, nullptr) {}
316+
EmitDotFilesForDebugging, false, nullptr) {}
322317

323318
//============================================================================
324319
// MARK: ModuleDepGraph - updating from a switdeps file

include/swift/Option/Options.td

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,6 @@ def driver_always_rebuild_dependents :
139139
Flag<["-"], "driver-always-rebuild-dependents">, InternalDebugOpt,
140140
HelpText<"Always rebuild dependents of files that have been modified">;
141141

142-
def enable_type_fingerprints :
143-
Flag<["-"], "enable-type-fingerprints">, Flags<[FrontendOption, HelpHidden]>,
144-
HelpText<"Enable per-nominal and extension body fingerprints">;
145-
146-
def disable_type_fingerprints :
147-
Flag<["-"], "disable-type-fingerprints">, Flags<[FrontendOption, HelpHidden]>,
148-
HelpText<"Disable per-nominal and extension body fingerprints">;
149-
150142
def enable_only_one_dependency_file :
151143
Flag<["-"], "enable-only-one-dependency-file">, Flags<[DoesNotAffectIncrementalBuild]>,
152144
HelpText<"Enables incremental build optimization that only produces one dependencies file">;
@@ -190,11 +182,6 @@ Flag<["-"], "driver-emit-fine-grained-dependency-dot-file-after-every-import">,
190182
InternalDebugOpt,
191183
HelpText<"Emit dot files every time driver imports an fine-grained swiftdeps file.">;
192184

193-
def fine_grained_dependency_include_intrafile :
194-
Flag<["-"], "fine-grained-dependency-include-intrafile">,
195-
Flags<[FrontendOption, HelpHidden]>,
196-
HelpText<"Include within-file dependencies.">;
197-
198185
def emit_fine_grained_dependency_sourcefile_dot_files :
199186
Flag<["-"], "emit-fine-grained-dependency-sourcefile-dot-files">,
200187
Flags<[FrontendOption, HelpHidden]>,

lib/AST/AbstractSourceFileDepGraphFactory.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ using namespace fine_grained_dependencies;
3333
//==============================================================================
3434

3535
AbstractSourceFileDepGraphFactory::AbstractSourceFileDepGraphFactory(
36-
bool includePrivateDeps, bool hadCompilationError, StringRef swiftDeps,
36+
bool hadCompilationError, StringRef swiftDeps,
3737
StringRef fileFingerprint, bool emitDotFileAfterConstruction,
3838
DiagnosticEngine &diags)
39-
: includePrivateDeps(includePrivateDeps),
40-
hadCompilationError(hadCompilationError), swiftDeps(swiftDeps.str()),
39+
: hadCompilationError(hadCompilationError), swiftDeps(swiftDeps.str()),
4140
fileFingerprint(fileFingerprint.str()),
4241
emitDotFileAfterConstruction(emitDotFileAfterConstruction), diags(diags) {
4342
}

lib/AST/Decl.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8038,26 +8038,3 @@ void swift::simple_display(llvm::raw_ostream &out, AnyFunctionRef fn) {
80388038
else
80398039
out << "closure";
80408040
}
8041-
8042-
bool Decl::isPrivateToEnclosingFile() const {
8043-
if (auto *VD = dyn_cast<ValueDecl>(this))
8044-
return VD->getFormalAccess() <= AccessLevel::FilePrivate;
8045-
switch (getKind()) {
8046-
case DeclKind::Import:
8047-
case DeclKind::PatternBinding:
8048-
case DeclKind::EnumCase:
8049-
case DeclKind::TopLevelCode:
8050-
case DeclKind::IfConfig:
8051-
case DeclKind::PoundDiagnostic:
8052-
return true;
8053-
8054-
case DeclKind::Extension:
8055-
case DeclKind::InfixOperator:
8056-
case DeclKind::PrefixOperator:
8057-
case DeclKind::PostfixOperator:
8058-
return false;
8059-
8060-
default:
8061-
llvm_unreachable("everything else is a ValueDecl");
8062-
}
8063-
}

lib/AST/DeclContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ bool IterableDeclContext::areTokensHashedForThisBodyInsteadOfInterfaceHash()
933933
// corresponding to the fingerprinted nominal dependency node.
934934
if (isa<ExtensionDecl>(this))
935935
return false;
936-
return getASTContext().LangOpts.EnableTypeFingerprints;
936+
return true;
937937
}
938938

939939
/// Return the DeclContext to compare when checking private access in

0 commit comments

Comments
 (0)