This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Model the behavior of various optional members
ClosedPublic

Authored by sgatev on Mar 10 2022, 7:30 AM.

Details

Summary

Model make_optional, optional's default constructor, emplace,
reset, and operator bool members.

Diff Detail

Event Timeline

sgatev created this revision.Mar 10 2022, 7:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 7:30 AM
sgatev requested review of this revision.Mar 10 2022, 7:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 7:30 AM
xazax.hun accepted this revision.Mar 10 2022, 8:41 AM

Thanks!

clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
64

Nit: unintended change?

clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp
34

I wonder if it is more sustainable in the long term to have these headers in a separate file and #include them here (and build the raw string literal with a macro if that is possible at all).

This revision is now accepted and ready to land.Mar 10 2022, 8:41 AM
sgatev updated this revision to Diff 414396.Mar 10 2022, 8:58 AM
sgatev marked an inline comment as done.

Address reviewers' comments.

sgatev marked an inline comment as done.Mar 10 2022, 9:00 AM
sgatev added inline comments.
clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp
34

Yeap, I agree that would be better. I'll consider some options and send a patch to move them out of here.

This revision was landed with ongoing or failed builds.Mar 13 2022, 11:51 PM
This revision was automatically updated to reflect the committed changes.
sgatev marked an inline comment as done.