Re: [PATCH] D20207: [AST] Move operations enum to a definition file.

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb marked an inline comment as done. etienneb added a comment. Comment at: include/clang/AST/OperationKinds.def:15 @@ +14,3 @@ +// +/// @file OperationKinds.def +/// aaron.ballman wrote: > Do we use @file doxygen comments usually? I'm not certain if I've

Re: [PATCH] D20196: [clang-tidy] Inefficient string operation

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. etienneb added a comment. drive-by, some nits. Comment at: clang-tidy/performance/InefficientStringAdditionCheck.cpp:31 @@ +30,3 @@ +void InefficientStringAdditionCheck::registerMatchers(MatchFinder *Finder) { + auto BasicStringType = has

[PATCH] D20218: [Tooling] Fix broken dependency for shared build

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. There virtual destructor can't be found and cause a compilation error on a shared build. To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ``` Which produ

Re: [PATCH] D20218: [Tooling] Fix broken dependency for shared build

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. note: To repro, you must compile the tests. % ninja check-all http://reviews.llvm.org/D20218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18575: [clang-tidy] New checker to replace deprecated throw() specifications

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. etienneb added a comment. drive by Comment at: clang-tidy/modernize/UseNoexceptCheck.cpp:40 @@ +39,3 @@ + unsigned &Len) { + SourceManager &SM = *Result.SourceManager; + const ASTContext &Context = *Resul

r269334 - [Tooling] Fix broken dependency for shared build

2016-05-12 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu May 12 14:51:18 2016 New Revision: 269334 URL: http://llvm.org/viewvc/llvm-project?rev=269334&view=rev Log: [Tooling] Fix broken dependency for shared build Summary: There virtual destructor can't be found and cause a compilation error on a shared build. To repro: [Rel

Re: [PATCH] D20170: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. Comment at: clang-tidy/utils/TypeTraits.cpp:35 @@ +34,3 @@ +return false; + for (const CXXConstructorDecl *Constructor : Record->ctors()) { +if (Constructor->isCopyConstructor() && Constructor->isDeleted()) aaron.bal

Re: [PATCH] D20170: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/utils/TypeTraits.cpp:24 @@ -20,2 +23,3 @@ + bool classHasTrivialCopyAndDestroy(QualType Type) { auto *Record = Type->getAsCXXRecordDecl(); Should this be lifted to 'type_traits' ? The same function exist

Re: [PATCH] D18919: [Clang-tidy] Add check "modernize use using"

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. Comment at: clang-tidy/modernize/UseUsingCheck.cpp:32 @@ +31,3 @@ + + diag(MatchedDecl->getLocStart(), "use using instead of typedef") + << FixItHint::CreateReplacement( I think 'using' should be quote. This message is

Re: [PATCH] D20053: [clang-tidy] Add misc-unnecessary-mutable check.

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. Comment at: clang-tidy/misc/UnnecessaryMutableCheck.cpp:38 @@ +37,3 @@ + + void RunSearch(Decl *Declaration) { +auto *Body = Declaration->getBody(); nit: Decl *Declaration -> const Decl *Declaration and other visitor fu

r269347 - [AST] Move operations enum to a definition file.

2016-05-12 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu May 12 15:58:56 2016 New Revision: 269347 URL: http://llvm.org/viewvc/llvm-project?rev=269347&view=rev Log: [AST] Move operations enum to a definition file. Summary: This patch moves the enum definitions to a definition (.def) file. These modifications provide way to l

Re: [PATCH] D18575: [clang-tidy] New checker to replace deprecated throw() specifications

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/modernize/UseNoexceptCheck.cpp:98 @@ +97,3 @@ + const auto *FuncDecl = Result.Nodes.getNodeAs("functionDecl"); + if (!FuncDecl) +return; I'm not saying to use 'const *FuncDecl', but 'const auto*' ==

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57101. etienneb marked an inline comment as done. etienneb added a comment. regenerate doc http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/AST

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57123. etienneb added a comment. add unittest http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/AST

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D19871#428997, @jroelofs wrote: > Drive-by thought: I think it would be useful to be able to match implicit > casts separately from explicit casts when using this new matcher. Jonathan, I think what you are asking for is already supported. I

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57124. etienneb added a comment. nit: indentation http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests

Re: [PATCH] D20170: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/utils/TypeTraits.cpp:22 @@ -20,2 +21,3 @@ + bool classHasTrivialCopyAndDestroy(QualType Type) { auto *Record = Type->getAsCXXRecordDecl(); My bad! I didn't saw the file change when reading. Forget about it

[PATCH] D20226: [AST] Add missing const qualifiers to AstContext in Type.cpp

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: rsmith. etienneb added a subscriber: cfe-commits. Add some missing const qualifiers to AstContext. The ASTContext can't be modified with accessors. There is no behavior change. This patch is cleanup only. http://reviews.llvm.org/D20226

Re: [PATCH] D20170: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/utils/TypeTraits.cpp:42 @@ -27,3 +41,3 @@ llvm::Optional isExpensiveToCopy(QualType Type, ASTContext &Context) { if (Type->isDependentType()) You're right too. But, it's possible to fix these prototypes:

r269418 - [AST] Add missing const qualifiers to AstContext in Type.cpp

2016-05-13 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Fri May 13 09:31:44 2016 New Revision: 269418 URL: http://llvm.org/viewvc/llvm-project?rev=269418&view=rev Log: [AST] Add missing const qualifiers to AstContext in Type.cpp Summary: Add some missing const qualifiers to AstContext. The ASTContext can't be modified with acces

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-13 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D19871#429466, @Prazek wrote: > +1 I will probably also use this. > > Does hasCastKind works for implicitCastExpr? Yes, there is a unittest with the code. http://reviews.llvm.org/D19871 ___ cfe

[PATCH] D20240: [clang-rename] Fix broken dependency on shared build.

2016-05-13 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. The build is broken due to a missing dependency. To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ``` Which produce this error: ``` tools/clang/tools/ext

Re: [PATCH] D20240: [clang-rename] Fix broken dependency on shared build.

2016-05-13 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. thanks, landing as soon as my other checkouts complete their tests (few minutes). http://reviews.llvm.org/D20240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang-tools-extra] r269429 - [clang-rename] Fix broken dependency on shared build.

2016-05-13 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Fri May 13 10:38:54 2016 New Revision: 269429 URL: http://llvm.org/viewvc/llvm-project?rev=269429&view=rev Log: [clang-rename] Fix broken dependency on shared build. Summary: The build is broken due to a missing dependency. To repro: [Release + Shared] ``` -DCMAKE_BUILD_TY

[PATCH] D20245: [include-fixer] Fix broken dependency shared build

2016-05-13 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added reviewers: bkramer, hokein. etienneb added a subscriber: cfe-commits. The shared build is broken (again). To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ``` Errors: ``` tools/clang/tools/extra/include-fixer/tool/C

[clang-tools-extra] r269441 - [include-fixer] Fix broken dependency shared build

2016-05-13 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Fri May 13 12:38:22 2016 New Revision: 269441 URL: http://llvm.org/viewvc/llvm-project?rev=269441&view=rev Log: [include-fixer] Fix broken dependency shared build Summary: The shared build is broken (again). To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUI

Re: [PATCH] D20245: [include-fixer] Fix broken dependency shared build

2016-05-13 Thread Etienne Bergeron via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL269441: [include-fixer] Fix broken dependency shared build (authored by etienneb). Changed prior to commit: http://reviews.llvm.org/D20245?vs=57208&id=57221#toc Repository: rL LLVM http://reviews.ll

Re: [PATCH] D20240: [clang-rename] Fix broken dependency on shared build.

2016-05-13 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D20240#429910, @vmiklos wrote: > Thanks for fixing the problem I introduced. :-) No worries, I did the same twice this week. http://reviews.llvm.org/D20240 ___ cfe-commits mailing list cfe-comm

r269460 - Add an AST matcher for CastExpr kind

2016-05-13 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Fri May 13 14:36:55 2016 New Revision: 269460 URL: http://llvm.org/viewvc/llvm-project?rev=269460&view=rev Log: Add an AST matcher for CastExpr kind Summary: This AST matcher will match a given CastExpr kind. It's an narrowing matcher on CastExpr. Reviewers: klimek, alexfh

[PATCH] D20261: [compiler-rt] Fix multi-configuration output paths

2016-05-13 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: rnk. etienneb added a subscriber: cfe-commits. When using a multi-configuration build (i.e. MSVC) the output path where libraries are dropped is incorrect. Example: ``` C:\src\llvm\examples>d:\src\llvm\build\Release\bin\clang-cl.exe -fsa

Re: [PATCH] D20261: [compiler-rt] Fix multi-configuration output paths

2016-05-13 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D20261#430151, @rnk wrote: > Will this put the libraries in build/Release/bin/../lib/. aka > build/Release/lib, or will they collide between build types? If I get your question correctly, they won't collide since the first folder below

Re: [PATCH] D20196: [clang-tidy] Inefficient string operation

2016-05-15 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/performance/InefficientStringAdditionCheck.cpp:35 @@ +34,3 @@ + cxxOperatorCallExpr(hasAnyArgument(ignoringImpCasts(declRefExpr(BasicStringType))), + hasOverloadedOperatorName("+")); + --

Re: [PATCH] D18575: [clang-tidy] New checker to replace deprecated throw() specifications

2016-05-15 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/modernize/UseNoexceptCheck.cpp:22 @@ +21,3 @@ +static StringRef +MakeDynamicExceptionString(const SourceManager &SM, + const CharSourceRange &FileMoveRange) { coding style: MakeDynami

Re: [PATCH] D19841: [clang-tidy] Lift common matchers to utils namespace

2016-05-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57314. etienneb marked an inline comment as done. etienneb added a comment. rebase over trunk. matchers are lifted to ASTMatchers. http://reviews.llvm.org/D19841 Files: clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp clang-tidy/modernize/UseNull

Re: [PATCH] D19841: [clang-tidy] Lift common matchers to utils namespace

2016-05-15 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57316. etienneb added a comment. nits: indent http://reviews.llvm.org/D19841 Files: clang-tidy/misc/BoolPointerImplicitConversionCheck.cpp clang-tidy/modernize/UseNullptrCheck.cpp clang-tidy/performance/FasterStringFindCheck.cpp clang-tidy/readabil

[PATCH] D20279: [clang-tidy] Cleanups utils files

2016-05-15 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. Cleanup some code by using appropriate APIs. Some coding style cleanups. There is no behavior changes. http://reviews.llvm.org/D20279 Files: clang-tidy/utils/DeclRefExprUtils.cpp cla

[clang-tools-extra] r269656 - [clang-tidy] Cleanups utils files

2016-05-16 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Mon May 16 09:34:20 2016 New Revision: 269656 URL: http://llvm.org/viewvc/llvm-project?rev=269656&view=rev Log: [clang-tidy] Cleanups utils files Summary: Cleanup some code by using appropriate APIs. Some coding style cleanups. There is no behavior changes. - Function `I

[clang-tools-extra] r269804 - [clang-tidy] Lift common matchers to utils namespace

2016-05-17 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Tue May 17 14:36:09 2016 New Revision: 269804 URL: http://llvm.org/viewvc/llvm-project?rev=269804&view=rev Log: [clang-tidy] Lift common matchers to utils namespace Summary: This patch is lifting matchers used by more than one checkers to the common namespace. Reviewers: a

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-29 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 51927. etienneb added a comment. fix invalid comment. http://reviews.llvm.org/D18475 Files: clang-tidy/readability/RedundantStringCStrCheck.cpp test/clang-tidy/readability-redundant-string-cstr.cpp Index: test/clang-tidy/readability-redundant-string-c

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-29 Thread Etienne Bergeron via cfe-commits
etienneb marked an inline comment as done. etienneb added a comment. thanks, aaron.ballman@. Comment at: clang-tidy/readability/RedundantStringCStrCheck.cpp:129 @@ +128,3 @@ + // Detect: 'dst += str.c_str()' -> 'dst += str' + // Detect: 's == str.c_str()' -> 's == str' +

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-29 Thread Etienne Bergeron via cfe-commits
etienneb marked an inline comment as done. etienneb added a comment. I'll to try to make a better way to describe redundant cases (as proposed by sbenza@) with an array. I like the array based approach, it's lean and clean. I'll try to make a prototype of the generic overloaded functions matcher

Re: [PATCH] D18457: [clang-tidy] Add a new checker to detect missing comma in initializer list.

2016-03-29 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 51969. etienneb marked 5 inline comments as done. etienneb added a comment. address alexfh@ comments. http://reviews.llvm.org/D18457 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousMissingCommaCheck.

Re: [PATCH] D18457: [clang-tidy] Add a new checker to detect missing comma in initializer list.

2016-03-29 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: clang-tidy/misc/SuspiciousMissingCommaCheck.cpp:42 @@ +41,3 @@ + const auto *ConcatenatedLiteral = Result.Nodes.getNodeAs("str"); + if (InitializerList && ConcatenatedLiteral) { +// Skip small arrays as they often generate false-po

Re: [PATCH] D18457: [clang-tidy] Add a new checker to detect missing comma in initializer list.

2016-03-31 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52225. etienneb marked 5 inline comments as done. etienneb added a comment. address alexfh@ comments. http://reviews.llvm.org/D18457 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousMissingCommaCheck.

Re: [PATCH] D18457: [clang-tidy] Add a new checker to detect missing comma in initializer list.

2016-03-31 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52226. etienneb added a comment. nits http://reviews.llvm.org/D18457 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousMissingCommaCheck.cpp clang-tidy/misc/SuspiciousMissingCommaCheck.h docs/clang

Re: [PATCH] D18457: [clang-tidy] Add a new checker to detect missing comma in initializer list.

2016-03-31 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. ready to land. Comment at: clang-tidy/misc/SuspiciousMissingCommaCheck.cpp:75 @@ +74,3 @@ + diag(ConcatenatedLiteral->getLocStart(), + "suspicious string literal, probably missing a comma"); +} alexfh wrote: > xazax.hun wrote: >

[clang-tools-extra] r265033 - [clang-tidy] Add a new checker to detect missing comma in initializer list.

2016-03-31 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Mar 31 13:12:23 2016 New Revision: 265033 URL: http://llvm.org/viewvc/llvm-project?rev=265033&view=rev Log: [clang-tidy] Add a new checker to detect missing comma in initializer list. Summary: This checker is able to detect missing comma in an array of string literals.

Re: [PATCH] D18582: [Clang-tidy] Update release notes with list of checks added since 3.8

2016-03-31 Thread Etienne Bergeron via cfe-commits
etienneb accepted this revision. etienneb added a comment. thanks for taking care of this. Comment at: docs/ReleaseNotes.rst:131 @@ +130,3 @@ + Finds unnecessary string initializations. + +Fixed bugs: I just landed this one: http://reviews.llvm.org/D18457 I'll

[PATCH] D18695: [clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. This patch is adding detection of common string literal patterns that should not trigger warnings. [*] Add a limit on the number of concatenated token, [*] Add support for parenthese s

Re: [PATCH] D18695: [clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52365. etienneb added a comment. Simplification and nits. http://reviews.llvm.org/D18695 Files: clang-tidy/misc/SuspiciousMissingCommaCheck.cpp clang-tidy/misc/SuspiciousMissingCommaCheck.h test/clang-tidy/misc-suspicious-missing-comma.cpp Index: te

Re: [PATCH] D18649: [clang-tidy] cppcoreguidelines-interfaces-global-init

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. etienneb added a comment. some nits. Comment at: clang-tidy/cppcoreguidelines/InterfacesGlobalInitCheck.cpp:21 @@ +20,3 @@ +void InterfacesGlobalInitCheck::registerMatchers(MatchFinder *Finder) { + auto IsStaticGlobal = + allOf(hasGlo

Re: [PATCH] D18649: [clang-tidy] cppcoreguidelines-interfaces-global-init

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. more nits, sorry didn't saw them first time. Comment at: test/clang-tidy/cppcoreguidelines-interfaces-global-init.cpp:32 @@ +31,3 @@ +// CHECK-MESSAGES: [[@LINE-1]]:12: warning: initializing static variable with non-const expression depending on static

Re: [PATCH] D18695: [clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. thanks alex, I'll give a day or two to people to jump in. If no other comments, I'll land it. http://reviews.llvm.org/D18695 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. This checker is validating suspicious usage of string compare functions. Example: ``` if (strcmp(...)) // Implicitly compare to zero if (!strcmp(...)) // Won't warn if (st

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. As pointed by Eugene, The following code seems to produce multiple errors. int foo() { if (strcmp(A, "a") == true) return 0; return 1; } Results: /home/etienneb/examples/test.cc:56:7: warning: function 'strcmp' is compared to a suspicious constant

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. You're right, both are outputted. /home/etienneb/examples/test.cc:56:7: warning: function 'strcmp' is called without explicitly comparing result [misc-suspicious-string-compare] if (strcmp(A, "a")) ^ != 0 /home/etienneb/examples/te

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52420. etienneb added a comment. Fix support for C. Adding test for C99 code. http://reviews.llvm.org/D18703 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousStringCompareCheck.cpp clang-tidy/misc/S

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52421. etienneb marked an inline comment as done. etienneb added a comment. nits and formatting http://reviews.llvm.org/D18703 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousStringCompareCheck.cpp

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. Eugene, I double checked and the implicit bool version doesn't trigger in C. This check is applied in C and C++. (note: I needed to add code to fix C) Comment at: docs/clang-tidy/checks/misc-suspicious-string-compare.rst:13 @@ +12,3 @@ +.. code:: c++ +

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-01 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. I spent time thinking about Eugene.Zelenko@ comment and I start to believe that given the difference between the errors ratio and the warnings ratio, maybe we should gate the report 'explicitly comparing result' under a configurable option. There is an order of magnit

[PATCH] D18747: [Support] Fix an invalid character escaping in string literal (unittest).

2016-04-03 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added reviewers: rnk, alexfh. etienneb added a subscriber: cfe-commits. A character within a string literal is not escaped correctly. In this case, there is no semantic change because the invalid character turn out to be NUL anyway. note: "\0x12" is equiv

[clang-tools-extra] r265303 - [clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.

2016-04-04 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Mon Apr 4 10:46:38 2016 New Revision: 265303 URL: http://llvm.org/viewvc/llvm-project?rev=265303&view=rev Log: [clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check. Summary: This patch is adding detection of common string literal patterns that sh

Re: [PATCH] D18695: [clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.

2016-04-04 Thread Etienne Bergeron via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL265303: [clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check. (authored by etienneb). Changed prior to commit: http://reviews.llvm.org/D18695?vs=52365&id=52563#toc Repository

[PATCH] D18764: [clang-tidy] Fix documentation of misc-suspicious-missing-comma

2016-04-04 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. The clang-tidy documentation generation was broken since commit : http://reviews.llvm.org/D18457 I ran locally the documentation generation and I fixed errors related to that specific ch

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-04 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52601. etienneb marked 3 inline comments as done. etienneb added a comment. add options, configurable list of function names, support for ! pattern. http://reviews.llvm.org/D18703 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp

Re: [PATCH] D18703: [clang-tidy] Add new checker for comparison with runtime string functions.

2016-04-04 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52602. etienneb added a comment. nits http://reviews.llvm.org/D18703 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/SuspiciousStringCompareCheck.cpp clang-tidy/misc/SuspiciousStringCompareCheck.h docs/cla

Re: [PATCH] D18766: [clang-tidy] Add check misc-multiple-statement-macro

2016-04-04 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. etienneb added a comment. this is cool. Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:33 @@ +32,3 @@ + +namespace { + I feel it nicer if you merge this namespace with the one at line 20. Comm

Re: [PATCH] D18766: [clang-tidy] Add check misc-multiple-statement-macro

2016-04-04 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. thanks, lgtm. http://reviews.llvm.org/D18766 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-04 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. This patch add the support for detecting suspicious string literals and their usage. The following example shows a incorrect character escaping leading to an embedded NUL character. ```

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-04 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52653. etienneb added a comment. Fix list.rst (bad merge) http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp clang-tidy/misc/StringLiteralWit

[clang-tools-extra] r265375 - [clang-tidy] Fix documentation of misc-suspicious-missing-comma

2016-04-04 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Mon Apr 4 20:41:02 2016 New Revision: 265375 URL: http://llvm.org/viewvc/llvm-project?rev=265375&view=rev Log: [clang-tidy] Fix documentation of misc-suspicious-missing-comma Summary: The clang-tidy documentation generation was broken since commit : http://reviews.llvm.or

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-05 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52707. etienneb marked an inline comment as done. etienneb added a comment. fix comments. http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-05 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52708. etienneb added a comment. add missing reference in release-notes. http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp clang-tidy/misc/S

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-05 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52710. etienneb added a comment. alpha ordering http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp clang-tidy/misc/StringLiteralWithEmbeddedN

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-05 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D18783#392486, @bcraig wrote: > Is this checker able to connect a std::string with a pre-declared string > literal (i.e. constant propagation)? For example... > > const char *bad_chars = "\0\1\2\3"; > std::string bad_str = bad_chars; >

[PATCH] D18803: [clang-tidy] fix building clang-tidy documentation.

2016-04-05 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. The clang-tidy documentation can't be generated because of broken links. ``` Warning, treated as error: /home/etienneb/llvm/llvm/tools/clang/tools/extra/docs/clang-tidy/checks/google-reada

[PATCH] D18806: [clang-tidy] filter plugins and plugin arguments of the command-line

2016-04-05 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. This patch remove the plugin argument from the command-line. Loading plugins was making clang-tidy to fail when running over chromium (linux). Example of a command-line executed when run

[clang-tools-extra] r265539 - [clang-tidy] fix building clang-tidy documentation.

2016-04-06 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Wed Apr 6 08:57:22 2016 New Revision: 265539 URL: http://llvm.org/viewvc/llvm-project?rev=265539&view=rev Log: [clang-tidy] fix building clang-tidy documentation. Summary: The clang-tidy documentation can't be generated because of broken links. ``` Warning, treated as err

[clang-tools-extra] r265542 - [clang-tidy] filter plugins and plugin arguments of the command-line

2016-04-06 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Wed Apr 6 09:07:51 2016 New Revision: 265542 URL: http://llvm.org/viewvc/llvm-project?rev=265542&view=rev Log: [clang-tidy] filter plugins and plugin arguments of the command-line Summary: This patch remove the plugin argument from the command-line. Loading plugins was ma

Re: [PATCH] D18806: [clang-tidy] filter plugins and plugin arguments of the command-line

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52788. etienneb marked 4 inline comments as done. etienneb added a comment. alexfh@ comments. http://reviews.llvm.org/D18806 Files: clang-tidy/ClangTidy.cpp Index: clang-tidy/ClangTidy.cpp

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52791. etienneb marked 2 inline comments as done. etienneb added a comment. alexfh comments. http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52793. etienneb added a comment. nits. http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.h

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. I finally get rid of the GetCharAt function. Comment at: clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp:22 @@ +21,3 @@ +static unsigned int GetCharAt(const StringLiteral *SL, size_t offset) { + if (offset >= SL->getLength()) return 0; + return

[PATCH] D18829: [clang-tidy] Fix FP with readability-redundant-string-init for default arguments

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. Clang-tidy is reporting a warning of redundant string initialisation on a string parameter initialized with empty string. See bug: 27087 The reported example is: ``` #include void fn(std

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D18783#393367, @LegalizeAdulthood wrote: > There are some APIs where a series of strings are passed as a single `char *` > with NUL separators between the strings and the last string is indicated by > two NUL characters in a row. For instanc

[PATCH] D18833: [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. In Release mode, the check was infinite looping over chromium code base. It seems there is something strange with the creation of the Maps. I believe the compiler is making some assumption

Re: [PATCH] D18509: clang-tidy: add_new_check.py stubs out release notes

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb added a subscriber: etienneb. etienneb added a comment. I like this :) http://reviews.llvm.org/D18509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52856. etienneb added a comment. rebased. http://reviews.llvm.org/D18783 Files: clang-tidy/misc/MisplacedWideningCastCheck.cpp Index: clang-tidy/misc/MisplacedWideningCastCheck.cpp === ---

[PATCH] D18852: [clang-tidy] fix a crash with -fdelayed-template-parsing in UnnecessaryValueParamCheck.

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a reviewer: alexfh. etienneb added a subscriber: cfe-commits. This is the same kind of bug that [[ http://reviews.llvm.org/D18238 | D18238 ]]. Fix crashes caused by deferencing null pointer when declarations parsing may be delayed. The body of the

Re: [PATCH] D18852: [clang-tidy] fix a crash with -fdelayed-template-parsing in UnnecessaryValueParamCheck.

2016-04-06 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. There are probably other instances of this error. It's not an instance that got incorrectly fixed. I may review other checkers to see if I can find more of them. For now, I'm fixing them when they make clang-tidy crash over chromium code (with a clang-tidy windows buil

[clang-tools-extra] r265671 - [clang-tidy] Fix FP with readability-redundant-string-init for default arguments

2016-04-07 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 7 09:18:53 2016 New Revision: 265671 URL: http://llvm.org/viewvc/llvm-project?rev=265671&view=rev Log: [clang-tidy] Fix FP with readability-redundant-string-init for default arguments Summary: Clang-tidy is reporting a warning of redundant string initialisation on

Re: [PATCH] D18852: [clang-tidy] fix a crash with -fdelayed-template-parsing in UnnecessaryValueParamCheck.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52915. etienneb added a comment. add unittests. http://reviews.llvm.org/D18852 Files: clang-tidy/performance/UnnecessaryValueParamCheck.cpp test/clang-tidy/performance-unnecessary-value-param-delayed.cpp Index: test/clang-tidy/performance-unnecessary-

Re: [PATCH] D18833: [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52919. etienneb added a comment. alexfh comments. http://reviews.llvm.org/D18833 Files: clang-tidy/misc/MisplacedWideningCastCheck.cpp Index: clang-tidy/misc/MisplacedWideningCastCheck.cpp

Re: [PATCH] D18833: [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52921. etienneb added a comment. nits, lower case names. http://reviews.llvm.org/D18833 Files: clang-tidy/misc/MisplacedWideningCastCheck.cpp Index: clang-tidy/misc/MisplacedWideningCastCheck.cpp =

Re: [PATCH] D18833: [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52924. etienneb marked an inline comment as done. etienneb added a comment. fix nits. http://reviews.llvm.org/D18833 Files: clang-tidy/misc/MisplacedWideningCastCheck.cpp Index: clang-tidy/misc/MisplacedWideningCastCheck.cpp

[clang-tools-extra] r265679 - [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.

2016-04-07 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 7 09:52:52 2016 New Revision: 265679 URL: http://llvm.org/viewvc/llvm-project?rev=265679&view=rev Log: [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck. Summary: In Release mode, the check was infinite looping over chromium code base. It seems there is

[clang-tools-extra] r265681 - [clang-tidy] fix a crash with -fdelayed-template-parsing in UnnecessaryValueParamCheck.

2016-04-07 Thread Etienne Bergeron via cfe-commits
Author: etienneb Date: Thu Apr 7 09:58:13 2016 New Revision: 265681 URL: http://llvm.org/viewvc/llvm-project?rev=265681&view=rev Log: [clang-tidy] fix a crash with -fdelayed-template-parsing in UnnecessaryValueParamCheck. Summary: This is the same kind of bug than [[ http://reviews.llvm.org/D18

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52926. etienneb marked 2 inline comments as done. etienneb added a comment. Revert last diff (invalid patchset). http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWith

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52927. etienneb added a comment. nit http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.h

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-07 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 52930. etienneb marked 3 inline comments as done. etienneb added a comment. fix doc. http://reviews.llvm.org/D18783 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp clang

<    1   2   3   4   >