Skip to content

[Incremental] Use the initial value of EnableFineGrainedDependencies as the default. #29390

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 1 commit into from
Jan 23, 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
1 change: 1 addition & 0 deletions include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ namespace swift {

/// Emit the newer, finer-grained swiftdeps file. Eventually will support
/// faster rebuilds.
/// The initializer here sets the default for the frontend and driver.
bool EnableFineGrainedDependencies = false;

/// When using fine-grained dependencies, emit dot files for every swiftdeps
Expand Down
4 changes: 3 additions & 1 deletion include/swift/Driver/Compilation.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "swift/Basic/ArrayRefView.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/LangOptions.h"
#include "swift/Basic/NullablePtr.h"
#include "swift/Basic/OutputFileMap.h"
#include "swift/Basic/Statistic.h"
Expand Down Expand Up @@ -327,7 +328,8 @@ class Compilation {
bool ShowDriverTimeCompilation = false,
std::unique_ptr<UnifiedStatsReporter> Stats = nullptr,
bool OnlyOneDependencyFile = false,
bool EnableFineGrainedDependencies = false,
bool EnableFineGrainedDependencies =
LangOptions().EnableFineGrainedDependencies,
bool VerifyFineGrainedDependencyGraphAfterEveryImport = false,
bool EmitFineGrainedDependencyDotFileAfterEveryImport = false,
bool FineGrainedDependenciesIncludeIntrafileOnes = false,
Expand Down
5 changes: 4 additions & 1 deletion lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "swift/AST/DiagnosticsDriver.h"
#include "swift/AST/DiagnosticsFrontend.h"
#include "swift/Basic/LLVM.h"
#include "swift/Basic/LangOptions.h"
#include "swift/Basic/OutputFileMap.h"
#include "swift/Basic/Platform.h"
#include "swift/Basic/Range.h"
Expand Down Expand Up @@ -964,9 +965,11 @@ Driver::buildCompilation(const ToolChain &TC,
options::OPT_disable_only_one_dependency_file, true);

// relies on the new dependency graph
// Get the default from the initializer in LangOptions.
const bool EnableFineGrainedDependencies =
ArgList->hasFlag(options::OPT_enable_fine_grained_dependencies,
options::OPT_disable_fine_grained_dependencies, false);
options::OPT_disable_fine_grained_dependencies,
LangOptions().EnableFineGrainedDependencies);

const bool VerifyFineGrainedDependencyGraphAfterEveryImport = ArgList->hasArg(
options::
Expand Down
3 changes: 2 additions & 1 deletion lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,

Opts.EnableFineGrainedDependencies =
Args.hasFlag(options::OPT_enable_fine_grained_dependencies,
options::OPT_disable_fine_grained_dependencies, false);
options::OPT_disable_fine_grained_dependencies,
Opts.EnableFineGrainedDependencies);

if (Args.hasArg(OPT_emit_fine_grained_dependency_sourcefile_dot_files))
Opts.EmitFineGrainedDependencySourcefileDotFiles = true;
Expand Down