diff options
author | Edwin Vane <edwin.vane@intel.com> | 2013-06-12 19:58:21 +0000 |
---|---|---|
committer | Edwin Vane <edwin.vane@intel.com> | 2013-06-12 19:58:21 +0000 |
commit | 59175a1523c15a5e534dfa24bdee5b3bd252f3bc (patch) | |
tree | 4ca6da25c130d55a7775a7bf1e52bf34ea510fb2 /clang-tools-extra/cpp11-migrate/Core/Transform.cpp | |
parent | a6bbcdd7079570b8065677ff0df5958e539ccf0f (diff) | |
download | bcm5719-llvm-59175a1523c15a5e534dfa24bdee5b3bd252f3bc.tar.gz bcm5719-llvm-59175a1523c15a5e534dfa24bdee5b3bd252f3bc.zip |
cpp11-migrate: Decluttering Transform.h
Moving RewriteContainer's constructor impl to Transform.cpp to reduce clutter.
More things will soon be added to this header.
llvm-svn: 183856
Diffstat (limited to 'clang-tools-extra/cpp11-migrate/Core/Transform.cpp')
-rw-r--r-- | clang-tools-extra/cpp11-migrate/Core/Transform.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang-tools-extra/cpp11-migrate/Core/Transform.cpp b/clang-tools-extra/cpp11-migrate/Core/Transform.cpp index a781e912002..718ed0785ad 100644 --- a/clang-tools-extra/cpp11-migrate/Core/Transform.cpp +++ b/clang-tools-extra/cpp11-migrate/Core/Transform.cpp @@ -74,6 +74,24 @@ private: } // namespace +RewriterContainer::RewriterContainer(clang::FileManager &Files, + const FileContentsByPath &InputStates) + : DiagOpts(new clang::DiagnosticOptions()), + DiagnosticPrinter(llvm::errs(), DiagOpts.getPtr()), + Diagnostics(llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs>( + new clang::DiagnosticIDs()), + DiagOpts.getPtr(), &DiagnosticPrinter, false), + Sources(Diagnostics, Files), Rewrite(Sources, DefaultLangOptions) { + + // Overwrite source manager's file contents with data from InputStates + for (FileContentsByPath::const_iterator I = InputStates.begin(), + E = InputStates.end(); + I != E; ++I) { + Sources.overrideFileContents(Files.getFile(I->first), + llvm::MemoryBuffer::getMemBuffer(I->second)); + } +} + void collectResults(clang::Rewriter &Rewrite, const FileContentsByPath &InputStates, FileContentsByPath &Results) { |