[PATCH] D70819: [ASTImporter] Support functions with placeholder return types ...

2019-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 231725. martong marked 4 inline comments as done. martong added a comment. - Address Alexei's comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70819/new/ https://reviews.llvm.org/D70819 Files: clang/li

[PATCH] D70819: [ASTImporter] Support functions with placeholder return types ...

2019-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Alexei, thanks for the assiduous review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70819/new/ https://reviews.llvm.org/D70819 ___ cfe-commits mailing list cfe-commits@lists

[PATCH] D69948: [Checkers] Added support for freopen to StreamChecker.

2019-12-03 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, but wait for others please. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69948/new/ https://reviews.llvm.org/D69948

[PATCH] D70439: [Analyzer][Docs][NFC] Add CodeChecker to the command line tools

2019-12-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @NoQ Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70439/new/ https://reviews.llvm.org/D70439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D60499: [ASTImporter] Various source location and range import fixes.

2019-12-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Ping Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60499/new/ https://reviews.llvm.org/D60499 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

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

2019-12-04 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: balazske, a_sidorin. Herald added subscribers: cfe-commits, teemperor, gamesh411, Szelethus, jfb, dkrupp, rnkovacs. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: clang. martong added a parent rev

[PATCH] D71020: [ASTImporter] Friend class decl should not be visible in its context

2019-12-04 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: balazske, a_sidorin. Herald added subscribers: cfe-commits, teemperor, gamesh411, Szelethus, dkrupp, rnkovacs. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: clang. In the past we had to use Decl

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

2019-12-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 232336. martong added a comment. IMPORT -> IMPORT_TYPE_LOC Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71018/new/ https://reviews.llvm.org/D71018 Files: clang/lib/AST/ASTImporter.cpp Index: clang/lib/AST/

[PATCH] D70439: [Analyzer][Docs][NFC] Add CodeChecker to the command line tools

2019-12-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/www/analyzer/codechecker.html:13 + + + NoQ wrote: > Note related to your patch, but SSI seem to be completely broken these days; > previously the dropdown menus header kept working on the front page but now > eve

[PATCH] D70439: [Analyzer][Docs][NFC] Add CodeChecker to the command line tools

2019-12-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 232371. martong marked 15 inline comments as done. martong added a comment. Addressing Artem's review comments. Artem, thanks for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70439/new/ https://rev

[PATCH] D71112: [ASTImporter] Implicitly declare parameters for imported ObjCMethodDecls

2019-12-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for addressing this, I just have some minor comments. Comment at: clang/unittests/AST/ASTImporterTest.cpp:5603 +TEST_P(ASTImporterOptionSpecificTestBase, ImplicitlyDeclareSelf) { + Decl *FromTU = getTuDecl("__attribute__((objc_root_class))\n" +

[PATCH] D70439: [Analyzer][Docs][NFC] Add CodeChecker to the command line tools

2019-12-06 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 232540. martong marked 3 inline comments as done. martong added a comment. Put back the menu, add "open source" property. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70439/new/ https://reviews.llvm.org/D70439

[PATCH] D70439: [Analyzer][Docs][NFC] Add CodeChecker to the command line tools

2019-12-06 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 6 inline comments as done. martong added a comment. In D70439#1772168 , @Charusso wrote: > I would change the order of CCh and scan-build because we usually list stuff > in alphabetical order. Also the chronological order is that, the newes

[PATCH] D71112: [ASTImporter] Implicitly declare parameters for imported ObjCMethodDecls

2019-12-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/unittests/AST/Language.cpp:44 + case Lang_OpenCL: +llvm_unreachable("-std=objc++"); } I think, we should keep the "Not implemented yet!" message here. Perhaps you wanted "-std=objc++" to put next to -x obj

[PATCH] D70819: [ASTImporter] Support functions with placeholder return types ...

2019-12-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a reviewer: teemperor. martong marked an inline comment as done. martong added inline comments. Comment at: clang/unittests/AST/ASTImporterTest.cpp:5625 + // parsed libcxx/src/filesystem/directory_iterator.cpp, but could not reduce + // that with creduce, because

[PATCH] D71378: Modifying ImportDeclContext(...) to ensure that we complete each FieldDecl of a RecordDecl when we are importing the definiton

2019-12-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for the patch! It look almost good to me, but I have a comment about the error handling. Comment at: clang/lib/AST/ASTImporter.cpp:1707 +if (Err) + return Err; +} Rather than just simply retu

[PATCH] D71378: Modifying ImportDeclContext(...) to ensure that we complete each FieldDecl of a RecordDecl when we are importing the definiton

2019-12-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Just one more thing, maybe that is too overkill, but I think on a long term we could benefit from a unittest for this case. You could create a test similar to `LLDBLookupTest` in ASTImporterTest.cpp. In that Fixture we use Minimal import and the regular lookup (that is

[PATCH] D70819: [ASTImporter] Support functions with placeholder return types ...

2019-12-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D70819#170 , @shafik wrote: > Apologies for wacky C++ code that follows but will this also work for the > following cases: > > auto f2() { > auto l = []() { > struct X{}; > return X(); > }; >r

[PATCH] D70439: [Analyzer][Docs][NFC] Add CodeChecker to the command line tools

2019-12-12 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4cfb91f1ef1b: [Analyzer][Docs][NFC] Add CodeChecker to the command line tools (authored by martong). Changed prior to commit: https://reviews.llvm.org/D70439?vs=232540&id=233590#toc Repository: rG LL

[PATCH] D70819: [ASTImporter] Support functions with placeholder return types ...

2019-12-12 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added a comment. In D70819#1781678 , @martong wrote: > In D70819#170 , @shafik wrote: > > > Apologies for wacky C++ code that follows but will this also work for

[PATCH] D70819: [ASTImporter] Support functions with placeholder return types ...

2019-12-12 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 rG25234fd69e32: [ASTImporter] Support functions with placeholder return types ... (authored by martong). Changed prior to commit: https://reviews.llvm.org/D70819?

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

2019-12-12 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. > Are you going to add any tests in the following patches? I don't have any tests for now, but in a later patch we can create them. Comment at: clang/lib/AST/ASTImporter.cpp:8043 + + Error VisitFunctionTypeLoc

[PATCH] D71020: [ASTImporter] Friend class decl should not be visible in its context

2019-12-12 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:334 + FromDC->lookup(FromNamed->getDeclName()); + if (std::find(FromLookup.begin(), FromLookup.end(), FromNamed) != + FromLookup.end()) a_sidorin wrote: >

[PATCH] D71020: [ASTImporter] Friend class decl should not be visible in its context

2019-12-12 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 233675. martong marked 4 inline comments as done. martong added a comment. Addressing Alexeis comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71020/new/ https://reviews.llvm.org/D71020 Files: clang/l

[PATCH] D71020: [ASTImporter] Friend class decl should not be visible in its context

2019-12-16 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 234062. martong marked an inline comment as done. martong added a comment. Simplify getRecordDeclOfFriend() further. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71020/new/ https://reviews.llvm.org/D71020 Fil

[PATCH] D71020: [ASTImporter] Friend class decl should not be visible in its context

2019-12-16 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/unittests/AST/ASTImporterTest.cpp:252 + QualType Ty = FD->getFriendType()->getType().getCanonicalType(); + if (isa(Ty)) +Ty = cast(Ty)->getNamedType(); a_sidorin wrot

[PATCH] D71020: [ASTImporter] Friend class decl should not be visible in its context

2019-12-17 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4becf68c6f17: [ASTImporter] Friend class decl should not be visible in its context (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71020

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2019-12-17 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: NoQ, Szelethus. Herald added subscribers: cfe-commits, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity, mgorny. Herald added a project: clang. This checker ver

[PATCH] D71020: [ASTImporter] Friend class decl should not be visible in its context

2019-12-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Recommited in bc5b7e21e32 . I changed `llvm:is_contained` to a simple for loop over the lookup result. This way the copy assignment of the iterator is avoided even if windows STL is used. Repository

[PATCH] D71734: [Modules] Handle tag types and complain about bad merges in C/Objective-C mode

2019-12-20 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/Serialization/ASTReader.cpp:9286 + false /*UseCanonicalDecls*/); + (void)Ctx.IsEquivalent(D, Canon); +} Would it be possible to check the structural non-equivalency with `ODRHash`? I wonder if

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2019-12-20 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 22 inline comments as done. martong added a comment. Thank you guys for the assiduous review! Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:22 +ProgramStateRef State) const; + mutable std::unique_ptr BT_Placement

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2019-12-20 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 234857. martong marked 8 inline comments as done. martong added a comment. - Bugtype by value - Decompose Place to base region and offset - Add test for type hierarchy - Remove State check - Return directly with the size of the type in case of non-array new -

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2019-12-20 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp:32 + const MemRegion *BaseRegion = MRegion->getBaseRegion(); + assert(BaseRegion == Offset.getRegion()); + This assertio

[PATCH] D71612: [analyzer] Add PlacementNewChecker

2019-12-20 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 234901. martong added a comment. - Better handling of unknown values Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71612/new/ https://reviews.llvm.org/D71612 Files: clang/include/clang/StaticAnalyzer/Checker

[PATCH] D75678: [analyzer] Skip analysis of inherited ctor as top-level function

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added a reviewer: NoQ. Herald added subscribers: cfe-commits, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a reviewer: Szelethus. Herald ad

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

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks Richard for the explanation. Artem, I think this justifies your suggestion to skip the analysis of inherited constructors as top level functions. I just created the patch https://reviews.llvm.org/D75678 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D75678: [analyzer] Skip analysis of inherited ctor as top-level function

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. For those who are interested in more details please refer to the related discussion after the commit of the patch that introduces handling of inherited ctors . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://r

[PATCH] D75678: [analyzer] Skip analysis of inherited ctor as top-level function

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. In D75678#1907449 , @NoQ wrote: > Thanks!! I also recommend a more direct test with `-analyzer-display-progress > | FileCheck`. Ok, I added a new test file with FileCheck. ===

[PATCH] D75678: [analyzer] Skip analysis of inherited ctor as top-level function

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 248473. martong marked an inline comment as done. martong added a comment. - Change comments, add FileCheck test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75678/new/ https://reviews.llvm.org/D75678 Files:

