[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 244140. martong added a comment. - Remove debug dump - Add TryExpandAsInteger to CheckerHelpers.h Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74473/new/ https://reviews.llvm.org/D74473 Files: clang/include

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 244141. martong added a comment. - Remove PP declaration Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74473/new/ https://reviews.llvm.org/D74473 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 244143. martong added a comment. - EOFMacroIt -> MacroIt Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74473/new/ https://reviews.llvm.org/D74473 Files: clang/include/clang/StaticAnalyzer/Core/PathSensitive/

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > Harbormaster failed remote builds in B46321 > : Diff 244141! This is actually true, I have a test that crashes! Finally, a case where remote builds are proved to be useful! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 244149. martong added a comment. - Fix crash in TryExpandAsInteger Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74473/new/ https://reviews.llvm.org/D74473 Files: clang/include/clang/StaticAnalyzer/Core/Path

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:571 +.Case( +{ReturnValueCondition(WithinRange, {{EOFv, EOFv}, {0, UCharMax}})}); }; Szel

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 244173. martong marked 6 inline comments as done. martong added a comment. - Move include of Preprocessor.h to CheckerHelpers.cpp - Try -> try - Use PP.getIdentifierInfo - Handle parens in tryExpandAsInteger Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-13 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 244376. martong marked 6 inline comments as done. martong added a comment. - Enable core checkers explicitly in test - Add ASCII art to depict a range list example Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:313-321 for (size_t I = 1; I != E; ++I) { const llvm::APSInt &Min = BVF.getValue(R[I - 1].second + 1ULL, T); const llvm::APSInt &Max = BVF.getValue(R[I]

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-13 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG536456a7e93d: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D74542: [ASTImporter] Prevent the ASTImporter from creating multiple main FileIDs.

2020-02-13 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a reviewer: balazske. martong added a subscriber: balazske. martong added a comment. This revision is now accepted and ready to land. Looks good to me! Thanks! Adding @balazske as another reviewer though. He worked on something related to this, where

[PATCH] D74542: [ASTImporter] Prevent the ASTImporter from creating multiple main FileIDs.

2020-02-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D74542#1874221 , @teemperor wrote: > In D74542#1874201 , @martong wrote: > > > Looks good to me! Thanks! > > Adding @balazske as another reviewer though. He worked on something > > rela

[PATCH] D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints

2020-02-13 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 244430. martong added a comment. - Rebase to master Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73898/new/ https://reviews.llvm.org/D73898 Files: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecke

[PATCH] D74554: [ASTImporter] Added visibility check for scoped enums.

2020-02-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:2600 + EnumDecl *FoundDef = FoundEnum->getDefinition(); + if (D->isThisDeclarationADefinition() && FoundDef) +return Importer.MapImported(D, FoundDef); shafik w

[PATCH] D74639: Add linkage check to ASTNodeImporter::hasSameVisibilityContext and rename to hasSameVisibilityContextAndLinkage

2020-02-17 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/lib/AST/ASTImporter.cpp:989 !Found->hasExternalFormalLinkage(); } balazske wrote: > This would be equivalent but mor

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-17 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp:114-117 + const auto MacroIt = llvm::find_if( + PP.macros(), [&](const auto &K) { return K.first->getName() == Macro; }); + if (MacroIt ==

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-17 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp:114-117 + const auto MacroIt = llvm::find_if( + PP.macros(), [&](const auto &K) { return K.first->getName() == Macro; }); + if (MacroIt ==

[PATCH] D74735: [analyzer] Add support for CXXInheritedCtorInitExpr.

2020-02-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:872 +/// +/// Example: \c class T : public S { using S::S; }; T(1); +class CXXInheritedConstructorCall : public AnyFunctionCall { Perhaps the example cou

[PATCH] D74735: [analyzer] Add support for CXXInheritedCtorInitExpr.

2020-02-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:436 case CXXConstructExpr::CK_Complete: { +assert(CE && "Complete constructors cannot be inherited!"); std::tie(State, Target) = baloghadamsoftware wrote: > mar

[PATCH] D74735: [analyzer] Add support for CXXInheritedCtorInitExpr.

2020-02-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:436 case CXXConstructExpr::CK_Complete: { +assert(CE && "Complete constructors cannot be inherited!"); std::tie(State, Target) = NoQ wrote: > martong wrote: > >

[PATCH] D74473: [analyzer] StdLibraryFunctionsChecker: Use platform dependent EOF and UCharMax

2020-02-18 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CheckerHelpers.cpp:114-117 + const auto MacroIt = llvm::find_if( + PP.macros(), [&](const auto &K) { return K.first->getName() == Macro; }); + if (MacroIt ==

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2020-01-21 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D71612#1828059 , @NoQ wrote: > This looks fantastic. Let's enable by it default! Ok, I've done that: https://github.com/llvm/llvm-project/commit/bc29069dc40 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D73166: [ASTImporter] Properly delete decls from SavedImportPaths

2020-01-22 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Thanks for the fix! Looks good to me! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73166/new/ https://reviews.llvm.org/D73166

[PATCH] D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc)

2020-01-27 Thread Gabor Marton via Phabricator via cfe-commits
martong edited reviewers, added: teemperor; removed: a.sidorin. martong added a comment. Herald added a reviewer: a.sidorin. @teemperor , @shafik Guys, could you please take a look on this patch? I don't think that type locations could have any effects on LLDB, but one may never know, so, it is

[PATCH] D73667: Speed up compilation of ASTImporter

2020-01-30 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Thanks for the patch! Looks good to me! Comment at: clang/lib/AST/ASTImporter.cpp:192 + // Don't attempt to import nodes if we hit an error earlier. + if (Err) +

[PATCH] D73675: Avoid many std::tie/tuple instantiations in ASTImporter

2020-01-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for this patch too! However, I have a minor concern with this new approach: If `importSeq` fails then a `ToSomething` still holds a value from the "From" context. This could cause problems if it is used later in creating the new AST node. Normally, this should not

[PATCH] D73675: Avoid many std::tie/tuple instantiations in ASTImporter

2020-01-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a subscriber: gamesh411. martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:1152 + if (Error E = importSeq(ToElementType, ToSizeExpr)) +return std::move(E); Quuxplusone wrote: > As the author of [P1155 "More Implicit Mov

[PATCH] D73675: Avoid many std::tie/tuple instantiations in ASTImporter

2020-01-31 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Ok, this looks good to me now. And I really appreciate the work you have done here, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7367

[PATCH] D73675: Avoid many std::tie/tuple instantiations in ASTImporter

2020-01-31 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:1168 + Error Err = Error::success(); + QualType ToElementType = T->getElementType(); + Expr *ToSizeExpr = T->getSizeExpr(); shafik wrote: > Should this group be using `importChecked` as w

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-20 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 139181. martong marked 14 inline comments as done. martong added a comment. Update based on Alexei's comments. - Use createVirtualFile in testImport - Add minimal style changes - Use DeclCounter - Add hasFieldOrder matcher - Add parameterized tests Reposito

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-20 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: unittests/AST/ASTImporterTest.cpp:198 + Language ToLang, StringRef Identifier = "declToImport") { +ArgVector FromArgs = getBasicRunOptionsForLanguage(FromLang), + ToArgs = getBasicRunOptionsForLanguage(T

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-21 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: unittests/AST/ASTImporterTest.cpp:1169 + MatchVerifier Verifier; + ASSERT_TRUE(Verifier.match(From, cxxRecordDecl(has(fieldDecl(); + ASSERT_TRUE(Verifier.match(To, cxxRecordDecl(has(fieldDecl(); a.sidorin wrot

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-21 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 139295. martong marked 7 inline comments as done. martong added a comment. Add minor syntax changes and rename Repository: rC Clang https://reviews.llvm.org/D43967 Files: unittests/AST/ASTImporterTest.cpp unittests/AST/DeclMatcher.h Index: unittests

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-23 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 139567. martong marked 3 inline comments as done. martong added a comment. - Add some minor changes based on xazax's comments Repository: rC Clang https://reviews.llvm.org/D43967 Files: unittests/AST/ASTImporterTest.cpp unittests/AST/DeclMatcher.h I

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: unittests/AST/ASTImporterTest.cpp:276 +// This will not create the file more than once. +createVirtualFile(ToAST.get(), It->FileName, It->Code); + xazax.hun wrote: > Maybe an IfNeeded suffix or something like tha

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Hi Aleksei, I don't have commit permissions, could you please help and commit? Repository: rC Clang https://reviews.llvm.org/D43967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/ma

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 139791. martong added a comment. - Fix gcc 5 warnings Repository: rC Clang https://reviews.llvm.org/D43967 Files: unittests/AST/ASTImporterTest.cpp unittests/AST/DeclMatcher.h Index: unittests/AST/DeclMatcher.h ==

[PATCH] D38943: [ASTImporter] import SubStmt of CaseStmt

2018-03-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: cfe/trunk/unittests/AST/ASTImporterTest.cpp:100 + // This traverses the AST to catch certain bugs like poorly or not + // implemented subtrees. r.stahl wrote: > a.sidorin wrote: > > I just saw this change and I canno

[PATCH] D43967: [ASTImporter] Add test helper Fixture

2018-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Ping. Could someone with commit rights please commit this? @szepet or @xazax.hun ? Repository: rC Clang https://reviews.llvm.org/D43967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D117568: [Analyzer] Add docs to StdCLibraryFunctionArgsChecker

2022-01-18 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, gamesh411, NoQ. Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. martong requested review

[PATCH] D117568: [Analyzer] Add docs to StdCLibraryFunctionArgsChecker

2022-01-19 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 401230. martong marked 3 inline comments as done. martong added a comment. - Describe the different kind of constraints and limitations - Some rewording Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117568/new/

[PATCH] D117568: [Analyzer] Add docs to StdCLibraryFunctionArgsChecker

2022-01-19 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/docs/analyzer/checkers.rst:2361 +(void)ret; +clang_analyzer_eval(EOF <= x && x <= 255); // this reports TRUE + } NoQ wrote: > I recommend against using `clang_analyzer_eval` in user docs. Users aren't > e

[PATCH] D117229: [Analyzer] Produce SymbolCast for pointer to integer cast

2022-01-19 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 401274. martong marked an inline comment as done. martong added a comment. - Move the comment hunk Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117229/new/ https://reviews.llvm.org/D117229 Files: clang/incl

[PATCH] D117229: [Analyzer] Produce SymbolCast for pointer to integer cast

2022-01-19 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:1022 +SVal clang::ento::SValBuilder::simplifySymbolCast(SymbolRef SE, + QualType CastTy) { ASDenysPetrov wrote: > And it'd

[PATCH] D115521: [Templight] Don't display empty strings for names of unnamed template parameters

2022-01-19 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115521/new/ https://reviews.llvm.org/D115521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[PATCH] D116155: [clang][AST][ASTImporter] Set record to complete during import of its members.

2022-01-19 Thread Gabor Marton via Phabricator via cfe-commits
martong added a subscriber: teemperor. martong added a comment. Adding Raphael @teemperor , he might have useful comments about the minimal mode. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116155/new/ https://reviews.llvm.org/D116155 _

[PATCH] D117568: [Analyzer] Add docs to StdCLibraryFunctionArgsChecker

2022-01-31 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG280b43031ca0: [Analyzer] Add docs to StdCLibraryFunctionArgsChecker (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117568/new/ https:/

[PATCH] D101060: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

2021-04-22 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, NoQ, vsavchenko. Herald added subscribers: ASDenysPetrov, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szeleth

[PATCH] D101060: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

2021-04-22 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1 -//=== StdLibraryFunctionsChecker.cpp - Model standard functions -*- C++ -*-===// // upsz Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D101060: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

2021-04-22 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 339603. martong marked an inline comment as not done. martong added a comment. - Put back first line - Remove wrong comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101060/new/ https://reviews.llvm.org/D10

[PATCH] D101060: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

2021-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added a comment. Thanks for the review Valeriy! Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:338-339 } +llvm_unreachable("The constraint must be either a concrete value or " +

[PATCH] D101060: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

2021-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 339934. martong marked 3 inline comments as done. martong added a comment. - Assert on SizeArgN Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101060/new/ https://reviews.llvm.org/D101060 Files: clang/lib/Sta

[PATCH] D101060: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

2021-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/test/Analysis/std-c-library-functions-arg-constraints-notes.cpp:32 +__buf_size_arg_constraint_concrete(buf); // \ +// expected-note{{The size of the 0th arg should be equal to or l

[PATCH] D101060: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

2021-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 33. martong marked an inline comment as done. martong added a comment. - Start arg index display from 1. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101060/new/ https://reviews.llvm.org/D101060 Files:

[PATCH] D101041: [analyzer] Find better description for tracked symbolic values

2021-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Awesome! Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1529 + // b = a; + // c = foo(b); + // I'd rather use `identity` here (and at line 1509) instead of `foo`, I think that could make this e

[PATCH] D101041: [analyzer] Find better description for tracked symbolic values

2021-04-23 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1532 + // Telling the user that the value of 'a' is assigned to 'c', while + // correct, can be confusing. + StoreManager::FindUniqueBinding FB(V.getAsLocSymbol()); ---

[PATCH] D101060: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints

2021-04-23 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa7cb951fa40d: [Analyzer][StdLibraryFunctionsChecker] Describe arg constraints (authored by martong). Changed prior to commit: https://reviews.llvm.org/D101060?vs=33&id=340048#toc Repository: rG L

[PATCH] D101041: [analyzer] Find better description for tracked symbolic values

2021-04-26 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. For me it looks good now. The changes, however, seem to be unrelated to retain count checker. Do you think it would make sense to upstream this patch independently from the other 3 patches

[PATCH] D101236: [ASTImporter] Import definitions required for layout of [[no_unique_address]] from LLDB

2021-04-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. To provide unit tests that mimic the LLDB setup, a good starting point could be an existing test case: struct LLDBLookupTest : ASTImporterOptionSpecificTestBase { You can create a similar descendant class, but with the MinimalImport flag set to true. Then you could c

[PATCH] D101358: [analyzer][StdLibraryFunctionsChecker] Track dependent arguments

2021-04-27 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: vsavchenko, NoQ, steakhal. Herald added subscribers: ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. marton

[PATCH] D101358: [analyzer][StdLibraryFunctionsChecker] Track dependent arguments

2021-04-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Wow, thanks for the real quick review! I appreciate it! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101358/new/ https://reviews.llvm.org/D101358 ___ cfe-commits mailing list

[PATCH] D101358: [analyzer][StdLibraryFunctionsChecker] Track dependent arguments

2021-04-27 Thread Gabor Marton 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 rG4b99f9c7db26: [analyzer][StdLibraryFunctionsChecker] Track dependent arguments (authored by martong). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints

2021-04-29 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: vsavchenko, NoQ, steakhal. Herald added subscribers: ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. marton

[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints

2021-04-30 Thread Gabor Marton via Phabricator via cfe-commits
martong planned changes to this revision. martong marked 4 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:836-837 + NewState, NewNode, + C.getNoteTag([Msg](PathSensitiveBugRep

[PATCH] D101236: [ASTImporter] Import definitions required for layout of [[no_unique_address]] from LLDB

2021-05-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/unittests/AST/ASTImporterTest.cpp:6408 + // Import the definition of the created class. + llvm::Error Err = findFromTU(FromC)->Importer->ImportDefinition(ToC); + EXPECT_FALSE((bool)Err); I suppose that the probl

[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints

2021-05-03 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 4 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:836-837 + NewState, NewNode, + C.getNoteTag([Msg](PathSensitiveBugReport &BR, + llv

[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints

2021-05-03 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/test/Analysis/std-c-library-functions-arg-constraints-note-tags.cpp:16 +int test_note(int x, int y) { +__single_val_1(x); // expected-note{{Applied constraint: The 1st arg should be

[PATCH] D101526: [analyzer][StdLibraryFunctionsChecker] Add NoteTags for applied arg constraints

2021-05-03 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 342342. martong marked an inline comment as done. martong added a comment. - Add the description to the note tag only if the SVal is interesting - Use 'Assuming the nth arg is in ...' form for the descriptions Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D101763: [analyzer][ctu] Avoid parsing invocation list again and again during on-demand parsing of CTU

2021-05-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thank you for this patch! Could you please provide a lit test that ignites the over and over parsing behaviour? I think you need to create two files and the second one should contain parser error(s). Comment at: clang/include/clang/CrossTU/CrossTrans

[PATCH] D116155: [clang][AST][ASTImporter] Set record to complete during import of its members.

2022-01-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:2021 + // fields imported) at that time without multiple AST import passes. + To->setCompleteDefinition(true); // Complete the definition even if error is returned. balazske wrote: > ba

[PATCH] D55134: [CTU] Add triple/lang mismatch handling

2022-01-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D55134#3224339 , @ychen wrote: > FWIW, ASTUnit seems to save an effective triple while the current AST uses > the nominal triple. (for example, `armv7a-xx-xx-eabihf` vs > `armv7a-xx-xx-eabi`). I'm not sure if there is a good s

[PATCH] D115521: [Templight] Don't display empty strings for names of unnamed template parameters

2022-01-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/Frontend/FrontendActions.cpp:501 + +if (const auto *Decl = dyn_cast(NamedTemplate)) { + if (const auto *R = dyn_cast(Decl)) { martong wrote: > Should this handle `EnumDecl`s as well? An enum declaratio

[PATCH] D115355: Fix build failure with GCC 11 in C++20 mode

2022-01-06 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2ccf0b76bcaf: Fix build failure with GCC 11 in C++20 mode (authored by Godin, committed by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115355/new

[PATCH] D114706: [analyzer] Fix sensitive argument logic in GenericTaintChecker

2022-01-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > The semantics of taint sinks is that if ANY of the arguments is tainted, a > warning should be emmitted. Before this change, if there were multiple > arguments that are sensitive, and if the first arg is not tainted, but any of > the noninitial are tainted, a warning is

[PATCH] D114622: [clang-tidy][analyzer] Fix false-positive in IdenticalExprChecker and misc-redundant-expression

2022-01-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D114622#3200678 , @NoQ wrote: > These checks are almost 2000 lines of code each and it looks like all they do > is figure out if two statements are the same and we have a very flexible > reusable solution for this sort of stu

[PATCH] D91000: [clang-tidy] Add cert-msc24-c checker.

2022-01-10 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > I think for now it is enough to issue a warning of using these functions, and > not suggest a replacement. Should we add an option to the checker to also > check for these functions? IMHO, it is okay to start with just simply issuing the warning. Later we might add

[PATCH] D105340: [analyzer] Produce SymbolCast symbols for integral types in SValBuilder::evalCast

2022-01-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D105340#3237430 , @ASDenysPetrov wrote: > In D105340#3232671 , @NoQ wrote: > >> This looks great with the option flag. Landing this patch will enable more >> people to test the new mo

[PATCH] D115932: [Analyzer] Create and handle SymbolCast for pointer to integral conversion

2022-01-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for the review guys. Artem, I agree, that we should remove `LocAsInteger`. `LocaAsInteger` is a primitive handling of a specific cast operation (when we cast a pointer to an integer). The integration of `LocaAsInteger` into the `SymExpr` hierarchy is problemati

[PATCH] D115932: [Analyzer] Create and handle SymbolCast for pointer to integral conversion

2022-01-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Ah, I forgot to mention one last point: 5. Revert D115149 . We should never reach that problematic assertion once we produce the `SymbolCast`s. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D117229: [Analyzer] Produce SymbolCast for pointer to integer cast

2022-01-13 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: ASDenysPetrov, NoQ, steakhal. Herald added subscribers: manas, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. martong requested review

[PATCH] D115932: [Analyzer] Create and handle SymbolCast for pointer to integral conversion

2022-01-13 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > I took Denys' patch D105340 and created a > prototype on top of that to create the SymbolCast in > SValBuilder::evalCastSubKind(loc::MemRegionVal V, Here is the new (alternative) patch: https://reviews.llvm.org/D117229 Repository:

[PATCH] D114418: [clang][ASTImporter] Update lookup table correctly at deduction guides.

2021-12-06 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG341a30a4ba4b: [clang][ASTImporter] Update lookup table correctly at deduction guides. (authored by balazske, committed by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https

[PATCH] D115149: [analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions

2021-12-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D115149#3175068 , @NoQ wrote: >> It can happen if the `Loc` was perfectly constrained to a concrete >> value (`nonloc::ConcreteInt`) > > This shouldn't happen. It should be `loc::ConcreteInt` which is, well, a > `Loc`. I see

[PATCH] D114938: [Analyzer][NFCi] SValBuilder: Simlify a SymExpr to the absolute simplest form

2021-12-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D114938#3174331 , @steakhal wrote: > You mentioned in the summary that there are different places where > simplification-like machinary kicks in, which hindered the test case > synthesis. What places did you refer to exactly?

[PATCH] D114938: [Analyzer][NFCi] SValBuilder: Simlify a SymExpr to the absolute simplest form

2021-12-07 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG978431e80b61: [Analyzer] SValBuilder: Simlify a SymExpr to the absolute simplest form (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D11

[PATCH] D115149: [analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions

2021-12-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D115149#3188743 , @ASDenysPetrov wrote: >> @steakhal >> I don't get this one. I've provided a bunch of tests, even annotated with >> `no-crash` comments where we crashed prior to this change. > > I wasn't able to catch any cr

[PATCH] D46081: [analyzer] Expand conversion check to check more expressions for overflow and underflow

2021-12-15 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbd9e23943a22: [analyzer] Expand conversion check to check more expressions for overflow and… (authored by martong). Changed prior to commit: https://reviews.llvm.org/D46081?vs=144202&id=394502#toc Repo

[PATCH] D115149: [analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions

2021-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D115149#3192725 , @ASDenysPetrov wrote: > @martong wrote: > >> Denis, you can see in the `Revision Contents` that Diff 3 has the baseline >> commit `63a6348`. When I check out `63a6348` then the newly added test file >> trig

[PATCH] D115149: [analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions

2021-12-17 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D115149#3195377 , @ASDenysPetrov wrote: > @martong > Thanks for clarification. > >> TLDR, it is recommended to use the arcanist. > > I'm not able to use arcanist. It doesn't work on Windows (at least I've tryed > several ways

[PATCH] D115932: [Analyzer] Create and handle SymbolCast for pointer to integral conversion

2021-12-17 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, NoQ, ASDenysPetrov. Herald added subscribers: manas, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. martong requested review

[PATCH] D115149: [analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions

2021-12-17 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D115149#3181580 , @NoQ wrote: > Like, that's the whole reason why `nonloc::LocAsInteger` exists: so that we > could cast a pointer to an integer and actually have a way to represent the > resulting value as `NonLoc`. > I'm co

[PATCH] D115932: [Analyzer] Create and handle SymbolCast for pointer to integral conversion

2021-12-17 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:417 + // the member function of SValBuilder (?) + if (symRHS) +if (auto RLocAsInt = RHS.getAs()) { We should handle LHS as well. Repository: rG LLVM Github Monorepo

[PATCH] D98951: [clang][ASTImporter] Add import API for 'const Type *' (NFC).

2021-03-22 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Herald added a subscriber: rnkovacs. LG! Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98951/new/ https://reviews.llvm.org/D98951 ___ cfe-

[PATCH] D99062: [clang][ASTImporter] Import "CapturedVLAType" in FieldDecl.

2021-03-22 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. This revision is now accepted and ready to land. Herald added a subscriber: rnkovacs. LGTM! Thanks! Comment at: clang/unittests/AST/ASTImporterTest.cpp:6213-6216 + R"(void declToImport(int N) { + int VLA[N]; +

[PATCH] D99343: [Analyzer] Infer 0 value when the divisible is 0 (bug fix)

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, NoQ, vsavchenko, Szelethus. Herald added subscribers: ASDenysPetrov, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. martong requested review of this

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, NoQ, vsavchenko, Szelethus. Herald added subscribers: ASDenysPetrov, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. martong requested review of this

[PATCH] D99343: [Analyzer] Infer 0 value when the divisible is 0 (bug fix)

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/zero-operands.c:43 + +void test_0_divisible(int x, int y) { + int a = x < 0; // Eagerly bifurcate. Note, this is the test that fails without this fix. The preceding tests are here to demonstrate th

[PATCH] D99343: [Analyzer] Infer 0 value when the divisible is 0 (bug fix)

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. Thanks for the review! Comment at: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:655 return makeSymExprValNN(op, InputLHS, InputRHS, resultTy); + case BO_Div: case BO_Rem:

[PATCH] D99343: [Analyzer] Infer 0 value when the divisible is 0 (bug fix)

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. martong marked an inline comment as done. Closed by commit rG015c39882ebc: [Analyzer] Infer 0 value when the divisible is 0 (bug fix) (authored by martong). Changed prior to commit: https://reviews.llvm.org/D99343?vs=

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 46. martong added a comment. - Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 Files: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisito

<    16   17   18   19   20   21   22   23   >