diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-02 16:32:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-02 16:32:41 +0000 |
commit | 2973c0eff437e57541735c9bb9561358715440e6 (patch) | |
tree | 49839e0715c43f6a676e30e03e82d67983c3498c /lib/Frontend/CompilerInstance.cpp | |
parent | 735df88a38e80c1ca70daa889aa516b8b9f54b50 (diff) |
Move file-remapping logic into InitPreprocesor. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 02b24b4976..2d58beead8 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -190,45 +190,6 @@ CompilerInstance::createPreprocessor(Diagnostic &Diags, PP->setPTHManager(PTHMgr); } - // Remap files in the source manager. - for (PreprocessorOptions::remapped_file_iterator - Remap = PPOpts.remapped_file_begin(), - RemapEnd = PPOpts.remapped_file_end(); - Remap != RemapEnd; - ++Remap) { - // Find the file that we're mapping to. - const FileEntry *ToFile = FileMgr.getFile(Remap->second); - if (!ToFile) { - Diags.Report(diag::err_fe_remap_missing_to_file) - << Remap->first << Remap->second; - continue; - } - - // Find the file that we're mapping from. - const FileEntry *FromFile = FileMgr.getFile(Remap->first); - if (!FromFile) { - // FIXME: We could actually recover from this, by faking a - // FileEntry based on the "ToFile". - Diags.Report(diag::err_fe_remap_missing_from_file) - << Remap->first; - continue; - } - - // Load the contents of the file we're mapping to. - std::string ErrorStr; - const llvm::MemoryBuffer *Buffer - = llvm::MemoryBuffer::getFile(ToFile->getName(), &ErrorStr); - if (!Buffer) { - Diags.Report(diag::err_fe_error_opening) - << Remap->second << ErrorStr; - continue; - } - - // Override the contents of the "from" file with the contents of - // the "to" file. - SourceMgr.overrideFileContents(FromFile, Buffer); - } - InitializePreprocessor(*PP, PPOpts, HSOpts); // Handle generating dependencies, if requested. |