[clang] [clang][analyzer] Add StreamChecker note tags for "indeterminate stream position". (PR #83288)

2024-02-29 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/83288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
@@ -27,20 +27,48 @@ class IdentifierInfo; namespace clang { namespace ento { - -enum CallDescriptionFlags : unsigned { - CDF_None = 0, - - /// Describes a C standard function that is sometimes implemented as a macro - /// that expands to a compiler builtin with some __built

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/83432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
@@ -27,20 +27,48 @@ class IdentifierInfo; namespace clang { namespace ento { - -enum CallDescriptionFlags : unsigned { - CDF_None = 0, - - /// Describes a C standard function that is sometimes implemented as a macro - /// that expands to a compiler builtin with some __built

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
@@ -27,20 +27,48 @@ class IdentifierInfo; namespace clang { namespace ento { - -enum CallDescriptionFlags : unsigned { - CDF_None = 0, - - /// Describes a C standard function that is sometimes implemented as a macro - /// that expands to a compiler builtin with some __built

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
@@ -27,20 +27,48 @@ class IdentifierInfo; namespace clang { namespace ento { - -enum CallDescriptionFlags : unsigned { - CDF_None = 0, - - /// Describes a C standard function that is sometimes implemented as a macro - /// that expands to a compiler builtin with some __built

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
https://github.com/balazske commented: The flag approach can probably make a sense for namespace handling (match the exact specified namespace, or allow a prefix before, or even something in between). https://github.com/llvm/llvm-project/pull/83432 _

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
@@ -27,20 +27,48 @@ class IdentifierInfo; namespace clang { namespace ento { - -enum CallDescriptionFlags : unsigned { - CDF_None = 0, - - /// Describes a C standard function that is sometimes implemented as a macro - /// that expands to a compiler builtin with some __built

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
@@ -27,20 +27,48 @@ class IdentifierInfo; namespace clang { namespace ento { - -enum CallDescriptionFlags : unsigned { - CDF_None = 0, - - /// Describes a C standard function that is sometimes implemented as a macro - /// that expands to a compiler builtin with some __built

[clang] [analyzer] Refactor CallDescription match mode (NFC) (PR #83432)

2024-03-01 Thread Balázs Kéri via cfe-commits
@@ -27,20 +27,48 @@ class IdentifierInfo; namespace clang { namespace ento { - -enum CallDescriptionFlags : unsigned { - CDF_None = 0, - - /// Describes a C standard function that is sometimes implemented as a macro - /// that expands to a compiler builtin with some __built

[clang] [clang][analyzer] StreamChecker: Model getc, vfscanf, putc, vfprintf (PR #82476)

2024-03-01 Thread Balázs Kéri via cfe-commits
balazske wrote: Do you plan to commit this re-apply to the LLVM repository? https://github.com/llvm/llvm-project/pull/82476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Change default value of checker option in unix.StdCLibraryFunctions. (PR #80457)

2024-03-04 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/80457 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] da5966e - Revert "[clang][analyzer] Change default value of checker option in unix.StdCLibraryFunctions. (#80457)"

2024-03-04 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2024-03-04T09:50:36+01:00 New Revision: da5966e0c102f03ab853b906377814675db3623c URL: https://github.com/llvm/llvm-project/commit/da5966e0c102f03ab853b906377814675db3623c DIFF: https://github.com/llvm/llvm-project/commit/da5966e0c102f03ab853b906377814675db3623c.diff L

[clang] bbeb946 - [clang][analyzer] Change value of checker option in unix.StdCLibraryFunctions (second try). (#80457)

2024-03-04 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2024-03-04T15:28:20+01:00 New Revision: bbeb946652f2830b3211dcd8c6836bce4dbdd188 URL: https://github.com/llvm/llvm-project/commit/bbeb946652f2830b3211dcd8c6836bce4dbdd188 DIFF: https://github.com/llvm/llvm-project/commit/bbeb946652f2830b3211dcd8c6836bce4dbdd188.diff L

[clang] [clang][analyzer] Improve documentation of StreamChecker (NFC). (PR #83858)

2024-03-04 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/83858 None From bb81a944b78315471df8866bf21b317e8c50166c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 4 Mar 2024 09:48:41 +0100 Subject: [PATCH] [clang][analyzer] Improve documentatio

[clang] [clang][analyzer] Improve documentation of StreamChecker (NFC). (PR #83858)

2024-03-04 Thread Balázs Kéri via cfe-commits
@@ -3020,44 +3020,82 @@ Check for misuses of stream APIs. Check for misuses of stream APIs: ``fopen, fcl alpha.unix.Stream (C) " -Check stream handling functions: ``fopen, tmpfile, fclose, fread, fwrite, fseek, ftell, rewind, fgetpos,`` -``fsetpos, cleare

[clang] [clang][analyzer] Improve documentation of StreamChecker (NFC). (PR #83858)

2024-03-04 Thread Balázs Kéri via cfe-commits
@@ -3020,44 +3020,82 @@ Check for misuses of stream APIs. Check for misuses of stream APIs: ``fopen, fcl alpha.unix.Stream (C) " -Check stream handling functions: ``fopen, tmpfile, fclose, fread, fwrite, fseek, ftell, rewind, fgetpos,`` -``fsetpos, cleare

[clang] [clang][analyzer] Improve documentation of StreamChecker (NFC). (PR #83858)

2024-03-05 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/83858 From bb81a944b78315471df8866bf21b317e8c50166c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 4 Mar 2024 09:48:41 +0100 Subject: [PATCH 1/2] [clang][analyzer] Improve documentation

[clang] [clang][analyzer] Improve modeling of 'realpath' in StdLibraryFunctionsChecker (PR #79939)

2024-01-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/79939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improve modeling of 'realpath' in StdLibraryFunctionsChecker (PR #79939)

2024-01-30 Thread Balázs Kéri via cfe-commits
@@ -2992,12 +2992,14 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( // char *realpath(const char *restrict file_name, //char *restrict resolved_name); -// FIXME: Improve for errno modeling. addToFunctionSummaryMap( "realpat

[clang] [clang][analyzer] Improve modeling of 'realpath' in StdLibraryFunctionsChecker (PR #79939)

2024-01-30 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/79939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Simplify code of StreamChecker (NFC). (PR #79312)

2024-01-31 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/79312 From 62dc7fdb2f86c81af501f7f1255a98d97ede303f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 24 Jan 2024 16:28:57 +0100 Subject: [PATCH 1/2] [clang][analyzer] Simplify code of Stre

[clang] [clang][ASTImporter] fix assert fail due to offset overflow (PR #79084)

2024-01-31 Thread Balázs Kéri via cfe-commits
@@ -9896,9 +9903,13 @@ Expected ASTImporter::Import(FileID FromID, bool IsBuiltin) { // FIXME: The filename may be a virtual name that does probably not // point to a valid file and we get no Entry here. In this case try with // the memory buffer below

[clang] [clang][analyzer] Add note tags to alpha.unix.BlockInCriticalSection (PR #80029)

2024-01-31 Thread Balázs Kéri via cfe-commits
balazske wrote: I think we could get a note at the first `lock` call in this code, this behavior is not entirely correct: ``` void test() { std::mutex m; m.lock(); m.unlock(); m.lock(); sleep(3); m.unlock(); } ``` https://github.com/llvm/llvm-project/pull/80029 _

[clang] [clang-tools-extra] [llvm] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-02-01 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/76979 From e4932449fd2407cee888f3f0e5dc00c6ce637221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 4 Jan 2024 18:16:12 +0100 Subject: [PATCH 1/6] [clang][analyzer] Add missing stream rel

[clang] [clang-tools-extra] [llvm] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-02-01 Thread Balázs Kéri via cfe-commits
@@ -1385,14 +1385,16 @@ Improvements - Improved the ``unix.StdCLibraryFunctions`` checker by modeling more - functions like ``send``, ``recv``, ``readlink``, ``fflush``, ``mkdtemp``, - ``getcwd`` and ``errno`` behavior. + functions like ``send``, ``recv``, ``re

[clang] [clang][analyzer] Change default value of checker option in unix.StdCLibraryFunctions. (PR #80457)

2024-02-02 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/80457 Default value of checker option `ModelPOSIX` is changed to `true`. Documentation is updated. From 1f65abda712efce624c01ec99675c8261a8e6cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Dat

[clang] [clang][analyzer] Support `fgets` in the SteamChecker (PR #73638)

2024-01-24 Thread Balázs Kéri via cfe-commits
@@ -778,42 +781,61 @@ void StreamChecker::evalFgetc(const FnDescription *Desc, const CallEvent &Call, assertStreamStateOpened(OldSS); balazske wrote: Will this invalidate only the buffer, not `F1`? https://github.com/llvm/llvm-project/pull/73638 __

[clang] [clang][analyzer] Simplify code of StreamChecker (NFC). (PR #79312)

2024-01-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/79312 Common parts of some "eval" functions are moved into one function. The non-common parts of the "eval" functions are passed through lambda parameters to the new function. From 62dc7fdb2f86c81af501f7f1255a98d97e

[clang] [clang][analyzer] Simplify code of StreamChecker (NFC). (PR #79312)

2024-01-24 Thread Balázs Kéri via cfe-commits
balazske wrote: Later more functions can be simplified with `evalRWCommon`, probably in a next patch to make the review more simple. https://github.com/llvm/llvm-project/pull/79312 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [clang][analyzer] Support `fgets` in the SteamChecker (PR #73638)

2024-01-24 Thread Balázs Kéri via cfe-commits
@@ -778,42 +781,61 @@ void StreamChecker::evalFgetc(const FnDescription *Desc, const CallEvent &Call, assertStreamStateOpened(OldSS); balazske wrote: There should be a same kind of problem with `fread`, or not? (That function was not changed in the recent

[clang] [clang][analyzer] Improve modeling of 'popen' and 'pclose' in StdLibraryFunctionsChecker (PR #78895)

2024-01-25 Thread Balázs Kéri via cfe-commits
@@ -2211,6 +2221,15 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( ErrnoNEZeroIrrelevant, GenericFailureMsg) .ArgConstraint(NotNull(ArgNo(0; +// int pclose(FILE *stream); +addToFunctionSummaryMap( +"pclose", Signatu

[clang] [clang][analyzer] Add function 'fprintf' to StreamChecker. (PR #77613)

2024-01-25 Thread Balázs Kéri via cfe-commits
@@ -926,6 +932,49 @@ void StreamChecker::evalFputx(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +void StreamChecker::evalFprintf(const FnDescription *Desc, +const CallEvent &Call, +

[clang] [clang][analyzer] Simplify code of StreamChecker (NFC). (PR #79312)

2024-01-25 Thread Balázs Kéri via cfe-commits
balazske wrote: My concern was the addition of many small functions that are used only from few other `eval*` calls and are relatively special. And all of these need a common big set of arguments like `StreamSym`, `CE`, `Call`. The build of states for success and failure cases in the thing tha

[clang] [clang][analyzer] Improve modeling of 'popen' and 'pclose' in StdLibraryFunctionsChecker (PR #78895)

2024-01-25 Thread Balázs Kéri via cfe-commits
@@ -2211,6 +2221,15 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( ErrnoNEZeroIrrelevant, GenericFailureMsg) .ArgConstraint(NotNull(ArgNo(0; +// int pclose(FILE *stream); +addToFunctionSummaryMap( +"pclose", Signatu

[clang] [clang][analyzer] Improve modeling of 'popen' and 'pclose' in StdLibraryFunctionsChecker (PR #78895)

2024-01-25 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/78895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Fix argument invalidations in StreamChecker. (PR #79470)

2024-01-25 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/79470 Specific arguments passed to stream handling functions are changed by the function, this means these should be invalidated ("escaped") by the analyzer. This change adds the argument invalidation (in specific ca

[clang] [clang][analyzer] Simplify code of StreamChecker (NFC). (PR #79312)

2024-01-26 Thread Balázs Kéri via cfe-commits
balazske wrote: For clarification, the `evalRWCommon` new function is not planned to be used in the same way as other `eval*` calls, the name may be misleading. This function contains a "generic algorithm" that is called from the other `eval*` calls, but not used directly in `CallDescriptionMa

[clang] [clang][analyzer] Fix argument invalidations in StreamChecker. (PR #79470)

2024-01-26 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,133 @@ +// RUN: %clang_analyze_cc1 -verify %s \ +// RUN: -analyzer-checker=core \ +// RUN: -analyzer-checker=alpha.unix.Stream \ +// RUN: -analyzer-checker=debug.StreamTester \ +// RUN: -analyzer-checker=debug.ExprInspection + +#include "Inputs/system-header-simulator.h

[clang] [clang][analyzer] Fix argument invalidations in StreamChecker. (PR #79470)

2024-01-26 Thread Balázs Kéri via cfe-commits
@@ -544,6 +545,21 @@ const ExplodedNode *StreamChecker::getAcquisitionSite(const ExplodedNode *N, return nullptr; } +static ProgramStateRef +escapeArgs(ProgramStateRef State, CheckerContext &C, const CallEvent &Call, + const SmallVector &EscapingArgs) { + const a

[clang] [clang][analyzer] Fix argument invalidations in StreamChecker. (PR #79470)

2024-01-26 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/79470 From dbd9af4e77c34fcf6ce82f226f7dbf836033a8f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 25 Jan 2024 17:50:42 +0100 Subject: [PATCH 1/2] [clang][analyzer] Fix argument invalida

[clang] [clang][ASTImporter] fix assert fail due to offset overflow (PR #79084)

2024-01-26 Thread Balázs Kéri via cfe-commits
@@ -9896,9 +9903,13 @@ Expected ASTImporter::Import(FileID FromID, bool IsBuiltin) { // FIXME: The filename may be a virtual name that does probably not // point to a valid file and we get no Entry here. In this case try with // the memory buffer below

[clang] [clang][ASTImporter] fix assert fail due to offset overflow (PR #79084)

2024-01-26 Thread Balázs Kéri via cfe-commits
@@ -9896,9 +9903,13 @@ Expected ASTImporter::Import(FileID FromID, bool IsBuiltin) { // FIXME: The filename may be a virtual name that does probably not // point to a valid file and we get no Entry here. In this case try with // the memory buffer below

[clang] [clang][ASTImporter] Improve import of variable template specializations. (PR #78284)

2024-01-29 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/78284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add function 'fprintf' to StreamChecker. (PR #77613)

2024-01-12 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/77613 From 96a786f07ca5fb84b372e0b7c60f371bf4cdfd7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 10 Jan 2024 10:55:27 +0100 Subject: [PATCH] [clang][analyzer] Add function 'fprintf' to

[clang] [clang][analyzer] Improve modeling of 'fseeko' and 'ftello' in StdLibraryFunctionsChecker (PR #77902)

2024-01-12 Thread Balázs Kéri via cfe-commits
@@ -2859,13 +2859,19 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( "fseeko", Signature(ArgTypes{FilePtrTy, Off_tTy, IntTy}, RetType{IntTy}), Summary(NoEvalCall) -.Case(ReturnsZeroOrMinusOne, ErrnoIrrelevant) -.ArgCons

[clang] [clang][analyzer] Improve modeling of 'fseeko' and 'ftello' in StdLibraryFunctionsChecker (PR #77902)

2024-01-12 Thread Balázs Kéri via cfe-commits
@@ -2859,13 +2859,19 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( "fseeko", Signature(ArgTypes{FilePtrTy, Off_tTy, IntTy}, RetType{IntTy}), Summary(NoEvalCall) -.Case(ReturnsZeroOrMinusOne, ErrnoIrrelevant) -.ArgCons

[clang] [clang][analyzer] Add function 'fprintf' to StreamChecker. (PR #77613)

2024-01-12 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/77613 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Improve structural equivalence of overloadable operators. (PR #72242)

2024-01-12 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/72242 From 5300f979c96eb2f88c298872f0519e274c155cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Tue, 14 Nov 2023 11:53:20 +0100 Subject: [PATCH 1/3] [clang][ASTImporter] Improve structural

[clang] [clang][ASTImporter] Improve structural equivalence of overloadable operators. (PR #72242)

2024-01-12 Thread Balázs Kéri via cfe-commits
@@ -2252,6 +2252,176 @@ TEST_F(StructuralEquivalenceStmtTest, UnaryOperatorDifferentOps) { EXPECT_FALSE(testStructuralMatch(t)); } +TEST_F(StructuralEquivalenceStmtTest, + CXXOperatorCallExprVsUnaryBinaryOperator) { + auto t = makeNamedDecls( + R"( + templa

[clang] [clang][ASTImporter] Fix import of variable template redeclarations. (PR #72841)

2024-01-12 Thread Balázs Kéri via cfe-commits
@@ -6245,17 +6245,21 @@ ExpectedDecl ASTNodeImporter::VisitVarTemplateDecl(VarTemplateDecl *D) { D->getTemplatedDecl())) continue; if (IsStructuralMatch(D, FoundTemplate)) { -// The Decl in the "From" context

[clang] [clang][ASTImporter] Fix import of variable template redeclarations. (PR #72841)

2024-01-15 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/72841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add function 'fscanf' to StreamChecker. (PR #78180)

2024-01-15 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/78180 None From aacfc3f06ee51ede08464cb23ec32b210e703b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 15 Jan 2024 16:41:34 +0100 Subject: [PATCH] [clang][analyzer] Add function 'fscan

[clang] [clang][analyzer] Improve modeling of 'fseeko' and 'ftello' in StdLibraryFunctionsChecker (PR #77902)

2024-01-16 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/77902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Improve modeling of two functions in StdLibraryFunctionsChecker (PR #78079)

2024-01-16 Thread Balázs Kéri via cfe-commits
@@ -248,3 +248,25 @@ void check_fflush_all(void) { if (errno) {}// no-warning } } + +void check_opendir(const char *Path) { + DIR *Dir = opendir(Path); + if (Dir == NULL) { +clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}} +if (er

[clang] Improve modeling of two functions in StdLibraryFunctionsChecker (PR #78079)

2024-01-16 Thread Balázs Kéri via cfe-commits
@@ -248,3 +248,25 @@ void check_fflush_all(void) { if (errno) {}// no-warning } } + +void check_opendir(const char *Path) { + DIR *Dir = opendir(Path); + if (Dir == NULL) { +clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}} +if (er

[clang] Improve modeling of two functions in StdLibraryFunctionsChecker (PR #78079)

2024-01-16 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/78079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add function 'fscanf' to StreamChecker. (PR #78180)

2024-01-16 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/78180 From aacfc3f06ee51ede08464cb23ec32b210e703b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 15 Jan 2024 16:41:34 +0100 Subject: [PATCH 1/2] [clang][analyzer] Add function 'fscanf'

[clang] [clang][ASTImporter] Improve import of variable template specializations. (PR #78284)

2024-01-16 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/78284 Code of `VisitVarTemplateSpecializationDecl` was rewritten based on code of `VisitVarDecl`. Additional changes (in structural equivalence) were made to make tests pass. From 41393908cb142f5b863a7a4203d89a57c5c

[clang] [clang][ASTImporter] Improve import of variable template specializations. (PR #78284)

2024-01-16 Thread Balázs Kéri via cfe-commits
balazske wrote: After this change it should be possible to add a ``` static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, VarTemplateDecl *D1, VarTemplateDecl *D2) ``` function with all tests passing. https://github.com/llvm/llvm-projec

[clang] [clang][ASTImporter] Improve import of variable template specializations. (PR #78284)

2024-01-16 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/78284 From 41393908cb142f5b863a7a4203d89a57c5ce4bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 22 Nov 2023 16:33:58 +0100 Subject: [PATCH 1/2] [clang][ASTImporter] Improve import of

[clang] [clang][ASTImporter] Improve structural equivalence of overloadable operators. (PR #72242)

2024-01-18 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/72242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-01-18 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/76979 From c45d8c9ef074c8dbce862d88222e16c2e60be619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 4 Jan 2024 18:16:12 +0100 Subject: [PATCH 1/3] [clang][analyzer] Add missing stream rel

[clang] [clang][analyzer] Improve modeling of 'fdopen' in StdLibraryFunctionsChecker (PR #78680)

2024-01-19 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/78680 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-01-19 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/76979 From c45d8c9ef074c8dbce862d88222e16c2e60be619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 4 Jan 2024 18:16:12 +0100 Subject: [PATCH 1/4] [clang][analyzer] Add missing stream rel

[clang] [clang][analyzer] Support 'getdelim' and 'getline' in StreamChecker (PR #78693)

2024-01-19 Thread Balázs Kéri via cfe-commits
balazske wrote: I have already a working code to simplify code repetitions, but want to merge first patches #76979 and #78180 (@NagyDonat could you look at these too?). https://github.com/llvm/llvm-project/pull/78693 ___ cfe-commits mailing list cfe-

[clang] [clang][analyzer] Add function 'fscanf' to StreamChecker. (PR #78180)

2024-01-22 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/78180 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Support 'getdelim' and 'getline' in StreamChecker (PR #78693)

2024-01-22 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. OK, change can be merged before the simplification. https://github.com/llvm/llvm-project/pull/78693 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[clang] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-01-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/76979 From c45d8c9ef074c8dbce862d88222e16c2e60be619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 4 Jan 2024 18:16:12 +0100 Subject: [PATCH 1/5] [clang][analyzer] Add missing stream rel

[clang] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-01-23 Thread Balázs Kéri via cfe-commits
@@ -2201,6 +2214,56 @@ void StdLibraryFunctionsChecker::initFunctionSummaries( ErrnoNEZeroIrrelevant, GenericFailureMsg) .ArgConstraint(NotNull(ArgNo(0; +// int fgetc(FILE *stream); +// 'getc' is the same as 'fgetc' but may be a macro

[clang] [clang][analyzer] Improve modeling of 'popen' and 'pclose' in StdLibraryFunctionsChecker (PR #78895)

2024-01-23 Thread Balázs Kéri via cfe-commits
@@ -51,6 +51,17 @@ void check_freopen(void) { if (errno) {} // expected-warning{{An undefined value may be read from 'errno'}} } +void check_popen(void) { + FILE *F = popen("xxx", "r"); + if (!F) { +clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}} +if

[clang] [clang][analyzer] Improve modeling of 'popen' and 'pclose' in StdLibraryFunctionsChecker (PR #78895)

2024-01-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/78895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improve modeling of 'execv' and 'execvp' in StdLibraryFunctionsChecker (PR #78930)

2024-01-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/78930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improve modeling of 'execv' and 'execvp' in StdLibraryFunctionsChecker (PR #78930)

2024-01-23 Thread Balázs Kéri via cfe-commits
balazske wrote: Test for these functions can be added to file std-c-library-functions-POSIX.c (with check of return value and `errno`). https://github.com/llvm/llvm-project/pull/78930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-01-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/76979 From e4932449fd2407cee888f3f0e5dc00c6ce637221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 4 Jan 2024 18:16:12 +0100 Subject: [PATCH 1/5] [clang][analyzer] Add missing stream rel

[clang] [clang][analyzer] Add function 'ungetc' to StreamChecker. (PR #77331)

2024-01-23 Thread Balázs Kéri via cfe-commits
@@ -916,6 +922,45 @@ void StreamChecker::evalFputx(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call, + CheckerContext &C) const {

[clang] [clang][analyzer] Add function 'fscanf' to StreamChecker. (PR #78180)

2024-01-23 Thread Balázs Kéri via cfe-commits
balazske wrote: > This patch breaks a downstream test, like this: I think this can be caused by missing the default `evalCall` for `fscanf`, but did not find the exact reason. https://github.com/llvm/llvm-project/pull/78180 ___ cfe-commits mailing li

[clang] [clang][analyzer] Add missing stream related functions to StdLibraryFunctionsChecker. (PR #76979)

2024-01-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/76979 From e4932449fd2407cee888f3f0e5dc00c6ce637221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 4 Jan 2024 18:16:12 +0100 Subject: [PATCH 1/6] [clang][analyzer] Add missing stream rel

[clang] [clang][Analyzer] Move checker 'alpha.unix.Errno' to 'unix.Errno'. (PR #69469)

2023-10-18 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/69469 None From 0fdc57b49002afd8aa54043837ee4155688b4c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Tue, 17 Oct 2023 11:51:27 +0200 Subject: [PATCH] [clang][Analyzer] Move checker 'alpha

[clang] [clang][Analyzer] Move checker 'alpha.unix.Errno' to 'unix.Errno'. (PR #69469)

2023-10-18 Thread Balázs Kéri via cfe-commits
balazske wrote: This checker was dependent on `unix.StdCLibraryFunctions`. After that checker was moved out of alpha, it is possible to move `alpha.unix.Errno` out of alpha. The checker was tested first on the following projects. The following links were automatically generated to compare the c

[clang] [clang][Analyzer] Move checker 'alpha.unix.Errno' to 'unix.Errno'. (PR #69469)

2023-10-19 Thread Balázs Kéri via cfe-commits
balazske wrote: The checker was tested additionally on projects libwebm, bitcoin, contour and produced no results. https://github.com/llvm/llvm-project/pull/69469 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [clang][ASTImporter] Fix import of SubstTemplateTypeParmType in return type of function. (PR #69724)

2023-10-20 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/69724 Import of a function with `auto` return type that is expanded to a `SubstTemplateTypeParmType` could fail if the function itself is the template specialization where the parameter was replaced. From 2bfad6f0fb

[clang] [clang][Analyzer] Move checker 'alpha.unix.Errno' to 'unix.Errno'. (PR #69469)

2023-10-20 Thread Balázs Kéri via cfe-commits
@@ -934,6 +934,76 @@ Check calls to various UNIX/Posix functions: ``open, pthread_once, calloc, mallo .. literalinclude:: checkers/unix_api_example.c :language: c +.. _unix-Errno: + +unix.Errno (C) +"" + +Check for improper use of ``errno``. +This checker impl

[clang] [analyzer][NFC] Combine similar methods of StreamChecker (PR #70170)

2023-10-25 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/70170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer][NFC] Combine similar methods of StreamChecker (PR #70170)

2023-10-25 Thread Balázs Kéri via cfe-commits
https://github.com/balazske requested changes to this pull request. Probably add [clang] tag to the commit message, and remove the change in DiagnosticParseKinds.td, otherwise the change looks good. https://github.com/llvm/llvm-project/pull/70170 ___

[clang] [analyzer][NFC] Combine similar methods of StreamChecker (PR #70170)

2023-10-25 Thread Balázs Kéri via cfe-commits
@@ -1349,7 +1349,7 @@ def warn_omp_extra_tokens_at_eol : Warning< "extra tokens at the end of '#pragma omp %0' are ignored">, InGroup; def err_omp_multiple_step_or_linear_modifier : Error< - "multiple %select{'step size'|'linear modifier'}0 found in linear clause">; + "m

[clang] [analyzer][NFC] Combine similar methods of StreamChecker (PR #70170)

2023-10-25 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/70170 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix import of SubstTemplateTypeParmType in return type of function. (PR #69724)

2023-10-25 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/69724 From 2bfad6f0fbb7a5757318c77ef76335986d23ab83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 19 Oct 2023 16:27:24 +0200 Subject: [PATCH 1/2] [clang][ASTImporter] Fix import of Sub

[clang] [clang][ASTImporter] Fix crash when template class static member imported to other translation unit. (PR #68774)

2023-10-27 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/68774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix crash when template class static member imported to other translation unit. (PR #68774)

2023-10-27 Thread Balázs Kéri via cfe-commits
@@ -1373,6 +1373,40 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportCorrectTemplatedDecl) { ASSERT_EQ(ToTemplated1, ToTemplated); } +TEST_P(ASTImporterOptionSpecificTestBase, + ImportTemplateSpecializationStaticMember) { + auto FromCode = R"( + template clas

[clang] [clang][ASTImporter] Fix crash when template class static member imported to other translation unit. (PR #68774)

2023-10-27 Thread Balázs Kéri via cfe-commits
https://github.com/balazske commented: The fix looks good but the formatting of the test code could be better, like in the other tests. https://github.com/llvm/llvm-project/pull/68774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang-tools-extra] d1b2a52 - [clang-tidy] Add signal-handler-check for SEI CERT rule SIG30-C

2020-11-04 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2020-11-04T16:42:30+01:00 New Revision: d1b2a523191e22806aee381d54015b94b9dcad7a URL: https://github.com/llvm/llvm-project/commit/d1b2a523191e22806aee381d54015b94b9dcad7a DIFF: https://github.com/llvm/llvm-project/commit/d1b2a523191e22806aee381d54015b94b9dcad7a.diff L

[clang-tools-extra] 47518d6 - [clang-tidy] Improving bugprone-sizeof-expr check.

2020-11-19 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2020-11-19T10:26:33+01:00 New Revision: 47518d6a0aed7ec3607aeacfa511dedda2cd67cb URL: https://github.com/llvm/llvm-project/commit/47518d6a0aed7ec3607aeacfa511dedda2cd67cb DIFF: https://github.com/llvm/llvm-project/commit/47518d6a0aed7ec3607aeacfa511dedda2cd67cb.diff L

[clang] 98a8344 - [clang][ASTImporter] Add support for importing CXXFoldExpr.

2021-01-22 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-01-22T15:20:55+01:00 New Revision: 98a8344895a8e1f2cfa98b664b50fb7b864afa52 URL: https://github.com/llvm/llvm-project/commit/98a8344895a8e1f2cfa98b664b50fb7b864afa52 DIFF: https://github.com/llvm/llvm-project/commit/98a8344895a8e1f2cfa98b664b50fb7b864afa52.diff L

[clang] 7ce6385 - [clang][ASTImporter] Generic attribute import handling (first step).

2021-09-22 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-09-22T10:14:03+02:00 New Revision: 7ce638538bcf323cd15ed5dfbc43013312b0e3e3 URL: https://github.com/llvm/llvm-project/commit/7ce638538bcf323cd15ed5dfbc43013312b0e3e3 DIFF: https://github.com/llvm/llvm-project/commit/7ce638538bcf323cd15ed5dfbc43013312b0e3e3.diff L

[clang] a3a0b06 - [clang][ASTImporter] Import InheritedConstructor and ConstructorUsingShadowDecl.

2021-10-01 Thread Balázs Kéri via cfe-commits
Author: Gabor Marton Date: 2021-10-01T10:16:11+02:00 New Revision: a3a0b066264fd132a2014edf2aef53072a1fe53a URL: https://github.com/llvm/llvm-project/commit/a3a0b066264fd132a2014edf2aef53072a1fe53a DIFF: https://github.com/llvm/llvm-project/commit/a3a0b066264fd132a2014edf2aef53072a1fe53a.diff

[clang] cad9ff5 - [clang][ASTImporter] Import ConstructorUsingShadowDecl correctly.

2021-10-01 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-10-01T11:41:08+02:00 New Revision: cad9ff531c71e7c28d7bd5a64a26f9b214156b59 URL: https://github.com/llvm/llvm-project/commit/cad9ff531c71e7c28d7bd5a64a26f9b214156b59 DIFF: https://github.com/llvm/llvm-project/commit/cad9ff531c71e7c28d7bd5a64a26f9b214156b59.diff L

[clang] bcefea8 - [clang][ASTImporter] Add import of thread safety attributes.

2021-10-05 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-10-05T13:08:31+02:00 New Revision: bcefea80a40ead1e1fbec2e6fa001dd4816ca5c2 URL: https://github.com/llvm/llvm-project/commit/bcefea80a40ead1e1fbec2e6fa001dd4816ca5c2 DIFF: https://github.com/llvm/llvm-project/commit/bcefea80a40ead1e1fbec2e6fa001dd4816ca5c2.diff L

[clang] 085dcc8 - [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-16 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-02-17T09:02:49+01:00 New Revision: 085dcc82178f94b99783c5730e70a953e4105c00 URL: https://github.com/llvm/llvm-project/commit/085dcc82178f94b99783c5730e70a953e4105c00 DIFF: https://github.com/llvm/llvm-project/commit/085dcc82178f94b99783c5730e70a953e4105c00.diff L

[clang-tools-extra] 7dc7f0c - [clang-tidy] Add new check 'concurrency-thread-canceltype-asynchronous' and alias 'cert-pos47-c'.

2021-02-22 Thread Balázs Kéri via cfe-commits
Author: Balázs Kéri Date: 2021-02-22T12:42:20+01:00 New Revision: 7dc7f0c2ecc05b9a9c73e89facec24ad6d325cae URL: https://github.com/llvm/llvm-project/commit/7dc7f0c2ecc05b9a9c73e89facec24ad6d325cae DIFF: https://github.com/llvm/llvm-project/commit/7dc7f0c2ecc05b9a9c73e89facec24ad6d325cae.diff L

<    1   2   3   4   5   6   7   8   9   >