Skip to content
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

"White" AST search: Add to Sub mutation #677

Merged
merged 3 commits into from
Mar 15, 2020
Merged

"White" AST search: Add to Sub mutation #677

merged 3 commits into from
Mar 15, 2020

Conversation

stanislaw
Copy link
Member

No description provided.

Copy link
Member

@AlexDenisov AlexDenisov left a comment

Choose a reason for hiding this comment

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

It would be nice if you can also reformat the code, it feels like in a couple of places something went wrong in this regard.

include/mull/AST/ASTSearchTask.h Outdated Show resolved Hide resolved
include/mull/AST/ASTSearchTask.h Outdated Show resolved Hide resolved
lib/AST/ASTFinder.cpp Outdated Show resolved Hide resolved
lib/AST/ASTMutationFilter.cpp Outdated Show resolved Hide resolved
lib/AST/ASTSearchTask.cpp Outdated Show resolved Hide resolved
lib/AST/ASTVisitor.cpp Outdated Show resolved Hide resolved
lib/AST/ASTVisitor.cpp Outdated Show resolved Hide resolved
tools/driver-cxx/CLIOptions.cpp Show resolved Hide resolved
}
bool compilationDatabaseInfoAvailable = bitcodeCompilationDatabaseAvailable ||
compilationDatabasePathAvailable ||
bitcodeCompilationFlagsAvailable;
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain the need for these three extra variables? It feels a bit too noisy and adds more mental overhead than needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only comment where I want to make an argument for actually doing this.

We can make the variables a little bit shorter but they actually make making of decisions below very clear:

We only enter the "Junk detection" decision only if compilationDatabaseInfoAvailable and we enter the "White search" decision if EnableASTSearch && compilationDatabaseInfoAvailable.

Otherwise I would have to introduce a variable called whiteSearchIsEnabled and put it where junkDetectionEnabled is set to true and we would have a duplication of both variables set to true to make their decisions.

This makes sense to me. For you?

Copy link
Member

Choose a reason for hiding this comment

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

It does make sense to me, though there is a small misunderstanding on either side.
What I meant is to basically rename junkDetectionEnabled into compilationDatabaseInfoAvailable and drop the unnecessary variables. Then the same logic would be preserved, right?

I'm not going to die on this hill, so if having three extra variables works better for you, then I don't have any objections :)

tools/driver-cxx/driver-cxx.cpp Show resolved Hide resolved
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