mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
use new llvm::Optional API
`getValue` -> `value` `getValueOr` -> `value_or` `hasValue` -> `has_value` `map` -> `transform` The old API will be deprecated in the rebranch. To avoid merge conflicts, use the new API already in the main branch. rdar://102362022
This commit is contained in:
@@ -295,13 +295,13 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
|
||||
llvm::raw_svector_ostream OS(Text);
|
||||
AnnotatingPrinter Printer(Info, OS);
|
||||
if (!Group && InterestedUSR) {
|
||||
Group = findGroupNameForUSR(Mod, InterestedUSR.getValue());
|
||||
Group = findGroupNameForUSR(Mod, InterestedUSR.value());
|
||||
}
|
||||
printModuleInterface(Mod, Group.hasValue()
|
||||
? llvm::makeArrayRef(Group.getValue())
|
||||
printModuleInterface(Mod, Group.has_value()
|
||||
? llvm::makeArrayRef(Group.value())
|
||||
: ArrayRef<StringRef>(),
|
||||
TraversalOptions, Printer, Options,
|
||||
Group.hasValue() && SynthesizedExtensions);
|
||||
Group.has_value() && SynthesizedExtensions);
|
||||
|
||||
Info.Text = std::string(OS.str());
|
||||
return false;
|
||||
@@ -787,9 +787,9 @@ void SwiftLangSupport::editorOpenHeaderInterface(EditorConsumer &Consumer,
|
||||
if (!swiftVersion.empty()) {
|
||||
auto swiftVer =
|
||||
VersionParser::parseVersionString(swiftVersion, SourceLoc(), nullptr);
|
||||
if (swiftVer.hasValue())
|
||||
if (swiftVer.has_value())
|
||||
Invocation.getLangOptions().EffectiveLanguageVersion =
|
||||
swiftVer.getValue();
|
||||
swiftVer.value();
|
||||
}
|
||||
auto IFaceGenRef = SwiftInterfaceGenContext::create(Name,
|
||||
/*IsModule=*/false,
|
||||
|
||||
Reference in New Issue
Block a user