This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Rename `getPointeeLoc` to `getReferentLoc` for ReferenceValue.
ClosedPublic

Authored by wyt on Jun 14 2022, 7:53 AM.

Details

Summary

We distinguish between the referent location for ReferenceValue and pointee location for PointerValue. The former must be non-empty but the latter may be empty in the case of a nullptr

Diff Detail

Event Timeline

wyt created this revision.Jun 14 2022, 7:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 7:53 AM
wyt requested review of this revision.Jun 14 2022, 7:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 7:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

On a high level, what's wrong with having getPointeeLoc members with different return types in ReferenceValue and PointerValue?

wyt updated this revision to Diff 436816.Jun 14 2022, 9:22 AM

Modified renaming: getPointeeLoc of ReferenceValue is modified to getReferentLoc, getPointeeLoc remains unchanged for PointerValue

wyt retitled this revision from [clang][dataflow] Rename `getPointeeLoc` to `getReferencePointeeLoc` and `getPointerPointeeLoc` respectively for ReferenceValue and PointerValue. to [clang][dataflow] Rename `getPointeeLoc` to `getReferentLoc` for ReferenceValue..Jun 14 2022, 9:25 AM
wyt edited the summary of this revision. (Show Details)
wyt added a comment.Jun 14 2022, 9:30 AM

On a high level, what's wrong with having getPointeeLoc members with different return types in ReferenceValue and PointerValue?

IMO, it would be nice to distinguish the type of Value we are working on.
As per Dmitri's suggestion, I updated the patch so that getPointeeLoc of ReferenceValue is now renamed to getReferentLoc, getPointeeLoc is remains the same for PointerValue.

sgatev accepted this revision.Jun 14 2022, 10:20 AM
This revision is now accepted and ready to land.Jun 14 2022, 10:20 AM
gribozavr2 accepted this revision.Jun 14 2022, 3:40 PM
This revision was landed with ongoing or failed builds.Jun 14 2022, 3:53 PM
This revision was automatically updated to reflect the committed changes.