[PATCH] D155895: Anonymous unions should be transparent wrt `[[clang::trivial_abi]]`.

2023-08-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 rGbddaa3517786: Anonymous unions should be transparent wrt `[[clang::trivial_abi]]`. (authored by gribozavr). Changed prior to commit:

[PATCH] D155895: Anonymous unions should be transparent wrt `[[clang::trivial_abi]]`.

2023-08-04 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/test/SemaCXX/attr-trivial-abi.cpp:258 + static_assert(__is_trivially_relocatable(TrivialAbiAttributeAppliedToAnonymousUnion), ""); +#endif +

[PATCH] D156728: [Sema] Ignore nullability qualifiers when deducing types for `auto` and `__auto_type`

2023-08-04 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:3933 // type are ignored for type deduction. + // Ignore top level nullability qualifiers too. ArgType = ArgType.getUnqualifiedType(); ahatanak wrote: >

[PATCH] D156728: [Sema] Ignore nullability qualifiers when deducing types for `auto` and `__auto_type`

2023-07-31 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. I understand that this is an expedient fix that silences the warning. However, the fundamental problem is the simplistic implementation of the warning (that it is not flow-sensitive), not the inference of nullability. That is, when we are removing nullability

[PATCH] D155895: Anonymous unions should be transparent wrt `[[clang::trivial_abi]]`.

2023-07-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. @lukasza I think you forgot to upload an updated version of the patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155895/new/ https://reviews.llvm.org/D155895 ___

[PATCH] D155890: [clang-tidy] Add folly::Optional to unchecked-optional-access

2023-07-21 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:62 +return N != nullptr && (isTopLevelNamespaceWithName(*N, "base") || +isTopLevelNamespaceWithName(*N, "folly")); }

[PATCH] D155890: [clang-tidy] Add folly::Optional to unchecked-optional-access

2023-07-21 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. In D155890#4523243 , @adukeman wrote: > In D155890#4522266 , @ymandel wrote: > >> In D155890#4521266 , >> @carlosgalvezp wrote: >> >>> This

[PATCH] D155895: Anonymous unions should be transparent wrt `[[clang::trivial_abi]]`.

