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

2019-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske 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/l

[PATCH] D62484: [ASTImporter] Added visibility context check for EnumDecl.

2019-07-09 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL365464: [ASTImporter] Added visibility context check for EnumDecl. (authored by balazske, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM CHAN

[PATCH] D64477: [ASTImporter] Using Lang_CXX11 in ASTImporterVisibilityTest.

2019-07-10 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp. Herald added a reviewer: martong. Herald added a reviewer: a.sidorin. Herald added a project: clang. These tests may work with language constructs in C++11 in the future. To avoid warnings about la

[PATCH] D64480: [ASTImporter] Added visibility context check for TypedefNameDecl.

2019-07-10 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp. Herald added a reviewer: martong. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: clang. balazske added a parent revision: D64477: [ASTImporter] Using La

[PATCH] D64554: [CrossTU] Add a function to retrieve original source location.

2019-07-11 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp. Herald added a reviewer: martong. Herald added a reviewer: shafik. Herald added a project: clang. A new function will be added to get the original SourceLocation for a SourceLocation that was impor

[PATCH] D60465: [ASTImporter] Error handling fix in ImportDefinition_New.

2019-05-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 200901. balazske added a comment. Rebase to current master. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60465/new/ https://reviews.llvm.org/D60465 Files: lib/AST/ASTImporter.cpp Index: lib/AST/ASTImporter.cpp

[PATCH] D60465: [ASTImporter] Error handling fix in ImportDefinition_New.

2019-05-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. ping Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60465/new/ https://reviews.llvm.org/D60465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[PATCH] D60465: [ASTImporter] Error handling fix in ImportDefinition_New.

2019-05-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Maybe this patch can be abandoned, the correction is already made (when every _New was removed). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60465/new/ https://reviews.llvm.org/D60465 ___

[PATCH] D62312: [ASTImporter] Added visibility context check for CXXRecordDecl.

2019-05-23 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp. Herald added a reviewer: martong. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: clang. ASTImporter makes now difference between classes with same name

[PATCH] D62312: [ASTImporter] Added visibility context check for CXXRecordDecl.

2019-05-24 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added a comment. Thanks for reviewing. Similar additions are planned to follow with function and variable template, enum, scoped enum, typedef, type alias. Comment at: unittests/AST/ASTImporterVisibilityTest.cpp:34 }; +stru

[PATCH] D62312: [ASTImporter] Added visibility context check for CXXRecordDecl.

2019-05-24 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 201133. balazske added a comment. - Changed type of string constants to const. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62312/new/ https://reviews.llvm.org/D62312 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImp

[PATCH] D62312: [ASTImporter] Added visibility context check for CXXRecordDecl.

