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 | 5159f6162e894deedb0be1ab53e3e0f823c9db5d (patch) | |
| tree | 6ad37aa5c3f6564eb01bc7a75e0749e9b7829204 /clang/lib/Frontend/InitPreprocessor.cpp | |
| parent | 5c1d4e3b1ea05949052737e5cdf11ef228231543 (diff) | |
| download | llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.zip llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.tar.gz llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.tar.bz2  | |
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.
llvm-svn: 120010
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
| -rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 13 | 
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 7275733..08ced99 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/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  | 