2023-07-21 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:10325 - for (const auto *FD : RD.fields()) { -// Ill-formed if the field is an ObjectiveC pointer or of a type that is -// non-trivial for the purpose of calls. -QualType FT =

[PATCH] D155890: [clang-tidy] Add folly::Optional to unchecked-optional-access

2023-07-20 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. Thank you! Do you have commit access or do you need me to commit this patch for you? Comment at:

[PATCH] D155506: [clang][JumpDiagnostics] use StmtClass rather than dyn_cast chain NFC

2023-07-17 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. I'm not sure it is actually an anti-pattern. `dyn_cast` will transparently handle subclasses, should any be added in the future, but a switch wouldn't. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155506/new/

[PATCH] D155202: [clang][dataflow] Simplify implementation of `transferStdForwardCall()` in optional check.

2023-07-13 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/Models/UncheckedOptionalAccessModel.cpp:683 - StorageLocation *LocRet = State.Env.getStorageLocation(*E,

[PATCH] D154948: [dataflow] improve determinism of generated SAT system

2023-07-11 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/DeterminismTest.cpp:62 +}; +struct Tree{ + int height(); Repository: rG

[PATCH] D154935: [clang][dataflow] Introduce `getFieldValue()` test helpers.

2023-07-11 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/DataflowEnvironmentTest.cpp:27 using namespace dataflow; +using test::getFieldValue; using

[PATCH] D154339: [clang][dataflow] Make `runDataflowReturnError()` a non-template function.

2023-07-04 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:389 /// verify the results. -template -llvm::Error -runDataflowReturnError(llvm::StringRef Code, VerifyResultsT VerifyResults, - DataflowAnalysisOptions

[PATCH] D154339: [clang][dataflow] Make `runDataflowReturnError()` a non-template function.

2023-07-04 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:389 /// verify the results. -template -llvm::Error -runDataflowReturnError(llvm::StringRef Code, VerifyResultsT VerifyResults, - DataflowAnalysisOptions

[PATCH] D154339: [clang][dataflow] Make `runDataflowReturnError()` a non-template function.

2023-07-03 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:389 /// verify the results. -template -llvm::Error -runDataflowReturnError(llvm::StringRef

[PATCH] D153006: [clang][dataflow] Perform deep copies in copy and move operations.

2023-07-03 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/RecordOps.h:26 +/// fields of record type. It also copies properties from the `StructValue` +/// associated with `Dst` to the `StructValue` associated with `Src` (if these +///

[PATCH] D153805: Expose DataflowAnalysisContext.querySolver().

2023-06-30 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 rG3b29b8a2aba2: Expose DataflowAnalysisContext.querySolver(). (authored by bazuzi, committed by gribozavr). Repository: rG LLVM Github Monorepo

[PATCH] D153485: [dataflow] use true/false literals in formulas, rather than variables

2023-06-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Formula.h:71 + bool literal() const { +assert(kind() == Literal); castAsLiteral() ? Comment at:

[PATCH] D153469: [dataflow] Replace most BoolValue subclasses with references to Formula (and AtomicBoolValue => Atom and BoolValue => Formula where appropriate)

2023-06-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/include/clang/Analysis/FlowSensitive/Arena.h:61 + /// Passing in the same formula will result in the same BoolValue. + /// FIXME: This

[PATCH] D153366: [dataflow] Add dedicated representation of boolean formulas

2023-06-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/include/clang/Analysis/FlowSensitive/Formula.h:27 +/// +/// This often represents an assertion that is interesting to the analysis but +///

[PATCH] D153805: Expose DataflowAnalysisContext.querySolver().

2023-06-30 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:183 + /// been stored in flow conditions. + Solver::Result querySolver(llvm::DenseSet Constraints); +

[PATCH] D153852: [clang][dataflow] Initialize fields of anonymous records correctly.

2023-06-28 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/TypeErasedDataflowAnalysis.cpp:356 + Member = cast(I); + MemberLoc = (MemberLoc)->getChild(*Member); +

[PATCH] D153960: [clang][dataflow] Implement support for pointers to members.

2023-06-28 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. Using PointerValue to model pointers to data members does not look right to me, because a pointer to data member is an offset within an object that we apply this pointer to,

[PATCH] D153491: [dataflow] Avoid copying environment

2023-06-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153491/new/ https://reviews.llvm.org/D153491 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D153476: [dataflow] document & test determinism of formula structure

2023-06-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/ArenaTest.cpp:165-169 + auto = A.create(); + auto = A.create(); + auto = A.makeAnd(BX, BY); + auto = A.makeOr(BY, BX); + auto = A.makeEquals(BOr, BAnd);

[PATCH] D153476: [dataflow] document & test determinism of formula structure

2023-06-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/ArenaTest.cpp:169 + auto = A.makeOr(BY, BX); + auto = A.makeEquals(BOr, BAnd); + EXPECT_EQ(Expected, llvm::to_string(B.getFormula(BEqual))); Shouldn't these lines use

[PATCH] D153409: [clang][dataflow] Treat fields of anonymous records as being part of their parent.

2023-06-21 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:305 +if (Field->isAnonymousStructOrUnion()) + getFieldsFromClassHierarchy(Field->getType(), Fields); +else

[PATCH] D152813: [clang][dataflow] Create `Value`s for integer literals.

2023-06-15 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Arena.h:89 + /// `Value`. These literals are the same every time. + IntegerValue (llvm::APInt Value); + Should we be taking the type

[PATCH] D152813: [clang][dataflow] Create `Value`s for integer literals.

2023-06-14 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. In D152813#4420448 , @mboehme wrote: > We would expect analysis of this code to converge too -- right? Yes - but we might need universal top values for that? maybe? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D152813: [clang][dataflow] Create `Value`s for integer literals.

2023-06-14 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. In D152813#4420399 , @mboehme wrote: > It looks to me as if the values we're now newly producing for integer > literals are causing non-convergence of the analysis on the for-loop. For integer literals specifically, we

[PATCH] D152732: [clang][dataflow] Support limits on the SAT solver to force timeouts.

2023-06-12 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h:37 + // measurements like CPU cycles or time to ensure deterministic results. + std::int64_t MaxIterations = std::numeric_limits::max(); +

[PATCH] D151818: [clang][analyzer][NFC] Use the operator new directly with the `BumpPtrAllocator`

2023-05-31 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 rG7ebf64f7e934: [clang][analyzer][NFC] Use the operator new directly with the `BumpPtrAllocator` (authored by gribozavr). Repository: rG LLVM

[PATCH] D151818: [clang][analyzer][NFC] Use the operator new directly with the `BumpPtrAllocator`

2023-05-31 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr updated this revision to Diff 527115. gribozavr added a comment. Format the edits Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151818/new/ https://reviews.llvm.org/D151818 Files: clang/lib/Analysis/CFG.cpp

[PATCH] D151818: [clang][analyzer][NFC] Use the operator new directly with the `BumpPtrAllocator`

2023-05-31 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. gribozavr added reviewers: NoQ, steakhal. Herald added subscribers: manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. gribozavr requested review of this

[PATCH] D151727: [clang][analyzer][NFC] Replace dyn_cast with cast in MemRegion::getMemorySpace

2023-05-30 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 rG8a40f89e2e93: [clang][analyzer][NFC] Replace dyn_cast with cast in MemRegion::getMemorySpace (authored by gribozavr). Repository: rG LLVM Github

[PATCH] D151725: [clang][analyzer][NFC] Move dyn_cast's into if statements for readability

2023-05-30 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 rG0989ce947e3d: [clang][analyzer][NFC] Move dyn_casts into if statements for readability (authored by gribozavr). Repository: rG LLVM Github

[PATCH] D151723: [clang][analyzer][NFC] Remove unnecessary FALLTHROUGH markers

2023-05-30 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 rGdaa95c7de5b7: [clang][analyzer][NFC] Remove unnecessary FALLTHROUGH markers (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D151726: [clang][analyzer][NFC] Remove unnecessary casts around Allocate function calls

2023-05-30 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 rG0da99ffe1afc: [clang][analyzer][NFC] Remove unnecessary casts around Allocate function calls (authored by gribozavr). Repository: rG LLVM Github

[PATCH] D151727: [clang] Replace dyn_cast with cast in MemRegion::getMemorySpace

2023-05-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. gribozavr added a reviewer: NoQ. Herald added subscribers: steakhal, martong. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. MemRegion::getMemorySpace() is annotated

[PATCH] D151726: [clang] Remove unnecessary casts around Allocate function calls

2023-05-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. gribozavr added a reviewer: NoQ. Herald added subscribers: steakhal, martong. 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

[PATCH] D151725: [clang] Move dyn_cast's into if statements for readability

2023-05-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. gribozavr added a reviewer: NoQ. Herald added subscribers: steakhal, martong. 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

[PATCH] D151723: [clang] Remove unnecessary FALLTHROUGH markers

2023-05-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. gribozavr added a reviewer: NoQ. Herald added subscribers: steakhal, martong. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. They are redundant with the

[PATCH] D151192: [clang-tidy] have bugprone-unchecked-optional-access check boost::optional usage

2023-05-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. The mock optional types in the unit test are just declarations of the API - they don't need any implementations (function or method bodies should be omitted). But the declarations of classes, methods, and functions should mirror the production header closely. There

[PATCH] D151192: [clang-tidy] have bugprone-unchecked-optional-access check boost::optional usage

2023-05-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. Could you change the tests to cover the new case? They are here: `llvm-project/clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151192/new/

[PATCH] D151071: [clang][dataflow] Fix a null pointer crash in `computeBlockInputState()`.

2023-05-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. LGTM too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151071/new/ https://reviews.llvm.org/D151071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D150352: [clang][dataflow] Don't analyze templated declarations.

2023-05-11 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:2537 -TEST(TransferTest, DerefDependentPtr) { std::string Code = R"( This `DerefDependentPtr` test was originally added in

[PATCH] D150352: [clang][dataflow] Don't analyze templated declarations.

2023-05-11 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:36 + /// `S` resides. `D.isTemplated()` must be false. + static llvm::Expected build(const Decl , Stmt , +

[PATCH] D150071: [clang-tidy] Fix bugprone-assert-side-effect to actually give warnings

2023-05-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-tools-extra/test/clang-tidy/checkers/bugprone/Inputs/assert-side-effect/assert.h:1 +int abort() { return 0; } + There should

[PATCH] D142991: [clang-tidy] Add --fix-mode and --nolint-prefix options

2023-05-05 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Herald added a subscriber: PiotrZSL. Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:58 + (Lexer::getIndentationForLine(Loc, Loc.getManager()) + "/* " + + NoLintPrefix + "NOLINTNEXTLINE(" +

[PATCH] D149144: [clang][dataflow] Eliminate intermediate `ReferenceValue`s from `Environment::DeclToLoc`.

2023-05-04 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. LGTM still. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D149144/new/ https://reviews.llvm.org/D149144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-02 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:2641 TEST(TransferTest, VarDeclInDoWhile) { std::string Code = R"( Could you update the test name to reflect what the test is checking now? (the comment

[PATCH] D149640: [clang][dataflow] Change PruneTriviallyFalseEdges for building CFG

2023-05-02 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. Is it testable? For example, can we show that we don't compute the program state for the program point "p" here: void f() { while (true) { } /*p*/ } Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D149144: [clang][dataflow] Eliminate intermediate `ReferenceValue`s from `Environment::DeclToLoc`.

2023-04-25 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/TypeErasedDataflowAnalysis.cpp:43 +namespace { + mboehme wrote: > There were a number of

[PATCH] D148554: [dataflow] Extract arena for Value/StorageLocation out of DataflowAnalysisContext

2023-04-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/include/clang/Analysis/FlowSensitive/Arena.h:15-16 + +// The Arena owns the objects that model data within an analysis. +// Currently this is

[PATCH] D148377: [clang][dataflow] Drop optional model's dependency on libc++ internals.

2023-04-17 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added a comment. Nice deduplication and compatibility fixes! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148377/new/ https://reviews.llvm.org/D148377 ___

[PATCH] D146591: [dataflow] add HTML logger: browse code/cfg/analysis timeline/state

2023-04-11 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/HTMLLogger.js:47-50 +for (tmpl of root.getElementsByTagName('template')) { + // Clear previously rendered

[PATCH] D147698: [clang][dataflow] Add support for new and delete expressions.

2023-04-11 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. In D147698#4257698 , @mboehme wrote: > @gribozavr2 Just to make sure I understand you correctly here (before I make > any changes to the code): IIUC you recommend simply doing nothing on a delete > expression? (Your

[PATCH] D147698: [clang][dataflow] Add support for new and delete expressions.

2023-04-06 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Value.h:315 + /// `D` must currently be associated with a value. + void unsetChild(const ValueDecl ) { +auto It = Children.find(); Modifying already-created values is

[PATCH] D146591: [dataflow] add HTML logger: browse code/cfg/analysis timeline/state

2023-03-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/HTMLLogger.html:19 +Function + + sammccall wrote: > gribozavr2 wrote: > > Could you add the file name and line number of the start location of the > > function? > > > > It might be

[PATCH] D146591: [dataflow] add HTML logger: browse code/cfg/analysis timeline/state

2023-03-27 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/HTMLLogger.cpp:34 +// the data into tags embedded in the HTML. (see inflate() in JS). +// +// SELECTION Comment at:

[PATCH] D146591: [dataflow] add HTML logger: browse code/cfg/analysis timeline/state

2023-03-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. Could you upload an updated sample HTML file? It is easier to review the HTML generation and javascript code when an example is available. Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp:388 +std::unique_ptr flagLogger()

[PATCH] D146591: [dataflow] add HTML logger: browse code/cfg/analysis timeline/state

2023-03-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Logger.h:34 static std::unique_ptr textual(llvm::raw_ostream &); + // A logger that builds an HTML UI to inspect the analysis results. + // One file is written under the specified dir

[PATCH] D146507: [clang][dataflow][NFC] Eliminate StmtToEnvMap interface.

2023-03-22 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Transfer.h:35 + /// The result is guaranteed never to be null. + virtual const Environment *getEnvironment(const Stmt ) const { +auto BlockIt =

[PATCH] D146514: [clang][dataflow] Fix crash when RHS of `&&` or `||` calls `noreturn` func.

2023-03-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/unittests/Analysis/FlowSensitive/TestingSupport.h:399 +template +ValueT (ASTContext , const Environment , +

[PATCH] D146507: [clang][dataflow][NFC] Eliminate StmtToEnvMap interface.

2023-03-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/Transfer.h:31 - /// there isn't one. - /// FIXME: Ensure that the result can't be null and return a

[PATCH] D144987: [clang][dataflow] Fix missed fields in field set construction.

2023-03-20 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp:141 + }; + S foo(); + )cc"; ymandel wrote: > gribozavr2 wrote: > > Is `foo()` used for anything in this test? > not that I can see. looks

[PATCH] D144987: [clang][dataflow] Fix missed fields in field set construction.

2023-03-20 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp:141 + }; + S foo(); + )cc"; Is `foo()` used for anything in this test? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D144730: [FlowSensitive][WIP] log analysis progress for debugging purposes

2023-03-09 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/Logger.h:22 + +// A logger is notified as the analysis progresses. +// It can produce a report of the analysis's findings and how it came to them. Elsewhere under

[PATCH] D144480: [C++20][ClangTidy] Update the ClangTidy tests to also test in C++20 mode

2023-03-02 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-type-member-init-cxx98.cpp:2 // RUN: %check_clang_tidy -std=c++98 %s

[PATCH] D142799: [Clang] Fix unconditional access to Attr pointer when checking if _Nullable is applicable to a type

2023-01-30 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. Comment at: clang/docs/ReleaseNotes.rst:60 `Issue 59446 `_. +- Fix crash when diagnosing incorrect usage of _Nullable involing alias + templates. This

[PATCH] D142799: [Clang] Fix unconditional access to Attr pointer when checking if _Nullable is applicable to a type

2023-01-30 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. Thank you for the fix! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142799/new/ https://reviews.llvm.org/D142799 ___ cfe-commits

[PATCH] D142637: A slightly more concise AST dump :)

2023-01-26 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/test/AST/ast-dump-attr-type.cpp:12 +// CHECK-NEXT:`-BuiltinType 0x{{[^ ]*}} 'int' +// CHECK-NOT: `-PointerType 0x564c31a07520 'int *' sammccall wrote: > Can you add a second example where the

[PATCH] D142560: Allow getRawCommentForDecl to find comments in macros

2023-01-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 rG8bb54da5da31: Allow getRawCommentForDecl to find comments in macros (authored by danakj, committed by gribozavr). Repository: rG LLVM Github

[PATCH] D141709: [clang][dataflow] Fix bug in joining bool values.

2023-01-20 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141709/new/ https://reviews.llvm.org/D141709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D140859: [clang][dataflow] Allow analyzing multiple functions in unit tests

2023-01-20 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 rGc8b31da1ef0a: [clang][dataflow] Allow analyzing multiple functions in unit tests (authored by gribozavr). Repository: rG LLVM Github Monorepo

[PATCH] D140859: [clang][dataflow] Allow analyzing multiple functions in unit tests

2023-01-20 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp:59 +if (SM.isPointWithin(Loc, BoundingRange.getBegin(), + BoundingRange.getEnd())) { + LineNumberToContent[SM.getPresumedLineNumber(Loc)] =

[PATCH] D140859: [clang][dataflow] Allow analyzing multiple functions in unit tests

2023-01-20 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr updated this revision to Diff 491003. gribozavr added a comment. Address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140859/new/ https://reviews.llvm.org/D140859 Files:

[PATCH] D141105: [OpenMP] Add support for '--offload-arch=native' to OpenMP offloading

2023-01-12 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. FYI: I fixed the problem in https://github.com/llvm/llvm-project/commit/0a11a1b1868dd2ab183c4313ccbfbe126e91ca08. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141105/new/ https://reviews.llvm.org/D141105

[PATCH] D141384: [clang][dataflow] Fix 2 bugs in `MemberExpr` interpretation.

2023-01-10 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141384/new/ https://reviews.llvm.org/D141384 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D141283: [clang] Improve diagnostic for "initializer-string for char array is too long"

2023-01-10 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. In D141283#4038703 , @tbaeder wrote: > When grepping `clang/test/` for "for char array is too long", I get a bunch > of other hits for this diagnostic, are the those tests not failing for you > (e.g.

[PATCH] D141158: [OpenMP] Introduce '-f[no-]openmp-target-jit' flag to control JIT for offloading

2023-01-09 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141158/new/ https://reviews.llvm.org/D141158 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D141158: [OpenMP] Introduce '-f[no-]openmp-target-jit' flag to control JIT for offloading

2023-01-09 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. The newly added test fails when `tools/clang/include/clang/Config/config.h` is configured with `#define CLANG_DEFAULT_OPENMP_RUNTIME "libgomp"`. Please fix. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140859: [clang][dataflow] Allow analyzing multiple functions in unit tests

2023-01-02 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. Herald added subscribers: martong, xazax.hun. Herald added a project: All. gribozavr requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. In unit tests for concrete dataflow analyses we typically use the

[PATCH] D140753: [clang][dataflow] Fix crash when having boolean-to-integral casts.

2022-12-29 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:97-106 +// FIXME: This is sort of workaround. Since now we just ignore all (implicit) +

[PATCH] D140696: [clang][dataflow] Treat unions as structs.

2022-12-29 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added a comment. > With this change, unions are modeled exactly as structs (as far as I can > tell), which is unsound. Modeling just the storage of the union (but not the value) is sound. The first revision of the patch was a targeted fix that allowed us to continue maintaining the

[PATCH] D140753: [clang][dataflow] Check both operand's type in mergeDistinctValues

2022-12-29 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. Thank you for your contribution! While adding a conditional check fixes the crash, the problem's root cause must be deeper. Mismatched types indicate that one code path in

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

2022-12-28 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/TypeErasedDataflowAnalysis.h:35 struct DataflowAnalysisOptions { - /// Options for the built-in

[PATCH] D140694: [clang][dataflow] Only model struct fields that are used in the function being analyzed.

2022-12-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/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:147-148 + // Returns the subset of fields of `Type` that are referenced in

[PATCH] D140625: [clang] Remove deprecated ControlFlowContext::build()

2022-12-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 rGd27386384a2a: [clang] Remove deprecated ControlFlowContext::build() (authored by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D140625: [clang] Remove deprecated ControlFlowContext::build()

2022-12-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. gribozavr added a reviewer: merrymeerkat. 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

[PATCH] D140620: [clang] Migrate away from a deprecated Clang CFG factory function

2022-12-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 rG3a39b0ac1a72: [clang] Migrate away from a deprecated Clang CFG factory function (authored by gribozavr). Repository: rG LLVM Github Monorepo

[PATCH] D140620: [clang] Migrate away from a deprecated Clang CFG factory function

2022-12-23 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr created this revision. gribozavr added a reviewer: merrymeerkat. Herald added a subscriber: carlosgalvezp. Herald added a reviewer: njames93. Herald added a project: All. gribozavr requested review of this revision. Herald added projects: clang, clang-tools-extra. Herald added a

[PATCH] D140501: [clang][dataflow] Account for global variables in constructor initializers.

2022-12-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/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp:112 + const auto *Var = selectFirst("global", Results); + ASSERT_TRUE(Fun !=

[PATCH] D140104: [clang][dataflow] Remove unused argument in getNullability

2022-12-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 rG0da4cecfb6ad: [clang][dataflow] Remove unused argument in getNullability (authored by merrymeerkat, committed by gribozavr). Repository: rG LLVM

[PATCH] D140104: [clang][dataflow] Remove unused argument in getNullability

2022-12-15 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/include/clang/AST/Type.h:2550 /// be lost by canonicalization and desugaring. - Optional getNullability(const ASTContext ) const; + Optional getNullability() const; Could you add a temporary deprecated

[PATCH] D140037: [clang][dataflow] Remove old diagnoser API

2022-12-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 rG4ca1ae580b0c: [clang][dataflow] Remove old diagnoser API (authored by merrymeerkat, committed by gribozavr). Repository: rG LLVM Github Monorepo

[PATCH] D139868: [clang][dataflow] Change the diagnoser API to receive a correctly typed lattice element

2022-12-13 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 rG82d50fef9b7c: [clang][dataflow] Change the diagnoser API to receive a correctly typed latticeā€¦ (authored by merrymeerkat, committed by gribozavr).

[PATCH] D137584: Add const information about AST nodes used to construct CFG elements.

2022-11-08 Thread Dmitri Gribenko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3c50f0d879bf: Add const information about AST nodes used to construct CFG elements. (authored by merrymeerkat, committed by gribozavr). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D137334: [clang][dataflow] Generalize custom comparison to return tri-value result.

2022-11-03 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/DataflowEnvironment.h:73-74 +/// Returns: +/// `Same`:`Val1` is equivalent to `Val2`, according

  1   2   3   4   5   6   7   8   9   10   >