This is an archive of the discontinued LLVM Phabricator instance.

[clang][tooling] Properly initialize DiagnosticsEngine for cc1 command-line construction
ClosedPublic

Authored by jansvoboda11 on Aug 31 2021, 1:28 AM.

Details

Summary

In ToolInvocation::run, the driver -> cc1 command-line transformation uses DiagnosticsEngine that wasn't completely initialized. This patch ensures ProcessWarningOptions(DiagnosticsEngine&, const DiagnosticOptions &) is called.

Depends on D108982.

Diff Detail

Event Timeline

jansvoboda11 requested review of this revision.Aug 31 2021, 1:28 AM
jansvoboda11 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2021, 1:28 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

XFAIL clang-scan-deps test

dexonsmith added inline comments.Aug 31 2021, 8:37 AM
clang/test/ClangScanDeps/strip_diag_serialize.cpp
1–3 ↗(On Diff #369657)

Can you clarify why a temporary regression is necessary? Is there a way of reordering patches to avoid it?

Shuffling patches around.

This revision is now accepted and ready to land.Sep 2 2021, 11:00 AM

(If you can squash the changes from https://reviews.llvm.org/D109158 into here, even better.)

This revision was landed with ongoing or failed builds.Sep 10 2021, 4:54 AM
This revision was automatically updated to reflect the committed changes.