This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Remove unintentional `move`
ClosedPublic

Authored by jansvoboda11 on Oct 17 2022, 8:05 PM.

Details

Summary

This is a fix related to D135414. The original intention was to keep BaseFS as a member of the worker and conditionally overlay it with local in-memory FS. The move of ref-counted BaseFS was not intended, and it's a bug.

Disabling parallelism in the "by-module-name" test reliably reproduces this, and the test itself doesn't *need* parallelism. (I think -j 4 was cargo culted from another test.) Reusing that test to check for correct behavior...

Diff Detail

Event Timeline

jansvoboda11 created this revision.Oct 17 2022, 8:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 17 2022, 8:05 PM
Herald added a subscriber: ributzka. · View Herald Transcript
jansvoboda11 requested review of this revision.Oct 17 2022, 8:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 17 2022, 8:05 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
DavidSpickett added inline comments.Oct 18 2022, 12:32 AM
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
400

Is this equivalent?

auto OverlayFS = BaseFS;

Given that BaseFS is already IntrusiveRefCntPtr.

clang/test/ClangScanDeps/modules-full-by-mod-name.cpp
18

Would it help to have one be j1 and one j4, any extra coverage by doing that?

jansvoboda11 added inline comments.Oct 18 2022, 8:14 AM
clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
400

It's not, because BaseFS is pointer to the llvm::vfs::FileSystem interface. Here we need to call members of llvm::vfs::OverlayFileSystem specifically.

Use both -j 1 and -j 4 in tests.

jansvoboda11 added inline comments.Oct 18 2022, 8:17 AM
clang/test/ClangScanDeps/modules-full-by-mod-name.cpp
18

Technically that does give us extra coverage. Let's do it if you feel more comfortable that way.

DavidSpickett accepted this revision.Oct 18 2022, 8:29 AM

LGTM

As it happens the bot that found this has been moved to silent for other reasons. I'll let you know if we see any further issues.

This revision is now accepted and ready to land.Oct 18 2022, 8:29 AM
This revision was landed with ongoing or failed builds.Oct 18 2022, 4:56 PM
This revision was automatically updated to reflect the committed changes.