Skip to content

[Experimental Dependencies] Add -enable-experimental-dependencies and push it through. #20078

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 2 commits into from
Oct 30, 2018

Conversation

davidungar
Copy link
Contributor

Adds -enable-experimental-dependencies option and pushing it through to the places where it will be needed in the frontend and driver. Getting this in now will reduce future rebasing work.

@davidungar davidungar force-pushed the manual-rebasing-exp-deps branch 3 times, most recently from 0e83ce8 to 8b92a6b Compare October 26, 2018 23:46
@davidungar
Copy link
Contributor Author

@swift-ci please smoke test os x platform

@davidungar davidungar force-pushed the manual-rebasing-exp-deps branch from 8b92a6b to 1f4dfce Compare October 28, 2018 07:39
@davidungar
Copy link
Contributor Author

@swift-ci please smoke test os x platform


/// Scaffolding to permit experimentation with finer-grained dependencies and
/// faster rebuilds.
bool getEnableExperimentalDependencies() const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you expecting this to be a per-Decl or per-DeclContext setting? If not, please don't do this; just stick to the longer getASTContext().LangOpts. EnableExperimentalDependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, gone.

@@ -234,7 +238,8 @@ class Compilation {
Optional<unsigned> BatchSizeLimit = None,
bool SaveTemps = false,
bool ShowDriverTimeCompilation = false,
std::unique_ptr<UnifiedStatsReporter> Stats = nullptr);
std::unique_ptr<UnifiedStatsReporter> Stats = nullptr,
bool EnableExperimentalDependencies = false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting convinced we need a CompilationOptions struct, but that doesn't have to be part of this patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good points.

@@ -129,6 +129,10 @@ def driver_always_rebuild_dependents :
Flag<["-"], "driver-always-rebuild-dependents">, InternalDebugOpt,
HelpText<"Always rebuild dependents of files that have been modified">;

def enable_experimental_dependencies :
Flag<["-"], "enable-experimental-dependencies">, Flags<[FrontendOption, HelpHidden]>,
HelpText<"When interface changes, be more selective">;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I don't understand this help text.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit terse, but I'm not sure exactly what would be needed to make it understandable--I'm too close. Could you suggest something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's context in what the "interface" is, but even knowing that this means "a file's semantic and binary interface as presented to the rest of the module", it doesn't say what the compiler is going to be more selective about.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed a fix. Hope it's better.

return DependencyGraphImpl::loadFromPath(Traits::getAsVoidPointer(node),
path);
LoadResult loadFromPath(T node, StringRef path,
const bool EnableExperimentalDependencies) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you even going to use the same dependency graph structure? It might be better to not bother with this flag at all.

(Then again, you can always take it back out.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right! Taking it out.

@davidungar davidungar force-pushed the manual-rebasing-exp-deps branch from 19cd39b to 19caf59 Compare October 29, 2018 17:28
Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; this is now pretty minimal.

@@ -288,6 +288,10 @@ namespace swift {
/// Whether to verify the parsed syntax tree and emit related diagnostics.
bool VerifySyntaxTree = false;

/// Scaffolding to permit experimentation with finer-grained dependencies
/// and faster rebuilds.
bool EnableExperimentalDependencies = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option is to put this on a SourceFile's ReferencedNameTracker. I'm not sure if that's better since it means putting this flag in FrontendOptions just to pass it through, but it might be easier for whatever implementation you end up with to have the flag right there. Since that's inside the frontend, though, you can always change it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thought, will keep it in mind.

@davidungar
Copy link
Contributor Author

@swift-ci please smoke test and merge

@davidungar
Copy link
Contributor Author

@jrose-apple Thanks for the review. It helps to keep the quality and consistency up.

@davidungar
Copy link
Contributor Author

@swift-ci please smoke test

@davidungar
Copy link
Contributor Author

@swift-ci please smoke test os x platform

@davidungar
Copy link
Contributor Author

@swift-ci please smoke test linux platform

@davidungar davidungar merged commit 0c2c756 into swiftlang:master Oct 30, 2018
@davidungar davidungar deleted the manual-rebasing-exp-deps branch June 14, 2019 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants