diff options
author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2018-07-18 06:49:33 +0000 |
---|---|---|
committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2018-07-18 06:49:33 +0000 |
commit | 33eb7297d232d1473621d40c961708159fab6a6c (patch) | |
tree | 1ce5c3baa3e13fd8e12bc5a3ddfcacec886502b8 /clang/lib/Frontend/FrontendActions.cpp | |
parent | 17c0f721b9efde9d76d8b2b24d615e69fe9e0ede (diff) | |
download | bcm5719-llvm-33eb7297d232d1473621d40c961708159fab6a6c.tar.gz bcm5719-llvm-33eb7297d232d1473621d40c961708159fab6a6c.zip |
[modules] Print input files when -module-file-info file switch is passed.
This patch improves traceability of duplicated header files which end
up in multiple pcms.
Differential Revision: https://reviews.llvm.org/D47118
llvm-svn: 337353
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendActions.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp index 06db814f4b5..9344e673c7a 100644 --- a/clang/lib/Frontend/FrontendActions.cpp +++ b/clang/lib/Frontend/FrontendActions.cpp @@ -560,6 +560,45 @@ namespace { Out << "\n"; } + + /// Tells the \c ASTReaderListener that we want to receive the + /// input files of the AST file via \c visitInputFile. + bool needsInputFileVisitation() override { return true; } + + /// Tells the \c ASTReaderListener that we want to receive the + /// input files of the AST file via \c visitInputFile. + bool needsSystemInputFileVisitation() override { return true; } + + /// Indicates that the AST file contains particular input file. + /// + /// \returns true to continue receiving the next input file, false to stop. + bool visitInputFile(StringRef Filename, bool isSystem, + bool isOverridden, bool isExplicitModule) override { + + Out.indent(2) << "Input file: " << Filename; + + if (isSystem || isOverridden || isExplicitModule) { + Out << " ["; + if (isSystem) { + Out << "System"; + if (isOverridden || isExplicitModule) + Out << ", "; + } + if (isOverridden) { + Out << "Overridden"; + if (isExplicitModule) + Out << ", "; + } + if (isExplicitModule) + Out << "ExplicitModule"; + + Out << "]"; + } + + Out << "\n"; + + return true; + } #undef DUMP_BOOLEAN }; } |