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/CompilerInvocation.cpp | |
parent | 5c1d4e3b1ea05949052737e5cdf11ef228231543 (diff) | |
download | bcm5719-llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.tar.gz bcm5719-llvm-5159f6162e894deedb0be1ab53e3e0f823c9db5d.zip |
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/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b0c30361dd1..a0280e52c72 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/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<OptTable> 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); } |