diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-23 08:35:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-23 08:35:12 +0000 |
commit | 39b49bcaaddb1049234fca9500c0ac02c088e23d (patch) | |
tree | 4f7ac9da3cf2bcbad0aebfb781b7635462b431cf /lib/Frontend/InitPreprocessor.cpp | |
parent | 458b5e25052a1052eb873f9145298e0f0aa75cd1 (diff) |
now the FileManager has a FileSystemOpts ivar, stop threading
FileSystemOpts through a ton of apis, simplifying a lot of code.
This also fixes a latent bug in ASTUnit where it would invoke
methods on FileManager without creating one in some code paths
in cindextext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120010 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/InitPreprocessor.cpp')
-rw-r--r-- | lib/Frontend/InitPreprocessor.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index 7275733bbb..08ced99c08 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -478,7 +478,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI, static void InitializeFileRemapping(Diagnostic &Diags, SourceManager &SourceMgr, FileManager &FileMgr, - const FileSystemOptions &FSOpts, const PreprocessorOptions &InitOpts) { // Remap files in the source manager (with buffers). for (PreprocessorOptions::const_remapped_file_buffer_iterator @@ -489,7 +488,7 @@ static void InitializeFileRemapping(Diagnostic &Diags, // Create the file entry for the file that we're mapping from. const FileEntry *FromFile = FileMgr.getVirtualFile(Remap->first, Remap->second->getBufferSize(), - 0, FSOpts); + 0); if (!FromFile) { Diags.Report(diag::err_fe_remap_missing_from_file) << Remap->first; @@ -511,7 +510,7 @@ static void InitializeFileRemapping(Diagnostic &Diags, Remap != RemapEnd; ++Remap) { // Find the file that we're mapping to. - const FileEntry *ToFile = FileMgr.getFile(Remap->second, FSOpts); + const FileEntry *ToFile = FileMgr.getFile(Remap->second); if (!ToFile) { Diags.Report(diag::err_fe_remap_missing_to_file) << Remap->first << Remap->second; @@ -520,8 +519,7 @@ static void InitializeFileRemapping(Diagnostic &Diags, // Create the file entry for the file that we're mapping from. const FileEntry *FromFile = FileMgr.getVirtualFile(Remap->first, - ToFile->getSize(), - 0, FSOpts); + ToFile->getSize(), 0); if (!FromFile) { Diags.Report(diag::err_fe_remap_missing_from_file) << Remap->first; @@ -531,7 +529,7 @@ static void InitializeFileRemapping(Diagnostic &Diags, // Load the contents of the file we're mapping to. std::string ErrorStr; const llvm::MemoryBuffer *Buffer - = FileMgr.getBufferForFile(ToFile->getName(), FSOpts, &ErrorStr); + = FileMgr.getBufferForFile(ToFile->getName(), &ErrorStr); if (!Buffer) { Diags.Report(diag::err_fe_error_opening) << Remap->second << ErrorStr; @@ -548,7 +546,6 @@ static void InitializeFileRemapping(Diagnostic &Diags, /// environment ready to process a single file. This returns true on error. /// void clang::InitializePreprocessor(Preprocessor &PP, - const FileSystemOptions &FSOpts, const PreprocessorOptions &InitOpts, const HeaderSearchOptions &HSOpts, const FrontendOptions &FEOpts) { @@ -558,7 +555,7 @@ void clang::InitializePreprocessor(Preprocessor &PP, MacroBuilder Builder(Predefines); InitializeFileRemapping(PP.getDiagnostics(), PP.getSourceManager(), - PP.getFileManager(), FSOpts, InitOpts); + PP.getFileManager(), InitOpts); // Emit line markers for various builtin sections of the file. We don't do // this in asm preprocessor mode, because "# 4" is not a line marker directive |