|
15 | 15 | //===----------------------------------------------------------------------===//
|
16 | 16 |
|
17 | 17 | #include "swift/Parse/Parser.h"
|
| 18 | +#include "ParseSIL.h" |
18 | 19 | #include "swift/Parse/CodeCompletionCallbacks.h"
|
19 | 20 | #include "swift/Parse/DelayedParsingCallbacks.h"
|
20 | 21 | #include "swift/Subsystems.h"
|
@@ -200,28 +201,33 @@ bool Parser::parseTopLevel() {
|
200 | 201 | // that SIL bodies can only be at the top level.
|
201 | 202 | if (Tok.is(tok::kw_sil)) {
|
202 | 203 | assert(isInSILMode() && "'sil' should only be a keyword in SIL mode");
|
203 |
| - parseDeclSIL(); |
| 204 | + SIL->parseDeclSIL(*this); |
204 | 205 | } else if (Tok.is(tok::kw_sil_stage)) {
|
205 |
| - assert(isInSILMode() && "'sil' should only be a keyword in SIL mode"); |
206 |
| - parseDeclSILStage(); |
| 206 | + assert(isInSILMode() && "'sil_stage' should only be a keyword in SIL mode"); |
| 207 | + SIL->parseDeclSILStage(*this); |
207 | 208 | } else if (Tok.is(tok::kw_sil_vtable)) {
|
208 |
| - assert(isInSILMode() && "'sil' should only be a keyword in SIL mode"); |
209 |
| - parseSILVTable(); |
| 209 | + assert(isInSILMode() && |
| 210 | + "'sil_vtable' should only be a keyword in SIL mode"); |
| 211 | + SIL->parseSILVTable(*this); |
210 | 212 | } else if (Tok.is(tok::kw_sil_global)) {
|
211 |
| - assert(isInSILMode() && "'sil' should only be a keyword in SIL mode"); |
212 |
| - parseSILGlobal(); |
| 213 | + assert(isInSILMode() && |
| 214 | + "'sil_global' should only be a keyword in SIL mode"); |
| 215 | + SIL->parseSILGlobal(*this); |
213 | 216 | } else if (Tok.is(tok::kw_sil_witness_table)) {
|
214 |
| - assert(isInSILMode() && "'sil' should only be a keyword in SIL mode"); |
215 |
| - parseSILWitnessTable(); |
| 217 | + assert(isInSILMode() && |
| 218 | + "'sil_witness_table' should only be a keyword in SIL mode"); |
| 219 | + SIL->parseSILWitnessTable(*this); |
216 | 220 | } else if (Tok.is(tok::kw_sil_default_witness_table)) {
|
217 |
| - assert(isInSILMode() && "'sil' should only be a keyword in SIL mode"); |
218 |
| - parseSILDefaultWitnessTable(); |
| 221 | + assert(isInSILMode() && |
| 222 | + "'sil_default_witness_table' should only be a keyword in SIL mode"); |
| 223 | + SIL->parseSILDefaultWitnessTable(*this); |
219 | 224 | } else if (Tok.is(tok::kw_sil_coverage_map)) {
|
220 |
| - assert(isInSILMode() && "'sil' should only be a keyword in SIL mode"); |
221 |
| - parseSILCoverageMap(); |
| 225 | + assert(isInSILMode() && |
| 226 | + "'sil_coverage_map' should only be a keyword in SIL mode"); |
| 227 | + SIL->parseSILCoverageMap(*this); |
222 | 228 | } else if (Tok.is(tok::kw_sil_scope)) {
|
223 |
| - assert(isInSILMode() && "'sil' should only be a keyword in SIL mode"); |
224 |
| - parseSILScope(); |
| 229 | + assert(isInSILMode() && "'sil_scope' should only be a keyword in SIL mode"); |
| 230 | + SIL->parseSILScope(*this); |
225 | 231 | } else {
|
226 | 232 | parseBraceItems(Items,
|
227 | 233 | allowTopLevelCode() ? BraceItemListKind::TopLevelCode
|
|
0 commit comments