https://github.com/Xazax-hun approved this pull request.

I wish we could clean up `checkLocation` to work as expected for all cases. It 
is more future proof in the sense that if C++ introduces new kinds of 
statements or expressions that could index into something (like 
multi-dimensional `operator[]`), checks continue to work without change after 
the analysis engine is updated. 

It is a higher-level abstraction that lets checker authors focus on the 
semantics without having to enumerate all the patterns the check might be 
interested in which is often impossible in C++, let alone considering all the 
extensions implemented by Clang. So, these high-level abstractions supposed to 
deduplicate a lot of work by doing all the pattern matching once and for all in 
the engine, so checkers could benefit from this work without duplicating some 
of that pattern matching in every checker.

All that being said, I understand that it is more practical to just work these 
engine problems around in this check for now as we do not have a volunteer to 
revamp `checkLocation` at the moment. I know @steakhal looked into it, but it 
turned out to be a bigger fish than we expected.  So, I'd say let's land this 
as a practical middle-term solution on the hope that we will be able to come 
back and clean this up at some point using something that is more future proof. 

https://github.com/llvm/llvm-project/pull/72107
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to