Modules: Simplify how DisableGeneratingGlobalModuleIndex is set, likely NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 30 Apr 2021 22:23:47 +0000 (15:23 -0700)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 13 May 2021 17:39:40 +0000 (10:39 -0700)
commit7c57a9bd7d4c976b7a824472c427433359200e02
tree60aac6b379191d934ad7381d117f4d7d92a9ea15
parent16d03818412415c56efcd482d18c0cbdf712524c
Modules: Simplify how DisableGeneratingGlobalModuleIndex is set, likely NFC

DisableGeneratingGlobalModuleIndex was being set by
CompilerInstance::findOrCompileModuleAndReadAST most of (but not all of)
the times it returned `nullptr` as a "normal" failure. Pull that up to
the caller, CompilerInstance::loadModule, to simplify the code. This
resolves a number of FIXMEs added during the refactoring in
5cca622310c10fdf6f921b6cce26f91d9f14c762.

The extra cases where this is set are all some version of a fatal error,
and the only client of the field, shouldBuildGlobalModuleIndex, seems
to be unreachable in that case. Even if there is some corner case where
this has an effect, it seems like the right/consistent behaviour.

Differential Revision: https://reviews.llvm.org/D101672
clang/lib/Frontend/CompilerInstance.cpp