This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by steakhal on Nov 4 2020, 3:20 AM.

Details

Summary

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

Diff Detail

Event Timeline

steakhal created this revision.Nov 4 2020, 3:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2020, 3:20 AM
NoQ accepted this revision.Nov 5 2020, 7:52 PM

Looks great, thanks!

This revision is now accepted and ready to land.Nov 5 2020, 7:52 PM
This revision was landed with ongoing or failed builds.Nov 6 2020, 7:51 AM
This revision was automatically updated to reflect the committed changes.