[PATCH] D99260: [analyzer] Fix false positives in inner pointer checker (PR49628)

2021-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/inner-pointer.cpp:23 + +char *data(std::string &c); + Seems like all test are exercising with std::string, this looks like a legacy in this Checker. Still, I miss a bit at least one test for the othe

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-30 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 rGefa7df1682c2: [Analyzer] Track RValue expressions (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-30 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/BugReporterVisitors.cpp:1958-1959 + EnableNullFPSuppression); + } else { // Track only the LHS of divisions. +if (LHSV.isZeroConstant(

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 334093. martong added a comment. - Update comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 Files: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp clang

[PATCH] D99421: [ASTImporter] Import member specialization/instantiation of enum decls

2021-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for the review guys! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99421/new/ https://reviews.llvm.org/D99421 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D99421: [ASTImporter] Import member specialization/instantiation of enum decls

2021-03-30 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG98f6cbd68eba: [ASTImporter] Import member specialization/instantiation of enum decls (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D994

[PATCH] D99421: [ASTImporter] Import member specialization/instantiation of enum decls

2021-03-30 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 334086. martong added a comment. - Add check for specialization kind Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99421/new/ https://reviews.llvm.org/D99421 Files: clang/lib/AST/ASTImporter.cpp clang/unit

[PATCH] D99421: [ASTImporter] Import member specialization/instantiation of enum decls

2021-03-29 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/unittests/AST/ASTImporterTest.cpp:6239 +TEST_P(ASTImporterOptionSpecificTestBase, ImportEnumMemberSpecializtion) { + Decl *FromTU = getTuDecl( balazske wrote: > Thanks, I fixed the typo now. Repository: rG

[PATCH] D99421: [ASTImporter] Import member specialization/instantiation of enum decls

2021-03-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 333858. martong marked an inline comment as done. martong added a comment. - Fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99421/new/ https://reviews.llvm.org/D99421 Files: clang/lib/AST/ASTImporter

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-29 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/BugReporterVisitors.cpp:1944-1945 +return; + if (!BO->isMultiplicativeOp()) +return; + steakhal wrote: > There are only 3 multiplicative op

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 333848. martong added a comment. - Remove handling of assignment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 Files: clang/lib/StaticAnalyzer/Core/BugReporterVisit

[PATCH] D99421: [ASTImporter] Import member specialization/instantiation of enum decls

2021-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 333570. martong added a comment. - Rename test case name to something meaningful Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99421/new/ https://reviews.llvm.org/D99421 Files: clang/lib/AST/ASTImporter.cpp

[PATCH] D99421: [ASTImporter] Import member specialization/instantiation of enum decls

2021-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: teemperor, shafik, balazske, steakhal. Herald added subscribers: whisperity, gamesh411, Szelethus, dkrupp, rnkovacs. Herald added a reviewer: a.sidorin. martong requested review of this revision. Herald added a project: clang. Herald added a s

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Guys, thanks for the review! :) Comment at: clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp:1945 + + auto IsZero = [&BVF](const Optional &CI) { +if (!CI) NoQ wrote: > `SVal::isZeroConstant()` please ^.^ Yeah good catch, I wis

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-26 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 333508. martong marked 5 inline comments as done. martong added a comment. - Use isZeroConstant() - Make trackRValueExpression private (static function) - Fix clang-tidy report: auto *BO ---> const auto *BO Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h:119-124 +/// Attempts to add visitors to track an RValue expression back to its point of +/// origin. Works similarly to

[PATCH] D99344: [Analyzer] Track RValue expressions

2021-03-25 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 47. martong added a comment. - Assert in the callee and check in the caller - Fix typo in comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99344/new/ https://reviews.llvm.org/D99344 Files: clang/inc

[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

[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] 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
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] 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 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] 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] 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] D95244: [clang][AST] Handle overload callee type in CallExpr::getCallReturnType.

2021-03-11 Thread Gabor Marton via Phabricator via cfe-commits
martong added reviewers: aaron.ballman, riccibruno, dblaikie. martong added subscribers: aaron.ballman, dblaikie. martong added a comment. Hi @aaron.ballman @riccibruno @dblaikie, I am adding you as a reviewer because it seems you have great experience with Clang's AST. Could you please take a lo

[PATCH] D98244: [analyzer] Fix StdLibraryFunctionsChecker performance issue

2021-03-09 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. Good catch! Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98244/new/ https://reviews.llvm.org/D98244 _

[PATCH] D95244: [clang][AST] Handle overload callee type in CallExpr::getCallReturnType.

2021-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/Expr.cpp:1406 + } else if (CalleeType->isDependentType() || + CalleeType->isSpecificPlaceholderType(BuiltinType::Overload)) { +return CreateDependentType(); Can't we create a built in place

[PATCH] D95244: [clang][AST] Handle overload callee type in CallExpr::getCallReturnType.

2021-03-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. > This causes a crash if the function is called in such case. Is the crash caused by the below assertion? QualType Expr::findBoundMemberType(const Expr *expr) { assert(expr->hasPlaceholderType(BuiltinType::BoundMember)); Comment at: clang/lib/AS

[PATCH] D96586: [analyzer][CTU][NFC] Add an extra regression test

2021-03-08 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Thanks for the test! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96586/new/ https://reviews.llvm.org/D96586 ___ cfe-commits mailing list cfe-com

[PATCH] D97849: [AST][PCH][ASTImporter] Fix UB caused by uninited SwitchStmt member

2021-03-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Thanks for the review! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97849/new/ https://reviews.llvm.org/D97849 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[PATCH] D97849: [AST][PCH][ASTImporter] Fix UB caused by uninited SwitchStmt member

2021-03-04 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 rG2e90fc2c407b: [AST][PCH][ASTImporter] Fix UB caused by uninited SwitchStmt member (authored by martong). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D97849: [AST][PCH][ASTImporter] Fix UB caused by uninited SwitchStmt member

2021-03-04 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 328149. martong added a comment. Herald added a reviewer: Szelethus. Add a test case which fails if lit --vg is used. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97849/new/ https://reviews.llvm.org/D97849 Fi

[PATCH] D97849: [AST][PCH][ASTImporter] Fix UB caused by uninited SwitchStmt member

2021-03-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D97849#2600300 , @teemperor wrote: > We can (and do) run LIT tests under valgrind, so if you have a test that > triggers this valgrind error then that seems like the way to go. I don't > think the test has to deterministically

[PATCH] D97849: [AST][PCH][ASTImporter] Fix UB caused by uninited SwitchStmt member

2021-03-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D97849#2600220 , @steakhal wrote: > In D97849#2600201 , @aaron.ballman > wrote: > >> This looks reasonable to me (good catch!), but is there a way for us to add >> a regression test for

[PATCH] D97849: [AST][PCH][ASTImporter] Fix UB caused by uninited SwitchStmt member

2021-03-03 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. F15719554: valgrind-output.txt Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97849/new/ https://reviews.llvm.org/D97849 ___ cfe-commits maili

[PATCH] D97849: [AST][PCH][ASTImporter] Fix UB caused by uninited SwitchStmt member

2021-03-03 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: riccibruno, aaron.ballman, shafik, teemperor, rsmith. Herald added subscribers: gamesh411, Szelethus, dkrupp, rnkovacs. Herald added a reviewer: a.sidorin. martong requested review of this revision. Herald added a project: clang. Herald added

[PATCH] D93223: [analyzer] Create MacroExpansionContext member in AnalysisConsumer

2021-02-01 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. Still looks good. (The parent is an NFC and only this patch changes the behavior (and only if the cmdline flag is there), right? So, I'd expect the big impact from this patch.) CHANGES SIN

[PATCH] D93222: [analyzer] Introduce MacroExpansionContext to libAnalysis

2021-02-01 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Still looks good to me! Thanks for handling the pragma cases! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93222/new/ https://reviews.llvm.org/D93222 ___ cfe-commits mailing list cfe-c

[PATCH] D95244: [clang][AST] Handle overload callee type in CallExpr::getCallReturnType.

2021-01-27 Thread Gabor Marton via Phabricator via cfe-commits
martong added reviewers: rsmith, majnemer. martong added subscribers: majnemer, rsmith. martong added a comment. Adding reviewers. @rsmith as code owner, @majnemer based on git blame of CallExpr::getCallReturnType. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D95244: [clang][AST] Handle overload callee type in CallExpr::getCallReturnType.

2021-01-25 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Hi Balázs, Could you please create a lit test file which ignites the related crash? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95244/new/ https://reviews.llvm.org/D95244 ___

[PATCH] D69726: [analyzer] DynamicSize: Store the dynamic size

2021-01-21 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D69726#2471657 , @vabridgers wrote: > I was referred to this patch from https://reviews.llvm.org/D86743. I pulled > this patch under review, brought it up to date and pushed to github at > https://github.com/vabridgers/llvm-pr

[PATCH] D94786: [clang][ASTImporter] Add support for importing CXXFoldExpr.

2021-01-20 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Thanks for the update! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94786/new/ https://reviews.llvm.org/D94786 ___ cfe-commits mailing list cfe-c

[PATCH] D93224: [RFC][analyzer] Use the MacroExpansionContext for macro expansions in plists

2021-01-20 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D93224#2497632 , @steakhal wrote: > It seems quite a challenge to hook the `Preprocessor` for all possible > configurations for every `CompilerInvocation`. > The underlying machinery is somewhat complex and spaghetti to me. > >

[PATCH] D93222: [RFC][analyzer] Introduce MacroExpansionContext to libAnalysis

2021-01-20 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. Nice work! Thanks! Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:210 +} \ No newline at end of file Missing newline? Comment

[PATCH] D94786: [clang][ASTImporter] Add support for importing CXXFoldExpr.

2021-01-19 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. Looks good to me! Thanks! Comment at: clang/lib/AST/ASTImporter.cpp:8019 + auto ToType = importChecked(Err, E->getType()); + auto ToCallee = importChecked(Err, E->getCall

[PATCH] D92797: APINotes: add initial stub of APINotesWriter

2021-01-19 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. In D92797#2505254 , @compnerd wrote: > Ping x 3 Sorry, just came back from holidays. Generally, I have no major concerns. My minor concern is that i

[PATCH] D94067: [clang][ASTImporter] Fix a possible assertion failure `NeedsInjectedClassNameType(Decl)'.

2021-01-19 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @balazske Thanks Balázs! Great work! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94067/new/ https://reviews.llvm.org/D94067 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

2020-12-15 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 your work, I am glad that finally the Window bug is fixed with a simple solution. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D926

[PATCH] D93224: [RFC][analyzer] Use the MacroExpansionContext for macro expansions in plists

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist:148 nameSET_PTR_VAR_TO_NULL - expansionptr = 0 + expansionptr =0 martong wrote: > I wonder how much added value do we

[PATCH] D93224: [RFC][analyzer] Use the MacroExpansionContext for macro expansions in plists

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist:148 nameSET_PTR_VAR_TO_NULL - expansionptr = 0 + expansionptr =0 I wonder how much added value do we have with these h

[PATCH] D93222: [RFC][analyzer] Introduce MacroExpansionContext to libAnalysis

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/Analysis/MacroExpansionContext.h:82 + MacroExpansionText + getExpandedMacroForLocation(SourceLocation MacroExpansionLoc) const; + `getExpandedText` ? Since what you get back is not a macro anymore.

[PATCH] D93223: [RFC][analyzer] Create MacroExpansionContext member in AnalysisConsumer and pass down to the diagnostics consumers

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Looks quite straight-forward other than that new prototype. Comment at: clang/include/clang/Analysis/PathDiagnostic.h:911 +void createHTMLSingleFileDiagnosticConsumer( +PathDiagnosticConsumerOptions DiagOpts, Why do we need this p

[PATCH] D93222: [RFC][analyzer] Introduce MacroExpansionContext to libAnalysis

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Nice and precise work! And special thanks for the unit tests. I've found some minor nits. Comment at: clang/include/clang/Analysis/MacroExpansionContext.h:77 + /// \param MacroExpansionLoc Must be the expansion location of a macro. + /// \return The

[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong requested changes to this revision. martong added inline comments. This revision now requires changes to proceed. Comment at: clang/unittests/AST/StructuralEquivalenceTest.cpp:1656-1662 + R"( + template + void f() { +T x; +(void)_Generic(x,

[PATCH] D92797: APINotes: add initial stub of APINotesWriter

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D92797#2452497 , @compnerd wrote: > Ping I am terribly sorry for keeping you waiting always. Thanks for your patience. Comment at: clang/include/clang/APINotes/APINotesWriter.h:1 +//===-- APINotesWriter.h -

[PATCH] D92634: [Analyzer] Diagnose signed integer overflow

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D92634#2453822 , @OikawaKirie wrote: > I think it could be better to implement this check with a checker on > `PreStmt` and so on. And IMO, checkers have enough > functionalities to report these problems. > > Besides, the retu

[PATCH] D92634: [Analyzer] Diagnose signed integer overflow

2020-12-15 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D92634#2451646 , @danielmarjamaki wrote: > No reviews => I will not contribute. Hi, thanks for the patch! I am terribly sorry that we could not pick this up earlier. You can always ping the community with a simple 'Ping' mess

[PATCH] D92962: [ASTImporter] Fix import of a typedef that has an attribute

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

[PATCH] D92962: [ASTImporter] Fix import of a typedef that has an attribute

2020-12-14 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. martong marked an inline comment as done. Closed by commit rG68f53960e17d: [ASTImporter] Fix import of a typedef that has an attribute (authored by martong). Repositor

[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

2020-12-14 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Thanks for the update. I checked it, still looks good to me. Some notes in parenthesis: > It looks like the problem is again due to delayed template parsing: the > templatized functions in the test both came out as nullptr. So, I added a

[PATCH] D92962: [ASTImporter] Fix import of a typedef that has an attribute

2020-12-10 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:6098 + FirstDeclMatcher().match(TU, typedefDecl(hasName("X"))); + auto *ToD = Import(FromD, Lang_CXX17); + ASSERT_TRUE(ToD); shafik

[PATCH] D92962: [ASTImporter] Fix import of a typedef that has an attribute

2020-12-10 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 310869. martong added a comment. - Check the attribute in the test as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92962/new/ https://reviews.llvm.org/D92962 Files: clang/lib/AST/ASTImporter.cpp clan

[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

2020-12-10 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. I wouldn't worry much about the `ASTMerge` tests, those are mostly legacy and not actively used nowadays. (At one point we were thinking even to remove them because we could got rid of the `ASTMergeAction` which is exclusively used for testing.) The main test infrastruc

[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

2020-12-10 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Herald added a subscriber: rnkovacs. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92600/new/ https://reviews.llvm.org/D92600 ___ cfe-commit

[PATCH] D92962: [ASTImporter] Fix import of a typedef that has an attribute

2020-12-09 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added a reviewer: teemperor. Herald added subscribers: gamesh411, Szelethus, dkrupp, rnkovacs. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. martong requested review of this revision. Herald added a project: clang. Herald added a subscri

[PATCH] D92209: [ASTImporter] Support CXXDeductionGuideDecl with local typedef

2020-12-09 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 rGa5e6590b15b1: [ASTImporter] Support CXXDeductionGuideDecl with local typedef (authored by martong). Changed prior to commit: https://reviews.llvm.

[PATCH] D92209: [ASTImporter] Support CXXDeductionGuideDecl with local typedef

2020-12-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 310591. martong marked an inline comment as done. martong added a comment. - Remove not relevant param from test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92209/new/ https://reviews.llvm.org/D92209 Files:

[PATCH] D92209: [ASTImporter] Support CXXDeductionGuideDecl with local typedef

2020-12-09 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. Thanks for the review guys! Comment at: clang/lib/AST/ASTImporter.cpp:2522 + // Add to the lookupTable because we could not do that in MapImported. + Importer.AddToLookupTable(ToTypedef); + te

[PATCH] D92209: [ASTImporter] Support CXXDeductionGuideDecl with local typedef

2020-12-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 310510. martong added a comment. - Remove `if (!DC || !LexicalDC)` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92209/new/ https://reviews.llvm.org/D92209 Files: clang/lib/AST/ASTImporter.cpp clang/unitte

[PATCH] D92432: [analyzer] Add a thin abstraction layer between libCrossTU and libAnalysis.

2020-12-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/CrossTU/CrossTranslationUnit.h:124 /// Note that this class also implements caching. -class CrossTranslationUnitContext { +class CrossTranslationUnitContext : public CrossTUAnalysisHelper { public:

[PATCH] D92771: [analyzer][StdLibraryFunctionsChecker] Add more return value contraints

2020-12-08 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. martong marked an inline comment as done. Closed by commit rGfebe75032f6f: [analyzer][StdLibraryFunctionsChecker] Add more return value contraints (authored by martong)

[PATCH] D92771: [analyzer][StdLibraryFunctionsChecker] Add more return value contraints

2020-12-08 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added a comment. Thanks for the review! Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1367-1368 +.Case(ReturnsZeroOrMinusOne) .ArgC

[PATCH] D92764: [analyzer][StdLibraryFunctionsChecker] Make close and mmap to accept -1 as fd

2020-12-08 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 rGd14c63167315: [analyzer][StdLibraryFunctionsChecker] Make close and mmap to accept -1 as fd (authored by martong). Repository: rG LLVM Github Mono

[PATCH] D92209: [ASTImporter] Support CXXDeductionGuideDecl with local typedef

2020-12-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. Ping. @teemperor please take a look if you have some time. This is a really important patch which may influence some future directions regarding the ASTImporter. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92209/new/ htt

[PATCH] D92771: [analyzer][StdLibraryFunctionsChecker] Add more return value contraints

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

[PATCH] D92764: [analyzer][StdLibraryFunctionsChecker] Make close and mmap to accept -1 as fd

2020-12-07 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1737 .ArgConstraint( ArgumentCondition(4, WithinRange, Range(0, IntMax; steakhal wrote: > `mmap` should have the same

[PATCH] D92764: [analyzer][StdLibraryFunctionsChecker] Make close and mmap to accept -1 as fd

2020-12-07 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 309931. martong marked an inline comment as done. martong added a comment. - Use -1 for mmap too Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92764/new/ https://reviews.llvm.org/D92764 Files: clang/lib/Stat

[PATCH] D92764: [analyzer][StdLibraryFunctionsChecker] Make close and mmap to accept -1 as fd

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

[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

2020-12-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D92600#2433263 , @martong wrote: > It might be worth to extend StmtComparer > > as well with

[PATCH] D92600: [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

2020-12-04 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. It might be worth to extend StmtComparer as well with this Expr. I mean, probably two selections exprs should be considered equal if thei

[PATCH] D92209: [ASTImporter] Support CXXDeductionGuideDecl with local typedef

2020-12-03 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added a comment. > I was thinking about to create a separate ASTImporter implementation > specifically for CTU and LLDB could have it's own implementation. For that we > just need to create an interface class with virtual functions. One implemen

[PATCH] D92209: [ASTImporter] Support CXXDeductionGuideDecl with local typedef

2020-12-03 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:2522 + // Add to the lookupTable because we could not do that in MapImported. + Importer.AddToLookupTable(ToTypedef); + shafik wrote: > I am not s

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-03 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. martong marked an inline comment as done. Closed by commit rG1e14588d0f68: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs (authored by martong). C

[PATCH] D92474: [analyzer][StdLibraryFunctionsChecker] Add return value constraint to functions with BufferSize

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb40b3196b321: [analyzer][StdLibraryFunctionsChecker] Add return value constraint to functions… (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D92474: [analyzer][StdLibraryFunctionsChecker] Add return value constraint to functions with BufferSize

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 308951. martong marked an inline comment as done. martong added a comment. - Remove comments - Hoist Range(-1,0) to ReturnsZeroOrMinusOne Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92474/new/ https://reviews

[PATCH] D92474: [analyzer][StdLibraryFunctionsChecker] Add return value constraint to functions with BufferSize

2020-12-02 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:2076 Summary(NoEvalCall) +.Case({ReturnValueCondition(WithinRange, Range(-1, 0))}) .ArgConstrai

[PATCH] D92474: [analyzer][StdLibraryFunctionsChecker] Add return value constraint to functions with BufferSize

2020-12-02 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:1771 +.Case({ReturnValueCondition(LessThanOrEq, ArgNo(2)), + ReturnValueCondition(WithinRange, Rang

[PATCH] D92432: [analyzer] Add a thin abstraction layer between libCrossTU and libAnalysis.

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong accepted this revision. martong added a comment. Looks good, thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92432/new/ https://reviews.llvm.org/D92432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D91997: APINotes: add bitcode format schema definitions

2020-12-02 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. Looks good, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91997/new/ https://reviews.llvm.org/D91997

[PATCH] D92474: [analyzer][StdLibraryFunctionsChecker] Add return value constraint to functions with BufferSize

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

[PATCH] D92103: [ASTImporter] Import the default argument of TemplateTypeParmDecl

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a subscriber: balazske. martong added a comment. Hey Raphael, thanks for looking into the CTU crash! I also had a look and I could reproduce that on Linux Ubuntu 18.04 with GCC 7. I think the discrepancy stems from GCC's libstdc++ and MacOS's libc++ implementation differences of `

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D92101#2423685 , @shafik wrote: > Should we add a test for the `regular function template` case as well? I think this issue is specific for a `CXXDeductionGuideDecl` which is a `FunctionDecl`. I am not sure if I can follow wha

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. @rsmith I have moved the check into `TransformTypedefType`. We do not add the typedef to the `MaterializedTypedefs` list if it's context is dependent because later we set the deduction guide as the DC for all typedefs in the list: for (auto *TD : MaterializedTypedefs)

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 308922. martong added a comment. - Add to MaterializedTypedefs only when copying the Decl Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92101/new/ https://reviews.llvm.org/D92101 Files: clang/lib/Sema/SemaTe

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 308920. martong added a comment. - Move dependent context check into TransformTypedefType - Add new test case for param with pointer type Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92101/new/ https://reviews

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-12-02 Thread Gabor Marton via Phabricator via cfe-commits
martong added a comment. In D92101#2423685 , @shafik wrote: > Should we add a test for the `regular function template` case as well? I think this issue is specific for `CXXDeductionGuideDecl`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D92109: [ASTImporter] Support import of CXXDeductionGuideDecl

2020-12-01 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/AST/ASTImporter.cpp:3336 +if (Fun->getExplicitSpecifier().getExpr()) { + ExplicitExpr = importChecked(Err, Fun->getExplicitSpecifier().getExpr()); + if (Err) rnk wrote: > GCC 5.3 complained about

[PATCH] D92109: [ASTImporter] Support import of CXXDeductionGuideDecl

2020-11-30 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 rG70eb2ce395be: [ASTImporter] Support import of CXXDeductionGuideDecl (authored by martong). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

2020-11-30 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/Sema/SemaTemplate.cpp:2356-2359 + auto *CD = cast(OldParam->getDeclContext()); + // If the typedef is not a local typedef, then skip the transform. + if (OldTypedefDecl->getDeclContext() != CD->getDeclContext())

<    4   5   6   7   8   9   10   11   12   13   >