Skip to content

Commit 964f640

Browse files
committed
Drop "Private Deps" Flag
In order for type body fingerprints to work, these declarations must always be included. Drop the ability to turn this off.
1 parent 74765a8 commit 964f640

19 files changed

+50
-215
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
@@ -948,9 +948,6 @@ class alignas(1 << DeclAlignInBits) Decl {
948948
/// If this returns true, the decl can be safely casted to ValueDecl.
949949
bool isPotentiallyOverridable() const;
950950

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

include/swift/Basic/LangOptions.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,6 @@ namespace swift {
334334
/// file.
335335
bool EmitFineGrainedDependencySourcefileDotFiles = false;
336336

337-
/// To mimic existing system, set to false.
338-
/// To experiment with including file-private and private dependency info,
339-
/// set to true.
340-
bool FineGrainedDependenciesIncludeIntrafileOnes = false;
341-
342337
/// Whether to enable experimental differentiable programming features:
343338
/// `@differentiable` declaration attribute, etc.
344339
bool EnableExperimentalDifferentiableProgramming = false;

include/swift/Driver/Compilation.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,6 @@ class Compilation {
272272
/// needed.
273273
const bool EmitFineGrainedDependencyDotFileAfterEveryImport;
274274

275-
/// Experiment with intrafile dependencies
276-
const bool FineGrainedDependenciesIncludeIntrafileOnes;
277-
278275
/// Experiment with source-range-based dependencies
279276
const bool EnableSourceRangeDependencies;
280277

@@ -318,7 +315,6 @@ class Compilation {
318315
bool OnlyOneDependencyFile = false,
319316
bool VerifyFineGrainedDependencyGraphAfterEveryImport = false,
320317
bool EmitFineGrainedDependencyDotFileAfterEveryImport = false,
321-
bool FineGrainedDependenciesIncludeIntrafileOnes = false,
322318
bool EnableSourceRangeDependencies = false,
323319
bool CompareIncrementalSchemes = false,
324320
StringRef CompareIncrementalSchemesPath = "",
@@ -389,10 +385,6 @@ class Compilation {
389385
return EmitFineGrainedDependencyDotFileAfterEveryImport;
390386
}
391387

392-
bool getFineGrainedDependenciesIncludeIntrafileOnes() const {
393-
return FineGrainedDependenciesIncludeIntrafileOnes;
394-
}
395-
396388
bool getEnableSourceRangeDependencies() const {
397389
return EnableSourceRangeDependencies;
398390
}

include/swift/Option/Options.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,6 @@ Flag<["-"], "driver-emit-fine-grained-dependency-dot-file-after-every-import">,
182182
InternalDebugOpt,
183183
HelpText<"Emit dot files every time driver imports an fine-grained swiftdeps file.">;
184184

185-
def fine_grained_dependency_include_intrafile :
186-
Flag<["-"], "fine-grained-dependency-include-intrafile">,
187-
Flags<[FrontendOption, HelpHidden]>,
188-
HelpText<"Include within-file dependencies.">;
189-
190185
def emit_fine_grained_dependency_sourcefile_dot_files :
191186
Flag<["-"], "emit-fine-grained-dependency-sourcefile-dot-files">,
192187
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
@@ -8098,26 +8098,3 @@ void swift::simple_display(llvm::raw_ostream &out, AnyFunctionRef fn) {
80988098
else
80998099
out << "closure";
81008100
}
8101-
8102-
bool Decl::isPrivateToEnclosingFile() const {
8103-
if (auto *VD = dyn_cast<ValueDecl>(this))
8104-
return VD->getFormalAccess() <= AccessLevel::FilePrivate;
8105-
switch (getKind()) {
8106-
case DeclKind::Import:
8107-
case DeclKind::PatternBinding:
8108-
case DeclKind::EnumCase:
8109-
case DeclKind::TopLevelCode:
8110-
case DeclKind::IfConfig:
8111-
case DeclKind::PoundDiagnostic:
8112-
return true;
8113-
8114-
case DeclKind::Extension:
8115-
case DeclKind::InfixOperator:
8116-
case DeclKind::PrefixOperator:
8117-
case DeclKind::PostfixOperator:
8118-
return false;
8119-
8120-
default:
8121-
llvm_unreachable("everything else is a ValueDecl");
8122-
}
8123-
}

0 commit comments

Comments
 (0)