This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Improve optional model's support for ignoring smart pointers.
ClosedPublic

Authored by ymandel on Dec 14 2022, 6:08 AM.

Details

Summary

The optional model has an option to ignore optionals accessed through smart
pointer types (other than optional itself). This patch improves this feature in
two ways:

  1. We extend support to optionals accessed directly through the smart pointer,

like ptr->value(). Previously, support was limited to cases that went through
an intermediate field.

  1. We clean up the implementation by removing the option from the analysis,

leaving it only in the diagnostic phase (where it is relevant).

  1. Adjusts a test which was misleading in what it was testing.

Diff Detail

Event Timeline

ymandel created this revision.Dec 14 2022, 6:08 AM
Herald added a project: Restricted Project. · View Herald Transcript
ymandel requested review of this revision.Dec 14 2022, 6:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 6:08 AM
xazax.hun accepted this revision.Dec 14 2022, 3:01 PM
This revision is now accepted and ready to land.Dec 14 2022, 3:01 PM