[PATCH] D64464: [CodeGen] Emit destructor calls to destruct compound literals

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:7918 + + return nullptr; +} I think ``` return make_errorhttps://reviews.llvm.org/D64464/new/ https://reviews.llvm.org/D64464 ___ cfe-commit

[PATCH] D75665: [analyzer] On-demand parsing capability for CTU

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. The warning below suggests that we parse the ctu-other.c file (and presumably every file) as a C++ file, even if it should be parsed as a C file. Perhaps the invocation of the parser is missing some setting? Also, could this be the reason why on-the-fly and pch driven c

[PATCH] D75665: [analyzer] On-demand parsing capability for CTU

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > As the CTUDir string prefix is only needed in case of the old approach, I > have refactored the external definition mapping storage to NOT include that. Both `ctu-main.c` and `ctu-on-demand-parsing.c` use the `-analyzer-config ctu-dir=%t/ctudir2` setting. So it is not

[PATCH] D75665: [analyzer] On-demand parsing capability for CTU

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/CrossTU/CrossTranslationUnit.h:23 #include "llvm/ADT/StringMap.h" +#include "llvm/IR/DiagnosticInfo.h" +#include "llvm/IR/OperandTraits.h" Perhaps this include is needed only in the .cpp file?

[PATCH] D75665: [analyzer] On-demand parsing capability for CTU

2020-03-05 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CallEvent.cpp:578 + + // Optional OnDemandParsingDatabase; + // if (Opts.CTUOnDemandParsing) left here some debugging Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D75678: [analyzer] Skip analysis of inherited ctor as top-level function

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 248678. martong added a comment. - Remove superfluous param x from test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75678/new/ https://reviews.llvm.org/D75678 Files: clang/lib/StaticAnalyzer/Frontend/Analy

[PATCH] D75678: [analyzer] Skip analysis of inherited ctor as top-level function

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Ping. Please prioritize this patch, since it is fixing a regression caused by https://reviews.llvm.org/D74735. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75678/new/ https://reviews.llvm.org/D75678 __

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

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @steakhal There is a fix for the crash: https://reviews.llvm.org/D75678 Let's hope that patch get's in soon. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74735/new/ https://reviews.llvm.org/D74735 _

[PATCH] D75698: [analyzer][WIP] Suppress bug reports where a tracked expression's latest value change was a result of an invalidation

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > While invalidation is a fundamental part of static analysis, it is > unfortunately not an under-approximation (resulting in fewer but more precise > paths of execution) +1 for saying this out :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D75356: [Analyzer][StreamChecker] Introduction of stream error state handling.

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:92-125 +class MakeRetVal { + const CallExpr *CE = nullptr; + std::unique_ptr RetVal; + SymbolRef RetSym; + +public: + MakeRetVal(const CallEvent &Call, CheckerContext &C) --

[PATCH] D75612: [Analyzer][StreamChecker] Adding PreCall and refactoring (NFC).

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:321 +ProgramStateRef +StreamChecker::ensureStreamNonNull(SVal StreamVal, CheckerContext &C, + ProgramStateRef State) const { Just a qu

[PATCH] D75665: [analyzer] On-demand parsing capability for CTU

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/CrossTU/CrossTranslationUnit.cpp:365 + llvm::SmallString<256> AbsPath = CTUDir; + llvm::sys::path::append(AbsPath, Identifier); Could we check somehow if `CTUDir` is indeed an absolute path? If not then pr

[PATCH] D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 4 inline comments as done. martong added a comment. In D74973#1900852 , @Szelethus wrote: > I have some high level questions, you have spent far more time with this code > and I'm happy to be proven wrong! :) > > In D74973#1889188

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

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 9 inline comments as done. martong added a comment. In D73898#1894923 , @balazske wrote: > It may be useful to make a "macro value map" kind of object. Some macros can > be added to it as a string, and it is possible to lookup for an `Expr`

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

2020-03-06 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added a comment. In D73898#1901142 , @balazske wrote: > Is it sure that the signedness in the ranges is handled correctly? The EOF is > a negative value but the `RangeInt` is unsigned type. The > `tryExpa

[PATCH] D64464: [CodeGen] Emit destructor calls to destruct compound literals

2020-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong resigned from this revision. martong added a comment. Looks good from the ASTImporter's point of view. I don't have the competence to review the rest, so I am resigning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64464/new/ https://revi

[PATCH] D75678: [analyzer] Skip analysis of inherited ctor as top-level function

2020-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:511 + // + // Also, we cannot model the parameters. CXXInheritedCtorInitExpr doesn't + // take arguments and doesn't model parameter init

[PATCH] D75678: [analyzer] Skip analysis of inherited ctor as top-level function

2020-03-09 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 rG59a960b83c2d: [analyzer] Skip analysis of inherited ctor as top-level function (authored by martong). Changed prior to commit: https://reviews.llvm.org/D75678?v

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

2020-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:3281 + // Import the function parameters. + SmallVector Parameters; balazske wrote: > shafik wrote: > > I am curious, why move this chunk of code up? > See comments at line 8238? I moved

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

2020-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 249106. martong marked 10 inline comments as done. martong added a comment. - Remove default visit functions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71018/new/ https://reviews.llvm.org/D71018 Files: cl

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

2020-03-10 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:8132 + return VisitTypeSpecTypeLoc(FTS); +llvm_unreachable("Unimplemented TypeLoc visitor function"); + } balazske wrote: > This assert is

[PATCH] D75698: [analyzer][WIP] Suppress bug reports where a tracked expression's latest value change was a result of an invalidation

2020-03-10 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > P.S. So, like, we could try to emit the warning only if we covered enough > execution paths to prove that there's either dead code or the warning is > true. Then we would no longer care about invalidation problems. > Unfortunately, i don't have any specific suggestion

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

