This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Various changes to handling of modeled fields.
ClosedPublic

Authored by mboehme on Jul 6 2023, 2:21 AM.

Details

Summary
  • Rename getReferencedFields() to getModeledFields(). Move the logic that returns all object fields when doing a context-sensitive analysis to here from DataflowAnalysisContext::createStorageLocation(). I think all callers of the previous getReferencedFields() should use this logic; the fact that they were not doing so looks like a bug.
  • Make getModeledFields() public. I have an upcoming patch that will need to use this function from Transfer.cpp, and there doesn't seem to be any reason why this function should not be public.
  • Use a SmallSetVector to get deterministic iteration order. I have a pending patch where I'm getting flaky tests because Environment::createValueUnlessSelfReferential() is non-deterministically populating different fields depending on the iteration order. This change fixes those flaky tests.

Diff Detail

Event Timeline

mboehme created this revision.Jul 6 2023, 2:21 AM
Herald added a project: Restricted Project. · View Herald Transcript
mboehme requested review of this revision.Jul 6 2023, 2:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2023, 2:21 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
gribozavr2 accepted this revision.Jul 8 2023, 9:18 PM
This revision is now accepted and ready to land.Jul 8 2023, 9:18 PM

libcxx failure looks unrelated

This revision was landed with ongoing or failed builds.Jul 9 2023, 11:46 PM
This revision was automatically updated to reflect the committed changes.