[all-commits] [llvm/llvm-project] aa0dc1: [analyzer][NFCi] Mark CallEvent::getOriginExpr vir...

Balazs Benics via All-commits all-commits at lists.llvm.org
Fri Nov 6 07:52:06 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: aa0dc1c3b8628bed8c8b91a75258d13eefa88dfe
      https://github.com/llvm/llvm-project/commit/aa0dc1c3b8628bed8c8b91a75258d13eefa88dfe
  Author: Balazs Benics <benicsbalazs at gmail.com>
  Date:   2020-11-06 (Fri, 06 Nov 2020)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h

  Log Message:
  -----------
  [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




More information about the All-commits mailing list