[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 446842. samestep added a comment. Address Yitzie's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D130306 Files: clang/include/clang/Analysis/FlowSensitive/Dataf

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:220 + assert(Body != nullptr); + initGlobalVars(*Body, Env); + ymandel wrote: > samestep wrote: > > ymandel wrote: > > > I wonder how this will work between cal

[PATCH] D130305: [clang][dataflow] Refactor ApplyBuiltinTransfer field out into DataflowAnalysisOptions struct

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGaed1ab8cabac: [clang][dataflow] Refactor ApplyBuiltinTransfer field out into… (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 446855. samestep added a comment. Fix typo in comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D130306 Files: clang/include/clang/Analysis/FlowSensitive/DataflowEnv

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 446914. samestep added a comment. Don't allow globals Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D130306 Files: clang/include/clang/Analysis/FlowSensitive/DataflowEnv

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:220 + assert(Body != nullptr); + initGlobalVars(*Body, Env); + ymandel wrote: > samestep wrote: > > ymandel wrote: > > > samestep wrote: > > > > ymandel wrote:

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 446915. samestep added a comment. Update comment about default parameters Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D130306 Files: clang/include/clang/Analysis/FlowS

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h:64 TypeErasedDataflowAnalysis(bool ApplyBuiltinTransfer) : Options({ApplyBuiltinTransfer}) {} li.zhe.hua wrote: > Nit: `-Wmissing-fiel

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 446958. samestep added a comment. Appease -Wmissing-field-initializers Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130306/new/ https://reviews.llvm.org/D130306 Files: clang/include/clang/Analysis/FlowSens

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-25 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D130306#3673120 , @xazax.hun wrote: > Thanks! I think this is a major design decision, and I'd love to see a > discussion about the alternatives considered before jumping to an > implementation. Specifically, I'd like to kno

[PATCH] D130306: [clang][dataflow] Analyze calls to in-TU functions

2022-07-25 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. In D130306#3676672 , @xazax.hun wrote: > Thanks! Knowing the context, I am much happier with the direction overall. Is > the plan to analyze a mock of std::optional instead of the actual code in the > STL? How will that mock be

[PATCH] D131779: [clang][dataflow] Encode options using llvm::Optional

2022-08-12 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https:/

[PATCH] D131779: [clang][dataflow] Encode options using llvm::Optional

2022-08-12 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 452193. samestep added a comment. Use llvm::None per Gábor's suggestion Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131779/new/ https://reviews.llvm.org/D131779 Files: clang/include/clang/Analysis/FlowSen

[PATCH] D131779: [clang][dataflow] Encode options using llvm::Optional

2022-08-12 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:70 + ? TransferOptions{} + : llvm::Optional()}) {} sgatev wrote: > I tried tha

[PATCH] D131779: [clang][dataflow] Encode options using llvm::Optional

2022-08-12 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 452196. samestep added a comment. Remove unnecessary explicit call to hasValue Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131779/new/ https://reviews.llvm.org/D131779 Files: clang/include/clang/Analysis/

[PATCH] D131779: [clang][dataflow] Encode options using llvm::Optional

2022-08-12 Thread Sam Estep via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGb3f1a6bf1080: [clang][dataflow] Encode options using llvm::Optional (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D131809: [clang][dataflow] Add an option for context-sensitive depth

2022-08-12 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https:/

[PATCH] D131809: [clang][dataflow] Add an option for context-sensitive depth

2022-08-15 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:210 + const DeclContext *Callee) const { + return CallString.size() <= MaxDepth && + std::find(CallString.begin(), CallString.end(), Callee) =

[PATCH] D131809: [clang][dataflow] Add an option for context-sensitive depth

2022-08-15 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:665 +if (!(Options.ContextSensitiveOpts && + Env.canDescend(Options.ContextSensitiveOpts->Depth, F))) return; samestep wrote: > xazax.hun wrote: > > Alte

[PATCH] D131809: [clang][dataflow] Add an option for context-sensitive depth

2022-08-15 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 452783. samestep added a comment. Address Stanislav's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131809/new/ https://reviews.llvm.org/D131809 Files: clang/include/clang/Analysis/FlowSensitive/Da

[PATCH] D131809: [clang][dataflow] Add an option for context-sensitive depth

2022-08-15 Thread Sam Estep via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG2efc8f8d6561: [clang][dataflow] Add an option for context-sensitive depth (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D132241: [clang][dataflow] Dummy patch 1

2022-08-19 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https:/

[PATCH] D132242: [clang][dataflow] Dummy patch 2

2022-08-19 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Depends On D132241

[PATCH] D132251: [clang][dataflow] Dummy patch

2022-08-19 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https:/

[PATCH] D127502: [clang][dataflow] Don't `assert` full LHS coverage in `optional` model

2022-06-10 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. samestep added a reviewer: ymandel. Herald added subscribers: tschuett, steakhal, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github

[PATCH] D127502: [clang][dataflow] Don't `assert` full LHS coverage in `optional` model

2022-06-10 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. @ymandel Yes, either this patch or D127434 would bring that test from crashing to passing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127502/new/ https://reviews.llvm.org/D127502 ___

[PATCH] D127898: [clang][dataflow] Find unsafe locs after fixpoint

2022-06-15 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, carlosgalvezp, xazax.hun, mgorny. Herald added a project: All. samestep requested review of this revision. Herald added projects: clang, LLVM, clang-tools-extra. Herald added subscribers: cfe-commits, llvm-commits. Reposi

[PATCH] D127898: [clang][dataflow] Find unsafe locs after fixpoint

2022-06-21 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:66 + SourceLocations Locs; + for (const CFGBlock *Block : Context->getCFG()) { +// Skip blocks that were not evaluated. xazax.hun wrote: > Wh

[PATCH] D127898: [clang][dataflow] Find unsafe locs after fixpoint

2022-06-21 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 438891. samestep added a comment. Only add the new API, don't change the check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/docs/tools/clang-format

[PATCH] D128352: [clang][dataflow] Use diagnosis API in optional checker

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, carlosgalvezp, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo

[PATCH] D128352: [clang][dataflow] Use diagnosis API in optional checker

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439042. samestep added a comment. Remove unnecessary ExitBlock code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128352/new/ https://reviews.llvm.org/D128352 Files: clang-tools-extra/clang-tidy/bugprone/Un

[PATCH] D128354: Comment Diagnosis.h and add missing headers

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D128354 Files: clang/include/clang/Analysis/FlowSensiti

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439045. samestep added a comment. Comment Diagnosis.h and add missing headers Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/include/clang/Analysis/F

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep marked 4 inline comments as done. samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h:49 +template struct DiagnoseState { + DiagnoseState(DiagsT &Diags, const Environment &Env) + : Diags(Diags), Env(Env) {}

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439048. samestep added a comment. Try to fix the broken patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/docs/tools/clang-formatted-files.txt c

[PATCH] D128352: [clang][dataflow] Use diagnosis API in optional checker

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:58 BlockToOutputState = - dataflow::runDataflowAnalysis(*Context, Analysis, Env); + dataflow::runTypeErasedDataflowAnalysis(*Context, Analy

[PATCH] D128352: [clang][dataflow] Use diagnosis API in optional checker

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439052. samestep added a comment. - Merge branch 'diagnose-api' into optional-check-diagnose Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128352/new/ https://reviews.llvm.org/D128352 Files: clang-tools-ext

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep marked an inline comment as not done. samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:76 +class UncheckedOptionalAccessDiagnosis { +public: samestep wrote: > sgatev wrote: >

[PATCH] D128356: [clang][dataflow] Use NoopLattice in optional model

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D1

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:76 +class UncheckedOptionalAccessDiagnosis { +public: sgatev wrote: > samestep wrote: > > samestep wrote: > > > sgatev wrote: > > > > M

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-22 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:76 +class UncheckedOptionalAccessDiagnosis { +public: samestep wrote: > sgatev wrote: > > samestep wrote: > > > samestep wrote: > > > >

[PATCH] D128356: [clang][dataflow] Use NoopLattice in optional model

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. @xazax.hun After this patch, `SourceLocationsLattice` is still used by `clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp`. I'm currently working on a patch to change the way we write unit tests in that file, after which I'll make a followup p

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439372. samestep added a comment. - Merge branch 'main' into diagnose-api - Incorporate Gábor's suggestions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files:

[PATCH] D128352: [clang][dataflow] Use diagnosis API in optional checker

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439373. samestep added a comment. - Merge branch 'diagnose-api' into optional-check-diagnose Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128352/new/ https://reviews.llvm.org/D128352 Files: clang-tools-ext

[PATCH] D128356: [clang][dataflow] Use NoopLattice in optional model

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439374. samestep added a comment. - Merge branch 'optional-check-diagnose' into optional-model-noop-lattice Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128356/new/ https://reviews.llvm.org/D128356 Files:

[PATCH] D128446: [clang][dataflow] Use annotations for optional diagnostic tests

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D1

[PATCH] D128448: [clang][dataflow] Delete SourceLocationsLattice

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, mgrang, xazax.hun, mgorny. Herald added a project: All. samestep requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. Repository: rG LLVM Github Mon

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Diagnosis.h:57 + } + return std::move(Diags); +} sgatev wrote: > Better to remove this and rely on NRVO? > https://en.cppreference.com/w/cpp/language/copy_elision Ah OK, I'm

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439411. samestep added a comment. - Remove unnecessary std::move Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/docs/tools/clang-formatted-files.txt

[PATCH] D128352: [clang][dataflow] Use diagnosis API in optional checker

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439413. samestep added a comment. - Merge branch 'diagnose-api' into optional-check-diagnose Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128352/new/ https://reviews.llvm.org/D128352 Files: clang-tools-ext

[PATCH] D128356: [clang][dataflow] Use NoopLattice in optional model

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439414. samestep added a comment. - Merge branch 'optional-check-diagnose' into optional-model-noop-lattice Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128356/new/ https://reviews.llvm.org/D128356 Files:

[PATCH] D128446: [clang][dataflow] Use annotations for optional diagnostic tests

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439415. samestep added a comment. - Merge branch 'diagnose-api' into diagnose-test-annotations Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128446/new/ https://reviews.llvm.org/D128446 Files: clang/unittes

[PATCH] D128448: [clang][dataflow] Delete SourceLocationsLattice

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439438. samestep added a comment. - Merge branch 'delete-source-locations-lattice-base' into delete-source-locations-lattice Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128448/new/ https://reviews.llvm.org/

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep marked an inline comment as done. samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Diagnosis.h:38-42 +llvm::DenseSet diagnoseCFG( +const ControlFlowContext &CFCtx, +std::vector> &BlockStates, +const Environment &Env, Type

[PATCH] D128467: [clang][dataflow] Allow MatchSwitch to return a value

2022-06-23 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D1

[PATCH] D128467: [clang][dataflow] Allow MatchSwitch to return a value

2022-06-24 Thread Sam Estep via Phabricator via cfe-commits
samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h:49 /// appropriate handler. -template -using MatchSwitch = std::function; +template +using MatchSwitch = std::function; gribozavr2 wrote: > WDYT? like a "funct

[PATCH] D128467: [clang][dataflow] Allow MatchSwitch to return a value

2022-06-24 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439723. samestep added a comment. - Use Result instead of Output - Merge branch 'main' into match-switch-return-non-void Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128467/new/ https://reviews.llvm.org/D1284

[PATCH] D128467: [clang][dataflow] Allow MatchSwitch to return a value

2022-06-24 Thread Sam Estep via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4eecd194b073: [clang][dataflow] Allow MatchSwitch to return a value (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D128533: [clang][dataflow] Allow MatchSwitch to return a value

2022-06-24 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D1

[PATCH] D128533: [clang][dataflow] Allow MatchSwitch to return a value

2022-06-24 Thread Sam Estep via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG8c278a27811c: [clang][dataflow] Allow MatchSwitch to return a value (authored by samestep). Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-24 Thread Sam Estep via Phabricator via cfe-commits
samestep marked an inline comment as done. samestep added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:85 +private: + ASTContext &Context; + MatchSwitch>> samestep wrote: > xazax.hun wrote: > > D

[PATCH] D127898: [clang][dataflow] Add API to separate analysis from diagnosis

2022-06-24 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 439878. samestep added a comment. - Merge branch 'main' into diagnose-api - WIP Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127898/new/ https://reviews.llvm.org/D127898 Files: clang/include/clang/Analysi

[PATCH] D127008: [clang][dataflow] Fix filename typos in tests

2022-06-03 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. Herald added subscribers: tschuett, steakhal, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D

[PATCH] D127434: [clang][dataflow] Match call return via hasType Currently the unchecked-optional-access model fails on this example: #include #include void foo() {

2022-06-09 Thread Sam Estep via Phabricator via cfe-commits
samestep created this revision. samestep added a reviewer: ymandel. Herald added subscribers: tschuett, steakhal, xazax.hun. Herald added a project: All. samestep requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. ...::nullopt; } You can v

[PATCH] D127434: [clang][dataflow] In `optional` model, match call return via hasType

2022-06-09 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. A test would definitely be good, but I'm not sure how to add one to `UncheckedOptionalAccessModelTest.cpp`, since the issue disappears when we replace `std::unique_ptr` with our custom simple `smart_ptr`. Any ideas? Comment at: clang/lib/Analysis/Fl

[PATCH] D127434: [clang][dataflow] In `optional` model, match call return via hasType

2022-06-09 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 435649. samestep added a comment. Simplify body using qualType Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127434/new/ https://reviews.llvm.org/D127434 Files: clang/lib/Analysis/FlowSensitive/Models/Unche

[PATCH] D127434: [clang][dataflow] In `optional` model, match call return via hasType

2022-06-10 Thread Sam Estep via Phabricator via cfe-commits
samestep added a comment. @sgatev Oh nice, thank you for figuring that out! @ymandel and I saw that on Wednesday and tried for a while to figure out how to encode it into a test using the sample implementation from cppreference, but I think we kept forgetting the `::type` part. I'll add this as

[PATCH] D127434: [clang][dataflow] In `optional` model, match call return via hasType

2022-06-10 Thread Sam Estep via Phabricator via cfe-commits
samestep updated this revision to Diff 435873. samestep added a comment. Add a test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127434/new/ https://reviews.llvm.org/D127434 Files: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccess

<    1   2