Page MenuHomePhabricator

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

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
21

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
21

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
21

Ah, that makes sense, thanks!

This revision is now accepted and ready to land.Jan 30 2021, 10:31 AM