This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Use correct DiagnosticOptions for command-line handling
ClosedPublic

Authored by jansvoboda11 on Aug 31 2021, 3:03 AM.

Details

Summary

In this patch the dependency scanner starts using proper DiagnosticOptions parsed from the actual TU command-line in order to mimic what the actual compiler would do. The actual functionality will be enabled and tested in follow-up patches. (This split is necessary to avoid temporary regression.)

Depends on D108976.

Diff Detail

Event Timeline

jansvoboda11 requested review of this revision.Aug 31 2021, 3:03 AM
jansvoboda11 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2021, 3:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dexonsmith requested changes to this revision.Aug 31 2021, 7:54 AM

Code changes LGTM, just a comment on the test.

clang/test/ClangScanDeps/diagnostics.c
8 ↗(On Diff #369665)

Should this just be:

CHECK-NOT: error:

?

Also, is there a positive CHECK or two you could add? And possibly a comment to explain what the test is for? (It's not obvious to me from the name "diagnostics".)

This revision now requires changes to proceed.Aug 31 2021, 7:54 AM

Split out tests into a separate patch in order to avoid temporary regression.

jansvoboda11 retitled this revision from [clang][deps] Avoid creating diagnostic serialization file, add test to [clang][deps] Use correct DiagnosticOptions for command-line handling.Sep 2 2021, 7:02 AM
jansvoboda11 edited the summary of this revision. (Show Details)

Thanks for the reviews. I had to split out the tests from this patch into D109158 to prevent the temporary regression you pointed out. Your remarks should be addressed there.

arphaman accepted this revision.Sep 2 2021, 8:40 AM

LGTM, thanks

dexonsmith accepted this revision.Sep 2 2021, 10:59 AM

LGTM too, thanks.

This revision is now accepted and ready to land.Sep 2 2021, 10:59 AM
This revision was landed with ongoing or failed builds.Sep 10 2021, 4:44 AM
This revision was automatically updated to reflect the committed changes.