This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Prevent emitting diagnostics outside of source file
ClosedPublic

Authored by jansvoboda11 on Oct 10 2022, 6:48 PM.

Details

Summary

The dependency scanner needs to report the module map file describing the module whose implementation is being compiled (see D134222). However, calling Preprocessor::getCurrentModuleImplementation() in the scanner might cause a diagnostic during module map parsing and emitting a diagnostic without being "in" a source file is illegal (e.g. in TextDiagnosticPrinter). This patch ensures the module map parse is triggered while the compiler is still "in" a source file, avoiding the failure case.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Oct 10 2022, 6:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 6:48 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Oct 10 2022, 6:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 6:48 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Oct 11 2022, 2:21 PM