diff options
Diffstat (limited to 'clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp')
| -rw-r--r-- | clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp b/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp deleted file mode 100644 index 72f5ae077f2..00000000000 --- a/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp +++ /dev/null @@ -1,71 +0,0 @@ -//===-- UseAuto/UseAuto.cpp - Use auto type specifier ---------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -/// -/// \file -/// \brief This file provides the implementation of the UseAutoTransform class. -/// -//===----------------------------------------------------------------------===// - -#include "UseAuto.h" -#include "UseAutoActions.h" -#include "UseAutoMatchers.h" - -using clang::ast_matchers::MatchFinder; -using namespace clang; -using namespace clang::tooling; - -int UseAutoTransform::apply(const FileOverrides &InputStates, - const clang::tooling::CompilationDatabase &Database, - const std::vector<std::string> &SourcePaths) { - ClangTool UseAutoTool(Database, SourcePaths); - - unsigned AcceptedChanges = 0; - - MatchFinder Finder; - ReplacementsVec Replaces; - IteratorReplacer ReplaceIterators(AcceptedChanges, Options().MaxRiskLevel, - /*Owner=*/ *this); - NewReplacer ReplaceNew(AcceptedChanges, Options().MaxRiskLevel, - /*Owner=*/ *this); - - Finder.addMatcher(makeIteratorDeclMatcher(), &ReplaceIterators); - Finder.addMatcher(makeDeclWithNewMatcher(), &ReplaceNew); - - setOverrides(InputStates); - - if (int Result = UseAutoTool.run(createActionFactory(Finder))) { - llvm::errs() << "Error encountered during translation.\n"; - return Result; - } - - setAcceptedChanges(AcceptedChanges); - - return 0; -} - -struct UseAutoFactory : TransformFactory { - UseAutoFactory() { - Since.Clang = Version(2, 9); - Since.Gcc = Version(4, 4); - Since.Icc = Version(12); - Since.Msvc = Version(10); - } - - Transform *createTransform(const TransformOptions &Opts) LLVM_OVERRIDE { - return new UseAutoTransform(Opts); - } -}; - -// Register the factory using this statically initialized variable. -static TransformFactoryRegistry::Add<UseAutoFactory> -X("use-auto", "Use of 'auto' type specifier"); - -// This anchor is used to force the linker to link in the generated object file -// and thus register the factory. -volatile int UseAutoTransformAnchorSource = 0; |

