[clang-tools-extra] r183856 - cpp11-migrate: Decluttering Transform.h
Edwin Vane
edwin.vane at intel.com
Wed Jun 12 12:58:21 PDT 2013
Author: revane
Date: Wed Jun 12 14:58:21 2013
New Revision: 183856
URL: http://llvm.org/viewvc/llvm-project?rev=183856&view=rev
Log:
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.
Modified:
clang-tools-extra/trunk/cpp11-migrate/Core/Transform.cpp
clang-tools-extra/trunk/cpp11-migrate/Core/Transform.h
Modified: clang-tools-extra/trunk/cpp11-migrate/Core/Transform.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/cpp11-migrate/Core/Transform.cpp?rev=183856&r1=183855&r2=183856&view=diff
==============================================================================
--- clang-tools-extra/trunk/cpp11-migrate/Core/Transform.cpp (original)
+++ clang-tools-extra/trunk/cpp11-migrate/Core/Transform.cpp Wed Jun 12 14:58:21 2013
@@ -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) {
Modified: clang-tools-extra/trunk/cpp11-migrate/Core/Transform.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/cpp11-migrate/Core/Transform.h?rev=183856&r1=183855&r2=183856&view=diff
==============================================================================
--- clang-tools-extra/trunk/cpp11-migrate/Core/Transform.h (original)
+++ clang-tools-extra/trunk/cpp11-migrate/Core/Transform.h Wed Jun 12 14:58:21 2013
@@ -80,23 +80,7 @@ void collectResults(clang::Rewriter &Rew
class RewriterContainer {
public:
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));
- }
- }
+ const FileContentsByPath &InputStates);
clang::Rewriter &getRewriter() { return Rewrite; }
More information about the cfe-commits
mailing list