2020-03-10 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 249350. martong marked an inline comment as done. martong added a comment. - Handle AttributedTypeLoc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71018/new/ https://reviews.llvm.org/D71018 Files: clang/lib

[PATCH] D75922: [ASTImporter] Compare the DC of the underlying type of a FriendDecl

2020-03-10 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: a_sidorin, shafik. Herald added subscribers: cfe-commits, teemperor, gamesh411, Szelethus, dkrupp, rnkovacs. Herald added a reviewer: a.sidorin. Herald added a project: clang. Currently, we do not check the scope of friend classes. This can

[PATCH] D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance

2020-03-10 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:151 + + using ValueConstraintPtr = std::shared_ptr; + /// The complete list of constraints that defines a single branch. ---

[PATCH] D75922: [ASTImporter] Compare the DC of the underlying type of a FriendDecl

2020-03-11 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D75922#1915918 , @shafik wrote: > I believe that your main example violates basic.scope.class p2 > : > > > A name N used in a class S shall refer to the same declaration in its > > c

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

2020-03-16 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 250568. martong added a comment. - Remove redundant VisitQualifiedTypeLoc and VisitAttributedTypeLoc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71018/new/ https://reviews.llvm.org/D71018 Files: clang/lib/

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

2020-03-16 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 250570. martong added a comment. - Fix the base commit of this patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71018/new/ https://reviews.llvm.org/D71018 Files: clang/lib/AST/ASTImporter.cpp clang/unit

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

2020-03-16 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D71018#1924604 , @martong wrote: > - Remove redundant VisitQualifiedTypeLoc and VisitAttributedTypeLoc I realized that the mentioned functions are redundant, because we have a while loop which iterates over all related typelo

[PATCH] D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance

2020-03-17 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 250732. martong marked 3 inline comments as done. martong added a comment. - Rebase to master - Add comments to ValueConstraint - Add virtual dtor - Add comments to ValueConstraintPtr Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

[PATCH] D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance

2020-03-17 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 12 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:88 typedef uint32_t ArgNo; - static const ArgNo Ret = std::numeric_limits::max(); + static const ArgNo Ret; + --

[PATCH] D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance

2020-03-17 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc6b8484e855b: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74973/new/

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

2020-03-17 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 16 inline comments as done. martong added inline comments. Herald added a subscriber: DenisDvlp. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:296 +def StdCLibraryFunctionArgsChecker : Checker<"StdCLibraryFunctionArgs">, + HelpText<"Check con

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

2020-03-17 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 250820. martong marked 4 inline comments as done. martong removed a subscriber: DenisDvlp. martong added a comment. - Address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73898/new/ https://rev

[PATCH] D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance

2020-03-17 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Herald added a subscriber: DenisDvlp. In D74973#1926694 , @Szelethus wrote: > Please have my post-commit approval :^) Nice work! Thanks! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

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

2020-03-17 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 250869. martong marked an inline comment as done. martong added a comment. Herald added a subscriber: ASDenysPetrov. - tmp -> Tmp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73898/new/ https://reviews.llvm.or

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

