This is an archive of the discontinued LLVM Phabricator instance.

Modules: Simplify how DisableGeneratingGlobalModuleIndex is set, likely NFC
ClosedPublic

Authored by dexonsmith on Apr 30 2021, 3:30 PM.

Details

Summary

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.

Diff Detail

Event Timeline

dexonsmith created this revision.Apr 30 2021, 3:30 PM
dexonsmith requested review of this revision.Apr 30 2021, 3:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 30 2021, 3:30 PM
dexonsmith edited the summary of this revision. (Show Details)Apr 30 2021, 3:33 PM

Just fixed a typo in the description, where the second paragraph should start:

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.

(and now does).

This revision is now accepted and ready to land.May 3 2021, 1:42 AM
This revision was landed with ongoing or failed builds.May 13 2021, 10:40 AM
This revision was automatically updated to reflect the committed changes.