summaryrefslogtreecommitdiffstats
path: root/lib/Lex
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-11-01 00:46:54 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-11-01 00:46:54 +0000
commitc6a35f056e82c4eb18eb07e38ae2cb60858bebd2 (patch)
treed952e4b7d7b8d969d32c1c5a310b82b5febd17df /lib/Lex
parent66e7c70fc54b902067dfa0132838d82dee7e8588 (diff)
Fix regression in behavior of clang -x c++-header -fmodule-name=XXX
-fsyntax-only. The driver accidentally stopped passing the input filenames on to -cc1 in this mode due to confusion over what action was being requested. This change also fixes a couple of crashes I encountered when passing multiple files to such a -cc1 invocation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r--lib/Lex/ModuleMap.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp
index d44bf124ff..13d2b728f5 100644
--- a/lib/Lex/ModuleMap.cpp
+++ b/lib/Lex/ModuleMap.cpp
@@ -523,7 +523,7 @@ void ModuleMap::diagnoseHeaderInclusion(Module *RequestingModule,
// At this point, only non-modular includes remain.
- if (LangOpts.ModulesStrictDeclUse) {
+ if (RequestingModule && LangOpts.ModulesStrictDeclUse) {
Diags.Report(FilenameLoc, diag::err_undeclared_use_of_module)
<< RequestingModule->getTopLevelModule()->Name << Filename;
} else if (RequestingModule && RequestingModuleIsModuleInterface &&