This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Unify `TransferOptions` and `DataflowAnalysisContext::Options`.
ClosedPublic

Authored by ymandel on Dec 27 2022, 10:53 AM.

Details

Summary

Merges TransferOptions into the newly-introduced
DataflowAnalysisContext::Options and removes explicit parameter for
TransferOptions, relying instead on the common options carried by the analysis
context. Given that there was no intent to allow different options between calls
to transfer, a common value for the options is preferable.

Diff Detail

Event Timeline

ymandel created this revision.Dec 27 2022, 10:53 AM
Herald added a project: Restricted Project. · View Herald Transcript
ymandel requested review of this revision.Dec 27 2022, 10:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 27 2022, 10:53 AM
gribozavr2 accepted this revision.Dec 28 2022, 3:09 AM
gribozavr2 added inline comments.
clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h
39–40

Please undo the comment reformatting.

This revision is now accepted and ready to land.Dec 28 2022, 3:09 AM
ymandel updated this revision to Diff 485488.Dec 28 2022, 5:40 AM

address review comments

gribozavr2 accepted this revision.Dec 29 2022, 10:27 AM
ymandel updated this revision to Diff 487516.Jan 9 2023, 11:43 AM

rebasing.

ymandel updated this revision to Diff 487538.Jan 9 2023, 1:06 PM

Initialize AnalysisOptions as a struct, avoiding a use-after-move bug from incorrect use of the fluent (rvalue-ref) API.

xazax.hun accepted this revision.Jan 9 2023, 1:47 PM
xazax.hun added inline comments.
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
89

If we already change this code, I think we can consider replacing this with std::optional but feel free to ignore.

ymandel updated this revision to Diff 487769.Jan 10 2023, 6:00 AM

use std::optional

clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
89

If we already change this code, I think we can consider replacing this with std::optional but feel free to ignore.

Thanks, I was actually wondering about that. I wasn't sure where llvm/clang was in terms of std::optional adoption. I'm happy to update.

This revision was landed with ongoing or failed builds.Jan 10 2023, 6:17 AM
This revision was automatically updated to reflect the committed changes.