diff --git a/compiler/ast/ast_types.nim b/compiler/ast/ast_types.nim index 58770d82c61..4bba6e9b78a 100644 --- a/compiler/ast/ast_types.nim +++ b/compiler/ast/ast_types.nim @@ -433,7 +433,6 @@ const sfNoForward* = sfRegister ## forward declarations are not required (per module) sfExperimental* = sfOverriden ## module uses the .experimental switch - sfGoto* = sfOverriden ## var is used for 'goto' code generation sfWrittenTo* = sfBorrow ## param is assigned to sfEscapes* = sfProcvar ## param escapes sfBase* = sfDiscriminant diff --git a/compiler/ast/report_enums.nim b/compiler/ast/report_enums.nim index 9c8a2956ebd..6889e5befcf 100644 --- a/compiler/ast/report_enums.nim +++ b/compiler/ast/report_enums.nim @@ -630,9 +630,7 @@ type # Codegen rsemRttiRequestForIncompleteObject rsemExpectedNimcallProc - rsemDisallowedRangeForComputedGoto rsemExpectedParameterForJsPattern - rsemExpectedLiteralForGoto rsemRequiresDeepCopyEnabled rsemDisallowedOfForPureObjects rsemCannotCodegenCompiletimeProc diff --git a/compiler/backend/ccgstmts.nim b/compiler/backend/ccgstmts.nim index 81dbebafc39..7e49197cea6 100644 --- a/compiler/backend/ccgstmts.nim +++ b/compiler/backend/ccgstmts.nim @@ -62,24 +62,11 @@ proc endBlock(p: BProc) = blockEnd.addf("}$n", []) endBlock(p, blockEnd) -proc genGotoVar(p: BProc; value: CgNode) = - case value.kind - of cnkIntLit, cnkUIntLit: - lineF(p, cpsStmts, "goto NIMSTATE_$#;$n", [value.intVal.rope]) - else: - localReport(p.config, value.info, reportSem rsemExpectedLiteralForGoto) - proc genBracedInit(p: BProc, n: CgNode; optionalType: PType): Rope proc genSingleVar(p: BProc, vn, value: CgNode) = ## Generates and emits the C code for the definition statement of a local. let v = vn.local - - if sfGoto in p.body[v].flags: - # translate 'var state {.goto.} = X' into 'goto LX': - genGotoVar(p, value) - return - assignLocalVar(p, vn) # default-initialize the local if no initial value is supplied. Automatic # initialization is also ommitted when the `value` expression is a @@ -108,20 +95,6 @@ proc genIf(p: BProc, n: CgNode) = lineF(p, cpsStmts, "if ($1)$n", [rdLoc(a)]) startBlock(p) -proc genGotoForCase(p: BProc; caseStmt: CgNode) = - for i in 1..