This is an archive of the discontinued LLVM Phabricator instance.

Frontend: Add -f{,no-}implicit-modules-uses-lock and -Rmodule-lock
ClosedPublic

Authored by dexonsmith on Jan 27 2021, 7:26 PM.

Details

Summary

Add -cc1 flags -fmodules-uses-lock and -fno-modules-uses-lock to
allow the lock manager to be turned off when building implicit modules.

Add -Rmodule-lock so that we can see when it's being used.

Diff Detail

Event Timeline

dexonsmith created this revision.Jan 27 2021, 7:26 PM
dexonsmith requested review of this revision.Jan 27 2021, 7:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2021, 7:26 PM

Left a question in-line.

clang/test/Modules/implicit-modules-use-lock.m
22

Where is the empty remark coming from? Is it useful to us in any way?

dexonsmith added inline comments.Jan 29 2021, 8:15 AM
clang/test/Modules/implicit-modules-use-lock.m
22

This is a CHECK-NOT: <match> line (with a custom -check-prefix). It confirms that <match> does not occur at least until the next positive check matches. The FileCheck invocation that uses CHECK-NO-LOCKS has no other check lines, so this really means: "remark: does not match on any line". Note I also needed to add -allow-empty since with no diagnostics at all, FileCheck's stdin will be empty.

FYI, if you want to read more:

Often in clang tests it's easier to use -cc1 -verify for diagnostics instead of manual FileChecks (expected-no-diagnostics comment being the equivalent of -allow-empty). In the modules testcases, there's often a complicated setup that we want to run a lot of RUN: lines against where each one expects different diagnostics. Maybe we should add prefix support to -verify (or maybe it's there and no one told me...).

jansvoboda11 accepted this revision.Jan 30 2021, 10:31 AM

LGTM

clang/test/Modules/implicit-modules-use-lock.m
22

Ah, that makes sense, thanks!

This revision is now accepted and ready to land.Jan 30 2021, 10:31 AM
This revision was landed with ongoing or failed builds.Aug 12 2021, 3:59 PM
This revision was automatically updated to reflect the committed changes.
arichardson added inline comments.
clang/test/Modules/implicit-modules-use-lock.m
22

This could use e.g. -verify=lock and -verify=lock to avoid the Filecheck usage.

dexonsmith added inline comments.Aug 16 2021, 4:25 PM
clang/test/Modules/implicit-modules-use-lock.m
22