From 39b49bcaaddb1049234fca9500c0ac02c088e23d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 23 Nov 2010 08:35:12 +0000 Subject: 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 --- lib/Frontend/CompilerInvocation.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'lib/Frontend/CompilerInvocation.cpp') diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index b0c30361dd..a0280e52c7 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1419,7 +1419,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, FileManager &FileMgr, - const FileSystemOptions &FSOpts, Diagnostic &Diags) { using namespace cc1options; Opts.ImplicitPCHInclude = Args.getLastArgValue(OPT_include_pch); @@ -1474,8 +1473,7 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, // PCH is handled specially, we need to extra the original include path. if (A->getOption().matches(OPT_include_pch)) { std::string OriginalFile = - ASTReader::getOriginalSourceFile(A->getValue(Args), FileMgr, FSOpts, - Diags); + ASTReader::getOriginalSourceFile(A->getValue(Args), FileMgr, Diags); if (OriginalFile.empty()) continue; @@ -1531,8 +1529,8 @@ static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args) { // void CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, - const char* const *ArgBegin, - const char* const *ArgEnd, + const char *const *ArgBegin, + const char *const *ArgEnd, Diagnostic &Diags) { // Parse the arguments. llvm::OwningPtr Opts(createCC1OptTable()); @@ -1561,11 +1559,10 @@ void CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, ParseLangArgs(Res.getLangOpts(), *Args, DashX, Diags); // FIXME: ParsePreprocessorArgs uses the FileManager to read the contents of // PCH file and find the original header name. Remove the need to do that in - // ParsePreprocessorArgs and remove the FileManager & FileSystemOptions + // ParsePreprocessorArgs and remove the FileManager // parameters from the function and the "FileManager.h" #include. FileManager FileMgr(Res.getFileSystemOpts()); - ParsePreprocessorArgs(Res.getPreprocessorOpts(), *Args, - FileMgr, Res.getFileSystemOpts(), Diags); + ParsePreprocessorArgs(Res.getPreprocessorOpts(), *Args, FileMgr, Diags); ParsePreprocessorOutputArgs(Res.getPreprocessorOutputOpts(), *Args); ParseTargetArgs(Res.getTargetOpts(), *Args); } -- cgit v1.2.3-18-g5258