mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fold ExtInfo::isThin and ::isBlock into a "Representation" enum.
These bits are orthogonal to each other, so combine them into one, and diagnose attempts to produce a type that's both. Spot-fix a bunch of places this revealed by inspection that we would have crashed in SILGen or IRGen if blocks were be handled. Swift SVN r16088
This commit is contained in:
@@ -823,14 +823,14 @@ void Mangler::mangleType(CanType type, ResilienceExpansion explosion,
|
||||
};
|
||||
|
||||
// <impl-callee-convention>
|
||||
if (fn->isThin()) {
|
||||
if (fn->getRepresentation() == AnyFunctionType::Representation::Thin) {
|
||||
Buffer << 't';
|
||||
} else {
|
||||
Buffer << mangleParameterConvention(fn->getCalleeConvention());
|
||||
}
|
||||
|
||||
// <impl-function-attribute>*
|
||||
if (fn->isBlock()) {
|
||||
if (fn->getRepresentation() == AnyFunctionType::Representation::Block) {
|
||||
Buffer << "Cb";
|
||||
} else {
|
||||
switch (fn->getAbstractCC()) {
|
||||
@@ -1149,7 +1149,7 @@ void Mangler::mangleFunctionType(CanAnyFunctionType fn,
|
||||
// type ::= 'f' type type (uncurried)
|
||||
// type ::= 'b' type type (objc block)
|
||||
// type ::= 'K' type type (auto closure)
|
||||
if (fn->isBlock())
|
||||
if (fn->getRepresentation() == AnyFunctionType::Representation::Block)
|
||||
Buffer << 'b';
|
||||
else if (fn->isAutoClosure())
|
||||
Buffer << 'K';
|
||||
|
||||
Reference in New Issue
Block a user