[PATCH] D16786: [Clang-tidy] Make modernize-redundant-void-arg working with included files
Eugene Zelenko via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 1 13:25:09 PST 2016
Eugene.Zelenko created this revision.
Eugene.Zelenko added reviewers: alexfh, LegalizeAdulthood, aaron.ballman.
Eugene.Zelenko added a subscriber: cfe-commits.
Eugene.Zelenko set the repository for this revision to rL LLVM.
This fix for PR25894. I checked it on my work code base.
Build and regressions were OK on RHEL 6.
Repository:
rL LLVM
http://reviews.llvm.org/D16786
Files:
clang-tidy/modernize/RedundantVoidArgCheck.cpp
Index: clang-tidy/modernize/RedundantVoidArgCheck.cpp
===================================================================
--- clang-tidy/modernize/RedundantVoidArgCheck.cpp
+++ clang-tidy/modernize/RedundantVoidArgCheck.cpp
@@ -46,42 +46,30 @@
namespace modernize {
void RedundantVoidArgCheck::registerMatchers(MatchFinder *Finder) {
- Finder->addMatcher(functionDecl(isExpansionInMainFile(), parameterCountIs(0),
- unless(isImplicit()), unless(isExternC()))
- .bind(FunctionId),
+ Finder->addMatcher(functionDecl(parameterCountIs(0), unless(isImplicit()),
+ unless(isExternC())).bind(FunctionId),
this);
- Finder->addMatcher(typedefDecl(isExpansionInMainFile()).bind(TypedefId),
- this);
+ Finder->addMatcher(typedefDecl().bind(TypedefId), this);
auto ParenFunctionType = parenType(innerType(functionType()));
auto PointerToFunctionType = pointee(ParenFunctionType);
auto FunctionOrMemberPointer =
anyOf(hasType(pointerType(PointerToFunctionType)),
hasType(memberPointerType(PointerToFunctionType)));
- Finder->addMatcher(
- fieldDecl(isExpansionInMainFile(), FunctionOrMemberPointer).bind(FieldId),
- this);
- Finder->addMatcher(
- varDecl(isExpansionInMainFile(), FunctionOrMemberPointer).bind(VarId),
- this);
+ Finder->addMatcher(fieldDecl(FunctionOrMemberPointer).bind(FieldId), this);
+ Finder->addMatcher(varDecl(FunctionOrMemberPointer).bind(VarId), this);
auto CastDestinationIsFunction =
hasDestinationType(pointsTo(ParenFunctionType));
Finder->addMatcher(
- cStyleCastExpr(isExpansionInMainFile(), CastDestinationIsFunction)
- .bind(CStyleCastId),
- this);
+ cStyleCastExpr(CastDestinationIsFunction).bind(CStyleCastId), this);
Finder->addMatcher(
- cxxStaticCastExpr(isExpansionInMainFile(), CastDestinationIsFunction)
- .bind(NamedCastId),
- this);
+ cxxStaticCastExpr(CastDestinationIsFunction).bind(NamedCastId), this);
Finder->addMatcher(
- cxxReinterpretCastExpr(isExpansionInMainFile(), CastDestinationIsFunction)
- .bind(NamedCastId),
+ cxxReinterpretCastExpr(CastDestinationIsFunction).bind(NamedCastId),
this);
Finder->addMatcher(
- cxxConstCastExpr(isExpansionInMainFile(), CastDestinationIsFunction)
- .bind(NamedCastId),
+ cxxConstCastExpr(CastDestinationIsFunction).bind(NamedCastId),
this);
- Finder->addMatcher(lambdaExpr(isExpansionInMainFile()).bind(LambdaId), this);
+ Finder->addMatcher(lambdaExpr().bind(LambdaId), this);
}
void RedundantVoidArgCheck::check(const MatchFinder::MatchResult &Result) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16786.46573.patch
Type: text/x-patch
Size: 2754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160201/84afe921/attachment.bin>
More information about the cfe-commits
mailing list