Skip to content

Commit 63d165a

Browse files
authored
[clang][DependencyScanning] Use structured bindings for initVFSForByNameScanning (NFC) (#172335)
1 parent 3645cef commit 63d165a

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

clang/lib/DependencyScanning/DependencyScanningWorker.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,11 @@ bool DependencyScanningWorker::computeDependencies(
170170

171171
bool DependencyScanningWorker::initializeCompilerInstanceWithContext(
172172
StringRef CWD, ArrayRef<std::string> CommandLine, DiagnosticConsumer &DC) {
173-
auto OverlayFSAndArgs =
173+
auto [OverlayFS, ModifiedCommandLine] =
174174
initVFSForByNameScanning(DepFS, CommandLine, CWD, "ScanningByName");
175-
auto &OverlayFS = OverlayFSAndArgs.first;
176-
const auto &ModifiedCommandLine = OverlayFSAndArgs.second;
177-
178175
auto DiagEngineWithCmdAndOpts =
179176
std::make_unique<DiagnosticsEngineWithDiagOpts>(ModifiedCommandLine,
180177
OverlayFS, DC);
181-
182178
return initializeCompilerInstanceWithContext(
183179
CWD, ModifiedCommandLine, std::move(DiagEngineWithCmdAndOpts), OverlayFS);
184180
}

clang/lib/Tooling/DependencyScanningTool.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,8 @@ DependencyScanningTool::initializeCompilerInstanceWithContextOrError(
235235
// The input command line is either a driver-style command line, or
236236
// ill-formed. In this case, we will first call the Driver to build a -cc1
237237
// command line for this compilation or diagnose any ill-formed input.
238-
auto OverlayFSAndArgs = initVFSForByNameScanning(
238+
auto [OverlayFS, ModifiedCommandLine] = initVFSForByNameScanning(
239239
&Worker.getVFS(), CommandLine, CWD, "ScanningByName");
240-
auto &OverlayFS = OverlayFSAndArgs.first;
241-
const auto &ModifiedCommandLine = OverlayFSAndArgs.second;
242-
243240
auto DiagEngineWithCmdAndOpts =
244241
std::make_unique<DiagnosticsEngineWithDiagOpts>(
245242
ModifiedCommandLine, OverlayFS, DiagPrinterWithOS->DiagPrinter);

0 commit comments

Comments
 (0)