[clang] [clang][analyzer] Check for label location bindings in `DereferenceChecker` (PR #91119)

2024-05-07 Thread Balazs Benics via cfe-commits
steakhal wrote: > Should we introduce a new Kind in `DerefKind` (in reference to > `DereferenceChecker::reportBug`) ? Yes. Something like this should work: ```c++ BugType BT_Label{this, "Dereference of the address of a label", categories::LogicError}; ```

[clang] [analyzer] Clean up apiModeling.llvm.ReturnValue (PR #91231)

2024-05-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM. I have nothing to add here. https://github.com/llvm/llvm-project/pull/91231 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Use explicit call description mode in more checkers (PR #90974)

2024-05-07 Thread Balazs Benics via cfe-commits
@@ -149,26 +149,34 @@ class BlockInCriticalSectionChecker : public Checker { private: const std::array MutexDescriptors{ MemberMutexDescriptor( - CallDescription(/*QualifiedName=*/{"std", "mutex", "lock"}, +

[clang] [analyzer] Use explicit call description mode in more checkers (PR #90974)

2024-05-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM, thanks. I had one minor nit. https://github.com/llvm/llvm-project/pull/90974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Use explicit call description mode in more checkers (PR #90974)

2024-05-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/90974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Use explicit call description mode in more checkers (PR #90974)

2024-05-07 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/90974 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] MallocChecker: Recognize std::atomics in smart pointer suppression. (PR #90918)

2024-05-06 Thread Balazs Benics via cfe-commits
@@ -3479,13 +3479,24 @@ PathDiagnosticPieceRef MallocBugVisitor::VisitNode(const ExplodedNode *N, // original reference count is positive, we should not report use-after-frees // on objects deleted in such destructors. This can probably be improved // through better

[clang] [clang][analyzer] Check for label location bindings in `DereferenceChecker` (PR #91119)

2024-05-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. The `llvm::errs()` are for only debugging stuff. The print to the stderr. However, to form a bug report you need to use the `reportBug` here, and you also need to define a new `BugType` for representing this bug kind. Once

[clang] [analyzer] Fix false double free when including 3rd-party headers with overloaded delete operator as system headers (PR #85224)

2024-05-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/85224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false double free when including 3rd-party headers with overloaded delete operator as system headers (PR #85224)

2024-05-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/85224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix false double free when including 3rd-party headers with overloaded delete operator as system headers (PR #85224)

2024-05-05 Thread Balazs Benics via cfe-commits
steakhal wrote: I had a deeper look at the patch and I think it's good. To be on the safe side, I canonicalize `FD` to prefer decls with definitions if the redeclchain contains a definition. This ensures that if we have a definition, `L` will refer to the beginning of that definition. I'll

[clang] [analyzer] Fix false double free when including 3rd-party headers with overloaded delete operator as system headers (PR #85224)

2024-05-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/85224 >From b3e6a2273e9c35ac4cc3ac16aebcf4ea0d89ef74 Mon Sep 17 00:00:00 2001 From: Ella Ma Date: Thu, 14 Mar 2024 20:41:20 +0800 Subject: [PATCH 1/2] wip: the first workaround ---

[clang] [analyzer] MallocChecker: Recognize std::atomics in smart pointer suppression. (PR #90918)

2024-05-03 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/90918 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] MallocChecker: Recognize std::atomics in smart pointer suppression. (PR #90918)

2024-05-03 Thread Balazs Benics via cfe-commits
@@ -3479,13 +3479,24 @@ PathDiagnosticPieceRef MallocBugVisitor::VisitNode(const ExplodedNode *N, // original reference count is positive, we should not report use-after-frees // on objects deleted in such destructors. This can probably be improved // through better

[clang] [analyzer] MallocChecker: Recognize std::atomics in smart pointer suppression. (PR #90918)

2024-05-03 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Hah! I've just debugged an identical case last week, wrt. llvm intrusive pointers, which also used std::atomics inside for the refcount and lead to a Leak FP. When I dag into the case, I realized that the root cause is that we can't track the value of

[clang] [alpha.webkit.UncountedLocalVarsChecker] Don't warning on inlined functions (PR #90733)

2024-05-01 Thread Balazs Benics via cfe-commits
steakhal wrote: In the LLVM project we expect functional changes to include tests demonstrating the motivational example, and to also serve as a regression test for the future. https://github.com/llvm/llvm-project/pull/90733 ___ cfe-commits mailing

[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

2024-04-28 Thread Balazs Benics via cfe-commits
@@ -54,7 +54,7 @@ class UncountedCallArgsChecker bool shouldVisitImplicitCode() const { return false; } bool TraverseDecl(Decl *D) { -if (isa(D) && isRefType(safeGetName(D))) +if (D && isa(D) && isRefType(safeGetName(D))) steakhal

[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

2024-04-26 Thread Balazs Benics via cfe-commits
steakhal wrote: Hey, do you think a regression test would be valuable? https://github.com/llvm/llvm-project/pull/90301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix alpha.unix.BlockInCriticalSection for CTU (PR #90030)

2024-04-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. > In CTU there is not always an AnalysisDeclContext for a given call. Why? Could you demonstrate the fix in a test? https://github.com/llvm/llvm-project/pull/90030 ___ cfe-commits

[clang] [analyzer] Fix performance of getTaintedSymbolsImpl() (PR #89606)

2024-04-22 Thread Balazs Benics via cfe-commits
steakhal wrote: Ah, I think rushed ahead of myself. I applied the patch to clang-17, where it of course we didn't have any issues even with this broken `isTainted`. Now that I applied the patch to our clang-18 based branch, the file analyzes in 1:40, which is still far off from the baseline

[clang] [analyzer] Fix performance of getTaintedSymbolsImpl() (PR #89606)

2024-04-22 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Thanks! The patch makes sense. Thank you for the promptly fix. I've checked and this resolves the `FFmpeg` issue. i wonder if this is serious enough to consider hangs as a crash and nominate this PR for backport to `clang-18`. Leave me no

[clang] [analyzer] Fix performance of getTaintedSymbolsImpl() (PR #89606)

2024-04-22 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/89606 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix stores through label locations (PR #89265)

2024-04-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/89265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Fix stores through label locations (PR #89265)

2024-04-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/89265 >From 50964bf4f694ae21c2ba86b648b241b335e5d6e8 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Thu, 18 Apr 2024 18:36:29 +0200 Subject: [PATCH 1/2] [analyzer] Fix stores through label locations

[clang] [analyzer] Fix stores through label locations (PR #89265)

2024-04-19 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/89265 >From 50964bf4f694ae21c2ba86b648b241b335e5d6e8 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Thu, 18 Apr 2024 18:36:29 +0200 Subject: [PATCH 1/2] [analyzer] Fix stores through label locations

[clang] [analyzer] Fix stores through label locations (PR #89265)

2024-04-19 Thread Balazs Benics via cfe-commits
@@ -2358,11 +2358,12 @@ StoreRef RegionStoreManager::killBinding(Store ST, Loc L) { RegionBindingsRef RegionStoreManager::bind(RegionBindingsConstRef B, Loc L, SVal V) { - if (L.getAs()) + // We only care about region locations. + auto MemRegVal = L.getAs(); + if

[clang] [llvm] [mlir] Fix warning about mismatches between function parameter and call-site args names (PR #89294)

2024-04-19 Thread Balazs Benics via cfe-commits
steakhal wrote: `StaticAnalyzer` changes LGTM. https://github.com/llvm/llvm-project/pull/89294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Use explicit call description mode (easy cases) (PR #88879)

2024-04-18 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88879 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move StreamChecker out of the alpha package. (PR #89247)

2024-04-18 Thread Balazs Benics via cfe-commits
@@ -563,6 +563,20 @@ def MismatchedDeallocatorChecker : Checker<"MismatchedDeallocator">, Dependencies<[DynamicMemoryModeling]>, Documentation; +def StreamChecker : Checker<"Stream">, + HelpText<"Check stream handling functions">, +

[clang] [clang][analyzer] Move StreamChecker out of the alpha package. (PR #89247)

2024-04-18 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I have no particular interest of this change. Let me know if I should do a proper review. https://github.com/llvm/llvm-project/pull/89247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][analyzer] Move StreamChecker out of the alpha package. (PR #89247)

2024-04-18 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/89247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move StreamChecker out of the alpha package. (PR #89247)

2024-04-18 Thread Balazs Benics via cfe-commits
@@ -1462,6 +1462,99 @@ checker). Default value of the option is ``true``. +.. _unix-Stream: + +unix.Stream (C) +" steakhal wrote: This line does not match the length of the section title. https://github.com/llvm/llvm-project/pull/89247

[clang] [analyzer] Fix stores through label locations (PR #89265)

2024-04-18 Thread Balazs Benics via cfe-commits
steakhal wrote: #89264 Will implement a diagnostic for storing to label addresses. In this patch, I only focus on resolving the crash. https://github.com/llvm/llvm-project/pull/89265 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Fix stores through label locations (PR #89265)

2024-04-18 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/89265 Interestingly, this case crashed from the very beginning of the project, at least starting by clang-3. As a "fix" I just do the same thing as we do for concrete integers. It might not be the best we could do,

[clang] [analyzer] Harden security.cert.env.InvalidPtr checker fn matching (PR #88536)

2024-04-17 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/88536 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Harden security.cert.env.InvalidPtr checker fn matching (PR #88536)

2024-04-17 Thread Balazs Benics via cfe-commits
steakhal wrote: The `dyn_cast` fix was committed as e096c144921daba59963f15e89d2ca6fb32d3a78. The CDM:CLibrary matching mode is committed right after that as 024281d4d26344f9613b9115ea1fcbdbdba23235. I'll propose the `dyn_cast` patch for backporting, but leave the other.

[clang] 024281d - [analyzer] Harden security.cert.env.InvalidPtr checker fn matching

2024-04-17 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2024-04-17T08:02:49+02:00 New Revision: 024281d4d26344f9613b9115ea1fcbdbdba23235 URL: https://github.com/llvm/llvm-project/commit/024281d4d26344f9613b9115ea1fcbdbdba23235 DIFF: https://github.com/llvm/llvm-project/commit/024281d4d26344f9613b9115ea1fcbdbdba23235.diff

[clang] e096c14 - [analyzer] Fix a security.cert.env.InvalidPtr crash

2024-04-17 Thread Balazs Benics via cfe-commits
Author: Balazs Benics Date: 2024-04-17T08:02:49+02:00 New Revision: e096c144921daba59963f15e89d2ca6fb32d3a78 URL: https://github.com/llvm/llvm-project/commit/e096c144921daba59963f15e89d2ca6fb32d3a78 DIFF: https://github.com/llvm/llvm-project/commit/e096c144921daba59963f15e89d2ca6fb32d3a78.diff

[clang] [analyzer] Harden security.cert.env.InvalidPtr checker fn matching (PR #88536)

2024-04-16 Thread Balazs Benics via cfe-commits
@@ -205,8 +210,12 @@ void InvalidPtrChecker::postPreviousReturnInvalidatingCall( CE, LCtx, CE->getType(), C.blockCount()); State = State->BindExpr(CE, LCtx, RetVal); + const auto *SymRegOfRetVal = + dyn_cast_or_null(RetVal.getAsRegion()); + if (!SymRegOfRetVal)

[clang] [analyzer] Use explicit call description mode in iterator checkers (PR #88913)

2024-04-16 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. This should be all good. FYI std lib funcs are not always functions. They could be also niebloids, which we cant actually hook. This shouldnt affect these apis though. I left it here as food for thought.

[clang] [analyzer] Handle builtin functions in MallocChecker (PR #88416)

2024-04-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: @@ -214,3 +214,15 @@ void *realloc(void **ptr, size_t size) { realloc(ptr, size); } // no-crash namespace pr46253_paramty2{ void *realloc(void *ptr, int size) { realloc(ptr, size); } // no-crash } // namespace

[clang] [analyzer] Handle builtin functions in MallocChecker (PR #88416)

2024-04-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. High quality code with descent description. Really nice work. Nothing really stood out to me that I'd object. https://github.com/llvm/llvm-project/pull/88416

[clang] [analyzer] Handle builtin functions in MallocChecker (PR #88416)

2024-04-14 Thread Balazs Benics via cfe-commits
=?utf-8?q?Donát?= Nagy Message-ID: In-Reply-To: https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/88416 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. https://github.com/llvm/llvm-project/pull/87521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 %s \ steakhal wrote: I think you should put this test without the RUN lines into the `clang/test/Analysis/invalidated-iterator.cpp` to have them at one place. https://github.com/llvm/llvm-project/pull/87521

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
@@ -57,10 +57,14 @@ ProgramStateRef SimpleConstraintManager::assumeAux(ProgramStateRef State, // We cannot reason about SymSymExprs, and can only reason about some // SymIntExprs. if (!canReasonAbout(Cond)) { -// Just add the constraint to the expression without

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
@@ -2836,6 +2836,10 @@ bool RangeConstraintManager::canReasonAbout(SVal X) const { return false; } + // Non-integer types are not supported. + if (X.getAs()) +return false; + steakhal wrote: My problem with this is that I think LCVs shouldn't

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
@@ -0,0 +1,16 @@ +// RUN: %clang_analyze_cc1 %s \ +// RUN: -analyzer-checker=alpha.cplusplus.InvalidatedIterator \ +// RUN: -analyzer-config aggressive-binary-operation-simplification=true \ +// RUN: 2>&1 + +struct node {}; +struct prop : node {}; +struct bitvec : node { +

[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

2024-04-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/87521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Harden security.cert.env.InvalidPtr checker fn matching (PR #88536)

2024-04-13 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/88536 >From 915ab37028067fb38ffa69ae5c9726bb8c971436 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Fri, 12 Apr 2024 19:07:49 +0200 Subject: [PATCH 1/2] [analyzer] Harden security.cert.env.InvalidPtr checker fn

[clang] [libc] [llvm] Fix typos (PR #88565)

2024-04-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Harden security.cert.env.InvalidPtr checker fn matching (PR #88536)

2024-04-12 Thread Balazs Benics via cfe-commits
steakhal wrote: @iillyyaa, do you wish this crash fix to be backported to clang-18? Or you are fine with only having it in clang-19? https://github.com/llvm/llvm-project/pull/88536 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Harden security.cert.env.InvalidPtr checker fn matching (PR #88536)

2024-04-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/88536 Fixes #88181 I'm also hardening an llvm::cast along the way. Here is the full stack trace of the original crash: https://godbolt.org/z/jn93q39b5 >From 915ab37028067fb38ffa69ae5c9726bb8c971436 Mon Sep 17

[clang] [analyzer] Support `PointerType` in `getCXXRecordDecl` for `ContainerModeling` (PR #87787)

2024-04-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/87787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Support `PointerType` in `getCXXRecordDecl` for `ContainerModeling` (PR #87787)

2024-04-12 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/87787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC] Fix misspellings of effects (PR #87795)

2024-04-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/87795 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Support `PointerType` in `getCXXRecordDecl` for `ContainerModeling` (PR #87787)

2024-04-05 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. Looks clean to me, even though I haven't checked how the ContainerModeling checker works. https://github.com/llvm/llvm-project/pull/87787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Set and display CSA analysis entry points as notes on debugging (PR #84823)

2024-04-05 Thread Balazs Benics via cfe-commits
@@ -788,7 +791,7 @@ class PathDiagnostic : public llvm::FoldingSetNode { PathDiagnostic(StringRef CheckerName, const Decl *DeclWithIssue, StringRef bugtype, StringRef verboseDesc, StringRef shortDesc, StringRef category,

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread Balazs Benics via cfe-commits
steakhal wrote: > > Unless you plan to add more heuristics, I'd prefer a more concrete option > > name, like AssumeSuccessfulWrites=true. This would better describe it imo. > > I do not like totally the name "Pedantic", it could be > "AssumeOftenUncheckedOperationsMayFail". I am not sure if

[clang] [clang][ASTImporter] fix variable inline of CXX17 (PR #87314)

2024-04-02 Thread Balazs Benics via cfe-commits
@@ -5317,6 +5317,34 @@ TEST_P(ASTImporterOptionSpecificTestBase, EXPECT_FALSE(ToX); } +TEST_P(ASTImporterOptionSpecificTestBase, VarTemplateDeclInlineWithCXX17) { + Decl *FromTU = getTuDecl( + R"( + struct S { +template static constexpr bool X = true; +

[clang] [clang][ASTImporter] fix variable inline of CXX17 (PR #87314)

2024-04-02 Thread Balazs Benics via cfe-commits
@@ -5317,6 +5317,34 @@ TEST_P(ASTImporterOptionSpecificTestBase, EXPECT_FALSE(ToX); } +TEST_P(ASTImporterOptionSpecificTestBase, VarTemplateDeclInlineWithCXX17) { + Decl *FromTU = getTuDecl( + R"( + struct S { +template static constexpr bool X = true; +

[clang] [clang][ASTImporter] fix variable inline of CXX17 (PR #87314)

2024-04-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/87314 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] fix variable inline of CXX17 (PR #87314)

2024-04-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. I only had generic nits, as I'm not really in the domain. Consider my review as such. https://github.com/llvm/llvm-project/pull/87314 ___ cfe-commits mailing list

[clang] [clang][analyzer] Add "pedantic" mode to StreamChecker. (PR #87322)

2024-04-02 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: Unless you plan to add more heuristics, I'd prefer a more concrete option name, like AssumeSuccessfulWrites=true. This would better describe it imo. https://github.com/llvm/llvm-project/pull/87322 ___

[clang] [clang][analyzer] Change modeling of `fseek` in StreamChecker. (PR #86919)

2024-03-30 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/86919 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Remove barely used class 'KnownSVal' (NFC) (PR #86953)

2024-03-28 Thread Balazs Benics via cfe-commits
@@ -1238,12 +1238,12 @@ class StoreSiteFinder final : public TrackingBugReporterVisitor { ///changes to its value in a nested stackframe could be pruned, and ///this visitor can prevent that without polluting the bugpath too ///much. -

[clang] [analyzer] Remove barely used class 'KnownSVal' (NFC) (PR #86953)

2024-03-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. The simpler the better. Thanks. https://github.com/llvm/llvm-project/pull/86953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Remove barely used class 'KnownSVal' (NFC) (PR #86953)

2024-03-28 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/86953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][docs] Document the `optin.performance.Padding` checker (PR #86411)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Document the `optin.performance.Padding` checker (PR #86411)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Document the `optin.performance.Padding` checker (PR #86411)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/86411 >From b6ca6f0ef83d03e299d6ee9a8ed9b8044477914e Mon Sep 17 00:00:00 2001 From: komalverma04 <114138604+komalverm...@users.noreply.github.com> Date: Sat, 23 Mar 2024 11:14:44 -0700 Subject: [PATCH 1/9] Update

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/86411 >From b6ca6f0ef83d03e299d6ee9a8ed9b8044477914e Mon Sep 17 00:00:00 2001 From: komalverma04 <114138604+komalverm...@users.noreply.github.com> Date: Sat, 23 Mar 2024 11:14:44 -0700 Subject: [PATCH 1/8] Update

[clang] [analyzer] Make recognition of hardened __FOO_chk functions explicit (PR #86536)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal approved this pull request. LGTM, but I'd recommed @Xazax-hun to also have a look. If nothing happens, merge this after one week. https://github.com/llvm/llvm-project/pull/86536 ___ cfe-commits mailing list

[clang] [analyzer] Make recognition of hardened __FOO_chk functions explicit (PR #86536)

2024-03-27 Thread Balazs Benics via cfe-commits
@@ -124,34 +124,45 @@ class CStringChecker : public Checker< eval::Call, const CallEvent &)>; CallDescriptionMap Callbacks = { - {{CDM::CLibrary, {"memcpy"}, 3}, + {{CDM::CLibraryMaybeHardened, {"memcpy"}, 3},

[clang] [analyzer] Make recognition of hardened __FOO_chk functions explicit (PR #86536)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal commented: I like your patch. This is an important fix. I only had a couple nits, but overall looks good. https://github.com/llvm/llvm-project/pull/86536 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [analyzer] Make recognition of hardened __FOO_chk functions explicit (PR #86536)

2024-03-27 Thread Balazs Benics via cfe-commits
@@ -110,13 +110,24 @@ bool CheckerContext::isCLibraryFunction(const FunctionDecl *FD, if (FName.starts_with("__inline") && FName.contains(Name)) return true; - if (FName.starts_with("__") && FName.ends_with("_chk") && - FName.contains(Name)) -return true; -

[clang] [analyzer] Make recognition of hardened __FOO_chk functions explicit (PR #86536)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/86536 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Make recognition of hardened __FOO_chk functions explicit (PR #86536)

2024-03-27 Thread Balazs Benics via cfe-commits
@@ -124,34 +124,45 @@ class CStringChecker : public Checker< eval::Call, const CallEvent &)>; CallDescriptionMap Callbacks = { - {{CDM::CLibrary, {"memcpy"}, 3}, + {{CDM::CLibraryMaybeHardened, {"memcpy"}, 3},

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-27 Thread Balazs Benics via cfe-commits
steakhal wrote: I figured, it might be easier to directly propose and apply some of my thoughts. Let me know if you like it. My goal was: - be specific what is the impact of not having the optimal layout: memory, cachemisses - have a single block of examples, demonstrating the bad, the good

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-27 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/86411 >From b6ca6f0ef83d03e299d6ee9a8ed9b8044477914e Mon Sep 17 00:00:00 2001 From: komalverma04 <114138604+komalverm...@users.noreply.github.com> Date: Sat, 23 Mar 2024 11:14:44 -0700 Subject: [PATCH 1/7] Update

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-25 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,38 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (C, C++, ObjC) + Check for

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. The grammar seems good. I have further concerns inline. https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-25 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,38 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (C, C++, ObjC) + Check for

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-25 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,38 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (C, C++, ObjC) + Check for

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-25 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,38 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (C, C++, ObjC) + Check for

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Set and display CSA analysis entry points as notes on debugging (PR #84823)

2024-03-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal closed https://github.com/llvm/llvm-project/pull/84823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Reapply "[analyzer] Accept C library functions from the `std` namespace" again (PR #85791)

2024-03-25 Thread Balazs Benics via cfe-commits
=?utf-8?q?Don=C3=A1t?= Nagy , =?utf-8?q?Don=C3=A1t?= Nagy ,NagyDonat ,NagyDonat Message-ID: In-Reply-To: https://github.com/steakhal approved this pull request. https://github.com/llvm/llvm-project/pull/85791 ___ cfe-commits mailing list

[clang] [analyzer] Set and display CSA analysis entry points as notes on debugging (PR #84823)

2024-03-25 Thread Balazs Benics via cfe-commits
https://github.com/steakhal updated https://github.com/llvm/llvm-project/pull/84823 >From 94c6be96d92d8a25693ccbbffedf9edabfe79cc5 Mon Sep 17 00:00:00 2001 From: Balazs Benics Date: Mon, 11 Mar 2024 21:18:30 +0100 Subject: [PATCH 1/2] [analyzer] Set and display CSA analysis entry points as

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal edited https://github.com/llvm/llvm-project/pull/86411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,28 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (PaddingChecker)

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,28 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (PaddingChecker)

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,28 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (PaddingChecker) steakhal wrote: It should be the

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,28 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (PaddingChecker)

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
@@ -804,10 +804,28 @@ Check for performance anti-patterns when using Grand Central Dispatch. .. _optin-performance-Padding: -optin.performance.Padding -" +optin.performance.Padding (PaddingChecker)

[clang] [Clang][analyzer] add documentation for optin performance padding (padding checker) #73675 (PR #86411)

2024-03-24 Thread Balazs Benics via cfe-commits
https://github.com/steakhal requested changes to this pull request. The docs should also explain why is a problem to have padding bytes, and how to fix it. How does the generated html look like after your change for this file? (Have a look at my commits to this or to the releasenotes file for

  1   2   3   4   5   6   7   8   9   10   >