summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/cpp11-migrate/tool/Cpp11Migrate.cpp
diff options
context:
space:
mode:
authorEdwin Vane <edwin.vane@intel.com>2013-06-13 17:17:32 +0000
committerEdwin Vane <edwin.vane@intel.com>2013-06-13 17:17:32 +0000
commit90706dd4244d4c0b8296c9aa7511181055e85cfb (patch)
tree7ead144d2bd6e0cf2793b3eecc95f9209a614a7a /clang-tools-extra/cpp11-migrate/tool/Cpp11Migrate.cpp
parent7f20dfb7466678c196dc1bd6b76e5a4d7a3e52c1 (diff)
downloadbcm5719-llvm-90706dd4244d4c0b8296c9aa7511181055e85cfb.tar.gz
bcm5719-llvm-90706dd4244d4c0b8296c9aa7511181055e85cfb.zip
cpp11-migrate: Add headers to file override information
File override structures now contain per-source overrides for headers. For now, modified headers are written to disk when the Migrator is done. This is only temporary behaviour since we can expect headers to be changed by migrating multiple source files. The changes need to be merged after all migrations are complete. llvm-svn: 183917
Diffstat (limited to 'clang-tools-extra/cpp11-migrate/tool/Cpp11Migrate.cpp')
-rw-r--r--clang-tools-extra/cpp11-migrate/tool/Cpp11Migrate.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang-tools-extra/cpp11-migrate/tool/Cpp11Migrate.cpp b/clang-tools-extra/cpp11-migrate/tool/Cpp11Migrate.cpp
index 26c2ac4bfa2..15f5aa12f5c 100644
--- a/clang-tools-extra/cpp11-migrate/tool/Cpp11Migrate.cpp
+++ b/clang-tools-extra/cpp11-migrate/tool/Cpp11Migrate.cpp
@@ -179,6 +179,19 @@ int main(int argc, const char **argv) {
llvm::raw_fd_ostream FileStream(I->first.c_str(), ErrorInfo,
llvm::raw_fd_ostream::F_Binary);
FileStream << I->second.MainFileOverride;
+
+ // FIXME: The Migrator shouldn't be responsible for writing headers
+ // to disk. Instead, it should write replacement info and another tool
+ // should take all replacement info for a header from possibly many other
+ // migration processes and merge it into a final form. For now, the
+ // updated header is written to disk for testing purposes.
+ for (HeaderOverrides::const_iterator HeaderI = I->second.Headers.begin(),
+ HeaderE = I->second.Headers.end();
+ HeaderI != HeaderE; ++HeaderI) {
+ llvm::raw_fd_ostream HeaderStream(I->first.c_str(), ErrorInfo,
+ llvm::raw_fd_ostream::F_Binary);
+ HeaderStream << HeaderI->second.FileOverride;
+ }
}
// Report execution times.
OpenPOWER on IntegriCloud