mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[IUO] Add a locator for the result of a cast to an IUO type.
Not used yet, so NFC.
This commit is contained in:
@@ -78,6 +78,7 @@ void ConstraintLocator::Profile(llvm::FoldingSetNodeID &id, Expr *anchor,
|
|||||||
case KeyPathComponent:
|
case KeyPathComponent:
|
||||||
case ConditionalRequirement:
|
case ConditionalRequirement:
|
||||||
case TypeParameterRequirement:
|
case TypeParameterRequirement:
|
||||||
|
case ImplicitlyUnwrappedCoercionResult:
|
||||||
if (unsigned numValues = numNumericValuesInPathElement(elt.getKind())) {
|
if (unsigned numValues = numNumericValuesInPathElement(elt.getKind())) {
|
||||||
id.AddInteger(elt.getValue());
|
id.AddInteger(elt.getValue());
|
||||||
if (numValues > 1)
|
if (numValues > 1)
|
||||||
@@ -248,6 +249,10 @@ void ConstraintLocator::dump(SourceManager *sm, raw_ostream &out) {
|
|||||||
case TypeParameterRequirement:
|
case TypeParameterRequirement:
|
||||||
out << "type parameter requirement #" << llvm::utostr(elt.getValue());
|
out << "type parameter requirement #" << llvm::utostr(elt.getValue());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ImplicitlyUnwrappedCoercionResult:
|
||||||
|
out << "implictly unwrapped coercion result";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,9 @@ public:
|
|||||||
ConditionalRequirement,
|
ConditionalRequirement,
|
||||||
/// A single requirement placed on the type parameters.
|
/// A single requirement placed on the type parameters.
|
||||||
TypeParameterRequirement,
|
TypeParameterRequirement,
|
||||||
|
/// \brief A coercion to an Optional type that can potentially be
|
||||||
|
/// force-unwrapped to the underlying type.
|
||||||
|
ImplicitlyUnwrappedCoercionResult,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief Determine the number of numeric values used for the given path
|
/// \brief Determine the number of numeric values used for the given path
|
||||||
@@ -159,6 +162,7 @@ public:
|
|||||||
case Requirement:
|
case Requirement:
|
||||||
case Witness:
|
case Witness:
|
||||||
case OpenedGeneric:
|
case OpenedGeneric:
|
||||||
|
case ImplicitlyUnwrappedCoercionResult:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case GenericArgument:
|
case GenericArgument:
|
||||||
@@ -221,6 +225,7 @@ public:
|
|||||||
case KeyPathComponent:
|
case KeyPathComponent:
|
||||||
case ConditionalRequirement:
|
case ConditionalRequirement:
|
||||||
case TypeParameterRequirement:
|
case TypeParameterRequirement:
|
||||||
|
case ImplicitlyUnwrappedCoercionResult:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case FunctionArgument:
|
case FunctionArgument:
|
||||||
|
|||||||
Reference in New Issue
Block a user