ValueFlow: start splitting it into multiple files
valueflow.cpp is very monolithic which makes it hard to manage. This is splitting several parts into separate files as discussed in #4642.
@pfultz2 Please have a look.
This is the initial approach which works quite well. I already did further functions up to the first more complex case valueFlowForwardLifetime() were it gets quite granular but we can discuss this after decided if this approach is fine.
I will also get rid of the using namespace ValueFlow within the split files since it makes things harder to understand when the increased granularity kicks in.
I am reworking this a bit and will fix the matchcompiler and CMake.
Still needs matchcompiler support.
Also need to make sure it doesn't impact the performance negatively now the code is no longer completely visible to some of the callers.
I will also get rid of the using namespace ValueFlow within the split files since it makes things harder to understand when the increased granularity kicks in.
Wrapping in namespace ValueFlow { ... } will get rid of that.
I will also get rid of the using namespace ValueFlow within the split files since it makes things harder to understand when the increased granularity kicks in.
Wrapping in
namespace ValueFlow { ... }will get rid of that.
I don't like that the indentation is being increased by that. I think it's nicer to simply add a single line and having them all aligned to the first line.
This currently doesn't play well with the matchcompiler. I have it working in CMake but the regular make is still an issue. It also seems there's some code in it which we don't need anymore.
I don't like that the indentation is being increased by that. I think it's nicer to simply add a single line and having them all aligned to the first line.
We should update the formatting to not indent for namespace scopes.
I will give this another stab after #6298 has been merged.
Since it complicates things and does not match the structure the project has been using all along I will omit introducing a subfolder and introduce an underscore in the filenames instead (although that also doesn't match what has been done so far).
Re-did the first commit, will re-add the others later.
Having this in individual files might also allow us to write unit (and maybe performance tests) for the respective analyze steps.
We could already merge this as a start or I could move yet another step. IMO this change is way too big to do it in a single commit.
After all the steps have been moved out I will do the further suggested split of the common code.
Any feedback on this? I would like to proceed on this so it is done within this dev cycle. Also so we could maybe do some work on #6097.