mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -307,7 +307,7 @@ bool StringOptimization::optimizeTypeName(ApplyInst *typeNameCall) {
|
||||
Optional<int> isQualifiedOpt = getIntConstant(typeNameCall->getArgument(1));
|
||||
if (!isQualifiedOpt)
|
||||
return false;
|
||||
bool isQualified = isQualifiedOpt.getValue();
|
||||
bool isQualified = isQualifiedOpt.value();
|
||||
|
||||
// Create the constant type string by mangling + demangling.
|
||||
Mangle::ASTMangler mangler;
|
||||
@@ -547,7 +547,7 @@ StringOptimization::StringInfo StringOptimization::getStringInfo(SILValue value)
|
||||
int reservedCapacity = std::numeric_limits<int>::max();
|
||||
if (apply->getNumArguments() > 0) {
|
||||
if (Optional<int> capacity = getIntConstant(apply->getArgument(0)))
|
||||
reservedCapacity = capacity.getValue();
|
||||
reservedCapacity = capacity.value();
|
||||
}
|
||||
return StringInfo("", reservedCapacity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user