summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-07-06 21:05:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-07-06 21:05:56 +0000
commit1f2bd35b247b895619c41f5119dd424f9b1ca658 (patch)
tree29ff12e22f1b53bb813554fed4b718fc41f3ea05 /clang/lib/Frontend/FrontendActions.cpp
parent1cda1d76b110dca737d9c3b8dafe27bab9adbb04 (diff)
downloadbcm5719-llvm-1f2bd35b247b895619c41f5119dd424f9b1ca658.tar.gz
bcm5719-llvm-1f2bd35b247b895619c41f5119dd424f9b1ca658.zip
Reject attempts to build a module without -fmodules, rather than silently doing weird things.
llvm-svn: 307316
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index 0fbcc1c7399..d42400183a4 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -163,6 +163,16 @@ GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI,
return llvm::make_unique<MultiplexConsumer>(std::move(Consumers));
}
+bool GenerateModuleFromModuleMapAction::BeginSourceFileAction(
+ CompilerInstance &CI) {
+ if (!CI.getLangOpts().Modules) {
+ CI.getDiagnostics().Report(diag::err_module_build_requires_fmodules);
+ return false;
+ }
+
+ return GenerateModuleAction::BeginSourceFileAction(CI);
+}
+
std::unique_ptr<raw_pwrite_stream>
GenerateModuleFromModuleMapAction::CreateOutputFile(CompilerInstance &CI,
StringRef InFile) {
OpenPOWER on IntegriCloud