[analyzer][NFCi] Mark CallEvent::getOriginExpr virtual, some cleanup
authorBalazs Benics <benicsbalazs@gmail.com>
Fri, 6 Nov 2020 15:51:34 +0000 (16:51 +0100)
committerBalazs Benics <benicsbalazs@gmail.com>
Fri, 6 Nov 2020 15:51:34 +0000 (16:51 +0100)
commitaa0dc1c3b8628bed8c8b91a75258d13eefa88dfe
treee14bd3ab8d8ef5257a990d22237e811627473156
parent7efe07a12b6967bc358678adf75dffd238a00250
[analyzer][NFCi] Mark CallEvent::getOriginExpr virtual, some cleanup

Previously we just shadowed the original implementation with a virtual
declaration - which is really bugprone in a long run.

This patch marks `CallEvent::getOriginExpr` virtual to let subclasses
override it's behavior.
At the same time, I checked all virtual functions of this class hierarchy
to make sure we don't suffer from this elsewhere.
Removes redundant declarations of `virtual` if `override` is already present.

In theory, this patch is a functional change, but no tests were broken.
I suspect that there were no meaningful changes in behavior in the
subclasses compared to the shadowed `CallEvent::getOriginExpr`.

That being said, I had a hard time coming up with unit-tests covering this.
Motivation: https://reviews.llvm.org/D74735#2370909

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D90754
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h