diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-03-13 02:44:13 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-03-13 02:44:13 +0000 |
commit | 4b5aedef16fc5faa78a2683d6a8fccfe9cefd84c (patch) | |
tree | 43691e2903e02e003449bd085676e08b85b175f6 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 28286cdfc7818a97304349d7f491322bfc2dc8da (diff) | |
download | bcm5719-llvm-4b5aedef16fc5faa78a2683d6a8fccfe9cefd84c.tar.gz bcm5719-llvm-4b5aedef16fc5faa78a2683d6a8fccfe9cefd84c.zip |
clang-cl: Add /Yc argument to /showIncludes output.
To make this work, delay printing of ExtraDeps in HeaderIncludesCallback a bit,
so that it happens after CompilerInstance::InitializeSourceManager() has run.
General /FI arguments are still missing from /showIncludes output, this still
needs to be fixed.
llvm-svn: 263352
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index c02eb761041..7e7588af58a 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -715,16 +715,14 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input){ return InitializeSourceManager( Input, getDiagnostics(), getFileManager(), getSourceManager(), hasPreprocessor() ? &getPreprocessor().getHeaderSearchInfo() : nullptr, - getFrontendOpts()); + getDependencyOutputOpts(), getFrontendOpts()); } // static -bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input, - DiagnosticsEngine &Diags, - FileManager &FileMgr, - SourceManager &SourceMgr, - HeaderSearch *HS, - const FrontendOptions &Opts) { +bool CompilerInstance::InitializeSourceManager( + const FrontendInputFile &Input, DiagnosticsEngine &Diags, + FileManager &FileMgr, SourceManager &SourceMgr, HeaderSearch *HS, + DependencyOutputOptions &DepOpts, const FrontendOptions &Opts) { SrcMgr::CharacteristicKind Kind = Input.isSystem() ? SrcMgr::C_System : SrcMgr::C_User; @@ -765,6 +763,9 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input, /*RelativePath=*/nullptr, /*RequestingModule=*/nullptr, /*SuggestedModule=*/nullptr, /*SkipCache=*/true); + // Also add the header to /showIncludes output. + if (File) + DepOpts.ExtraDeps.push_back(File->getName()); } if (!File) { Diags.Report(diag::err_fe_error_reading) << InputFile; |