Skip to content

Commit d239f3c

Browse files
committed
[clang][deps] Remove unintentional move
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... Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D136124
1 parent 5f15479 commit d239f3c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ bool DependencyScanningWorker::computeDependencies(
396396
ModifiedCommandLine = CommandLine;
397397
ModifiedCommandLine->emplace_back(*ModuleName);
398398

399-
auto OverlayFS = llvm::makeIntrusiveRefCnt<llvm::vfs::OverlayFileSystem>(
400-
std::move(BaseFS));
399+
auto OverlayFS =
400+
llvm::makeIntrusiveRefCnt<llvm::vfs::OverlayFileSystem>(BaseFS);
401401
auto InMemoryFS =
402402
llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>();
403403
InMemoryFS->setCurrentWorkingDirectory(WorkingDirectory);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb_by_mod_name.json > %t.cdb
1212
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb_clangcl_by_mod_name.json > %t_clangcl.cdb
1313
//
14-
// RUN: clang-scan-deps -compilation-database %t.cdb -j 4 -format experimental-full \
14+
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -format experimental-full \
1515
// RUN: -mode preprocess-dependency-directives -module-name=header1 > %t.result
1616
// RUN: cat %t.result | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t.dir --check-prefixes=CHECK %s
1717
//

0 commit comments

Comments
 (0)