This is an archive of the discontinued LLVM Phabricator instance.

[clang][dataflow] Refactor ApplyBuiltinTransfer field out into DataflowAnalysisOptions struct
ClosedPublic

Authored by samestep on Jul 21 2022, 2:33 PM.

Details

Summary

Depends On D130304

This patch pulls the ApplyBuiltinTransfer from the TypeErasedDataflowAnalysis class into a new DataflowAnalysisOptions struct, to allow us to add additional options later without breaking existing code.

Diff Detail

Event Timeline

samestep created this revision.Jul 21 2022, 2:33 PM
Herald added a project: Restricted Project. · View Herald Transcript
samestep requested review of this revision.Jul 21 2022, 2:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 2:33 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
samestep edited the summary of this revision. (Show Details)Jul 21 2022, 2:39 PM
samestep added reviewers: ymandel, gribozavr2, sgatev.
xazax.hun added inline comments.Jul 21 2022, 3:53 PM
clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h
38

I think it might be better to have a default value.

gribozavr2 accepted this revision.Jul 21 2022, 4:00 PM
gribozavr2 added inline comments.
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
66

Will you remove this bool overload in a later patch?

clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h
38

+1, uninitialized data is tricky to handle -- especially if we add more options in future.

This revision is now accepted and ready to land.Jul 21 2022, 4:00 PM
samestep added inline comments.Jul 22 2022, 7:18 AM
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
66

I didn't have any plans to, but I'm fine with removing it in a later patch if people want to.

clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h
38

Makes sense, will do!

samestep updated this revision to Diff 446829.Jul 22 2022, 7:24 AM

Give a default value to ApplyBuiltinTransfer

sgatev accepted this revision.Jul 22 2022, 7:27 AM
sgatev added inline comments.
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
66

I think it makes sense to remove it. Can you already document that it's deprecated in this patch?

samestep added inline comments.Jul 22 2022, 7:29 AM
clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
66

Sure, I can document that; what's the best way to do so? Is there a special way to say something is deprecated in a /// comment?

samestep updated this revision to Diff 446841.Jul 22 2022, 8:11 AM

Mark bool constructors as deprecated

sgatev accepted this revision.Jul 22 2022, 8:11 AM
This revision was landed with ongoing or failed builds.Jul 22 2022, 8:16 AM
This revision was automatically updated to reflect the committed changes.