This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Change the diagnoser API to receive a correctly typed lattice element
ClosedPublic

Authored by merrymeerkat on Dec 12 2022, 11:31 AM.

Details

Summary

Previously, the diagnoser could only receive the Environment at a given program point. Now, it receives the complete dataflow state: the environment and lattice element.

This change does not contain any tests because we modify the checkDataflow function to rely on the newly introduced lattice element in PostVisitCFG, and existing tests that verify lattice elements depend on this overload of checkDataflow.

Diff Detail

Event Timeline

merrymeerkat created this revision.Dec 12 2022, 11:31 AM
Herald added a project: Restricted Project. · View Herald Transcript
merrymeerkat requested review of this revision.Dec 12 2022, 11:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2022, 11:31 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
merrymeerkat retitled this revision from [clang][dataflow] Change the diagnoser API to receive a correctly typed lattice element Previously, the diagnoser could only receive the Environment at a given program point. Now, it receives the complete dataflow state: the environment and... to [clang][dataflow] Change the diagnoser API to receive a correctly typed lattice element.Dec 12 2022, 11:33 AM
merrymeerkat edited the summary of this revision. (Show Details)
merrymeerkat added reviewers: gribozavr2, ymandel.
merrymeerkat edited the summary of this revision. (Show Details)Dec 12 2022, 11:42 AM
ymandel accepted this revision.Dec 12 2022, 11:44 AM
ymandel added inline comments.
clang/unittests/Analysis/FlowSensitive/TestingSupport.h
134

nit: I think capturing by move is a bit better, since Arg is passed by copy to withPostVisitCFG: [Arg = std::move(Arg)]

This revision is now accepted and ready to land.Dec 12 2022, 11:44 AM

Address review comment

gribozavr2 accepted this revision.Dec 13 2022, 4:27 AM
This revision was landed with ongoing or failed builds.Dec 13 2022, 5:49 AM
This revision was automatically updated to reflect the committed changes.