summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2013-06-12 19:52:13 +0000
committerEdwin Vane <edwin.vane@intel.com>2013-06-12 19:52:13 +0000
commita6bbcdd7079570b8065677ff0df5958e539ccf0f (patch)
treeed221b6ea199210409cff6cdadfab44ce4c9e1e8 /clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp
parent31c60f740eb1d1a4b8f3c254e0db089983ca1e5b (diff)
downloadbcm5719-llvm-a6bbcdd7079570b8065677ff0df5958e539ccf0f.tar.gz
bcm5719-llvm-a6bbcdd7079570b8065677ff0df5958e539ccf0f.zip
cpp11-migrate: New mechanism for overriding file contents
Next step toward supporting migrating headers. Instead of using ClangTool's ability to override all files at once, use a custom FrontendAction and override only the source (and eventually headers) the action is about to parse. Use of newFrontendActionFactory() is replaced with a new factory maker provided by Transform. llvm-svn: 183855
Diffstat (limited to 'clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp')
-rw-r--r--clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp b/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp
index 3c75246ea34..2a76b304ad5 100644
--- a/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp
+++ b/clang-tools-extra/cpp11-migrate/UseAuto/UseAuto.cpp
@@ -26,11 +26,6 @@ int UseAutoTransform::apply(const FileContentsByPath &InputStates,
FileContentsByPath &ResultStates) {
RefactoringTool UseAutoTool(Database, SourcePaths);
- for (FileContentsByPath::const_iterator I = InputStates.begin(),
- E = InputStates.end();
- I != E; ++I)
- UseAutoTool.mapVirtualFile(I->first, I->second);
-
unsigned AcceptedChanges = 0;
MatchFinder Finder;
@@ -42,8 +37,7 @@ int UseAutoTransform::apply(const FileContentsByPath &InputStates,
Finder.addMatcher(makeIteratorDeclMatcher(), &ReplaceIterators);
Finder.addMatcher(makeDeclWithNewMatcher(), &ReplaceNew);
- if (int Result = UseAutoTool.run(
- newFrontendActionFactory(&Finder, /*Callbacks=*/ this))) {
+ if (int Result = UseAutoTool.run(createActionFactory(Finder, InputStates))) {
llvm::errs() << "Error encountered during translation.\n";
return Result;
}
OpenPOWER on IntegriCloud