[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. tomasz-kaminski-sonarsource marked an inline comment as done. Closed by commit rG587b8f323d2d: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

[PATCH] D155847: [analyzer] Fix crash in GenericTaintChecker when propagatig taint to AllocaRegion

2023-07-24 Thread Tomasz Kamiński 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 rG438fc2c83b73: [analyzer] Fix crash in GenericTaintChecker when propagatig taint to… (authored by tomasz-kaminski-sonarsource). Repository: rG

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:6 +// that has non-trivial destructor. As the behavior for such types is different +// from ones with trivial

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 543407. tomasz-kaminski-sonarsource added a comment. Updated text of FIXME Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155694/new/ https://reviews.llvm.org/D155694 Files:

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-21 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 542779. tomasz-kaminski-sonarsource added a comment. Added generic FIXME comment for covering test cases for types with trivial destructor. This affects nearly all tests cases from file, so some tought needs to be put on how to apporach

[PATCH] D155847: [analyzer] Fix crash in GenericTaintChecker when propagatig taint to AllocaRegion

2023-07-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. I belive this fix to be the correct approach, as it reduces the number of edge cases to deal with. We are using it on internal fork for over a year know, and haven't found any negative impact. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D155847: [analyzer] Fix crash in GenericTaintChecker when propagatig taint to AllocaRegion

2023-07-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All.

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked 2 inline comments as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:1 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=debug.DumpCFG -analyzer-config

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Updating this tests illustrated that we are missing a lot of coverage for the objects with trivial destructors, but I think this should be addressed as a separate patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D155694: [NFC][analyzer] Enable implicit destructor for cfg-lifetime tests

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: manas, steakhal, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:1 // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=debug.DumpCFG -analyzer-config

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-19 Thread Tomasz Kamiński 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 rGc3dd2f35b876: [analyzer] Model lifetime of a variable declared in for condition in CFG… (authored by tomasz-kaminski-sonarsource). Repository: rG

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:3511 // go in this block as well. Block = Succ = TransitionBlock = createBlock(false);

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/auto-obj-dtors-cfg-output.cpp:1231 A a; - for (A b; A c = b; ) { + for (A b; A c = b; ++c.x) { A d; xazax.hun wrote: > Would there be any value in also keeping a couple

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 541519. tomasz-kaminski-sonarsource added a comment. Updated unit tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155547/new/ https://reviews.llvm.org/D155547 Files:

[PATCH] D155547: [analyzer] Model lifetime of a variable declared in for condition in CFG correctly

2023-07-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:609 // CHECK-NEXT:1: [B9.2] (Lifetime ends) // CHECK-NEXT:T: continue; // CHECK-NEXT:Preds (1): B7 Note that the lifetime ends for

[PATCH] D155442: [analyzer] Bind return value for assigment and copies of trivial empty classes

2023-07-18 Thread Tomasz Kamiński 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 rG61760bb98c46: [analyzer] Bind return value for assigment and copies of trivial empty classes (authored by tomasz-kaminski-sonarsource). Changed

[PATCH] D155547: CPP-4580 Model lifetime of a variable declared in for condition in CFG correctly

2023-07-18 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Per [stmt.for] p1

[PATCH] D153273: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-07-17 Thread Tomasz Kamiński 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 rGd937836ead34: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements (authored by tomasz-kaminski-sonarsource). Repository:

[PATCH] D153273: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-07-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked 2 inline comments as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/nonreturn-destructors-cfg-output.cpp:99 +// +// CHECK: [B2 (NORETURN)] +// CHECK-NEXT:1: [B3.3].~A() (Implicit destructor)

[PATCH] D153273: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-07-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/lifetime-cfg-output.cpp:760 // CHECK-NEXT:2: [B1.1]++ -// CHECK-NEXT:3: [B2.2] (Lifetime ends) -// CHECK-NEXT:4: [B3.1]

[PATCH] D155442: [analyzer] Bind return value for assigment and copies of trivial empty classes

2023-07-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All.

[PATCH] D155084: [analyzer] Fix crash in MoveChecker when it tries to report duplicate issue

2023-07-13 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd172b65ef001: [analyzer] Fix crash in MoveChecker when it tries to report duplicate issue (authored by arseniy-sonar, committed by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo

[PATCH] D155084: [analyzer] Fix crash in MoveChecker when it tries to report duplicate issue.

2023-07-12 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All.

[PATCH] D153273: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-07-12 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 539529. tomasz-kaminski-sonarsource marked 5 inline comments as done. tomasz-kaminski-sonarsource added a comment. Switched to ranges when applicable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D153273: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-07-12 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/Analysis/CFG.cpp:1936-1938 +for (LocalScope::const_iterator I = DstPos; I != BasePos; ++I) + if (I.pointsToFirstDeclaredVar()) +appendScopeBegin(Block, *I, S); steakhal

[PATCH] D153273: [analyzer] Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-07-12 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 539470. tomasz-kaminski-sonarsource marked 3 inline comments as done. tomasz-kaminski-sonarsource added a comment. Apply review suggestion and replaced make_scope_exit with SaveAndRestore that was already used in file. Repository: rG

[PATCH] D154827: [analyzer] NonParamVarRegion should prefer definition over canonical decl

2023-07-10 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource accepted this revision. tomasz-kaminski-sonarsource added a comment. This revision is now accepted and ready to land. Looks good. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154827/new/

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. tomasz-kaminski-sonarsource marked an inline comment as done. Closed by commit rGfeafbb9fda57: [analyzer] Differentiate lifetime extended temporaries (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp:556 + bool IsLocal = + isa_and_nonnull(MR) && + isa(MR->getMemorySpace());

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 537092. tomasz-kaminski-sonarsource added a comment. Reformatting and link to revelant core issue. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151325/new/ https://reviews.llvm.org/D151325

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added a comment. In D151325#4470832 , @xazax.hun wrote: > Overall looks good to me. I think the changes to the notes already make the > analyzer more useful so

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-07-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:1282 + LLVM_ATTRIBUTE_RETURNS_NONNULL + const Expr *getExpr() const { return Ex; } +

[PATCH] D153273: CPP-4465 Rework support for CFGScopeBegin, CFGScopeEnd, CFGLifetime elements

2023-06-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch reworks generation for the

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-06-01 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 527291. tomasz-kaminski-sonarsource added a comment. Rebasing on main Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151325/new/ https://reviews.llvm.org/D151325 Files:

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-05-31 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 527027. tomasz-kaminski-sonarsource added a comment. Added function to query stack frame for temporary object. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151325/new/

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-05-26 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 525978. tomasz-kaminski-sonarsource added a comment. Fixed formatting to match clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151325/new/ https://reviews.llvm.org/D151325

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-05-26 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 525961. tomasz-kaminski-sonarsource added a comment. Remove excessive reformating Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151325/new/ https://reviews.llvm.org/D151325 Files:

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-05-26 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 525950. tomasz-kaminski-sonarsource added a comment. Updated MoveChecker to handle CXXLifetimeExtendedObjects Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151325/new/

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-05-25 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. In D151325#4374326 , @NoQ wrote: > I totally support this! There's no reason why the region wouldn't carry such > information. > > This patch is surprisingly tiny, but this matches my grep observations: >

[PATCH] D151325: [analyzer] Differentiate lifetime extended temporaries

2023-05-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All.

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-27 Thread Tomasz Kamiński 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 rGa826b9034bbd: [clang] source range of variable template specialization should include… (authored by tomasz-kaminski-sonarsource). Repository: rG

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-27 Thread Tomasz Kamiński 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 rG4a9dc94d336a: [clang] Test for AST Dumping of the template variables (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. In D146733#4219448 , @erichkeane wrote: > LGTM! Let me know if you need someone to commit this for you, and include > "Name To Use " I have commit rights, but I will not be able to commit this before

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 508105. tomasz-kaminski-sonarsource added a comment. Rebasing on test commit. My applogies for noise, I still get confused with arc sometimes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 508104. tomasz-kaminski-sonarsource added a comment. Reintroduced bug commit refernces. Sorry for the noise, but I still sometimes get confused with arc. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 508102. tomasz-kaminski-sonarsource added a comment. Reverted accidentally included changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146784/new/ https://reviews.llvm.org/D146784

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 508091. tomasz-kaminski-sonarsource added a comment. Rebased on updated test commit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146784/new/ https://reviews.llvm.org/D146784 Files:

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 508088. tomasz-kaminski-sonarsource added a comment. Updated FIXME with GitHub bug reference. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146784/new/ https://reviews.llvm.org/D146784

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. This is now tracked as https://github.com/llvm/llvm-project/issues/61680. Let me know if I should refer it in the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146784/new/

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 508081. tomasz-kaminski-sonarsource added a comment. Updated release note to be more descriptive. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146733/new/ https://reviews.llvm.org/D146733

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 508077. tomasz-kaminski-sonarsource added a comment. Including release note Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146733/new/ https://reviews.llvm.org/D146733 Files:

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/AST/ast-dump-template-decls.cpp:193 +// DIRECT: VarTemplateSpecializationDecl 0x{{[^ ]*}} col:5 unTempl 'int' +// SERIALIZED: VarTemplateSpecializationDecl 0x{{[^ ]*}} col:5 unTempl 'int' +//

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 508076. tomasz-kaminski-sonarsource added a comment. Added FIXME Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146784/new/ https://reviews.llvm.org/D146784 Files:

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 507975. tomasz-kaminski-sonarsource added a comment. Adding tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146733/new/ https://reviews.llvm.org/D146733 Files:

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 507973. tomasz-kaminski-sonarsource added a comment. Merged indidictal check lines Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146784/new/ https://reviews.llvm.org/D146784 Files:

[PATCH] D139705: [clang] fix zero-initialization fix-it for variable template

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. While creating a test for the fix, I noticed the getSourceRange behavior is not stable after the serialization, as illustrated here: https://reviews.llvm.org/D146784 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. I do not plan to address the behavior in case of a variable without initializer. Creating separate PR to illustrate that is not a regression from my change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D146784: [clang] Test for AST Dumping of the template variables

2023-03-24 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. They illustrate unstable behavior of the https://reviews.llvm.org/D139705 after

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. I have updated the description and implementation. Will look at adding a unit test tomorrow. Comment at: clang/lib/AST/DeclTemplate.cpp:1467 +SourceRange VarTemplatePartialSpecializationDecl::getSourceRange() const { + if (const

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 507784. tomasz-kaminski-sonarsource edited the summary of this revision. tomasz-kaminski-sonarsource added a comment. Simpified condition Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. In D146733#4216931 , @erichkeane wrote: > This needs a test and a release note. Patch otherwise looks fine to me. Do you have any pointers for a test of source ranges? The patch that caused regression used

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 507776. tomasz-kaminski-sonarsource added a comment. Comments no longer misleading reffer to fallback to DeclatorDecl Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146733/new/

[PATCH] D139705: [clang] fix zero-initialization fix-it for variable template

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. >> Indeed, this would address our concern, and allow properly inserting >> initializer. This would build down to repeating the condition from here: >>

[PATCH] D146733: [clang] source range of variable template specialization should include initializer

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch adjust the getSourceRange() for the VarTemplateSpecializationDecl and

[PATCH] D139705: [clang] fix zero-initialization fix-it for variable template

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. > Since the motivation for this patch here was "make sure we're pointing to the > 'end' so we can suggest an init fixit", perhaps this SHOULD be changed to the > 'end' still, but just fix the case where the initializer was omitted. So > > /// What

[PATCH] D139705: [clang] fix zero-initialization fix-it for variable template

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. In D139705#4216417 , @erichkeane wrote: > In D139705#4215653 , > @tomasz-kaminski-sonarsource wrote: > >> As a downstream, we have concerns with this change. From

[PATCH] D139705: [clang] fix zero-initialization fix-it for variable template

2023-03-23 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. As a downstream, we have concerns with this change. From what I saw it breaks the behavior of the fix-it that wants to remove the whole variable definition (including the initializer). For example, I have unused, that I want to remove variable x and

[PATCH] D140891: [analyzer] Fix assertion failure in SMT conversion for unary operator on floats.

2023-01-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All. tomasz-kaminski-sonarsource

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-11-09 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2fb3bec932ed: [analyzer] Fix crash for array-delete of UnknownVal values. (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-11-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:1244 SVal *ElementCountVal) { + assert(Region != nullptr && "Null-regions passed to prepareStateForArrayDestruction.");

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-11-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 473166. tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added a comment. Added assert Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136671/new/

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-10-25 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 470489. tomasz-kaminski-sonarsource added a comment. Added assertion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136671/new/ https://reviews.llvm.org/D136671 Files:

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-10-25 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. In D136671#3882166 , @isuckatcs wrote: >> This eliminate the crash in `getDynamicElementCount` on that region > > I think that if the crash comes from `getDynamicElementCount`, we should > address it there

[PATCH] D136671: [analyzer] Fix crash for array-delete of UnknownVal values.

2022-10-25 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All.

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/region-store.c:66 + // expected-warning@+1 {{passing arguments to 'b' without a prototype is deprecated in all versions of C and is not supported in C2x}} + b(); +}

[PATCH] D136162: [analyzer] Fix assertion failure with conflicting prototype calls

2022-10-20 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:490 +// edge-cases. +ArgVal = castArgToParamTypeIfNeeded(Call, Idx, ArgVal, SVB); + Previously we didng make bindings if `ArgVal` was unknown, and

[PATCH] D135136: [analyzer] Make directly bounded LazyCompoundVal as lazily copied

2022-10-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6194229c6287: [analyzer] Make directly bounded LazyCompoundVal as lazily copied (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D134947: [analyzer] Fix the liveness of Symbols for values in regions referred by LazyCompoundVal

2022-10-19 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa6b42040ad30: [analyzer] Fix the liveness of Symbols for values in regions referred by… (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D135136: [analyzer] Make directly bounded LazyCompoundVal as lazily copied

2022-10-17 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:2843 -// subregions of the `LCS.getRegion()` also lazily copied. -if (const MemRegion *R = LCS->getRegion()) - SymReaper.markLazilyCopied(R);

[PATCH] D134947: [analyzer] Fix the liveness of Symbols for values in regions referred by LazyCompoundVal

2022-10-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SymbolManager.cpp:461 +bool SymbolReaper::isLazilyCopiedRegion(const MemRegion *MR) const { + // TODO: See comment in

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-06 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked 2 inline comments as done. tomasz-kaminski-sonarsource added a comment. Where should I add As a result of our internal test on around ~170 projects (~20 Widnows, ~150 Linux) that are compromised of several hundreds of millions of lines of code, the impact on

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-04 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/trivial-copy-struct.cpp:98 + // w->head.next and n->next are equal + clang_analyzer_warnIfReached(); // expected-warning {{REACHABLE}} +} NoQ wrote: > martong wrote:

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464684. tomasz-kaminski-sonarsource added a comment. Applied suggested comment updates. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/new/ https://reviews.llvm.org/D134947 Files:

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464678. tomasz-kaminski-sonarsource added a comment. Fighting with arcanist. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/new/ https://reviews.llvm.org/D134947 Files:

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464677. tomasz-kaminski-sonarsource added a comment. Herald added subscribers: openmp-commits, zero9178, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, mravishankar, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1,

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. Applied all review suggestions. Comment at: clang/lib/StaticAnalyzer/Core/SymbolManager.cpp:461 +bool SymbolReaper::isLazilyCopiedRegion(const MemRegion *MR) const { + // TODO: See comment in isLiveRegion. + return

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464673. tomasz-kaminski-sonarsource marked 3 inline comments as done. tomasz-kaminski-sonarsource added a comment. Applied review suggestions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. tomasz-kaminski-sonarsource marked an inline comment as done. Closed by commit rG73716baa30eb: [analyzer][NFC] Add tests for D132236 (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464659. tomasz-kaminski-sonarsource added a comment. Included additional tests that corresponds to TODO. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134947/new/

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked 2 inline comments as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/test/Analysis/symbol-reaper-lambda.cpp:14 +escape(param, local_pre_lambda); +return ref_captured; // no-warning: The value is not garbage. +

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-10-03 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464657. tomasz-kaminski-sonarsource added a comment. Added requested comment for the example. Included additional false-positive test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D132236: [analyzer] Fix liveness of LazyCompoundVals

2022-09-30 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource added a comment. > What looks fishy about getInterestingValues() is that it assumes that the > amount of interesting values is finite. This sounds incredibly wrong to me. > If a lazy compound value contains any pointer symbol `$p`, then all values in > the following

[PATCH] D134947: [analyzer] Fix liveness of Symbols for values in regions reffered by LazyCompoundVal

2022-09-30 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: NoQ. Herald added a project: All.

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-09-30 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 464184. tomasz-kaminski-sonarsource added a comment. Added new line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134941/new/ https://reviews.llvm.org/D134941 Files:

[PATCH] D134941: [analyzer][NFC] Add tests for D132236

2022-09-30 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource created this revision. Herald added subscribers: manas, steakhal, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a project: All. tomasz-kaminski-sonarsource requested review of this

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-09-26 Thread Tomasz Kamiński via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4ff836a138b4: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction (authored by tomasz-kaminski-sonarsource). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-09-13 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 459666. tomasz-kaminski-sonarsource added a comment. Ping and reformat. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132030/new/ https://reviews.llvm.org/D132030 Files:

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-29 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource marked an inline comment as done. tomasz-kaminski-sonarsource added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:753 -SVal V = computeObjectUnderConstruction(E, State, LCtx, CC, CallOpts, Idx);

[PATCH] D132030: [analyzer] Pass correct bldrCtx to computeObjectUnderConstruction

2022-08-29 Thread Tomasz Kamiński via Phabricator via cfe-commits
tomasz-kaminski-sonarsource updated this revision to Diff 456268. tomasz-kaminski-sonarsource added a comment. - Pass BldrCtx to handleConstructionContext Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132030/new/ https://reviews.llvm.org/D132030

  1   2   >