-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Driver] A Pile of Nits #34991
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
[Driver] A Pile of Nits #34991
Conversation
Not doing so causes the IDE and terminals to interleave the output of the dump.
This class was relying on the caller to keep this member alive. In general, this will lead to startling memory ownership bugs if, say, the enumerators were returned from these functions. Pass it in as a parameter instead to formalize that contract.
So the compiler has a chance to see the definition for itself, rather than having to. manually force a specialization.
@swift-ci smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! Might be nice to comment that one function ref parameter, but it's not strictly necessary. Something like: "Will be passed down to all callees in order to record the uses", maybe. Nice cleanups.
findJobsToRecompileWhenNodesChange(const Nodes &nodes) { | ||
std::vector<ModuleDepGraphNode *> foundDependents; | ||
for (ModuleDepGraphNode *n : nodes) | ||
findPreviouslyUntracedDependents(foundDependents, n); | ||
return jobsContaining(foundDependents); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you were able to remove some template foo by moving the code to here. Is that right? If so, great!
os << "fingerprint: " << fingerprint.getValue() << ""; | ||
else | ||
llvm::errs() << "no fingerprint"; | ||
os << "no fingerprint"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
UsedDeclEnumerator(const SourceFile *SF, const DependencyTracker &depTracker, | ||
StringRef swiftDeps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the advantage in passing the function ref down recursively vs storing it in the instance?
Since you did it, I bet there is a good reason. Would be nice to have a comment, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llvm::function_ref
is non-owning. It makes me nervous to see it stored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'Oh! Thank you for fixing this!
@@ -406,26 +406,19 @@ class UsedDeclEnumerator { | |||
StringRef swiftDeps; | |||
|
|||
/// Cache these for efficiency | |||
const DependencyKey sourceFileInterface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see... looks like this wasn't even used. Is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup.
return reloadAndRemarkFineGrainedDepsOnNormalExit( | ||
FinishedCmd, cmdFailed, forRanges, DependenciesFile); | ||
} | ||
|
||
std::vector<const Job *> reloadAndRemarkFineGrainedDepsOnNormalExit( | ||
const Job *FinishedCmd, const bool cmdFailed, const bool forRanges, | ||
StringRef DependenciesFile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL!
@swift-ci test |
⛵ |
llvm::function_ref
is non-owning.