[PATCH] D136224: [clang-tidy] Skip private default ctors in modernize-use-equals-default

2022-10-19 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp:233 + auto IsPublicOrOutOfLineUntilCPP20 = + LangOpts.CPlusPlus20 || LangOpts.C

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-14 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/SolverTest.cpp:69 -TEST(SolverTest, UnitConflict) { - ConstraintContext Ctx; Why delete this test? Repository: rG LLVM Github Monorepo

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-07 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:157 + TopValue &createTop() { +return takeOwnership(std::make_unique()); + } ymandel wrote: > xazax.hun wr

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-06 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:157 + TopValue &createTop() { +return takeOwnership(std::make_unique()); + } Should we be creating a new top every time, or should it be a si

[PATCH] D133698: [clang][dataflow] SignAnalysis, edgeTransfer, branchTransfer

2022-09-15 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:127 + // Default implementation is a Noop. + virtual void branchTransfer(bool Branch, const Stmt *S, Lattice &L, + Environment &Env) {} -

[PATCH] D133029: [Sema] Allow to diagnose the references to std::vector with incomplete T

2022-08-31 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. In D133029#3761344 , @ilya-biryukov wrote: > [...] I don't think there is an easy way to write it outside `Sema` and > `Sema` is not readily available for `clang-tidy`. What information is missing, exactly? Repository: r

[PATCH] D133009: [libclang] Fix conversion from `StringRef` to `CXString`

2022-08-31 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/test/Index/comment-lots-of-unknown-commands.c:3 +// XFAIL: * + egorzhdan wrote: > This test was never properly passing. Because of the bug in string > conversion, the printed comments contained the entire sou

[PATCH] D132932: [Clang][Comments] Parse `` in doc comments correctly

2022-08-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/tools/libclang/CXString.cpp:85 + if (String.empty()) +return createEmpty(); + egorzhdan wrote: > gribozavr2 wrote: > > Ple

[PATCH] D132932: [Clang][Comments] Parse `` in doc comments correctly

2022-08-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/tools/libclang/CXString.cpp:85 + if (String.empty()) +return createEmpty(); + Please split this change into a separate patch and add a unit test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D132654: [clang-tidy] Fix false positive on `ArrayInitIndexExpr` inside `ProBoundsConstantArrayIndexCheck`

2022-08-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/pro-bounds-constant-array-index.cpp:2 // RUN: %check_clang_tidy %s cppcoreguidelines-pr

[PATCH] D132713: [clang-tidy] Skip union-like classes in use-equals-default

2022-08-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp:220 void UseEqualsDefaultCheck::registerMatchers(MatchFinder *Finder) { - // Skip unions since constructors with empty bodies behave differently - // in comparison wi

[PATCH] D132932: [Clang][Comments] Parse `` in doc comments correctly

2022-08-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/test/Sema/warn-documentation.cpp:78 +/// Aaa bbb +int test_html_img4(int); + Could you also add these tests to clang/test/Index/comment-to-html-xml-conversion.cpp to show that the whole tag is captured correct

[PATCH] D132763: [clang][dataflow] Use `StringMap` for storing analysis states at annotated points instead of `vector>`.

2022-08-29 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:302 +AnnotationStates.insert({It->second, StateT{*Lattice, State.Env}}); +assert(InsertSuccess); }; Please add

[PATCH] D132795: [clang-tidy] Tweak diagnostics for bugprone-assign-in-if-condition

2022-08-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/bugprone/AssignmentInIfConditionCheck.cpp:64 void AssignmentInIfConditionCheck::report(const Expr *MatchedDecl) { +

[PATCH] D132756: [clang][dataflow] Refactor `TypeErasedDataflowAnalysisTest` - replace usage of the deprecated overload of `checkDataflow`.

2022-08-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:68 +const Environment &getEnvironmentAtAnnotation( +llvm::StringMap> &AnnotationStates, +

[PATCH] D132763: [clang][dataflow] Use `StringMap` for storing analysis states at annotated points instead of `vector>`.

2022-08-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp:124 + } + Result[Stmt] = Annotation; + Commen

[PATCH] D132147: [clang][dataflow] Refactor `TestingSupport.h`

2022-08-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:117 +llvm::DenseMap +getAnnotationLinesAndContent(AnalysisOutputs &AO); + (if possible) Comment at: clang/unittests/Analysis/FlowSensitive/Tes

[PATCH] D132745: [clang] Fix ambiguous use of `report_fatal_error`.

2022-08-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Basic/SanitizerSpecialCaseList.cpp:36 return SSCL; - llvm::report_fatal_error(Error); + llvm::report_fatal_error(llvm::StringRef(Erro

[PATCH] D132377: [clang][dataflow] Add `SetupTest` parameter for `AnalysisInputs`.

2022-08-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:106 + /// `BlockStates` field which is only computed later during the analysis. + std::funct

[PATCH] D132290: [clang-tidy] Skip unions in use-equals-default

2022-08-20 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp:221 // Destructor. - Finder->addMatcher(cxxDestructorDecl(isDefinition()).bind(Sp

[PATCH] D132147: [clang][dataflow] Refactor `TestingSupport.h`

2022-08-18 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:60 +/// Arguments for building the dataflow analysis. +template struct AnalysisArguments { + /// Input code that is analyzed. AnalysisInputs? ===

[PATCH] D131975: [clang][dataflow] Use llvm::is_contained()

2022-08-16 Thread Dmitri Gribenko 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 rG941959d69de7: [clang][dataflow] Use llvm::is_contained() (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D131975: [clang][dataflow] Use llvm::is_contained()

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

[PATCH] D131616: [clang][dataflow] Generalise match switch utility to other AST types and add a `CFGMatchSwitch` which currently handles `CFGStmt` and `CFGInitializer`.

2022-08-16 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Analysis/FlowSensitive/CFGMatchSwitch.h:53-54 + template + CFGMatchSwitchBuilder CaseOfCFGStmt(MSMatcherT M, +

[PATCH] D131614: [clang][dataflow] Extend transfer functions for other `CFGElement`s

2022-08-16 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:144 llvm::Optional>>> -runDataflowAnalysis( +runDataflowAnalysisOnCFG( const C

[PATCH] D131616: [clang][dataflow] Generalise match switch utility to other AST types and add a `CFGMatchSwitch` which currently handles `CFGStmt` and `CFGInitializer`.

2022-08-11 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. LGTM so far, please finish the patch and tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131616/new/ https://reviews.llvm.org/D131616 ___ cfe-commits mailing list cfe-com

[PATCH] D131614: [clang][dataflow] Extend transfer functions for other `CFGElement`s

2022-08-11 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:103 + virtual void transferCFGElement(const CFGElement *Element, Lattice &L, + Environment &Env) {} + Instead of adding v

[PATCH] D130600: [clang][dataflow] Handle return statements

2022-07-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:110 + /// Assigns `Loc` as the storage location of `return`. + /// Comment at: clang/include/clang/Analysis/FlowSensitive/

[PATCH] D130270: [clang][dataflow] Use a dedicated bool to encode which branch was taken

2022-07-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 requested changes to this revision. gribozavr2 added a comment. This revision now requires changes to proceed. Sorry, could you rebase the patch? It does not apply cleanly anymore. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130270/new/

[PATCH] D130519: [clang][dataflow] Add explicit "AST" nodes for implications and iff

2022-07-26 Thread Dmitri Gribenko 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 rGb5e3dac33d42: [clang][dataflow] Add explicit "AST" nodes for implications and iff (authored by gribozavr). Changed prior to commit: https://review

[PATCH] D130519: [clang][dataflow] Add explicit "AST" nodes for implications and iff

2022-07-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Value.h:40-41 // Synthetic boolean values are either atomic values or composites that // represent conjunctions, disjunctions, and negations. AtomicBool, sga

[PATCH] D130522: [clang][dataflow] Fix SAT solver crashes on `X ^ X` and `X v X`

2022-07-26 Thread Dmitri Gribenko 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 rG3281138aad80: [clang][dataflow] Fix SAT solver crashes on `X ^ X` and `X v X` (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGE

[PATCH] D130522: [clang][dataflow] Fix SAT solver crashes on `X ^ X` and `X v X`

2022-07-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr updated this revision to Diff 447609. gribozavr added a comment. Actually visit a subexpression Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130522/new/ https://reviews.llvm.org/D130522 Files: clang/lib/Analysis/FlowSensitive/WatchedL

[PATCH] D130519: [clang][dataflow] Add explicit "AST" nodes for implications and iff

2022-07-25 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp:332 + + if (LeftSubVar == RightSubVar) { +// `X <=> (A <=> A)` is equvalent to `X` which is already in xazax.hun wrote: > xazax.hun wrote: > > I

[PATCH] D130519: [clang][dataflow] Add explicit "AST" nodes for implications and iff

2022-07-25 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr updated this revision to Diff 447484. gribozavr added a comment. Normalized more comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130519/new/ https://reviews.llvm.org/D130519 Files: clang/include/clang/Analysis/FlowSensitive/Data

[PATCH] D130522: [clang][dataflow] Fix SAT solver crashes on `X ^ X` and `X v X`

2022-07-25 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. BooleanFormula::addClause has an i

[PATCH] D130519: [clang][dataflow] Add explicit "AST" nodes for implications and iff

2022-07-25 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Previously we used to desugar impl

[PATCH] D130423: [clang][dataflow] Rename iterators from IT to It

2022-07-25 Thread Dmitri Gribenko 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 rGc0c9d717dfd2: [clang][dataflow] Rename iterators from IT to It (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D130423: [clang][dataflow] Rename iterators from IT to It

2022-07-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr updated this revision to Diff 447067. gribozavr added a comment. Reverted an unintended edit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130423/new/ https://reviews.llvm.org/D130423 Files: clang/lib/Analysis/FlowSensitive/DataflowAna

[PATCH] D130423: [clang][dataflow] Rename iterators from IT to It

2022-07-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The latter way to abbreviate is a

[PATCH] D130406: Use llvm::sort instead of std::sort where possible

2022-07-23 Thread Dmitri Gribenko 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 rGaba43035bdf8: Use llvm::sort instead of std::sort where possible (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D130403: Use the range-based overload of llvm::sort where possible

2022-07-23 Thread Dmitri Gribenko 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 rGcd9a5cfd2e4e: Use the range-based overload of llvm::sort where possible (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D130406: Use llvm::sort instead of std::sort where possible

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: bzcheeseman, sdasgup3, carlosgalvezp, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, usaxe

[PATCH] D130403: Use the range-based overload of llvm::sort where possible

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: carlosgalvezp, cishida, cmtice, usaxena95, kadircet, arphaman, mgrang. Herald added a reviewer: jhenderson. Herald added a reviewer: aaron.ballman. Herald added a reviewer: ributzka. Herald added a project: All. gribozavr requested review

[PATCH] D130398: [clang][dataflow] Add DataflowEnvironment::dump()

2022-07-22 Thread Dmitri Gribenko 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 rGb5414b566a5a: [clang][dataflow] Add DataflowEnvironment::dump() (authored by gribozavr). Changed prior to commit: https://reviews.llvm.org/D130398

[PATCH] D130399: [clang][dataflow] Expose stringification functions for SAT solver enums

2022-07-22 Thread Dmitri Gribenko 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 rGee6aba85aa48: [clang][dataflow] Expose stringification functions for SAT solver enums (authored by gribozavr). Changed prior to commit: https://re

[PATCH] D130400: [clang][dataflow] ArrayRef'ize debugString()

2022-07-22 Thread Dmitri Gribenko 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 rG589ddd7fe8e4: [clang][dataflow] ArrayRef'ize debugString() (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D130398: [clang][dataflow] Add Environment::dump()

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr updated this revision to Diff 446992. gribozavr added a comment. Reverted more changes broken out to separate revisions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130398/new/ https://reviews.llvm.org/D130398 Files: clang/include/cla

[PATCH] D130399: [clang][dataflow] Expose stringification functions for SAT solver enums

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr updated this revision to Diff 446991. gribozavr added a comment. Fix the build Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130399/new/ https://reviews.llvm.org/D130399 Files: clang/include/clang/Analysis/FlowSensitive/DebugSupport.h

[PATCH] D130400: [clang][dataflow] ArrayRef'ize debugString()

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monor

[PATCH] D130398: [clang][dataflow] Add Environment::dump()

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr updated this revision to Diff 446988. gribozavr added a comment. Moved some changes to a different revision Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130398/new/ https://reviews.llvm.org/D130398 Files: clang/include/clang/Analysis/

[PATCH] D130399: [clang][dataflow] Expose stringification functions for SAT solver enums

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: martong, tschuett, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monor

[PATCH] D130398: [clang][dataflow] Add Environment::dump()

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: martong, tschuett, mgrang, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Start by dumping the flow

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

2022-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:231 + // parameters still need to be given `StorageLocation`s anyway, so this code + // will need to be generalized later. + for (; ArgIt != ArgEnd; ++ParamIt, ++ArgIt) { ---

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

2022-07-21 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h:66 explicit DataflowAnalysis(ASTContext &Context) : Context(Context) {} explicit D

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DebugSupport.h:49-56 +debugString(std::vector &Constraints, Solver::Result &Result, +llvm::DenseMap AtomNames = {{}}); +inline std::string +debu

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-12 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp:33-34 + explicit DebugStringGenerator( + llvm::DenseMap UserSpecifiedAtomNames) + : Counter(0), AtomNames(std::move(UserSpecifiedAtomNames

[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

2022-07-12 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp:143 + +return formatv("{0:$[\n]}", llvm::make_range(Lines.begin(), Lines.end())); + } I appreciate the table, but it looks quite bulky... Could we switch to a sim

[PATCH] D129547: [clang][dataflow] Generate readable form of boolean values for debugging purposes.

2022-07-12 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DebugSupport.h:24-25 +namespace dataflow { +/// Utility functions which return a string representation for a boolean value +/// `B`. +/// Comment at: clan

[PATCH] D129546: [clang][dataflow] Refactor boolean creation as a test utility.

2022-07-12 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:223 +/// Utility class for creating boolean values. +class BoolValueManager { --

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread Dmitri Gribenko 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 rG19e21887eb18: [clang][dataflow] Return a solution from the solver when `Constraints` are… (authored by wyt, committed by gribozavr). Changed prior t

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Solver.h:67 +/// boolean formula if available. Otherwise, an empty optional is returned. +std::optional> +getSolution() const { Please use llvm::Optional, we can'

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-07 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:266 + /// - `Unsatisfiable`: A satisfying assignment does not exist. + /// - `

[PATCH] D129180: [clang][dataflow] Return a solution from the solver when `Constraints` are `Satisfiable`.

2022-07-06 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:263-267 + Possible return values are: + /// - `Satisfiable` : There exists a satisfying assignment for `Constraints`, + ///the solutio

[PATCH] D127114: new clang-tidy checker for assignments within condition clause of if statement

2022-07-05 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG05130a6ba7d9: new clang-tidy checker for assignments within condition clause of if statement (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D127114: new clang-tidy checker for assignments within condition clause of if statement

2022-07-05 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. Thanks! I'll commit this for you once you upload a refreshed patch (that applies to the main branch cleanly). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127114/new/ https://reviews.llvm.org/D127114 ___ cfe-comm

[PATCH] D127114: new clang-tidy checker for assignments within condition clause of if statement

2022-07-05 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-assignment-in-if-condition.cpp:84 + +// Add something that doesn't trigger the check here. +void awesome_f2(int arg) { CHANGES SINCE LAST ACTION https://review

[PATCH] D127114: new clang-tidy checker for assignments within condition clause of if statement

2022-07-05 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added a comment. This revision is now accepted and ready to land. LGTM with a few minor edits. Do you have commit access? Comment at: clang-tools-extra/clang-tidy/bugprone/AssignmentInIfConditionCheck.cpp:19-21 +void AssignmentInI

[PATCH] D129097: [clang][dataflow] Handle null pointers of type std::nullptr_t

2022-07-05 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:61 + auto CanonicalPointeeType = + PointeeType.isNull() ? PointeeType : PointeeType

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

2022-06-28 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp:67 +std::move(StmtDiagnostics.begin(), StmtDiagnostics.end(), + std::back_inserter(Diagnostics

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

2022-06-28 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h:78 +public: + UncheckedOptionalAccessDiagnosis( + ASTContext &AstContext, UncheckedOptionalAccessModelOptions O

[PATCH] D128659: [clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment`

2022-06-27 Thread Dmitri Gribenko 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 rGae90bc846758: [clang][dataflow] Add `buildAndSubstituteFlowCondition` to `DataflowEnvironment` (authored by wyt, committed by gribozavr). Repositor

[PATCH] D128658: [clang][dataflow] Do not allow substitution of true/false boolean literals in `buildAndSubstituteFlowCondition`

2022-06-27 Thread Dmitri Gribenko 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 rGfa34210fa69f: [clang][dataflow] Do not allow substitution of true/false boolean literals in… (authored by wyt, committed by gribozavr). Repository:

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb611376e7eb5: [clang][dataflow] Singleton pointer values for null pointers. (authored by wyt, committed by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D128056: [clang][dataflow] Singleton pointer values for null pointers.

2022-06-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:240-241 + // Index used to avoid recreating pointer values for null pointers of the + // same canonical pointee type. + // -

[PATCH] D128363: [clang][dataflow] Implement functionality for flow condition variable substitution.

2022-06-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbdfe556dd837: [clang][dataflow] Implement functionality for flow condition variable… (authored by wyt, committed by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D128359: [clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.

2022-06-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG12c7352fa488: [clang][dataflow] Move logic for `createStorageLocation` from… (authored by wyt, committed by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D128359: [clang][dataflow] Move logic for `createStorageLocation` from `DataflowEnvironment` to `DataflowAnalysisContext`.

2022-06-24 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:47 +/// Gets the set of all fields in the type. +llvm::DenseSet getObjectFields(QualType Type); Repository:

[PATCH] D128363: [clang][dataflow] Implement functionality for flow condition variable substitution.

2022-06-24 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:209 + /// `Substitutions`, it will be substituted with the value it maps to. + BoolValue &buildAndSubstituteFlowCondition( +

[PATCH] D128556: Make Objective-C++ match Objective-C's behavior on implicit ivar access when `self` is shadowed

2022-06-24 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. Please add a test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128556/new/ https://reviews.llvm.org/D128556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[PATCH] D128521: [clang][dataflow] Implement functionality to compare if two boolean values are equivalent.

2022-06-24 Thread Dmitri Gribenko 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 rG0f65a3e61005: [clang][dataflow] Implement functionality to compare if two boolean values are… (authored by wyt, committed by gribozavr). Repository:

[PATCH] D128520: [clang][dataflow] Refactor function that queries the solver for satisfiability checking.

2022-06-24 Thread Dmitri Gribenko 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 rG42a7ddb428c9: [clang][dataflow] Refactor function that queries the solver for satisfiability… (authored by wyt, committed by gribozavr). Repository

[PATCH] D128520: [clang][dataflow] Refactor function that queries the solver for satisfiability checking.

2022-06-24 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:224 + /// assignment for `Constraints` + bool checkUnsatisfiable(llvm::DenseSet Constraints) { +return querySolver(std::mov

[PATCH] D128519: [clang][dataflow] Move logic for creating implication and iff expressions into `DataflowAnalysisContext` from `DataflowEnvironment`.

2022-06-24 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG00e9d53453ab: [clang][dataflow] Move logic for creating implication and iff expressions into… (authored by wyt, committed by gribozavr). Changed prior to commit: https://reviews.llvm.org/D128519?vs=4397

[PATCH] D128357: [clang][dataflow] Store flow condition constraints in a single `FlowConditionConstraints` map.

2022-06-24 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfb88ea62602c: [clang][dataflow] Store flow condition constraints in a single… (authored by wyt, committed by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

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

2022-06-24 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp:1258 + + llvm::DenseSet AnnotationLines; + for

[PATCH] D128401: [clang-tidy] Fixing a bug raising false alarms on static local variables in the Infinite Loop Checker

2022-06-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:184-185 +const Decl *Func) { + bool containsFunc = false; + bool overlap = false; + gribozavr2 wrote: > It seems like you missed this

[PATCH] D128406: clang: Tweak behaviour of warn_empty_while_body and warn_empty_if_body

2022-06-23 Thread Dmitri Gribenko 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 rG37b881aa0bca: clang: Tweak behaviour of warn_empty_while_body and warn_empty_if_body (authored by gribozavr). Repository: rG LLVM Github Monorepo

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

2022-06-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 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; WD

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

2022-06-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 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, TypeErasedDataflowAnalysis &Analysis, +Di

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

2022-06-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Diagnosis.h:38 +template +llvm::DenseSet diagnoseCFG( +const ControlFlowContext &CFCtx, This function seems pretty general and not necessarily tied to diagnostics. WDYT

[PATCH] D128401: [clang-tidy] Fixing a bug raising false alarms on static local variables in the Infinite Loop Checker

2022-06-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:159 +llvm::SmallSet &Callees) { +if (const CallExpr *Call

[PATCH] D128363: [clang][dataflow] Implement functionality for flow condition variable substitution.

2022-06-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:163 +BoolValue &Val, +llvm::DenseMap &SubstitutionsCache) { + auto It = SubstitutionsCache.find(&Val); Could you refactor it into a free function?

[PATCH] D128183: [clang][dataflow] Extend flow condition in the body of a do/while loop

2022-06-20 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:3700 +EXPECT_TRUE(AfterLoopEnv.flowConditionImplies( +AfterLoopEnv.makeNot

[PATCH] D128060: [clang][dataflow] Extend flow condition in the body of a for loop

2022-06-17 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:3577-3580 +ASSERT_THAT(Results, ElementsAre(Pair("if_branch_1", _), +

[PATCH] D127886: [clang-tidy] Allow access to the SourceManager in clang-tidy checks

2022-06-15 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. Could you provide more context? There seems to be plenty of ways to access the SourceManager from a ClangTidy check, for example, see `clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D127745: [clang][dataflow] Rename `getPointeeLoc` to `getReferentLoc` for ReferenceValue.

2022-06-14 Thread Dmitri Gribenko 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 rG97d69cdaf324: [clang][dataflow] Rename `getPointeeLoc` to `getReferentLoc` for ReferenceValue. (authored by wyt, committed by gribozavr). Repository

[PATCH] D127312: [clang][dataflow] Remove IndirectionValue class, moving PointeeLoc field into PointerValue and ReferenceValue

2022-06-08 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa1b2b7d9790b: [clang][dataflow] Remove IndirectionValue class, moving PointeeLoc field into… (authored by wyt, committed by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D127312: [clang][dataflow] Remove IndirectionValue class, moving PointeeLoc field into PointerValue and ReferenceValue

2022-06-08 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp:63 -auto *IndVal2 = cast(Val2); -assert(IndVal1->getKind() == IndVal2->getKind()); -

[PATCH] D127196: [clang][dataflow] Enable use of synthetic properties on all Value instances.

2022-06-08 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG49ed5bf51958: [clang][dataflow] Enable use of synthetic properties on all Value instances. (authored by wyt, committed by gribozavr). Changed prior to commit: https://reviews.llvm.org/D127196?vs=435121&

<    1   2   3   4   5   6   7   8   9   10   >