[PATCH] D20689: [clang-tidy] Suspicious Call Argument checker

2017-01-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. In https://reviews.llvm.org/D20689#633889, @varjujan wrote: > I ran the check on multiple projects and tried to categorize the warnings: > real errors, false positives, naming

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2017-01-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Err, looks like I forgot to post comments I entered a few days ago. Just a few nits. Comment at: include/clang/Tooling/Core/Diagnostic.h:62 + Diagnostic(llvm::StringRef DiagnosticName, DiagnosticMessage , + llvm::StringMap , +

[PATCH] D26137: [clang-tidy] Add check name to YAML export

2017-01-03 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL290892: [clang-tidy] Add check name to YAML export (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D26137?vs=82860=82881#toc Repository: rL LLVM

[PATCH] D25406: Fix doubled whitespace in modernize-use-auto fixit

2017-01-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D25406#633892, @malcolm.parsons wrote: > I'd prefer a -format option to clang-tidy. Exactly. https://reviews.llvm.org/D25406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-01-09 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/modernize/UseNoexceptCheck.cpp:100 + StringRef ReplacementStr = + IsNoThrow ? NoexceptMacro.empty() ? "noexcept" : NoexceptMacro +

[PATCH] D21298: [Clang-tidy] delete null check

2016-12-29 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/readability/DeleteNullPointerCheck.cpp:29 + const auto BinaryPointerCheckCondition = binaryOperator( +

[PATCH] D21298: [Clang-tidy] delete null check

2016-12-29 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D21298#632235, @aaron.ballman wrote: > In https://reviews.llvm.org/D21298#632154, @xazax.hun wrote: > > > Small ping, is this ready to be committed? > > > If @alexfh doesn't sign off by tomorrow, I think it's fine to commit. We can > deal with

[PATCH] D21298: [Clang-tidy] delete null check

2016-12-29 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D21298#632265, @alexfh wrote: > In https://reviews.llvm.org/D21298#632235, @aaron.ballman wrote: > > > In https://reviews.llvm.org/D21298#632154, @xazax.hun wrote: > > > > > Small ping, is this ready to be committed? > > > > > > If @alexfh

[PATCH] D28189: Extend documentation of how to test clang-tidy checks.

2016-12-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: docs/clang-tidy/index.rst:558 +typically the basic `CHECK` forms (`CHECK-MESSAGES` and `CHECK-FIXES`) +are sufficient for matcher tests. Note that the `FileCheck` +documentation mostly assumes the default prefix (`CHECK`), and hence

[PATCH] D28189: Extend documentation of how to test clang-tidy checks.

2016-12-31 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Awesome! Thank you for adding clarity to this part. Looks good with a couple of nits. Comment at: docs/clang-tidy/index.rst:550 +separate `FileCheck`_ invocations: once

[PATCH] D21298: [Clang-tidy] delete null check

2017-01-02 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. One more late comment (I should really add a check-list for new checks): this check lacks tests with macros and templates with multiple instantiations. Incorrect handling of templates will likely not manifest in the current state of the check, it's brittle, since it

[PATCH] D28189: Extend documentation of how to test clang-tidy checks.

2017-01-02 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: docs/clang-tidy/index.rst:565 +An additional check enabled by ``check_clang_tidy.py`` ensures that +if `CHECK-MESSAGES:` is used in a file then every warning or error +must have an associated CHECK in that file. Looks

[PATCH] D22507: Clang-tidy - Enum misuse check

2016-12-19 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. A few more notes, all fine for a follow up. Comment at: clang-tidy/misc/SuspiciousEnumUsageCheck.cpp:202 + + const auto *LhsExpr = Result.Nodes.getNodeAs("lhsExpr"); + const auto *RhsExpr = Result.Nodes.getNodeAs("rhsExpr"); Looks

[PATCH] D27806: [clang-tidy] Add obvious-invalid-range

2016-12-23 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/obvious/InvalidRangeCheck.cpp:38 + +const auto CXX11_AlgorithmNames = +CXX_AlgorithmNames + "; " No global `auto` variables, please. In this case `auto` just isn't buying you anything, but in other cases

[PATCH] D28022: [clang-tidy] Handle constructors in performance-unnecessary-value-param

2016-12-22 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:96 - // Do not trigger on non-const value parameters when: - // 1. they are in a constructor definition since they can likely trigger - //modernize-pass-by-value which will

[PATCH] D28022: [clang-tidy] Handle constructors in performance-unnecessary-value-param

2016-12-21 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:114 if (AllDeclRefExprs.size() == 1 && -

[PATCH] D26453: [clang-tidy] Remove duplicated check from move-constructor-init

2016-12-21 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. LG. In https://reviews.llvm.org/D26453#592934, @flx wrote: > In https://reviews.llvm.org/D26453#590720, @malcolm.parsons wrote: > > > Add ValuesOnly option to modernize-pass-by-value. > > > Thanks for doing this. Alex, would this work for us? Yep, I think so.

[PATCH] D28729: [clang-tidy] Add -enable-alpha-checks command

2017-01-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/ClangTidy.cpp:296 const auto = - AnalyzerOptions::getRegisteredCheckers(/*IncludeExperimental=*/false); bool AnalyzerChecksEnabled = false; This is the place where a small local change will enable

[PATCH] D28667: [clang-tidy] Don't modernize-raw-string-literal if replacement is longer.

2017-01-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: test/clang-tidy/modernize-raw-string-literal.cpp:94 +char const *const Concatenated("\"foo\"" + "\"bar\"");

[PATCH] D28729: [clang-tidy] Add -enable-alpha-checks command

2017-01-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D28729#646555, @aaron.ballman wrote: > In https://reviews.llvm.org/D28729#646548, @alexfh wrote: > > > As discussed with the Static Analyzer maintainers, alpha checkers are > > completely unsupported and are suitable for very early testing

[PATCH] D30567: [clang-tidy] Fix treating non-space whitespaces in checks list.

2017-03-22 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. There's one more trim() you missed. And the test needs to be updated (`s/\\n/ /`). https://reviews.llvm.org/D30567 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30567: [clang-tidy] Fix treating non-space whitespaces in checks list.

2017-03-22 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:133 + StringRef UntrimmedGlob = GlobList.substr(0, GlobList.find(',')); + StringRef Glob = UntrimmedGlob.trim(); + GlobList = GlobList.substr(UntrimmedGlob.size() + 1);

[PATCH] D27210: [clang-tidy] misc-string-compare. Adding a new check to clang-tidy

2017-03-22 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. A late comment here: the check seems to suit better readability module instead of misc. Could you move it there? Repository: rL LLVM https://reviews.llvm.org/D27210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D29262: Fixes to modernize-use-using

2017-03-24 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D29262#709351, @krystyna wrote: > I have plan to finish this patch next week, when I finish academic year at my > school. If I will have any issues with submitting, Prazek offered to help me. Sure, no stress. Good luck with your studies!

[PATCH] D31308: [clang-tidy] new check readability-no-alternative-tokens

2017-03-24 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. FWIW, I'm pretty sure this can and should be done on the lexer level - it will be faster and more universal. Repository: rL LLVM https://reviews.llvm.org/D31308 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D31308: [clang-tidy] new check readability-no-alternative-tokens

2017-03-24 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. > So I would propose to keep the features as-is for now, > change the name to readability-operators-representation, and then later > (someone else?) might also add an option > for making this work the other way around. Would that be ok for you? Fine by me.

[PATCH] D31308: [clang-tidy] new check readability-no-alternative-tokens

2017-03-24 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D31308#709709, @mgehre wrote: > Thanks for your feedback, Eugene! > > I'm not sure if it would be helpful to have this check in both ways. I did a > code search for "not_eq", "bitand" and "and_eq" > on github, and their usage seems to be a

[PATCH] D31308: [clang-tidy] new check readability-no-alternative-tokens

2017-03-27 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/readability/OperatorsRepresentationCheck.cpp:34 + + if (const auto *B = Result.Nodes.getNodeAs("binary")) { +switch (B->getOpcode()) { aaron.ballman wrote: > I think this would make more sense lifted into

[PATCH] D31308: [clang-tidy] new check readability-no-alternative-tokens

2017-03-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/readability/OperatorsRepresentationCheck.cpp:34 + + if (const auto *B = Result.Nodes.getNodeAs("binary")) { +switch (B->getOpcode()) { aaron.ballman wrote: > mgehre wrote: > > aaron.ballman wrote: > > >

[PATCH] D31406: [clang-tidy] Reuse FileID in getLocation

2017-03-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. Thank you for finding out the root cause here! Comment at: clang-tidy/ClangTidy.cpp:241 -const FileEntry *File =

[PATCH] D31406: [clang-tidy] Reuse FileID in getLocation

2017-03-30 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG Do you have commit rights? https://reviews.llvm.org/D31406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30567: [clang-tidy] Fix treating non-space whitespaces in checks list.

2017-03-23 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thanks! Do you have commit rights? https://reviews.llvm.org/D30567 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D29858: [clang-tidy] Catch trivially true statements like a != 1 || a != 3

2017-03-23 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D29858#707897, @watsond wrote: > Following up. Was this checked in? Do I need to do anything further? Committed the patch now. Thanks for the reminder! Repository: rL LLVM https://reviews.llvm.org/D29858

[PATCH] D31252: [clang-tidy] add readability-compound-statement-size check.

2017-03-23 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. Hi Roman, Welcome to the community! As others noted, adding a separate check so similar functionally and implementation-wise to the existing one is not the best way to go here. A

[PATCH] D29858: [clang-tidy] Catch trivially true statements like a != 1 || a != 3

2017-03-23 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL298607: [clang-tidy] Catch trivially true statements like a != 1 || a != 3 (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D29858?vs=90087=92802#toc Repository: rL LLVM

[PATCH] D30592: [clang-tidy] Fix diag message for catch-by-value

2017-03-23 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL298608: [clang-tidy] Fix diag message for catch-by-value (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D30592?vs=90572=92805#toc Repository: rL LLVM

[PATCH] D29262: Fixes to modernize-use-using

2017-03-23 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Krystyna, do you need help committing the patch after you address the outstanding comments? https://reviews.llvm.org/D29262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30841: [clang-tidy] readability-misleading-indentation: fix chained if

2017-03-16 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:40-42 + for (auto Iter = ChainedIfs.find(If); Iter != ChainedIfs.end(); + Iter = ChainedIfs.find(Iter->second)) +IfLoc = Iter->second->getIfLoc(); alexfh

[PATCH] D30841: [clang-tidy] readability-misleading-indentation: fix chained if

2017-03-16 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. Thank you for the fix! One comment inline. Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:40-42 + for (auto Iter = ChainedIfs.find(If); Iter !=

[PATCH] D31049: [Clang-tidy] Fix for misc-noexcept-move-constructor false triggers on defaulted declarations

2017-03-17 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL298101: [Clang-tidy] Fix for misc-noexcept-move-constructor false triggers on defaulted… (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D31049?vs=92037=92159#toc Repository:

[PATCH] D30931: [clang-tidy] modified identifier naming case to use CT_AnyCase for ignoring case style

2017-03-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Could you generate a diff with full context (http://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface)? https://reviews.llvm.org/D30931 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D31160: [clang-tidy] Fix misc-move-const-arg for move-only types.

2017-03-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh created this revision. Fix misc-move-const-arg false positives on move-only types. https://reviews.llvm.org/D31160 Files: clang-tidy/misc/MoveConstantArgumentCheck.cpp test/clang-tidy/misc-move-const-arg.cpp Index: test/clang-tidy/misc-move-const-arg.cpp

[PATCH] D30931: [clang-tidy] added new identifier naming case type for ignoring case style

2017-03-16 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D30931#702578, @jutocz wrote: > You are right, it does look misleading. I'll try to modify it the way you > suggest (though I'm new to LLVM, so be ready to give me more comments;) Sure, thank you for the work!

[PATCH] D31097: [clang-tidy] don't warn about implicit widening casts in function calls

2017-03-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D31097#704621, @xazax.hun wrote: > I wonder whether warning on implicit casts still makes sense for example in > mission critical code. So maybe it is worth to have a configuration option > with the default setting being less strict and

[PATCH] D31097: [clang-tidy] don't warn about implicit widening casts in function calls

2017-03-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D31097#704626, @alexfh wrote: > In https://reviews.llvm.org/D31097#704621, @xazax.hun wrote: > > > I wonder whether warning on implicit casts still makes sense for example in > > mission critical code. So maybe it is worth to have a

[PATCH] D30841: [clang-tidy] readability-misleading-indentation: fix chained if

2017-03-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D30841#702980, @fgross wrote: > Now using `ASTContext::getParents` instead of `ChainedIfs` map. > > For some reason I thought of `getParents` as an expensive

[PATCH] D30841: [clang-tidy] readability-misleading-indentation: fix chained if

2017-03-17 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL298059: [clang-tidy] readability-misleading-indentation: fix chained if (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D30841?vs=92026=92116#toc Repository: rL LLVM

[PATCH] D31049: [Clang-tidy] Fix for misc-noexcept-move-constructor false triggers on defaulted declarations

2017-03-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Do you have commit rights? Repository: rL LLVM https://reviews.llvm.org/D31049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D31049: [Clang-tidy] Fix for misc-noexcept-move-constructor false triggers on defaulted declarations

2017-03-17 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG Repository: rL LLVM https://reviews.llvm.org/D31049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30748: [Lexer] Finding beginning of token with escaped new line

2017-03-16 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: lib/Lex/Lexer.cpp:457 +static bool isNewLineEscaped(const char *BufferStart, const char *Str) { + while (Str > BufferStart && isWhitespace(*Str))

[PATCH] D30931: [clang-tidy] modified identifier naming case to use CT_AnyCase for ignoring case style

2017-03-22 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. A couple of nits, otherwise looks good. Do you need me to commit the patch for you? Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:169

[PATCH] D30567: [clang-tidy] Fix treating non-space whitespaces in checks list.

2017-03-22 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D30567#696436, @curdeius wrote: > Hi Alex and sorry for the late reply. > > The main use case is a more readable `.clang-tidy` configuration checks. > Before this correction one can use something like this: > > --- > Checks: ' > ,*,

[PATCH] D30931: [clang-tidy] modified identifier naming case to use CT_AnyCase for ignoring case style

2017-03-22 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL298499: [clang-tidy] modified identifier naming case to use CT_AnyCase for ignoring… (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D30931?vs=92619=92623#toc Repository: rL

[PATCH] D31130: B32239 clang-tidy should not warn about array to pointer decay on system macros

2017-03-22 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D31130#707197, @aaron.ballman wrote: > This change was reverted in r298470. The use of the include is a > problem because this is not a clang-supplied header file. Also, there's a > (good) question about what array decay is happening in the

[PATCH] D31860: Add more examples to clang tidy checkers

2017-04-10 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Thanks! LG with a couple of nits. Comment at: docs/clang-tidy/checks/misc-inefficient-algorithm.rst:25 + std::set s; + auto c = count(s.begin(), s.end(), 43); +

[PATCH] D31706: [clang-format] Handle NSString literals by merging tokens.

2017-04-10 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Friendly ping. https://reviews.llvm.org/D31706 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D31308: [clang-tidy] new check readability-no-alternative-tokens

2017-04-04 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/readability/OperatorsRepresentationCheck.cpp:34 + + if (const auto *B = Result.Nodes.getNodeAs("binary")) { +switch (B->getOpcode()) { Eugene.Zelenko wrote: > aaron.ballman wrote: > > alexfh wrote: > > >

[PATCH] D31706: [clang-format] Handle NSString literals by merging tokens.

2017-04-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh created this revision. Herald added a subscriber: klimek. This fixes a couple of outstanding bugs: - incorrect breaking of NSString literals containing double-width characters; - inconsistent formatting of ObjC dictionary literals containing NSString literals; -

[PATCH] D31713: [Basic] getColumnNumber returns location of CR+LF on Windows

2017-04-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG with one nit. Thank you for tracking down this bug and fixing it! Comment at: lib/Basic/SourceManager.cpp:1153 + if (FilePos + 1 == LineEnd && FilePos > LineStart)

[PATCH] D31706: [clang-format] Handle NSString literals by merging tokens.

2017-04-11 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL299927: [clang-format] Handle NSString literals by merging tokens. (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D31706?vs=94218=94801#toc Repository: rL LLVM

[PATCH] D31862: docs/clang-tidy/tools/dump_check_docs.py: Remove deprecated script

2017-04-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D31862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D31860: Add more examples to clang tidy checkers

2017-04-11 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Another couple of post-commit comments. Comment at: docs/clang-tidy/checks/misc-unused-parameters.rst:15 + + void a(int /*i*/) {} + nit: two spaces before the comment. Comment at:

[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. SGTM provided this continues to work with python 2. https://reviews.llvm.org/D32294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D32294#732986, @Prazek wrote: > In https://reviews.llvm.org/D32294#732861, @kuhar wrote: > > > After thinking about Piotr's comment, I think that a better way to perform > > the check would be te invoking clang-apply-replacements with

[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/tool/run-clang-tidy.py:226 +print('Applying fixes ...') +successfully_applied = True + ` = False` here and ` = True` after `apply_fixes()` inside `try`. https://reviews.llvm.org/D32294

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D24892#732243, @malcolm.parsons wrote: > In https://reviews.llvm.org/D24892#732217, @alexfh wrote: > > > In https://reviews.llvm.org/D24892#723536, @malcolm.parsons wrote: > > > > > Is there any way for multiple checks to share an option? > > >

[PATCH] D24892: [clang-tidy] Add option "LiteralInitializers" to cppcoreguidelines-pro-type-member-init

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D24892#723536, @malcolm.parsons wrote: > The `modernize-use-default-member-init` check now has an option with the same > effect, but it is called `UseAssignment`. > We should use consistent option names. > Is there any way for multiple

[PATCH] D32294: [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds

2017-04-20 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/tool/run-clang-tidy.py:99-101 + except: +print >>sys.stderr, "Unable to run clang-apply-replacements." +sys.exit(1)

[PATCH] D32112: [clang] Register isConstexpr matcher

2017-04-16 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG Repository: rL LLVM https://reviews.llvm.org/D32112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D31860: Add more examples to clang tidy checkers

2017-04-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: docs/clang-tidy/checks/misc-unused-parameters.rst:15 + + void a(int /*i*/) {} + sylvestre.ledru wrote: > alexfh wrote: > > nit: two spaces before the comment. > I believe it is the case ? > I stole this from the unit

[PATCH] D32170: Add a FixItHint for -Wmissing-prototypes to insert 'static '.

2017-04-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh created this revision. Missing 'static' on functions that are intended to be local to a translation unit seems to be the most common cause of -Wmissing-prototypes warnings, so suggesting a fix seems to be convenient and useful. https://reviews.llvm.org/D32170 Files:

[PATCH] D32164: [clang-tidy] misc-misplaced-widening-cast: Disable checking of implicit widening casts by default

2017-04-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D32164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Awesome, thanks! A few late comments inline. Comment at: clang-tools-extra/trunk/clang-tidy/performance/InefficientVectorOperationCheck.cpp:56 +void InefficientVectorOperationCheck::registerMatchers(MatchFinder *Finder) { + const auto VectorDecl =

[PATCH] D31542: [clang-tidy] Extend readability-container-size-empty to add comparisons to newly-constructed objects

2017-04-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. LG with one nit. Comment at: clang-tidy/readability/ContainerSizeEmptyCheck.cpp:209 + "the 'empty' method should be used to check " + "for emptiness instead of comparing to an empty object.") +<<

[PATCH] D24886: Add [[clang::suppress(rule, ...)]] attribute

2017-04-18 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: cfe/trunk/include/clang/Basic/AttrDocs.td:2792 + namespace N { +[[clang::suppress("type", "bounds")]]; +... Should this be `gsl::suppress` as well? Repository: rL LLVM https://reviews.llvm.org/D24886

[PATCH] D29858: [clang-tidy] Catch trivially true statements like a != 1 || a != 3

2017-03-02 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Do you need someone to commit the patch for you? https://reviews.llvm.org/D29858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30748: [Lexer] Finding beginning of token with escaped new line

2017-03-09 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: lib/Lex/Lexer.cpp:457 +static bool isNewLineEscaped(const char *BufferStart, const char *Str) { + while (Str > BufferStart && isWhitespace(*Str))

[PATCH] D30610: [clang-tidy] Added options to cppcoreguidelines-special-member-functions check

2017-03-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp:184 + if (!MissingMembers.empty()) +diag(ID.first, "class '%0' defines %1 but does not define %2") +<< ID.second << join(DefinedMembers, " and ")

[PATCH] D30931: [clang-tidy] added new identifier naming case type for ignoring case style

2017-03-14 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. BTW, next time please add cfe-commits to subscribers when you create the patch to get it sent properly to the mailing list. https://reviews.llvm.org/D30931 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30639: [clang-tidy] Ignore substituted template types in modernize-use-nullptr check.

2017-03-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG https://reviews.llvm.org/D30639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30650: [clang-tidy] misc-use-after-move: Fix failing assertion

2017-03-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. So you won the flappy column game? ;) https://reviews.llvm.org/D30650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30639: [clang-tidy] Ignore substituted template types in modernize-use-nullptr check.

2017-03-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr.cpp:254 + + void h(T *default_value = 0) {} + xazax.hun wrote: > Maybe as a separate patch, but I think it might be worth to warn here. WDYT? > (Sorry for

[PATCH] D30650: [clang-tidy] misc-use-after-move: Fix failing assertion

2017-03-06 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D30650#693165, @Eugene.Zelenko wrote: > I think we should refactor this check as part of Static Analyzer, since it's > path-sensitive. We can think about trying this as a SA checker, but it's irrelevant to this patch.

[PATCH] D30607: Replace re module by regex module in run-clang-tidy script

2017-03-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Actually, I'm not sure why we need groups in that regex. We can instead try replacing `re.compile('(' + ')|('.join(args.files) + ')')` with `re.compile('|'.join(args.files))`. https://reviews.llvm.org/D30607 ___

[PATCH] D30607: Replace re module by regex module in run-clang-tidy script

2017-03-05 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. https://docs.python.org/2/howto/regex.html#introduction says "The regex module was removed completely in Python 2.5.". Why would we want to switch to it? https://reviews.llvm.org/D30607 ___ cfe-commits mailing list

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90445. alexfh marked an inline comment as done. alexfh added a comment. Replace the separate -format and -style options with -format-style (default is 'none', which means no formatting). https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. PTAL https://reviews.llvm.org/D30564 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90452. alexfh added a comment. Apply changes even when formatting fails. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/tool/ClangTidyMain.cpp docs/ReleaseNotes.rst docs/clang-tidy/index.rst

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296864: [clang-tidy] Format code around applied fixes (authored by alexfh). Changed prior to commit: https://reviews.llvm.org/D30564?vs=90452=90453#toc Repository: rL LLVM

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90447. alexfh added a comment. Expanded -format-style option description. Run cleanup tests with different format styles, just in case. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/tool/ClangTidyMain.cpp

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. In https://reviews.llvm.org/D30564#691446, @malcolm.parsons wrote: > In https://reviews.llvm.org/D30564#691441, @alexfh wrote: > > > Replace the separate -format and -style options with -format-style (default > > is > > 'none', which means no formatting). > > > Is there

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90448. alexfh added a comment. Clarify the 'file' option a bit. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/tool/ClangTidyMain.cpp docs/ReleaseNotes.rst docs/clang-tidy/index.rst test/clang-tidy/clean-up-code.cpp

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh updated this revision to Diff 90442. alexfh added a comment. Pacify llvm::Expected<> debug checks. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/ClangTidy.h clang-tidy/tool/ClangTidyMain.cpp docs/ReleaseNotes.rst docs/clang-tidy/index.rst

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh created this revision. Herald added a subscriber: JDevlieghere. Add -format option (disabled by default for now) to trigger formatting of replacements. https://reviews.llvm.org/D30564 Files: clang-tidy/ClangTidy.cpp clang-tidy/ClangTidy.h clang-tidy/tool/ClangTidyMain.cpp

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: test/clang-tidy/readability-braces-around-statements-format.cpp:1 +// RUN: %check_clang_tidy %s readability-braces-around-statements %t -- -format -- + malcolm.parsons wrote: > Will clang-tidy look for a .clang-format

[PATCH] D30564: [clang-tidy] Format code around applied fixes

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh marked an inline comment as done. alexfh added inline comments. Comment at: docs/clang-tidy/index.rst:184 -p= - Build path +-quiet - + Run clang-tidy in quiet mode. This suppresses

[PATCH] D30569: [clang-tidy] misc-use-after-move: Fix failing assertion

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG. Thanks! Comment at: test/clang-tidy/misc-use-after-move.cpp:285 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved - // CHECK-MESSAGES:

[PATCH] D30567: [clang-tidy] Fix treating non-space whitespaces in checks list.

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. What's the practical use of newlines and tab characters in the glob list? https://reviews.llvm.org/D30567 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30569: [clang-tidy] misc-use-after-move: Fix failing assertion

2017-03-03 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: test/clang-tidy/misc-use-after-move.cpp:285 // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved - // CHECK-MESSAGES: [[@LINE-3]]:6: note: move occurred here + // CHECK-MESSAGES: [[@LINE-3]]:7: note: move occurred

[PATCH] D35941: Fix -Wshadow false positives with function-local classes.

2017-07-31 Thread Alexander Kornienko via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL309569: Fix -Wshadow false positives with function-local classes. (authored by alexfh). Repository: rL LLVM https://reviews.llvm.org/D35941 Files: cfe/trunk/lib/Sema/SemaDecl.cpp

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