diff options
author | Alexander Kornienko <alexfh@google.com> | 2016-02-16 09:49:05 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2016-02-16 09:49:05 +0000 |
commit | f8bb8c58918d66895c80a14236ee28a2d5e897b9 (patch) | |
tree | 26fcd1720f1c503cceb1212e464cf4f9cd8458c8 | |
parent | f447a6b5f4cb8a2da217d88b0dff5e95caa8a134 (diff) | |
download | bcm5719-llvm-f8bb8c58918d66895c80a14236ee28a2d5e897b9.tar.gz bcm5719-llvm-f8bb8c58918d66895c80a14236ee28a2d5e897b9.zip |
[clang-tidy] Enhance modernize-redundant-void-arg check to apply fixes to header files
Fixes http://llvm.org/PR25894
Patch by Richard Thomson!
Differential revision: http://reviews.llvm.org/D16953
llvm-svn: 260948
-rw-r--r-- | clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp index 2c5611b705f..4c8f681be0a 100644 --- a/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp +++ b/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp @@ -46,42 +46,30 @@ namespace tidy { namespace modernize { void RedundantVoidArgCheck::registerMatchers(MatchFinder *Finder) { - Finder->addMatcher(functionDecl(isExpansionInMainFile(), parameterCountIs(0), - unless(isImplicit()), unless(isExternC())) + 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), - this); - Finder->addMatcher(lambdaExpr(isExpansionInMainFile()).bind(LambdaId), this); + cxxConstCastExpr(CastDestinationIsFunction).bind(NamedCastId), this); + Finder->addMatcher(lambdaExpr().bind(LambdaId), this); } void RedundantVoidArgCheck::check(const MatchFinder::MatchResult &Result) { |