This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow][NFC] Eliminate `getStorageLocation()` / `setStorageLocation()` in `DataflowAnalysisContext`.
ClosedPublic

Authored by mboehme on Aug 28 2023, 5:57 AM.

Details

Summary

Instead, inline them into the getStableStorageLocation() overloads, which is the only place they were called from (and should be called from).

getStorageLocation() / setStorageLocation() were confusing because neither their name nor their documentation made reference to the fact that the storage location is stable.

It didn't make sense to keep these as private member functions either. The code for the two getStableStorageLocation() overloads has become only marginally more complex by inlining these functions, and the Expr version is actually more efficient because we only call ignoreCFGOmittedNodes() once instead of twice.

Diff Detail

Event Timeline

mboehme created this revision.Aug 28 2023, 5:57 AM
Herald added a project: Restricted Project. · View Herald Transcript
mboehme requested review of this revision.Aug 28 2023, 5:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 5:57 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mboehme edited the summary of this revision. (Show Details)Aug 28 2023, 5:57 AM
mboehme added a reviewer: ymandel.
ymandel accepted this revision.Aug 28 2023, 7:51 AM

I love this! (specifically, that it simplifies the API surface)

This revision is now accepted and ready to land.Aug 28 2023, 7:51 AM
xazax.hun accepted this revision.Aug 28 2023, 8:02 AM