sbenza added inline comments.
Comment at: include/clang/AST/ASTTypeTraits.h:250
@@ +249,3 @@
+return NodeKind.hasPointerIdentity()
+ ? *reinterpret_cast(Storage.buffer)
+ : nullptr;
I'm not sure about this reinterpret_cast.
We are
sbenza added a comment.
Just fyi, I am looking at this diff. It is very large with a lot of rounds of
comments and I didn't have the context.
I don't know if I should giving comments at this point of the change, but here
it is.
Have you considered matching on typeLoc() instead of having a large
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp:44
@@ +43,3 @@
+ if (MatchedCast->getCastKind() == CK_BitCast ||
+ MatchedCast->getCastKind() == CK_LValueBitCast ||
+ MatchedCast->getCastKind() == CK_IntegralToPointer
sbenza added a comment.
In http://reviews.llvm.org/D14096#275902, @xazax.hun wrote:
> There is already a similar check in the Google package. What are the
> differences between those two checks? What is the reason we can not just
> register that check into the core guidelines module?
That
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Just wanted to know it was considered, and it was.
It looks good to me then.
http://reviews.llvm.org/D7639
___
cfe-commits mailing list
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Just one formatting comment.
Comment at:
clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:52
@@ +51,3 @@
+
+ diag(MatchedCast->getExprLoc(), "do not
sbenza added a comment.
I'm sorry. This change fell through the cracks. I'll take a look today.
http://reviews.llvm.org/D7639
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
sbenza added inline comments.
Comment at: clang-tidy/misc/UnusedParametersCheck.cpp:25
@@ +24,3 @@
+template
+static CharSourceRange removeNode(const MatchFinder::MatchResult ,
+ const T *PrevNode, const T *Node,
aaron.ballman
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Seems straightforward.
http://reviews.llvm.org/D13784
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
sbenza added a comment.
Thanks for the patch.
A few comments below.
Comment at: clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp:23
@@ +22,3 @@
+
+
Finder->addMatcher(arraySubscriptExpr(hasBase(ignoringImpCasts(hasType(constantArrayType().bind("type",
+
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargUseCheck.cpp:20
@@ +19,3 @@
+void ProTypeVarargUseCheck::registerMatchers(MatchFinder *Finder) {
+
Finder->addMatcher(callExpr(callee(functionDecl(isVariadic(.bind("expr"),
this);
+}
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp:55
@@ +54,3 @@
+ if (!IndexExpr->isIntegerConstantExpr(Index, *Result.Context, nullptr,
true)) {
+//Fixit would need gsl::at()
+diag(Matched->getExprLoc(), "do
sbenza added a comment.
In http://reviews.llvm.org/D13510#261925, @aaron.ballman wrote:
> In http://reviews.llvm.org/D13510#261825, @Eugene.Zelenko wrote:
>
> > I think it'll be fine to rename check without leaving traces of misc. Same
> > thing happened with modernize-shrink-to-fit.
>
>
> I
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:26
@@ +25,3 @@
+ Finder->addMatcher(
+ varDecl(hasType(pointsTo(cxxRecordDecl(hasName("__va_list_tag")
+ .bind("va_list"),
Is there a way to look for
sbenza added inline comments.
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-vararg.cpp:27
@@ +26,3 @@
+template
+void CallFooIfAvailableImpl(T& t, ...) {
+}
You would still warn on the callers of this.
Maybe we should ignore any call if the variadic
Author: sbenza
Date: Mon Oct 19 16:49:51 2015
New Revision: 250742
URL: http://llvm.org/viewvc/llvm-project?rev=250742=rev
Log:
Added check uniqueptr-delete-release to replace "delete x.release()" with "x =
nullptr"
Reviewers: alexfh
Differential Revision: http://reviews.llvm.org/D13179
sbenza created this revision.
sbenza added reviewers: alexfh, aaron.ballman.
sbenza added a subscriber: cfe-commits.
Fix bug in suggested fix that truncated variable names to 1 character.
Also, rework the suggested fix to try to remove unnecessary whitespace.
http://reviews.llvm.org/D13899
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Thanks for check.
http://reviews.llvm.org/D13787
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
sbenza added a comment.
Minor comments only.
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:29
@@ +28,3 @@
+ callExpr(callee(functionDecl(isVariadic(),
+ unless(hasName("__builtin_va_start")
+
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp:20
@@ +19,3 @@
+void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) {
+
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargUseCheck.cpp:20
@@ +19,3 @@
+void ProTypeVarargUseCheck::registerMatchers(MatchFinder *Finder) {
+
Finder->addMatcher(callExpr(callee(functionDecl(isVariadic(.bind("expr"),
this);
+}
sbenza added inline comments.
Comment at:
test/clang-tidy/cppcoreguidelines-pro-type-static-cast-downcast.cpp:28
@@ +27,3 @@
+
+ auto P0 = static_cast(new Base());
+ // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use static_cast to
downcast from a base to a
sbenza added inline comments.
Comment at:
clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:29
@@ +28,3 @@
+ implicitCastExpr(unless(hasParent(arraySubscriptExpr())),
+
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
See comment regarding //CHECKs
Comment at: test/clang-tidy/cert-variadic-function-def.cpp:4
@@ +3,3 @@
+// Variadic function definitions are diagnosed.
+// CHECK-MESSAGES:
Author: sbenza
Date: Wed Aug 26 11:15:59 2015
New Revision: 246037
URL: http://llvm.org/viewvc/llvm-project?rev=246037view=rev
Log:
[ASTMatchers] Add type matcher for SubstTemplateTypeParmType.
Modified:
cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp:38
@@ +37,3 @@
+ Finder->addMatcher(
+ arraySubscriptExpr(hasBase(implicitCastExpr(hasSourceExpression(
+
sbenza added inline comments.
Comment at:
test/clang-tidy/cppcoreguidelines-pro-type-static-cast-downcast.cpp:19
@@ +18,3 @@
+ // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use static_cast to cast
from base to derived. Use dynamic_cast instead. (C++ Core Guidelines, rule
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp:35
@@ +34,3 @@
+
+ //Array subscript on a pointer (not an array) is also pointer arithmetic
+ Finder->addMatcher(
Space after //
Comment
sbenza updated this revision to Diff 42884.
sbenza added a comment.
Add a faster version of the qualified name matcher.
It falls back to the previous version if it can't handle the name.
http://reviews.llvm.org/D15506
Files:
include/clang/ASTMatchers/ASTMatchersInternal.h
sbenza added inline comments.
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:322
@@ +321,3 @@
+ for (bool SkipUnwritten : SkipUnwrittenCases) {
+llvm::SmallString<128> NodeName = StringRef("::");
+llvm::raw_svector_ostream OS(NodeName);
yaron.keren
sbenza updated this revision to Diff 42767.
sbenza added a comment.
Minor fixes
http://reviews.llvm.org/D15506
Files:
lib/ASTMatchers/ASTMatchersInternal.cpp
unittests/ASTMatchers/ASTMatchersTest.cpp
Index: unittests/ASTMatchers/ASTMatchersTest.cpp
sbenza added a comment.
I am thinking on doing this some other way.
Copying the PrintingPolicy object is very expensive, as it contains quite a few
strings and vectors of strings.
In the past I changed this matcher to make no allocations in the common path
(ie using SmallString<>, etc) to
sbenza created this revision.
sbenza added a reviewer: klimek.
sbenza added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Allow hasName() to look through inline namespaces.
This will fix the interaction between some clang-tidy checks and libc++.
libc++ defines names in an inline
Author: sbenza
Date: Tue Dec 22 14:06:40 2015
New Revision: 256278
URL: http://llvm.org/viewvc/llvm-project?rev=256278=rev
Log:
[ASTMatchers] Add booleanType() matcher.
Modified:
cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
cfe/trunk/lib/ASTMatchers/Dynamic/Registry.cpp
Author: sbenza
Date: Tue Dec 22 15:06:36 2015
New Revision: 256284
URL: http://llvm.org/viewvc/llvm-project?rev=256284=rev
Log:
[ASTMatchers] Fix typo in booleanType() doc.
Fix typo in booleanType() doc and recreate the
LibASTMatchersReference.html reference document.
Modified:
On Tue, Dec 22, 2015 at 3:16 PM, Aaron Ballman <aa...@aaronballman.com>
wrote:
> On Tue, Dec 22, 2015 at 3:06 PM, Samuel Benzaquen via cfe-commits
> <cfe-commits@lists.llvm.org> wrote:
> > Author: sbenza
> > Date: Tue Dec 22 14:06:40 2015
> > New Revision:
sbenza added inline comments.
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:4994
@@ +4993,3 @@
+ EXPECT_TRUE(matches("typedef int hasUnderlyingTypeTest;",
+ typedefDecl(hasUnderlyingType(asString("int");
+ EXPECT_TRUE(matches("typedef const int
Author: sbenza
Date: Mon Jun 6 09:21:11 2016
New Revision: 271896
URL: http://llvm.org/viewvc/llvm-project?rev=271896=rev
Log:
[clang-tidy] Do not try to suggest a fix if the parameter is partially in a
macro.
It is not easy to tell where to do the suggestion and whether the
suggestion will be
sbenza added a comment.
I think this would be more interesting with macros.
Eg triggering in code like this:
#define FOO(type, op) const type& X = op()
FOO(int*, bar);
Comment at: clang-tidy/misc/MisplacedConstCheck.cpp:32
@@ +31,3 @@
+
+static QualType
sbenza accepted this revision.
This revision is now accepted and ready to land.
Comment at: clang-tidy/misc/MisplacedConstCheck.cpp:22
@@ +21,3 @@
+ Finder->addMatcher(
+ valueDecl(allOf(hasType(isConstQualified()),
+ hasType(typedefType(hasDeclaration(
sbenza added inline comments.
Comment at: clang-tidy/misc/MisplacedConstCheck.cpp:22
@@ +21,3 @@
+ Finder->addMatcher(
+ valueDecl(allOf(hasType(isConstQualified()),
+ hasType(typedefType(hasDeclaration(
allOf() is unnecessary
sbenza added a comment.
Is it a typo in the description when it says that when RemoveStar is on we will
write 'auto*' instead if 'auto'?
http://reviews.llvm.org/D20917
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
Author: sbenza
Date: Wed Jun 1 15:37:23 2016
New Revision: 271426
URL: http://llvm.org/viewvc/llvm-project?rev=271426=rev
Log:
Fix uninitialized memory access when the token 'const' is not present in
the program.
If the token is not there, we still warn but we don't try to give a
fixit hint.
sbenza added a comment.
Missing the .rst file.
Did you use the check_clang_tidy.py script to create the template?
Comment at: clang-tidy/performance/EmplaceCheck.cpp:25
@@ +24,3 @@
+ cxxMemberCallExpr(
+ on(expr(hasType(cxxRecordDecl(hasName("std::vector"),
+
sbenza added inline comments.
Comment at: clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp:34
@@ +33,3 @@
+ hasDeclaration(functionDecl(hasName("push_back"))),
+ on(hasType(cxxRecordDecl(hasAnyName("std::vector", "llvm::SmallVector",
+
sbenza created this revision.
sbenza added a reviewer: alexfh.
sbenza added a subscriber: cfe-commits.
Add check performance-faster-string-find.
It replaces single character string literals to character literals in calls to
string::find and friends.
http://reviews.llvm.org/D16152
Files:
sbenza marked an inline comment as done.
Comment at: clang-tidy/performance/FasterStringFindCheck.cpp:51
@@ +50,3 @@
+ const auto StringFindFunctions =
+ anyOf(hasName("find"), hasName("rfind"), hasName("find_first_of"),
+hasName("find_first_not_of"),
sbenza updated this revision to Diff 44889.
sbenza marked 2 inline comments as done.
sbenza added a comment.
Added support for non 'char' chars.
http://reviews.llvm.org/D16152
Files:
clang-tidy/performance/CMakeLists.txt
clang-tidy/performance/FasterStringFindCheck.cpp
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821
@@ +4820,3 @@
+/// initializer for i.
+AST_MATCHER(Expr, nullPointerConstant) {
+ return Matcher(
aaron.ballman wrote:
> aaron.ballman wrote:
> > sbenza wrote:
> > > sbenza
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821
@@ +4820,3 @@
+/// initializer for i.
+AST_MATCHER(Expr, nullPointerConstant) {
+ return Matcher(
Use AST_MATCHER_FUNCTION instead, where the return value is the matcher
Now that I submitted the fix to hasName(), I'll work on adding hasAnyName.
On Tue, Feb 9, 2016 at 6:54 AM, Alexander Kornienko
wrote:
> I think, we need to add a `hasAnyName()` matcher that would take a list of
> names.
>
> On Tue, Feb 9, 2016 at 11:20 AM, Gabor Horvath via
Author: sbenza
Date: Fri Feb 5 12:29:24 2016
New Revision: 259898
URL: http://llvm.org/viewvc/llvm-project?rev=259898=rev
Log:
[ASTMatchers] Allow hasName() to look through inline namespaces
Summary:
Allow hasName() to look through inline namespaces.
This will fix the interaction between some
This revision was automatically updated to reflect the committed changes.
Closed by commit rL259898: [ASTMatchers] Allow hasName() to look through inline
namespaces (authored by sbenza).
Changed prior to commit:
http://reviews.llvm.org/D15506?vs=45438=47029#toc
Repository:
rL LLVM
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:644
@@ -643,2 +643,3 @@
explicit HasNameMatcher(StringRef Name);
+ explicit HasNameMatcher(ArrayRef Names);
alexfh wrote:
> bkramer wrote:
> > alexfh wrote:
> > > Why
sbenza updated this revision to Diff 47808.
sbenza marked an inline comment as done.
sbenza added a comment.
Minor fix on comment
http://reviews.llvm.org/D16152
Files:
clang-tidy/performance/CMakeLists.txt
clang-tidy/performance/FasterStringFindCheck.cpp
Author: sbenza
Date: Fri Feb 12 13:28:14 2016
New Revision: 260712
URL: http://llvm.org/viewvc/llvm-project?rev=260712=rev
Log:
[clang-tidy] Add check performance-faster-string-find
Summary:
Add check performance-faster-string-find.
It replaces single character string literals to character
This revision was automatically updated to reflect the committed changes.
Closed by commit rL260712: [clang-tidy] Add check
performance-faster-string-find (authored by sbenza).
Changed prior to commit:
http://reviews.llvm.org/D16152?vs=47808=47825#toc
Repository:
rL LLVM
sbenza created this revision.
sbenza added a reviewer: alexfh.
sbenza added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Add matcher hasAnyName as an optimization over anyOf(hasName(),...)
http://reviews.llvm.org/D17163
Files:
docs/LibASTMatchersReference.html
sbenza updated this revision to Diff 46798.
sbenza added a comment.
Make the delimiter a constant and fix mismatch between parse/serialize of the
option.
http://reviews.llvm.org/D16152
Files:
clang-tidy/performance/CMakeLists.txt
clang-tidy/performance/FasterStringFindCheck.cpp
sbenza updated this revision to Diff 46796.
sbenza added a comment.
Added comment about StringLikeClasses
http://reviews.llvm.org/D16152
Files:
clang-tidy/performance/CMakeLists.txt
clang-tidy/performance/FasterStringFindCheck.cpp
clang-tidy/performance/FasterStringFindCheck.h
Author: sbenza
Date: Mon Feb 22 15:13:02 2016
New Revision: 261574
URL: http://llvm.org/viewvc/llvm-project?rev=261574=rev
Log:
[ASTMatchers] Add matcher hasAnyName.
Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...)
Reviewers: alexfh
Subscribers: klimek, cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261574: [ASTMatchers] Add matcher hasAnyName. (authored by
sbenza).
Changed prior to commit:
http://reviews.llvm.org/D17163?vs=47802=48720#toc
Repository:
rL LLVM
http://reviews.llvm.org/D17163
sbenza added a comment.
I assume you checked that the new trait works on MSVC.
Aren't both the same type of expression SFINAE? Is somehow one supported but
not the other?
http://reviews.llvm.org/D17575
___
cfe-commits mailing list
> >>
> >> On Mon, Feb 22, 2016 at 4:13 PM, Samuel Benzaquen via cfe-commits
> >> <cfe-commits@lists.llvm.org> wrote:
> >> > Author: sbenza
> >> > Date: Mon Feb 22 15:13:02 2016
> >> > New Revision: 261574
> >>
On Mon, Feb 22, 2016 at 4:19 PM, Aaron Ballman <aa...@aaronballman.com>
wrote:
> On Mon, Feb 22, 2016 at 4:13 PM, Samuel Benzaquen via cfe-commits
> <cfe-commits@lists.llvm.org> wrote:
> > Author: sbenza
> > Date: Mon Feb 22 15:13:02 2016
> > New Revision:
On Mon, Feb 22, 2016 at 5:27 PM, Hans Wennborg <h...@chromium.org> wrote:
> On Mon, Feb 22, 2016 at 1:13 PM, Samuel Benzaquen via cfe-commits
> <cfe-commits@lists.llvm.org> wrote:
> > Author: sbenza
> > Date: Mon Feb 22 15:13:02 2016
> > New Revision: 261574
sbenza added inline comments.
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:351
@@ +350,3 @@
+
+ // First, match the name.
+ if (!MatchNodeName(Pattern, Node))
klimek wrote:
> Perhaps comment that Pattern will be changed to the prefix, so it's clear
>
sbenza updated this revision to Diff 45438.
sbenza added a comment.
Rename functions.
http://reviews.llvm.org/D15506
Files:
include/clang/ASTMatchers/ASTMatchersInternal.h
lib/ASTMatchers/ASTMatchersInternal.cpp
unittests/ASTMatchers/ASTMatchersTest.cpp
Index:
sbenza added inline comments.
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:4994
@@ +4993,3 @@
+ EXPECT_TRUE(matches("typedef int hasUnderlyingTypeTest;",
+ typedefDecl(hasUnderlyingType(asString("int");
+ EXPECT_TRUE(matches("typedef const int
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838
@@ +4837,3 @@
+ gnuNullExpr(), cxxNullPtrLiteralExpr(),
+ expr(integerLiteral(equals(0),
hasParent(expr(hasType(pointerType()));
+}
is this expr() necessary?
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838
@@ +4837,3 @@
+ gnuNullExpr(), cxxNullPtrLiteralExpr(),
+ expr(integerLiteral(equals(0),
hasParent(expr(hasType(pointerType()));
+}
aaron.ballman wrote:
> sbenza
Author: sbenza
Date: Wed Feb 17 10:13:14 2016
New Revision: 261102
URL: http://llvm.org/viewvc/llvm-project?rev=261102=rev
Log:
[clang-tidy] Match the type against the get() method we are calling,
instead of a get() method we find in the class.
The duck typed smart pointer class could have
sbenza added inline comments.
Comment at: clang-tidy/cert/CommandProcessorCheck.cpp:22
@@ +21,3 @@
+ Finder->addMatcher(
+ callExpr(callee(functionDecl(anyOf(hasName("system"), hasName("popen"),
+ hasName("_popen")))
sbenza added inline comments.
Comment at: clang-tidy/cert/CommandProcessorCheck.cpp:36
@@ +35,3 @@
+ // is not a security risk by itself.
+ if (Fn->getName() == "system" && E->getNumArgs() == 1 &&
+ E->getArg(0)->isNullPointerConstant(*Result.Context,
You
sbenza created this revision.
sbenza added a reviewer: alexfh.
sbenza added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
llvm::VariadicFunction is only being used by ASTMatchers.
Having own copy here allows us to remove the other one from llvm/ADT.
Also, we can extend the API to
sbenza added a comment.
Alex, this is what we discussed to make `hasAnyName` take a `vector`
directly.
http://reviews.llvm.org/D18275
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
sbenza added a comment.
The reason we haven't fixed hasAnyArgument is that it can potentially break its
users.
I'd prefer if you separated the fix from the addition.
That way we can revert the fix if needed.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4796
@@ +4795,3
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4848
@@ +4847,3 @@
+/// \code
+/// return a+b;
+/// \endcode
`a + b` (with spaces)
A few in this comment, and one in the test.
Comment at:
sbenza added a comment.
> I will separate it, OK. In the Clang there is one use case that I fixed,
> although it did not break the tests. Neither of the other "has..." checkers
> (except the general ones) ignore implicit casts and parenthesized expressions
> so this one should not do it either
This is already being done in http://reviews.llvm.org/D18582
On Wed, Mar 30, 2016 at 12:44 PM, Richard wrote:
> LegalizeAdulthood added a subscriber: LegalizeAdulthood.
> LegalizeAdulthood added a comment.
>
> Can you add a synopsis of this new check to
sbenza added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
baloghadamsoftware wrote:
> sbenza
sbenza added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
baloghadamsoftware wrote:
> sbenza
sbenza added inline comments.
Comment at: docs/clang-tidy/checks/misc-multiple-statement-macro.rst:15
@@ +14,3 @@
+ if (do_increment)
+INCREMENT_TWO(a, b);
+
hokein wrote:
> Would be better to add a comment to explain the sample.
The sentence just before the
sbenza updated this revision to Diff 52702.
sbenza marked 2 inline comments as done and an inline comment as not done.
sbenza added a comment.
Minor fixes
http://reviews.llvm.org/D18766
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
sbenza added inline comments.
Comment at: clang-tidy/readability/RedundantInlineCheck.cpp:68
@@ +67,3 @@
+ }
+ llvm_unreachable("InlineTok() did not encounter the 'inline' token");
+}
This is still reachable.
The token might be hidden through macros, for
sbenza updated this revision to Diff 53398.
sbenza marked an inline comment as done.
sbenza added a comment.
Change warning message.
http://reviews.llvm.org/D18766
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MultipleStatementMacroCheck.cpp
sbenza added inline comments.
Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:99
@@ +98,3 @@
+
+ diag(InnerRanges.back().first, "multiple statement macro spans unbraced "
+ "conditional and the following statement");
Author: sbenza
Date: Fri Mar 18 15:14:35 2016
New Revision: 263822
URL: http://llvm.org/viewvc/llvm-project?rev=263822=rev
Log:
[clang-tidy] Use hasAnyName() instead of matchesName().
matchesName() uses regular expressions and it is very slow.
hasAnyName() gives the same result and it is much
sbenza added a comment.
In http://reviews.llvm.org/D17811#380124, @jbcoe wrote:
> Do you have commit access? I can apply this patch for you if not.
I do.
I am waiting on http://reviews.llvm.org/D18275 to fix the problem with using
internal::HasNameMatcher directly.
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:80
@@ +79,3 @@
+ ResultT operator()(ArrayRef Args) const {
+std::vector InnerArgs;
+for (const ArgT : Args)
alexfh wrote:
> It's unfortunate that we need to create
This revision was automatically updated to reflect the committed changes.
Closed by commit rL264417: [ASTMatchers] Add own version of VariadicFunction.
(authored by sbenza).
Changed prior to commit:
http://reviews.llvm.org/D18275?vs=51447=51645#toc
Repository:
rL LLVM
On Fri, Mar 25, 2016 at 1:55 PM, Etienne Bergeron
wrote:
> etienneb added a subscriber: etienneb.
> etienneb added a comment.
>
> Any plan for doing the same for : hasOverloadedOperatorName ?
>
hasAnyName() was added mostly for performance reasons.
We could add the 'Any'
sbenza added a comment.
Can you rerun the doc script (dump_ast_matchers.py)?
http://reviews.llvm.org/D17986
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: sbenza
Date: Mon Mar 21 13:00:43 2016
New Revision: 263963
URL: http://llvm.org/viewvc/llvm-project?rev=263963=rev
Log:
[clang-tidy] Fix check broken in rL263822.
Add names missing from rL263822 and add tests to prevent future omissions.
Modified:
dio
>
> --
> Mehdi
>
>
>
>
> > On Mar 25, 2016, at 9:29 AM, Samuel Benzaquen via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
> >
> > Author: sbenza
> > Date: Fri Mar 25 11:29:30 2016
> > New Revision: 264417
> >
> > URL: htt
> I believe r264428 fixes this problem.
>>
>> On Fri, Mar 25, 2016 at 2:18 PM, Mehdi Amini <mehdi.am...@apple.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I think this broke clang-tidy somehow:
>>> http://lab.llvm.org:8011/builders/clang-
:
>> http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10881/steps/build%20stage%201/logs/stdio
>>
>> --
>> Mehdi
>>
>>
>>
>>
>> > On Mar 25, 2016, at 9:29 AM, Samuel Benzaquen via cfe-commits <
>> cfe-commits@lists.llv
sbenza updated this revision to Diff 51684.
sbenza added a comment.
Using new public hasAnyName API.
http://reviews.llvm.org/D17811
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/DanglingHandleCheck.cpp
clang-tidy/misc/DanglingHandleCheck.h
clang-tidy/misc/MiscTidyModule.cpp
Author: sbenza
Date: Fri Mar 25 14:41:32 2016
New Revision: 264453
URL: http://llvm.org/viewvc/llvm-project?rev=264453=rev
Log:
[ASTMatchers] Don't use brace-init lists.
They are not supported everywhere yet.
This fixes the MSVC build.
Modified:
sbenza added a comment.
Please add a test for this.
http://reviews.llvm.org/D18243
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
1 - 100 of 157 matches
Mail list logo