[PATCH] D90754: [analyzer][NFCi] Mark CallEvent::getOriginExpr virtual, some cleanup

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 03:20:13 PST 2020


steakhal created this revision.
steakhal added reviewers: NoQ, vsavchenko, martong, ASDenysPetrov, Szelethus.
Herald added subscribers: cfe-commits, Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity.
Herald added a project: clang.
steakhal requested review of this revision.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90754

Files:
  clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90754.302797.patch
Type: text/x-patch
Size: 6836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201104/e3867ad9/attachment-0001.bin>


More information about the cfe-commits mailing list