diff options
author | Alp Toker <alp@nuanti.com> | 2014-07-07 07:47:20 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-07-07 07:47:20 +0000 |
commit | 1b070d25ca6d0e18aced39ba82b3a1cfb6dde099 (patch) | |
tree | 158fbfea6e31d8b88f7d274e11c69f12f5bd8261 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | a9a1c68a1bcba94f8d5c6cf5ea5619b0e2eedfce (diff) | |
download | bcm5719-llvm-1b070d25ca6d0e18aced39ba82b3a1cfb6dde099.tar.gz bcm5719-llvm-1b070d25ca6d0e18aced39ba82b3a1cfb6dde099.zip |
Peel away old-style file remapping typedefs and cruft
llvm-svn: 212438
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index e8b46e73432..7cea9e4efc0 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -241,44 +241,37 @@ static void InitializeFileRemapping(DiagnosticsEngine &Diags, FileManager &FileMgr, const PreprocessorOptions &InitOpts) { // Remap files in the source manager (with buffers). - for (PreprocessorOptions::const_remapped_file_buffer_iterator - Remap = InitOpts.remapped_file_buffer_begin(), - RemapEnd = InitOpts.remapped_file_buffer_end(); - Remap != RemapEnd; ++Remap) { + for (const auto &RB : InitOpts.RemappedFileBuffers) { // Create the file entry for the file that we're mapping from. const FileEntry *FromFile = - FileMgr.getVirtualFile(Remap->first, Remap->second->getBufferSize(), 0); + FileMgr.getVirtualFile(RB.first, RB.second->getBufferSize(), 0); if (!FromFile) { - Diags.Report(diag::err_fe_remap_missing_from_file) << Remap->first; + Diags.Report(diag::err_fe_remap_missing_from_file) << RB.first; if (!InitOpts.RetainRemappedFileBuffers) - delete Remap->second; + delete RB.second; continue; } // Override the contents of the "from" file with the contents of // the "to" file. - SourceMgr.overrideFileContents(FromFile, Remap->second, + SourceMgr.overrideFileContents(FromFile, RB.second, InitOpts.RetainRemappedFileBuffers); } // Remap files in the source manager (with other files). - for (PreprocessorOptions::const_remapped_file_iterator - Remap = InitOpts.remapped_file_begin(), - RemapEnd = InitOpts.remapped_file_end(); - Remap != RemapEnd; ++Remap) { + for (const auto &RF : InitOpts.RemappedFiles) { // Find the file that we're mapping to. - const FileEntry *ToFile = FileMgr.getFile(Remap->second); + const FileEntry *ToFile = FileMgr.getFile(RF.second); if (!ToFile) { - Diags.Report(diag::err_fe_remap_missing_to_file) << Remap->first - << Remap->second; + Diags.Report(diag::err_fe_remap_missing_to_file) << RF.first << RF.second; continue; } // Create the file entry for the file that we're mapping from. const FileEntry *FromFile = - FileMgr.getVirtualFile(Remap->first, ToFile->getSize(), 0); + FileMgr.getVirtualFile(RF.first, ToFile->getSize(), 0); if (!FromFile) { - Diags.Report(diag::err_fe_remap_missing_from_file) << Remap->first; + Diags.Report(diag::err_fe_remap_missing_from_file) << RF.first; continue; } |