aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index e6c7b9f..51e9f2c 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -263,6 +263,20 @@ GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI,
/*ForceUseTemporary=*/true);
}
+bool GenerateModuleInterfaceAction::PrepareToExecuteAction(
+ CompilerInstance &CI) {
+ for (const auto &FIF : CI.getFrontendOpts().Inputs) {
+ if (const auto InputFormat = FIF.getKind().getFormat();
+ InputFormat != InputKind::Format::Source) {
+ CI.getDiagnostics().Report(
+ diag::err_frontend_action_unsupported_input_format)
+ << "module interface compilation" << FIF.getFile() << InputFormat;
+ return false;
+ }
+ }
+ return GenerateModuleAction::PrepareToExecuteAction(CI);
+}
+
bool GenerateModuleInterfaceAction::BeginSourceFileAction(
CompilerInstance &CI) {
CI.getLangOpts().setCompilingModule(LangOptions::CMK_ModuleInterface);