2020-03-17 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:152 +break; + default: +llvm_unreachable("Unknown RangeConstraint kind!"); martong wrote: > This `default` branch is not needed here (

[PATCH] D75063: [analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 6 inline comments as done. martong added inline comments. Herald added a subscriber: ASDenysPetrov. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:175 +using ValueConstraint::ValueConstraint; +bool CannotBeNull = true; + --

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

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 11 inline comments as done. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Checkers/Checkers.td:298 +def StdCLibraryFunctionArgsChecker : Checker<"StdCLibraryFunctionArgs">, + HelpText<"Check constraints of arguments of C standard

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

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 251083. martong marked 5 inline comments as done. martong added a comment. - Add comments about what is a branch - Do not use 'this' for BugType - Lazily init BT and BT -> BT_InvalidArg - ReportBug -> reportBug Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D67336: [analyzer][NFC] Introduce SuperChecker<>, a convenient alternative to Checker<> for storing subcheckers

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. The way I see perhaps we need a 3rd class of checkers (beside super and sub). And that would be those checkers which are not dependent closely on any super checker but they do emit diagnostics. E.g. the PlacementNewChecker is implemented in it's own, it emits some diagn

[PATCH] D76229: [clang-tidy] Added PlacementNewStorageCheck

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Please note about the alignment requirements that they are not checked in the static analyzer for a reason. To track the alignment data across the data flow, probably we should modify the analyzer's core structure (e.g. `MemRegion`) and some modeling checkers like the `

[PATCH] D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > Whenever the analyzer budget runs out just at the point where std::advance(), > std::prev() or std::next() is invoked the function are not inlined. This > results in strange behavior such as std::prev(v.end()) equals v.end(). To > prevent this model these functions if

[PATCH] D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`

2020-03-18 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/IteratorModeling.cpp:221 +if (Handler) { + if (!C.wasInlined) { +if (Call.getNumArgs() > 1) { Perhaps putting this hunk into a separate function or lambda could decrease

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-03 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added a reviewer: NoQ. Herald added subscribers: cfe-commits, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a project: clang. Repository: rG LLVM G

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

2020-02-03 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added a reviewer: NoQ. Herald added subscribers: cfe-commits, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun, whisperity. Herald added a project: clang. Repository: rG LLVM G

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:537-551 + // The format is as follows: //{ "function name", - // { spec: + // { variant0: //{ argument types list,

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 243117. martong marked an inline comment as done. martong added a comment. - Rename several types Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73897/new/ https://reviews.llvm.org/D73897 Files: clang/lib/Sta

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 243167. martong marked 6 inline comments as done. martong added a comment. - Describe what pure means Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73897/new/ https://reviews.llvm.org/D73897 Files: clang/lib

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:33 // // This checker uses eval::Call for modeling "pure" functions, for which // their `FunctionSummaryTy' is a precise model. This avoids unnecessary

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

2020-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D73898#1863710 , @Szelethus wrote: > I wouldn't like to see reports emitted by a checker that resides in > `apiModeling`. Could we create a new one? Some checkers, like the > `IteratorChecker`, `MallocChecker` and `CStringChec

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

2020-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:697-699 + // The behavior is undefined if the value of the argument is not + // representable as unsigned char or is no

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

2020-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D73898#1864066 , @martong wrote: > In D73898#1863710 , @Szelethus wrote: > > > I wouldn't like to see reports emitted by a checker that resides in > > `apiModeling`. Could we create a ne

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

2020-02-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > What I mean by that is that we must do over-approximation if the argument is > symbolic. I.e. we presume that the constraints do hold otherwise the program > would be ill-formed and there is no point to continue the analysis on this > path. Sorry, that's actually und

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

2020-02-10 Thread Gabor Marton via Phabricator via cfe-commits
martong planned changes to this revision. martong added a subscriber: steakhal. martong added a comment. Based on our verbal discussion with @Szelethus and @steakhal and based on the mailing archives , I am going to do the followi

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-10 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 2 inline comments as done. martong added a comment. Herald added a subscriber: steakhal. Ping @NoQ Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:42-49 // The following standard C functions are currently supported: // // fgetc

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-10 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 243552. martong marked 7 inline comments as done. martong added a comment. - Ditch comment about (macro) format - Use {} with RetType Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73897/new/ https://reviews.llv

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-10 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for the review guys! Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:537-551 + // The format is as follows: //{ "function name", - // { spec: + // { variant0: //{ argument types list, ... }, - //r

[PATCH] D73897: [analyzer] StdLibraryFunctionsChecker refactor: remove macros

2020-02-10 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf5086b3803ac: [analyzer] StdLibraryFunctionsChecker refactor: remove macros (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73897/new/

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

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: Szelethus, NoQ. Herald added subscribers: cfe-commits, steakhal, Charusso, gamesh411, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, kristof.beyls, xazax.hun, whisperity. Herald added a project: clang.

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

2020-02-12 Thread Gabor Marton via Phabricator via cfe-commits
martong planned changes to this revision. martong marked 3 inline comments as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:533 + +IntValue.dump(); +return IntValue.getSExtValue(); balazs

<    15   16   17   18   19   20   21   22   23   >