Skip to content

ValueFlow: extracted valueFlowSymbolicOperators() into separate file #6845

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
Oct 15, 2024

Conversation

firewave
Copy link
Collaborator

No description provided.

@@ -437,4 +440,32 @@ namespace ValueFlow
scope = scope->nestedIn;
return scope;
}

Value inferCondition(const std::string& op, const Token* varTok, MathLib::bigint val)

This comment was marked as resolved.

@@ -388,3 +387,35 @@ std::vector<MathLib::bigint> getMaxValue(const ValuePtr<InferModel>& model, cons
return model->match(v);
}).maxvalue;
}

namespace {
struct IntegralInferModel : InferModel {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the SymbolicInferModel should be moved here as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense. Will do in a follow-up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It makes sense to put them all in one place. But keeping them in the only place that uses them might also make sense. The compiler would also be able to see all the code...not 100% on what to do here.

There is also IteratorInferModel and related classes in vf_infercondition.cpp.

@firewave
Copy link
Collaborator Author

No further comments for two weeks - merging.

@firewave firewave merged commit 66d53a2 into danmar:main Oct 15, 2024
63 checks passed
@firewave firewave deleted the vf-symbolicop branch October 15, 2024 18:40
ludviggunne pushed a commit to ludviggunne/cppcheck that referenced this pull request Oct 19, 2024
pfultz2 added a commit to pfultz2/cppcheck that referenced this pull request Nov 5, 2024
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