This is an archive of the discontinued LLVM Phabricator instance.

[DependencyScanning] Canonicalize `CodeGenOptions.RelaxAll`
AcceptedPublic

Authored by akyrtzi on Apr 14 2023, 12:54 PM.

Details

Summary

This is particularly useful to avoid diverging the modules between a PCH and a translation-unit compilation.

Diff Detail

Event Timeline

akyrtzi created this revision.Apr 14 2023, 12:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2023, 12:54 PM
akyrtzi requested review of this revision.Apr 14 2023, 12:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2023, 12:55 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 added inline comments.Apr 14 2023, 1:42 PM
clang/tools/clang-scan-deps/ClangScanDeps.cpp
958

This assumes FD is not empty, i.e. the -format experimental-full argument. We should probably error out early if that's not the case.

WDYT about changing the new -brief flag into something like -format experimental-brief? We could avoid the dependency between arguments and we'd also make it clear the make and p1689 don't have a brief variant.

akyrtzi added inline comments.Apr 14 2023, 2:29 PM
clang/tools/clang-scan-deps/ClangScanDeps.cpp
958

This assumes FD is not empty,

Ah, good catch! I'll fix.

WDYT about changing the new -brief flag into something like -format experimental-brief?

I consider -brief orthogonal to the format kind, there's no reason we can't have brief versions of the other formats.

akyrtzi updated this revision to Diff 513751.Apr 14 2023, 2:30 PM

Make sure to check FD is valid.

akyrtzi updated this revision to Diff 513828.Apr 14 2023, 5:40 PM

Remove -optimize-args from the test invocations since it's not relevant for the test.

jansvoboda11 added inline comments.Apr 17 2023, 11:16 AM
clang/tools/clang-scan-deps/ClangScanDeps.cpp
958

I consider -brief orthogonal to the format kind, there's no reason we can't have brief versions of the other formats.

How would a brief make or P1689 output look like?

akyrtzi added inline comments.Apr 17 2023, 11:30 AM
clang/tools/clang-scan-deps/ClangScanDeps.cpp
958

make could print the number of file dependencies and P1689 maybe also prints the number of modules (I'm not familiar with that).

In the apple fork there are additional formats added that would have the same -brief output as in this patch, without any changes.

jansvoboda11 accepted this revision.Apr 18 2023, 1:57 PM

LGTM. Note that I think we should consider renaming the -format flag in the future. Ideally, it should reflect the fact that the scanner is doing different work, not just formatting the output differently.

This revision is now accepted and ready to land.Apr 18 2023, 1:57 PM
akyrtzi updated this revision to Diff 515085.Apr 19 2023, 2:00 PM

Rebase on top of main.