|
27 | 27 | #include "swift/Parse/Lexer.h" |
28 | 28 | #include "swift/Parse/ParseSILSupport.h" |
29 | 29 | #include "swift/Parse/Parser.h" |
| 30 | +#include "swift/Sema/SILTypeResolutionContext.h" |
30 | 31 | #include "swift/SIL/AbstractionPattern.h" |
31 | 32 | #include "swift/SIL/InstructionUtils.h" |
32 | 33 | #include "swift/SIL/SILArgument.h" |
@@ -131,6 +132,7 @@ namespace { |
131 | 132 | } // namespace |
132 | 133 |
|
133 | 134 | namespace swift { |
| 135 | + /// The parser for an individual SIL function. |
134 | 136 | class SILParser { |
135 | 137 | friend SILParserState; |
136 | 138 | public: |
@@ -1255,10 +1257,10 @@ Type SILParser::performTypeResolution(TypeRepr *TyR, bool IsSILType, |
1255 | 1257 | if (!GenericSig) |
1256 | 1258 | GenericSig = ContextGenericSig; |
1257 | 1259 |
|
1258 | | - return swift::performTypeResolution(TyR, P.Context, |
1259 | | - /*isSILMode=*/true, IsSILType, |
1260 | | - GenericSig, GenericParams, |
1261 | | - &P.SF); |
| 1260 | + SILTypeResolutionContext SILContext(IsSILType, GenericParams); |
| 1261 | + |
| 1262 | + return swift::performTypeResolution(TyR, P.Context, GenericSig, |
| 1263 | + &SILContext, &P.SF); |
1262 | 1264 | } |
1263 | 1265 |
|
1264 | 1266 | /// Find the top-level ValueDecl or Module given a name. |
@@ -7590,12 +7592,11 @@ static bool parseSILWitnessTableEntry( |
7590 | 7592 | if (TyR.isNull()) |
7591 | 7593 | return true; |
7592 | 7594 |
|
| 7595 | + SILTypeResolutionContext silContext(/*isSILType=*/false, |
| 7596 | + witnessParams); |
7593 | 7597 | auto Ty = |
7594 | 7598 | swift::performTypeResolution(TyR.get(), P.Context, |
7595 | | - /*isSILMode=*/false, |
7596 | | - /*isSILType=*/false, |
7597 | | - witnessSig, |
7598 | | - witnessParams, |
| 7599 | + witnessSig, &silContext, |
7599 | 7600 | &P.SF); |
7600 | 7601 | if (witnessSig) { |
7601 | 7602 | Ty = witnessSig.getGenericEnvironment()->mapTypeIntoContext(Ty); |
@@ -7655,11 +7656,11 @@ static bool parseSILWitnessTableEntry( |
7655 | 7656 | if (TyR.isNull()) |
7656 | 7657 | return true; |
7657 | 7658 |
|
| 7659 | + SILTypeResolutionContext silContext(/*isSILType=*/false, |
| 7660 | + witnessParams); |
7658 | 7661 | auto Ty = |
7659 | 7662 | swift::performTypeResolution(TyR.get(), P.Context, |
7660 | | - /*isSILMode=*/false, |
7661 | | - /*isSILType=*/false, |
7662 | | - witnessSig, witnessParams, |
| 7663 | + witnessSig, &silContext, |
7663 | 7664 | &P.SF); |
7664 | 7665 | if (witnessSig) { |
7665 | 7666 | Ty = witnessSig.getGenericEnvironment()->mapTypeIntoContext(Ty); |
|
0 commit comments