This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Extend flow condition in the body of a for loop
ClosedPublic

Authored by sgatev on Jun 17 2022, 7:38 AM.

Details

Summary

Extend flow condition in the body of a for loop.

Diff Detail

Event Timeline

sgatev created this revision.Jun 17 2022, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2022, 7:38 AM
sgatev requested review of this revision.Jun 17 2022, 7:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 17 2022, 7:38 AM
gribozavr2 accepted this revision.Jun 17 2022, 7:43 AM
gribozavr2 added inline comments.
clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
3577–3580
This revision is now accepted and ready to land.Jun 17 2022, 7:43 AM
ymandel accepted this revision.Jun 17 2022, 8:28 AM

Mild preference for splitting into three tests, since it technically different code that's covered in each. But, up to you.

sgatev updated this revision to Diff 437918.Jun 17 2022, 8:31 AM

Address comments.

xazax.hun accepted this revision.Jun 17 2022, 9:41 AM
xazax.hun added inline comments.
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
92

Do we support DoStmt or is that missing?

sgatev updated this revision to Diff 438257.Jun 19 2022, 11:04 PM

Address comments.

sgatev marked an inline comment as done.Jun 19 2022, 11:10 PM
sgatev added inline comments.
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
92

Good question. I think it's worth adding support for DoStmt, but that won't be very useful at this point because the condition will not always be true within the body of the loop. I'd be happy to follow up with a patch for it, but I'll first need to figure out what test to write. Ideas are welcome. : )

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