2019-05-27 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361752: [ASTImporter] Added visibility context check for CXXRecordDecl. (authored by balazske, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Repository: rL LLVM

[PATCH] D62484: [ASTImporter] Added visibility context check for EnumDecl.

2019-05-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp. Herald added a reviewer: martong. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: clang. ASTImporter makes now difference between enums with same name i

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

2019-05-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 201521. balazske added a comment. - Import BraceRange of EnumDecl. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60499/new/ https://reviews.llvm.org/D60499 Files: lib/AST/ASTImporter.cpp Index: lib/AST/ASTImporter.cpp ==

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

2019-05-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. There is a test for the SourceLocation import in https://reviews.llvm.org/D60463 (after this patch is applied that test should not fail and the "return" statement is to be removed). Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60499/ne

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

2019-05-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 3 inline comments as done. balazske added inline comments. Comment at: lib/AST/ASTImporter.cpp:6129 if (Error Err = -ImportTemplateArgumentListInfo(E->template_arguments(), ToTAInfo)) +ImportTemplateArgumentListInfo(E->getLAngleLoc(), E->

[PATCH] D53818: [ASTImporter] Changed use of Import to Import_New in ASTImporter.

2018-12-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 179249. balazske added a comment. Rebase. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D53818/new/ https://reviews.llvm.org/D53818 Files: include/clang/AST/ASTImporter.h lib/AST/ASTImporter.cpp Index: lib/AST/ASTImport

[PATCH] D67480: [Clang][Checkers] Add 'freopen' support to SimpleStreamChecker.

2019-09-11 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp. Herald added a project: clang. The checker now recognizes 'freopen' as file opening function. Added support for binding the return value to the passed stream. Repository: rG LLVM Github Monorep

[PATCH] D67490: [Clang][ASTImporter] Added visibility check for FunctionTemplateDecl.

2019-09-12 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp. Herald added a reviewer: martong. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: clang. ASTImporter makes now difference between function templates wit

[PATCH] D67480: [analyzer] Add 'freopen' support to SimpleStreamChecker.

2019-09-13 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Code of StreamChecker does not look much better, it uses deprecated `eval::Call` and does not check for escape. But it handles more functions and error at open (still not `freopen`). A mixture of both would be a better option. Repository: rG LLVM Github Monorepo CH

[PATCH] D67490: [Clang][ASTImporter] Added visibility check for FunctionTemplateDecl.

2019-09-13 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL371820: [Clang][ASTImporter] Added visibility check for FunctionTemplateDecl. (authored by balazske, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D67543: [Clang][ASTImporter] Added visibility check for ClassTemplateDecl.

2019-09-13 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, teemperor, gamesh411, Szelethus, dkrupp. Herald added a reviewer: martong. Herald added a reviewer: a.sidorin. Herald added a reviewer: shafik. Herald added a project: clang. ASTImporter makes now difference between class templ

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-13 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dexonsmith, steven_wu, dkrupp, xazax.hun, inglorion, mgorny, mehdi_amini. Herald added a project: clang. Added new checker 'cert-default-operator-new' that checks for CERT rule MEM57-CPP. Simple version.

[PATCH] D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies

2019-09-16 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/unittests/AST/ASTImporterODRStrategiesTest.cpp:274 +// There may be a hidden fwd spec decl before a function spec decl. +if (auto *PrevF = dyn_cast(ImportedD)) { + if (PrevF->getTemplatedKind() == Thi

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-16 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 3 inline comments as done. balazske added a comment. C++17 makes things more difficult because the align is probably handled by `operator new`, probably not, depending on the defined allocation functions. This can be observed only with a non clang-tidy checker (we could compute t

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp:53 +CheckFactories.registerCheck( +"cert-default-operator-new"); CheckFactories.registerCheck( The checker

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang-tools-extra/clang-tidy/cert/DefaultOperatorNewCheck.cpp:49 + if (HasDefaultOperatorNew && OverAligned) +diag(NewExpr->getBeginLoc(), "using default 'operator new' with over-aligned

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp:53 +CheckFactories.registerCheck( +"cert-default-operator-new"); CheckFactories.registerCheck( aaron.ballm

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 220625. balazske added a comment. Rebase and update according to comments. C++17 related changes not implemented yet (possible check for the called allocation function). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 220628. balazske added a comment. Fixed the test, fixed problems in list.rst. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67545/new/ https://reviews.llvm.org/D67545 Files: clang-tools-extra/clang-tidy/cer

[PATCH] D67480: [analyzer] Add 'freopen' support to SimpleStreamChecker.

2019-09-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske abandoned this revision. balazske added a comment. I try to improve `StreamChecker` instead. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67480/new/ https://reviews.llvm.org/D67480 ___ cfe-co

[PATCH] D67706: [clang][checkers] Using CallDescription in StreamChecker.

2019-09-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp. Herald added a project: clang. Recognization of function names is done now with the CallDescription class instead of using IdentifierInfo. This means function name and argument count is compared to

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang-tools-extra/clang-tidy/cert/DefaultOperatorNewCheck.cpp:51 + // The alignment used by default 'operator new' (in bits). + const unsigned DefaultAlignment = Context.getTargetInfo().getNe

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-09-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 222138. balazske added a comment. Using CallDescriptionMap. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67706/new/ https://reviews.llvm.org/D67706 Files: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cp

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-09-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 222161. balazske added a comment. - Rename to DefaultOperatorNewAlignmentCheck. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67545/new/ https://reviews.llvm.org/D67545 Files: clang-tools-extra/clang-tidy/c

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-09-30 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:90-106 + FnCheck identifyCall(const CallEvent &Call, CheckerContext &C, + const CallExpr *CE) const; + + void evalFop

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-10-01 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 222566. balazske added a comment. - Various code cleanups. Eval functions use CallEvent, CallExpr is removed from state. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67706/new/ https://reviews.llvm.org/D6770

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-10-01 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 3 inline comments as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:109-110 bool StreamChecker::evalCall(const CallEvent &Call, CheckerContext &C) const { + if (!Call.isGlobalCFunction()) +return false;

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-10-01 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 2 inline comments as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:109-110 bool StreamChecker::evalCall(const CallEvent &Call, CheckerContext &C) const { + if (!Call.isGlobalCFunction()) +return false;

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-10-02 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 222795. balazske marked an inline comment as done. balazske added a comment. - Re-design of eval functions. - Added a C++ test with fopen-looking function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67706/ne

[PATCH] D47459: [ASTImporter] Eliminated some unittest warnings.

2018-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 153015. balazske added a comment. Rebase to newest master. Repository: rC Clang https://reviews.llvm.org/D47459 Files: unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp

[PATCH] D48628: [AST] Structural equivalence of methods

2018-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added a subscriber: cfe-commits. Added structural equivalence check for C++ methods. Improved structural equivalence tests. Added related ASTImporter tests. Repository: rC Clang https://reviews.llvm.org/D48628 Files: lib/AST/ASTStructuralEquivalence.c

[PATCH] D48631: [ASTImporter] Added import of CXXStdInitializerListExpr

2018-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, martong. Herald added a reviewer: a.sidorin. Repository: rC Clang https://reviews.llvm.org/D48631 Files: lib/AST/ASTImporter.cpp test/ASTMerge/std-initializer-list/Inputs/il.cpp test/ASTMerge/std-initializer-list/test

[PATCH] D48628: [AST] Structural equivalence of methods

2018-06-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: lib/AST/ASTStructuralEquivalence.cpp:873 + + if (auto *Constructor1 = dyn_cast(Method1)) { +if (auto *Constructor2 = dyn_cast(Method2)) { a.sidorin wrote: > ```if (Method1->getStmtKind() != Method2->getStmtKind())

[PATCH] D48722: [ASTImporter] Update isUsed flag at Decl import.

2018-06-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, martong. Herald added a reviewer: a.sidorin. When a Decl is imported over an already existing similar one, the isUsed flag is updated if it is set in the imported Decl. This can happen if the Decl is used somewhere in the impor

[PATCH] D48722: [ASTImporter] Update isUsed flag at Decl import.

2018-07-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Originally this change was made after the patch in https://reviews.llvm.org/D47632 was done. It is here back-ported to the state before it. I like the idea of integrating this change into https://reviews.llvm.org/D47632. (This is a new functionality: Attributes are up

[PATCH] D48773: [ASTImporter] Fix import of objects with anonymous types

2018-07-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: lib/AST/ASTImporter.cpp:2085 } + } else { +if (!IsStructuralMatch(D, FoundRecord, false)) martong wrote: > a_sidorin wrote: > > Is it possible to use the added code for the entire condi

[PATCH] D48628: [AST] Structural equivalence of methods

2018-07-04 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 154073. balazske added a comment. - Updates according to review comments Repository: rC Clang https://reviews.llvm.org/D48628 Files: lib/AST/ASTImporter.cpp lib/AST/ASTStructuralEquivalence.cpp unittests/AST/ASTImporterTest.cpp unittests/AST/Str

[PATCH] D48628: [AST] Structural equivalence of methods

2018-07-04 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: lib/AST/ASTImporter.cpp:2454 + if (IsStructuralMatch(D, FoundFunction)) { +const FunctionDecl *Definition = nullptr; +if (D->doesThisDeclarationHaveABody() && This change with `Definitio

[PATCH] D48628: [AST] Structural equivalence of methods

2018-07-05 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 154175. balazske added a comment. - Added comment into test StructuralEquivalenceRecordTest.DISABLED_Methods. Repository: rC Clang https://reviews.llvm.org/D48628 Files: lib/AST/ASTImporter.cpp lib/AST/ASTStructuralEquivalence.cpp unittests/AST/AS

[PATCH] D48628: [AST] Structural equivalence of methods

2018-07-05 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: unittests/AST/StructuralEquivalenceTest.cpp:489 + +TEST_F(StructuralEquivalenceRecordTest, DISABLED_Methods) { + auto t = makeNamedDecls( a_sidorin wrote: > Could you add a co

[PATCH] D48628: [AST] Structural equivalence of methods

2018-07-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: unittests/AST/StructuralEquivalenceTest.cpp:489 + +TEST_F(StructuralEquivalenceRecordTest, DISABLED_Methods) { + auto t = makeNamedDecls( a_sidorin wrote: > balazske wrote: >

[PATCH] D47632: [ASTImporter] Refactor Decl creation

2018-07-08 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: lib/AST/ASTImporter.cpp:6905 Decl *ToD = Pos->second; +// FIXME: remove this call from this function ASTNodeImporter(*this).ImportDefinitionIfNeeded(FromD, ToD); I think this comment is not needed (or with

[PATCH] D48628: [AST] Structural equivalence of methods

2018-07-11 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL336776: [AST] Structural equivalence of methods (authored by balazske, committed by ). Herald added a subscriber: llvm-com

[PATCH] D49223: [AST] Check described template at structural equivalence check.

2018-07-12 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added a subscriber: cfe-commits. When checking a class or function the described class or function template is checked too. Improved test with symmetric check, added new tests. Repository: rC Clang https://reviews.llvm.org/D49223 Files: lib/AST/ASTStr

[PATCH] D49235: [ASTImporter] Import described template (if any) of function.

2018-07-12 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, martong. Herald added a reviewer: a.sidorin. When a function is imported, check if it has a described template. The name lookup is corrected to find the templated entity in this case. The described template of the function is i

[PATCH] D49245: [ASTImporter] Import implicit methods of existing class.

2018-07-12 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, martong. Herald added a reviewer: a.sidorin. Herald added a reviewer: a.sidorin. When an already existing class is encountered during import, check if it has implicit methods that are missing in the existing one, and import the

[PATCH] D49293: [ASTImporter] Add support for import of CXXInheritedCtorInitExpr.

2018-07-13 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, martong. Herald added a reviewer: a.sidorin. Repository: rC Clang https://reviews.llvm.org/D49293 Files: lib/AST/ASTImporter.cpp test/Import/inherited-ctor-init-expr/Inputs/A.cpp test/Import/inherited-ctor-init-expr/t

[PATCH] D49296: [ASTImporter] Fix import of unnamed structs

2018-07-16 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: lib/AST/ASTStructuralEquivalence.cpp:913 - if (D1->isAnonymousStructOrUnion() && D2->isAnonymousStructOrUnion()) { + if (!D1->getDeclName() && !D2->getDeclName()) { // If both anonymous structs/unions are in a record context, m

[PATCH] D49245: [ASTImporter] Import implicit methods of existing class.

2018-07-16 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 155625. balazske added a comment. - Small style and comment changes. Repository: rC Clang https://reviews.llvm.org/D49245 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp

[PATCH] D49293: [ASTImporter] Add support for import of CXXInheritedCtorInitExpr.

2018-07-16 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: lib/AST/ASTImporter.cpp:6741 + + auto *Ctor = dyn_cast(Importer.Import( + E->getConstructor())); a_sidorin wrote: > cast_or_null? dyn_cast_or_null: Import may return nullptr, but if not, the cast should succeed (

[PATCH] D49235: [ASTImporter] Import described template (if any) of function.

2018-07-16 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: lib/AST/ASTImporter.cpp:2715 +if (auto *ToFT = dyn_cast(Importer.Import(FromFT))) + ToFunction->setDescribedFunctionTemplate(ToFT); +else a_sidorin wrote: > The function template should be already set after

[PATCH] D49235: [ASTImporter] Import described template (if any) of function.

2018-07-16 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 155630. balazske added a comment. - Removed setDescribedFunctionTemplate call. Repository: rC Clang https://reviews.llvm.org/D49235 Files: lib/AST/ASTImporter.cpp unittests/AST/ASTImporterTest.cpp Index: unittests/AST/ASTImporterTest.cpp =

[PATCH] D49245: [ASTImporter] Import implicit methods of existing class.

2018-07-16 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC337162: [ASTImporter] Import implicit methods of existing class. (authored by balazske, committed by ). Changed prior to commit: https://reviews.llvm.org/D49245?vs=155625&id=155648#toc Repository: rC

[PATCH] D49296: [ASTImporter] Fix import of unnamed structs

2018-07-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: unittests/AST/StructuralEquivalenceTest.cpp:615 + ASSERT_TRUE(R0); + ASSERT_TRUE(R1); + ASSERT_NE(R0, R1); These asserts can be removed too. Repository: rC Clang https://reviews.llvm.org/D49296 __

[PATCH] D49235: [ASTImporter] Import described template (if any) of function.

2018-07-17 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC337260: [ASTImporter] Import described template (if any) of function. (authored by balazske, committed by ). Changed prior to commit: https://reviews.llvm.org/D49235?vs=155630&id=155832#toc Repository:

[PATCH] D49293: [ASTImporter] Add support for import of CXXInheritedCtorInitExpr.

2018-07-17 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 155838. balazske added a comment. - Using cast_or_null Repository: rC Clang https://reviews.llvm.org/D49293 Files: lib/AST/ASTImporter.cpp test/Import/inherited-ctor-init-expr/Inputs/A.cpp test/Import/inherited-ctor-init-expr/test.cpp Index: tes

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-10-11 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67706/new/ https://reviews.llvm.org/D67706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-10-11 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 3 inline comments as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:288-290 + SymbolRef Sym = RetVal.getAsSymbol(); + stateNotNull = stateNotNull->set(Sym, StreamState::getOpened()); + stateNull = stateNull

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-10-18 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 225625. balazske added a comment. - Fixes from review comments, added C++ version test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67545/new/ https://reviews.llvm.org/D67545 Files: clang-tools-extra/clan

[PATCH] D67543: [Clang][ASTImporter] Added visibility check for ClassTemplateDecl.

2019-10-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67543/new/ https://reviews.llvm.org/D67543 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[PATCH] D67545: [clang-tidy] Added DefaultOperatorNewCheck.

2019-10-24 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 226206. balazske added a comment. - Improved check for C++17. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67545/new/ https://reviews.llvm.org/D67545 Files: clang-tools-extra/clang-tidy/cert/CERTTidyModule

[PATCH] D67706: [clang][analyzer] Using CallDescription in StreamChecker.

2019-10-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Ping again Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67706/new/ https://reviews.llvm.org/D67706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D80015: [Analyzer][StreamChecker] Added support for 'fread' and 'fwrite'.

2020-05-20 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf7c9f77ef372: [Analyzer][StreamChecker] Added support for 'fread' and 'fwrite'. (authored by balazske). Changed prior to commit: https://reviews.llvm.org/D80015?vs=264843&id=265159#toc Repository: rG

[PATCH] D80015: [Analyzer][StreamChecker] Added support for 'fread' and 'fwrite'.

2020-05-20 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 2 inline comments as done. balazske added a comment. I want to test the StreamChecker for false positives. Page http://clang.llvm.org/analyzer/open_projects.html says that it has too much false positives because state splitting (I did not see this page before.) There is an alter

[PATCH] D75432: [analyzer][NFC][MallocChecker] Convert many parameters into CallEvent

2020-05-20 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1194 - if (!FD) + if (!Call.getOriginExpr()) return; This should be added to avoid later crash (probably not needed for every check kind?): ``` const Funct

[PATCH] D75432: [analyzer][NFC][MallocChecker] Convert many parameters into CallEvent

2020-05-20 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1194 - if (!FD) + if (!Call.getOriginExpr()) return; Szelethus wrote: > Szelethus wrote: > > balazske wrote: > > > This should be added to avoid later crash (

[PATCH] D75432: [analyzer][NFC][MallocChecker] Convert many parameters into CallEvent

2020-05-20 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1194 - if (!FD) + if (!Call.getOriginExpr()) return; Szelethus wrote: > Szelethus wrote: > > balazske wrote: > > > Szelethus wrote: > > > > Szelethus wrote: >

[PATCH] D77846: [analyzer][CallAndMessage][NFC] Split up checkPreCall

2020-05-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske accepted this revision. balazske added a comment. This revision is now accepted and ready to land. Looks good. Not sure if it work in all cases after the `MallocChecker` problems but we can fix problems if any later. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77846/new/ htt

[PATCH] D80018: [Analyzer][StreamChecker] Added check for "indeterminate file position".

2020-05-21 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked 4 inline comments as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:107 + /// This value applies to all error states in ErrorState except FEOF. + /// An EOF+indeterminate state is the same as EOF state. + b

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-22 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:435 + /// If the call returns a C++ record type then the region of its return value + // can be retrieved from its construction context. + Optional getReturnValueUnde

[PATCH] D80018: [Analyzer][StreamChecker] Added check for "indeterminate file position".

2020-05-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:107 + /// This value applies to all error states in ErrorState except FEOF. + /// An EOF+indeterminate state is the same as EOF state. + b

[PATCH] D80018: [Analyzer][StreamChecker] Added check for "indeterminate file position".

2020-05-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:857-868 +// FEof and other states are possible. +// The path with FEof is the one that can continue. +// For this reason a non-fa

[PATCH] D80018: [Analyzer][StreamChecker] Added check for "indeterminate file position".

2020-05-26 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 266434. balazske added a comment. - Rebase - Some StreamState members are const and checked in constructor - Restructuring of some functions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80018/new/ https://re

[PATCH] D80018: [Analyzer][StreamChecker] Added check for "indeterminate file position".

2020-05-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 266440. balazske marked 2 inline comments as done. balazske added a comment. - Fixed a bug in previous update - Added new tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80018/new/ https://reviews.llvm.org

[PATCH] D80016: [analyzer] StdLibraryFunctionsChecker: Add support to lookup types

2020-05-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:747 + : *FilePtrTy) +: None; + martong wrote: > balazske wrote: > > The `Optional` can be left out from the right

[PATCH] D80018: [Analyzer][StreamChecker] Added check for "indeterminate file position".

2020-05-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske marked an inline comment as done. balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:670 - State = State->set(StreamSym, StreamState::getOpened(Desc)); + // FilePositionIndeterminate is not cleared. + State = State->set(

[PATCH] D80522: [Analyzer] [NFC] Parameter Regions -- Alternative Approach

2020-05-27 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:917 assert(isa(sReg) || isa(sReg) || isa(sReg) || isa(sReg)); } This assert should not be duplicated. It has the place in `VarRegion

[PATCH] D80018: [Analyzer][StreamChecker] Added check for "indeterminate file position".

2020-05-27 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9081fa20991d: [Analyzer][StreamChecker] Added check for "indeterminate file position". (authored by balazske). Changed prior to commit: https://reviews.llvm.org/D80018?vs=266440&id=266752#toc Repositor

[PATCH] D80699: [Analyzer][StreamChecker] Add check for pointer escape.

2020-05-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: clang. After an escape

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-05-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:112 +Optional ExprEngine::retrieveFromConstructionContext( +ProgramStateRef State, const LocationContext *LCtx, baloghadamsoftware wrote: > baloghadamsoftware wrote:

[PATCH] D80725: [Analyzer][StreamChecker] Updated initialization of BugType's.

2020-05-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: clang. BugType objects

[PATCH] D80725: [Analyzer][StreamChecker] Updated initialization of BugType's.

2020-05-28 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Why is `BuiltinBug` used instead of `BugType`? The differentiation between these classes looks not obvious. There is even a non-virtual `getDescription` function in both classes and a confusion with meaning of "name" and "description". Repository: rG LLVM Github Mo

[PATCH] D77658: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints

2020-05-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. The code looks basically good to me, some documentations can be improved. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:697 if (auto *FD = dyn_cast(D)) { - if (S.matchesSignature(FD)) { + if (S.

[PATCH] D80016: [analyzer] StdLibraryFunctionsChecker: Add support to lookup types

2020-05-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske accepted this revision. balazske added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:739 + Optional FileTy = lookupType("FILE", ACtx); + Optional FilePtrTy, FilePtrRestri

[PATCH] D79330: [Analyzer][VLASizeChecker] Check for VLA size overflow.

2020-05-29 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Strange: Even if the assume for zero index size does not indicate problem (assume that index length is not zero) the `getKnownValue` returns 0 for it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79330/new/ https://revie

[PATCH] D80903: [analyzer] Ignore calculated indices of <= 0 in VLASizeChecker

2020-06-01 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp:114-115 // Convert the array length to size_t. NonLoc IndexLength = SVB.evalCast(SizeD, SizeTy, SizeE->getType()).castAs(); // Multiply the array length by the

[PATCH] D80903: [analyzer] Ignore calculated indices of <= 0 in VLASizeChecker

2020-06-02 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. It is no problem to return instead of the assert. I could fix the problem by using SVal LessThanZeroVal = SVB.evalBinOp(State, BO_LE, SizeD, Zero, SizeTy); in `checkVLAIndexSize` (`BO_LT` is used before). Still the proposed return makes the code more safe. ==

[PATCH] D80903: [analyzer] Ignore calculated indices of <= 0 in VLASizeChecker

2020-06-02 Thread Balázs Kéri via Phabricator via cfe-commits
balazske accepted this revision. balazske added a comment. This revision is now accepted and ready to land. At least as fast bugfix it is acceptable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80903/new/ https://reviews.llvm.org/D80903 __

[PATCH] D81061: [Analyzer][VLASizeChecker] Fix problem with zero index assumption.

2020-06-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, arphaman, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: clang. balazs

<    1   2   3   4   5   6   7   8   9   10   >