[PATCH] D158948: [clang][ASTImporter] Add import of type-related nodes

2023-08-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:1758 + *ToAttrLocOrErr); +} + At cases like this (many imported values) `importChecked` can be used, like at `VisitDependentSizedArrayType`. Comment at:

[PATCH] D157684: [clang][ASTImporter] Repeated friend templates are partially imported

2023-08-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:4087 + + if (TypeSourceInfo *TSI = FD1->getFriendType()) +return Importer.IsStructurallyEquivalent( This can be `const`? Comment at:

[PATCH] D157684: [clang][ASTImporter] Repeated friend templates are partially imported

2023-08-22 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:4072 + + if (auto *TSI = FD1->getFriendType()) +return Importer.IsStructurallyEquivalent( According to the coding rules `auto` should not be used here. Comment at:

[PATCH] D158156: [analyzer] Add C++ array delete checker

2023-08-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. I found that this concept of "fake" checkers (that change only options of a common checker instance) has more problems (checker dependencies, callback order, separation of "modeling" and bug report generation independently), it is better to avoid this. It is really

[PATCH] D156693: [clang][ASTImporter]Skip check depth of friend template parameter

2023-08-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske accepted this revision. balazske added a comment. This revision is now accepted and ready to land. My concern was related to nested namespaces or nested classes with friend declarations that are equivalent and differ only in the nesting level. It may be possible to construct code where

[PATCH] D156461: [clang][ASTImporter] Merge implicit ctors with definition

2023-08-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. After import we get a new AST that looks like this: |-CXXConstructorDecl 0x556e6a172d58 col:16 implicit used constexpr A 'void (A &&)' inline default trivial noexcept-unevaluated 0x556e6a172d58 | `-ParmVarDecl 0x556e6a172e78 col:16 'A &&' `-CXXConstructorDecl

[PATCH] D158145: [clang] Update NumFunctionDeclBits for FunctionDeclBitfields

2023-08-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/unittests/AST/DeclTest.cpp:368 + ASTContext = AST->getASTContext(); + Ctx.getTranslationUnitDecl()->dump(); + This dump is not needed? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D156693: [clang][ASTImporter]Skip check depth of friend template parameter

2023-08-15 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/unittests/AST/StructuralEquivalenceTest.cpp:1716 + IgnoreTemplateParmDepthAtNonTypeTemplateParmDecl) { + auto t = makeDecls( + R"( The convention is to start variable names with uppercase, for example

[PATCH] D157691: [ASTImporter] Remove extranous FunctionTemplateDecl introduced by templated friend

2023-08-15 Thread Balázs Kéri via Phabricator via cfe-commits
balazske accepted this revision. balazske added a comment. This revision is now accepted and ready to land. Additionally, use the "[clang][ASTImporter]" tags at commit message. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157691/new/

[PATCH] D156693: [clang][ASTImporter]Skip check depth of friend template parameter

2023-08-15 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/unittests/AST/StructuralEquivalenceTest.cpp:1709 + classTemplateDecl(hasName("A"))); + EXPECT_TRUE(testStructuralMatch(t)); + EXPECT_TRUE(testStructuralMatch(t, true)); The intent was to have

[PATCH] D157691: [ASTImporter] Remove extranous FunctionTemplateDecl introduced by templated friend

2023-08-15 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. When committing this patch, the commit message should not contain the whole AST and crash dump (phabricator takes the "summary" text), this looks too much in a commit message. One AST dump from the wrong To AST is enough. Comment at:

[PATCH] D156693: [clang][ASTImporter]Skip check depth of friend template parameter

2023-08-15 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/unittests/AST/StructuralEquivalenceTest.cpp:1697 +TEST_F(StructuralEquivalenceTemplateTest, + ClassTemplateEquivalentFriendClassTemplate) { + auto t = makeDecls( IgnoreTemplateParmDepth) {

[PATCH] D157691: [ASTImporter] Remove extranous FunctionTemplateDecl introduced by templated friend

2023-08-14 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. It is better to add a test to ASTImporterTests.cpp with the same code, and check the properties of DeclContext and LexicalDeclContext in the From and To AST (should be the same in "From" and "To" side). Comment at: clang/lib/AST/ASTImporter.cpp:6451

[PATCH] D156693: [clang][ASTImporter]Skip check depth of friend template parameter

2023-08-14 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. A simple test should be added to StructuralEquivalenceTest.cpp too to check if ignore (and not ignore) depth works. I think this solution is not always correct, but is still an improvement. Comment at:

[PATCH] D156461: [clang][ASTImporter] Merge implicit ctors with definition

2023-08-14 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. It looks not good to remove an invalid node from the DeclContext that otherwise remains in the AST. I checked the problem and found that the existing move constructor (originally in the To AST which had no definition) gets a `getNumCtorInitializers` value of 1 but the

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-08-10 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. About the questions: - How many issues does it raise? Would we flood the user? I did not experience that the checker produces many warnings. Any warning from this checker is connected to a function call of a standard API, and the number of such calls is usually not

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-08-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. I have checked the results on some projects (memcached,tmux,curl,twin,vim,openssl,sqlite,ffmpeg,postgres,xerces,bitcoin). These results are more interesting, some look correct, some probably not:

[PATCH] D156693: [clang][ASTImporter]Skip check friend template depth

2023-08-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. This fix can cause problems because the depth comparison is omitted all times. It would be better to omit depth check if the imported template is a friend, and has a `ClassTemplateSpecializationDecl` as context. Probably even then it is possible to construct cases

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-08-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. This checker was originally in the "unix" package. I agree that this is not exact and `core` can be better, the checked functions should be available in any default C library on UNIX, OSX, Windows or other platforms too, even the POSIX ones at least in some cases.

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-08-07 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 54. balazske added a comment. Herald added a subscriber: wangpc. Using the latest version of the checker. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152436/new/ https://reviews.llvm.org/D152436 Files:

[PATCH] D157238: [clang][ASTImporter] Add import of 'DependentSizedExtVectorType'

2023-08-07 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. In D157238#4565260 , @danix800 wrote: > In D157238#4565051 , @balazske > wrote: > >> `ASTImporter` part looks good, I did not check the generated documentation >> for correctness. > >

[PATCH] D157238: [clang][ASTImporter] Add import of 'DependentSizedExtVectorType'

2023-08-07 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. `ASTImporter` part looks good, I did not check the generated documentation for correctness. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157238/new/ https://reviews.llvm.org/D157238

[PATCH] D155715: [clang][analyzer] Improve StdCLibraryFunctions socket send/recv functions.

2023-08-07 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG52ac71f92d38: [clang][analyzer] Improve StdCLibraryFunctions socket send/recv functions. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D156693: [clang][ASTImporter]Skip check friend template declaration in VisitClassTemplateDecl

2023-08-04 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. The summary tells nothing about what is the real problem to fix here. In the lit test I see that an error message is displayed, this causes the test failure. The problem is that the structural equivalence check is not good for this special case. The imported AST

[PATCH] D156201: [ASTImporter] Fix corrupted RecordLayout introduced by circular referenced fields

2023-08-01 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a reviewer: aaron.ballman. balazske added a comment. The fix looks good, only a person with AST competence should have a look at it because a change in `Expr.h`. Comment at: clang/unittests/AST/ASTImporterTest.cpp:8033 +TEST_P(ASTImporterOptionSpecificTestBase,

[PATCH] D155661: [clang][ASTImporter] Fix friend class template import within dependent context

2023-08-01 Thread Balázs Kéri via Phabricator via cfe-commits
balazske accepted this revision. balazske added a comment. This revision is now accepted and ready to land. The fix looks OK, but the test could be improved and cleaned up (for example `FromClass` is the same as `FromD` in the test, and DeclContext is not checked, can be done like in the test

[PATCH] D155661: [clang][ASTImporter] Fix friend class template import within dependent context

2023-07-31 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:2862-2866 + bool ShouldAddRedecl = !(IsFriendTemplate && IsDependentContext); + // We may already have a record of the same name; try to find and match it. RecordDecl *PrevDecl = nullptr; if

[PATCH] D156201: [ASTImporter] Fix corrupted RecordLayout introduced by circular referenced fields

2023-07-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:7418 + + return UO; } Why is it better to use `CreateEmpty` instead of the old code? Does `Create` do something that does not work at this situation (probably getting the layout)? If

[PATCH] D155574: [clang][ASTImporter] Fix import of recursive field initializer.

2023-07-27 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf4438385d4d9: [clang][ASTImporter] Fix import of recursive field initializer. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D155574: [clang][ASTImporter] Fix import of recursive field initializer.

2023-07-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 544371. balazske added a comment. Added check for duplicate import of initializer. Added more tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155574/new/ https://reviews.llvm.org/D155574 Files:

[PATCH] D155574: [clang][ASTImporter] Fix import of recursive field initializer.

2023-07-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:3936-3937 +return std::move(Err); + if (ToInitializer) +ToField->setInClassInitializer(ToInitializer); return ToField; danix800 wrote: > Initializer could indirectly depends on

[PATCH] D155574: [clang][ASTImporter] Fix import of recursive field initializer.

2023-07-20 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 542383. balazske added a comment. using clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155574/new/ https://reviews.llvm.org/D155574 Files: clang/lib/AST/ASTImporter.cpp

[PATCH] D155715: [clang][analyzer] Improve StdCLibraryFunctions socket send/recv functions.

2023-07-19 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D155445: [analyzer][docs] Add CSA release notes

2023-07-19 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/docs/ReleaseNotes.rst:964 +- ``StdCLibraryFunctionArgs`` was merged into the ``StdCLibraryFunctions``. + The diagnostics of the ``StdCLibraryFunctions`` was improved. + (`4f0436dd1532

[PATCH] D154509: [clang][analyzer] StdLibraryFunctionsChecker: Allow NULL buffer in `fread` and `fwrite` if size is zero.

2023-07-19 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. balazske marked an inline comment as done. Closed by commit rGe271049bc6a1: [clang][analyzer] StdLibraryFunctionsChecker: Allow NULL buffer in `fread` and… (authored

[PATCH] D154509: [clang][analyzer] StdLibraryFunctionsChecker: Allow NULL buffer in `fread` and `fwrite` if size is zero.

2023-07-19 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:413-414 +using ValueConstraint::ValueConstraint; +ArgNo SizeArg1N; +std::optional SizeArg2N; +// This variable

[PATCH] D155574: [clang][ASTImporter] Fix import of recursive field initializer.

2023-07-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, martong, gamesh411, Szelethus, dkrupp. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: All. balazske requested review of this revision. Herald added a project: clang. Herald added a

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-07-18 Thread Balázs Kéri 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 rGf12808ab2036: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if… (authored by balazske). Repository: rG LLVM Github Monorepo

[PATCH] D154423: [clang][analyzer] Add all success/failure messages to StdLibraryFunctionsChecker.

2023-07-18 Thread Balázs Kéri 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 rG6dccf5b8d550: [clang][analyzer] Add all success/failure messages to… (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-07-18 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG39670ae3b934: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker. (authored by balazske). Changed prior to commit: https://reviews.llvm.org/D153612?vs=540015=541353#toc

[PATCH] D154764: [ASTImporter] Fields are imported first and reordered for correct layout.

2023-07-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. If I see correctly this change does that the re-ordered members are imported before all other, specially fields come before functions. This way order of fields is already correct when a function is imported. Comment at:

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-07-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. No major problems were indicated with the patch stack, I plan to merge all of these soon. Small problems can be still corrected before or when the checker is put out from the alpha package. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D154423: [clang][analyzer] Add all success/failure messages to StdLibraryFunctionsChecker.

2023-07-14 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. About the "`fileno` with standard stream" problem: I do not see an always good solution for this case because these standard streams are global variables. If we want to be exact, we can not know much about these at analysis start unless it is the `main` function. The

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-07-13 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 540015. balazske marked 6 inline comments as done. balazske added a comment. Changed format string back to `str().c_str()`, changed `dyn_cast_or_null`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153612/new/

[PATCH] D154983: [clang-extdef-mapping] register necessary targest for ms-style asm block

2023-07-12 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. I do not have the knowledge to approve this change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154983/new/ https://reviews.llvm.org/D154983 ___ cfe-commits mailing list

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-07-12 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 3 inline comments as done. balazske added inline comments. Comment at: clang/test/Analysis/stream-note.c:61-62 FILE *F1 = fopen("foo1.c", "r"); // expected-note {{Stream opened here}} + // stdargs-note@-1 {{'fopen' is successful}} + // stdargs-note@-2

[PATCH] D154701: [clang] Overridden CXXMethodDecl::isVirtual() assertion failed before fully imported.

2023-07-11 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. It is possible to reproduce the same problem with this test added to ASTImporterTest.cpp: TEST_P(ASTImporterOptionSpecificTestBase, ImportVirtualOverriddenMethodTest) { const char *Code = R"( void f1(); class A { virtual void

[PATCH] D154709: [clang][ASTImporter] Add a 'Message' member to ASTImportError and use it throughout ASTImporter

2023-07-10 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. The goal is to have a message always in `ASTImportError`? Then probably the constructor without message can be removed, at least to check if really the message is added at all places. I found that it is missing in `VisitObjCImplementationDecl`. I do not know what

[PATCH] D154423: [clang][analyzer] Add all success/failure messages to StdLibraryFunctionsChecker.

2023-07-10 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. It would be more simple to handle the standard streams in `StreamChecker` only. There it is possible to detect standard streams (should be variables with the known names) as arguments to functions. If `StreamChecker` eliminates the failure branch of `fileno` it will

[PATCH] D154423: [clang][analyzer] Add all success/failure messages to StdLibraryFunctionsChecker.

2023-07-07 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. The standard streams may need special handling, this can be useful for `StreamChecker` too. One problem is that the standard streams can be changed by the program, so we can not know for sure if these are the original values. Still it can be better to assume that

[PATCH] D154509: [clang][analyzer] StdLibraryFunctionsChecker: Allow NULL buffer in `fread` and `fwrite` if size is zero.

2023-07-05 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D154423: [clang][analyzer] Add all success/failure messages to StdLibraryFunctionsChecker.

2023-07-05 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 537346. balazske added a comment. Added AT_FDCWD `openat` test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154423/new/ https://reviews.llvm.org/D154423 Files:

[PATCH] D154423: [clang][analyzer] Add all success/failure messages to StdLibraryFunctionsChecker.

2023-07-05 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Results from the last run (the same applies as before, the run postfix `_3` must be selected at top right corner): | memcached_1.6.8_stdclf_notetag_interesting_test_3 | Reports

[PATCH] D154423: [clang][analyzer] Add all success/failure messages to StdLibraryFunctionsChecker.

2023-07-04 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-07-04 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 537003. balazske added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153776/new/ https://reviews.llvm.org/D153776 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-07-04 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 537002. balazske added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153612/new/ https://reviews.llvm.org/D153612 Files: clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-07-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. The success/failure note tags are not added to all functions, `dup` is one of these, this means at `dup` no note tag is shown. A next patch can be made to add these messages to all functions. The other places look good, but CodeChecker is a bit tricky, you must select

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-06-30 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. | results with the latest version: | | memcached_1.6.8_stdclf_notetag_interesting_test_2 | Reports

[PATCH] D153363: [clang][analyzer] No end-of-file when seek to file begin.

2023-06-30 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2eefd19613b8: [clang][analyzer] No end-of-file when seek to file begin. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153363/new/

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-06-30 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 536133. balazske added a comment. Rebase to newest parent review version. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153776/new/ https://reviews.llvm.org/D153776 Files:

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-06-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 535800. balazske added a comment. Fixed review issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153612/new/ https://reviews.llvm.org/D153612 Files: clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp

[PATCH] D153889: [analyzer][NFC] Fix dangling StringRef in barely used code

2023-06-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. This is actually needed to get correct bug reports in D153612 , otherwise I got garbage messages (probably a `std::string` stack variable was passed to the `getNoteTag` function). I would not say that this is NFC because it is a

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-06-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 535655. balazske marked 3 inline comments as done. balazske added a comment. Fixed review issues. Note tag is added for `fread`. Notes contain now the function name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1299 +// StdLibraryFunctionsChecker. +ExplodedNode *Pred = const_cast(Node); +if (!Case.getNote().empty()) { donat.nagy wrote: > balazske

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 534991. balazske marked 5 inline comments as done. balazske added a comment. Fixed review issues Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153612/new/ https://reviews.llvm.org/D153612 Files:

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1325 if (!Pred) -break; +continue; } steakhal wrote: > Why do you continue here? Do you have a case for this? This is only

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Here are results for vim, still the fileno problem is not fixed. This run was made before the last update

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 534868. balazske added a comment. `markInteresting` must be used at arguments found to be invalid Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153776/new/ https://reviews.llvm.org/D153776 Files:

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1299 +// StdLibraryFunctionsChecker. +ExplodedNode *Pred = const_cast(Node); +if (!Case.getNote().empty()) { donat.nagy wrote: > Can you

[PATCH] D153776: [clang][analyzer] Display notes in StdLibraryFunctionsChecker only if interesting

2023-06-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-06-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 534487. balazske added a comment. Add note tag always if function is not evaluated as "pure". Reformat the code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153612/new/ https://reviews.llvm.org/D153612

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-06-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. In D152436#4438956 , @NoQ wrote: > Uh-oh, looks like I'm not paying nearly enough attention to this discussion > (sorry about that!!) > > I'm somewhat skeptical of the decision made in D151225 >

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-06-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/test/Analysis/errno-stdlibraryfunctions-notes.c:17 access("path", 0); - // expected-note@-1{{Assuming that function 'access' is successful, in this case the value 'errno' may be undefined after the call and should not be

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-06-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. For first experiment I have made patch D153612 that adds a `NoteTag` to "all" standard function calls. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152436/new/

[PATCH] D153424: [clang][ASTImporter] Add import of CXXRewrittenBinaryOperator.

2023-06-23 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdd639eb15aac: [clang][ASTImporter] Add import of CXXRewrittenBinaryOperator. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D153612: [clang][analyzer] Add and change NoteTags in StdLibraryFunctionsChecker.

2023-06-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D153424: [clang][ASTImporter] Add import of CXXRewrittenBinaryOperator.

2023-06-22 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/test/ASTMerge/cxx-rewritten-binary-operator/Inputs/std-compare.h:307 + +#endif // STD_COMPARE_H I do not like to add this file but could not find a better solution. The file is copied from other test, this file

[PATCH] D153424: [clang][ASTImporter] Add import of CXXRewrittenBinaryOperator.

2023-06-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, martong, gamesh411, Szelethus, dkrupp. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: All. balazske requested review of this revision. Herald added a project: clang. Herald added a

[PATCH] D153363: [clang][analyzer] No end-of-file when seek to file begin.

2023-06-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. This case

[PATCH] D153363: [clang][analyzer] No end-of-file when seek to file begin.

2023-06-20 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-06-19 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. It is possible to add note tags to show decisions at standard functions. For example at `fileno` show if it has failed or not failed. The most simple way is to add it to all places, this means a note will show up on any bug path at all standard function usages. This

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-06-09 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. In D152436#4408301 , @steakhal wrote: > In D152436#4405558 , @balazske > wrote: > >> These are reports that could be improved: >> link >>

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-06-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Another question is if default value of `ModelPOSIX` can be changed to true? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152436/new/ https://reviews.llvm.org/D152436 ___

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-06-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. One deficiency is that some filenames of test files contain the old **std-c-library-functions-arg** name that is not used any more. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152436/new/

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-06-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. I could test the checker on these projects (CTU analysis was not used): memcached,tmux,curl,twin,vim,openssl,sqlite,ffmpeg,postgres,tinyxml2,libwebm,xerces,bitcoin,protobuf,qtbase,contour,acid These are reports that could be improved: link

[PATCH] D152436: [clang][analyzer] Move checker alpha.unix.StdCLibraryFunctions out of alpha.

2023-06-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D152169: [clang][analyzer] Add report of NULL stream to StreamChecker.

2023-06-06 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2c60f9c8a4fd: [clang][analyzer] Add report of NULL stream to StreamChecker. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D152169: [clang][analyzer] Add report of NULL stream to StreamChecker.

2023-06-05 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:553 HelpText<"Check stream handling functions">, + WeakDependencies<[NonNullParamChecker]>, Documentation; steakhal wrote: > What's the purpose of this

[PATCH] D152169: [clang][analyzer] Add report of NULL stream to StreamChecker.

2023-06-05 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D151225: [clang][analyzer] Merge apiModeling.StdCLibraryFunctions and StdCLibraryFunctionArgs checkers into one.

2023-06-01 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4f0436dd1532: [clang][analyzer] Merge apiModeling.StdCLibraryFunctions and… (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D151431: [clang-tidy] Add check bugprone-unique-ptr-array-mismatch.

2023-05-31 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb0bab14b8b53: [clang-tidy] Add check bugprone-unique-ptr-array-mismatch. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151431/new/

[PATCH] D151431: [clang-tidy] Add check bugprone-unique-ptr-array-mismatch.

2023-05-31 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 526927. balazske added a comment. removed check name in documentation code comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151431/new/ https://reviews.llvm.org/D151431 Files:

[PATCH] D151225: [clang][analyzer] Merge apiModeling.StdCLibraryFunctions and StdCLibraryFunctionArgs checkers into one.

2023-05-30 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. There are still some problems with dependencies, the `ErrnoChecker` really needs now the `StdCLibraryFunctions` checker (to be turned on and run before) but this is not enforced. The checker order looks to work but not enforced specially. Repository: rG LLVM

[PATCH] D151225: [clang][analyzer] Merge apiModeling.StdCLibraryFunctions and StdCLibraryFunctionArgs checkers into one.

2023-05-30 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 526623. balazske added a comment. Updated documentation and removed occurrences of old checker name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151225/new/ https://reviews.llvm.org/D151225 Files:

[PATCH] D151431: [clang-tidy] Add check bugprone-unique-ptr-array-mismatch.

2023-05-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. The case of fully dependent type (`unique_ptr`) is not working in this checker and likely not in `SharedPtrArrayMismatchCheck`. I can fix this in a next patch (for both checkers). Maybe we can remove the warning in all cases when the type is a POD type (or add a check

[PATCH] D151431: [clang-tidy] Add check bugprone-unique-ptr-array-mismatch.

2023-05-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 526063. balazske marked an inline comment as done. balazske added a comment. Fixed the documentation issue. Added tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151431/new/

[PATCH] D151431: [clang-tidy] Add check bugprone-unique-ptr-array-mismatch.

2023-05-25 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: PiotrZSL, carlosgalvezp, steakhal, martong, gamesh411, Szelethus, dkrupp, xazax.hun. Herald added a reviewer: njames93. Herald added a project: All. balazske requested review of this revision. Herald added a project: clang-tools-extra.

[PATCH] D151225: [clang][analyzer] Merge apiModeling.StdCLibraryFunctions and StdCLibraryFunctionArgs checkers into one.

2023-05-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: steakhal, manas, ASDenysPetrov, martong, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a reviewer: NoQ. Herald added a

[PATCH] D149447: [clang][analyzer] Improve documentation of StdCLibraryFunctionArgs checker (NFC)

2023-05-18 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4400ff587be2: [clang][analyzer] Improve documentation of StdCLibraryFunctionArgs checker (NFC) (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D149447: [clang][analyzer] Improve documentation of StdCLibraryFunctionArgs checker (NFC)

2023-05-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/docs/analyzer/checkers.rst:2490-2523 +**List of checked functions** + +``fgetc``, ``fread``, ``fwrite``, ``getc``, ``getchar``, ``getdelim``, +``getenv``, ``getline``, ``isalnum``, ``isalpha``, ``isascii``, ``isblank``,

  1   2   3   4   5   6   7   8   9   10   >