mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[NFC] Cleanup deprecated Optional API usage in depscan
This commit is contained in:
@@ -622,8 +622,8 @@ Optional<const ModuleDependencyInfo *> ModuleDependenciesCache::findDependency(
|
||||
scannerContextHash);
|
||||
// During a scan, only produce the cached source module info for the current
|
||||
// module under scan.
|
||||
if (optionalDep.hasValue()) {
|
||||
auto dep = optionalDep.getValue();
|
||||
if (optionalDep) {
|
||||
auto dep = *optionalDep;
|
||||
if (dep->getAsSwiftSourceModule() &&
|
||||
moduleName != mainScanModuleName &&
|
||||
moduleName != "DummyMainModuleForResolvingCrossImportOverlays") {
|
||||
|
||||
@@ -408,12 +408,12 @@ Optional<const ModuleDependencyInfo*> ClangImporter::getModuleDependencies(
|
||||
std::vector<std::string> commandLineArgs =
|
||||
getClangDepScanningInvocationArguments(ctx);
|
||||
auto optionalWorkingDir = computeClangWorkingDirectory(commandLineArgs, ctx);
|
||||
if (!optionalWorkingDir.hasValue()) {
|
||||
if (!optionalWorkingDir) {
|
||||
ctx.Diags.diagnose(SourceLoc(), diag::clang_dependency_scan_error,
|
||||
"Missing '-working-directory' argument");
|
||||
return None;
|
||||
}
|
||||
std::string workingDir = optionalWorkingDir.getValue();
|
||||
std::string workingDir = *optionalWorkingDir;
|
||||
|
||||
auto moduleCachePath = getModuleCachePathFromClang(getClangInstance());
|
||||
auto lookupModuleOutput =
|
||||
@@ -473,12 +473,12 @@ bool ClangImporter::addBridgingHeaderDependencies(
|
||||
std::vector<std::string> commandLineArgs =
|
||||
getClangDepScanningInvocationArguments(ctx, StringRef(bridgingHeader));
|
||||
auto optionalWorkingDir = computeClangWorkingDirectory(commandLineArgs, ctx);
|
||||
if (!optionalWorkingDir.hasValue()) {
|
||||
if (!optionalWorkingDir) {
|
||||
ctx.Diags.diagnose(SourceLoc(), diag::clang_dependency_scan_error,
|
||||
"Missing '-working-directory' argument");
|
||||
return true;
|
||||
}
|
||||
std::string workingDir = optionalWorkingDir.getValue();
|
||||
std::string workingDir = *optionalWorkingDir;
|
||||
|
||||
auto moduleCachePath = getModuleCachePathFromClang(getClangInstance());
|
||||
auto lookupModuleOutput =
|
||||
|
||||
@@ -1182,7 +1182,7 @@ std::error_code ModuleInterfaceLoader::findModuleFilesInDirectory(
|
||||
|
||||
// First check to see if the .swiftinterface exists at all. Bail if not.
|
||||
auto &fs = *Ctx.SourceMgr.getFileSystem();
|
||||
std::string InPath = BaseName.findInterfacePath(fs).getValueOr("");
|
||||
std::string InPath = BaseName.findInterfacePath(fs).value_or("");
|
||||
if (InPath.empty()) {
|
||||
if (fs.exists(ModPath)) {
|
||||
LLVM_DEBUG(llvm::dbgs()
|
||||
|
||||
Reference in New Issue
Block a user