aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-08-17 23:13:53 +0000
committerAdrian Prantl <aprantl@apple.com>2016-08-17 23:13:53 +0000
commit576b2dbec5c737020a95e46b70d9111200b5f9e7 (patch)
tree897ae705b6ecac65abd3677dbca70f6b39109f61 /clang/lib/Frontend/FrontendActions.cpp
parent0e3bde821611bed2947beeccaaf4f5f26bcdddbf (diff)
downloadllvm-576b2dbec5c737020a95e46b70d9111200b5f9e7.zip
llvm-576b2dbec5c737020a95e46b70d9111200b5f9e7.tar.gz
llvm-576b2dbec5c737020a95e46b70d9111200b5f9e7.tar.bz2
Support object-file-wrapped modules in clang -module-file-info.
rdar://problem/24504815 llvm-svn: 279004
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index babaa2d..88ff7e0 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -596,6 +596,13 @@ namespace {
};
}
+bool DumpModuleInfoAction::BeginInvocation(CompilerInstance &CI) {
+ // The Object file reader also supports raw ast files and there is no point in
+ // being strict about the module file format in -module-file-info mode.
+ CI.getHeaderSearchOpts().ModuleFormat = "obj";
+ return true;
+}
+
void DumpModuleInfoAction::ExecuteAction() {
// Set up the output file.
std::unique_ptr<llvm::raw_fd_ostream> OutFile;
@@ -608,6 +615,7 @@ void DumpModuleInfoAction::ExecuteAction() {
llvm::raw_ostream &Out = OutFile.get()? *OutFile.get() : llvm::outs();
Out << "Information for module file '" << getCurrentFile() << "':\n";
+
Preprocessor &PP = getCompilerInstance().getPreprocessor();
DumpModuleInfoListener Listener(Out);
HeaderSearchOptions &HSOpts =