Refactor Usenullptr matcher to avoid duplication

Previously UseNullptr matched separately implicit and explicit casts to nullptr,
now it matches casts that either are implict casts to nullptr or have an
implicit cast to nullptr within.

Also fixes PR15572 since the same macro replacement logic is applied to implicit
and explicit casts.

llvm-svn: 178494
This commit is contained in:
Ariel J. Bernal
2013-04-01 20:09:29 +00:00
parent 335bf6fb76
commit f78debd7d2
6 changed files with 91 additions and 96 deletions

View File

@@ -45,7 +45,6 @@ int UseNullptrTransform::apply(const FileContentsByPath &InputStates,
AcceptedChanges,
MaxRisk);
Finder.addMatcher(makeImplicitCastMatcher(), &Fixer);
Finder.addMatcher(makeCastSequenceMatcher(), &Fixer);
if (int result = UseNullptrTool.run(newFrontendActionFactory(&Finder))) {